Add hide button in the user interface
The little menu with the hide notification link and block user link has been added to each proposal notification. JS for adding the fade efect has also been added.
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
//= require moderator_comment
|
//= require moderator_comment
|
||||||
//= require moderator_debates
|
//= require moderator_debates
|
||||||
//= require moderator_proposals
|
//= require moderator_proposals
|
||||||
|
//= require moderator_proposal_notifications
|
||||||
//= require prevent_double_submission
|
//= require prevent_double_submission
|
||||||
//= require gettext
|
//= require gettext
|
||||||
//= require annotator
|
//= require annotator
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
App.ModeratorProposalNotifications =
|
||||||
|
|
||||||
|
add_class_faded: (id) ->
|
||||||
|
$("##{id}").addClass("faded")
|
||||||
|
|
||||||
|
hide_moderator_actions: (id) ->
|
||||||
|
$("##{id} .js-moderator-proposal-notifications-actions:first").hide()
|
||||||
@@ -1963,7 +1963,8 @@ table {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-body {
|
.comment-body,
|
||||||
|
.notification-body {
|
||||||
|
|
||||||
img {
|
img {
|
||||||
margin-right: $line-height / 2;
|
margin-right: $line-height / 2;
|
||||||
|
|||||||
14
app/views/proposal_notifications/_actions.html.erb
Normal file
14
app/views/proposal_notifications/_actions.html.erb
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<div class="reply">
|
||||||
|
<span class='js-moderation-actions'>
|
||||||
|
<% if can? :hide, notification %>
|
||||||
|
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_proposal_notification_path(notification),
|
||||||
|
method: :put, remote: true, data: { confirm: t('admin.actions.confirm') } %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if can? :hide, notification.author %>
|
||||||
|
<span class="divider"> • </span>
|
||||||
|
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(notification.author_id),
|
||||||
|
method: :put, data: { confirm: t('admin.actions.confirm') } %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="tabs-panel" id="tab-notifications" role="tab">
|
<div class="tabs-panel" id="tab-notifications" role="tab">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 column">
|
<div id="proposal_notifications" class="small-12 column notification-body">
|
||||||
<% if @notifications.blank? %>
|
<% if @notifications.blank? %>
|
||||||
<div class="callout primary text-center">
|
<div class="callout primary text-center">
|
||||||
<%= t('proposals.show.no_notifications') %>
|
<%= t('proposals.show.no_notifications') %>
|
||||||
@@ -8,9 +8,15 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% @notifications.each do |notification| %>
|
<% @notifications.each do |notification| %>
|
||||||
|
<div id="<%= dom_id(notification) %>">
|
||||||
<h3><%= notification.title %></h3>
|
<h3><%= notification.title %></h3>
|
||||||
<p class="more-info"><%= notification.created_at.to_date %></p>
|
<p class="more-info"><%= notification.created_at.to_date %></p>
|
||||||
<p><%= notification.body %></p>
|
<%= simple_format text_with_links(notification.body), {}, sanitize: false %>
|
||||||
|
|
||||||
|
<span class="js-flag-actions">
|
||||||
|
<%= render 'proposal_notifications/actions', notification: notification %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ en:
|
|||||||
poll:
|
poll:
|
||||||
one: "Poll"
|
one: "Poll"
|
||||||
other: "Polls"
|
other: "Polls"
|
||||||
|
proposal_notification:
|
||||||
|
one: "Proposal notification"
|
||||||
|
other: "Proposal notifications"
|
||||||
attributes:
|
attributes:
|
||||||
budget:
|
budget:
|
||||||
name: "Name"
|
name: "Name"
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ es:
|
|||||||
poll:
|
poll:
|
||||||
one: "Votación"
|
one: "Votación"
|
||||||
other: "Votaciones"
|
other: "Votaciones"
|
||||||
|
proposal_notification:
|
||||||
|
one: "Notificación de propuesta"
|
||||||
|
other: "Notificaciones de propuestas"
|
||||||
attributes:
|
attributes:
|
||||||
budget:
|
budget:
|
||||||
name: "Nombre"
|
name: "Nombre"
|
||||||
|
|||||||
Reference in New Issue
Block a user