Fixed bookmark flash issue (#18997)
* Fixed bookmark flash issue * User nil check
This commit is contained in:
parent
a37d79f8e5
commit
bbb8985a51
1 changed files with 17 additions and 15 deletions
|
|
@ -162,21 +162,23 @@
|
|||
<small class="crayons-story__tertiary fs-xs mr-2">
|
||||
<%= t("views.articles.reading_time", count: [story.reading_time, 1].max) %>
|
||||
</small>
|
||||
<button
|
||||
type="button"
|
||||
id="article-save-button-<%= story.id %>"
|
||||
class="c-btn c-btn--icon-alone bookmark-button"
|
||||
data-reactable-id="<%= story.id %>"
|
||||
data-article-author-id="<%= story.user_id %>"
|
||||
aria-label="<%= t("views.articles.save.aria_label", title: story.title) %>"
|
||||
title="<%= t("views.articles.save.title", title: story.title) %>">
|
||||
<span class="bm-initial crayons-icon c-btn__icon">
|
||||
<%= inline_svg_tag("small-save.svg", alt: "", aria_hidden: true) %>
|
||||
</span>
|
||||
<span class="bm-success crayons-icon c-btn__icon">
|
||||
<%= inline_svg_tag("small-save-filled.svg", alt: "", aria_hidden: true) %>
|
||||
</span>
|
||||
</button>
|
||||
<% if (@user == nil) || (@user.id != story.user_id) %>
|
||||
<button
|
||||
type="button"
|
||||
id="article-save-button-<%= story.id %>"
|
||||
class="c-btn c-btn--icon-alone bookmark-button"
|
||||
data-reactable-id="<%= story.id %>"
|
||||
data-article-author-id="<%= story.user_id %>"
|
||||
aria-label="<%= t("views.articles.save.aria_label", title: story.title) %>"
|
||||
title="<%= t("views.articles.save.title", title: story.title) %>">
|
||||
<span class="bm-initial">
|
||||
<%= inline_svg_tag("small-save.svg", alt: "", aria_hidden: true) %>
|
||||
</span>
|
||||
<span class="bm-success">
|
||||
<%= inline_svg_tag("small-save-filled.svg", alt: "", aria_hidden: true) %>
|
||||
</span>
|
||||
</button>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue