Remove unneded code
This commit is contained in:
@@ -249,7 +249,6 @@
|
|||||||
.proposal-form,
|
.proposal-form,
|
||||||
.budget-investment-form,
|
.budget-investment-form,
|
||||||
.spending-proposal-form,
|
.spending-proposal-form,
|
||||||
.document-form,
|
|
||||||
.topic-new,
|
.topic-new,
|
||||||
.topic-form {
|
.topic-form {
|
||||||
|
|
||||||
@@ -303,8 +302,7 @@
|
|||||||
|
|
||||||
.proposal-form,
|
.proposal-form,
|
||||||
.topic-form,
|
.topic-form,
|
||||||
.topic-new,
|
.topic-new {
|
||||||
.document-form {
|
|
||||||
|
|
||||||
.recommendations li::before {
|
.recommendations li::before {
|
||||||
color: $proposals;
|
color: $proposals;
|
||||||
@@ -314,7 +312,6 @@
|
|||||||
.budget-investment-new,
|
.budget-investment-new,
|
||||||
.proposal-form,
|
.proposal-form,
|
||||||
.proposal-edit,
|
.proposal-edit,
|
||||||
.document-form,
|
|
||||||
.new_poll_question,
|
.new_poll_question,
|
||||||
.edit_poll_question {
|
.edit_poll_question {
|
||||||
@include direct-uploads;
|
@include direct-uploads;
|
||||||
@@ -852,12 +849,6 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.document-form {
|
|
||||||
max-width: 75rem;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.more-info {
|
.more-info {
|
||||||
clear: both;
|
clear: both;
|
||||||
color: $text-medium;
|
color: $text-medium;
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
module DocumentsHelper
|
module DocumentsHelper
|
||||||
|
|
||||||
def document_note(document)
|
|
||||||
t "documents.new.#{document.documentable.class.name.parameterize.underscore}.note",
|
|
||||||
title: document.documentable.title
|
|
||||||
end
|
|
||||||
|
|
||||||
def document_attachment_file_name(document)
|
def document_attachment_file_name(document)
|
||||||
document.attachment_file_name
|
document.attachment_file_name
|
||||||
end
|
end
|
||||||
@@ -40,7 +35,7 @@ module DocumentsHelper
|
|||||||
klass = document.errors[:attachment].any? ? "error" : ""
|
klass = document.errors[:attachment].any? ? "error" : ""
|
||||||
klass = document.persisted? || document.cached_attachment.present? ? " hide" : ""
|
klass = document.persisted? || document.cached_attachment.present? ? " hide" : ""
|
||||||
html = builder.label :attachment,
|
html = builder.label :attachment,
|
||||||
t("documents.upload_document"),
|
t("documents.form.attachment_label"),
|
||||||
class: "button hollow #{klass}"
|
class: "button hollow #{klass}"
|
||||||
html += builder.file_field :attachment,
|
html += builder.file_field :attachment,
|
||||||
label: false,
|
label: false,
|
||||||
|
|||||||
@@ -9,11 +9,6 @@ module ImagesHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def image_note(image)
|
|
||||||
t "images.new.#{image.imageable.class.name.parameterize.underscore}.note",
|
|
||||||
title: image.imageable.title
|
|
||||||
end
|
|
||||||
|
|
||||||
def image_first_recommendation(image)
|
def image_first_recommendation(image)
|
||||||
t "images.#{image.imageable.class.name.parameterize.underscore}.recommendation_one_html",
|
t "images.#{image.imageable.class.name.parameterize.underscore}.recommendation_one_html",
|
||||||
title: image.imageable.title
|
title: image.imageable.title
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<%= f.hidden_field :cached_attachment %>
|
<%= f.hidden_field :cached_attachment %>
|
||||||
|
|
||||||
<div class="small-12 column title">
|
<div class="small-12 column title">
|
||||||
<%= f.text_field :title, placeholder: t("documents.new.form.title_placeholder") %>
|
<%= f.text_field :title, placeholder: t("documents.form.title_placeholder") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column attachment-actions">
|
<div class="small-12 column attachment-actions">
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
<div class="document-form <%= documentable_class(@document.documentable.class) %> row">
|
|
||||||
|
|
||||||
<div class="small-12 medium-9 column">
|
|
||||||
<%= back_link_to params[:from] %>
|
|
||||||
<h1><%= t("documents.new.title") %></h1>
|
|
||||||
<p><%= document_note(@document) %></p>
|
|
||||||
<%= render "documents/form", form_url: documents_url %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="small-12 medium-3 column">
|
|
||||||
<span class="icon-documents float-right"></span>
|
|
||||||
<h2><%= t("documents.recommendations_title") %></h2>
|
|
||||||
<ul class="recommendations">
|
|
||||||
<li>
|
|
||||||
<%= t "documents.recommendation_one_html",
|
|
||||||
max_documents_allowed: max_documents_allowed(@document.documentable) %>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<%= t "documents.recommendation_two_html",
|
|
||||||
accepted_content_types: documentable_humanized_accepted_content_types(@document.documentable.class) %>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<%= t "documents.recommendation_three_html",
|
|
||||||
max_file_size: max_file_size(@document.documentable.class) %>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -2,42 +2,26 @@ en:
|
|||||||
documents:
|
documents:
|
||||||
tab: Documents
|
tab: Documents
|
||||||
no_documents: Don't have uploaded documents
|
no_documents: Don't have uploaded documents
|
||||||
upload_document: Upload document
|
|
||||||
max_documents_allowed_reached_html: You have reached the maximum number of documents allowed! <strong>You have to delete one before you can upload another.</strong>
|
max_documents_allowed_reached_html: You have reached the maximum number of documents allowed! <strong>You have to delete one before you can upload another.</strong>
|
||||||
|
|
||||||
form:
|
form:
|
||||||
title: Documents
|
title: Documents
|
||||||
|
title_placeholder: Add a descriptive title for the document
|
||||||
attachment_label: Choose document
|
attachment_label: Choose document
|
||||||
submit_button: Upload document
|
|
||||||
delete_button: Remove document
|
delete_button: Remove document
|
||||||
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."
|
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
|
add_new_document: Add new document
|
||||||
|
|
||||||
new:
|
|
||||||
title: Upload document
|
|
||||||
budget_investment:
|
|
||||||
note: 'Add new document to your investment project: %{title}'
|
|
||||||
proposal:
|
|
||||||
note: 'Add new document to your proposal: %{title}'
|
|
||||||
form:
|
|
||||||
title_placeholder: Add a descriptive title for the document
|
|
||||||
|
|
||||||
recommendations_title: File upload tips
|
|
||||||
recommendation_one_html: You can upload up to a <strong>maximum of %{max_documents_allowed} documents</strong>.
|
|
||||||
recommendation_two_html: You can upload <strong>%{accepted_content_types}</strong> files.
|
|
||||||
recommendation_three_html: You can upload files up to <strong>%{max_file_size} MB</strong>.
|
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
create:
|
|
||||||
notice: Document was created successfully.
|
|
||||||
alert: Cannot create document. Check form errors and try again.
|
|
||||||
destroy:
|
destroy:
|
||||||
notice: Document was deleted successfully.
|
notice: Document was deleted successfully.
|
||||||
alert: Cannot destroy document.
|
alert: Cannot destroy document.
|
||||||
confirm: Are you sure you want to delete the document? This action cannot be undone!
|
confirm: Are you sure you want to delete the document? This action cannot be undone!
|
||||||
|
|
||||||
buttons:
|
buttons:
|
||||||
download_document: Dowload file
|
download_document: Dowload file
|
||||||
destroy_document: Destroy
|
destroy_document: Destroy
|
||||||
|
|
||||||
errors:
|
errors:
|
||||||
messages:
|
messages:
|
||||||
in_between: must be in between %{min} and %{max}
|
in_between: must be in between %{min} and %{max}
|
||||||
|
|||||||
@@ -7,37 +7,22 @@ es:
|
|||||||
|
|
||||||
form:
|
form:
|
||||||
title: Documentos
|
title: Documentos
|
||||||
|
title_placeholder: Añade un título descriptivo para el documento
|
||||||
attachment_label: Selecciona un documento
|
attachment_label: Selecciona un documento
|
||||||
submit_button: Subir documento
|
|
||||||
delete_button: Eliminar documento
|
delete_button: Eliminar documento
|
||||||
note: "Puedes subir hasta un máximo de %{max_documents_allowed} documentos en los formatos: %{accepted_content_types}, y de hasta %{max_file_size} MB por archivo."
|
note: "Puedes subir hasta un máximo de %{max_documents_allowed} documentos en los formatos: %{accepted_content_types}, y de hasta %{max_file_size} MB por archivo."
|
||||||
add_new_document: Añadir nuevo documento
|
add_new_document: Añadir nuevo documento
|
||||||
|
|
||||||
new:
|
|
||||||
title: Subir un documento
|
|
||||||
budget_investment:
|
|
||||||
note: 'Añade un documento la propuesta de inversión: %{title}.'
|
|
||||||
proposal:
|
|
||||||
note: 'Añade un documento a la propuesta: %{title}.'
|
|
||||||
form:
|
|
||||||
title_placeholder: Añade un título descriptivo para el documento
|
|
||||||
|
|
||||||
recommendations_title: Consejos para subir archivos
|
|
||||||
recommendation_one_html: Puedes subir hasta un máximo de <strong>%{max_documents_allowed} documentos</strong>
|
|
||||||
recommendation_two_html: Sólo puedes subir <strong>archivos %{accepted_content_types}</strong>.
|
|
||||||
recommendation_three_html: Puedes subir archivos de hasta <strong>%{max_file_size} MB</strong>
|
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
create:
|
|
||||||
notice: "El documento se ha creado correctamente."
|
|
||||||
alert: "El documento no se ha podido crear. Revise los errores del formulario."
|
|
||||||
destroy:
|
destroy:
|
||||||
notice: "El documento se ha eliminado correctamente."
|
notice: "El documento se ha eliminado correctamente."
|
||||||
alert: "El documento no se ha podido eliminar."
|
alert: "El documento no se ha podido eliminar."
|
||||||
confirm: "¿Está seguro de que desea eliminar el documento? Esta acción no se puede deshacer!"
|
confirm: "¿Está seguro de que desea eliminar el documento? Esta acción no se puede deshacer!"
|
||||||
|
|
||||||
buttons:
|
buttons:
|
||||||
download_document: Descargar archivo
|
download_document: Descargar archivo
|
||||||
destroy_document: Eliminar
|
destroy_document: Eliminar
|
||||||
|
|
||||||
errors:
|
errors:
|
||||||
messages:
|
messages:
|
||||||
in_between: debe estar entre %{min} y %{max}
|
in_between: debe estar entre %{min} y %{max}
|
||||||
|
|||||||
Reference in New Issue
Block a user