diff options
| author | Zog | 2018-01-17 09:36:15 +0100 |
|---|---|---|
| committer | Zog | 2018-01-25 17:17:59 +0100 |
| commit | 377ddcd306fb9e61e734aaf3762e05f448938af0 (patch) | |
| tree | 4947ecf95e346adb1eb5578a4cd559a7fa146d33 /app/views | |
| parent | 44d38ab6b6a05a56a73c443c62f4a88d1733f274 (diff) | |
| download | chouette-core-377ddcd306fb9e61e734aaf3762e05f448938af0.tar.bz2 | |
Refs #5586 @1.5h; Migrate more decorators
- Remove ApiKeyDecorator (never used)
- Migrate CalendarDecorator
- Migrate CompanyDecorator
- Migrate TimeTableDecorator
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/calendars/index.html.slim | 4 | ||||
| -rw-r--r-- | app/views/calendars/show.html.slim | 22 | ||||
| -rw-r--r-- | app/views/companies/index.html.slim | 4 | ||||
| -rw-r--r-- | app/views/companies/show.html.slim | 18 | ||||
| -rw-r--r-- | app/views/referential_companies/index.html.slim | 4 | ||||
| -rw-r--r-- | app/views/time_tables/index.html.slim | 3 |
6 files changed, 8 insertions, 47 deletions
diff --git a/app/views/calendars/index.html.slim b/app/views/calendars/index.html.slim index 77478a624..92c24be5b 100644 --- a/app/views/calendars/index.html.slim +++ b/app/views/calendars/index.html.slim @@ -1,7 +1,4 @@ - breadcrumb :calendars -- content_for :page_header_actions do - - if policy(Calendar).create? - = link_to(t('actions.add'), new_calendar_path, class: 'btn btn-default') .page_content .container-fluid @@ -35,7 +32,6 @@ attribute: Proc.new { |c| t("#{c.try(:shared)}") } \ ) \ ], - links: [:show, :edit], cls: 'table has-filter' = new_pagination @calendars, 'pull-right' diff --git a/app/views/calendars/show.html.slim b/app/views/calendars/show.html.slim index da4afa3e6..8eb66dc60 100644 --- a/app/views/calendars/show.html.slim +++ b/app/views/calendars/show.html.slim @@ -1,25 +1,13 @@ - breadcrumb :calendar, @calendar - page_header_content_for @calendar -- content_for :page_header_content do - .row.mb-sm - .col-lg-12.text-right - - @calendar.action_links.each do |link| - = link_to link.href, - method: link.method, - data: link.data, - class: 'btn btn-primary' do - = link.content -- if policy(@calendar).edit? - - content_for :page_header_actions do - = link_to(t('actions.edit'), edit_calendar_path(@calendar), class: 'btn btn-default') .page_content .container-fluid .row .col-lg-6.col-md-6.col-sm-12.col-xs-12 = definition_list t('metadatas'), - { 'Nom court' => @calendar.try(:short_name), - Calendar.human_attribute_name(:shared) => t("#{@calendar.shared}"), - 'Organisation' => @calendar.organisation.name, - Calendar.human_attribute_name(:dates) => @calendar.dates.collect{|d| l(d, format: :short)}.join(', ').html_safe, - Calendar.human_attribute_name(:date_ranges) => @calendar.periods.map{|d| t('validity_range', debut: l(d.begin, format: :short), end: l(d.end, format: :short))}.join('<br>').html_safe } + { 'Nom court' => resource.try(:short_name), + Calendar.human_attribute_name(:shared) => t("#{resource.shared}"), + 'Organisation' => resource.organisation.name, + Calendar.human_attribute_name(:dates) => resource.dates.collect{|d| l(d, format: :short)}.join(', ').html_safe, + Calendar.human_attribute_name(:date_ranges) => resource.periods.map{|d| t('validity_range', debut: l(d.begin, format: :short), end: l(d.end, format: :short))}.join('<br>').html_safe } diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim index e031f3776..9f1502e54 100644 --- a/app/views/companies/index.html.slim +++ b/app/views/companies/index.html.slim @@ -1,7 +1,4 @@ - breadcrumb :companies, @line_referential -- content_for :page_header_actions do - - if policy(Chouette::Company).create? - = link_to(t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'btn btn-primary') .page_content .container-fluid @@ -34,7 +31,6 @@ end \ ) \ ], - links: [:show], cls: 'table has-search' = new_pagination @companies, 'pull-right' diff --git a/app/views/companies/show.html.slim b/app/views/companies/show.html.slim index 0d6b4aae3..ca0a410b3 100644 --- a/app/views/companies/show.html.slim +++ b/app/views/companies/show.html.slim @@ -1,25 +1,13 @@ - breadcrumb :company, @company -- content_for :page_header_content do - .row - .col-lg-12.text-right.mb-sm - - if policy(Chouette::Company).create? - = link_to t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'btn btn-primary' - - if policy(@company).update? - = link_to t('companies.actions.edit'), edit_line_referential_company_path(@line_referential, @company), class: 'btn btn-primary' - - if policy(@company).destroy? - = link_to line_referential_company_path(@line_referential, @company), method: :delete, data: {confirm: t('companies.actions.destroy_confirm')}, class: 'btn btn-primary' do - span.fa.fa-trash - span = t('companies.actions.destroy') - page_header_content_for @company - .page_content .container-fluid .row .col-lg-6.col-md-6.col-sm-12.col-xs-12 = definition_list t('metadatas'), { 'ID Codif' => @company.try(:get_objectid).try(:short_id), - Chouette::Company.human_attribute_name(:phone) => @company.phone, - Chouette::Company.human_attribute_name(:email) => @company.email, - Chouette::Company.human_attribute_name(:url) => @company.url } + Chouette::Company.human_attribute_name(:phone) => resource.phone, + Chouette::Company.human_attribute_name(:email) => resource.email, + Chouette::Company.human_attribute_name(:url) => resource.url } diff --git a/app/views/referential_companies/index.html.slim b/app/views/referential_companies/index.html.slim index 07de2bc9d..3bff448c7 100644 --- a/app/views/referential_companies/index.html.slim +++ b/app/views/referential_companies/index.html.slim @@ -1,7 +1,4 @@ - breadcrumb :referential_companies, @referential -- content_for :page_header_actions do - - if policy(Chouette::Company).create? - = link_to(t('companies.actions.new'), new_referential_company_path(@referential), class: 'btn btn-default') .page_content .container-fluid @@ -46,7 +43,6 @@ attribute: 'url' \ ) \ ], - links: [:show], cls: 'table has-search' = new_pagination @companies, 'pull-right' diff --git a/app/views/time_tables/index.html.slim b/app/views/time_tables/index.html.slim index b194dcea1..f58fbb5ea 100644 --- a/app/views/time_tables/index.html.slim +++ b/app/views/time_tables/index.html.slim @@ -1,7 +1,4 @@ - breadcrumb :time_tables, @referential -- content_for :page_header_actions do - - if (policy(Chouette::TimeTable).create? && @referential.organisation == current_organisation) - = link_to(t('actions.add'), new_referential_time_table_path(@referential), class: 'btn btn-default') .page_content .container-fluid |
