Commit ae06a0aab8be3ea3bad8066d2e19c12d86b85ad8
1 parent
6956f1f6
Exists in
master
and in
4 other branches
Return own tab for wall. Improve Wiki nav. Removed attachments listing page
Showing
12 changed files
with
25 additions
and
62 deletions
Show diff stats
app/contexts/projects/create_context.rb
app/controllers/projects_controller.rb
app/helpers/tab_helper.rb
| ... | ... | @@ -80,16 +80,6 @@ module TabHelper |
| 80 | 80 | end |
| 81 | 81 | end |
| 82 | 82 | |
| 83 | - def project_wiki_tab_class | |
| 84 | - [:files, :wall].each do |action| | |
| 85 | - return "active" if current_page?(controller: "projects", action: action, id: @project) | |
| 86 | - end | |
| 87 | - | |
| 88 | - if ['wikis', 'snippets'].include? controller.controller_name | |
| 89 | - "active" | |
| 90 | - end | |
| 91 | - end | |
| 92 | - | |
| 93 | 83 | def branches_tab_class |
| 94 | 84 | if current_page?(branches_project_repository_path(@project)) || |
| 95 | 85 | current_controller?(:protected_branches) || | ... | ... |
app/views/layouts/project_resource.html.haml
| ... | ... | @@ -35,11 +35,17 @@ |
| 35 | 35 | Merge Requests |
| 36 | 36 | %span.count.merge_counter= @project.merge_requests.opened.count |
| 37 | 37 | |
| 38 | - = nav_link(html_options: {class: "#{project_wiki_tab_class}"}) do | |
| 39 | - = link_to 'Wiki', project_wiki_path(@project, :home) | |
| 38 | + - if @project.wiki_enabled | |
| 39 | + = nav_link(controller: :wikis) do | |
| 40 | + = link_to 'Wiki', project_wiki_path(@project, :home) | |
| 41 | + | |
| 42 | + - if @project.wall_enabled | |
| 43 | + = nav_link(path: 'projects#wall') do | |
| 44 | + = link_to 'Wall', wall_project_path(@project) | |
| 40 | 45 | |
| 41 | 46 | - if can? current_user, :admin_project, @project |
| 42 | 47 | = nav_link(html_options: {class: "#{project_tab_class}"}) do |
| 43 | 48 | = link_to edit_project_path(@project), class: "stat-tab tab " do |
| 44 | 49 | Settings |
| 50 | + | |
| 45 | 51 | .content= yield | ... | ... |
app/views/projects/files.html.haml
| ... | ... | @@ -1,22 +0,0 @@ |
| 1 | -= render 'wikis/nav' | |
| 2 | -- unless @notes.empty? | |
| 3 | - %table | |
| 4 | - %thead | |
| 5 | - %tr | |
| 6 | - %th File name | |
| 7 | - %th | |
| 8 | - | |
| 9 | - - @notes.each do |note| | |
| 10 | - %tr | |
| 11 | - %td | |
| 12 | - = link_to note.attachment.secure_url, target: "_blank" do | |
| 13 | - = image_tag gravatar_icon(note.author_email), class: "avatar s24" | |
| 14 | - = note.attachment_identifier | |
| 15 | - %td | |
| 16 | - Added | |
| 17 | - = time_ago_in_words(note.created_at) | |
| 18 | - ago | |
| 19 | -- else | |
| 20 | - %p.slead All files attached to project wall, issues etc will be displayed here | |
| 21 | - | |
| 22 | - |
app/views/projects/wall.html.haml
app/views/snippets/index.html.haml
app/views/wikis/_main_links.html.haml
| 1 | 1 | %span.pull-right |
| 2 | - = link_to project_wiki_path(@project, :home), class: "btn btn-small grouped" do | |
| 3 | - Home | |
| 4 | - = link_to pages_project_wikis_path(@project), class: "btn btn-small grouped" do | |
| 5 | - Pages | |
| 6 | 2 | - if (@wiki && @wiki.persisted?) |
| 7 | 3 | = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do |
| 8 | - History | |
| 9 | - - if can?(current_user, :write_wiki, @project) | |
| 10 | - - if @wiki && @wiki.persisted? | |
| 4 | + Page History | |
| 5 | + - if can?(current_user, :write_wiki, @project) | |
| 11 | 6 | = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do |
| 12 | 7 | %i.icon-edit |
| 13 | 8 | Edit |
| 14 | - = link_to git_access_project_wikis_path(@project), class: "btn btn-small grouped" do | |
| 15 | - %i.icon-download-alt | |
| 16 | - Git Access | ... | ... |
app/views/wikis/_nav.html.haml
| 1 | 1 | %ul.nav.nav-tabs |
| 2 | - - if @project.wiki_enabled | |
| 3 | - = nav_link(controller: 'wikis') do | |
| 4 | - = link_to 'Wiki', project_wiki_path(@project, :home) | |
| 2 | + = nav_link(html_options: {class: params[:id] == 'home' ? 'active' : '' }) do | |
| 3 | + = link_to 'Home', project_wiki_path(@project, :home) | |
| 5 | 4 | |
| 6 | - - if @project.wall_enabled | |
| 7 | - = nav_link(path: 'projects#wall') do | |
| 8 | - = link_to 'Wall', wall_project_path(@project) | |
| 5 | + = nav_link(path: 'wikis#pages') do | |
| 6 | + = link_to 'Pages', pages_project_wikis_path(@project) | |
| 9 | 7 | |
| 10 | - = nav_link(path: 'projects#files') do | |
| 11 | - = link_to 'Attachments', files_project_path(@project), class: "files-tab tab" | |
| 12 | - | |
| 13 | - = nav_link(controller: :snippets) do | |
| 14 | - = link_to 'Snippets', project_snippets_path(@project), class: "snippets-tab tab" | |
| 8 | + = nav_link(path: 'wikis#git_access') do | |
| 9 | + = link_to git_access_project_wikis_path(@project) do | |
| 10 | + %i.icon-download-alt | |
| 11 | + Git Access | ... | ... |
app/views/wikis/edit.html.haml
app/views/wikis/git_access.html.haml