From fcb6c7a19d77f8c437e9825c6746a1b9fb0aed9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Tue, 19 Dec 2017 13:20:30 +0100 Subject: [PATCH] Added related contents score views --- app/views/relationable/_flag_actions.html.erb | 19 ------------------- .../relationable/_refresh_flag_actions.js.erb | 1 - .../_refresh_score_actions.js.erb | 1 + app/views/relationable/_related_list.html.erb | 8 +++++--- app/views/relationable/_score.html.erb | 5 +++++ 5 files changed, 11 insertions(+), 23 deletions(-) delete mode 100644 app/views/relationable/_flag_actions.html.erb delete mode 100644 app/views/relationable/_refresh_flag_actions.js.erb create mode 100644 app/views/relationable/_refresh_score_actions.js.erb create mode 100644 app/views/relationable/_score.html.erb diff --git a/app/views/relationable/_flag_actions.html.erb b/app/views/relationable/_flag_actions.html.erb deleted file mode 100644 index d501b098d..000000000 --- a/app/views/relationable/_flag_actions.html.erb +++ /dev/null @@ -1,19 +0,0 @@ - - <% if show_flag_action? related %> - - - - - <%= link_to t('shared.flag'), flag_related_content_path(related), method: :put, remote: true, id: "flag-related-#{ related.id }" %> - - <% end %> - - <% if show_unflag_action? related %> - - - - - <%= link_to t('shared.unflag'), unflag_related_content_path(related), method: :put, remote: true, id: "unflag-related-#{ related.id }" %> - - <% end %> - diff --git a/app/views/relationable/_refresh_flag_actions.js.erb b/app/views/relationable/_refresh_flag_actions.js.erb deleted file mode 100644 index d3755c4b1..000000000 --- a/app/views/relationable/_refresh_flag_actions.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#<%= dom_id(@related) %>.js-flag-actions").html('<%= j render("relationable/flag_actions", related: @related) %>'); diff --git a/app/views/relationable/_refresh_score_actions.js.erb b/app/views/relationable/_refresh_score_actions.js.erb new file mode 100644 index 000000000..a0f2101c6 --- /dev/null +++ b/app/views/relationable/_refresh_score_actions.js.erb @@ -0,0 +1 @@ +$("#<%= dom_id(@related) %>.js-score-actions").html(''); diff --git a/app/views/relationable/_related_list.html.erb b/app/views/relationable/_related_list.html.erb index f1d86b748..351865734 100644 --- a/app/views/relationable/_related_list.html.erb +++ b/app/views/relationable/_related_list.html.erb @@ -1,9 +1,11 @@