From 169b26dbb6962eda0a8b97fc098ccb074ac4e749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C4=82LTEANU?= Date: Sat, 17 Aug 2024 17:01:12 +0300 Subject: [PATCH] Replace images with SVG icons. diff --git a/app/assets/images/icons.svg b/app/assets/images/icons.svg new file mode 100644 index 000000000..88f17e2ae --- /dev/null +++ b/app/assets/images/icons.svg @@ -0,0 +1,352 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 8ab85f269..5dd96340d 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -121,8 +121,8 @@ pre, code {font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace;} #sidebar ul li, ul.flat li {list-style-type:none;margin: 0px 2px 0px 0px; padding: 0px 0px 0px 0px;} #sidebar div.wiki ul {margin:inherit; padding-left:40px;} #sidebar div.wiki ul li {list-style-type:inherit;} -#sidebar a.icon-only {opacity: 0.4; margin-left: 5px;} -#sidebar a.icon-only:hover {opacity: 1;} +#sidebar a.icon-only svg {opacity: 0.2; margin-left: 5px;} +#sidebar a.icon-only:hover svg {opacity: 1;} #sidebar span.icon-warning {margin-left: 5px;} #sidebar li input[type=checkbox] {height: 20px;} @@ -238,8 +238,8 @@ div + .drdn-items {border-top:1px solid #ccc;} .contextual .drdn-content {top:18px;} .contextual .drdn-items {padding:2px; min-width: 160px;} -.contextual .drdn-items>a {padding: 5px 8px;} -.contextual .drdn-items>a.icon {padding-left: 24px; background-position-x: 4px;} +.contextual .drdn-items>a {display: flex; padding: 5px 8px;} +.contextual .drdn-items>a.icon:not(:has(svg)) {padding-left: 24px; background-position-x: 4px;} .contextual .drdn-items>a:hover {color:#2A5685; border:1px solid #628db6; background-color:#eef5fd; border-radius:3px;} #project-jump.drdn {width:200px;display:inline-block;} @@ -275,7 +275,7 @@ table.list td.tick {width:15%} table.list td.checkbox { width: 15px; padding: 2px 0 0 0; } table.list .checkbox input {padding:0px; height: initial;} table.list td.buttons, div.buttons { white-space:nowrap; text-align: right; } -table.list td.buttons a, div.buttons a { margin-right: 0.6em; } +table.list td.buttons a, div.buttons a, table.list td.buttons span.icon-only { margin-right: 0.6em; } table.list td.buttons a:last-child, div.buttons a:last-child { margin-right: 0; } table.list td.buttons img, div.buttons img {vertical-align:middle;} table.list td.reorder {width:15%; white-space:nowrap; text-align:center; } @@ -336,7 +336,7 @@ tr.changeset td.author { text-align: center; width: 15%; white-space:nowrap;} tr.changeset td.committed_on { text-align: center; width: 15%; white-space:nowrap;} table.files tbody th {text-align:left;} -table.files tr.file td.filename { text-align: left; padding-left: 24px; } +table.files tr.file td.filename { text-align: left; } table.files tr.file td.digest { font-size: 80%; } table.members td.roles, table.memberships td.roles { width: 45%; } @@ -640,7 +640,6 @@ fieldset#date-range p { margin: 2px 0 2px 0; } #issue_is_private_wrap {float:right; margin-right:1em;} .toggle-multiselect { margin-right:5px; cursor:pointer;} .buttons { font-size: 0.9em; margin-bottom: 1.4em; margin-top: 1em; } -.buttons .icon {padding-bottom:3px; padding-top:1px;} div#issue-changesets {float:right; width:45%; margin-left: 1em; margin-bottom: 1em; background: #fff; padding-left: 1em; font-size: 90%;} div#issue-changesets div.changeset {border-bottom: 1px solid #ddd; padding: 4px;} @@ -815,7 +814,7 @@ select.expandable {vertical-align:top;} textarea#custom_field_possible_values {width: 95%; resize:vertical} textarea#custom_field_default_value {width: 95%; resize:vertical} -.sort-handle {display:inline-block; vertical-align:middle; cursor: move;} +.sort-handle { cursor: move; } input#content_comments {width: 99%} @@ -1621,13 +1620,51 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container { white-space: pre-wrap; } -/***** Icons *****/ -.icon { +/***** SVG Icons *****/ +.icon, .icon-only { + display: inline-flex; +} + +a.icon svg, a.icon-only svg { + fill: #169; +} + +a.icon:hover svg, a.icon-only:hover svg { + fill: #c61a1a; +} + +.icon-only span { + display: none; +} + +svg { + width: 0; + height: 0; + + &.s14 { + width: 14px; + height: 14px; + } +} + +span.icon-label { + margin-left: 4px; +} + +.icon-bookmarked-project svg { + fill: #169; +} +.icon-user svg { + fill: #169; +} + +/***** Legacy icons *****/ +.icon:not(:has(svg)) { background-position: 0% 50%; background-repeat: no-repeat; padding-left: 20px; } -.icon-only { +.icon-only:not(:has(svg)) { background-position: 0% 50%; background-repeat: no-repeat; padding-left: 16px; @@ -1640,59 +1677,59 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container { font-size: 8px; vertical-align: middle; } -.icon-only::after { +.icon-only:not(:has(svg))::after { content: "\a0"; } -.icon-add { background-image: url(/add.png); } -.icon-edit { background-image: url(/edit.png); } -.icon-copy { background-image: url(/copy.png); } +.icon-add:not(:has(svg)) { background-image: url(/add.png); } +.icon-edit:not(:has(svg)) { background-image: url(/edit.png); } +.icon-copy:not(:has(svg)) { background-image: url(/copy.png); } .icon-duplicate { background-image: url(/duplicate.png); } -.icon-del { background-image: url(/delete.png); } -.icon-move { background-image: url(/move.png); } -.icon-save { background-image: url(/save.png); } -.icon-download { background-image: url(/download.png); } +.icon-del:not(:has(svg)) { background-image: url(/delete.png); } +.icon-move:not(:has(svg)) { background-image: url(/move.png); } +.icon-save:not(:has(svg)) { background-image: url(/save.png); } +.icon-download:not(:has(svg)) { background-image: url(/download.png); } .icon-cancel { background-image: url(/cancel.png); } .icon-multiple { background-image: url(/table_multiple.png); } .icon-folder { background-image: url(/folder.png); } .open .icon-folder { background-image: url(/folder_open.png); } .icon-package { background-image: url(/package.png); } -.icon-user { background-image: url(/user.png); } +.icon-user:not(:has(svg)) { background-image: url(/user.png); } .icon-project, .icon-projects { background-image: url(/projects.png); } -.icon-help { background-image: url(/help.png); } -.icon-attachment { background-image: url(/attachment.png); } -.icon-history { background-image: url(/history.png); } +.icon-help:not(:has(svg)) { background-image: url(/help.png); } +.icon-attachment:not(:has(svg)) { background-image: url(/attachment.png); } +.icon-history:not(:has(svg)) { background-image: url(/history.png); } .icon-time-entry, .icon-time { background-image: url(/time.png); } -.icon-time-add { background-image: url(/time_add.png); } -.icon-stats { background-image: url(/stats.png); } +.icon-time-add:not(:has(svg)) { background-image: url(/time_add.png); } +.icon-stats:not(:has(svg)) { background-image: url(/stats.png); } .icon-warning { background-image: url(/warning.png); } .icon-error { background-image: url(/exclamation.png); } .icon-fav { background-image: url(/fav.png); } .icon-fav-off { background-image: url(/fav_off.png); } -.icon-reload { background-image: url(/reload.png); } -.icon-lock, .icon-locked { background-image: url(/locked.png); } -.icon-unlock { background-image: url(/unlock.png); } -.icon-checked { background-image: url(/toggle_check.png); } +.icon-reload:not(:has(svg)) { background-image: url(/reload.png); } +.icon-lock:not(:has(svg)), .icon-locked:not(:has(svg)) { background-image: url(/locked.png); } +.icon-unlock:not(:has(svg)) { background-image: url(/unlock.png); } +.icon-checked:not(:has(svg)) { background-image: url(/toggle_check.png); } .icon-report { background-image: url(/report.png); } -.icon-comment, .icon-comments { background-image: url(/comment.png); } -.icon-summary { background-image: url(/lightning.png); } +.icon-comment:not(:has(svg)), .icon-comments { background-image: url(/comment.png); } +.icon-summary:not(:has(svg)) { background-image: url(/lightning.png); } .icon-server-authentication { background-image: url(/server_key.png); } .icon-issue { background-image: url(/ticket.png); } .icon-zoom-in { background-image: url(/zoom_in.png); } .icon-zoom-out { background-image: url(/zoom_out.png); } .icon-magnifier { background-image: url(/magnifier.png); } .icon-passwd { background-image: url(/textfield_key.png); } -.icon-arrow-right, .icon-test, .icon-sticky { background-image: url(/bullet_go.png); } +.icon-arrow-right, .icon-test:not(:has(svg)), .icon-sticky { background-image: url(/bullet_go.png); } .icon-email { background-image: url(/email.png); } .icon-email-disabled { background-image: url(/email_disabled.png); } .icon-email-add { background-image: url(/email_add.png); } .icon-ok { background-image: url(/true.png); } .icon-not-ok { background-image: url(/false.png); } -.icon-link-break { background-image: url(/link_break.png); } -.icon-list { background-image: url(/text_list_bullets.png); } -.icon-close { background-image: url(/close.png); } -.icon-close:hover { background-image: url(/close_hl.png); } -.icon-settings { background-image: url(/changeset.png); } +.icon-link-break:not(:has(svg)) { background-image: url(/link_break.png); } +.icon-list:not(:has(svg)) { background-image: url(/text_list_bullets.png); } +.icon-close:not(:has(svg)) { background-image: url(/close.png); } +.icon-close:hover:not(:has(svg)) { background-image: url(/close_hl.png); } +.icon-settings:not(:has(svg)) { background-image: url(/changeset.png); } .icon-group, .icon-groupnonmember, .icon-groupanonymous { background-image: url(/group.png); } .icon-roles { background-image: url(/database_key.png); } .icon-issue-edit { background-image: url(/ticket_edit.png); } @@ -1710,19 +1747,19 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container { .icon-project { background-image: url(/projects.png); } .icon-add-bullet { background-image: url(/bullet_add.png); } .icon-shared { background-image: url(/link.png); } -.icon-actions { background-image: url(/3_bullets.png); } -.icon-sort-handle { background-image: url(/reorder.png); } +.icon-actions:not(:has(svg)) { background-image: url(/3_bullets.png); } +.icon-sort-handle:not(:has(svg)) { background-image: url(/reorder.png); } .icon-expanded { background-image: url(/arrow_down.png); } .icon-collapsed { background-image: url(/arrow_right.png); } -.icon-bookmark { background-image: url(/tag_blue_delete.png); } -.icon-bookmark-off { background-image: url(/tag_blue_add.png); } -.icon-bookmarked-project { background-image: url(/tag_blue.png); } +.icon-bookmark:not(:has(svg)) { background-image: url(/tag_blue_delete.png); } +.icon-bookmark-off:not(:has(svg)) { background-image: url(/tag_blue_add.png); } +.icon-bookmarked-project:not(:has(svg)) { background-image: url(/tag_blue.png); } .icon-sorted-asc { background-image: url(/arrow_down.png); } .icon-sorted-desc { background-image: url(/arrow_up.png); } .icon-toggle-plus { background-image: url(/bullet_toggle_plus.png) } .icon-toggle-minus { background-image: url(/bullet_toggle_minus.png) } -.icon-clear-query { background-image: url(/close_hl.png); } -.icon-import { background-image: url(/database_go.png); } +.icon-clear-query:not(:has(svg)) { background-image: url(/close_hl.png); } +.icon-import:not(:has(svg)) { background-image: url(/database_go.png); } .icon-file { background-image: url(/files/default.png); } .icon-file.text-plain { background-image: url(/files/text.png); } @@ -1742,7 +1779,7 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container { .icon-file.application-pdf { background-image: url(/files/pdf.png); } .icon-file.application-zip { background-image: url(/files/zip.png); } .icon-file.application-gzip { background-image: url(/files/zip.png); } -.icon-copy-link { background-image: url(/copy_link.png); } +.icon-copy-link:not(:has(svg)) { background-image: url(/copy_link.png); } .sort-handle.ajax-loading { background-image: url(/loading.gif); } tr.ui-sortable-helper { border:1px solid #e4e4e4; } diff --git a/app/assets/stylesheets/context_menu.css b/app/assets/stylesheets/context_menu.css index b0acdcca9..ca25697f6 100644 --- a/app/assets/stylesheets/context_menu.css +++ b/app/assets/stylesheets/context_menu.css @@ -41,7 +41,7 @@ #context-menu a { text-decoration:none !important; - padding: 2px 0px 2px 20px; + padding: 4px 8px; width:100%; /* IE */ } #context-menu li>a { width:auto; } /* others */ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d7d588eb3..ca3cc449d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -28,9 +28,11 @@ class ApplicationController < ActionController::Base include Redmine::Hook::Helper include RoutesHelper include AvatarsHelper + include IconsHelper helper :routes helper :avatars + helper :icons class_attribute :accept_api_auth_actions class_attribute :accept_atom_auth_actions diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5a0e9b0b4..578d8aa5d 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(&block) 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 diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb new file mode 100644 index 000000000..d82a74611 --- /dev/null +++ b/app/helpers/icons_helper.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Redmine - project management software +# Copyright (C) 2006- Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +module IconsHelper + DEFAULT_ICON_SIZE = "14" + DEFAULT_SPRITE = "icons" + + def icon_with_label(icon_name, label_text, icon_only: false) + sprite_icon(icon_name) + content_tag(:span, label_text, class: "icon-label") + end + + def sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, sprite: DEFAULT_SPRITE) + sprite_path = "#{sprite}.svg" + + content_tag( + :svg, + content_tag(:use, '', { 'href' => "#{asset_path(sprite_path)}#icon--#{icon_name}" }), + class: "s#{size}", + aria: { + hidden: true + } + ) + end +end diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 5661cf377..5b37a6067 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( - l(:label_delete_link_to_subtask), + icon_with_label('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( - l(:label_relation_delete), + icon_with_label('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 d5c996d87..c3ba50180 100644 --- a/app/helpers/journals_helper.rb +++ b/app/helpers/journals_helper.rb @@ -31,37 +31,37 @@ 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(l(:label_download_all_attachments), + dropbown_links << link_to(icon_with_label('download', l(:label_download_all_attachments)), container_attachments_download_path(journal), :title => l(:label_download_all_attachments), - :class => 'icon icon-download' + :class => 'icon icon-download ' ) end if journal.notes.present? if options[:reply_links] - links << link_to(l(:button_quote), + links << link_to(icon_with_label('comment', l(:button_quote)), quoted_issue_path(issue, :journal_id => journal, :journal_indice => indice), :remote => true, :method => 'post', :title => l(:button_quote), - :class => 'icon-only icon-comment' + :class => 'icon-only icon-comment ' ) end if journal.editable_by?(User.current) - links << link_to(l(:button_edit), + links << link_to(icon_with_label('edit', l(:button_edit)), edit_journal_path(journal), :remote => true, :method => 'get', :title => l(:button_edit), - :class => 'icon-only icon-edit' + :class => 'icon-only icon-edit ' ) - dropbown_links << link_to(l(:button_delete), + dropbown_links << link_to(icon_with_label('del', l(:button_delete)), journal_path(journal, :journal => {:notes => ""}), :remote => true, :method => 'put', :data => {:confirm => l(:text_are_you_sure)}, - :class => 'icon icon-del' + :class => 'icon icon-del ' ) end end diff --git a/app/helpers/my_helper.rb b/app/helpers/my_helper.rb index f65288de1..2957f4e90 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', '', :class => 'icon-only icon-sort-handle sort-handle', :title => l(:button_move)) - close = link_to(l(:button_delete), + 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)), {: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 43c89a350..158c6ac10 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(l(:label_project_new), new_project_path, :class => 'icon icon-add') + links << link_to(icon_with_label('add', l(:label_project_new)), new_project_path, :class => 'icon icon-add') end if User.current.admin? - links << link_to(l(:label_administration), admin_projects_path, :class => 'icon icon-settings') + links << link_to(icon_with_label('settings', l(:label_administration)), admin_projects_path, :class => 'icon icon-settings') end links end @@ -182,12 +182,14 @@ module ProjectsHelper if bookmarked css << "icon-bookmark" + icon = "bookmark" method = "delete" - text = l(:button_project_bookmark_delete) + text = icon_with_label(icon, l(:button_project_bookmark_delete)) else css << "icon-bookmark-off" + icon = "bookmark-off" method = "post" - text = l(:button_project_bookmark) + text = icon_with_label(icon, l(:button_project_bookmark)) end url = bookmark_project_path(project) diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index b5ce6addd..d58dd5d82 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -517,7 +517,7 @@ module QueriesHelper def link_to_clear_query(params = {:set_filter => 1, :sort => '', :project_id => @project}) link_to( - l(:button_clear), + icon_with_label('clear-query', l(:button_clear)), params, :class => 'icon-only icon-clear-query', :title => l(:button_clear) diff --git a/app/helpers/versions_helper.rb b/app/helpers/versions_helper.rb index 5ad319c7f..4f88ba5ee 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 l(:label_issue_new), new_project_issue_path(project, :issue => attrs, :back_url => version_path(version)), :class => 'icon icon-add' + 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' end end end diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 8afd5af31..2071879e3 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -25,7 +25,8 @@ module WatchersHelper return '' unless objects.any? watched = Watcher.any_watched?(objects, user) - css = [watcher_css(objects), watched ? 'icon icon-fav' : 'icon icon-fav-off'].join(' ') + icon = watched ? 'fav' : 'fav-off' + css = [watcher_css(objects), '', 'icon', icon].join(' ') text = watched ? l(:button_unwatch) : l(:button_watch) url = watch_path( :object_type => objects.first.class.to_s.underscore, @@ -33,7 +34,7 @@ module WatchersHelper ) method = watched ? 'delete' : 'post' - link_to text, url, :remote => true, :method => method, :class => css + link_to icon_with_label(icon, text), url, :remote => true, :method => method, :class => css end # Returns the css class used to identify watch links for a given +object+ @@ -61,7 +62,7 @@ module WatchersHelper :object_id => object.id, :user_id => user} s << ' ' - s << link_to(l(:button_delete), url, + s << link_to(icon_with_label('del', l(:button_delete)), url, :remote => true, :method => 'delete', :class => "delete icon-only icon-del", :title => l(:button_delete)) diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb index c0e2a713e..91a981a59 100644 --- a/app/views/admin/projects.html.erb +++ b/app/views/admin/projects.html.erb @@ -1,5 +1,5 @@
-<%= link_to l(:label_project_new), new_project_path, :class => 'icon icon-add' %> +<%= link_to icon_with_label('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 25d022029..c90f0df7a 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -1,23 +1,23 @@
- <%= link_to(l(:label_edit_attachments), + <%= link_to(icon_with_label('edit', l(:label_edit_attachments)), container_attachments_edit_path(container), :title => l(:label_edit_attachments), - :class => 'icon-only icon-edit' + :class => 'icon-only icon-edit ' ) if options[:editable] %> - <%= link_to(l(:label_download_all_attachments), + <%= link_to(icon_with_label('download', l(:label_download_all_attachments)), container_attachments_download_path(container), :title => l(:label_download_all_attachments), - :class => 'icon-only icon-download' + :class => 'icon-only icon-download ' ) if attachments.size > 1 %>
<% for attachment in attachments %> diff --git a/app/views/auth_sources/index.html.erb b/app/views/auth_sources/index.html.erb index 7a0ffa59d..4d9634857 100644 --- a/app/views/auth_sources/index.html.erb +++ b/app/views/auth_sources/index.html.erb @@ -1,5 +1,5 @@
-<%= link_to l(:label_auth_source_new), {:action => 'new'}, :class => 'icon icon-add' %> +<%= link_to icon_with_label('add', l(:label_auth_source_new)), {:action => 'new'}, :class => 'icon icon-add' %>
<%= title l(:label_auth_source_plural) %> @@ -20,7 +20,7 @@ diff --git a/app/views/boards/index.html.erb b/app/views/boards/index.html.erb index 63daeb535..e20c8f641 100644 --- a/app/views/boards/index.html.erb +++ b/app/views/boards/index.html.erb @@ -1,5 +1,5 @@
- <%= link_to_if_authorized l(:label_settings), + <%= 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) %>
diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index bc8c24c3d..96d6490c1 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -1,12 +1,12 @@ <%= board_breadcrumb(@board) %>
-<%= link_to l(:label_message_new), +<%= link_to icon_with_label('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 l(:label_settings), +<%= 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) %> diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb index dfef117de..adfd288b9 100644 --- a/app/views/calendars/show.html.erb +++ b/app/views/calendars/show.html.erb @@ -32,15 +32,15 @@ <%= label_tag('year', l(:label_year)) %> <%= select_year(@year, :prefix => "year", :discard_type => true) %> - <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> - <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %> + <%= 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' %> <% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %> - <%= link_to_function l(:button_save_object, object_name: l(:label_query).downcase), + <%= link_to_function icon_with_label('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 l(:button_edit_object, object_name: l(:label_query).downcase), edit_query_path(@query, :calendar => 1), :class => 'icon icon-edit' %> + <%= 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' %> <%= delete_link query_path(@query, :calendar => 1), {}, l(:button_delete_object, object_name: l(:label_query).downcase) %> <% end %>

diff --git a/app/views/context_menus/issues.html.erb b/app/views/context_menus/issues.html.erb index a61b951fa..9b9c7f07a 100644 --- a/app/views/context_menus/issues.html.erb +++ b/app/views/context_menus/issues.html.erb @@ -2,10 +2,10 @@ <%= call_hook(:view_issues_context_menu_start, {:issues => @issues, :can => @can, :back => @back }) %> <% if @issue -%> -
  • <%= context_menu_link l(:button_edit), edit_issue_path(@issue), +
  • <%= context_menu_link icon_with_label('edit', l(:button_edit)), edit_issue_path(@issue), :class => 'icon icon-edit', :disabled => !@can[:edit] %>
  • <% else %> -
  • <%= context_menu_link l(:label_bulk_edit), bulk_edit_issues_path(:ids => @issue_ids), +
  • <%= 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] %>
  • <% end %> @@ -130,7 +130,7 @@
  • <%= l(:label_issue_watchers) %>
      -
    • <%= context_menu_link l(:button_add), +
    • <%= 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' %>
    • @@ -143,28 +143,28 @@ <% end %> <% unless @issue %> -
    • <%= context_menu_link l(:button_filter), _project_issues_path(@project, :set_filter => 1, :status_id => "*", :issue_id => @issue_ids.join(","), :c => @columns), +
    • <%= 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' %>
    • <% end %> <% if @issue.present? %> <% if @can[:log_time] -%> -
    • <%= context_menu_link l(:button_log_time), new_issue_time_entry_path(@issue), +
    • <%= context_menu_link icon_with_label('time', l(:button_log_time)), new_issue_time_entry_path(@issue), :class => 'icon icon-time-add' %>
    • <% end %> <% if @can[:add_subtask] -%> -
    • <%= context_menu_link l(:button_add_subtask), url_for_new_subtask(@issue), +
    • <%= context_menu_link icon_with_label('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 l(:button_copy), project_copy_issue_path(@project, @issue), +
    • <%= context_menu_link icon_with_label('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 l(:button_copy), bulk_edit_issues_path(:ids => @issue_ids, :copy => '1'), +
    • <%= 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] %>
    • <% end %> -
    • <%= context_menu_link 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 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), :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 c200311f2..ba18b4e06 100644 --- a/app/views/context_menus/projects.html.erb +++ b/app/views/context_menus/projects.html.erb @@ -6,7 +6,7 @@
    • <%= context_menu_link 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 l(:button_copy), copy_project_path(@projects), class: 'icon icon-copy' %> + <%= context_menu_link icon_with_label('copy', l(:button_copy)), copy_project_path(@projects), class: 'icon icon-copy' %>
    • <%= context_menu_link l(:button_delete), project_path(@project, back_url: @back), method: :delete, class: 'icon icon-del' %> diff --git a/app/views/context_menus/time_entries.html.erb b/app/views/context_menus/time_entries.html.erb index 3bf138e91..2282a6ea3 100644 --- a/app/views/context_menus/time_entries.html.erb +++ b/app/views/context_menus/time_entries.html.erb @@ -1,9 +1,9 @@
        <% if !@time_entry.nil? -%> -
      • <%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => @time_entry}, +
      • <%= context_menu_link icon_with_label('edit', l(:button_edit)), {:controller => 'timelog', :action => 'edit', :id => @time_entry}, :class => 'icon icon-edit', :disabled => !@can[:edit] %>
      • <% else %> -
      • <%= context_menu_link l(:label_bulk_edit), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)}, +
      • <%= 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] %>
      • <% end %> @@ -38,7 +38,7 @@ <%= call_hook(:view_time_entries_context_menu_end, {:time_entries => @time_entries, :can => @can, :back => @back }) %>
      • - <%= context_menu_link l(:button_delete), + <%= 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] %>
      • diff --git a/app/views/context_menus/users.html.erb b/app/views/context_menus/users.html.erb index 93fe061e6..4fa60779b 100644 --- a/app/views/context_menus/users.html.erb +++ b/app/views/context_menus/users.html.erb @@ -11,7 +11,7 @@ <% end %>
      • - <%= context_menu_link l(:button_edit), edit_user_path(@user, back_url: @back), class: 'icon icon-edit' %> + <%= context_menu_link icon_with_label('edit', l(:button_edit)), edit_user_path(@user, back_url: @back), class: 'icon icon-edit' %>
      • <% unless User.current == @user %> diff --git a/app/views/custom_fields/_index.html.erb b/app/views/custom_fields/_index.html.erb index 81fe21404..b350d4734 100644 --- a/app/views/custom_fields/_index.html.erb +++ b/app/views/custom_fields/_index.html.erb @@ -22,7 +22,7 @@ <% end %>
  • diff --git a/app/views/custom_fields/formats/_enumeration.erb b/app/views/custom_fields/formats/_enumeration.erb index 07e4cf463..a0529e80d 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 l(:button_edit), custom_field_enumerations_path(@custom_field), :class => 'icon icon-edit' %> + <%= link_to icon_with_label('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 0eecc6014..0af9c54ea 100644 --- a/app/views/custom_fields/index.html.erb +++ b/app/views/custom_fields/index.html.erb @@ -1,5 +1,5 @@
    -<%= link_to_function 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 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' %>
    <%= title l(:label_custom_field_plural) %> @@ -12,4 +12,4 @@ <%= javascript_tag do %> $(function() { $("table.custom_fields tbody").positionedItems(); }); -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/documents/index.html.erb b/app/views/documents/index.html.erb index aa5e5200d..b6458949d 100644 --- a/app/views/documents/index.html.erb +++ b/app/views/documents/index.html.erb @@ -1,5 +1,5 @@
    -<%= link_to l(:label_document_new), new_project_document_path(@project), :class => 'icon icon-add', +<%= 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) %>
    diff --git a/app/views/documents/show.html.erb b/app/views/documents/show.html.erb index 799803c9e..cce27281a 100644 --- a/app/views/documents/show.html.erb +++ b/app/views/documents/show.html.erb @@ -1,6 +1,6 @@
    <% if User.current.allowed_to?(:edit_documents, @project) %> -<%= link_to l(:button_edit), edit_document_path(@document), :class => 'icon icon-edit', :accesskey => accesskey(:edit) %> +<%= link_to icon_with_label('edit', l(:button_edit)), edit_document_path(@document), :class => 'icon icon-edit', :accesskey => accesskey(:edit) %> <% end %> <% if User.current.allowed_to?(:delete_documents, @project) %> <%= delete_link document_path(@document) %> diff --git a/app/views/enumerations/index.html.erb b/app/views/enumerations/index.html.erb index 09d13a091..a516ccc44 100644 --- a/app/views/enumerations/index.html.erb +++ b/app/views/enumerations/index.html.erb @@ -5,7 +5,7 @@ <% enumerations = klass.shared %> -

    <%= link_to l(:label_enumeration_new), new_enumeration_path(:type => klass.name), :class => 'icon icon-add' %>

    +

    <%= link_to icon_with_label('add', l(:label_enumeration_new)), new_enumeration_path(:type => klass.name), :class => 'icon icon-add' %>

    <% if enumerations.any? %>
    - <%= link_to_attachment attachment, class: 'icon icon-attachment' -%> + <%= link_to_attachment attachment, class: 'icon icon-attachment ' -%> (<%= number_to_human_size attachment.filesize %>) - <%= link_to_attachment attachment, class: 'icon-only icon-download', title: l(:button_download), download: true -%> + <%= link_to_attachment attachment, class: 'icon-only icon-download ', title: l(:button_download), download: true -%> <%= attachment.description unless attachment.description.blank? %> @@ -27,10 +27,10 @@ <% if options[:deletable] %> - <%= link_to l(:button_delete), attachment_path(attachment), + <%= link_to icon_with_label('del', l(:button_delete)), attachment_path(attachment), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, - :class => 'delete icon-only icon-del', + :class => 'delete icon-only icon-del ', :title => l(:button_delete) %> <% end %> <%= source.host %> <%= source.users.count %> - <%= link_to l(:button_test), try_connection_auth_source_path(source), :class => 'icon icon-test' %> + <%= link_to icon_with_label('arrow-right', l(:button_test)), try_connection_auth_source_path(source), :class => 'icon icon-test' %> <%= delete_link auth_source_path(source) %>
    <%= reorder_handle(custom_field, :url => custom_field_path(custom_field), :param => 'custom_field') %> - <%= link_to_function 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 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' %> <%= delete_link custom_field_path(custom_field) %>
    @@ -36,4 +36,4 @@ <%= javascript_tag do %> $(function() { $("table.enumerations tbody").positionedItems(); }); -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 3e8dda160..ff1aa5254 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -1,5 +1,5 @@
    -<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %> +<%= link_to(icon_with_label('add', l(:label_attachment_new)), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>

    <%=l(:label_attachment_plural)%>

    @@ -35,7 +35,7 @@ diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index ceca3d1a7..3e73d9d7a 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -83,17 +83,17 @@ <%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %> <%= hidden_field_tag 'zoom', @gantt.zoom %> - <%= link_to_function l(:button_apply), '$("#query_form").submit()', + <%= link_to_function icon_with_label('checked', l(:button_apply)), '$("#query_form").submit()', :class => 'icon icon-checked' %> - <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, + <%= link_to icon_with_label('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 l(:button_save_object, object_name: l(:label_query).downcase), + <%= link_to_function icon_with_label('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 l(:button_edit_object, object_name: l(:label_query).downcase), edit_query_path(@query, :gantt => 1), :class => 'icon icon-edit' %> + <%= link_to icon_with_label('edit', l(:button_edit_object, object_name: l(:label_query).downcase)), edit_query_path(@query, :gantt => 1), :class => 'icon icon-edit' %> <%= delete_link query_path(@query, :gantt => 1), {}, l(:button_delete_object, object_name: l(:label_query).downcase) %> <% end %>

    diff --git a/app/views/groups/_users.html.erb b/app/views/groups/_users.html.erb index 8c2ab7e4b..73af9ee58 100644 --- a/app/views/groups/_users.html.erb +++ b/app/views/groups/_users.html.erb @@ -1,4 +1,4 @@ -

    <%= link_to l(:label_user_new), new_group_users_path(@group), :remote => true, :class => "icon icon-add" %>

    +

    <%= link_to icon_with_label('add', l(:label_user_new)), new_group_users_path(@group), :remote => true, :class => "icon icon-add" %>

    <% if @group.users.any? %>
    <%= file.digest_type %>: <%= file.digest %> <%= link_to_attachment file, class: 'icon-only icon-download', title: l(:button_download), download: true %> - <%= link_to(l(:button_delete), attachment_path(file), :class => 'icon-only icon-del', + <%= link_to(icon_with_label('del', l(:button_delete)), attachment_path(file), :class => 'icon-only icon-del', :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
    diff --git a/app/views/groups/index.html.erb b/app/views/groups/index.html.erb index 7b77fec22..4c5139362 100644 --- a/app/views/groups/index.html.erb +++ b/app/views/groups/index.html.erb @@ -1,5 +1,5 @@
    -<%= link_to l(:label_group_new), new_group_path, :class => 'icon icon-add' %> +<%= link_to icon_with_label('add', l(:label_group_new)), new_group_path, :class => 'icon icon-add' %>
    <%= title l(:label_group_plural) %> @@ -9,7 +9,7 @@ <%= text_field_tag 'name', params[:name], :size => 30 %> <%= submit_tag l(:button_apply), :class => "small", :name => nil %> - <%= link_to l(:button_clear), groups_path, :class => 'icon icon-reload' %> + <%= link_to icon_with_label('reload', l(:button_clear)), groups_path, :class => 'icon icon-reload' %> <% end %>   diff --git a/app/views/groups/show.html.erb b/app/views/groups/show.html.erb index 9cb6363f5..136302ace 100644 --- a/app/views/groups/show.html.erb +++ b/app/views/groups/show.html.erb @@ -1,5 +1,5 @@
    -<%= link_to(l(:button_edit), edit_group_path(@group), :class => 'icon icon-edit') if User.current.admin? %> +<%= link_to(icon_with_label('edit', l(:button_edit)), edit_group_path(@group), :class => 'icon icon-edit') if User.current.admin? %>

    <%= @group.name %>

    diff --git a/app/views/issue_statuses/index.html.erb b/app/views/issue_statuses/index.html.erb index 509abd831..16df17943 100644 --- a/app/views/issue_statuses/index.html.erb +++ b/app/views/issue_statuses/index.html.erb @@ -1,6 +1,6 @@
    -<%= link_to l(:label_issue_status_new), new_issue_status_path, :class => 'icon icon-add' %> -<%= link_to(l(:label_update_issue_done_ratios), update_issue_done_ratio_issue_statuses_path, :class => 'icon icon-multiple', :method => 'post', :data => {:confirm => l(:text_are_you_sure)}) if Issue.use_status_for_done_ratio? %> +<%= link_to(icon_with_label('add', l(:label_issue_status_new)), new_issue_status_path, :class => 'icon icon-add') %> +<%= link_to(icon_with_label('multiple', l(:label_update_issue_done_ratios)), update_issue_done_ratio_issue_statuses_path, :class => 'icon icon-multiple', :method => 'post', :data => {:confirm => l(:text_are_you_sure)}) if Issue.use_status_for_done_ratio? %>

    <%=l(:label_issue_status_plural)%>

    diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index 1904f2171..abb157d5a 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -1,16 +1,16 @@
    -<%= link_to l(:button_edit), edit_issue_path(@issue), +<%= link_to icon_with_label('edit', l(:button_edit)), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', - :class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %> -<%= link_to l(:button_log_time), new_issue_time_entry_path(@issue), - :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %> + :class => 'icon icon-edit ', :accesskey => accesskey(:edit) if @issue.editable? %> +<%= link_to icon_with_label('time', l(:button_log_time)), new_issue_time_entry_path(@issue), + :class => 'icon icon-time-add ' if User.current.allowed_to?(:log_time, @project) %> <%= watcher_link(@issue, User.current) %> -<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), - :class => 'icon icon-copy' if User.current.allowed_to?(:copy_issues, @project) && Issue.allowed_target_projects.any? %> +<%= link_to icon_with_label('copy', l(:button_copy)), project_copy_issue_path(@project, @issue), + :class => 'icon icon-copy ' if User.current.allowed_to?(:copy_issues, @project) && Issue.allowed_target_projects.any? %> <%= actions_dropdown do %> <%= copy_object_url_link(issue_url(@issue, only_path: false)) %> - <%= link_to l(:button_delete_object, object_name: l(:label_issue).downcase), issue_path(@issue), + <%= link_to icon_with_label('del', l(:button_delete_object, object_name: l(:label_issue).downcase)), issue_path(@issue), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, - :method => :delete, :class => 'icon icon-del' if @issue.deletable? %> + :method => :delete, :class => 'icon icon-del ' if @issue.deletable? %> <% end %>
    diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index 517b67f95..3ee16fc66 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -7,7 +7,7 @@ <%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true}, :onchange => "updateIssueFrom('#{escape_javascript(update_issue_form_path(@project, @issue))}', this)", :title => @issue.status.description %> - <%= content_tag 'a', l(:label_open_issue_statuses_description), :class => 'icon-only icon-help', :title => l(:label_open_issue_statuses_description), :onclick => "showModal('issue_statuses_description', '500px'); return false;", :href => '#' if @allowed_statuses.any? {|s| s.description.present? } %> + <%= content_tag 'a', icon_with_label('help', l(:label_open_issue_statuses_description)), :class => 'icon-only icon-help', :title => l(:label_open_issue_statuses_description), :onclick => "showModal('issue_statuses_description', '500px'); return false;", :href => '#' if @allowed_statuses.any? {|s| s.description.present? } %> <% if @issue.transition_warning %> <%= @issue.transition_warning %> <% end %> @@ -36,7 +36,7 @@

    <%= f.select :category_id, category_options, {:include_blank => true, :required => @issue.required_attribute?('category_id')}, :onchange => ("updateIssueFrom('#{escape_javascript(update_issue_form_path(@project, @issue))}', this)" if @issue.new_record?) %> -<%= link_to(l(:label_issue_category_new), +<%= link_to(icon_with_label('add', l(:label_issue_category_new)), new_project_issue_category_path(@issue.project), :remote => true, :method => 'get', @@ -49,7 +49,7 @@ <% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>

    <%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version), :include_blank => true, :required => @issue.required_attribute?('fixed_version_id') %> -<%= link_to(l(:label_version_new), +<%= link_to(icon_with_label('add', l(:label_version_new)), new_project_version_path(@issue.project), :remote => true, :method => 'get', diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index b1693f7b3..88e7a9a1f 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -20,7 +20,7 @@ <%= f.select :tracker_id, trackers_options_for_select(@issue), {:required => true}, :onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}', this)", :title => @issue.tracker.description %> - <%= content_tag 'a', l(:label_open_trackers_description), :class => 'icon-only icon-help', :title => l(:label_open_trackers_description), :onclick => "showModal('trackers_description', '500px'); return false;", :href => '#' if trackers_for_select(@issue).any? {|t| t.description.present? } %> + <%= content_tag 'a', icon_with_label('help', l(:label_open_trackers_description)), :class => 'icon-only icon-help', :title => l(:label_open_trackers_description), :onclick => "showModal('trackers_description', '500px'); return false;", :href => '#' if trackers_for_select(@issue).any? {|t| t.description.present? } %>

    <%= render partial: 'issues/trackers_description', locals: {trackers: trackers_for_select(@issue)} %> <% end %> @@ -40,7 +40,7 @@ }, :no_label => true %> <% end %> - <%= link_to_function content_tag(:span, l(:button_edit), :class => 'icon icon-edit'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> + <%= link_to_function content_tag(:span, icon_with_label('edit', l(:button_edit)), :class => 'icon icon-edit'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %>

    <%= wikitoolbar_for 'issue_description', preview_issue_path(:project_id => @issue.project, :issue_id => @issue.id) %> <% end %> diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 1ab5198a1..5d10f7473 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,17 +1,17 @@
    <% if User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || Issue.allowed_target_trackers(@project).any?) %> - <%= link_to l(:label_issue_new), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %> + <%= link_to icon_with_label('add', l(:label_issue_new)), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %> <% end %> <%= actions_dropdown do %> <% if @project %> - <%= link_to l(:field_summary), project_issues_report_path(@project), :class => 'icon icon-stats' %> + <%= link_to icon_with_label('summary', l(:field_summary)), project_issues_report_path(@project), :class => 'icon icon-stats' %> <% end %> <% if User.current.allowed_to?(:import_issues, @project, :global => true) %> - <%= link_to l(:button_import), new_issues_import_path(:project_id => @project), :class => 'icon icon-import' %> + <%= link_to icon_with_label('import', l(:button_import)), new_issues_import_path(:project_id => @project), :class => 'icon icon-import' %> <% end %> - <%= link_to_if_authorized l(:label_settings), + <%= link_to_if_authorized icon_with_label('settings', l(:label_settings)), {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'issues'}, :class => 'icon icon-settings' if User.current.allowed_to?(:edit_project, @project) %> <% end %> diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 3b713b4e7..13c1bc632 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -84,7 +84,7 @@ end %>
    - <%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if @issue.notes_addable? %> + <%= link_to icon_with_label('comment', l(:button_quote)), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment ' if @issue.notes_addable? %>

    <%=l(:field_description)%>

    diff --git a/app/views/issues/tabs/_time_entries.html.erb b/app/views/issues/tabs/_time_entries.html.erb index 1807475bd..039f4b6a4 100644 --- a/app/views/issues/tabs/_time_entries.html.erb +++ b/app/views/issues/tabs/_time_entries.html.erb @@ -4,14 +4,14 @@ <% if time_entry.editable_by?(User.current) -%>
    - <%= link_to l(:button_edit), edit_time_entry_path(time_entry), + <%= link_to icon_with_label('edit', l(:button_edit)), edit_time_entry_path(time_entry), :title => l(:button_edit), - :class => 'icon-only icon-edit' %> - <%= link_to l(:button_delete), time_entry_path(time_entry), + :class => 'icon-only icon-edit ' %> + <%= link_to icon_with_label('del', l(:button_delete)), time_entry_path(time_entry), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete), - :class => 'icon-only icon-del' %> + :class => 'icon-only icon-del ' %>
    <% end -%> @@ -29,4 +29,4 @@
    <%= call_hook(:view_issues_history_time_entry_bottom, { :time_entry => time_entry }) %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index 6c902d087..ba22f713c 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -3,18 +3,18 @@
    <%= watcher_link(@topic, User.current) %> <%= link_to( - l(:button_quote), + icon_with_label('comment', l(:button_quote)), {:action => 'quote', :id => @topic}, :method => 'get', :class => 'icon icon-comment', :remote => true) if !@topic.locked? && authorize_for('messages', 'reply') %> <%= link_to( - l(:button_edit), + icon_with_label('edit', l(:button_edit)), {:action => 'edit', :id => @topic}, :class => 'icon icon-edit' ) if @message.editable_by?(User.current) %> <%= link_to( - l(:button_delete), + icon_with_label('del', l(:button_delete)), {:action => 'destroy', :id => @topic}, :method => :post, :data => {:confirm => l(:text_are_you_sure)}, diff --git a/app/views/my/blocks/_issues.erb b/app/views/my/blocks/_issues.erb index 953b5ed79..beed07224 100644 --- a/app/views/my/blocks/_issues.erb +++ b/app/views/my/blocks/_issues.erb @@ -1,5 +1,5 @@
    - <%= link_to_function l(:label_options), "$('##{block}-settings').toggle();", :class => 'icon-only icon-settings', :title => l(:label_options) %> + <%= link_to_function icon_with_label('settings', l(:label_options)), "$('##{block}-settings').toggle();", :class => 'icon-only icon-settings', :title => l(:label_options) %>

    diff --git a/app/views/my/blocks/_timelog.html.erb b/app/views/my/blocks/_timelog.html.erb index 4736832e2..95dc15e49 100644 --- a/app/views/my/blocks/_timelog.html.erb +++ b/app/views/my/blocks/_timelog.html.erb @@ -1,11 +1,11 @@
    - <%= link_to_function l(:label_options), "$('#timelog-settings').toggle();", :class => 'icon-only icon-settings', :title => l(:label_options) %> + <%= link_to_function icon_with_label('settings', l(:label_options)), "$('#timelog-settings').toggle();", :class => 'icon-only icon-settings', :title => l(:label_options) %>

    <%= link_to l(:label_spent_time), time_entries_path(:user_id => 'me') %> (<%= l(:label_last_n_days, days) %>: <%= l_hours_short entries.sum(&:hours) %>) - <%= link_to l(:button_log_time), new_time_entry_path, :class => "icon-only icon-add", :title => l(:button_log_time) if User.current.allowed_to?(:log_time, nil, :global => true) %> + <%= link_to icon_with_label('add', l(:button_log_time)), new_time_entry_path, :class => "icon-only icon-add", :title => l(:button_log_time) if User.current.allowed_to?(:log_time, nil, :global => true) %>

    diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb index 64fbe578b..e71506f30 100644 --- a/app/views/news/index.html.erb +++ b/app/views/news/index.html.erb @@ -1,5 +1,5 @@
    -<%= link_to(l(:label_news_new), +<%= link_to(icon_with_label('add', l(:label_news_new)), (@project ? project_news_index_path(@project) : news_index_path), :class => 'icon icon-add add-news-link', :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if User.current.allowed_to?(:manage_news, @project, global: true) %> diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb index 9b54a66cb..c05f34976 100644 --- a/app/views/news/show.html.erb +++ b/app/views/news/show.html.erb @@ -1,7 +1,7 @@ <%= breadcrumb link_to(l(:label_news_plural), project_news_index_path(@project)) %>
    <%= watcher_link(@news, User.current) %> -<%= link_to(l(:button_edit), +<%= link_to(icon_with_label('edit', l(:button_edit)), edit_news_path(@news), :class => 'icon icon-edit', :accesskey => accesskey(:edit), @@ -38,7 +38,7 @@ <% @comments.each do |comment| %> <% next if comment.new_record? %>
    - <%= link_to_if_authorized l(:button_delete), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, + <%= link_to_if_authorized icon_with_label('del', l(:button_delete)), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete), :class => 'icon-only icon-del' %> diff --git a/app/views/principal_memberships/_index.html.erb b/app/views/principal_memberships/_index.html.erb index c55a19543..d6ecaaa40 100644 --- a/app/views/principal_memberships/_index.html.erb +++ b/app/views/principal_memberships/_index.html.erb @@ -1,6 +1,6 @@ <% memberships = principal.memberships.preload(:member_roles, :roles).sorted_by_project.to_a %> -

    <%= link_to l(:label_add_projects), new_principal_membership_path(principal), :remote => true, :class => "icon icon-add" %>

    +

    <%= link_to icon_with_label('add', l(:label_add_projects)), new_principal_membership_path(principal), :remote => true, :class => "icon icon-add" %>

    <% if memberships.any? %>
    @@ -22,7 +22,7 @@
    - <%= link_to l(:button_edit), + <%= link_to icon_with_label('edit', l(:button_edit)), edit_principal_membership_path(principal, membership), :remote => true, :class => 'icon icon-edit' diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index d18cf6e47..f783e1daa 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -21,8 +21,8 @@ <% if User.current.logged? %>

    -<%= l(:label_my_projects) %> -<%= l(:label_my_bookmarks) %> +<%= icon_with_label('user', l(:label_my_projects)) %> +<%= icon_with_label('bookmarked', l(:label_my_bookmarks)) %>

    <% end %> diff --git a/app/views/projects/settings/_activities.html.erb b/app/views/projects/settings/_activities.html.erb index dce68df2c..12e95c8d9 100644 --- a/app/views/projects/settings/_activities.html.erb +++ b/app/views/projects/settings/_activities.html.erb @@ -1,10 +1,10 @@
    -<%= link_to(l(:button_reset), project_enumerations_path(@project), +<%= link_to(icon_with_label('del', l(:button_reset)), project_enumerations_path(@project), :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %> <% if User.current.admin? %> -<%= link_to l(:label_administration), enumerations_path, :class => "icon icon-settings" %> +<%= link_to icon_with_label('settings', l(:label_administration)), enumerations_path, :class => "icon icon-settings" %> <% end %>
    diff --git a/app/views/projects/settings/_boards.html.erb b/app/views/projects/settings/_boards.html.erb index bf0b786fd..b5a6f36d6 100644 --- a/app/views/projects/settings/_boards.html.erb +++ b/app/views/projects/settings/_boards.html.erb @@ -1,5 +1,5 @@ <% if User.current.allowed_to?(:manage_boards, @project) %> -

    <%= link_to l(:label_board_new), new_project_board_path(@project), :class => 'icon icon-add' %>

    +

    <%= link_to icon_with_label('add', l(:label_board_new)), new_project_board_path(@project), :class => 'icon icon-add' %>

    <% end %> <% if @project.boards.any? %> @@ -16,7 +16,7 @@
    <% if User.current.allowed_to?(:manage_boards, @project) %> <%= reorder_handle(board) %> - <%= link_to l(:button_edit), edit_project_board_path(@project, board), :class => 'icon icon-edit' %> + <%= link_to icon_with_label('edit', l(:button_edit)), edit_project_board_path(@project, board), :class => 'icon icon-edit' %> <%= delete_link project_board_path(@project, board) %> <% end %>
    diff --git a/app/views/projects/settings/_issue_categories.html.erb b/app/views/projects/settings/_issue_categories.html.erb index 3cd78e387..0123d7ce4 100644 --- a/app/views/projects/settings/_issue_categories.html.erb +++ b/app/views/projects/settings/_issue_categories.html.erb @@ -1,4 +1,4 @@ -

    <%= link_to l(:label_issue_category_new), new_project_issue_category_path(@project), :class => 'icon icon-add' if User.current.allowed_to?(:manage_categories, @project) %>

    +

    <%= link_to icon_with_label('add', l(:label_issue_category_new)), new_project_issue_category_path(@project), :class => 'icon icon-add' if User.current.allowed_to?(:manage_categories, @project) %>

    <% if @project.issue_categories.any? %> @@ -15,7 +15,7 @@ diff --git a/app/views/projects/settings/_issues.html.erb b/app/views/projects/settings/_issues.html.erb index 4fe977fb8..f7a84cdaa 100644 --- a/app/views/projects/settings/_issues.html.erb +++ b/app/views/projects/settings/_issues.html.erb @@ -4,7 +4,7 @@ <% unless @trackers.empty? %>
    <%= toggle_checkboxes_link('#project_trackers input[type=checkbox]') %><%= l(:label_tracker_plural)%> <% if User.current.admin? %> -
    <%= link_to l(:label_administration), trackers_path, :class => "icon icon-settings" %>
    +
    <%= link_to icon_with_label('settings', l(:label_administration)), trackers_path, :class => "icon icon-settings" %>
    <% end %> <% @trackers.each do |tracker| %>
    <%= category.assigned_to.name if category.assigned_to %> <% if User.current.allowed_to?(:manage_categories, @project) %> - <%= link_to l(:button_edit), edit_issue_category_path(category), :class => 'icon icon-edit' %> + <%= link_to icon_with_label('edit', l(:button_edit)), edit_issue_category_path(category), :class => 'icon icon-edit' %> <%= delete_link issue_category_path(category) %> <% end %>
    @@ -25,7 +25,7 @@
    diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index a1035927f..abb5ec23f 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -3,19 +3,19 @@ <%= actions_dropdown do %> <% if User.current.allowed_to?(:add_subprojects, @project) %> - <%= link_to l(:label_subproject_new), new_project_path(:parent_id => @project), :class => 'icon icon-add' %> + <%= link_to icon_with_label('add', l(:label_subproject_new)), new_project_path(:parent_id => @project), :class => 'icon icon-add' %> <% end %> <% if User.current.allowed_to?(:close_project, @project) %> <% if @project.active? %> - <%= link_to l(:button_close), close_project_path(@project), :data => {:confirm => l(:text_project_close_confirmation, @project.to_s)}, :method => :post, :class => 'icon icon-lock' %> + <%= link_to icon_with_label('lock', l(:button_close)), close_project_path(@project), :data => {:confirm => l(:text_project_close_confirmation, @project.to_s)}, :method => :post, :class => 'icon icon-lock' %> <% else %> - <%= link_to l(:button_reopen), reopen_project_path(@project), :data => {:confirm => l(:text_project_reopen_confirmation, @project.to_s)}, :method => :post, :class => 'icon icon-unlock' %> + <%= link_to icon_with_label('unlock', l(:button_reopen)), reopen_project_path(@project), :data => {:confirm => l(:text_project_reopen_confirmation, @project.to_s)}, :method => :post, :class => 'icon icon-unlock' %> <% end %> <% end %> <% if @project.deletable? %> - <%= link_to l(:button_delete), project_path(@project), :method => :delete, :class => 'icon icon-del' %> + <%= link_to icon_with_label('del', l(:button_delete)), project_path(@project), :method => :delete, :class => 'icon icon-del' %> <% end %> - <%= link_to_if_authorized l(:label_settings), + <%= link_to_if_authorized icon_with_label('settings', l(:label_settings)), {:controller => 'projects', :action => 'settings', :id => @project}, :class => 'icon icon-settings' if User.current.allowed_to?(:edit_project, @project) %> <% end %> @@ -137,7 +137,7 @@
      <% @subprojects.each do |project| %>
    • <%= link_to(project.name, project_path(project), :class => project.css_classes).html_safe %>
    • - <% end %> + <% end %>
    <% end %> diff --git a/app/views/queries/_query_form.html.erb b/app/views/queries/_query_form.html.erb index f60fa7911..2e9aa0f25 100644 --- a/app/views/queries/_query_form.html.erb +++ b/app/views/queries/_query_form.html.erb @@ -53,18 +53,18 @@

    - <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> - <%= link_to l(:button_clear), { :set_filter => 1, :sort => '', :project_id => @project }, :class => 'icon icon-reload' %> + <%= 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)), { :set_filter => 1, :sort => '', :project_id => @project }, :class => 'icon icon-reload' %> <% if @query.new_record? %> <% if User.current.allowed_to?(:save_queries, @project, :global => true) %> - <%= link_to_function l(:button_save_object, object_name: l(:label_query).downcase), + <%= link_to_function icon_with_label('save', l(:button_save_object, object_name: l(:label_query).downcase)), "$('#query_type').prop('disabled',false);$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit()", :class => 'icon icon-save' %> <% end %> <% else %> <% if @query.editable_by?(User.current) %> <% redirect_params = (controller_name == 'admin' && action_name == 'projects') ? {:admin_projects => 1} : {} %> - <%= link_to l(:button_edit_object, object_name: l(:label_query).downcase), edit_query_path(@query, redirect_params), :class => 'icon icon-edit' %> + <%= link_to icon_with_label('edit', l(:button_edit_object, object_name: l(:label_query).downcase)), edit_query_path(@query, redirect_params), :class => 'icon icon-edit' %> <%= delete_link query_path(@query, redirect_params), {}, l(:button_delete_object, object_name: l(:label_query).downcase) %> <% end %> <% end %> diff --git a/app/views/queries/index.html.erb b/app/views/queries/index.html.erb index c36c0ca1a..ca336dc41 100644 --- a/app/views/queries/index.html.erb +++ b/app/views/queries/index.html.erb @@ -15,7 +15,7 @@

    diff --git a/app/views/repositories/_navigation.html.erb b/app/views/repositories/_navigation.html.erb index 6653909d1..c897f91b1 100644 --- a/app/views/repositories/_navigation.html.erb +++ b/app/views/repositories/_navigation.html.erb @@ -11,15 +11,15 @@ :rev => @rev}, class: 'icon icon-download') %> <% end %> -<%= link_to l(:label_statistics), +<%= link_to icon_with_label('stats', l(:label_statistics)), {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param}, :class => 'icon icon-stats' if @repository.supports_history? %> <%= actions_dropdown do %> - <%= link_to_if_authorized l(:label_settings), + <%= link_to_if_authorized icon_with_label('settings', l(:label_settings)), {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'repositories'}, :class => 'icon icon-settings' if User.current.allowed_to?(:manage_repository, @project) %> - <%= link_to l(:button_fetch_changesets), + <%= link_to icon_with_label('reload', l(:button_fetch_changesets)), {:action => :fetch_changesets, :id => @project, :repository_id => @repository.identifier_param}, :class => 'icon icon-reload', :method => :post if User.current.allowed_to?(:manage_repository, @project) && !Setting.autofetch_changesets? %> <% end %> @@ -32,21 +32,21 @@ {:method => :get, :id => 'revision_selector'}) do -%> <% if !@repository.branches.nil? && @repository.branches.length > 0 -%> - | <%= l(:label_branch) %>: + | <%= l(:label_branch) %>: <%= select_tag :branch, options_for_select([''] + @repository.branches, @rev), :id => 'branch' %> <% end -%> <% if !@repository.tags.nil? && @repository.tags.length > 0 -%> - | <%= l(:label_tag) %>: + | <%= l(:label_tag) %>: <%= select_tag :tag, options_for_select([''] + @repository.tags, @rev), :id => 'tag' %> <% end -%> <% if @repository.supports_history? %> - | <%= l(:label_revision) %>: + | <%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 8 %> <% end %> <% end -%> diff --git a/app/views/repositories/_related_issues.html.erb b/app/views/repositories/_related_issues.html.erb index a90fbc3b6..0da1c3369 100644 --- a/app/views/repositories/_related_issues.html.erb +++ b/app/views/repositories/_related_issues.html.erb @@ -11,7 +11,7 @@
      <% @changeset.issues.visible.each do |issue| %>
    • "><%= link_to_issue issue %> - <%= link_to(l(:label_relation_delete), + <%= link_to(icon_with_label('link-break', l(:label_relation_delete)), {:controller => 'repositories', :action => 'remove_related_issue', :id => @project, :repository_id => @repository.identifier_param, :rev => @changeset.identifier, :issue_id => issue}, diff --git a/app/views/roles/index.html.erb b/app/views/roles/index.html.erb index f76e90466..1c001cae4 100644 --- a/app/views/roles/index.html.erb +++ b/app/views/roles/index.html.erb @@ -1,6 +1,6 @@
      -<%= link_to l(:label_role_new), new_role_path, :class => 'icon icon-add' %> -<%= link_to l(:label_permissions_report), permissions_roles_path, :class => 'icon icon-summary' %> +<%= link_to icon_with_label('add', l(:label_role_new)), new_role_path, :class => 'icon icon-add' %> +<%= link_to icon_with_label('summary', l(:label_permissions_report)), permissions_roles_path, :class => 'icon icon-summary' %>

      <%=l(:label_role_plural)%>

      @@ -24,7 +24,7 @@
    diff --git a/app/views/settings/_repositories.html.erb b/app/views/settings/_repositories.html.erb index f89a27944..d06c9c6e1 100644 --- a/app/views/settings/_repositories.html.erb +++ b/app/views/settings/_repositories.html.erb @@ -132,7 +132,7 @@ diff --git a/app/views/timelog/_list.html.erb b/app/views/timelog/_list.html.erb index af8dd1fa5..f0e14418f 100644 --- a/app/views/timelog/_list.html.erb +++ b/app/views/timelog/_list.html.erb @@ -38,10 +38,10 @@ <% end %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 9071dba19..2211d6707 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,8 +1,8 @@
    -<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %> +<%= link_to icon_with_label('add', l(:label_user_new)), new_user_path, :class => 'icon icon-add' %> <%= actions_dropdown do %> <% if User.current.allowed_to?(:import_users, nil, :global => true) %> - <%= link_to l(:button_import), new_users_import_path, :class => 'icon icon-import' %> + <%= link_to icon_with_label('import', l(:button_import)), new_users_import_path, :class => 'icon icon-import' %> <% end %> <% end %>
    diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 16a6c3414..7ff252945 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,5 +1,5 @@
    -<%= link_to(l(:button_edit), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? && @user.logged? %> +<%= link_to(icon_with_label('edit', l(:button_edit)), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? && @user.logged? %>

    <%= avatar @user, :size => "50" %> <%= @user.name %>

    diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index 382133e93..fdaff1657 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -1,8 +1,8 @@
    - <%= link_to(l(:label_version_new), new_project_version_path(@project), + <%= link_to(icon_with_label('add', l(:label_version_new)), new_project_version_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_versions, @project) %> <%= actions_dropdown do %> - <%= link_to_if_authorized l(:label_settings), + <%= link_to_if_authorized icon_with_label('settings', l(:label_settings)), {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'versions'}, :class => 'icon icon-settings' if User.current.allowed_to?(:manage_versions, @project) %> <% end %> @@ -18,7 +18,7 @@
    <% if User.current.allowed_to?(:manage_versions, version.project) %>
    - <%= link_to l(:button_edit), edit_version_path(version), :title => l(:button_edit), :class => 'icon-only icon-edit' %> + <%= link_to icon_with_label('edit', l(:button_edit)), edit_version_path(version), :title => l(:button_edit), :class => 'icon-only icon-edit' %>
    <% end %>
    diff --git a/app/views/wiki/_sidebar.html.erb b/app/views/wiki/_sidebar.html.erb index e849919c4..e0ed4f360 100644 --- a/app/views/wiki/_sidebar.html.erb +++ b/app/views/wiki/_sidebar.html.erb @@ -1,7 +1,7 @@ <% if User.current.allowed_to?(:edit_wiki_pages, @project) && (@wiki && @wiki.find_or_new_page('Sidebar').editable_by?(User.current)) %>
    - <%= link_to l(:button_edit), edit_project_wiki_page_path(@project, 'sidebar'), + <%= link_to icon_with_label('edit', l(:button_edit)), edit_project_wiki_page_path(@project, 'sidebar'), :class => 'icon icon-edit' %>
    <% end -%> diff --git a/app/views/wiki/annotate.html.erb b/app/views/wiki/annotate.html.erb index 1b48f5db8..d717992cc 100644 --- a/app/views/wiki/annotate.html.erb +++ b/app/views/wiki/annotate.html.erb @@ -1,6 +1,6 @@
    -<%= link_to(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit') %> -<%= link_to(l(:label_history), +<%= link_to(icon_with_label('edit', l(:button_edit)), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit') %> +<%= link_to(icon_with_label('history', l(:label_history)), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
    diff --git a/app/views/wiki/date_index.html.erb b/app/views/wiki/date_index.html.erb index 496411b7f..b58ae1fcb 100644 --- a/app/views/wiki/date_index.html.erb +++ b/app/views/wiki/date_index.html.erb @@ -1,6 +1,6 @@
    <% if User.current.allowed_to?(:edit_wiki_pages, @project) %> -<%= link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project), :remote => true, :class => 'icon icon-add' %> +<%= link_to icon_with_label('add', l(:label_wiki_page_new)), new_project_wiki_page_path(@project), :remote => true, :class => 'icon icon-add' %> <% end %> <%= watcher_link(@wiki, User.current) %> <% if User.current.allowed_to?(:manage_wiki, @project) %> diff --git a/app/views/wiki/index.html.erb b/app/views/wiki/index.html.erb index 3c7f55dab..0a44639fe 100644 --- a/app/views/wiki/index.html.erb +++ b/app/views/wiki/index.html.erb @@ -1,10 +1,10 @@
    <% if User.current.allowed_to?(:edit_wiki_pages, @project) %> -<%= link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project), :remote => true, :class => 'icon icon-add' %> +<%= link_to icon_with_label('add', l(:label_wiki_page_new)), new_project_wiki_page_path(@project), :remote => true, :class => 'icon icon-add' %> <% end %> <%= watcher_link(@wiki, User.current) %> <% if User.current.allowed_to?(:manage_wiki, @project) %> -<%= link_to l(:button_delete), {:controller => 'wikis', :action => 'destroy', :id => @project}, :class => 'icon icon-del' %> +<%= link_to icon_with_label('del', l(:button_delete)), {:controller => 'wikis', :action => 'destroy', :id => @project}, :class => 'icon icon-del' %> <% end %>
    diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erb index be0d7355a..8acb0abdc 100644 --- a/app/views/wiki/show.html.erb +++ b/app/views/wiki/show.html.erb @@ -2,27 +2,27 @@ <% if @editable %> <% if @content.current_version? %> - <%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %> + <%= link_to_if_authorized(icon_with_label('edit', l(:button_edit)), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %> <%= watcher_link(@page, User.current) %> <% end %> <% end %> <%= actions_dropdown do %> - <%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> + <%= link_to_if_authorized(icon_with_label('history', l(:label_history)), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> <% if @editable %> <% if @content.current_version? %> - <%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %> - <%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %> - <%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %> - <%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %> + <%= link_to_if_authorized(icon_with_label('lock', l(:button_lock)), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %> + <%= link_to_if_authorized(icon_with_label('unlock', l(:button_unlock)), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %> + <%= link_to_if_authorized(icon_with_label('move', l(:button_rename)), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %> + <%= link_to_if_authorized(icon_with_label('del', l(:button_delete)), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %> <% else %> - <%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') %> + <%= link_to_if_authorized(icon_with_label('cancel', l(:button_rollback)), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') %> <% end %> <% end %> <% if User.current.allowed_to?(:edit_wiki_pages, @project) %> - <%= link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project, :parent => @page.title), :remote => true, :class => 'icon icon-add' %> + <%= link_to icon_with_label('add', l(:label_wiki_page_new)), new_project_wiki_page_path(@project, :parent => @page.title), :remote => true, :class => 'icon icon-add' %> <% end %> <% end %>
    diff --git a/app/views/workflows/_action_menu.html.erb b/app/views/workflows/_action_menu.html.erb index 6961b2776..71677ecf8 100644 --- a/app/views/workflows/_action_menu.html.erb +++ b/app/views/workflows/_action_menu.html.erb @@ -1,4 +1,4 @@
    -<%= link_to l(:button_copy), {:action => 'copy'}, :class => 'icon icon-copy' %> -<%= link_to l(:field_summary), {:action => 'index'}, :class => 'icon icon-summary' %> +<%= link_to icon_with_label('copy', l(:button_copy)), {:action => 'copy'}, :class => 'icon icon-copy' %> +<%= link_to icon_with_label('summary', l(:field_summary)), {:action => 'index'}, :class => 'icon icon-summary' %>
    diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index 5846011e2..c2ca5a636 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -440,6 +440,9 @@ module Redmine raise ArgumentError, "Invalid option :children for menu item '#{name}'" end + # Rails.logger.debug "****"*50 + # Rails.logger.debug name.inspect + # logger.debug icon.inspect @name = name @url = url @condition = options[:if] diff --git a/lib/redmine/preparation.rb b/lib/redmine/preparation.rb index ab6cbdff6..bfaa99c10 100644 --- a/lib/redmine/preparation.rb +++ b/lib/redmine/preparation.rb @@ -241,7 +241,7 @@ module Redmine MenuManager.map :admin_menu do |menu| menu.push :projects, {:controller => 'admin', :action => 'projects'}, - :caption => :label_project_plural, + :caption => :label_project_plural, :icon => 'projects', :html => {:class => 'icon icon-projects'} menu.push :users, {:controller => 'users'}, :caption => :label_user_plural, :html => {:class => 'icon icon-user'} -- 2.39.3 (Apple Git-146)
    - <%= link_to l(:button_edit), + <%= link_to icon_with_label('edit', l(:button_edit)), edit_membership_path(member), :remote => true, :class => 'icon icon-edit' %> diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb index 8ae2ba25b..db1b992c8 100644 --- a/app/views/projects/settings/_repositories.html.erb +++ b/app/views/projects/settings/_repositories.html.erb @@ -1,5 +1,5 @@ <% if User.current.allowed_to?(:manage_repository, @project) %> -

    <%= link_to l(:label_repository_new), new_project_repository_path(@project), :class => 'icon icon-add' %>

    +

    <%= link_to icon_with_label('add', l(:label_repository_new)), new_project_repository_path(@project), :class => 'icon icon-add' %>

    <% end %> <% if @project.repositories.any? %> @@ -26,9 +26,9 @@
    <%= repository.url %> <% if User.current.allowed_to?(:manage_repository, @project) %> - <%= link_to(l(:label_user_plural), committers_repository_path(repository), + <%= link_to(icon_with_label('user', l(:label_user_plural)), committers_repository_path(repository), :class => 'icon icon-user') %> - <%= link_to(l(:button_edit), edit_repository_path(repository), + <%= link_to(icon_with_label('edit', l(:button_edit)), edit_repository_path(repository), :class => 'icon icon-edit') %> <%= delete_link repository_path(repository) %> <% end %> diff --git a/app/views/projects/settings/_versions.html.erb b/app/views/projects/settings/_versions.html.erb index 80d67cc24..172d6e895 100644 --- a/app/views/projects/settings/_versions.html.erb +++ b/app/views/projects/settings/_versions.html.erb @@ -1,10 +1,10 @@ <% if @versions.any? %>
    - <%= link_to l(:label_close_versions), close_completed_project_versions_path(@project), :class => 'icon icon-locked', :method => :put %> + <%= link_to icon_with_label('lock', l(:label_close_versions)), close_completed_project_versions_path(@project), :class => 'icon icon-locked', :method => :put %>
    <% end %>

    - <%= link_to l(:label_version_new), new_project_version_path(@project, :back_url => ''), :class => 'icon icon-add' if User.current.allowed_to?(:manage_versions, @project) %> + <%= link_to icon_with_label('add', l(:label_version_new)), new_project_version_path(@project, :back_url => ''), :class => 'icon icon-add' if User.current.allowed_to?(:manage_versions, @project) %>

    <%= form_tag(settings_project_path(@project, :tab => 'versions'), :method => :get) do %> @@ -14,7 +14,7 @@ <%= text_field_tag 'version_name', @version_name, :size => 30 %> <%= submit_tag l(:button_apply), :name => nil %> -<%= link_to l(:button_clear), settings_project_path(@project, :tab => 'versions'), :class => 'icon icon-reload' %> +<%= link_to icon_with_label('reload', l(:button_clear)), settings_project_path(@project, :tab => 'versions'), :class => 'icon icon-reload' %> <% end %>   @@ -43,7 +43,7 @@
    <%= link_to_if_authorized(version.wiki_page_title, {:controller => 'wiki', :action => 'show', :project_id => version.project, :id => Wiki.titleize(version.wiki_page_title)}) || h(version.wiki_page_title) unless version.wiki_page_title.blank? || version.project.wiki.nil? %> <% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %> - <%= link_to l(:button_edit), edit_version_path(version), :class => 'icon icon-edit' %> + <%= link_to icon_with_label('edit', l(:button_edit)), edit_version_path(version), :class => 'icon icon-edit' %> <%= delete_link version_path(version) %> <% end %> <% if query.editable_by?(User.current) %> - <%= link_to l(:button_edit), edit_query_path(query), :class => 'icon icon-edit' %> + <%= link_to icon_with_label('edit', l(:button_edit)), edit_query_path(query), :class => 'icon icon-edit' %> <%= delete_link query_path(query) %> <% end %> <%= reorder_handle(role) unless role.builtin? %> - <%= link_to l(:button_copy), new_role_path(:copy => role), :class => 'icon icon-copy' %> + <%= link_to icon_with_label('copy', l(:button_copy)), new_role_path(:copy => role), :class => 'icon icon-copy' %> <%= delete_link role_path(role) unless role.builtin? %>
    - <%= link_to(l(:button_add), '#', + <%= link_to(icon_with_label('add', l(:button_add)), '#', :class => 'add-commit-keywords icon-only icon-add', :title => l(:button_add)) %> <% if entry.editable_by?(User.current) -%> - <%= link_to l(:button_edit), edit_time_entry_path(entry), + <%= link_to icon_with_label('edit', l(:button_edit)), edit_time_entry_path(entry), :title => l(:button_edit), :class => 'icon-only icon-edit' %> - <%= link_to l(:button_delete), time_entry_path(entry), + <%= link_to icon_with_label('del', l(:button_delete)), time_entry_path(entry), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete), diff --git a/app/views/timelog/index.html.erb b/app/views/timelog/index.html.erb index ec7580b9a..9259c97b6 100644 --- a/app/views/timelog/index.html.erb +++ b/app/views/timelog/index.html.erb @@ -1,13 +1,13 @@
    -<%= link_to l(:button_log_time), +<%= link_to icon_with_label('time', l(:button_log_time)), _new_time_entry_path(@project, @query.filtered_issue_id), :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project, :global => true) %> <%= actions_dropdown do %> <% if User.current.allowed_to?(:import_time_entries, @project, :global => true) %> - <%= link_to l(:button_import), new_time_entries_import_path(:project_id => @project), :class => 'icon icon-import' %> + <%= link_to icon_with_label('import', l(:button_import)), new_time_entries_import_path(:project_id => @project), :class => 'icon icon-import' %> <% end %> - <%= link_to_if_authorized l(:label_settings), + <%= link_to_if_authorized icon_with_label('settings', l(:label_settings)), {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'activities'}, :class => 'icon icon-settings' if User.current.allowed_to?(:manage_project_activities, @project) %> <% end %> diff --git a/app/views/trackers/index.html.erb b/app/views/trackers/index.html.erb index 84093e943..40739a443 100644 --- a/app/views/trackers/index.html.erb +++ b/app/views/trackers/index.html.erb @@ -1,6 +1,6 @@
    -<%= link_to l(:label_tracker_new), new_tracker_path, :class => 'icon icon-add' %> -<%= link_to l(:field_summary), fields_trackers_path, :class => 'icon icon-summary' %> +<%= link_to icon_with_label('add', l(:label_tracker_new)), new_tracker_path, :class => 'icon icon-add' %> +<%= link_to icon_with_label('summary', l(:field_summary)), fields_trackers_path, :class => 'icon icon-summary' %>

    <%=l(:label_tracker_plural)%>

    @@ -28,7 +28,7 @@
    <%= reorder_handle(tracker) %> - <%= link_to l(:button_copy), new_tracker_path(:copy => tracker), :class => 'icon icon-copy' %> + <%= link_to icon_with_label('copy', l(:button_copy)), new_tracker_path(:copy => tracker), :class => 'icon icon-copy' %> <%= delete_link tracker_path(tracker) %>