diff --git a/app/views/admin/signature_sheets/index.html.erb b/app/views/admin/signature_sheets/index.html.erb index d03530e3b..3aea83918 100644 --- a/app/views/admin/signature_sheets/index.html.erb +++ b/app/views/admin/signature_sheets/index.html.erb @@ -1,26 +1,31 @@ -

Signatures

+

<%= t("admin.signature_sheets.index.title") %>

-
- <%= link_to 'Nueva hoja de firmas', new_admin_signature_sheet_path %> -
+<%= link_to t("admin.signature_sheets.index.new"), new_admin_signature_sheet_path, + class: "button success float-right" %> - - - - - - - <% @signature_sheets.each do |signature_sheet| %> - - - - +<% if @signature_sheets.any? %> +
<%= t("admin.signature_sheet.name") %><%= t("admin.signature_sheet.author") %><%= t("admin.signature_sheet.created_at") %>
- <%= link_to signature_sheet.name, [:admin, signature_sheet] %> - - <%= signature_sheet.author.name %> - - <%= l(signature_sheet.created_at, format: :short) %> -
+ + + + - <% end %> -
<%= t("admin.signature_sheets.name") %><%= t("admin.signature_sheets.author") %><%= t("admin.signature_sheets.created_at") %>
\ No newline at end of file + <% @signature_sheets.each do |signature_sheet| %> + + + <%= link_to signature_sheet.name, [:admin, signature_sheet] %> + + + <%= signature_sheet.author.name %> + + + <%= l(signature_sheet.created_at, format: :short) %> + + + <% end %> + +<% else %> +
+ <%= t("admin.signature_sheets.no_signature_sheets") %> +
+<% end %> diff --git a/app/views/admin/signature_sheets/new.html.erb b/app/views/admin/signature_sheets/new.html.erb index c3fe19b55..013913346 100644 --- a/app/views/admin/signature_sheets/new.html.erb +++ b/app/views/admin/signature_sheets/new.html.erb @@ -1,9 +1,22 @@ +<%= render 'shared/back_link' %> + +

<%= t("admin.signature_sheets.new.title") %>

+ <%= form_for [:admin, @signature_sheet] do |f| %> <%= render 'shared/errors', resource: @signature_sheet %> - <%= f.select :signable_type, signable_options %> - <%= f.text_field :signable_id %> - <%= f.text_area :document_numbers %> - <%= f.submit %> -<% end %> \ No newline at end of file +
+ <%= f.select :signable_type, signable_options %> +
+ +
+ <%= f.text_field :signable_id %> +
+ + <%= f.label :document_numbers %> +

<%= t("admin.signature_sheets.new.document_numbers_note") %>

+ <%= f.text_area :document_numbers, rows: "6", label: false %> + + <%= f.submit(class: "button", value: t("admin.signature_sheets.new.submit")) %> +<% end %> diff --git a/app/views/admin/signature_sheets/show.html.erb b/app/views/admin/signature_sheets/show.html.erb index 84f5cb672..357f173f2 100644 --- a/app/views/admin/signature_sheets/show.html.erb +++ b/app/views/admin/signature_sheets/show.html.erb @@ -1,28 +1,48 @@ -

<%= @signature_sheet.name %>

+

<%= @signature_sheet.name %>

-
Documentos: <%= @signature_sheet.document_numbers %>
-
Creado: <%= l(@signature_sheet.created_at, format: :short) %>
-
Autor: <%= @signature_sheet.author.name %>
-
- -
- Hay <%= @signature_sheet.signatures.valid.count %> firmas válidas +
+ <%= t("admin.signature_sheets.show.created_at") %> + <%= l(@signature_sheet.created_at, format: :short) %> +  •  + <%= t("admin.signature_sheets.show.author") %> + <%= @signature_sheet.author.name %>
-
- Hay <%= @signature_sheet.signatures.invalid.count %> firmas inválidas +
+

<%= t("admin.signature_sheets.show.documents") %>

+ <%= @signature_sheet.document_numbers %>
-
<% if @signature_sheet.signatures.invalid.any? %> +
+ + <%= t("admin.signature_sheets.show.valid", + count: @signature_sheet.signatures.valid.count ) %> + +
<% @invalid_signatures.each do |error, signatures| %> -
<%= error %>
-
- <%= signatures.map(&:document_number).join(",") %> +
+

