<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"/>
display: none;
}
+.icon-fav svg.icon-svg {
+ fill: #ffc400;
+ stroke: #ffc400;
+}
+
svg {
&.icon-svg {
stroke: #169;
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,
)
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+
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"
)
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"
)
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"
)