diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 62e09e088..6f809ca24 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -2424,11 +2424,24 @@ table { li { border-bottom: 1px solid $border; - padding: $line-height / 4; + margin-bottom: 0 !important; + padding: $line-height / 2; &:first-child { border-top: 1px solid $border; } + + .score-actions { + display: none; + } + + &:hover { + background: #f9f9f9; + + .score-actions { + display: block; + } + } } h3 { @@ -2436,7 +2449,7 @@ table { font-weight: normal; } - span:not(.icon-flag) { + .related-content-title { color: #4f4f4f; font-size: rem-calc(12); text-transform: uppercase; @@ -2447,6 +2460,44 @@ table { } } +.relate-content-score { + display: block; + text-align: center; + + a { + font-weight: bold; + margin-right: $line-height; + padding-left: rem-calc(20); + position: relative; + text-decoration: none; + + &.score-positive:before, + &.score-negative:before { + font-family: 'icons'; + left: 0; + position: absolute; + } + + &.score-positive { + color: $color-success; + + &:before { + color: $color-success; + content: '\6c'; + } + } + + &.score-negative { + color: $color-alert; + + &:before { + color: $color-alert; + content: '\76'; + } + } + } +} + // 22. Images // ----------------- diff --git a/app/views/relationable/_related_list.html.erb b/app/views/relationable/_related_list.html.erb index 351865734..1e5a866a3 100644 --- a/app/views/relationable/_related_list.html.erb +++ b/app/views/relationable/_related_list.html.erb @@ -2,12 +2,12 @@ <% @related_contents.each do |related| %>
  • <% if current_user %> - + <%= render 'relationable/score', related: related.relate_content(relationable) %> <% end %> - <%= t("related_content.content_title.#{related.class.name.downcase}") %>
    + <%= t("related_content.content_title.#{related.class.name.downcase}") %>

    <%= link_to related.title, eval("#{related.class.name.downcase}_path(related)") %>

    diff --git a/app/views/relationable/_score.html.erb b/app/views/relationable/_score.html.erb index 21cbf5064..1e93ff262 100644 --- a/app/views/relationable/_score.html.erb +++ b/app/views/relationable/_score.html.erb @@ -1,5 +1,17 @@ -<%= t('related_content.is_related') %> +<%= t("related_content.is_related") %> -<%= link_to t('related_content.score_positive'), score_positive_related_content_path(related), method: :put, remote: true, id: "score-positive-related-#{ related.id }" %> + + <%= link_to t("related_content.score_positive"), + score_positive_related_content_path(related), + method: :put, + remote: true, + id: "score-positive-related-#{ related.id }", + class: "score-positive" %> -<%= link_to t('related_content.score_negative'), score_negative_related_content_path(related), method: :put, remote: true, id: "score-negative-related-#{ related.id }" %> + <%= link_to t("related_content.score_negative"), + score_negative_related_content_path(related), + method: :put, + remote: true, + id: "score-negative-related-#{ related.id }", + class: "score-negative" %> +