Skip to content

Commit

Permalink
Apply 0.28 redesign to census feature
Browse files Browse the repository at this point in the history
  • Loading branch information
entantoencuanto committed Jan 2, 2025
1 parent c9acceb commit 0c1029e
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,39 +1,59 @@
<% add_decidim_page_title(t("admin.show.title", scope: "decidim.file_authorization_handler")) %>

<div class="card">
<div class="card-divider">
<h2 class="card-title">
<%= t('admin.show.title', scope: 'decidim.file_authorization_handler') %>
</h2>
</div>
<div class="card-section">
<% if @status.count > 0 %>
<p><%= t('decidim.file_authorization_handler.admin.show.data', count: @status.count,
due_date: l(@status.last_import_at, format: :long)) %>
</p>
<%= 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 %>
<p><%= t('admin.show.empty', scope: 'decidim.file_authorization_handler') %></p>
<% end %>
</div>
<div class="item_show__header">
<h1 class="item_show__header-title">
<%= t('admin.show.title', scope: 'decidim.file_authorization_handler') %>
</h1>
</div>

<div class="item__edit item__edit-1col">
<div class="item__edit-form">
<div class="form__wrapper">
<div class="card">
<div class="card-divider"></div>
<div class="card-section">

<div class="card">
<div class="card-divider">
<h2 class="card-title">
<%= t('admin.new.title', scope: 'decidim.file_authorization_handler') %>
</h2>
</div>
<div class="card-section">
<p><%= t('decidim.file_authorization_handler.admin.new.info') %></p>
<%= 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 %>
<div class="row column">
<p><%= t("decidim.verifications.csv_census.admin.index.data", count: @status.count,
due_date: l(@status.last_import_at, format: :long)) %>
</p>
<%= 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") } %>
</div>
<% else %>
<p class="row column"><%= t('admin.show.empty', scope: 'decidim.file_authorization_handler') %></p>
<% end %>
</div>

<div class="card-divider">
<h2 class="card-title">
<%= t('admin.new.title', scope: 'decidim.file_authorization_handler') %>
</h2>
</div>
<div class="card-section">
<div class="row column">
<p><%= t("decidim.file_authorization_handler.admin.new.info") %></p>
<pre class="code-block"><%= t("decidim.file_authorization_handler.admin.new.example") %></pre>
</div>

<div class="row column">
<%= 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 %>

<div class="item__edit-sticky">
<div class="item__edit-sticky-container">
<%= submit_tag t('admin.new.submit', scope: 'decidim.file_authorization_handler'), class: 'button button__sm button__transparent-secondary' %>
</div>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>
</div>
4 changes: 4 additions & 0 deletions config/locales/ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c1029e

Please sign in to comment.