Create LocalCensusRecords index page
* Create admin controller and routes * Add pagination * Add search by document_number * Add EN and ES translations * Add index specs * Add missing model specs
This commit is contained in:
committed by
Javi Martín
parent
76400a8c23
commit
f071ca6cb5
@@ -0,0 +1,25 @@
|
||||
<tr id="<%= dom_id(local_census_record) %>" class="local_census_record">
|
||||
<td>
|
||||
<%= local_census_record.document_type %>
|
||||
</td>
|
||||
<td>
|
||||
<%= local_census_record.document_number %>
|
||||
</td>
|
||||
<td>
|
||||
<%= l local_census_record.date_of_birth %>
|
||||
</td>
|
||||
<td>
|
||||
<%= local_census_record.postal_code %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to t("admin.actions.edit"),
|
||||
edit_admin_local_census_record_path(local_census_record),
|
||||
class: "button hollow" %>
|
||||
|
||||
<%= link_to t("admin.actions.delete"),
|
||||
admin_local_census_record_path(local_census_record),
|
||||
method: :delete,
|
||||
class: "button hollow alert",
|
||||
data: { confirm: t("admin.actions.confirm") } %>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,23 @@
|
||||
<% if @local_census_records.any? %>
|
||||
<h3 class="margin"><%= page_entries_info @local_census_records %></h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("admin.local_census_records.index.document_type") %></th>
|
||||
<th><%= t("admin.local_census_records.index.document_number") %></th>
|
||||
<th><%= t("admin.local_census_records.index.date_of_birth") %></th>
|
||||
<th><%= t("admin.local_census_records.index.postal_code") %></th>
|
||||
<th><%= t("admin.actions.actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= render @local_census_records %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @local_census_records %>
|
||||
<% else %>
|
||||
<div class="callout primary">
|
||||
<%= t("admin.local_census_records.index.no_local_census_records") %>
|
||||
</div>
|
||||
<% end %>
|
||||
20
app/views/admin/local_census_records/index.html.erb
Normal file
20
app/views/admin/local_census_records/index.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<h2 class="inline-block"><%= t("admin.local_census_records.index.title") %></h2>
|
||||
|
||||
<%= link_to t("admin.local_census_records.index.create"),
|
||||
new_admin_local_census_record_path,
|
||||
class: "button float-right" %>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= form_tag admin_local_census_records_path, method: :get, remote: true do %>
|
||||
<div class="input-group">
|
||||
<%= text_field_tag :search, "", placeholder: t("admin.local_census_records.index.search.placeholder") %>
|
||||
<div class="input-group-button">
|
||||
<%= submit_tag t("admin.local_census_records.index.search.search"), class: "button" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="local_census_records">
|
||||
<%= render "local_census_records" %>
|
||||
</div>
|
||||
1
app/views/admin/local_census_records/index.js.erb
Normal file
1
app/views/admin/local_census_records/index.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#local_census_records").html("<%= j render "local_census_records" %>");
|
||||
Reference in New Issue
Block a user