Add default actions list on admin dashboard actions index
This commit is contained in:
@@ -3,4 +3,8 @@ module Admin::ProposalDashboardActionsHelper
|
||||
return t("admin.dashboard.actions.index.active") if active
|
||||
t("admin.dashboard.actions.index.inactive")
|
||||
end
|
||||
|
||||
def default_actions
|
||||
%w[polls email poster]
|
||||
end
|
||||
end
|
||||
|
||||
13
app/views/admin/dashboard/actions/_default_actions.html.erb
Normal file
13
app/views/admin/dashboard/actions/_default_actions.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<% default_actions.each do |action| %>
|
||||
<tr>
|
||||
<td><%= t("admin.dashboard.actions.index.default.#{action}") %></td>
|
||||
<td><%= t("admin.dashboard.actions.action_type.resource") %></td>
|
||||
<td class="text-center"><%= t("admin.dashboard.actions.index.active") %></td>
|
||||
<td colspan="4"> </td>
|
||||
<td class="text-right">
|
||||
<%= link_to t("admin.dashboard.actions.index.edit"),
|
||||
admin_settings_path(anchor: "tab-proposals"),
|
||||
class: "button hollow" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -22,12 +22,6 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% if @dashboard_actions.empty? %>
|
||||
<tr>
|
||||
<td colspan="100%"><%= t("admin.dashboard.actions.index.no_records") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% @dashboard_actions.each do |action| %>
|
||||
<tr id="<%= dom_id(action) %>">
|
||||
<td><%= action.title %></td>
|
||||
@@ -49,5 +43,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<%= render "default_actions" %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -154,6 +154,7 @@ ignore_unused:
|
||||
- "admin.admin_notifications.*.submit_button"
|
||||
- "admin.homepage.*"
|
||||
- "admin.dashboard.administrator_tasks.index.filter*"
|
||||
- "admin.dashboard.actions.index.default.*"
|
||||
- "moderation.comments.index.filter*"
|
||||
- "moderation.comments.index.order*"
|
||||
- "moderation.debates.index.filter*"
|
||||
|
||||
@@ -379,7 +379,6 @@ en:
|
||||
create: Create resource or action
|
||||
edit: Edit
|
||||
delete: Delete
|
||||
no_records: No records found
|
||||
active: 'Yes'
|
||||
inactive: 'No'
|
||||
title: Resources and actions
|
||||
@@ -390,6 +389,10 @@ en:
|
||||
action_active: Active
|
||||
order: Order
|
||||
published_proposal: Published proposal
|
||||
default:
|
||||
email: Email
|
||||
polls: Polls
|
||||
poster: Poster
|
||||
new:
|
||||
creating: New action for the proposals dashboard
|
||||
back: Back to list
|
||||
|
||||
@@ -379,7 +379,6 @@ es:
|
||||
create: Crear recurso o acción
|
||||
edit: Editar
|
||||
delete: Borrar
|
||||
no_records: No se encontraron registros
|
||||
active: 'Si'
|
||||
inactive: 'No'
|
||||
title: Recursos y acciones
|
||||
@@ -390,6 +389,10 @@ es:
|
||||
action_active: Activo
|
||||
order: Orden
|
||||
published_proposal: Propuesta publicada
|
||||
default:
|
||||
email: Correo electrónico
|
||||
polls: Encuestas
|
||||
poster: Póster
|
||||
new:
|
||||
creating: Nueva acción para el dashboard de propuestas
|
||||
back: Volver a la lista
|
||||
|
||||
@@ -22,8 +22,12 @@ feature "Admin dashboard actions" do
|
||||
visit admin_dashboard_actions_path
|
||||
end
|
||||
|
||||
scenario "shows that there are no records available" do
|
||||
expect(page).to have_content("No records found")
|
||||
scenario "shows only default actions" do
|
||||
expect(page).to have_content("Polls")
|
||||
expect(page).to have_content("Email")
|
||||
expect(page).to have_content("Poster")
|
||||
|
||||
expect(page).to have_selector("a", text: "Edit", count: 3)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -69,7 +73,9 @@ feature "Admin dashboard actions" do
|
||||
|
||||
before do
|
||||
visit admin_dashboard_actions_path
|
||||
click_link "Edit"
|
||||
within ("#dashboard_action_#{action.id}") do
|
||||
click_link "Edit"
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Updates the action" do
|
||||
|
||||
Reference in New Issue
Block a user