Add diff for wiki pages
This commit is contained in:
parent
f5b6fbcf18
commit
ad036c948f
6 changed files with 34 additions and 6 deletions
7
plugins/wiki/app/views/pages/diff.html.haml
Normal file
7
plugins/wiki/app/views/pages/diff.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
- title t('.title', title: @page.title, old: @old_version.lock_version, new: @new_version.lock_version)
|
||||
|
||||
%style= Diffy::CSS
|
||||
= raw @diff
|
||||
|
||||
%hr
|
||||
= link_to t('ui.back'), 'javascript:history.go(-1)', class: 'btn btn-primary'
|
||||
|
|
@ -12,12 +12,16 @@
|
|||
%li= link_to t('.subpages'), "#subpages", 'data-toggle-this' => '#subpages'
|
||||
|
||||
#versions.well.well-small{:style => "display:none"}
|
||||
%h3= t '.title_versions'
|
||||
%ul.unstyled
|
||||
- @page.versions.reverse.each do |version|
|
||||
%li
|
||||
= link_to I18n.l(version.updated_at, :format => t('.date_format')), version_page_path(@page, :version => version.lock_version)
|
||||
= "(#{show_user(User.find_by_id(version.updated_by))})"
|
||||
= form_tag diff_page_path(@page), :method => :get do
|
||||
%h3= t '.title_versions'
|
||||
%ul.unstyled
|
||||
- @page.versions.reverse.each_with_index do |version, index|
|
||||
%li
|
||||
= radio_button_tag :old, version.lock_version, index == 1
|
||||
= radio_button_tag :new, version.lock_version, index == 0
|
||||
= link_to I18n.l(version.updated_at, :format => t('.date_format')), version_page_path(@page, :version => version.lock_version)
|
||||
= "(#{show_user(User.find_by_id(version.updated_by))})"
|
||||
= submit_tag t('.diff'), class: 'btn'
|
||||
|
||||
- unless @page.children.empty?
|
||||
#subpages.well.well-small{:style => "display:none"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue