diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-15 14:22:49 +0200 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-15 14:22:49 +0200 |
| commit | 7799b5bda6ba0a65c5a951dfd72db4fe334dc70e (patch) | |
| tree | 5522dc41d44a072cc1422316bfc34cf35ed3a7c0 | |
| parent | 753ecbdcecfacfaea9157267db4151d1b68e555a (diff) | |
| parent | 35ad4fe7db13f3974ca8f0bbce2b39a1b2357b5c (diff) | |
| download | gitlab-ce-7799b5bda6ba0a65c5a951dfd72db4fe334dc70e.tar.gz | |
Merge branch 'feature/writeboard'
| -rw-r--r-- | app/assets/stylesheets/sections/notes.scss | 2 | ||||
| -rw-r--r-- | app/helpers/tab_helper.rb | 12 | ||||
| -rw-r--r-- | app/views/commits/_diffs.html.haml | 2 | ||||
| -rw-r--r-- | app/views/hooks/index.html.haml | 2 | ||||
| -rw-r--r-- | app/views/layouts/project_resource.html.haml | 10 | ||||
| -rw-r--r-- | app/views/projects/files.html.haml | 2 | ||||
| -rw-r--r-- | app/views/projects/wall.html.haml | 1 | ||||
| -rw-r--r-- | app/views/snippets/edit.html.haml | 1 | ||||
| -rw-r--r-- | app/views/snippets/index.html.haml | 3 | ||||
| -rw-r--r-- | app/views/snippets/new.html.haml | 1 | ||||
| -rw-r--r-- | app/views/snippets/show.html.haml | 2 | ||||
| -rw-r--r-- | app/views/wikis/_nav.html.haml | 14 | ||||
| -rw-r--r-- | app/views/wikis/edit.html.haml | 3 | ||||
| -rw-r--r-- | app/views/wikis/pages.html.haml | 1 | ||||
| -rw-r--r-- | app/views/wikis/show.html.haml | 27 | ||||
| -rw-r--r-- | features/project/active_tab.feature | 2 | ||||
| -rw-r--r-- | spec/features/gitlab_flavored_markdown_spec.rb | 2 |
17 files changed, 50 insertions, 37 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..62a380eb730 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_wiki_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/commits/_diffs.html.haml b/app/views/commits/_diffs.html.haml index 76f9f267b41..b2da4796db6 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/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" - = 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..e4558b69362 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_wiki_tab_class}"}) do + = link_to 'Wiki', 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..3402e067081 100644 --- a/app/views/projects/files.html.haml +++ b/app/views/projects/files.html.haml @@ -1,4 +1,4 @@ -= render "project_head" += render 'wikis/nav' - unless @notes.empty? %table %thead diff --git a/app/views/projects/wall.html.haml b/app/views/projects/wall.html.haml index 82b565def43..1c2d907fddc 100644 --- a/app/views/projects/wall.html.haml +++ b/app/views/projects/wall.html.haml @@ -1,2 +1,3 @@ += render 'wikis/nav' %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..5dd00be88d7 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -1,5 +1,4 @@ -= render "projects/project_head" - += render 'wikis/nav' %h3.page_title Snippets %small share code pastes with others out of git repository 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/_nav.html.haml b/app/views/wikis/_nav.html.haml new file mode 100644 index 00000000000..36ab1053c17 --- /dev/null +++ b/app/views/wikis/_nav.html.haml @@ -0,0 +1,14 @@ +%ul.nav.nav-tabs + - 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" diff --git a/app/views/wikis/edit.html.haml b/app/views/wikis/edit.html.haml index 9e221aba47d..501ba092317 100644 --- a/app/views/wikis/edit.html.haml +++ b/app/views/wikis/edit.html.haml @@ -1,8 +1,7 @@ %h3.page_title Editing page -%hr = render 'form' .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..7bf57adc106 100644 --- a/app/views/wikis/pages.html.haml +++ b/app/views/wikis/pages.html.haml @@ -1,3 +1,4 @@ += render 'wikis/nav' %h3.page_title All Pages %br %table diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml index 7ff8b5cc01e..ea8de155154 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -1,21 +1,22 @@ -%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 += render 'wikis/nav' - 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 + = @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 diff --git a/features/project/active_tab.feature b/features/project/active_tab.feature index f33e4b9e369..9392db36b87 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 diff --git a/spec/features/gitlab_flavored_markdown_spec.rb b/spec/features/gitlab_flavored_markdown_spec.rb index 769fcd688b4..1da18275989 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 |
