forked from bofh/fetsite
document versions
This commit is contained in:
@@ -67,9 +67,17 @@ class DocumentsController < ApplicationController
|
||||
end
|
||||
def write
|
||||
@document = Document.find(params[:id])
|
||||
if @document.is_etherpad?
|
||||
if @document.is_etherpad? && params[:versionid].nil?
|
||||
redirect_to action: :write_etherpad
|
||||
else
|
||||
unless params[:versionid].nil?
|
||||
v=@document.versions.find(params[:versionid])
|
||||
if v.reify.nil?
|
||||
v=v.next
|
||||
end
|
||||
@document=v.reify
|
||||
|
||||
end
|
||||
@parent=@document.parent
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
||||
@@ -7,3 +7,11 @@
|
||||
<%= raw(@document.text) %>
|
||||
</div>
|
||||
|
||||
<% if can?(:edit, @document) %>
|
||||
<ul class='breadcrumb'>
|
||||
<% @document.versions.each do |v| %>
|
||||
<li>
|
||||
<%= link_to User.find(v.whodunnit).name+": "+ v.event + " (" + I18n.l(v.created_at)+ ") ", write_document_path(@document,:versionid=>v.id) %>
|
||||
<% end %> <span class="divider">/</span></li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user