From fd1d09c8c23efda9082057d02a5a10c41b85ad06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 2 Oct 2017 10:25:11 +0200 Subject: [PATCH] Booths and shifts index pages minor fixes Showing only actions to assign and edit shifits in shifts index, and option to create a new booth in booths index. --- app/views/admin/poll/booths/_booth.html.erb | 16 +++++++++------- app/views/admin/poll/booths/index.html.erb | 5 +++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/views/admin/poll/booths/_booth.html.erb b/app/views/admin/poll/booths/_booth.html.erb index 80b1ef38f..921361c4a 100644 --- a/app/views/admin/poll/booths/_booth.html.erb +++ b/app/views/admin/poll/booths/_booth.html.erb @@ -6,11 +6,13 @@ <%= booth.location %> - <%= link_to t("admin.booths.booth.shifts"), - new_admin_booth_shift_path(booth), - class: "button hollow" %> - <%= link_to t("admin.actions.edit"), - edit_admin_booth_path(booth), - class: "button hollow" %> + <% if controller_name == "shifts" || controller_name == "booths" && action_name == "available" %> + <%= link_to t("admin.booths.booth.shifts"), + new_admin_booth_shift_path(booth), + class: "button hollow" %> + <%= link_to t("admin.actions.edit"), + edit_admin_booth_path(booth), + class: "button hollow" %> + <% end %> - \ No newline at end of file + diff --git a/app/views/admin/poll/booths/index.html.erb b/app/views/admin/poll/booths/index.html.erb index 05044dd0e..95b248b3f 100644 --- a/app/views/admin/poll/booths/index.html.erb +++ b/app/views/admin/poll/booths/index.html.erb @@ -1,7 +1,8 @@

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

-<%= link_to t("admin.booths.index.add_booth"), new_admin_booth_path, - class: "button success float-right" %> +<% if controller_name == "booths" && action_name != "available" %> + <%= link_to t("admin.booths.index.add_booth"), new_admin_booth_path, class: "button success float-right" %> +<% end %> <% if @booths.empty? %>