From 053ec31df601fe245b15da55a93ef6da98c795c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 30 Sep 2021 22:39:56 +0200 Subject: [PATCH] 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. --- app/assets/stylesheets/layout.scss | 4 ++- .../comments/votes_component.html.erb | 30 ++++++++----------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index d3c5ca090..489f10ea4 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -2004,7 +2004,9 @@ table { .comment-votes { - a { + a, + .icon-like, + .icon-unlike { color: $text-light; display: inline-block; vertical-align: top; diff --git a/app/components/comments/votes_component.html.erb b/app/components/comments/votes_component.html.erb index e92b2bb25..cb428eb80 100644 --- a/app/components/comments/votes_component.html.erb +++ b/app/components/comments/votes_component.html.erb @@ -12,11 +12,9 @@ <% end %> <% else %> - <%= link_to new_user_session_path do %> - - <%= t("votes.agree") %> - - <% end %> + + <%= t("votes.agree") %> + <% end %> <%= comment.total_likes %> @@ -50,11 +48,9 @@ <% end %> <% else %> - <%= link_to new_user_session_path do %> - - <%= t("votes.agree") %> - - <% end %> + + <%= t("votes.agree") %> + <% end %> <%= comment.total_likes %> @@ -68,18 +64,18 @@ <% end %> <% else %> - <%= link_to new_user_session_path do %> - - <%= t("votes.disagree") %> - - <% end %> + + <%= t("votes.disagree") %> + <% end %> <%= comment.total_dislikes %> -