diff options
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ca8e1c266..315868de9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -127,7 +127,9 @@ module ApplicationHelper # * :download - Force download (default: false) def link_to_attachment(attachment, options={}) text = options.delete(:text) || attachment.filename + icon = 'attachment' if options.delete(:download) + icon = 'download' route_method = :download_named_attachment_url options[:filename] = attachment.filename else @@ -136,9 +138,10 @@ module ApplicationHelper options.delete(:filename) end html_options = options.slice!(:only_path, :filename) + options[:only_path] = true unless options.key?(:only_path) url = send(route_method, attachment, options) - link_to text, url, html_options + link_to icon_with_label(icon, text), url, html_options end # Generates a link to a SCM revision @@ -744,7 +747,7 @@ module ApplicationHelper :reorder_url => options[:url] || url_for(object), :reorder_param => options[:param] || object.class.name.underscore } - content_tag('span', '', + content_tag('span', icon_with_label('reorder', ''), :class => "icon-only icon-sort-handle sort-handle", :data => data, :title => l(:button_sort)) @@ -824,7 +827,7 @@ module ApplicationHelper content = capture(&) if content.present? trigger = - content_tag('span', l(:button_actions), :class => 'icon-only icon-actions', + content_tag('span', icon_with_label('3-bullets', l(:button_actions)), :class => 'icon-only icon-actions ', :title => l(:button_actions)) trigger = content_tag('span', trigger, :class => 'drdn-trigger') content = content_tag('div', content, :class => 'drdn-items') @@ -1365,7 +1368,7 @@ module ApplicationHelper content_tag( 'div', link_to( - l(:button_edit_section), + icon_with_label('edit', l(:button_edit_section)), options[:edit_section_links].merge( :section => @current_section), :class => 'icon-only icon-edit'), @@ -1559,7 +1562,7 @@ module ApplicationHelper :class => 'icon icon-del' }.merge(options) - link_to button_name, url, options + link_to icon_with_label('del', button_name), url, options end def link_to_function(name, function, html_options={}) @@ -1567,7 +1570,7 @@ module ApplicationHelper end def link_to_context_menu - link_to l(:button_actions), '#', title: l(:button_actions), class: 'icon-only icon-actions js-contextmenu' + link_to icon_with_label('3-bullets', l(:button_actions)), '#', title: l(:button_actions), class: 'icon-only icon-actions js-contextmenu ' end # Helper to render JSON in views @@ -1897,8 +1900,8 @@ module ApplicationHelper def copy_object_url_link(url) link_to_function( - l(:button_copy_link), 'copyTextToClipboard(this);', - class: 'icon icon-copy-link', + icon_with_label('copy-link', l(:button_copy_link)), 'copyTextToClipboard(this);', + class: 'icon icon-copy-link ', data: {'clipboard-text' => url} ) end |