diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2024-09-29 19:16:15 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2024-09-29 19:16:15 +0000 |
commit | dfbb1b68566a1dbafb7af905d8f9a037ed28c1ff (patch) | |
tree | 9fbfc56276520b9d1ec9d0f9b1525d1cb90931e2 | |
parent | b406fca2ec0f2392f610df84e7fc5f396075c173 (diff) | |
download | redmine-dfbb1b68566a1dbafb7af905d8f9a037ed28c1ff.tar.gz redmine-dfbb1b68566a1dbafb7af905d8f9a037ed28c1ff.zip |
Merges fav and fav-off icons in only one icon and fill the collor from CSS (#23980).
git-svn-id: https://svn.redmine.org/redmine/trunk@23089 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/assets/images/icons.svg | 3 | ||||
-rw-r--r-- | app/assets/stylesheets/application.css | 5 | ||||
-rw-r--r-- | app/helpers/watchers_helper.rb | 5 | ||||
-rw-r--r-- | test/helpers/watchers_helper_test.rb | 6 |
4 files changed, 10 insertions, 9 deletions
diff --git a/app/assets/images/icons.svg b/app/assets/images/icons.svg index 6a2b46adc..938ca792f 100644 --- a/app/assets/images/icons.svg +++ b/app/assets/images/icons.svg @@ -166,9 +166,6 @@ <symbol viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" id="icon--fav"> <path d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"/> </symbol> - <symbol viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" id="icon--fav-off"> - <path d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"/> - </symbol> <symbol viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" id="icon--file"> <path d="M14 3v4a1 1 0 0 0 1 1h4"/> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/> diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 008ab05c6..ddf8043d2 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1689,6 +1689,11 @@ svg.icon-ok { display: none; } +.icon-fav svg.icon-svg { + fill: #ffc400; + stroke: #ffc400; +} + svg { &.icon-svg { stroke: #169; diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index c800e4c96..286eaa8e6 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -25,8 +25,7 @@ module WatchersHelper return '' unless objects.any? watched = Watcher.any_watched?(objects, user) - icon = watched ? 'fav' : 'fav-off' - css = [watcher_css(objects), 'icon', "icon-#{icon}"].join(' ') + css = [watcher_css(objects), watched ? 'icon icon-fav' : 'icon icon-fav-off'].join(' ') text = watched ? l(:button_unwatch) : l(:button_watch) url = watch_path( :object_type => objects.first.class.to_s.underscore, @@ -34,7 +33,7 @@ module WatchersHelper ) method = watched ? 'delete' : 'post' - link_to icon_with_label(icon, text), url, :remote => true, :method => method, :class => css + link_to icon_with_label('fav', text), url, :remote => true, :method => method, :class => css end # Returns the css class used to identify watch links for a given +object+ diff --git a/test/helpers/watchers_helper_test.rb b/test/helpers/watchers_helper_test.rb index 42016ec01..7d1f39795 100644 --- a/test/helpers/watchers_helper_test.rb +++ b/test/helpers/watchers_helper_test.rb @@ -28,7 +28,7 @@ class WatchersHelperTest < Redmine::HelperTest test '#watcher_link with a non-watched object' do expected = link_to( - icon_with_label("fav-off", "Watch"), + icon_with_label("fav", "Watch"), "/watchers/watch?object_id=1&object_type=issue", :remote => true, :method => 'post', :class => "issue-1-watcher icon icon-fav-off" ) @@ -37,7 +37,7 @@ class WatchersHelperTest < Redmine::HelperTest test '#watcher_link with a single object array' do expected = link_to( - icon_with_label("fav-off", "Watch"), + icon_with_label("fav", "Watch"), "/watchers/watch?object_id=1&object_type=issue", :remote => true, :method => 'post', :class => "issue-1-watcher icon icon-fav-off" ) @@ -46,7 +46,7 @@ class WatchersHelperTest < Redmine::HelperTest test '#watcher_link with a multiple objects array' do expected = link_to( - icon_with_label("fav-off", "Watch"), + icon_with_label("fav", "Watch"), "/watchers/watch?object_id%5B%5D=1&object_id%5B%5D=3&object_type=issue", :remote => true, :method => 'post', :class => "issue-bulk-watcher icon icon-fav-off" ) |