]> source.dussan.org Git - redmine.git/commitdiff
Merges fav and fav-off icons in only one icon and fill the collor from CSS (#23980).
authorMarius Balteanu <marius.balteanu@zitec.com>
Sun, 29 Sep 2024 19:16:15 +0000 (19:16 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Sun, 29 Sep 2024 19:16:15 +0000 (19:16 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@23089 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/assets/images/icons.svg
app/assets/stylesheets/application.css
app/helpers/watchers_helper.rb
test/helpers/watchers_helper_test.rb

index 6a2b46adcf822ec091f986af01036105d6e7d74b..938ca792f0c982c26a7081d9cc25695745992395 100644 (file)
     <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"/>
index 008ab05c659cec41c3f0a57006b519847f48d724..ddf8043d29623de11bcf4fc29738f3c4757510bc 100644 (file)
@@ -1689,6 +1689,11 @@ svg.icon-ok {
   display: none;
 }
 
+.icon-fav svg.icon-svg {
+  fill: #ffc400;
+  stroke: #ffc400;
+}
+
 svg {
   &.icon-svg {
     stroke: #169;
index c800e4c960b85b217d057740d64788f2a9364a1e..286eaa8e6b0ee00be71d26c4793596393624aaae 100644 (file)
@@ -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+
index 42016ec01d3c60510d5a0aeca5212159507ad1f4..7d1f3979505cc927c04bd2015ef652790472bb4d 100644 (file)
@@ -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"
     )