+ + <%= t("admin.signature_sheets.show.invalid", + count: @signature_sheet.signatures.invalid.count ) %> + (<%= error %>) + +

+ <%= signatures.map(&:document_number).join(",") %>
<% end %> +<% else %> +
+ + <%= t("admin.signature_sheets.show.all_valid", + count: @signature_sheet.signatures.valid.count ) %> + +
<% end %> <% unless @signature_sheet.processed? %> - Aún hay firmas que se están verificando por el Padrón, por favor refresca la página en unos instantes. +
+ <%= t("admin.signature_sheets.show.loading") %> +
<% end %> \ No newline at end of file diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index b2fc86ce2..3b4e1f1c8 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -69,6 +69,10 @@ en: external_url: "Link to additional documentation" geozone_id: "Scope of operation" title: "Title" + signature_sheet: + signable_type: "Signable type" + signable_id: "Signable ID" + document_numbers: "Documents numbers" errors: models: user: diff --git a/config/locales/activerecord.es.yml b/config/locales/activerecord.es.yml index bc683970c..ea5aa14d6 100644 --- a/config/locales/activerecord.es.yml +++ b/config/locales/activerecord.es.yml @@ -69,6 +69,10 @@ es: external_url: "Enlace a documentación adicional" geozone_id: "Ámbito de actuación" title: "Título" + signature_sheet: + signable_type: "Tipo de hoja de firmas" + signable_id: "ID Propuesta ciudadana/Propuesta inversión" + document_numbers: "Números de documentos" errors: models: user: diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 373ec6085..6ba072419 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -296,10 +296,27 @@ en: delete: success: Geozone successfully deleted error: This geozone can't be deleted since there are elements attached to it - signature_sheet: + signature_sheets: author: Author created_at: Creation date name: Name + no_signature_sheets: "There are not signature_sheets" + index: + title: Signature sheets + new: New signature sheets + new: + title: New signature sheets + signable_type: Type of signature sheet + document_numbers_note: "Write the numbers separated by commas (,)" + submit: Create signature sheets + show: + created_at: Created + author: Author + documents: Documents + all_valid: "All the signatures (%{count}) are valid" + valid: "There are %{count} valid signatures" + invalid: "There are %{count} invalid signatures" + loading: "There are still signatures that are being verified by the Census, please refresh the page in a few moments" stats: show: stats_title: Stats diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index ec921b63a..ed4ad1bc1 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -294,10 +294,27 @@ es: delete: success: Distrito borrado correctamente error: No se puede borrar el distrito porque ya tiene elementos asociados - signature_sheet: + signature_sheets: author: Autor created_at: Fecha de creación name: Nombre + no_signature_sheets: "No existen hojas de firmas" + index: + title: Hojas de firmas + new: Nueva hoja de firmas + new: + title: Nueva hoja de firmas + signable_type: Tipo de hoja de firmas + document_numbers_note: "Introduce los números separados por comas (,)" + submit: Crear hoja de firmas + show: + created_at: Creado + author: Autor + documents: Documentos + all_valid: "Todas las firmas introducidas (%{count}) son válidas" + valid: "Hay %{count} firmas válidas" + invalid: "Hay %{count} firmas inválidas" + loading: "Aún hay firmas que se están verificando por el Padrón, por favor refresca la página en unos instantes" stats: show: stats_title: Estadísticas diff --git a/config/locales/settings.en.yml b/config/locales/settings.en.yml index 0de4e5feb..6d58f0727 100755 --- a/config/locales/settings.en.yml +++ b/config/locales/settings.en.yml @@ -27,6 +27,7 @@ en: facebook_login: Facebook login google_login: Google login debates: Debates + signature_sheets: Signature sheets spending_proposals: Investment projects spending_proposal_features: voting_allowed: Voting on investment projects diff --git a/config/locales/settings.es.yml b/config/locales/settings.es.yml index 05ba6c076..aeb737f5b 100644 --- a/config/locales/settings.es.yml +++ b/config/locales/settings.es.yml @@ -27,6 +27,7 @@ es: facebook_login: Registro con Facebook google_login: Registro con Google debates: Debates + signature_sheets: Hojas de firmas spending_proposals: Propuestas de inversión spending_proposal_features: voting_allowed: Votaciones sobre propuestas de inversión. \ No newline at end of file