summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2013-01-15 00:53:00 +0100
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2013-01-15 00:53:00 +0100
commitbda7fe38d0b0e39a408c4eb44374a330c24c3a49 (patch)
tree232212b8827c5be94da672287e3209c8e8f9f18a /app/views
parentd28176b132bdc74055f31e2d62665d5d74ebacb4 (diff)
parentd8e697ac68d758d4f451594047056c459f546bf7 (diff)
downloadgitlab-ce-bda7fe38d0b0e39a408c4eb44374a330c24c3a49.tar.gz
Merge branch 'master' into discussions
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin/dashboard/index.html.haml44
-rw-r--r--app/views/admin/logs/show.html.haml16
-rw-r--r--app/views/admin/projects/_form.html.haml7
-rw-r--r--app/views/admin/projects/index.html.haml89
-rw-r--r--app/views/admin/projects/show.html.haml7
-rw-r--r--app/views/blame/show.html.haml31
-rw-r--r--app/views/dashboard/index.html.haml3
-rw-r--r--app/views/dashboard/issues.html.haml4
-rw-r--r--app/views/dashboard/merge_requests.html.haml15
-rw-r--r--app/views/events/_event_last_push.html.haml2
-rw-r--r--app/views/groups/issues.html.haml4
-rw-r--r--app/views/groups/merge_requests.html.haml15
-rw-r--r--app/views/help/index.html.haml2
-rw-r--r--app/views/help/public_area.html.haml16
-rw-r--r--app/views/issues/show.html.haml5
-rw-r--r--app/views/keys/create.js.haml9
-rw-r--r--app/views/keys/new.js.haml11
-rw-r--r--app/views/layouts/_head.html.haml18
-rw-r--r--app/views/layouts/application.html.haml2
-rw-r--r--app/views/layouts/public.html.haml17
-rw-r--r--app/views/public/projects/index.html.haml17
-rw-r--r--app/views/shared/_clone_panel.html.haml1
-rw-r--r--app/views/shared/_merge_requests.html.haml14
-rw-r--r--app/views/wikis/edit.html.haml5
-rw-r--r--app/views/wikis/empty.html.haml4
-rw-r--r--app/views/wikis/history.html.haml21
-rw-r--r--app/views/wikis/pages.html.haml18
-rw-r--r--app/views/wikis/show.html.haml10
28 files changed, 271 insertions, 136 deletions
diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml
index 2e572aaba79..9a5e7edea0f 100644
--- a/app/views/admin/dashboard/index.html.haml
+++ b/app/views/admin/dashboard/index.html.haml
@@ -25,17 +25,51 @@
= link_to 'New User', new_admin_user_path, class: "btn small"
.row
- .span6
- %h3 Latest projects
+ .span4
+ %h4 Latest projects
%hr
- @projects.each do |project|
%p
= link_to project.name_with_namespace, [:admin, project]
- .span6
- %h3 Latest users
+ %span.light.right
+ = time_ago_in_words project.created_at
+ ago
+
+ .span4
+ %h4 Latest users
%hr
- @users.each do |user|
%p
= link_to [:admin, user] do
= user.name
- %small= user.email
+ %span.light.right
+ = time_ago_in_words user.created_at
+ ago
+
+ .span4
+ %h4 Stats
+ %hr
+ %p
+ Issues
+ %span.light.right
+ = Issue.count
+ %p
+ Merge Requests
+ %span.light.right
+ = MergeRequest.count
+ %p
+ Notes
+ %span.light.right
+ = Note.count
+ %p
+ Snippets
+ %span.light.right
+ = Snippet.count
+ %p
+ SSH Keys
+ %span.light.right
+ = Key.count
+ %p
+ Milestones
+ %span.light.right
+ = Milestone.count
diff --git a/app/views/admin/logs/show.html.haml b/app/views/admin/logs/show.html.haml
index 25644d6321a..c8be2ffa43c 100644
--- a/app/views/admin/logs/show.html.haml
+++ b/app/views/admin/logs/show.html.haml
@@ -5,6 +5,8 @@
= link_to "application.log", "#application", 'data-toggle' => 'tab'
%li
= link_to "production.log", "#production", 'data-toggle' => 'tab'
+ %li
+ = link_to "sidekiq.log", "#sidekiq", 'data-toggle' => 'tab'
%p.light To prevent perfomance issues admin logs output the last 2000 lines
.tab-content
@@ -50,3 +52,17 @@
- Gitlab::Logger.read_latest_for('production.log').each do |line|
%li
%p= line
+ .tab-pane#sidekiq
+ .file_holder#README
+ .file_title
+ %i.icon-file
+ sidekiq.log
+ .right
+ = link_to '#', class: 'log-bottom' do
+ %i.icon-arrow-down
+ Scroll down
+ .file_content.logs
+ %ol
+ - Gitlab::Logger.read_latest_for('sidekiq.log').each do |line|
+ %li
+ %p= line
diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml
index 36c0c655cae..0c7cf68ef43 100644
--- a/app/views/admin/projects/_form.html.haml
+++ b/app/views/admin/projects/_form.html.haml
@@ -44,6 +44,13 @@
.input= f.check_box :wiki_enabled
%fieldset.features
+ %legend Public mode:
+ .clearfix
+ = f.label :public do
+ %span Allow public http clone
+ .input= f.check_box :public
+
+ %fieldset.features
%legend Transfer:
.control-group
= f.label :namespace_id do
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index 1f5b31eca5f..a3c806bc913 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -1,38 +1,61 @@
%h3.page_title
- Projects (#{Project.count})
+ Projects
= link_to 'New Project', new_project_path, class: "btn small right"
-%br
-= form_tag admin_projects_path, method: :get, class: 'form-inline' do
- = select_tag :namespace_id, namespaces_options(params[:namespace_id], :all), class: "chosen xlarge", prompt: "Project namespace"
- = text_field_tag :name, params[:name], class: "xlarge"
- = submit_tag "Search", class: "btn submit primary"
-%table
- %thead
- %tr
- %th
- Name
- %i.icon-sort-down
- %th Path
- %th Team Members
- %th Owner
- %th Last Commit
- %th Edit
- %th.cred Danger Zone!
+%hr
- - @projects.each do |project|
- %tr
- %td
- = link_to project.name_with_namespace, [:admin, project]
- %td
- %span.monospace= project.path_with_namespace + ".git"
- %td= project.users_projects.count
- %td
- - if project.owner
- = link_to project.owner.name, [:admin, project.owner]
+.row
+ .span4
+ .admin-filter
+ = form_tag admin_projects_path, method: :get, class: 'form-inline' do
+ .control-group
+ = label_tag :name, 'Name:', class: 'control-label'
+ .controls
+ = text_field_tag :name, params[:name], class: "span2"
+
+ .control-group
+ = label_tag :namespace_id, 'Namespace:', class: 'control-label'
+ .controls
+ = select_tag :namespace_id, namespaces_options(params[:namespace_id], :all), class: "chosen span2", prompt: "Any"
+ .control-group
+ = label_tag :public_only, 'Public Only', class: 'control-label'
+ .controls
+ = check_box_tag :public_only, 1, params[:public_only]
+ .control-group
+ = label_tag :with_push, 'Not empty', class: 'control-label'
+ .controls
+ = check_box_tag :with_push, 1, params[:with_push]
+ &nbsp;
+ %span.light Projects with push events
+ .control-group
+ = label_tag :abandoned, 'Abandoned', class: 'control-label'
+ .controls
+ = check_box_tag :abandoned, 1, params[:abandoned]
+ &nbsp;
+ %span.light No activity over 6 month
+
+
+
+ .form-actions
+ = submit_tag "Search", class: "btn submit primary"
+ = link_to "Reset", admin_projects_path, class: "btn"
+ .span8
+ .ui-box
+ %h5.title
+ Projects (#{@projects.total_count})
+ %ul.well-list
+ - @projects.each do |project|
+ %li
+ - if project.public
+ %i.icon-unlock.cred
+ - else
+ %i.icon-lock.cgreen
+ = link_to project.name_with_namespace, [:admin, project]
+ .right
+ = link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small"
+ = link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger"
+ - if @projects.blank?
+ %p.nothing_here_message 0 projects matches
- else
- (deleted)
- %td= last_commit(project)
- %td= link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small"
- %td.bgred= link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger"
-= paginate @projects, theme: "admin"
+ %li.bottom
+ = paginate @projects, theme: "gitlab"
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index 5a745f58fe3..8e0d82328df 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -77,6 +77,13 @@
SSH:
%td
= link_to @project.ssh_url_to_repo
+ - if @project.public
+ %tr.bgred
+ %td
+ %b
+ Public Read-Only Code access:
+ %td
+ = check_box_tag 'public', nil, @project.public
- if @repository
%table.zebra-striped
diff --git a/app/views/blame/show.html.haml b/app/views/blame/show.html.haml
index c5192c53cc3..36d81e6af38 100644
--- a/app/views/blame/show.html.haml
+++ b/app/views/blame/show.html.haml
@@ -20,16 +20,27 @@
%span.options= render "tree/blob_actions"
.file_content.blame
%table
+ - current_line = 1
- @blame.each do |commit, lines|
- - commit = Commit.new(commit)
- - commit = CommitDecorator.decorate(commit)
+ - commit = CommitDecorator.decorate(Commit.new(commit))
%tr
- %td.author= commit.author_link avatar: true, size: 16
- %td.blame_commit
- &nbsp;
- %code= link_to commit.short_id, project_commit_path(@project, commit)
- = link_to_gfm truncate(commit.title, length: 30), project_commit_path(@project, commit), class: "row_title" rescue "--broken encoding"
+ %td.blame-commit
+ %span.commit
+ = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id"
+ &nbsp;
+ = commit.author_link avatar: true, size: 16
+ &nbsp;
+ = link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title"
+ %td.lines.blame-numbers
+ %pre
+ - if lines.empty?
+ = current_line
+ - current_line += 1
+ - else
+ - lines.each do |line|
+ = current_line
+ - current_line += 1
%td.lines
- = preserve do
- %pre
- = lines.join("\n")
+ %pre
+ - lines.each do |line|
+ = line
diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml
index abbe3101fc3..1a66ba4fb37 100644
--- a/app/views/dashboard/index.html.haml
+++ b/app/views/dashboard/index.html.haml
@@ -7,3 +7,6 @@
- else
= render "zero_authorized_projects"
+
+:javascript
+ dashboardPage();
diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml
index 68e3b3dcaf5..307d0d85ea3 100644
--- a/app/views/dashboard/issues.html.haml
+++ b/app/views/dashboard/issues.html.haml
@@ -12,9 +12,9 @@
- if @issues.any?
- @issues.group_by(&:project).each do |group|
%div.ui-box
- - @project = group[0]
+ - project = group[0]
%h5.title
- = link_to_project @project
+ = link_to_project project
%ul.well-list.issues_table
- group[1].each do |issue|
= render(partial: 'issues/show', locals: {issue: issue})
diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml
index c5245da731a..0c4d6e0aadf 100644
--- a/app/views/dashboard/merge_requests.html.haml
+++ b/app/views/dashboard/merge_requests.html.haml
@@ -8,17 +8,4 @@
.span3
= render 'filter', entity: 'merge_request'
.span9
- - if @merge_requests.any?
- - @merge_requests.group_by(&:project).each do |group|
- .ui-box
- - @project = group[0]
- %h5.title
- = link_to_project @project
- %ul.well-list
- - group[1].each do |merge_request|
- = render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
- %hr
- = paginate @merge_requests, theme: "gitlab"
-
- - else
- %h3.nothing_here_message Nothing to show here
+ = render 'shared/merge_requests'
diff --git a/app/views/events/_event_last_push.html.haml b/app/views/events/_event_last_push.html.haml
index b2376019c8e..2c2f270cf6c 100644
--- a/app/views/events/_event_last_push.html.haml
+++ b/app/views/events/_event_last_push.html.haml
@@ -1,7 +1,5 @@
- if show_last_push_widget?(event)
.event_lp
- = image_tag "event_push.png"
- &nbsp;
%span You pushed to
= link_to project_commits_path(event.project, event.ref_name) do
%strong= truncate(event.ref_name, length: 28)
diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml
index ffca2dc75ea..9e8642f3b2c 100644
--- a/app/views/groups/issues.html.haml
+++ b/app/views/groups/issues.html.haml
@@ -11,9 +11,9 @@
- if @issues.any?
- @issues.group_by(&:project).each do |group|
%div.ui-box
- - @project = group[0]
+ - project = group[0]
%h5.title
- = link_to_project @project
+ = link_to_project project
%ul.well-list.issues_table
- group[1].each do |issue|
= render(partial: 'issues/show', locals: {issue: issue})
diff --git a/app/views/groups/merge_requests.html.haml b/app/views/groups/merge_requests.html.haml
index c5245da731a..0c4d6e0aadf 100644
--- a/app/views/groups/merge_requests.html.haml
+++ b/app/views/groups/merge_requests.html.haml
@@ -8,17 +8,4 @@
.span3
= render 'filter', entity: 'merge_request'
.span9
- - if @merge_requests.any?
- - @merge_requests.group_by(&:project).each do |group|
- .ui-box
- - @project = group[0]
- %h5.title
- = link_to_project @project
- %ul.well-list
- - group[1].each do |merge_request|
- = render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
- %hr
- = paginate @merge_requests, theme: "gitlab"
-
- - else
- %h3.nothing_here_message Nothing to show here
+ = render 'shared/merge_requests'
diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml
index dc22b672cb7..cadf6c9d6e7 100644
--- a/app/views/help/index.html.haml
+++ b/app/views/help/index.html.haml
@@ -47,3 +47,5 @@
%li
%span= link_to "System Hooks", help_system_hooks_path
+ %li
+ %span= link_to "Public Area", help_public_area_path
diff --git a/app/views/help/public_area.html.haml b/app/views/help/public_area.html.haml
new file mode 100644
index 00000000000..a7a86e92396
--- /dev/null
+++ b/app/views/help/public_area.html.haml
@@ -0,0 +1,16 @@
+%h3.page_title Public Area
+.back_link
+ = link_to help_path do
+ &larr; to index
+%hr
+
+%p
+ Public area - is part of application with public access.
+ %br
+ It used to list all projects with public read-only access.
+ %br
+ If you enable public http access to the project - it will appears there
+ %br
+
+ Follow #{link_to "this link", public_root_path} to visit Public Area
+
diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml
index 55fc0aee0df..6bf78929699 100644
--- a/app/views/issues/show.html.haml
+++ b/app/views/issues/show.html.haml
@@ -51,8 +51,9 @@
- if @issue.description.present?
.ui-box-bottom
- = preserve do
- = markdown @issue.description
+ .wiki
+ = preserve do
+ = markdown @issue.description
.voting_notes#notes= render "notes/notes_with_form"
diff --git a/app/views/keys/create.js.haml b/app/views/keys/create.js.haml
deleted file mode 100644
index 1dccf6fdb91..00000000000
--- a/app/views/keys/create.js.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-- if @key.valid?
- :plain
- $("#new_key_dialog").dialog("close");
- $("#keys-table .data").append("#{escape_javascript(render(partial: 'show', locals: {key: @key}))}");
- $("#no_ssh_key_defined").hide();
-- else
- :plain
- $("#new_key_dialog").empty();
- $("#new_key_dialog").append("#{escape_javascript(render('form'))}");
diff --git a/app/views/keys/new.js.haml b/app/views/keys/new.js.haml
deleted file mode 100644
index 86e9db030c5..00000000000
--- a/app/views/keys/new.js.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-:plain
- var new_key_dialog = $("<div id='new_key_dialog'></div>");
- new_key_dialog.html("#{escape_javascript(render('form'))}");
- $(new_key_dialog).dialog({
- width: 350,
- resizable: false,
- draggable: false,
- title: "Add new public key",
- close: function(event, ui) { $("#new_key_dialog").remove();},
- modal: true
- });
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index 9d035f0e012..4b4f5da3324 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -6,12 +6,14 @@
= favicon_link_tag 'favicon.ico'
= stylesheet_link_tag "application"
= javascript_include_tag "application"
- -# Atom feed
- - if controller_name == 'projects' && action_name == 'index'
- = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed"
- - if @project && !@project.new_record?
- - if current_controller?(:tree, :commits)
- = auto_discovery_link_tag(:atom, project_commits_url(@project, @ref, format: :atom, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}")
- - if current_controller?(:issues)
- = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
= csrf_meta_tags
+
+ -# Atom feed
+ - if current_user
+ - if controller_name == 'projects' && action_name == 'index'
+ = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed"
+ - if @project && !@project.new_record?
+ - if current_controller?(:tree, :commits)
+ = auto_discovery_link_tag(:atom, project_commits_url(@project, @ref, format: :atom, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}")
+ - if current_controller?(:issues)
+ = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index a197de38749..88da5c98c78 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -18,7 +18,7 @@
%span.count= current_user.cared_merge_requests.opened.count
= nav_link(path: 'search#show') do
= link_to "Search", search_path
- = nav_link(path: 'help#index') do
+ = nav_link(controller: :help) do
= link_to "Help", help_path
.content= yield
diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml
new file mode 100644
index 00000000000..864b854c757
--- /dev/null
+++ b/app/views/layouts/public.html.haml
@@ -0,0 +1,17 @@
+!!! 5
+%html{ lang: "en"}
+ = render "layouts/head", title: "Public Area"
+ %body{class: "#{app_theme} application"}
+ %header.navbar.navbar-static-top.navbar-gitlab
+ .navbar-inner
+ .container
+ %div.app_logo
+ %span.separator
+ = link_to root_path, class: "home" do
+ %h1 GITLAB
+ %span.separator
+ %h1.project_name Public Area
+ .container
+ .content
+ .prepend-top-20
+ = yield
diff --git a/app/views/public/projects/index.html.haml b/app/views/public/projects/index.html.haml
new file mode 100644
index 00000000000..f60a0898821
--- /dev/null
+++ b/app/views/public/projects/index.html.haml
@@ -0,0 +1,17 @@
+%h3.page_title
+ Projects
+ %small Read-Only Access
+%hr
+
+%ul.unstyled
+ - @projects.each do |project|
+ %li.clearfix
+ %h5
+ %i.icon-star.cgreen
+ = project.name_with_namespace
+ .right
+ %span.monospace.tiny
+ git clone #{project.http_url_to_repo}
+
+
+= paginate @projects, theme: "admin"
diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml
index e283d9b3085..7b5de4a6274 100644
--- a/app/views/shared/_clone_panel.html.haml
+++ b/app/views/shared/_clone_panel.html.haml
@@ -1,4 +1,5 @@
.input-prepend.project_clone_holder
%button{class: "btn active", :"data-clone" => @project.ssh_url_to_repo} SSH
%button{class: "btn", :"data-clone" => @project.http_url_to_repo}= Gitlab.config.gitlab.protocol.upcase
+
= text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select input-xxlarge"
diff --git a/app/views/shared/_merge_requests.html.haml b/app/views/shared/_merge_requests.html.haml
new file mode 100644
index 00000000000..85391a34316
--- /dev/null
+++ b/app/views/shared/_merge_requests.html.haml
@@ -0,0 +1,14 @@
+- if @merge_requests.any?
+ - @merge_requests.group_by(&:project).each do |group|
+ .ui-box
+ - project = group[0]
+ %h5.title
+ = link_to_project project
+ %ul.well-list
+ - group[1].each do |merge_request|
+ = render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
+ %hr
+ = paginate @merge_requests, theme: "gitlab"
+
+- else
+ %h3.nothing_here_message Nothing to show here
diff --git a/app/views/wikis/edit.html.haml b/app/views/wikis/edit.html.haml
index 27d2a8f915f..8f6b457f22a 100644
--- a/app/views/wikis/edit.html.haml
+++ b/app/views/wikis/edit.html.haml
@@ -1,3 +1,8 @@
%h3.page_title Editing page
%hr
= render 'form'
+
+.right
+ - if can? current_user, :admin_wiki, @project
+ = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete, class: "btn small danger" do
+ Delete this page \ No newline at end of file
diff --git a/app/views/wikis/empty.html.haml b/app/views/wikis/empty.html.haml
index 32b1c9258c5..08b59f0328b 100644
--- a/app/views/wikis/empty.html.haml
+++ b/app/views/wikis/empty.html.haml
@@ -1,4 +1,4 @@
%h3.page_title Empty page
%hr
-.alert-message.block-message.warning
- %span You are not allowed to create wiki pages
+.error_message
+ You are not allowed to create wiki pages
diff --git a/app/views/wikis/history.html.haml b/app/views/wikis/history.html.haml
index 0a81817c5e7..18df8e1d71b 100644
--- a/app/views/wikis/history.html.haml
+++ b/app/views/wikis/history.html.haml
@@ -1,20 +1,23 @@
%h3.page_title
%span.cgray History for
- = @wikis.last.title
+ = @wiki_pages.first.title
%br
%table
%thead
%tr
- %th #
- %th last edit
- %th created by
+ %th Page version
+ %th Last updated
+ %th Updated by
%tbody
- - @wikis.each_with_index do |wiki_page, i|
+ - @wiki_pages.each_with_index do |wiki_page, i|
%tr
- %td= i + 1
%td
- = link_to wiki_page.created_at.to_s(:short), project_wiki_path(@project, wiki_page, old_page_id: wiki_page.id)
+ %strong
+ = link_to project_wiki_path(@project, wiki_page, version_id: wiki_page.id) do
+ Version
+ = @wiki_pages.count - i
+ %td
+ = wiki_page.created_at.to_s(:short)
(#{time_ago_in_words(wiki_page.created_at)}
ago)
- %td= wiki_page.user.name
-
+ %td= link_to_member(@project, wiki_page.user)
diff --git a/app/views/wikis/pages.html.haml b/app/views/wikis/pages.html.haml
index 7421d8f9675..2e0f091ce72 100644
--- a/app/views/wikis/pages.html.haml
+++ b/app/views/wikis/pages.html.haml
@@ -4,15 +4,17 @@
%thead
%tr
%th Title
- %th slug
- %th created by
+ %th Slug
+ %th Last updated
+ %th Updated by
%tbody
- - @wikis.each_with_index do |wiki_page, i|
+ - @wiki_pages.each do |wiki_page|
%tr
%td
- = link_to wiki_page.title, project_wiki_path(@project, wiki_page, old_page_id: wiki_page.id)
- (#{time_ago_in_words(wiki_page.created_at)}
- ago)
+ %strong= link_to wiki_page.title, project_wiki_path(@project, wiki_page)
%td= wiki_page.slug
- %td= wiki_page.user.name
-
+ %td
+ = wiki_page.created_at.to_s(:short) do
+ (#{time_ago_in_words(wiki_page.created_at)}
+ ago)
+ %td= link_to_member(@project, wiki_page.user)
diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml
index c3074539054..d3bd58bbeec 100644
--- a/app/views/wikis/show.html.haml
+++ b/app/views/wikis/show.html.haml
@@ -10,12 +10,14 @@
%i.icon-edit
Edit
%br
+- if @wiki != @most_recent_wiki
+ .warning_message
+ This is an old version of this page.
+ You can view the #{link_to "most recent version", project_wiki_path(@project, @wiki)} or browse the #{link_to "history", history_project_wiki_path(@project, @wiki)}.
+
.file_holder
.file_content.wiki
= preserve do
= markdown @wiki.content
-%p.time Last edited by #{@wiki.user.name}, #{time_ago_in_words @wiki.created_at} ago
-- if can? current_user, :admin_wiki, @project
- = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete do
- Delete this page
+%p.time Last edited by #{link_to_member @project, @wiki.user}, #{time_ago_in_words @wiki.created_at} ago