Fix new session links in comments votes component
When there isn't a current user, the links can't be clicked, so there's no real point in them being links. When there's a current user and they cannot vote (for example, an organization), having a link/button to an action they can't perform isn't that useful IMHO. They get a message saying they aren't allowed to vote but the message doesn't say why. However, in this case, many people might try to click/touch the link/button and will wonder why nothing happens, so we'll revisit this issue when we change the way we display the "participation not allowed" messages. Now the behavior is more similar to the one we get when voting proposals/debates.
This commit is contained in:
@@ -2004,7 +2004,9 @@ table {
|
||||
|
||||
.comment-votes {
|
||||
|
||||
a {
|
||||
a,
|
||||
.icon-like,
|
||||
.icon-unlike {
|
||||
color: $text-light;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
|
||||
@@ -12,12 +12,10 @@
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to new_user_session_path do %>
|
||||
<span class="icon-like">
|
||||
<span class="show-for-sr"><%= t("votes.agree") %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= comment.total_likes %>
|
||||
</span>
|
||||
|
||||
@@ -50,12 +48,10 @@
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to new_user_session_path do %>
|
||||
<span class="icon-like">
|
||||
<span class="show-for-sr"><%= t("votes.agree") %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= comment.total_likes %>
|
||||
</span>
|
||||
|
||||
@@ -68,18 +64,18 @@
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to new_user_session_path do %>
|
||||
<span class="icon-unlike">
|
||||
<span class="show-for-sr"><%= t("votes.disagree") %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= comment.total_dislikes %>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div tabindex="0">
|
||||
<div class="participation-not-allowed" style="display:none" aria-hidden="false">
|
||||
<%= sanitize(t("votes.comment_unauthenticated", signin: link_to_signin, signup: link_to_signup)) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user