document versions
This commit is contained in:
@@ -67,9 +67,17 @@ class DocumentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
def write
|
def write
|
||||||
@document = Document.find(params[:id])
|
@document = Document.find(params[:id])
|
||||||
if @document.is_etherpad?
|
if @document.is_etherpad? && params[:versionid].nil?
|
||||||
redirect_to action: :write_etherpad
|
redirect_to action: :write_etherpad
|
||||||
else
|
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
|
@parent=@document.parent
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
|
|||||||
@@ -7,3 +7,11 @@
|
|||||||
<%= raw(@document.text) %>
|
<%= raw(@document.text) %>
|
||||||
</div>
|
</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