Project

General

Profile

Patch #15905 » button_add_wiki_page.patch

Jan from Planio www.plan.io, 2014-01-20 09:30

View differences:

app/controllers/wiki_controller.rb
60 60
    @pages_by_date = @pages.group_by {|p| p.updated_on.to_date}
61 61
  end
62
  def new
63
    @page = WikiPage.new(:wiki => @wiki)
64
    unless User.current.allowed_to?(:edit_wiki_pages, @project) && editable?
65
      render_403
66
    end
67
  end
68

  
62 69
  # display a page (in editing mode if it doesn't exist)
63 70
  def show
64 71
    if params[:version] && !User.current.allowed_to?(:view_wiki_edits, @project)
app/views/wiki/new.html.erb
1
<h2><%= l(:label_wiki_page_new) %></h2>
2

  
3
<%= labelled_form_for :page, @page,
4
            :url => {:action => 'show'},
5
            :html => {:method => :get} do |f| %>
6

  
7
  <div class="box tabular">
8
    <p>
9
      <%= f.text_field :title, :name => 'id', :size => 60, :required => true %>
10
      <em class="info"><%= l(:text_unallowed_characters) %>: , . / ? ; : |</em>
11
    </p>
12
  </div>
13

  
14
  <%= submit_tag(l(:button_continue)) %>
15

  
16
<% end %>
17

  
18
<% html_title l(:label_wiki_page_new) %>
app/views/wiki/show.html.erb
1 1
<div class="contextual">
2
<%= link_to_if_authorized(l(:label_wiki_page_new), {:action => 'new'}, :class => 'icon icon-add') %>
2 3
<% if @editable %>
3 4
<% if @content.current_version? %>
4 5
  <%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
config/locales/de.yml
167 167
  button_copy_and_follow: Kopieren und Ticket anzeigen
168 168
  button_create: Anlegen
169 169
  button_create_and_continue: Anlegen und weiter
170
  button_continue: Weiter
170 171
  button_delete: Löschen
171 172
  button_delete_my_account: Mein Benutzerkonto löschen
172 173
  button_download: Download
......
792 793
  label_wiki_edit_plural: Wiki-Bearbeitungen
793 794
  label_wiki_page: Wiki-Seite
794 795
  label_wiki_page_plural: Wiki-Seiten
796
  label_wiki_page_new: Neue Wiki-Seite
795 797
  label_workflow: Workflow
796 798
  label_x_closed_issues_abbr:
797 799
    zero:  0 geschlossen
config/locales/en.yml
727 727
  label_wiki_edit_plural: Wiki edits
728 728
  label_wiki_page: Wiki page
729 729
  label_wiki_page_plural: Wiki pages
730
  label_wiki_page_new: New wiki page
730 731
  label_index_by_title: Index by title
731 732
  label_index_by_date: Index by date
732 733
  label_current_version: Current version
......
919 920
  button_delete: Delete
920 921
  button_create: Create
921 922
  button_create_and_continue: Create and continue
923
  button_continue: Continue
922 924
  button_test: Test
923 925
  button_edit: Edit
924 926
  button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
config/routes.rb
151 151
    end
152 152
    match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
153
    resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do
153
    resources :wiki, :except => [:index, :create], :as => 'wiki_page' do
154 154
      member do
155 155
        get 'rename'
156 156
        post 'rename'
lib/redmine.rb
152 152
  end
153 153
  map.project_module :wiki do |map|
154
    map.permission :manage_wiki, {:wikis => [:edit, :destroy]}, :require => :member
154
    map.permission :manage_wiki, {:wiki => :new, :wikis => [:edit, :destroy]}, :require => :member
155 155
    map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member
156 156
    map.permission :delete_wiki_pages, {:wiki => [:destroy, :destroy_version]}, :require => :member
157 157
    map.permission :view_wiki_pages, {:wiki => [:index, :show, :special, :date_index]}, :read => true
    (1-1/1)