From 0c1029eb3defbe1bc04b1927a94361020a08d214 Mon Sep 17 00:00:00 2001 From: Eduardo Martinez Echevarria Date: Thu, 2 Jan 2025 13:19:04 +0100 Subject: [PATCH] Apply 0.28 redesign to census feature --- .../admin/censuses/show.html.erb | 86 ++++++++++++------- config/locales/ca.yml | 4 + config/locales/en.yml | 4 + config/locales/es.yml | 4 + 4 files changed, 65 insertions(+), 33 deletions(-) diff --git a/app/views/decidim/file_authorization_handler/admin/censuses/show.html.erb b/app/views/decidim/file_authorization_handler/admin/censuses/show.html.erb index 67f4df2..0cfdd02 100644 --- a/app/views/decidim/file_authorization_handler/admin/censuses/show.html.erb +++ b/app/views/decidim/file_authorization_handler/admin/censuses/show.html.erb @@ -1,39 +1,59 @@ +<% add_decidim_page_title(t("admin.show.title", scope: "decidim.file_authorization_handler")) %> -
-
-

- <%= t('admin.show.title', scope: 'decidim.file_authorization_handler') %> -

-
-
- <% if @status.count > 0 %> -

<%= t('decidim.file_authorization_handler.admin.show.data', count: @status.count, - due_date: l(@status.last_import_at, format: :long)) %> -

- <%= link_to t('decidim.file_authorization_handler.admin.destroy.title'), - censuses_path, - method: :delete, - class: 'button alert', - data: { confirm: t('decidim.file_authorization_handler.admin.destroy.confirm') } %> - <% else %> -

<%= t('admin.show.empty', scope: 'decidim.file_authorization_handler') %>

- <% end %> -
+
+

+ <%= t('admin.show.title', scope: 'decidim.file_authorization_handler') %> +

+
+
+
+
+
+
-
-
-

- <%= t('admin.new.title', scope: 'decidim.file_authorization_handler') %> -

-
-
-

<%= t('decidim.file_authorization_handler.admin.new.info') %>

- <%= form_tag censuses_path, multipart: true, class: 'form' do %> - <%= label_tag :name, t('admin.new.file', scope: 'decidim.file_authorization_handler') %> - <%= file_field_tag :file %> - <%= submit_tag t('admin.new.submit', scope: 'decidim.file_authorization_handler'), class: 'button' %> - <% end %> + <% if @status.count > 0 %> +
+

<%= t("decidim.verifications.csv_census.admin.index.data", count: @status.count, + due_date: l(@status.last_import_at, format: :long)) %> +

+ <%= link_to t("decidim.verifications.csv_census.admin.destroy.title"), + censuses_path, + method: :delete, + class: "button button__sm button__secondary alert", + data: { confirm: t("decidim.file_authorization_handler.admin.destroy.confirm") } %> +
+ <% else %> +

<%= t('admin.show.empty', scope: 'decidim.file_authorization_handler') %>

+ <% end %> +
+ +
+

+ <%= t('admin.new.title', scope: 'decidim.file_authorization_handler') %> +

+
+
+
+

<%= t("decidim.file_authorization_handler.admin.new.info") %>

+
<%= t("decidim.file_authorization_handler.admin.new.example") %>
+
+ +
+ <%= form_tag censuses_path, multipart: true, class: 'form' do %> + <%= label_tag :name, t('admin.new.file', scope: 'decidim.file_authorization_handler') %> + <%= file_field_tag :file %> + +
+
+ <%= submit_tag t('admin.new.submit', scope: 'decidim.file_authorization_handler'), class: 'button button__sm button__transparent-secondary' %> +
+
+ <% end %> +
+
+
+
diff --git a/config/locales/ca.yml b/config/locales/ca.yml index e776355..d54cdf2 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -39,6 +39,10 @@ ca: data: Hi ha un total de %{count} registres carregats. La última càrrega va ser el dia %{due_date} empty: Encara no hi ha dades censals carregades. Utilitza el següent formulari per importar-lo utilitzant un fitxer CSV. new: + example: | + "Document";"Data de naixement" + "0123456789X";"01/11/1990" + "1111111111Y";"15/01/1995" info: "Ha de ser un fitxer generat en excel i exportat en CSV amb dues columnes: document d'identitat i data de naixement" title: Pujar un nou cens file: Arxiu excel .csv amb les dades del cens diff --git a/config/locales/en.yml b/config/locales/en.yml index 59bd185..edca18c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -39,6 +39,10 @@ en: data: There are %{count} records loaded in total. Last upload date was on %{due_date} empty: There are no census data. Use the form below to import it using a CSV file. new: + example: | + "Document";"Birthdate" + "0123456789X";"01/11/1990" + "1111111111Y";"15/01/1995" info: 'Must be a file generated by excel and exported with CSV format with two columns: identity document and date of birth' title: Upload a new census file: Excel .csv file with census data diff --git a/config/locales/es.yml b/config/locales/es.yml index f8ecffd..eb53781 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -39,6 +39,10 @@ es: data: Hay un total de %{count} registros cargados. La última carga fue el día %{due_date} empty: No hay datos censales. Usa el formulario a continuación para importar usando un fichero CSV. new: + example: | + "Documento";"Fecha de nacimiento" + "0123456789X";"01/11/1990" + "1111111111Y";"15/01/1995" info: 'Debe ser un fichero generado por excel y exportado en formato CSV con dos columnas: documento de identidad y fecha de nacimiento' title: Subir un nuevo censo file: Archivo excel .csv con los datos del censo