Use wiki tab for wiki, wall, snippets

This commit is contained in:
Dmitriy Zaporozhets 2013-03-15 14:20:03 +02:00
parent 39bbdc468f
commit 35ad4fe7db
10 changed files with 87 additions and 111 deletions

View file

@ -53,12 +53,6 @@ $ ->
$('.trigger-submit').on 'change', -> $('.trigger-submit').on 'change', ->
$(@).parents('form').submit() $(@).parents('form').submit()
# Wiki resizer
$('.wiki-fullscreen').on 'click', ->
$('.writeboards-menu').toggleClass('hide')
$('.writeboards-content').toggleClass('span9').toggleClass('span12')
# Flash # Flash
if (flash = $(".flash-container")).length > 0 if (flash = $(".flash-container")).length > 0
flash.click -> $(@).fadeOut() flash.click -> $(@).fadeOut()

View file

@ -80,7 +80,7 @@ module TabHelper
end end
end end
def project_writeboards_tab_class def project_wiki_tab_class
[:files, :wall].each do |action| [:files, :wall].each do |action|
return "active" if current_page?(controller: "projects", action: action, id: @project) return "active" if current_page?(controller: "projects", action: action, id: @project)
end end

View file

@ -35,7 +35,7 @@
Merge Requests Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count %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) = link_to 'Wiki', project_wiki_path(@project, :index)
- if can? current_user, :admin_project, @project - if can? current_user, :admin_project, @project

View file

@ -1,25 +1,22 @@
.row = render 'wikis/nav'
.span3 - unless @notes.empty?
= render 'writeboards/nav' %table
.span9 %thead
- unless @notes.empty? %tr
%table %th File name
%thead %th
%tr
%th File name
%th
- @notes.each do |note| - @notes.each do |note|
%tr %tr
%td %td
= link_to note.attachment.secure_url, target: "_blank" do = link_to note.attachment.secure_url, target: "_blank" do
= image_tag gravatar_icon(note.author_email), class: "avatar s24" = image_tag gravatar_icon(note.author_email), class: "avatar s24"
= note.attachment_identifier = note.attachment_identifier
%td %td
Added Added
= time_ago_in_words(note.created_at) = time_ago_in_words(note.created_at)
ago ago
- else - else
%p.slead All files attached to project wall, issues etc will be displayed here %p.slead All files attached to project wall, issues etc will be displayed here

View file

@ -1,6 +1,3 @@
.row = render 'wikis/nav'
.span3 %div.wall_page
= render 'writeboards/nav' = render "notes/reversed_notes_with_form"
.span9
%div.wall_page
= render "notes/reversed_notes_with_form"

View file

@ -1,23 +1,20 @@
.row = render 'wikis/nav'
.span3 %h3.page_title
= render 'writeboards/nav' Snippets
.span9 %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 - 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 = link_to new_project_snippet_path(@project), class: "btn btn-small add_new pull-right", title: "New Snippet" do
Add new snippet Add new snippet
%br %br
%table %table
%thead %thead
%tr %tr
%th Title %th Title
%th File Name %th File Name
%th Expires At %th Expires At
= render @snippets = render @snippets
- if @snippets.empty? - if @snippets.empty?
%tr %tr
%td{colspan: 3} %td{colspan: 3}
%h3.nothing_here_message Nothing here. %h3.nothing_here_message Nothing here.

View file

@ -1,4 +1,4 @@
%ul.nav.nav-pills.nav-stacked %ul.nav.nav-tabs
- if @project.wiki_enabled - if @project.wiki_enabled
= nav_link(controller: 'wikis') do = nav_link(controller: 'wikis') do
= link_to 'Wiki', project_wiki_path(@project, :index) = link_to 'Wiki', project_wiki_path(@project, :index)

View file

@ -1,24 +1,21 @@
.row = render 'wikis/nav'
.span3 %h3.page_title All Pages
= render 'writeboards/nav' %br
.span9 %table
%h3.page_title All Pages %thead
%br %tr
%table %th Title
%thead %th Slug
%tr %th Last updated
%th Title %th Updated by
%th Slug %tbody
%th Last updated - @wiki_pages.each do |wiki_page|
%th Updated by %tr
%tbody %td
- @wiki_pages.each do |wiki_page| %strong= link_to wiki_page.title, project_wiki_path(@project, wiki_page)
%tr %td= wiki_page.slug
%td %td
%strong= link_to wiki_page.title, project_wiki_path(@project, wiki_page) = wiki_page.created_at.to_s(:short) do
%td= wiki_page.slug (#{time_ago_in_words(wiki_page.created_at)}
%td ago)
= wiki_page.created_at.to_s(:short) do %td= link_to_member(@project, wiki_page.user)
(#{time_ago_in_words(wiki_page.created_at)}
ago)
%td= link_to_member(@project, wiki_page.user)

View file

@ -1,30 +1,24 @@
.row = render 'wikis/nav'
.span3.writeboards-menu - if @wiki != @most_recent_wiki
= render 'writeboards/nav' .alert
.span9.writeboards-content This is an old version of this page.
- if @wiki != @most_recent_wiki 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)}.
.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_holder
.file_title .file_title
= link_to '#', class: 'wiki-fullscreen' do = @wiki.title
%i.icon-resize-horizontal %span.options
  = link_to pages_project_wikis_path(@project), class: "btn btn-tiny grouped" do
= @wiki.title Pages
%span.options - if can? current_user, :write_wiki, @project
= link_to pages_project_wikis_path(@project), class: "btn btn-tiny grouped" do = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do
Pages History
- if can? current_user, :write_wiki, @project = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do
= link_to history_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do %i.icon-edit
History Edit
= link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-tiny grouped" do
%i.icon-edit
Edit
.file_content.wiki .file_content.wiki
= preserve do = preserve do
= markdown @wiki.content = 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

View file

@ -218,7 +218,7 @@ describe "Gitlab Flavored Markdown" do
end end
it "should NOT render title in wikis#show" do 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 have_content("Circumvent ##{issue.id}")
page.should_not have_link("##{issue.id}") page.should_not have_link("##{issue.id}")
end end