Remove image and send notification moved to proposal dashboard
This commit is contained in:
Juan Salvador Pérez García
2018-06-12 10:54:46 +02:00
parent e4e0cb65de
commit fc9f14568f
4 changed files with 19 additions and 27 deletions

View File

@@ -124,35 +124,14 @@
</div>
<aside class="small-12 medium-3 column">
<% if author_of_proposal?(@proposal) || can?(:dashboard, @proposal) || can_destroy_image?(@proposal) %>
<% if can?(:dashboard, @proposal) %>
<div class="sidebar-divider"></div>
<h2><%= t("proposals.show.author") %></h2>
<div class="show-actions-menu">
<% if can? :dashboard, @proposal %>
<%= link_to proposal_dashboard_index_path(@proposal), class: 'button hollow expanded' do %>
<span class="icon-edit"></span>
<%= t("proposals.show.dashboard_proposal_link") %>
<% end %>
<%= link_to proposal_dashboard_index_path(@proposal), class: 'button hollow expanded' do %>
<span class="icon-edit"></span>
<%= t("proposals.show.dashboard_proposal_link") %>
<% end %>
<% if author_of_proposal?(@proposal) %>
<%= link_to new_proposal_notification_path(proposal_id: @proposal.id),
class: 'button hollow expanded' do %>
<span class="icon-no-notification"></span>
<%= t("proposals.show.send_notification") %>
<% end %>
<% end %>
<% if can_destroy_image?(@proposal) %>
<%= link_to image_path(@proposal.image, from: request.url),
method: :delete,
class: 'button hollow alert expanded',
data: { confirm: t('images.actions.destroy.confirm') } do %>
<span class="icon-image"></span>
<%= t("images.remove_image") %>
<% end %>
<% end %>
</div>
<% end %>

View File

@@ -17,6 +17,19 @@
<% if current_editable?(proposal) %>
<%= link_to t('.edit_proposal_link'), edit_proposal_path(proposal), class: 'menu-entry', target: '_blank' %>
<% end %>
<%= link_to t('.send_notification'),
new_proposal_notification_path(proposal_id: proposal.id),
class: 'menu-entry',
target: '_blank' %>
<% if can_destroy_image?(proposal) %>
<%= link_to t('images.remove_image'),
image_path(proposal.image, from: request.url),
method: :delete,
class: 'menu-entry',
data: { confirm: t('images.actions.destroy.confirm') } %>
<% end %>
<%= link_to t('.publish'), publish_proposal_dashboard_index_path(proposal), method: :patch, class: 'menu-entry' if can?(:publish, proposal) %>
<% end %>

View File

@@ -478,7 +478,6 @@ en:
retired_warning_link_to_explanation: Read the explanation before voting for it.
retired: Proposal retired by the author
share: Share
send_notification: Send notification
no_notifications: "This proposal has any notifications."
embed_video_title: "Video on %{proposal}"
title_external_url: "Additional documentation"
@@ -494,6 +493,7 @@ en:
general: General
publish: Publish
edit_proposal_link: Edit
send_notification: Send notification
polls:
all: "All"
no_dates: "no date assigned"

View File

@@ -478,7 +478,6 @@ es:
retired_warning_link_to_explanation: Revisa su explicación antes de apoyarla.
retired: Propuesta retirada por el autor
share: Compartir
send_notification: Enviar notificación
no_notifications: "Esta propuesta no tiene notificaciones."
embed_video_title: "Vídeo en %{proposal}"
title_external_url: "Documentación adicional"
@@ -494,6 +493,7 @@ es:
general: General
publish: Publicar
edit_proposal_link: Editar propuesta
send_notification: Enviar notificación
polls:
all: "Todas"
no_dates: "sin fecha asignada"