Skip to content

Commit ea7bd40

Browse files
committed
Merge remote-tracking branch 'upstream/pull/5884'
2 parents a024a07 + 5e85764 commit ea7bd40

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed
Lines changed: 3 additions & 0 deletions
Loading

app/assets/images/icons/pencil.svg

Lines changed: 3 additions & 0 deletions
Loading

app/views/changesets/_changeset_line.html.erb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
<%= tag.span :class => ["d-flex align-items-baseline gap-1", { "opacity-50" => num_changes.zero? }],
2929
:title => t(".changes", :count => num_changes) do %>
3030
<%= num_changes %>
31-
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
32-
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325" />
33-
</svg>
31+
<%= inline_svg_tag "icons/pencil.svg" %>
3432
<% end %>
3533
<% end %>
3634
<% end %>
@@ -40,13 +38,7 @@
4038
<%= tag.span :class => ["changeset_num_comments d-flex align-items-baseline gap-1 justify-content-end", { "opacity-50" => num_comments.zero? }],
4139
:title => t(".comments", :count => num_comments) do %>
4240
<%= num_comments %>
43-
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
44-
<% if num_comments.zero? %>
45-
<path d="M2.678 11.894a1 1 0 0 1 .287.801 11 11 0 0 1-.398 2c1.395-.323 2.247-.697 2.634-.893a1 1 0 0 1 .71-.074A8 8 0 0 0 8 14c3.996 0 7-2.807 7-6s-3.004-6-7-6-7 2.808-7 6c0 1.468.617 2.83 1.678 3.894m-.493 3.905a22 22 0 0 1-.713.129c-.2.032-.352-.176-.273-.362a10 10 0 0 0 .244-.637l.003-.01c.248-.72.45-1.548.524-2.319C.743 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7-3.582 7-8 7a9 9 0 0 1-2.347-.306c-.52.263-1.639.742-3.468 1.105" />
46-
<% else %>
47-
<path d="M8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6-.097 1.016-.417 2.13-.771 2.966-.079.186.074.394.273.362 2.256-.37 3.597-.938 4.18-1.234A9 9 0 0 0 8 15" />
48-
<% end %>
49-
</svg>
41+
<%= inline_svg_tag "icons/comment.svg", :fill => num_comments.zero? ? "none" : "currentColor" %>
5042
<% end %>
5143
<% end %>
5244
</div>

config/initializers/inline_svg.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@ def transform(doc)
66
end
77
end
88
end
9+
10+
class SvgFillOverrideTransform < InlineSvg::CustomTransformation
11+
def transform(doc)
12+
with_svg(doc) do |svg|
13+
svg.set_attribute("fill", value)
14+
end
15+
end
16+
end
917
end
1018

1119
InlineSvg.configure do |config|
1220
config.add_custom_transformation(:attribute => :to_symbol, :transform => OpenStreetMap::SvgToSymbolTransform)
21+
config.add_custom_transformation(:attribute => :fill, :transform => OpenStreetMap::SvgFillOverrideTransform)
1322
end

0 commit comments

Comments
 (0)