summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-14 22:24:27 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-14 22:24:27 +0200
commita685624d27a99a4d7ee9d607fcf2ccbc85eb7fc7 (patch)
tree4d3d692b74c3358d61640b84d4f3337d1456b94a /app
parent753ecbdcecfacfaea9157267db4151d1b68e555a (diff)
downloadgitlab-ce-a685624d27a99a4d7ee9d607fcf2ccbc85eb7fc7.tar.gz
Merge wiki, wall & snippets under one tab - writeboards
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/sections/notes.scss2
-rw-r--r--app/helpers/tab_helper.rb12
-rw-r--r--app/views/hooks/index.html.haml2
-rw-r--r--app/views/layouts/project_resource.html.haml10
-rw-r--r--app/views/projects/files.html.haml41
-rw-r--r--app/views/projects/wall.html.haml8
-rw-r--r--app/views/snippets/edit.html.haml1
-rw-r--r--app/views/snippets/index.html.haml42
-rw-r--r--app/views/snippets/new.html.haml1
-rw-r--r--app/views/snippets/show.html.haml2
-rw-r--r--app/views/wikis/edit.html.haml2
-rw-r--r--app/views/wikis/pages.html.haml44
-rw-r--r--app/views/wikis/show.html.haml46
-rw-r--r--app/views/writeboards/_nav.html.haml14
14 files changed, 128 insertions, 99 deletions
diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss
index 1b4280f4974..98c4fd3b81e 100644
--- a/app/assets/stylesheets/sections/notes.scss
+++ b/app/assets/stylesheets/sections/notes.scss
@@ -284,6 +284,6 @@ ul.notes {
margin-top: 8px;
margin-left: 15px;
@extend .pull-left;
- @extend .span4;
+ width: 35%;
}
}
diff --git a/app/helpers/tab_helper.rb b/app/helpers/tab_helper.rb
index 063a210cb2c..3465bf456f1 100644
--- a/app/helpers/tab_helper.rb
+++ b/app/helpers/tab_helper.rb
@@ -73,11 +73,19 @@ module TabHelper
end
def project_tab_class
- [:files, :edit].each do |action|
+ return "active" if current_page?(controller: "projects", action: :edit, id: @project)
+
+ if ['services', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
+ "active"
+ end
+ end
+
+ def project_writeboards_tab_class
+ [:files, :wall].each do |action|
return "active" if current_page?(controller: "projects", action: action, id: @project)
end
- if ['snippets', 'services', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
+ if ['wikis', 'snippets'].include? controller.controller_name
"active"
end
end
diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml
index 88a5a7dcffe..808a348133c 100644
--- a/app/views/hooks/index.html.haml
+++ b/app/views/hooks/index.html.haml
@@ -18,7 +18,7 @@
.input
= f.text_field :url, class: "text_field xxlarge"
&nbsp;
- = f.submit "Add Web Hook", class: "btn btn-primary"
+ = f.submit "Add Web Hook", class: "btn btn-create"
%hr
-if @hooks.any?
diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/project_resource.html.haml
index 46d06960723..9ccb60d52a3 100644
--- a/app/views/layouts/project_resource.html.haml
+++ b/app/views/layouts/project_resource.html.haml
@@ -35,17 +35,11 @@
Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count
- - if @project.wall_enabled
- = nav_link(path: 'projects#wall') do
- = link_to 'Wall', wall_project_path(@project)
-
- - if @project.wiki_enabled
- = nav_link(controller: :wikis) do
- = link_to 'Wiki', project_wiki_path(@project, :index)
+ = nav_link(html_options: {class: "#{project_writeboards_tab_class}"}) do
+ = link_to 'Writeboards', project_wiki_path(@project, :index)
- if can? current_user, :admin_project, @project
= nav_link(html_options: {class: "#{project_tab_class}"}) do
= link_to edit_project_path(@project), class: "stat-tab tab " do
Settings
-
.content= yield
diff --git a/app/views/projects/files.html.haml b/app/views/projects/files.html.haml
index 36948eff658..b483681c055 100644
--- a/app/views/projects/files.html.haml
+++ b/app/views/projects/files.html.haml
@@ -1,22 +1,25 @@
-= render "project_head"
-- unless @notes.empty?
- %table
- %thead
- %tr
- %th File name
- %th
+.row
+ .span3
+ = render 'writeboards/nav'
+ .span9
+ - unless @notes.empty?
+ %table
+ %thead
+ %tr
+ %th File name
+ %th
- - @notes.each do |note|
- %tr
- %td
- = link_to note.attachment.secure_url, target: "_blank" do
- = image_tag gravatar_icon(note.author_email), class: "avatar s24"
- = note.attachment_identifier
- %td
- Added
- = time_ago_in_words(note.created_at)
- ago
-- else
- %p.slead All files attached to project wall, issues etc will be displayed here
+ - @notes.each do |note|
+ %tr
+ %td
+ = link_to note.attachment.secure_url, target: "_blank" do
+ = image_tag gravatar_icon(note.author_email), class: "avatar s24"
+ = note.attachment_identifier
+ %td
+ Added
+ = time_ago_in_words(note.created_at)
+ ago
+ - else
+ %p.slead All files attached to project wall, issues etc will be displayed here
diff --git a/app/views/projects/wall.html.haml b/app/views/projects/wall.html.haml
index 82b565def43..33af9248469 100644
--- a/app/views/projects/wall.html.haml
+++ b/app/views/projects/wall.html.haml
@@ -1,2 +1,6 @@
-%div.wall_page
- = render "notes/reversed_notes_with_form"
+.row
+ .span3
+ = render 'writeboards/nav'
+ .span9
+ %div.wall_page
+ = render "notes/reversed_notes_with_form"
diff --git a/app/views/snippets/edit.html.haml b/app/views/snippets/edit.html.haml
index 8afaf46e95d..f81c0b8bc64 100644
--- a/app/views/snippets/edit.html.haml
+++ b/app/views/snippets/edit.html.haml
@@ -1,2 +1 @@
-= render "projects/project_head"
= render "snippets/form"
diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml
index 28a533d238f..e2b7594395b 100644
--- a/app/views/snippets/index.html.haml
+++ b/app/views/snippets/index.html.haml
@@ -1,21 +1,23 @@
-= render "projects/project_head"
+.row
+ .span3
+ = render 'writeboards/nav'
+ .span9
+ %h3.page_title
+ Snippets
+ %small share code pastes with others out of git repository
-%h3.page_title
- Snippets
- %small share code pastes with others out of git repository
-
- - if can? current_user, :write_snippet, @project
- = link_to new_project_snippet_path(@project), class: "btn btn-small add_new pull-right", title: "New Snippet" do
- Add new snippet
-%br
-%table
- %thead
- %tr
- %th Title
- %th File Name
- %th Expires At
- = render @snippets
- - if @snippets.empty?
- %tr
- %td{colspan: 3}
- %h3.nothing_here_message Nothing here.
+ - if can? current_user, :write_snippet, @project
+ = link_to new_project_snippet_path(@project), class: "btn btn-small add_new pull-right", title: "New Snippet" do
+ Add new snippet
+ %br
+ %table
+ %thead
+ %tr
+ %th Title
+ %th File Name
+ %th Expires At
+ = render @snippets
+ - if @snippets.empty?
+ %tr
+ %td{colspan: 3}
+ %h3.nothing_here_message Nothing here.
diff --git a/app/views/snippets/new.html.haml b/app/views/snippets/new.html.haml
index 8afaf46e95d..f81c0b8bc64 100644
--- a/app/views/snippets/new.html.haml
+++ b/app/views/snippets/new.html.haml
@@ -1,2 +1 @@
-= render "projects/project_head"
= render "snippets/form"
diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml
index 64b7d9330e1..12534edf8ba 100644
--- a/app/views/snippets/show.html.haml
+++ b/app/views/snippets/show.html.haml
@@ -1,5 +1,3 @@
-= render "projects/project_head"
-
%h3.page_title
= @snippet.title
%small= @snippet.file_name
diff --git a/app/views/wikis/edit.html.haml b/app/views/wikis/edit.html.haml
index 9e221aba47d..0f879334d9c 100644
--- a/app/views/wikis/edit.html.haml
+++ b/app/views/wikis/edit.html.haml
@@ -5,4 +5,4 @@
.pull-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 btn-small btn-remove" do
- Delete this page \ No newline at end of file
+ Delete this page
diff --git a/app/views/wikis/pages.html.haml b/app/views/wikis/pages.html.haml
index 2e0f091ce72..d3215f83916 100644
--- a/app/views/wikis/pages.html.haml
+++ b/app/views/wikis/pages.html.haml
@@ -1,20 +1,24 @@
-%h3.page_title All Pages
-%br
-%table
- %thead
- %tr
- %th Title
- %th Slug
- %th Last updated
- %th Updated by
- %tbody
- - @wiki_pages.each do |wiki_page|
- %tr
- %td
- %strong= link_to wiki_page.title, project_wiki_path(@project, wiki_page)
- %td= wiki_page.slug
- %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)
+.row
+ .span3
+ = render 'writeboards/nav'
+ .span9
+ %h3.page_title All Pages
+ %br
+ %table
+ %thead
+ %tr
+ %th Title
+ %th Slug
+ %th Last updated
+ %th Updated by
+ %tbody
+ - @wiki_pages.each do |wiki_page|
+ %tr
+ %td
+ %strong= link_to wiki_page.title, project_wiki_path(@project, wiki_page)
+ %td= wiki_page.slug
+ %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 7ff8b5cc01e..694b046a102 100644
--- a/app/views/wikis/show.html.haml
+++ b/app/views/wikis/show.html.haml
@@ -1,23 +1,27 @@
-%h3.page_title
- = @wiki.title
- %span.pull-right
- = link_to pages_project_wikis_path(@project), class: "btn btn-small grouped" do
- Pages
- - if can? current_user, :write_wiki, @project
- = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do
- History
- = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do
- %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)}.
+.row
+ .span3
+ = render 'writeboards/nav'
+ .span9
+ %h3.page_title
+ = @wiki.title
+ %span.pull-right
+ = link_to pages_project_wikis_path(@project), class: "btn btn-small grouped" do
+ Pages
+ - if can? current_user, :write_wiki, @project
+ = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do
+ History
+ = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do
+ %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
+ .file_holder
+ .file_content.wiki
+ = preserve do
+ = markdown @wiki.content
-%p.time Last edited by #{link_to_member @project, @wiki.user}, #{time_ago_in_words @wiki.created_at} ago
+ %p.time Last edited by #{link_to_member @project, @wiki.user}, #{time_ago_in_words @wiki.created_at} ago
diff --git a/app/views/writeboards/_nav.html.haml b/app/views/writeboards/_nav.html.haml
new file mode 100644
index 00000000000..f5111778d8b
--- /dev/null
+++ b/app/views/writeboards/_nav.html.haml
@@ -0,0 +1,14 @@
+%ul.nav.nav-pills.nav-stacked
+ - if @project.wiki_enabled
+ = nav_link(controller: 'wikis') do
+ = link_to 'Wiki', project_wiki_path(@project, :index)
+
+ - if @project.wall_enabled
+ = nav_link(path: 'projects#wall') do
+ = link_to 'Wall', wall_project_path(@project)
+
+ = nav_link(path: 'projects#files') do
+ = link_to 'Attachments', files_project_path(@project), class: "files-tab tab"
+
+ = nav_link(controller: :snippets) do
+ = link_to 'Snippets', project_snippets_path(@project), class: "snippets-tab tab"