You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

show.html.erb 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <div class="contextual">
  2. <% if @editable %>
  3. <% if @content.current_version? %>
  4. <%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
  5. <%= watcher_link(@page, User.current) %>
  6. <% end %>
  7. <% end %>
  8. <%= actions_dropdown do %>
  9. <%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
  10. <% if @editable %>
  11. <% if @content.current_version? %>
  12. <%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %>
  13. <%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %>
  14. <%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %>
  15. <%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %>
  16. <% else %>
  17. <%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') %>
  18. <% end %>
  19. <% end %>
  20. <% if User.current.allowed_to?(:edit_wiki_pages, @project) %>
  21. <%= link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project, :parent => @page.title), :remote => true, :class => 'icon icon-add' %>
  22. <% end %>
  23. <% end %>
  24. </div>
  25. <%= wiki_page_breadcrumb(@page) %>
  26. <% unless @content.current_version? %>
  27. <%= title [@page.pretty_title, project_wiki_page_path(@page.project, @page.title, :version => nil)],
  28. [l(:label_history), history_project_wiki_page_path(@page.project, @page.title)],
  29. "#{l(:label_revision)} #{@content.version}" %>
  30. <p>
  31. <% if @content.previous %>
  32. <%= link_to ("\xc2\xab " + l(:label_previous)),
  33. :action => 'show', :id => @page.title, :project_id => @page.project,
  34. :version => @content.previous.version %> |
  35. <% end %>
  36. <%= "#{l(:label_revision)} #{@content.version}/#{@page.content.version}" %>
  37. <% if @content.previous %>
  38. (<%= link_to l(:label_diff), :controller => 'wiki', :action => 'diff',
  39. :id => @page.title, :project_id => @page.project,
  40. :version => @content.version %>)
  41. <% end %>
  42. <% if @content.next %>
  43. | <%= link_to (l(:label_next) + " \xc2\xbb"), :action => 'show',
  44. :id => @page.title, :project_id => @page.project,
  45. :version => @content.next.version %>
  46. <% end %>
  47. <br />
  48. <em><%= @content.author ? link_to_user(@content.author) : l(:label_user_anonymous)
  49. %>, <%= format_time(@content.updated_on) %> </em><br />
  50. <%= @content.comments %>
  51. </p>
  52. <hr />
  53. <% end %>
  54. <%= render(:partial => "wiki/content", :locals => {:content => @content}) %>
  55. <fieldset class="collapsible collapsed hide-when-print">
  56. <legend onclick="toggleFieldset(this);"><%= l(:label_attachment_plural) %> (<%= @page.attachments.length %>)</legend>
  57. <div style="display: none;">
  58. <%= link_to_attachments @page, :thumbnails => true %>
  59. <% if @editable && authorize_for('wiki', 'add_attachment') %>
  60. <div id="wiki_add_attachment">
  61. <%= form_tag({:controller => 'wiki', :action => 'add_attachment',
  62. :project_id => @project, :id => @page.title},
  63. :multipart => true, :id => "add_attachment_form") do %>
  64. <div class="box">
  65. <p><%= render :partial => 'attachments/form' %></p>
  66. </div>
  67. <%= submit_tag l(:button_add) %>
  68. <% end %>
  69. </div>
  70. <% end %>
  71. </div>
  72. </fieldset>
  73. <% if User.current.allowed_to?(:view_wiki_edits, @project) %>
  74. <p class="wiki-update-info">
  75. <%= wiki_content_update_info(@content) %>
  76. · <%= link_to l(:label_x_revisions, :count => @content.version), {:action => 'history', :id => @page.title} %>
  77. </p>
  78. <% end %>
  79. <% other_formats_links do |f| %>
  80. <%= f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} %>
  81. <%= f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} %>
  82. <%= f.link_to 'TXT', :url => {:id => @page.title, :version => params[:version]} %>
  83. <% end if User.current.allowed_to?(:export_wiki_pages, @project) %>
  84. <% content_for :sidebar do %>
  85. <%= render :partial => 'sidebar' %>
  86. <% end %>
  87. <% html_title @page.pretty_title %>