From d1008280d8bead4757646d53f18d0b76fa20b429 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sat, 19 Oct 2024 10:06:26 +0000 Subject: Renames and improves methods provided by @IconsHelper@ (#23980). git-svn-id: https://svn.redmine.org/redmine/trunk@23145 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 18 +++---- app/helpers/email_addresses_helper.rb | 4 +- app/helpers/gantt_helper.rb | 8 ++-- app/helpers/icons_helper.rb | 40 +++++++++------- app/helpers/issues_helper.rb | 4 +- app/helpers/journals_helper.rb | 6 +-- app/helpers/my_helper.rb | 4 +- app/helpers/projects_helper.rb | 12 ++--- app/helpers/projects_queries_helper.rb | 4 +- app/helpers/queries_helper.rb | 4 +- app/helpers/sort_helper.rb | 2 +- app/helpers/users_helper.rb | 8 ++-- app/helpers/versions_helper.rb | 2 +- app/helpers/watchers_helper.rb | 4 +- app/views/activities/_activities.html.erb | 2 +- app/views/admin/projects.html.erb | 2 +- app/views/attachments/_links.html.erb | 10 ++-- app/views/attachments/edit_all.html.erb | 2 +- app/views/auth_sources/index.html.erb | 4 +- app/views/boards/index.html.erb | 8 ++-- app/views/boards/show.html.erb | 8 ++-- app/views/calendars/show.html.erb | 14 +++--- app/views/common/error.html.erb | 2 +- app/views/common/feed.atom.builder | 2 +- app/views/context_menus/issues.html.erb | 38 +++++++-------- app/views/context_menus/projects.html.erb | 14 +++--- app/views/context_menus/time_entries.html.erb | 14 +++--- app/views/context_menus/users.html.erb | 20 ++++---- app/views/custom_fields/_index.html.erb | 2 +- app/views/custom_fields/formats/_enumeration.erb | 2 +- app/views/custom_fields/index.html.erb | 2 +- app/views/documents/index.html.erb | 4 +- app/views/documents/show.html.erb | 2 +- app/views/enumerations/index.html.erb | 2 +- app/views/files/index.html.erb | 10 ++-- app/views/gantts/show.html.erb | 8 ++-- app/views/groups/_users.html.erb | 2 +- app/views/groups/index.html.erb | 4 +- app/views/groups/show.html.erb | 2 +- app/views/issue_statuses/index.html.erb | 4 +- app/views/issues/_action_menu.html.erb | 8 ++-- app/views/issues/_attributes.html.erb | 6 +-- app/views/issues/_form.html.erb | 4 +- app/views/issues/_watchers_form.html.erb | 2 +- app/views/issues/index.html.erb | 14 +++--- app/views/issues/tabs/_time_entries.html.erb | 4 +- app/views/journals/index.builder | 2 +- app/views/messages/show.html.erb | 10 ++-- app/views/my/_sidebar.html.erb | 2 +- app/views/my/account.html.erb | 2 +- app/views/my/blocks/_issues.erb | 2 +- app/views/my/blocks/_timelog.html.erb | 4 +- app/views/news/index.html.erb | 2 +- app/views/news/show.html.erb | 12 ++--- app/views/principal_memberships/_index.html.erb | 4 +- app/views/projects/_members_box.html.erb | 2 +- app/views/projects/index.html.erb | 4 +- app/views/projects/settings/_activities.html.erb | 4 +- app/views/projects/settings/_boards.html.erb | 4 +- .../projects/settings/_issue_categories.html.erb | 4 +- app/views/projects/settings/_issues.html.erb | 4 +- app/views/projects/settings/_members.html.erb | 8 ++-- app/views/projects/settings/_repositories.html.erb | 10 ++-- app/views/projects/settings/_versions.html.erb | 8 ++-- app/views/projects/show.html.erb | 32 ++++++------- app/views/queries/_query_form.html.erb | 8 ++-- app/views/queries/index.html.erb | 2 +- app/views/reports/issue_report.html.erb | 56 +++++++++++----------- app/views/repositories/_dir_list_content.html.erb | 6 +-- app/views/repositories/_navigation.html.erb | 12 ++--- app/views/repositories/_related_issues.html.erb | 2 +- app/views/roles/index.html.erb | 8 ++-- app/views/settings/_repositories.html.erb | 4 +- app/views/timelog/_list.html.erb | 4 +- app/views/timelog/index.html.erb | 10 ++-- app/views/trackers/index.html.erb | 6 +-- app/views/users/edit.html.erb | 2 +- app/views/users/index.html.erb | 4 +- app/views/users/show.html.erb | 2 +- app/views/versions/_sidebar.html.erb | 2 +- app/views/versions/index.html.erb | 10 ++-- app/views/versions/show.html.erb | 4 +- app/views/wiki/_sidebar.html.erb | 2 +- app/views/wiki/annotate.html.erb | 4 +- app/views/wiki/date_index.html.erb | 4 +- app/views/wiki/diff.html.erb | 2 +- app/views/wiki/index.html.erb | 4 +- app/views/wiki/show.html.erb | 16 +++---- app/views/workflows/_action_menu.html.erb | 4 +- lib/redmine/menu_manager.rb | 2 +- lib/redmine/quote_reply.rb | 2 +- lib/redmine/wiki_formatting/macros.rb | 4 +- test/helpers/application_helper_test.rb | 2 +- test/helpers/watchers_helper_test.rb | 8 ++-- 94 files changed, 333 insertions(+), 325 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8d390d6f7..dd639c0c4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -143,7 +143,7 @@ module ApplicationHelper options[:only_path] = true unless options.key?(:only_path) url = send(route_method, attachment, options) - label = icon ? icon_with_label(icon, text) : text + label = icon ? sprite_icon(icon, text) : text link_to label, url, html_options end @@ -657,7 +657,7 @@ module ApplicationHelper check_box_tag(name, principal.id, false, :id => nil) + (avatar(principal, :size => 16).presence || content_tag( - 'span', icon_for_principal(principal.class.name.downcase), + 'span', principal_icon(principal.class.name.downcase), :class => "name icon icon-#{principal.class.name.downcase}" ) ) + principal.to_s @@ -769,7 +769,7 @@ module ApplicationHelper :reorder_url => options[:url] || url_for(object), :reorder_param => options[:param] || object.class.name.underscore } - content_tag('span', icon_with_label('reorder', ''), + content_tag('span', sprite_icon('reorder', ''), :class => "icon-only icon-sort-handle sort-handle", :data => data, :title => l(:button_sort)) @@ -849,7 +849,7 @@ module ApplicationHelper content = capture(&) if content.present? trigger = - content_tag('span', icon_with_label('3-bullets', l(:button_actions)), :class => 'icon-only icon-actions', + content_tag('span', sprite_icon('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') @@ -1390,7 +1390,7 @@ module ApplicationHelper content_tag( 'div', link_to( - icon_with_label('edit', l(:button_edit_section)), + sprite_icon('edit', l(:button_edit_section)), options[:edit_section_links].merge( :section => @current_section), :class => 'icon-only icon-edit'), @@ -1584,7 +1584,7 @@ module ApplicationHelper :class => 'icon icon-del' }.merge(options) - link_to icon_with_label('del', button_name), url, options + link_to sprite_icon('del', button_name), url, options end def link_to_function(name, function, html_options={}) @@ -1592,7 +1592,7 @@ module ApplicationHelper end def link_to_context_menu - link_to icon_with_label('3-bullets', l(:button_actions)), '#', title: l(:button_actions), class: 'icon-only icon-actions js-contextmenu ' + link_to sprite_icon('3-bullets', l(:button_actions)), '#', title: l(:button_actions), class: 'icon-only icon-actions js-contextmenu ' end # Helper to render JSON in views @@ -1619,7 +1619,7 @@ module ApplicationHelper def toggle_checkboxes_link(selector, options={}) css_classes = 'icon icon-checked' css_classes += ' ' + options[:class] if options[:class] - link_to_function icon_with_label('checked', ''), + link_to_function sprite_icon('checked', ''), "toggleCheckboxesBySelector('#{selector}')", :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}", :class => css_classes @@ -1924,7 +1924,7 @@ module ApplicationHelper def copy_object_url_link(url) link_to_function( - icon_with_label('copy-link', l(:button_copy_link)), 'copyTextToClipboard(this);', + sprite_icon('copy-link', l(:button_copy_link)), 'copyTextToClipboard(this);', class: 'icon icon-copy-link', data: {'clipboard-text' => url} ) diff --git a/app/helpers/email_addresses_helper.rb b/app/helpers/email_addresses_helper.rb index 093f1b1c3..2f42de374 100644 --- a/app/helpers/email_addresses_helper.rb +++ b/app/helpers/email_addresses_helper.rb @@ -22,14 +22,14 @@ module EmailAddressesHelper def toggle_email_address_notify_link(address) if address.notify? link_to( - icon_with_label('email', l(:label_disable_notifications)), + sprite_icon('email', l(:label_disable_notifications)), user_email_address_path(address.user, address, :notify => '0'), :method => :put, :remote => true, :title => l(:label_disable_notifications), :class => 'icon-only icon-email') else link_to( - icon_with_label('email-disabled', l(:label_enable_notifications)), + sprite_icon('email-disabled', l(:label_enable_notifications)), user_email_address_path(address.user, address, :notify => '1'), :method => :put, :remote => true, :title => l(:label_enable_notifications), diff --git a/app/helpers/gantt_helper.rb b/app/helpers/gantt_helper.rb index d037dfeaa..054aad366 100644 --- a/app/helpers/gantt_helper.rb +++ b/app/helpers/gantt_helper.rb @@ -23,21 +23,21 @@ module GanttHelper when :in if gantt.zoom < 4 link_to( - icon_with_label('zoom-in', l(:text_zoom_in)), + sprite_icon('zoom-in', l(:text_zoom_in)), {:params => request.query_parameters.merge(gantt.params.merge(:zoom => (gantt.zoom + 1)))}, :class => 'icon icon-zoom-in') else - content_tag(:span, icon_with_label('zoom-in', l(:text_zoom_in)), :class => 'icon icon-zoom-in').html_safe + content_tag(:span, sprite_icon('zoom-in', l(:text_zoom_in)), :class => 'icon icon-zoom-in').html_safe end when :out if gantt.zoom > 1 link_to( - icon_with_label('zoom-out', l(:text_zoom_out)), + sprite_icon('zoom-out', l(:text_zoom_out)), {:params => request.query_parameters.merge(gantt.params.merge(:zoom => (gantt.zoom - 1)))}, :class => 'icon icon-zoom-out') else - content_tag(:span, icon_with_label('zoom-out', l(:text_zoom_out)), :class => 'icon icon-zoom-out').html_safe + content_tag(:span, sprite_icon('zoom-out', l(:text_zoom_out)), :class => 'icon icon-zoom-out').html_safe end end end diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index e297d950b..ee1c66f3e 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -20,28 +20,36 @@ module IconsHelper DEFAULT_ICON_SIZE = "18" DEFAULT_SPRITE = "icons" + + def sprite_icon(icon_name, label = nil, icon_only: false, size: DEFAULT_ICON_SIZE, css_class: nil) + svg_icon = svg_sprite_icon(icon_name, size: size, css_class: css_class) - def icon_with_label(icon_name, label_text, icon_only: false, size: DEFAULT_ICON_SIZE, css_class: nil) - label_classes = ["icon-label"] - label_classes << "hidden" if icon_only - sprite_icon(icon_name, size: size, css_class: css_class) + content_tag(:span, label_text, class: label_classes.join(' ')) + if label + label_classes = ["icon-label"] + label_classes << "hidden" if icon_only + + svg_icon + content_tag(:span, label, class: label_classes.join(' ')) + else + svg_icon + end end - def icon_for_file(entry, name, size: DEFAULT_ICON_SIZE, css_class: nil) + # + def file_icon(entry, name, size: DEFAULT_ICON_SIZE, css_class: nil) if entry.is_dir? - icon_with_label("folder", name, size: size, css_class: css_class) + sprite_icon("folder", name, size: size, css_class: css_class) else - icon = icon_for_mime_type(Redmine::MimeType.css_class_of(name)) - icon_with_label(icon, name, size: size, css_class: css_class) + icon_name = icon_for_mime_type(Redmine::MimeType.css_class_of(name)) + sprite_icon(icon_name, name, size: size, css_class: css_class) end end - def icon_for_principal(principal_class, size: DEFAULT_ICON_SIZE, css_class: nil) - sprite_icon('group', size: size, css_class: css_class) if ['groupanonymous', 'groupnonmember', 'group'].include?(principal_class) + def principal_icon(principal_class, size: DEFAULT_ICON_SIZE, css_class: nil) + svg_sprite_icon('group', size: size, css_class: css_class) if ['groupanonymous', 'groupnonmember', 'group'].include?(principal_class) end - def icon_for_event_type(event_type, size: DEFAULT_ICON_SIZE, css_class: nil) - icon = case event_type + def activity_event_type_icon(event_type, size: DEFAULT_ICON_SIZE, css_class: nil) + icon_name = case event_type when 'reply' 'comments' when 'time-entry' @@ -52,10 +60,12 @@ module IconsHelper event_type end - sprite_icon(icon, size: size, css_class: css_class) + svg_sprite_icon(icon_name, size: size, css_class: css_class) end - def sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, sprite: DEFAULT_SPRITE, css_class: nil) + private + + def svg_sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, sprite: DEFAULT_SPRITE, css_class: nil) sprite_path = "#{sprite}.svg" css_classes = "s#{size} icon-svg" css_classes += " #{css_class}" unless css_class.nil? @@ -70,8 +80,6 @@ module IconsHelper ) end - private - def icon_for_mime_type(mime) if %w(text-plain text-x-c text-x-csharp text-x-java text-x-php text-x-ruby text-xml text-css text-html text-css text-html diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 88c98f90d..dc5b894e5 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -101,7 +101,7 @@ module IssuesHelper buttons = if manage_relations link_to( - icon_with_label('link-break', l(:label_delete_link_to_subtask)), + sprite_icon('link-break', l(:label_delete_link_to_subtask)), issue_path( {:id => child.id, :issue => {:parent_issue_id => ''}, :back_url => issue_path(issue.id), :no_flash => '1'} @@ -207,7 +207,7 @@ module IssuesHelper buttons = if manage_relations link_to( - icon_with_label('link-break', l(:label_relation_delete)), + sprite_icon('link-break', l(:label_relation_delete)), relation_path(relation, issue_id: issue.id), :remote => true, :method => :delete, diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb index e4c23995e..6c22fc4ca 100644 --- a/app/helpers/journals_helper.rb +++ b/app/helpers/journals_helper.rb @@ -33,7 +33,7 @@ module JournalsHelper dropbown_links << copy_object_url_link(issue_url(issue, anchor: "note-#{indice}", only_path: false)) if journal.attachments.size > 1 - dropbown_links << link_to(icon_with_label('download', l(:label_download_all_attachments)), + dropbown_links << link_to(sprite_icon('download', l(:label_download_all_attachments)), container_attachments_download_path(journal), :title => l(:label_download_all_attachments), :class => 'icon icon-download' @@ -46,14 +46,14 @@ module JournalsHelper links << quote_reply(url, "#journal-#{journal.id}-notes", icon_only: true) end if journal.editable_by?(User.current) - links << link_to(icon_with_label('edit', l(:button_edit)), + links << link_to(sprite_icon('edit', l(:button_edit)), edit_journal_path(journal), :remote => true, :method => 'get', :title => l(:button_edit), :class => 'icon-only icon-edit' ) - dropbown_links << link_to(icon_with_label('del', l(:button_delete)), + dropbown_links << link_to(sprite_icon('del', l(:button_delete)), journal_path(journal, :journal => {:notes => ""}), :remote => true, :method => 'put', diff --git a/app/helpers/my_helper.rb b/app/helpers/my_helper.rb index 2957f4e90..16b4ca290 100644 --- a/app/helpers/my_helper.rb +++ b/app/helpers/my_helper.rb @@ -34,8 +34,8 @@ module MyHelper def render_block(block, user) content = render_block_content(block, user) if content.present? - handle = content_tag('span', icon_with_label('reorder', ''), :class => 'icon-only icon-sort-handle sort-handle', :title => l(:button_move)) - close = link_to(icon_with_label('close', l(:button_delete)), + handle = content_tag('span', sprite_icon('reorder', ''), :class => 'icon-only icon-sort-handle sort-handle', :title => l(:button_move)) + close = link_to(sprite_icon('close', l(:button_delete)), {:action => "remove_block", :block => block}, :remote => true, :method => 'post', :class => "icon-only icon-close", :title => l(:button_delete)) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 2cd5aff61..01a5452f7 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -63,10 +63,10 @@ module ProjectsHelper def render_project_action_links links = (+"").html_safe if User.current.allowed_to?(:add_project, nil, :global => true) - links << link_to(icon_with_label('add', l(:label_project_new)), new_project_path, :class => 'icon icon-add') + links << link_to(sprite_icon('add', l(:label_project_new)), new_project_path, :class => 'icon icon-add') end if User.current.admin? - links << link_to(icon_with_label('settings', l(:label_administration)), admin_projects_path, :class => 'icon icon-settings') + links << link_to(sprite_icon('settings', l(:label_administration)), admin_projects_path, :class => 'icon icon-settings') end links end @@ -80,8 +80,8 @@ module ProjectsHelper classes += %w(icon icon-bookmarked-project) if bookmarked_project_ids.include?(project.id) s = link_to_project(project, {}, :class => classes.uniq.join(' ')) - s << icon_with_label('user', l(:label_my_projects), icon_only: true) if User.current.member_of?(project) - s << icon_with_label('bookmarked', l(:label_my_bookmarks), icon_only: true) if bookmarked_project_ids.include?(project.id) + s << sprite_icon('user', l(:label_my_projects), icon_only: true) if User.current.member_of?(project) + s << sprite_icon('bookmarked', l(:label_my_bookmarks), icon_only: true) if bookmarked_project_ids.include?(project.id) if project.description.present? s << content_tag('div', textilizable(project.short_description, :project => project), :class => 'wiki description') end @@ -187,12 +187,12 @@ module ProjectsHelper css << "icon-bookmark" icon = "bookmark-delete" method = "delete" - text = icon_with_label(icon, l(:button_project_bookmark_delete)) + text = sprite_icon(icon, l(:button_project_bookmark_delete)) else css << "icon-bookmark-off" icon = "bookmark-add" method = "post" - text = icon_with_label(icon, l(:button_project_bookmark)) + text = sprite_icon(icon, l(:button_project_bookmark)) end url = bookmark_project_path(project) diff --git a/app/helpers/projects_queries_helper.rb b/app/helpers/projects_queries_helper.rb index 7c978f350..302ec5055 100644 --- a/app/helpers/projects_queries_helper.rb +++ b/app/helpers/projects_queries_helper.rb @@ -24,8 +24,8 @@ module ProjectsQueriesHelper case column.name when :name link_to_project(item) + - (tag.span(icon_with_label('user', l(:label_my_projects), icon_only: true), class: 'icon-only icon-user my-project') if User.current.member_of?(item)) + - (tag.span(icon_with_label('bookmarked', l(:label_my_bookmarks), icon_only: true), class: 'icon-only icon-bookmarked-project') if User.current.bookmarked_project_ids.include?(item.id)) + (tag.span(sprite_icon('user', l(:label_my_projects), icon_only: true), class: 'icon-only icon-user my-project') if User.current.member_of?(item)) + + (tag.span(sprite_icon('bookmarked', l(:label_my_bookmarks), icon_only: true), class: 'icon-only icon-bookmarked-project') if User.current.bookmarked_project_ids.include?(item.id)) when :short_description if item.description? # Sets :inline_attachments to false to avoid performance issues diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 2712b6151..d2991fd25 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -225,7 +225,7 @@ module QueriesHelper end content = link_to( - icon_with_label(icon, column.caption), + sprite_icon(icon, column.caption), {:params => request.query_parameters.deep_merge(sort_param)}, link_options ) @@ -519,7 +519,7 @@ module QueriesHelper def link_to_clear_query(params = {:set_filter => 1, :sort => '', :project_id => @project}) link_to( - icon_with_label('clear-query', l(:button_clear)), + sprite_icon('clear-query', l(:button_clear)), params, :class => 'icon-only icon-clear-query', :title => l(:button_clear) diff --git a/app/helpers/sort_helper.rb b/app/helpers/sort_helper.rb index b827c61c4..77b01e16a 100644 --- a/app/helpers/sort_helper.rb +++ b/app/helpers/sort_helper.rb @@ -127,7 +127,7 @@ module SortHelper caption = column.to_s.humanize unless caption sort_options = {:sort => @sort_criteria.add(column.to_s, order).to_param} - link_to(icon_with_label(icon, caption), {:params => request.query_parameters.merge(sort_options)}, :class => css) + link_to(sprite_icon(icon, caption), { :params => request.query_parameters.merge(sort_options)}, :class => css) end # Returns a table header tag with a sort link for the named column diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 71527b87b..0da236e38 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -69,17 +69,17 @@ module UsersHelper url = {:controller => 'users', :action => 'update', :id => user, :page => params[:page], :status => params[:status], :tab => nil} if user.locked? - link_to icon_with_label('unlock', l(:button_unlock)), url.merge(:user => {:status => User::STATUS_ACTIVE}), :method => :put, :class => 'icon icon-unlock' + link_to sprite_icon('unlock', l(:button_unlock)), url.merge(:user => { :status => User::STATUS_ACTIVE}), :method => :put, :class => 'icon icon-unlock' elsif user.registered? - link_to icon_with_label('unlock', l(:button_activate)), url.merge(:user => {:status => User::STATUS_ACTIVE}), :method => :put, :class => 'icon icon-unlock' + link_to sprite_icon('unlock', l(:button_activate)), url.merge(:user => { :status => User::STATUS_ACTIVE}), :method => :put, :class => 'icon icon-unlock' elsif user != User.current - link_to icon_with_label('lock', l(:button_lock)), url.merge(:user => {:status => User::STATUS_LOCKED}), :method => :put, :class => 'icon icon-lock' + link_to sprite_icon('lock', l(:button_lock)), url.merge(:user => { :status => User::STATUS_LOCKED}), :method => :put, :class => 'icon icon-lock' end end def additional_emails_link(user) if user.email_addresses.count > 1 || Setting.max_additional_emails.to_i > 0 - link_to icon_with_label('email', l(:label_email_address_plural)), user_email_addresses_path(@user), :class => 'icon icon-email-add', :remote => true + link_to sprite_icon('email', l(:label_email_address_plural)), user_email_addresses_path(@user), :class => 'icon icon-email-add', :remote => true end end diff --git a/app/helpers/versions_helper.rb b/app/helpers/versions_helper.rb index 4f88ba5ee..98b16415b 100644 --- a/app/helpers/versions_helper.rb +++ b/app/helpers/versions_helper.rb @@ -101,7 +101,7 @@ module VersionsHelper :tracker_id => new_issue_tracker, :fixed_version_id => version.id } - link_to icon_with_label('add', l(:label_issue_new)), new_project_issue_path(project, :issue => attrs, :back_url => version_path(version)), :class => 'icon icon-add' + link_to sprite_icon('add', l(:label_issue_new)), new_project_issue_path(project, :issue => attrs, :back_url => version_path(version)), :class => 'icon icon-add' end end end diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 286eaa8e6..f7763e41b 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -33,7 +33,7 @@ module WatchersHelper ) method = watched ? 'delete' : 'post' - link_to icon_with_label('fav', text), url, :remote => true, :method => method, :class => css + link_to sprite_icon('fav', text), url, :remote => true, :method => method, :class => css end # Returns the css class used to identify watch links for a given +object+ @@ -61,7 +61,7 @@ module WatchersHelper :object_id => object.id, :user_id => user} s << ' ' - s << link_to(icon_with_label('del', l(:button_delete)), url, + s << link_to(sprite_icon('del', l(:button_delete)), url, :remote => true, :method => 'delete', :class => "delete icon-only icon-del", :title => l(:button_delete)) diff --git a/app/views/activities/_activities.html.erb b/app/views/activities/_activities.html.erb index 5c19585d0..6e830ed72 100644 --- a/app/views/activities/_activities.html.erb +++ b/app/views/activities/_activities.html.erb @@ -4,7 +4,7 @@
<% sort_activity_events(events_by_day[day]).each do |e, in_group| -%>
<%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>"> - <%= icon_for_event_type e.event_type %> + <%= activity_event_type_icon e.event_type %> <%= avatar(e.event_author) if e.respond_to?(:event_author) %> <%= format_time(e.event_datetime, false) %> <%= content_tag('span', e.project, :class => 'project') if @project.nil? || @project != e.project %> diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb index 91a981a59..baaf4e7d3 100644 --- a/app/views/admin/projects.html.erb +++ b/app/views/admin/projects.html.erb @@ -1,5 +1,5 @@
-<%= link_to icon_with_label('add', l(:label_project_new)), new_project_path, :class => 'icon icon-add' %> +<%= link_to sprite_icon('add', l(:label_project_new)), new_project_path, :class => 'icon icon-add' %>

<%= @query.new_record? ? l(:label_project_plural) : @query.name %>

diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index 1eac93344..846ba9496 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -1,11 +1,11 @@
- <%= link_to(icon_with_label('edit', l(:label_edit_attachments)), + <%= link_to(sprite_icon('edit', l(:label_edit_attachments)), container_attachments_edit_path(container), :title => l(:label_edit_attachments), :class => 'icon-only icon-edit ' ) if options[:editable] %> - <%= link_to(icon_with_label('download', l(:label_download_all_attachments)), + <%= link_to(sprite_icon('download', l(:label_download_all_attachments)), container_attachments_download_path(container), :title => l(:label_download_all_attachments), :class => 'icon-only icon-download ' @@ -15,9 +15,9 @@ <% for attachment in attachments %> - <%= link_to_attachment attachment, class: 'icon icon-attachment ', icon: 'attachment' -%> + <%= link_to_attachment attachment, class: 'icon icon-attachment ', sprite_icon: 'attachment' -%> (<%= number_to_human_size attachment.filesize %>) - <%= link_to_attachment attachment, class: 'icon-only icon-download ', title: l(:button_download), download: true, icon: 'download' -%> + <%= link_to_attachment attachment, class: 'icon-only icon-download ', title: l(:button_download), download: true, sprite_icon: 'download' -%> <%= attachment.description unless attachment.description.blank? %> @@ -27,7 +27,7 @@ <% if options[:deletable] %> - <%= link_to icon_with_label('del', l(:button_delete)), attachment_path(attachment), + <%= link_to sprite_icon('del', l(:button_delete)), attachment_path(attachment), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :class => 'delete icon-only icon-del ', diff --git a/app/views/attachments/edit_all.html.erb b/app/views/attachments/edit_all.html.erb index 2b611ebaf..749b53dbb 100644 --- a/app/views/attachments/edit_all.html.erb +++ b/app/views/attachments/edit_all.html.erb @@ -11,7 +11,7 @@ <% @attachments.each do |attachment| %> - <%= icon_with_label('attachment', attachment.filename_was) %> + <%= sprite_icon('attachment', attachment.filename_was) %> (<%= number_to_human_size attachment.filesize %>) <%= attachment.author %>, <%= format_time(attachment.created_on) %> diff --git a/app/views/auth_sources/index.html.erb b/app/views/auth_sources/index.html.erb index 4d9634857..6095580df 100644 --- a/app/views/auth_sources/index.html.erb +++ b/app/views/auth_sources/index.html.erb @@ -1,5 +1,5 @@
-<%= link_to icon_with_label('add', l(:label_auth_source_new)), {:action => 'new'}, :class => 'icon icon-add' %> +<%= link_to sprite_icon('add', l(:label_auth_source_new)), { :action => 'new'}, :class => 'icon icon-add' %>
<%= title l(:label_auth_source_plural) %> @@ -20,7 +20,7 @@ <%= source.host %> <%= source.users.count %> - <%= link_to icon_with_label('arrow-right', l(:button_test)), try_connection_auth_source_path(source), :class => 'icon icon-test' %> + <%= link_to sprite_icon('arrow-right', l(:button_test)), try_connection_auth_source_path(source), :class => 'icon icon-test' %> <%= delete_link auth_source_path(source) %> diff --git a/app/views/boards/index.html.erb b/app/views/boards/index.html.erb index ee43b3427..328795e2c 100644 --- a/app/views/boards/index.html.erb +++ b/app/views/boards/index.html.erb @@ -1,7 +1,7 @@
- <%= link_to_if_authorized icon_with_label('settings', l(:label_settings)), - {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'}, - :class => 'icon icon-settings' if User.current.allowed_to?(:manage_boards, @project) %> + <%= link_to_if_authorized sprite_icon('settings', l(:label_settings)), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_boards, @project) %>

<%= l(:label_board_plural) %>

@@ -21,7 +21,7 @@ <% end %> - <%= link_to icon_with_label('comment', board.name), project_board_path(board.project, board), :class => "board icon icon-comment" %> + <%= link_to sprite_icon('comment', board.name), project_board_path(board.project, board), :class => "board icon icon-comment" %>

<%= board.description %>

<%= board.topics_count %> diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index 617c7807f..b2aff9a53 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -1,14 +1,14 @@ <%= board_breadcrumb(@board) %>
-<%= link_to icon_with_label('add', l(:label_message_new)), +<%= link_to sprite_icon('add', l(:label_message_new)), new_board_message_path(@board), :class => 'icon icon-add', :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.allowed_to?(:add_messages, @board.project) %> <%= watcher_link(@board, User.current) %> -<%= link_to_if_authorized icon_with_label('settings', l(:label_settings)), - {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'}, - :class => 'icon icon-settings' if User.current.allowed_to?(:manage_boards, @project) %> +<%= link_to_if_authorized sprite_icon('settings', l(:label_settings)), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_boards, @project) %>
diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb index fa0f1cbc8..b67b93238 100644 --- a/app/views/calendars/show.html.erb +++ b/app/views/calendars/show.html.erb @@ -35,15 +35,15 @@ <%= label_tag('year', l(:label_year)) %> <%= select_year(@year, :prefix => "year", :discard_type => true) %> - <%= link_to_function icon_with_label('checked', l(:button_apply)), '$("#query_form").submit()', :class => 'icon icon-checked' %> - <%= link_to icon_with_label('reload', l(:button_clear)), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %> + <%= link_to_function sprite_icon('checked', l(:button_apply)), '$("#query_form").submit()', :class => 'icon icon-checked' %> + <%= link_to sprite_icon('reload', l(:button_clear)), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %> <% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %> - <%= link_to_function icon_with_label('save', l(:button_save_object, object_name: l(:label_query).downcase)), + <%= link_to_function sprite_icon('save', l(:button_save_object, object_name: l(:label_query).downcase)), "$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit();", :class => 'icon icon-save' %> <% end %> <% if !@query.new_record? && @query.editable_by?(User.current) %> - <%= link_to icon_with_label('edit', l(:button_edit_object, object_name: l(:label_query).downcase)), edit_query_path(@query, :calendar => 1), :class => 'icon icon-edit' %> + <%= link_to sprite_icon('edit', l(:button_edit_object, object_name: l(:label_query).downcase)), edit_query_path(@query, :calendar => 1), :class => 'icon icon-edit' %> <%= delete_link query_path(@query, :calendar => 1), {}, l(:button_delete_object, object_name: l(:label_query).downcase) %> <% end %>

@@ -57,9 +57,9 @@ <%= call_hook(:view_calendars_show_bottom, :year => @year, :month => @month, :project => @project, :query => @query) %>

- <%= icon_with_label('bullet-go', l(:text_tip_issue_begin_day)) %> - <%= icon_with_label('bullet-end', l(:text_tip_issue_end_day)) %> - <%= icon_with_label('bullet-go-end', l(:text_tip_issue_begin_end_day)) %> + <%= sprite_icon('bullet-go', l(:text_tip_issue_begin_day)) %> + <%= sprite_icon('bullet-end', l(:text_tip_issue_end_day)) %> + <%= sprite_icon('bullet-go-end', l(:text_tip_issue_begin_end_day)) %>

<% end %> diff --git a/app/views/common/error.html.erb b/app/views/common/error.html.erb index 4a7e2bf0c..007063f9c 100644 --- a/app/views/common/error.html.erb +++ b/app/views/common/error.html.erb @@ -5,7 +5,7 @@ <% end %> <% if @archived_project && User.current.admin? %> -

<%= link_to icon_with_label('unlock', l(:button_unarchive)), unarchive_project_path(@archived_project), :method => :post, :class => 'icon icon-unlock' %>

+

<%= link_to sprite_icon('unlock', l(:button_unarchive)), unarchive_project_path(@archived_project), :method => :post, :class => 'icon icon-unlock' %>

<% end %>

<%= l(:button_back) %>

diff --git a/app/views/common/feed.atom.builder b/app/views/common/feed.atom.builder index eed514277..b349595e3 100644 --- a/app/views/common/feed.atom.builder +++ b/app/views/common/feed.atom.builder @@ -6,7 +6,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do xml.link "rel" => "self", "href" => url_for(:params => request.query_parameters, :only_path => false, :format => 'atom') xml.link "rel" => "alternate", "href" => url_for(:params => request.query_parameters.merge(:format => nil, :key => nil), :only_path => false) xml.id home_url - xml.icon favicon_url + xml.icon favicon_url xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema) xml.author {xml.name "#{Setting.app_title}"} xml.generator(:uri => Redmine::Info.url) {xml.text! Redmine::Info.app_name} diff --git a/app/views/context_menus/issues.html.erb b/app/views/context_menus/issues.html.erb index bb8f2add6..94304108f 100644 --- a/app/views/context_menus/issues.html.erb +++ b/app/views/context_menus/issues.html.erb @@ -2,11 +2,11 @@ <%= call_hook(:view_issues_context_menu_start, {:issues => @issues, :can => @can, :back => @back }) %> <% if @issue -%> -
  • <%= context_menu_link icon_with_label('edit', l(:button_edit)), edit_issue_path(@issue), - :class => 'icon icon-edit', :disabled => !@can[:edit] %>
  • +
  • <%= context_menu_link sprite_icon('edit', l(:button_edit)), edit_issue_path(@issue), + :class => 'icon icon-edit', :disabled => !@can[:edit] %>
  • <% else %> -
  • <%= context_menu_link icon_with_label('edit', l(:label_bulk_edit)), bulk_edit_issues_path(:ids => @issue_ids), - :class => 'icon icon-edit', :disabled => !@can[:edit] %>
  • +
  • <%= context_menu_link sprite_icon('edit', l(:label_bulk_edit)), bulk_edit_issues_path(:ids => @issue_ids), + :class => 'icon icon-edit', :disabled => !@can[:edit] %>
  • <% end %> <% if @allowed_statuses.present? %> @@ -130,10 +130,10 @@
  • <%= l(:label_issue_watchers) %>
      -
    • <%= context_menu_link icon_with_label('add', l(:button_add)), - new_watchers_path(:object_type => 'issue', :object_id => @issue_ids), - :remote => true, - :class => 'icon icon-add' %>
    • +
    • <%= context_menu_link sprite_icon('add', l(:button_add)), + new_watchers_path(:object_type => 'issue', :object_id => @issue_ids), + :remote => true, + :class => 'icon icon-add' %>
  • <% end %> @@ -143,28 +143,28 @@ <% end %> <% unless @issue %> -
  • <%= context_menu_link icon_with_label('list', l(:button_filter)), _project_issues_path(@project, :set_filter => 1, :status_id => "*", :issue_id => @issue_ids.join(","), :c => @columns), - :class => 'icon icon-list' %>
  • +
  • <%= context_menu_link sprite_icon('list', l(:button_filter)), _project_issues_path(@project, :set_filter => 1, :status_id => "*", :issue_id => @issue_ids.join(","), :c => @columns), + :class => 'icon icon-list' %>
  • <% end %> <% if @issue.present? %> <% if @can[:log_time] -%> -
  • <%= context_menu_link icon_with_label('time-add', l(:button_log_time)), new_issue_time_entry_path(@issue), - :class => 'icon icon-time-add' %>
  • +
  • <%= context_menu_link sprite_icon('time-add', l(:button_log_time)), new_issue_time_entry_path(@issue), + :class => 'icon icon-time-add' %>
  • <% end %> <% if @can[:add_subtask] -%> -
  • <%= context_menu_link icon_with_label('add', l(:button_add_subtask)), url_for_new_subtask(@issue), - :class => 'icon icon-add' %>
  • +
  • <%= context_menu_link sprite_icon('add', l(:button_add_subtask)), url_for_new_subtask(@issue), + :class => 'icon icon-add' %>
  • <% end %>
  • <%= copy_object_url_link(issue_url(@issue)) %>
  • -
  • <%= context_menu_link icon_with_label('copy', l(:button_copy)), project_copy_issue_path(@project, @issue), - :class => 'icon icon-copy', :disabled => !@can[:copy] %>
  • +
  • <%= context_menu_link sprite_icon('copy', l(:button_copy)), project_copy_issue_path(@project, @issue), + :class => 'icon icon-copy', :disabled => !@can[:copy] %>
  • <% else %>
  • <%= copy_object_url_link(_project_issues_url(@project, set_filter: 1, status_id: '*', issue_id: @issue_ids.join(','))) %>
  • -
  • <%= context_menu_link icon_with_label('copy', l(:button_copy)), bulk_edit_issues_path(:ids => @issue_ids, :copy => '1'), - :class => 'icon icon-copy', :disabled => !@can[:copy] %>
  • +
  • <%= context_menu_link sprite_icon('copy', l(:button_copy)), bulk_edit_issues_path(:ids => @issue_ids, :copy => '1'), + :class => 'icon icon-copy', :disabled => !@can[:copy] %>
  • <% end %> -
  • <%= context_menu_link icon_with_label('del', l(:button_delete_object, object_name: (@issue_ids.size > 1 ? l(:label_issue_plural) : l(:label_issue)).downcase)), issues_path(:ids => @issue_ids, :back_url => @back), +
  • <%= context_menu_link sprite_icon('del', l(:button_delete_object, object_name: (@issue_ids.size > 1 ? l(:label_issue_plural) : l(:label_issue)).downcase)), issues_path(:ids => @issue_ids, :back_url => @back), :method => :delete, :data => {:confirm => issues_destroy_confirmation_message(@issues)}, :class => 'icon icon-del', :disabled => !@can[:delete] %>
  • <%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %> diff --git a/app/views/context_menus/projects.html.erb b/app/views/context_menus/projects.html.erb index 390843ffb..ea395f75e 100644 --- a/app/views/context_menus/projects.html.erb +++ b/app/views/context_menus/projects.html.erb @@ -1,21 +1,21 @@
      <% if @project && !@project.scheduled_for_deletion? %> <% if @project.archived? %> -
    • <%= context_menu_link icon_with_label('unlock', l(:button_unarchive)), unarchive_project_path(@project), method: :post, class: 'icon icon-unlock' %>
    • +
    • <%= context_menu_link sprite_icon('unlock', l(:button_unarchive)), unarchive_project_path(@project), method: :post, class: 'icon icon-unlock' %>
    • <% else %> -
    • <%= context_menu_link icon_with_label('lock', l(:button_archive)), archive_project_path(@project), data: {confirm: l(:text_project_archive_confirmation, @project.to_s)}, method: :post, class: 'icon icon-lock' %>
    • +
    • <%= context_menu_link sprite_icon('lock', l(:button_archive)), archive_project_path(@project), data: { confirm: l(:text_project_archive_confirmation, @project.to_s)}, method: :post, class: 'icon icon-lock' %>
    • <% end %>
    • - <%= context_menu_link icon_with_label('copy', l(:button_copy)), copy_project_path(@projects), class: 'icon icon-copy' %> + <%= context_menu_link sprite_icon('copy', l(:button_copy)), copy_project_path(@projects), class: 'icon icon-copy' %>
    • - <%= context_menu_link icon_with_label('del', l(:button_delete)), project_path(@project, back_url: @back), method: :delete, class: 'icon icon-del' %> + <%= context_menu_link sprite_icon('del', l(:button_delete)), project_path(@project, back_url: @back), method: :delete, class: 'icon icon-del' %>
    • <% else %>
    • - <%= context_menu_link icon_with_label('del', l(:button_delete)), - {controller: 'projects', action: 'bulk_destroy', ids: @projects.map(&:id), back_url: @back}, - method: :delete, data: {confirm: l(:text_projects_bulk_destroy_confirmation)}, class: 'icon icon-del' %> + <%= context_menu_link sprite_icon('del', l(:button_delete)), + {controller: 'projects', action: 'bulk_destroy', ids: @projects.map(&:id), back_url: @back}, + method: :delete, data: {confirm: l(:text_projects_bulk_destroy_confirmation)}, class: 'icon icon-del' %>
    • <% end %>
    diff --git a/app/views/context_menus/time_entries.html.erb b/app/views/context_menus/time_entries.html.erb index 2282a6ea3..c350aa337 100644 --- a/app/views/context_menus/time_entries.html.erb +++ b/app/views/context_menus/time_entries.html.erb @@ -1,10 +1,10 @@
      <% if !@time_entry.nil? -%> -
    • <%= context_menu_link icon_with_label('edit', l(:button_edit)), {:controller => 'timelog', :action => 'edit', :id => @time_entry}, - :class => 'icon icon-edit', :disabled => !@can[:edit] %>
    • +
    • <%= context_menu_link sprite_icon('edit', l(:button_edit)), { :controller => 'timelog', :action => 'edit', :id => @time_entry}, + :class => 'icon icon-edit', :disabled => !@can[:edit] %>
    • <% else %> -
    • <%= context_menu_link icon_with_label('edit', l(:label_bulk_edit)), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)}, - :class => 'icon icon-edit', :disabled => !@can[:edit] %>
    • +
    • <%= context_menu_link sprite_icon('edit', l(:label_bulk_edit)), { :controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)}, + :class => 'icon icon-edit', :disabled => !@can[:edit] %>
    • <% end %> <%= call_hook(:view_time_entries_context_menu_start, {:time_entries => @time_entries, :can => @can, :back => @back }) %> @@ -38,8 +38,8 @@ <%= call_hook(:view_time_entries_context_menu_end, {:time_entries => @time_entries, :can => @can, :back => @back }) %>
    • - <%= context_menu_link icon_with_label('del', l(:button_delete)), - {:controller => 'timelog', :action => 'destroy', :ids => @time_entries.collect(&:id), :back_url => @back}, - :method => :delete, :data => {:confirm => l(:text_time_entries_destroy_confirmation)}, :class => 'icon icon-del', :disabled => !@can[:delete] %> + <%= context_menu_link sprite_icon('del', l(:button_delete)), + {:controller => 'timelog', :action => 'destroy', :ids => @time_entries.collect(&:id), :back_url => @back}, + :method => :delete, :data => {:confirm => l(:text_time_entries_destroy_confirmation)}, :class => 'icon icon-del', :disabled => !@can[:delete] %>
    diff --git a/app/views/context_menus/users.html.erb b/app/views/context_menus/users.html.erb index 36dd1837c..5b6c783b7 100644 --- a/app/views/context_menus/users.html.erb +++ b/app/views/context_menus/users.html.erb @@ -2,38 +2,38 @@ <% if @user %> <% if @user.locked? %>
  • - <%= context_menu_link icon_with_label('unlock', l(:button_unlock)), user_path(@user, user: { status: User::STATUS_ACTIVE }, back_url: @back), method: :put, class: 'icon icon-unlock' %> + <%= context_menu_link sprite_icon('unlock', l(:button_unlock)), user_path(@user, user: { status: User::STATUS_ACTIVE }, back_url: @back), method: :put, class: 'icon icon-unlock' %>
  • <% elsif User.current != @user %>
  • - <%= context_menu_link icon_with_label('lock', l(:button_lock)), user_path(@user, user: { status: User::STATUS_LOCKED }, back_url: @back), method: :put, class: 'icon icon-lock' %> + <%= context_menu_link sprite_icon('lock', l(:button_lock)), user_path(@user, user: { status: User::STATUS_LOCKED }, back_url: @back), method: :put, class: 'icon icon-lock' %>
  • <% end %>
  • - <%= context_menu_link icon_with_label('edit', l(:button_edit)), edit_user_path(@user, back_url: @back), class: 'icon icon-edit' %> + <%= context_menu_link sprite_icon('edit', l(:button_edit)), edit_user_path(@user, back_url: @back), class: 'icon icon-edit' %>
  • <% unless User.current == @user %>
  • - <%= context_menu_link icon_with_label('del', l(:button_delete)), user_path(@user, back_url: @back), - method: :delete, class: 'icon icon-del' %> + <%= context_menu_link sprite_icon('del', l(:button_delete)), user_path(@user, back_url: @back), + method: :delete, class: 'icon icon-del' %>
  • <% end %> <% else %> <% unless @users.all?(&:locked?) %>
  • - <%= context_menu_link icon_with_label('lock', l(:button_lock)), bulk_lock_users_path(ids: @users.map(&:id)), method: :post, class: 'icon icon-lock' %> + <%= context_menu_link sprite_icon('lock', l(:button_lock)), bulk_lock_users_path(ids: @users.map(&:id)), method: :post, class: 'icon icon-lock' %>
  • <% else %>
  • - <%= context_menu_link icon_with_label('unlock', l(:button_unlock)), bulk_unlock_users_path(ids: @users.map(&:id)), method: :post, class: 'icon icon-unlock' %> + <%= context_menu_link sprite_icon('unlock', l(:button_unlock)), bulk_unlock_users_path(ids: @users.map(&:id)), method: :post, class: 'icon icon-unlock' %>
  • <% end %>
  • - <%= context_menu_link icon_with_label('del', l(:button_delete)), - {controller: 'users', action: 'bulk_destroy', ids: @users.map(&:id)}, - method: :delete, class: 'icon icon-del' %> + <%= context_menu_link sprite_icon('del', l(:button_delete)), + {controller: 'users', action: 'bulk_destroy', ids: @users.map(&:id)}, + method: :delete, class: 'icon icon-del' %>
  • <% end %> diff --git a/app/views/custom_fields/_index.html.erb b/app/views/custom_fields/_index.html.erb index b350d4734..fe4074548 100644 --- a/app/views/custom_fields/_index.html.erb +++ b/app/views/custom_fields/_index.html.erb @@ -22,7 +22,7 @@ <% end %> <%= reorder_handle(custom_field, :url => custom_field_path(custom_field), :param => 'custom_field') %> - <%= link_to_function icon_with_label('copy', l(:button_copy)), "location.href = '#{new_custom_field_path(:copy => custom_field)}&type=' + encodeURIComponent(($('.tabs a.selected').attr('id')||'').split('tab-').pop())", :class => 'icon icon-copy' %> + <%= link_to_function sprite_icon('copy', l(:button_copy)), "location.href = '#{new_custom_field_path(:copy => custom_field)}&type=' + encodeURIComponent(($('.tabs a.selected').attr('id')||'').split('tab-').pop())", :class => 'icon icon-copy' %> <%= delete_link custom_field_path(custom_field) %> diff --git a/app/views/custom_fields/formats/_enumeration.erb b/app/views/custom_fields/formats/_enumeration.erb index a0529e80d..08924951f 100644 --- a/app/views/custom_fields/formats/_enumeration.erb +++ b/app/views/custom_fields/formats/_enumeration.erb @@ -1,7 +1,7 @@ <% unless @custom_field.new_record? %>

    - <%= link_to icon_with_label('edit', l(:button_edit)), custom_field_enumerations_path(@custom_field), :class => 'icon icon-edit' %> + <%= link_to sprite_icon('edit', l(:button_edit)), custom_field_enumerations_path(@custom_field), :class => 'icon icon-edit' %>

    <% if @custom_field.enumerations.active.any? %>

    <%= f.select :default_value, @custom_field.enumerations.active.map{|v| [v.name, v.id.to_s]}, :include_blank => true %>

    diff --git a/app/views/custom_fields/index.html.erb b/app/views/custom_fields/index.html.erb index 0af9c54ea..a0bc1c2fa 100644 --- a/app/views/custom_fields/index.html.erb +++ b/app/views/custom_fields/index.html.erb @@ -1,5 +1,5 @@
    -<%= link_to_function icon_with_label('add', l(:label_custom_field_new)), "location.href = '#{new_custom_field_path}?tab=' + encodeURIComponent(($('.tabs a.selected').attr('id')||'').split('tab-').pop())", :class => 'icon icon-add' %> +<%= link_to_function sprite_icon('add', l(:label_custom_field_new)), "location.href = '#{new_custom_field_path}?tab=' + encodeURIComponent(($('.tabs a.selected').attr('id')||'').split('tab-').pop())", :class => 'icon icon-add' %>
    <%= title l(:label_custom_field_plural) %> diff --git a/app/views/documents/index.html.erb b/app/views/documents/index.html.erb index b6458949d..2c726a37f 100644 --- a/app/views/documents/index.html.erb +++ b/app/views/documents/index.html.erb @@ -1,6 +1,6 @@
    -<%= link_to icon_with_label('add', l(:label_document_new)), new_project_document_path(@project), :class => 'icon icon-add', - :onclick => 'showAndScrollTo("add-document", "document_title"); return false;' if User.current.allowed_to?(:add_documents, @project) %> +<%= link_to sprite_icon('add', l(:label_document_new)), new_project_document_path(@project), :class => 'icon icon-add', + :onclick => 'showAndScrollTo("add-document", "document_title"); return false;' if User.current.allowed_to?(:add_documents, @project) %>