From a685624d27a99a4d7ee9d607fcf2ccbc85eb7fc7 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 14 Mar 2013 22:24:27 +0200 Subject: [PATCH 1/5] Merge wiki, wall & snippets under one tab - writeboards --- app/assets/stylesheets/sections/notes.scss | 2 +- app/helpers/tab_helper.rb | 12 ++++- app/views/hooks/index.html.haml | 2 +- app/views/layouts/project_resource.html.haml | 10 +---- app/views/projects/files.html.haml | 41 +++++++++-------- app/views/projects/wall.html.haml | 8 +++- app/views/snippets/edit.html.haml | 1 - app/views/snippets/index.html.haml | 42 +++++++++--------- app/views/snippets/new.html.haml | 1 - app/views/snippets/show.html.haml | 2 - app/views/wikis/edit.html.haml | 2 +- app/views/wikis/pages.html.haml | 44 ++++++++++--------- app/views/wikis/show.html.haml | 46 +++++++++++--------- app/views/writeboards/_nav.html.haml | 14 ++++++ 14 files changed, 128 insertions(+), 99 deletions(-) create mode 100644 app/views/writeboards/_nav.html.haml diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index 1b4280f4..98c4fd3b 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 063a210c..3465bf45 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 88a5a7dc..808a3481 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"   - = 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 46d06960..9ccb60d5 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 36948eff..b483681c 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 82b565de..33af9248 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 8afaf46e..f81c0b8b 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 28a533d2..e2b75943 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 8afaf46e..f81c0b8b 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 64b7d933..12534edf 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 9e221aba..0f879334 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 2e0f091c..d3215f83 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 7ff8b5cc..694b046a 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 00000000..f5111778 --- /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" From 2681a01bcf1230cc54764db4c40d12befb4c48a7 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 14 Mar 2013 22:57:38 +0200 Subject: [PATCH 2/5] add resize button for better wiki reading --- app/assets/javascripts/main.js.coffee | 6 +++++ app/views/commits/_diffs.html.haml | 2 +- app/views/wikis/edit.html.haml | 1 - app/views/wikis/show.html.haml | 32 ++++++++++++++------------- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee index d707657d..8d139f2e 100644 --- a/app/assets/javascripts/main.js.coffee +++ b/app/assets/javascripts/main.js.coffee @@ -53,6 +53,12 @@ $ -> $('.trigger-submit').on 'change', -> $(@).parents('form').submit() + # Wiki resizer + $('.wiki-fullscreen').on 'click', -> + $('.writeboards-menu').toggleClass('hide') + $('.writeboards-content').toggleClass('span9').toggleClass('span12') + + # Flash if (flash = $(".flash-container")).length > 0 flash.click -> $(@).fadeOut() diff --git a/app/views/commits/_diffs.html.haml b/app/views/commits/_diffs.html.haml index 76f9f267..b2da4796 100644 --- a/app/views/commits/_diffs.html.haml +++ b/app/views/commits/_diffs.html.haml @@ -25,7 +25,7 @@ %span= diff.old_path - if @commit.prev_commit - = link_to project_tree_path(@project, tree_join(@commit.prev_commit_id, diff.new_path)), {:class => 'btn pull-right view-file'} do + = link_to project_tree_path(@project, tree_join(@commit.prev_commit_id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do View file @ %span.commit-short-id= @commit.short_id(6) - else diff --git a/app/views/wikis/edit.html.haml b/app/views/wikis/edit.html.haml index 0f879334..501ba092 100644 --- a/app/views/wikis/edit.html.haml +++ b/app/views/wikis/edit.html.haml @@ -1,5 +1,4 @@ %h3.page_title Editing page -%hr = render 'form' .pull-right diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml index 694b046a..7984c61c 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -1,25 +1,27 @@ .row - .span3 + .span3.writeboards-menu = 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 + .span9.writeboards-content - if @wiki != @most_recent_wiki - .warning_message + .alert 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_title + = link_to '#', class: 'wiki-fullscreen' do + %i.icon-resize-horizontal + = @wiki.title + %span.options + = link_to pages_project_wikis_path(@project), class: "btn btn-tiny grouped" do + Pages + - if can? current_user, :write_wiki, @project + = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do + History + = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do + %i.icon-edit + Edit + .file_content.wiki = preserve do = markdown @wiki.content From 5bf88506ecbc2fd57f0103cd3d8ce394a82954b5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 15 Mar 2013 09:39:07 +0200 Subject: [PATCH 3/5] rename writeboards to wiki --- app/views/layouts/project_resource.html.haml | 2 +- app/views/wikis/show.html.haml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/project_resource.html.haml index 9ccb60d5..8dd84f7c 100644 --- a/app/views/layouts/project_resource.html.haml +++ b/app/views/layouts/project_resource.html.haml @@ -36,7 +36,7 @@ %span.count.merge_counter= @project.merge_requests.opened.count = nav_link(html_options: {class: "#{project_writeboards_tab_class}"}) do - = link_to 'Writeboards', project_wiki_path(@project, :index) + = link_to 'Wiki', project_wiki_path(@project, :index) - if can? current_user, :admin_project, @project = nav_link(html_options: {class: "#{project_tab_class}"}) do diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml index 7984c61c..ff18541c 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -11,6 +11,7 @@ .file_title = link_to '#', class: 'wiki-fullscreen' do %i.icon-resize-horizontal +   = @wiki.title %span.options = link_to pages_project_wikis_path(@project), class: "btn btn-tiny grouped" do From 39bbdc468f628ae9835926a09e24a91c702ddede Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 15 Mar 2013 09:39:50 +0200 Subject: [PATCH 4/5] on wall subpage active tab should be wiki too --- features/project/active_tab.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/project/active_tab.feature b/features/project/active_tab.feature index f33e4b9e..9392db36 100644 --- a/features/project/active_tab.feature +++ b/features/project/active_tab.feature @@ -37,7 +37,7 @@ Feature: Project active tab Scenario: On Project Wall Given I visit my project's wall page - Then the active main tab should be Wall + Then the active main tab should be Wiki And no other main tabs should be active Scenario: On Project Wiki From 35ad4fe7db13f3974ca8f0bbce2b39a1b2357b5c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 15 Mar 2013 14:20:03 +0200 Subject: [PATCH 5/5] Use wiki tab for wiki, wall, snippets --- app/assets/javascripts/main.js.coffee | 6 --- app/helpers/tab_helper.rb | 2 +- app/views/layouts/project_resource.html.haml | 2 +- app/views/projects/files.html.haml | 41 ++++++++-------- app/views/projects/wall.html.haml | 9 ++-- app/views/snippets/index.html.haml | 41 ++++++++-------- .../{writeboards => wikis}/_nav.html.haml | 2 +- app/views/wikis/pages.html.haml | 45 ++++++++--------- app/views/wikis/show.html.haml | 48 ++++++++----------- .../features/gitlab_flavored_markdown_spec.rb | 2 +- 10 files changed, 87 insertions(+), 111 deletions(-) rename app/views/{writeboards => wikis}/_nav.html.haml (94%) diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee index 8d139f2e..d707657d 100644 --- a/app/assets/javascripts/main.js.coffee +++ b/app/assets/javascripts/main.js.coffee @@ -53,12 +53,6 @@ $ -> $('.trigger-submit').on 'change', -> $(@).parents('form').submit() - # Wiki resizer - $('.wiki-fullscreen').on 'click', -> - $('.writeboards-menu').toggleClass('hide') - $('.writeboards-content').toggleClass('span9').toggleClass('span12') - - # Flash if (flash = $(".flash-container")).length > 0 flash.click -> $(@).fadeOut() diff --git a/app/helpers/tab_helper.rb b/app/helpers/tab_helper.rb index 3465bf45..62a380eb 100644 --- a/app/helpers/tab_helper.rb +++ b/app/helpers/tab_helper.rb @@ -80,7 +80,7 @@ module TabHelper end end - def project_writeboards_tab_class + def project_wiki_tab_class [:files, :wall].each do |action| return "active" if current_page?(controller: "projects", action: action, id: @project) end diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/project_resource.html.haml index 8dd84f7c..e4558b69 100644 --- a/app/views/layouts/project_resource.html.haml +++ b/app/views/layouts/project_resource.html.haml @@ -35,7 +35,7 @@ Merge Requests %span.count.merge_counter= @project.merge_requests.opened.count - = nav_link(html_options: {class: "#{project_writeboards_tab_class}"}) do + = nav_link(html_options: {class: "#{project_wiki_tab_class}"}) do = link_to 'Wiki', project_wiki_path(@project, :index) - if can? current_user, :admin_project, @project diff --git a/app/views/projects/files.html.haml b/app/views/projects/files.html.haml index b483681c..3402e067 100644 --- a/app/views/projects/files.html.haml +++ b/app/views/projects/files.html.haml @@ -1,25 +1,22 @@ -.row - .span3 - = render 'writeboards/nav' - .span9 - - unless @notes.empty? - %table - %thead - %tr - %th File name - %th += render 'wikis/nav' +- 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 33af9248..1c2d907f 100644 --- a/app/views/projects/wall.html.haml +++ b/app/views/projects/wall.html.haml @@ -1,6 +1,3 @@ -.row - .span3 - = render 'writeboards/nav' - .span9 - %div.wall_page - = render "notes/reversed_notes_with_form" += render 'wikis/nav' +%div.wall_page + = render "notes/reversed_notes_with_form" diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index e2b75943..5dd00be8 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -1,23 +1,20 @@ -.row - .span3 - = render 'writeboards/nav' - .span9 - %h3.page_title - Snippets - %small share code pastes with others out of git repository += render 'wikis/nav' +%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/writeboards/_nav.html.haml b/app/views/wikis/_nav.html.haml similarity index 94% rename from app/views/writeboards/_nav.html.haml rename to app/views/wikis/_nav.html.haml index f5111778..36ab1053 100644 --- a/app/views/writeboards/_nav.html.haml +++ b/app/views/wikis/_nav.html.haml @@ -1,4 +1,4 @@ -%ul.nav.nav-pills.nav-stacked +%ul.nav.nav-tabs - if @project.wiki_enabled = nav_link(controller: 'wikis') do = link_to 'Wiki', project_wiki_path(@project, :index) diff --git a/app/views/wikis/pages.html.haml b/app/views/wikis/pages.html.haml index d3215f83..7bf57adc 100644 --- a/app/views/wikis/pages.html.haml +++ b/app/views/wikis/pages.html.haml @@ -1,24 +1,21 @@ -.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) += render 'wikis/nav' +%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 ff18541c..ea8de155 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -1,30 +1,24 @@ -.row - .span3.writeboards-menu - = render 'writeboards/nav' - .span9.writeboards-content - - if @wiki != @most_recent_wiki - .alert - 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)}. += render 'wikis/nav' +- if @wiki != @most_recent_wiki + .alert + 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_title - = link_to '#', class: 'wiki-fullscreen' do - %i.icon-resize-horizontal -   - = @wiki.title - %span.options - = link_to pages_project_wikis_path(@project), class: "btn btn-tiny grouped" do - Pages - - if can? current_user, :write_wiki, @project - = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do - History - = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do - %i.icon-edit - Edit +.file_holder + .file_title + = @wiki.title + %span.options + = link_to pages_project_wikis_path(@project), class: "btn btn-tiny grouped" do + Pages + - if can? current_user, :write_wiki, @project + = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do + History + = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do + %i.icon-edit + Edit - .file_content.wiki - = preserve do - = markdown @wiki.content + .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/spec/features/gitlab_flavored_markdown_spec.rb b/spec/features/gitlab_flavored_markdown_spec.rb index 769fcd68..1da18275 100644 --- a/spec/features/gitlab_flavored_markdown_spec.rb +++ b/spec/features/gitlab_flavored_markdown_spec.rb @@ -218,7 +218,7 @@ describe "Gitlab Flavored Markdown" do end it "should NOT render title in wikis#show" do - within(".content h3") do # page title + within(".content .file_title") do # page title page.should have_content("Circumvent ##{issue.id}") page.should_not have_link("##{issue.id}") end