Remove unneded code

This commit is contained in:
Senén Rodero Rodríguez
2017-09-27 11:38:38 +02:00
parent 2993ef8707
commit 6c1d828a62
7 changed files with 9 additions and 87 deletions

View File

@@ -249,7 +249,6 @@
.proposal-form,
.budget-investment-form,
.spending-proposal-form,
.document-form,
.topic-new,
.topic-form {
@@ -303,8 +302,7 @@
.proposal-form,
.topic-form,
.topic-new,
.document-form {
.topic-new {
.recommendations li::before {
color: $proposals;
@@ -314,7 +312,6 @@
.budget-investment-new,
.proposal-form,
.proposal-edit,
.document-form,
.new_poll_question,
.edit_poll_question {
@include direct-uploads;
@@ -852,12 +849,6 @@
display: none;
}
.document-form {
max-width: 75rem;
margin-left: auto;
margin-right: auto;
}
.more-info {
clear: both;
color: $text-medium;

View File

@@ -1,10 +1,5 @@
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)
document.attachment_file_name
end
@@ -40,7 +35,7 @@ module DocumentsHelper
klass = document.errors[:attachment].any? ? "error" : ""
klass = document.persisted? || document.cached_attachment.present? ? " hide" : ""
html = builder.label :attachment,
t("documents.upload_document"),
t("documents.form.attachment_label"),
class: "button hollow #{klass}"
html += builder.file_field :attachment,
label: false,

View File

@@ -9,11 +9,6 @@ module ImagesHelper
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)
t "images.#{image.imageable.class.name.parameterize.underscore}.recommendation_one_html",
title: image.imageable.title

View File

@@ -4,7 +4,7 @@
<%= f.hidden_field :cached_attachment %>
<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 class="small-12 column attachment-actions">

View File

@@ -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>

View File

@@ -2,42 +2,26 @@ en:
documents:
tab: 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>
form:
title: Documents
title_placeholder: Add a descriptive title for the document
attachment_label: Choose document
submit_button: Upload 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."
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:
create:
notice: Document was created successfully.
alert: Cannot create document. Check form errors and try again.
destroy:
notice: Document was deleted successfully.
alert: Cannot destroy document.
confirm: Are you sure you want to delete the document? This action cannot be undone!
buttons:
download_document: Dowload file
destroy_document: Destroy
errors:
messages:
in_between: must be in between %{min} and %{max}

View File

@@ -7,37 +7,22 @@ es:
form:
title: Documentos
title_placeholder: Añade un título descriptivo para el documento
attachment_label: Selecciona un documento
submit_button: Subir 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."
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:
create:
notice: "El documento se ha creado correctamente."
alert: "El documento no se ha podido crear. Revise los errores del formulario."
destroy:
notice: "El documento se ha eliminado correctamente."
alert: "El documento no se ha podido eliminar."
confirm: "¿Está seguro de que desea eliminar el documento? Esta acción no se puede deshacer!"
buttons:
download_document: Descargar archivo
destroy_document: Eliminar
errors:
messages:
in_between: debe estar entre %{min} y %{max}