Nested links have a cancel/remove link like documents have.
This commit is contained in:
Juan Salvador Pérez García
2018-07-09 07:51:07 +02:00
parent 39599e39ec
commit a4bf5d1710
6 changed files with 16 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
module LinksHelper
def render_destroy_element_link(builder, element)
link_to_remove_association element.new_record? ? t('links.form.cancel_button') : t('links.form.delete_button') , builder, class: 'delete remove-element'
end
end

View File

@@ -27,7 +27,7 @@
<tr id="<%= dom_id(action) %>">
<td><%= action.title %></td>
<td><%= t("admin.proposal_dashboard_actions.action_type.#{action.action_type}") %></td>
<td class="text-right"><%= action.required_supports %></td>
<td class="text-right"><%= number_with_delimiter(action.required_supports, delimiter: '.') %></td>
<td class="text-center"><%= active_human_readable(action.active) %></td>
<td class="text-right">
<%= link_to t('admin.proposal_dashboard_actions.index.edit'),

View File

@@ -11,8 +11,8 @@
<%= f.check_box :open_in_new_tab, label: Link.human_attribute_name(:open_in_new_tab) %>
</div>
<div class="small-6 column">
<%= f.check_box :_destroy, label: t('.destroy') if f.object.id.present? %>
<div class="small-6 column action-remove text-right">
<%= render_destroy_element_link(f, f.object) %>
</div>
<hr>

View File

@@ -7,7 +7,7 @@ en:
title_placeholder: Add a descriptive title for the document
attachment_label: Choose document
delete_button: Remove document
cancel_button: Cancelar
cancel_button: Cancel
note: "You can upload up to a maximum of %{max_documents_allowed} documents of following content types: %{accepted_content_types}, up to %{max_file_size} MB per file."
add_new_document: Add new document
actions:
@@ -21,4 +21,4 @@ en:
errors:
messages:
in_between: must be in between %{min} and %{max}
wrong_content_type: content type %{content_type} does not match any of accepted content types %{accepted_content_types}
wrong_content_type: content type %{content_type} does not match any of accepted content types %{accepted_content_types}

View File

@@ -974,6 +974,9 @@ en:
text_sign_up: sign up
title: How I can comment this document?
links:
form:
delete_button: Delete
cancel_button: Cancel
nested_links:
title: Links
note: Add the links that are of interest

View File

@@ -973,6 +973,9 @@ es:
text_sign_up: registrarte
title: "¿Cómo puedo comentar este documento?"
links:
form:
delete_button: Borrar
cancel_button: Cancelar
nested_links:
title: Enlaces
note: Añade los enlaces que sean de interés.