aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/calendars_controller.rb4
-rw-r--r--app/views/calendars/show.html.slim10
2 files changed, 10 insertions, 4 deletions
diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb
index 86d567882..432e528f0 100644
--- a/app/controllers/calendars_controller.rb
+++ b/app/controllers/calendars_controller.rb
@@ -5,6 +5,10 @@ class CalendarsController < BreadcrumbController
respond_to :html
respond_to :js, only: :index
+ def show
+ @calendar = @calendar.decorate
+ end
+
private
def calendar_params
permitted_params = [:id, :name, :short_name, periods_attributes: [:id, :begin, :end, :_destroy], date_values_attributes: [:id, :value, :_destroy]]
diff --git a/app/views/calendars/show.html.slim b/app/views/calendars/show.html.slim
index 3886cefaa..26248cea8 100644
--- a/app/views/calendars/show.html.slim
+++ b/app/views/calendars/show.html.slim
@@ -8,10 +8,12 @@
/ Below is secondary actions & optional contents (filters, ...)
.row.mb-sm
.col-lg-12.text-right
- - if policy(@calendar).destroy?
- = link_to calendar_path(@calendar), method: :delete, data: { confirm: t('calendars.actions.destroy_confirm') }, class: 'btn btn-primary' do
- span.fa.fa-trash
- span = t('actions.destroy')
+ - @calendar.action_links.each do |link|
+ = link_to link.href,
+ method: link.method,
+ data: link.data,
+ class: 'btn btn-primary' do
+ = link.content
/ PageContent
.page_content