app/views/wiki/bliki_revision.rhtml in Pimki-1.2.092 vs app/views/wiki/bliki_revision.rhtml in Pimki-1.3.092

- old
+ new

@@ -5,11 +5,25 @@ <tr style="background-color:dfd"> <td width="70%"><h4><%= @revision.page.name %></h4></td> <th><small><%= @revision.pretty_created_at %></small></th> </tr> <tr> - <td colspan="2"><%= @revision.display_content %></td> + <td colspan="2"> + <div id="revision"> + <%= @revision.display_content %> + </div> + <div id="changes" style="display: none"> + <p style="background: #eee; padding: 3px; border: 1px solid silver"> + <small> + Showing changes from revision #<%= @page.number - 1 %> to #<%= @page.number %>: + <ins class="diffins">Added</ins> | <del class="diffdel">Removed</del> + </small> + </p> + + <%= @revision.display_diff %> + </div> + </td> </tr> <tr style="background-color:efe"> <th colspan="2" align="right"><small><%= web.make_link(@revision.author, nil, {}) %></small></th> </tr> </table> @@ -44,8 +58,34 @@ <% if @page.references.length > 0 %> <small> | Referenced by: <%= @page.references.collect { |ref| "<a href='#{ref.name}'>#{ref.name}</a>" }.join(", ") %> </small> <% end %> + + <% if @page.revisions.length > 1 %> + <span id="show_changes"> + | <a href="#" onClick="toggleChanges(); return false;">See changes</a> + </span> + <span id="hide_changes" style="display: none"> + | <a href="#" onClick="toggleChanges(); return false;">Hide changes</a> + </span> + <% end %> + </div> + +<script language="Javascript"> + function toggleChanges() { + if (document.getElementById("changes").style.display == "none") { + document.getElementById("changes").style.display = "block"; + document.getElementById("revision").style.display = "none"; + document.getElementById("show_changes").style.display = "none"; + document.getElementById("hide_changes").style.display = "inline"; + } else { + document.getElementById("changes").style.display = "none"; + document.getElementById("revision").style.display = "block"; + document.getElementById("show_changes").style.display = "inline"; + document.getElementById("hide_changes").style.display = "none"; + } + } +</script> <%= sub_template "bottom" %> \ No newline at end of file