Commit 47669af4a44f7cb96404f5b4d5a53572a6e46e23

Authored by Junior Silva
1 parent 3eb27b6f

article-version: implementing improvements in user navigation

AI2822
app/views/content_viewer/article_versions.rhtml
  1 +<% button_bar do %>
  2 + <%= button(:back, _('Back to the post'), {:action => 'view_page'}) %>
  3 +<% end %>
  4 +
1 5 <%= article_title(@page, :no_link => true) %>
2 6  
3 7 <p><%= _('This is the list of all versions of this content. Select a version to see it and then revert to it.') %>.</p>
... ...
app/views/content_viewer/versioned_article.rhtml
  1 +<% button_bar do %>
  2 + <%= button(:back, _('Back to the versions'), {:action => 'article_versions'}) %>
  3 +<% end %>
  4 +
  5 +<% button_bar do %>
  6 + <%= button(:back, _('Go to current version'), {:action => 'view_page'}) %>
  7 +<% end %>
  8 +
1 9 <div id="article" class="<%= @page.css_class_name %>">
2 10  
3 11 <div id="article-actions">
... ... @@ -15,6 +23,8 @@
15 23 <%= _("Version %{version} - %{author} on %{date}") % {:version => @version, :author => @page.author_name(@version), :date => show_time(@versioned_article.updated_at) } %>
16 24 </div>
17 25  
  26 +<i><%= _('This is not the current version.') %>.</i>
  27 +
18 28 <% if @page.version_license(@version).present? %>
19 29 <div id='article-sub-header'>
20 30 <% if @page.version_license(@version).present? %>
... ...
app/views/content_viewer/versions_diff.html.erb
  1 +<% button_bar do %>
  2 + <%= button(:back, _('Back to the versions'), {:action => 'article_versions'}) %>
  3 +<% end %>
  4 +
1 5 <h1><%= _('Changes on "%s"') % @page.title %></h1>
2 6  
3 7 <p> <%= _('Changes from %s &rarr; %s') % [show_time(@v1.updated_at), show_time(@v2.updated_at)] %> </p>
4   -<%= Diffy::Diff.new(@v1.body, @v2.body, :context => 1).to_s(:html) %>
  8 +
  9 +<% temp = Diffy::Diff.new(@v1.body, @v2.body, :context => 1).to_s(:text).blank? %>
  10 +<% if temp %>
  11 + <i><%= _('These versions are equals!')%></i>
  12 +<% else %>
  13 + <%= Diffy::Diff.new(@v1.body, @v2.body, :context => 1).to_s(:html) %>
  14 +<% end %>
... ...