Commit a685624d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge wiki, wall & snippets under one tab - writeboards

parent 753ecbdc
...@@ -284,6 +284,6 @@ ul.notes { ...@@ -284,6 +284,6 @@ ul.notes {
margin-top: 8px; margin-top: 8px;
margin-left: 15px; margin-left: 15px;
@extend .pull-left; @extend .pull-left;
@extend .span4; width: 35%;
} }
} }
...@@ -73,11 +73,19 @@ module TabHelper ...@@ -73,11 +73,19 @@ module TabHelper
end end
def project_tab_class 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) return "active" if current_page?(controller: "projects", action: action, id: @project)
end end
if ['snippets', 'services', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name if ['wikis', 'snippets'].include? controller.controller_name
"active" "active"
end end
end end
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
.input .input
= f.text_field :url, class: "text_field xxlarge" = 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 %hr
-if @hooks.any? -if @hooks.any?
......
...@@ -35,17 +35,11 @@ ...@@ -35,17 +35,11 @@
Merge Requests Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count %span.count.merge_counter= @project.merge_requests.opened.count
- if @project.wall_enabled = nav_link(html_options: {class: "#{project_writeboards_tab_class}"}) do
= nav_link(path: 'projects#wall') do = link_to 'Writeboards', project_wiki_path(@project, :index)
= link_to 'Wall', wall_project_path(@project)
- if @project.wiki_enabled
= nav_link(controller: :wikis) do
= link_to 'Wiki', project_wiki_path(@project, :index)
- if can? current_user, :admin_project, @project - if can? current_user, :admin_project, @project
= nav_link(html_options: {class: "#{project_tab_class}"}) do = nav_link(html_options: {class: "#{project_tab_class}"}) do
= link_to edit_project_path(@project), class: "stat-tab tab " do = link_to edit_project_path(@project), class: "stat-tab tab " do
Settings Settings
.content= yield .content= yield
= render "project_head" .row
- unless @notes.empty? .span3
%table = render 'writeboards/nav'
%thead .span9
%tr - unless @notes.empty?
%th File name %table
%th %thead
%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
%div.wall_page .row
= render "notes/reversed_notes_with_form" .span3
= render 'writeboards/nav'
.span9
%div.wall_page
= render "notes/reversed_notes_with_form"
= render "projects/project_head"
= render "snippets/form" = render "snippets/form"
= 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 - if can? current_user, :write_snippet, @project
Snippets = link_to new_project_snippet_path(@project), class: "btn btn-small add_new pull-right", title: "New Snippet" do
%small share code pastes with others out of git repository Add new snippet
%br
- if can? current_user, :write_snippet, @project %table
= link_to new_project_snippet_path(@project), class: "btn btn-small add_new pull-right", title: "New Snippet" do %thead
Add new snippet %tr
%br %th Title
%table %th File Name
%thead %th Expires At
%tr = render @snippets
%th Title - if @snippets.empty?
%th File Name %tr
%th Expires At %td{colspan: 3}
= render @snippets %h3.nothing_here_message Nothing here.
- if @snippets.empty?
%tr
%td{colspan: 3}
%h3.nothing_here_message Nothing here.
= render "projects/project_head"
= render "snippets/form" = render "snippets/form"
= render "projects/project_head"
%h3.page_title %h3.page_title
= @snippet.title = @snippet.title
%small= @snippet.file_name %small= @snippet.file_name
......
...@@ -5,4 +5,4 @@ ...@@ -5,4 +5,4 @@
.pull-right .pull-right
- if can? current_user, :admin_wiki, @project - 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 = 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 Delete this page
\ No newline at end of file
%h3.page_title All Pages .row
%br .span3
%table = render 'writeboards/nav'
%thead .span9
%tr %h3.page_title All Pages
%th Title %br
%th Slug %table
%th Last updated %thead
%th Updated by %tr
%tbody %th Title
- @wiki_pages.each do |wiki_page| %th Slug
%tr %th Last updated
%td %th Updated by
%strong= link_to wiki_page.title, project_wiki_path(@project, wiki_page) %tbody
%td= wiki_page.slug - @wiki_pages.each do |wiki_page|
%td %tr
= wiki_page.created_at.to_s(:short) do %td
(#{time_ago_in_words(wiki_page.created_at)} %strong= link_to wiki_page.title, project_wiki_path(@project, wiki_page)
ago) %td= wiki_page.slug
%td= link_to_member(@project, wiki_page.user) %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)
%h3.page_title .row
= @wiki.title .span3
%span.pull-right = render 'writeboards/nav'
= link_to pages_project_wikis_path(@project), class: "btn btn-small grouped" do .span9
Pages %h3.page_title
- if can? current_user, :write_wiki, @project = @wiki.title
= link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do %span.pull-right
History = link_to pages_project_wikis_path(@project), class: "btn btn-small grouped" do
= link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do Pages
%i.icon-edit - if can? current_user, :write_wiki, @project
Edit = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do
%br History
- if @wiki != @most_recent_wiki = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do
.warning_message %i.icon-edit
This is an old version of this page. Edit
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)}. %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_holder
.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
%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"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment