Commit 8fd0de54 authored by azul's avatar azul

cleanup: unused wiki diffs views and helper functions

parent b823997e
module Wikis::VersionsHelper
#
# DISPLAY
#
def short_description(version, link_to_version = false)
version_text = 'Version '.html_safe + version.version.to_s
if link_to_version
version_text = link_to(version_text, wiki_version_path(@wiki, version))
end
version_text + ' created by ' + version_user_link(version)
end
#
# NAVIGATION LINKS
#
def list_versions_link
label = :list_things.t(things: :versions.t)
url = wiki_versions_path(@wiki)
link_to(label, url,
remote: true,
method: :get,
class: 'btn btn-default',
icon: 'left')
end
def next_version_link
version = @version.version + 1
if version <= @wiki.versions.count
......@@ -51,8 +28,6 @@ module Wikis::VersionsHelper
end
end
private
def version_user_link(version)
if version.user
link_to_user(version.user)
......@@ -60,10 +35,4 @@ module Wikis::VersionsHelper
''
end
end
def version_show_link(version)
return unless may_update?(@wiki)
link_to :version_link.t, wiki_version_path(@wiki, version)
end
end
- avatar_size = local_assigns[:avatar_size] || 'small'
= avatar_for(version.user, avatar_size)
= embold_links short_description(version)
%br/
%i= friendly_date(version.updated_at)
- if @wiki.versions.count > 1
=version_show_link(version)
= back_to_wiki_link
= pagination_links(@versions)
= render 'common/split_panel',
items: '@versions',
left_panel: 'wiki/diffs/diff_short_entry',
right_panel: 'wiki/diffs/show',
current: @new,
load_url: proc {|version| wiki_diff_path(@wiki, version.diff_id)}
standard_update(page)
page.replace_html dom_id(@new, :panel_right), :partial => '/wikis/diffs/show'
page << "activatePanelRow('#{dom_id(@new)}')"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment