Merge branch 'wiki'
Conflicts: app/views/layouts/_project_menu.html.haml
This commit is contained in:
commit
ce8eba8913
22 changed files with 294 additions and 17 deletions
|
@ -12,7 +12,6 @@
|
|||
= link_to project_issues_filter_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do
|
||||
Issues
|
||||
%span.count= @project.issues.opened.count
|
||||
|
||||
- if @project.merge_requests_enabled
|
||||
= link_to project_merge_requests_path(@project), :class => (controller.controller_name == "merge_requests") ? "current" : nil do
|
||||
Merge Requests
|
||||
|
@ -21,3 +20,7 @@
|
|||
- if @project.wall_enabled
|
||||
= link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do
|
||||
Wall
|
||||
|
||||
- if @project.wiki_enabled
|
||||
= link_to project_wiki_path(@project, :index), :class => (controller.controller_name == "wikis") ? "current" : nil do
|
||||
Wiki
|
||||
|
|
|
@ -41,6 +41,10 @@
|
|||
.clearfix
|
||||
= f.label :wall_enabled, "Wall"
|
||||
.input= f.check_box :wall_enabled
|
||||
|
||||
.clearfix
|
||||
= f.label :wiki_enabled, "Wiki"
|
||||
.input= f.check_box :wiki_enabled
|
||||
|
||||
.clearfix
|
||||
= f.label :description
|
||||
|
|
18
app/views/wikis/_form.html.haml
Normal file
18
app/views/wikis/_form.html.haml
Normal file
|
@ -0,0 +1,18 @@
|
|||
= form_for [@project, @wiki] do |f|
|
||||
-if @wiki.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@wiki.errors.count, "error")} prohibited this wiki from being saved:"
|
||||
%ul
|
||||
- @wiki.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
.clearfix
|
||||
= f.label :title
|
||||
.input= f.text_field :title, :class => :xxlarge
|
||||
= f.hidden_field :slug
|
||||
.clearfix
|
||||
= f.label :content
|
||||
.input= f.text_area :content, :class => :xxlarge
|
||||
.actions
|
||||
= f.submit 'Save', :class => "primary btn"
|
||||
= link_to "Cancel", project_wiki_path(@project, :index), :class => "btn"
|
3
app/views/wikis/edit.html.haml
Normal file
3
app/views/wikis/edit.html.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
%h1 Editing page
|
||||
|
||||
= render 'form'
|
19
app/views/wikis/history.html.haml
Normal file
19
app/views/wikis/history.html.haml
Normal file
|
@ -0,0 +1,19 @@
|
|||
%h2 Versions
|
||||
%table
|
||||
%thead
|
||||
%tr
|
||||
%th #
|
||||
%th last edit
|
||||
%th created by
|
||||
%tbody
|
||||
- @wikis.each_with_index do |wiki_page, i|
|
||||
%tr
|
||||
%td= i + 1
|
||||
%td
|
||||
= link_to wiki_page.created_at.to_s(:short), project_wiki_path(@project, wiki_page, :old_page_id => wiki_page.id)
|
||||
(
|
||||
= time_ago_in_words(wiki_page.created_at)
|
||||
ago
|
||||
)
|
||||
%td= wiki_page.user.name
|
||||
|
15
app/views/wikis/show.html.haml
Normal file
15
app/views/wikis/show.html.haml
Normal file
|
@ -0,0 +1,15 @@
|
|||
%h3
|
||||
= @wiki.title
|
||||
= link_to edit_project_wiki_path(@project, @wiki), :class => "right btn small" do
|
||||
Edit
|
||||
- if can? current_user, :write_wiki, @project
|
||||
= link_to history_project_wiki_path(@project, @wiki), :class => "right btn small" do
|
||||
History
|
||||
%hr
|
||||
|
||||
= markdown_to_html @wiki.content
|
||||
|
||||
%p.time Last edited by #{@wiki.user.name}, in #{time_ago_in_words @wiki.created_at}
|
||||
- if can? current_user, :write_wiki, @project
|
||||
= link_to project_wiki_path(@project, @wiki), :confirm => "Are you sure you want to delete this page?", :method => :delete do
|
||||
Delete this page
|
Loading…
Add table
Add a link
Reference in a new issue