aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/decorators/calendar_decorator.rb10
-rw-r--r--app/helpers/table_builder_helper.rb10
-rw-r--r--app/helpers/table_builder_helper/url.rb6
-rw-r--r--app/views/calendars/index.html.slim4
4 files changed, 29 insertions, 1 deletions
diff --git a/app/decorators/calendar_decorator.rb b/app/decorators/calendar_decorator.rb
index 0a7cbc312..1b2a085b7 100644
--- a/app/decorators/calendar_decorator.rb
+++ b/app/decorators/calendar_decorator.rb
@@ -5,11 +5,21 @@ class CalendarDecorator < AF83::Decorator
create_action_link
+<<<<<<< HEAD
with_instance_decorator do |instance_decorator|
instance_decorator.show_action_link
instance_decorator.edit_action_link
instance_decorator.destroy_action_link do |l|
l.data {{ confirm: h.t('calendars.actions.destroy_confirm') }}
+=======
+ if h.policy(object).destroy?
+ links << Link.new(
+ content: h.destroy_link_content,
+ href: h.workgroup_calendar_path(context[:workgroup], object),
+ method: :delete,
+ data: { confirm: h.t('calendars.actions.destroy_confirm') }
+ )
+>>>>>>> First draft for including calendars into workgroup for having appropriate scoping
end
end
end
diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb
index 2068dd23c..245843eab 100644
--- a/app/helpers/table_builder_helper.rb
+++ b/app/helpers/table_builder_helper.rb
@@ -316,6 +316,7 @@ module TableBuilderHelper
content_tag :span, '', class: 'fa fa-cog'
end
+<<<<<<< HEAD
action_links = item.action_links
if action_links.is_a?(AF83::Decorator::ActionLinks)
menu = content_tag :div, class: 'dropdown-menu' do
@@ -336,6 +337,15 @@ module TableBuilderHelper
gear_menu_link(link)
end.join.html_safe
end
+=======
+ menu = content_tag :ul, class: 'dropdown-menu' do
+ (
+ CustomLinks.new(item, pundit_user, links, referential, workgroup).links +
+ item.action_links.select { |link| link.is_a?(Link) }
+ ).map do |link|
+ gear_menu_link(link)
+ end.join.html_safe
+>>>>>>> First draft for including calendars into workgroup for having appropriate scoping
end
content_tag :div, trigger + menu, class: 'btn-group'
diff --git a/app/helpers/table_builder_helper/url.rb b/app/helpers/table_builder_helper/url.rb
index 0e3dce0aa..550b1e9d4 100644
--- a/app/helpers/table_builder_helper/url.rb
+++ b/app/helpers/table_builder_helper/url.rb
@@ -3,7 +3,7 @@ module TableBuilderHelper
def self.polymorphic_url_parts(item, referential, workgroup)
polymorph_url = []
- unless item.is_a?(Calendar) || item.is_a?(Referential) || item.is_a?(ComplianceControlSet)
+ unless item.is_a?(Referential) || item.is_a?(ComplianceControlSet)
if referential
polymorph_url << referential
polymorph_url << item.line if item.respond_to? :line
@@ -20,7 +20,11 @@ module TableBuilderHelper
end
end
else
+<<<<<<< HEAD
polymorph_url << item.workgroup if item.respond_to? :workgroup
+=======
+ polymorph_url << item.workgroup if item.is_a?(Calendar)
+>>>>>>> First draft for including calendars into workgroup for having appropriate scoping
polymorph_url << item
end
diff --git a/app/views/calendars/index.html.slim b/app/views/calendars/index.html.slim
index 0b58c0c72..a2d6b4731 100644
--- a/app/views/calendars/index.html.slim
+++ b/app/views/calendars/index.html.slim
@@ -1,4 +1,8 @@
- breadcrumb :calendars, workgroup
+- content_for :page_header_actions do
+ - if policy(Calendar).create?
+ = link_to(t('actions.add'), new_workgroup_calendar_path(current_workgroup), class: 'btn btn-default')
+
.page_content
.container-fluid