diff options
| author | Alban Peignier | 2017-12-20 09:41:53 +0100 |
|---|---|---|
| committer | Alban Peignier | 2017-12-20 09:42:07 +0100 |
| commit | 38ab26f1ea40b7ab5774ff0c18fba54204767b88 (patch) | |
| tree | 6cac0527da202aae01664e8cda4e5c4649164add /app | |
| parent | 023fdab6840c7bb2d87d8ffee2df478574158d6e (diff) | |
| parent | 0a5c1fd25403c327593a5cbe10c7c58be6128c89 (diff) | |
| download | chouette-core-38ab26f1ea40b7ab5774ff0c18fba54204767b88.tar.bz2 | |
Merge branch 'master' into 5333-add-policies-for-referentials-sharing5333-add-policies-for-referentials-sharing
Diffstat (limited to 'app')
| -rw-r--r-- | app/assets/stylesheets/components/_panels.sass | 1 | ||||
| -rw-r--r-- | app/decorators/compliance_check_set_decorator.rb | 9 | ||||
| -rw-r--r-- | app/decorators/referential_line_decorator.rb | 15 | ||||
| -rw-r--r-- | app/decorators/stop_area_decorator.rb | 9 | ||||
| -rw-r--r-- | app/policies/calendar_policy.rb | 4 | ||||
| -rw-r--r-- | app/views/compliance_check_sets/index.html.slim | 4 | ||||
| -rw-r--r-- | app/views/dashboards/_dashboard.html.slim | 2 | ||||
| -rw-r--r-- | app/views/stop_area_referentials/show.html.slim | 2 | ||||
| -rw-r--r-- | app/views/stop_areas/index.html.slim | 4 |
9 files changed, 8 insertions, 42 deletions
diff --git a/app/assets/stylesheets/components/_panels.sass b/app/assets/stylesheets/components/_panels.sass index e9f615081..ab25d8184 100644 --- a/app/assets/stylesheets/components/_panels.sass +++ b/app/assets/stylesheets/components/_panels.sass @@ -34,6 +34,7 @@ a text-decoration: none color: $blue + text-transform: capitalize &:hover, &:focus color: $darkblue diff --git a/app/decorators/compliance_check_set_decorator.rb b/app/decorators/compliance_check_set_decorator.rb index 096596b19..c58e14d88 100644 --- a/app/decorators/compliance_check_set_decorator.rb +++ b/app/decorators/compliance_check_set_decorator.rb @@ -3,15 +3,6 @@ class ComplianceCheckSetDecorator < Draper::Decorator def action_links links = [] - - links << Link.new( - content: h.destroy_link_content, - href: h.workbench_compliance_check_sets_path(object.id), - method: :delete, - data: {confirm: h.t('imports.actions.destroy_confirm')} - ) - - links end def lines_status diff --git a/app/decorators/referential_line_decorator.rb b/app/decorators/referential_line_decorator.rb index 55acf7ed9..654f68bf5 100644 --- a/app/decorators/referential_line_decorator.rb +++ b/app/decorators/referential_line_decorator.rb @@ -24,21 +24,6 @@ class ReferentialLineDecorator < Draper::Decorator ) ) - if h.policy(Chouette::Line).create? && - context[:referential].organisation == context[:current_organisation] - links << Link.new( - content: h.t('actions.new'), - href: h.new_referential_line_path(context[:referential]) - ) - end - - if h.policy(object).update? - links << Link.new( - content: h.t('actions.edit'), - href: h.edit_referential_line_path(context[:referential], object) - ) - end - if h.policy(object).destroy? links << Link.new( content: h.destroy_link_content('actions.destroy'), diff --git a/app/decorators/stop_area_decorator.rb b/app/decorators/stop_area_decorator.rb index 4e777292d..8b2ebf490 100644 --- a/app/decorators/stop_area_decorator.rb +++ b/app/decorators/stop_area_decorator.rb @@ -7,15 +7,6 @@ class StopAreaDecorator < Draper::Decorator links = [] stop_area ||= object - if h.policy(Chouette::StopArea).new? - links << Link.new( - content: h.t('stop_areas.actions.new'), - href: h.new_stop_area_referential_stop_area_path( - stop_area.stop_area_referential - ) - ) - end - if h.policy(stop_area).update? links << Link.new( content: h.t('stop_areas.actions.edit'), diff --git a/app/policies/calendar_policy.rb b/app/policies/calendar_policy.rb index 3ba708ec9..c2da8c924 100644 --- a/app/policies/calendar_policy.rb +++ b/app/policies/calendar_policy.rb @@ -6,7 +6,7 @@ class CalendarPolicy < ApplicationPolicy end def create? - !archived? && user.has_permission?('calendars.create') + user.has_permission?('calendars.create') end def destroy?; instance_permission("destroy") end def update?; instance_permission("update") end @@ -14,6 +14,6 @@ class CalendarPolicy < ApplicationPolicy private def instance_permission permission - !archived? & organisation_match? && user.has_permission?("calendars.#{permission}") + organisation_match? && user.has_permission?("calendars.#{permission}") end end diff --git a/app/views/compliance_check_sets/index.html.slim b/app/views/compliance_check_sets/index.html.slim index f5d1bd777..f109845b4 100644 --- a/app/views/compliance_check_sets/index.html.slim +++ b/app/views/compliance_check_sets/index.html.slim @@ -12,7 +12,7 @@ [ \ TableBuilderHelper::Column.new( \ key: :ref, \ - attribute: 'compliance_check_set_id' \ + attribute: 'id' \ ), \ TableBuilderHelper::Column.new( \ key: :creation_date, \ @@ -41,5 +41,3 @@ .row.mt-xs .col-lg-12 = replacement_msg t('compliance_check_sets.search_no_results') - - diff --git a/app/views/dashboards/_dashboard.html.slim b/app/views/dashboards/_dashboard.html.slim index e5aa5093a..7d547bf4c 100644 --- a/app/views/dashboards/_dashboard.html.slim +++ b/app/views/dashboards/_dashboard.html.slim @@ -22,7 +22,7 @@ .panel.panel-default .panel-heading h3.panel-title.with_actions - = link_to "Modèles de calendrier", calendars_path + = link_to I18n.t("activerecord.models.calendar", count: @dashboard.current_organisation.calendars.size), calendars_path div = link_to '', calendars_path, class: ' fa fa-chevron-right pull-right' - if @dashboard.current_organisation.calendars.present? diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim index f66db89f4..911006c39 100644 --- a/app/views/stop_area_referentials/show.html.slim +++ b/app/views/stop_area_referentials/show.html.slim @@ -8,7 +8,7 @@ .col-lg-12.text-right = link_to stop_area_referential_stop_areas_path(@stop_area_referential), class: 'btn btn-primary' do = Referential.human_attribute_name(:stop_areas) - em.small = " (#{@stop_area_referential.stop_areas.size})" + em.small = " (#{@stop_area_referential.stop_areas.count})" - page_header_content_for @stop_area_referential .page_content diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim index c4d880081..dbf3b848d 100644 --- a/app/views/stop_areas/index.html.slim +++ b/app/views/stop_areas/index.html.slim @@ -24,7 +24,7 @@ key: :name, \ attribute: 'name', \ link_to: lambda do |stop_area| \ - referential_stop_area_path( \ + stop_area_referential_stop_area_path( \ @stop_area_referential, \ stop_area \ ) \ @@ -51,7 +51,7 @@ attribute: Proc.new { |s| (s.area_type.nil? ? '-' : t("enumerize.stop_area.area_type.#{s.try(:area_type)}")) } \ ), \ ], - links: [:show, :edit, :delete], + links: [:show], cls: 'table has-filter has-search' = new_pagination @stop_areas, 'pull-right' |
