]> source.dussan.org Git - redmine.git/commitdiff
Add update info at the bottom of the wiki page.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 29 Jul 2017 08:01:41 +0000 (08:01 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 29 Jul 2017 08:01:41 +0000 (08:01 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@16905 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/wiki_helper.rb
app/views/wiki/show.html.erb
config/locales/en.yml
config/locales/fr.yml
public/stylesheets/application.css

index 2a49f087141c520bed9e51e817c6e27a251a530a..88a73be31fa9e0760749456b2556fa95037fdf41 100644 (file)
@@ -64,4 +64,8 @@ module WikiHelper
       project_wiki_page_path(page.project, page.title)
     end
   end
+
+  def wiki_content_update_info(content)
+    l(:label_updated_time_by, :author => content.author.name, :age => distance_of_time_in_words(Time.now, content.updated_on)).html_safe
+  end
 end
index c7d186176d8e5b08b348312b0631771552bf38cd..a4de3e7ebe8c680a45fce92a3ab60ee2634c71e7 100644 (file)
@@ -14,7 +14,6 @@
   <%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') %>
 <% end %>
 <% end %>
-<%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
 </div>
 
 <%= wiki_page_breadcrumb(@page) %>
 </div>
 </fieldset>
 
+<% if User.current.allowed_to?(:view_wiki_edits, @project) %>
+<p class="wiki-update-info">
+  <%= wiki_content_update_info(@content) %>
+ · <%= link_to l(:label_x_revisions, :count => @content.version), {:action => 'history', :id => @page.title} %>
+</p>
+<% end %>
+
 <% other_formats_links do |f| %>
   <%= f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} %>
   <%= f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} %>
index 0dac83a060d6c1130f41cf52baca0635878f94e7..3fb86c14c95ea280390814f91943d48b28004a8b 100644 (file)
@@ -775,6 +775,7 @@ en:
   label_latest_revision_plural: Latest revisions
   label_view_revisions: View revisions
   label_view_all_revisions: View all revisions
+  label_x_revisions: "%{count} revisions"
   label_max_size: Maximum size
   label_sort_highest: Move to top
   label_sort_higher: Move up
index e029b5e043d32c03f8ffbe8d1944011a294a9a38..11e0348c4a4495ab6d23579170d97bd8c5505a5a 100644 (file)
@@ -784,6 +784,7 @@ fr:
   label_latest_revision_plural: Dernières révisions
   label_view_revisions: Voir les révisions
   label_view_all_revisions: Voir toutes les révisions
+  label_x_revisions: "%{count} révisions"
   label_max_size: Taille maximale
   label_sort_highest: Remonter en premier
   label_sort_higher: Remonter
index 11a1d836b6d5c62c154e151f7500c2b772b6c930..cbd4bd6b26e33f4e0bb597c347da61e3fce93b9e 100644 (file)
@@ -550,6 +550,8 @@ table#time-report .hours-dec { font-size: 0.9em; }
 div.wiki-page .contextual a {opacity: 0.4}
 div.wiki-page .contextual a:hover {opacity: 1}
 
+.wiki-update-info {text-align:right; color:#666; font-size:90%;}
+
 form .attributes select { width: 60%; }
 form .attributes select + a.icon-only { vertical-align: middle; margin-left: 4px; }
 input#issue_subject, input#document_title { width: 99%; }