From 8c9ce8f5c143d1e9d3f2c038e447a01ee59c91d3 Mon Sep 17 00:00:00 2001
From: Zog
Date: Mon, 15 Jan 2018 10:34:30 +0100
Subject: Refs #5586 @4h; First `action_links` refactor
- Implement new API
- Migrate the LineDecorator
- ensure no change on the "lines/index" view
---
app/views/lines/index.html.slim | 1 -
1 file changed, 1 deletion(-)
(limited to 'app/views')
diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim
index b62263263..399a2d8e1 100644
--- a/app/views/lines/index.html.slim
+++ b/app/views/lines/index.html.slim
@@ -52,7 +52,6 @@
attribute: Proc.new { |n| n.transport_submode.present? ? t("enumerize.transport_submode.#{n.try(:transport_submode)}") : "-" } \
) \
],
- links: [:show],
cls: 'table has-filter has-search'
= new_pagination @lines, 'pull-right'
--
cgit v1.2.3
From fef78d49bbc89aa41fe043b4035585605e14d389 Mon Sep 17 00:00:00 2001
From: Zog
Date: Mon, 15 Jan 2018 13:06:19 +0100
Subject: Refs #5586 @1h; Primary and secondary lonks implementation
As well as the `to_html` method
---
app/views/lines/show.html.slim | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
(limited to 'app/views')
diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim
index 83244f739..1c0578b0b 100644
--- a/app/views/lines/show.html.slim
+++ b/app/views/lines/show.html.slim
@@ -2,12 +2,9 @@
- content_for :page_header_content do
.row
.col-lg-12.text-right.mb-sm
- - @line.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: "btn btn-primary #{link.disabled ? "disabled" : ""}" do
- = link.content
+ - @line.action_links(:show, :primary).each do |link|
+ = link.to_html do |l|
+ - l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
- page_header_content_for @line
--
cgit v1.2.3
From aefa3a507239b57ebdfe9110f3c8c789da6bce26 Mon Sep 17 00:00:00 2001
From: Zog
Date: Mon, 15 Jan 2018 16:35:08 +0100
Subject: Refs #5586 @2h; Better implementation of groups
Used it in Lines#index and Lines#show, probably broke everything else
---
app/views/layouts/navigation/_page_header.html.slim | 10 ++++++++++
app/views/lines/show.html.slim | 7 -------
2 files changed, 10 insertions(+), 7 deletions(-)
(limited to 'app/views')
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
index 90fd7d855..076c76de4 100644
--- a/app/views/layouts/navigation/_page_header.html.slim
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -19,5 +19,15 @@ div.page_header
- if content_for? :page_header_actions
= yield :page_header_actions
+ - action_links = resource.action_links(params[:action]) rescue nil
+ - if action_links&.primary&.any? || action_links&.secondary&.any?
+ .row
+ .col-lg-12.text-right.mb-sm
+ - action_links.primary.each do |link|
+ = link.to_html do |l|
+ - l.class "btn btn-primary #{l.disabled ? "disabled" : ""} sticky-action"
+ - action_links.secondary.each do |link|
+ = link.to_html do |l|
+ - l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
- if content_for? :page_header_content
= yield :page_header_content
diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim
index 1c0578b0b..34b907bdd 100644
--- a/app/views/lines/show.html.slim
+++ b/app/views/lines/show.html.slim
@@ -1,11 +1,4 @@
- breadcrumb :line, @line
-- content_for :page_header_content do
- .row
- .col-lg-12.text-right.mb-sm
- - @line.action_links(:show, :primary).each do |link|
- = link.to_html do |l|
- - l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
-
- page_header_content_for @line
.page_content
--
cgit v1.2.3
From 936650bb189104bf9795e0a7e9b5b8044e59a652 Mon Sep 17 00:00:00 2001
From: Zog
Date: Mon, 15 Jan 2018 18:22:53 +0100
Subject: Refs #5586 @2h; Refactor the whole thing
We now have a ModelDecorator and an "instance" decorator, all in the
same file, with the same API.
---
app/views/layouts/navigation/_page_header.html.slim | 1 +
app/views/lines/index.html.slim | 3 ---
2 files changed, 1 insertion(+), 3 deletions(-)
(limited to 'app/views')
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
index 076c76de4..353361992 100644
--- a/app/views/layouts/navigation/_page_header.html.slim
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -20,6 +20,7 @@ div.page_header
= yield :page_header_actions
- action_links = resource.action_links(params[:action]) rescue nil
+ - action_links ||= decorated_collection.action_links(params[:action]) rescue nil
- if action_links&.primary&.any? || action_links&.secondary&.any?
.row
.col-lg-12.text-right.mb-sm
diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim
index 399a2d8e1..2d64e5f73 100644
--- a/app/views/lines/index.html.slim
+++ b/app/views/lines/index.html.slim
@@ -1,7 +1,4 @@
- breadcrumb :lines, @line_referential
-- content_for :page_header_actions do
- - if policy(Chouette::Line).create?
- = link_to(t('lines.actions.new'), new_line_referential_line_path(@line_referential), class: 'btn btn-primary')
.page_content
.container-fluid
--
cgit v1.2.3
From 305c10faa98bcf157ca114293b634da32a16cc37 Mon Sep 17 00:00:00 2001
From: Zog
Date: Tue, 16 Jan 2018 16:08:19 +0100
Subject: Refs #5586 @1h; Ensure retrocompatibility
And remove snapshots (we don't need it anymore)
---
app/views/layouts/navigation/_page_header.html.slim | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
(limited to 'app/views')
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
index 353361992..c916c4037 100644
--- a/app/views/layouts/navigation/_page_header.html.slim
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -1,3 +1,6 @@
+- action_links = resource.action_links(params[:action]) rescue nil
+- action_links ||= decorated_collection.action_links(params[:action]) rescue nil
+
div.page_header
div.container-fluid
div.row
@@ -18,17 +21,16 @@ div.page_header
= yield :page_header_meta
- if content_for? :page_header_actions
= yield :page_header_actions
+ - if action_links&.primary&.any?
+ - action_links.primary.each do |link|
+ = link.to_html do |l|
+ - l.class "btn btn-default #{l.disabled ? "disabled" : ""}"
- - action_links = resource.action_links(params[:action]) rescue nil
- - action_links ||= decorated_collection.action_links(params[:action]) rescue nil
- - if action_links&.primary&.any? || action_links&.secondary&.any?
+ - if action_links&.secondary&.any? || content_for?(:page_header_content)
.row
.col-lg-12.text-right.mb-sm
- - action_links.primary.each do |link|
- = link.to_html do |l|
- - l.class "btn btn-primary #{l.disabled ? "disabled" : ""} sticky-action"
- - action_links.secondary.each do |link|
+ - action_links && action_links.secondary.each do |link|
= link.to_html do |l|
- l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
- - if content_for? :page_header_content
- = yield :page_header_content
+ - if content_for? :page_header_content
+ = yield :page_header_content
--
cgit v1.2.3
From 44d38ab6b6a05a56a73c443c62f4a88d1733f274 Mon Sep 17 00:00:00 2001
From: Zog
Date: Tue, 16 Jan 2018 16:51:58 +0100
Subject: Refs #5586 @1h; Migrate TimeTableDecorator
---
app/views/time_tables/index.html.slim | 1 -
app/views/time_tables/show.html.slim | 15 ---------------
2 files changed, 16 deletions(-)
(limited to 'app/views')
diff --git a/app/views/time_tables/index.html.slim b/app/views/time_tables/index.html.slim
index b684b0bcb..b194dcea1 100644
--- a/app/views/time_tables/index.html.slim
+++ b/app/views/time_tables/index.html.slim
@@ -54,7 +54,6 @@
attribute: Proc.new { |tt| l(tt.updated_at, format: :short) } \
) \
],
- links: [:show, :edit],
cls: 'table has-search'
= new_pagination @time_tables, 'pull-right'
diff --git a/app/views/time_tables/show.html.slim b/app/views/time_tables/show.html.slim
index df9789055..6d15323f3 100644
--- a/app/views/time_tables/show.html.slim
+++ b/app/views/time_tables/show.html.slim
@@ -4,21 +4,6 @@
- content_for :page_header_title, t('time_tables.show.title', name: @time_table.comment), flush: true
-- content_for :page_header_actions do
- - if policy(@time_table).edit?
- = link_to(t('actions.edit'), edit_referential_time_table_path(@referential, @time_table), class: 'btn btn-default')
-
-- content_for :page_header_content do
- .row.mb-sm
- .col-lg-12.text-right
- - @time_table.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
-
-
.page_content
.container-fluid
.row
--
cgit v1.2.3
From 377ddcd306fb9e61e734aaf3762e05f448938af0 Mon Sep 17 00:00:00 2001
From: Zog
Date: Wed, 17 Jan 2018 09:36:15 +0100
Subject: Refs #5586 @1.5h; Migrate more decorators
- Remove ApiKeyDecorator (never used)
- Migrate CalendarDecorator
- Migrate CompanyDecorator
- Migrate TimeTableDecorator
---
app/views/calendars/index.html.slim | 4 ----
app/views/calendars/show.html.slim | 22 +++++-----------------
app/views/companies/index.html.slim | 4 ----
app/views/companies/show.html.slim | 18 +++---------------
app/views/referential_companies/index.html.slim | 4 ----
app/views/time_tables/index.html.slim | 3 ---
6 files changed, 8 insertions(+), 47 deletions(-)
(limited to 'app/views')
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('
').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('
').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
--
cgit v1.2.3
From fc462f368bc45143b9f0b8649e5bec1f69e414c7 Mon Sep 17 00:00:00 2001
From: Zog
Date: Wed, 17 Jan 2018 10:16:55 +0100
Subject: Refs #5586 @1h; Refactor ReferentialDecorator
Plus:
- Fix a bug on `html_options` in AF83::Decorator::Link
- Add a `t` helper in AF83::Decorator to handle i18n
---
.../layouts/navigation/_page_header.html.slim | 31 +++++++++++-----------
app/views/referentials/show.html.slim | 16 -----------
2 files changed, 16 insertions(+), 31 deletions(-)
(limited to 'app/views')
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
index c916c4037..8240aa4c0 100644
--- a/app/views/layouts/navigation/_page_header.html.slim
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -1,22 +1,22 @@
- action_links = resource.action_links(params[:action]) rescue nil
- action_links ||= decorated_collection.action_links(params[:action]) rescue nil
-div.page_header
- div.container-fluid
- div.row
- div.col-lg-9.col-md-8.col-sm-7.col-xs-7
+.page_header
+ .container-fluid
+ .row
+ .col-lg-9.col-md-8.col-sm-7.col-xs-7
- if defined?(resource_class)
- div.page-icon
+ .page-icon
span.sb class="sb-#{resource_class.model_name.name.underscore}"
- div.page-title
+ .page-title
- if content_for? :page_header_title
h1 = yield :page_header_title
- else
- if defined?(resource_class)
h1 = t("#{resource_class.model_name.name.underscore.pluralize}.#{params[:action]}.title")
- div.col-lg-3.col-md-4.col-sm-5.col-xs-5.text-right
- div.page-action
+ .col-lg-3.col-md-4.col-sm-5.col-xs-5.text-right
+ .page-action
- if content_for? :page_header_meta
= yield :page_header_meta
- if content_for? :page_header_actions
@@ -27,10 +27,11 @@ div.page_header
- l.class "btn btn-default #{l.disabled ? "disabled" : ""}"
- if action_links&.secondary&.any? || content_for?(:page_header_content)
- .row
- .col-lg-12.text-right.mb-sm
- - action_links && action_links.secondary.each do |link|
- = link.to_html do |l|
- - l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
- - if content_for? :page_header_content
- = yield :page_header_content
+ .container-fluid
+ .row
+ .col-lg-12.text-right.mb-sm
+ - action_links && action_links.secondary.each do |link|
+ = link.to_html do |l|
+ - l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
+ - if content_for? :page_header_content
+ = yield :page_header_content
diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim
index cbb622c44..46019be35 100644
--- a/app/views/referentials/show.html.slim
+++ b/app/views/referentials/show.html.slim
@@ -1,21 +1,5 @@
- breadcrumb @referential
- page_header_content_for @referential
-- content_for :page_header_actions do
- - unless (@referential.referential_read_only? || !policy(@referential).edit?)
- = link_to(t('actions.edit'), edit_referential_path(@referential), class: 'btn btn-default')
-
-- content_for :page_header_content do
- .row.mb-sm
- .col-lg-12.text-right
- - @referential.action_links.each do |link|
- - if link.is_a?(HTMLElement)
- = link.to_html(class: 'btn btn-primary')
- - else
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
.page_content
.container-fluid
--
cgit v1.2.3
From ff5d96b530a41669c394b7b0dc138e29da48e97d Mon Sep 17 00:00:00 2001
From: Zog
Date: Mon, 22 Jan 2018 09:54:20 +0100
Subject: Refs #5586 @2h; Fix specs
---
app/views/layouts/navigation/_page_header.html.slim | 13 ++++++-------
app/views/workbenches/show.html.slim | 4 ++--
2 files changed, 8 insertions(+), 9 deletions(-)
(limited to 'app/views')
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
index 8240aa4c0..e407e53da 100644
--- a/app/views/layouts/navigation/_page_header.html.slim
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -26,12 +26,11 @@
= link.to_html do |l|
- l.class "btn btn-default #{l.disabled ? "disabled" : ""}"
- - if action_links&.secondary&.any? || content_for?(:page_header_content)
- .container-fluid
- .row
- .col-lg-12.text-right.mb-sm
- - action_links && action_links.secondary.each do |link|
+ - if action_links&.secondary&.any?
+ .row.mb-sm
+ .col-lg-12.text-right
+ - action_links.secondary.each do |link|
= link.to_html do |l|
- l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
- - if content_for? :page_header_content
- = yield :page_header_content
+ - if content_for? :page_header_content
+ = yield :page_header_content
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index 8907f3f08..a162ca334 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -59,8 +59,8 @@
) \
],
selectable: ->(ref){ @workbench.referentials.include?(ref) },
- links: [:show, :edit],
- cls: 'table has-filter has-search'
+ cls: 'table has-filter has-search',
+ action: :index
= multiple_selection_toolbox([:delete], collection_name: 'referentials')
--
cgit v1.2.3
From 759699cec33a06b931c50f4473460fb79290e356 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Tue, 23 Jan 2018 11:42:15 +0100
Subject: Imports#index: Move 'New import' button to action links
Begin the process of converting the `ImportDecorator` to the new action
links interface.
For now, only the "New import" button on the top right of the index page
is converted. The rest of the links are commented out for now and will
be treated in a subsequent commit.
Add a new `#class?` method to `AF83::Decorator::Link` that tells callers
whether a CSS class has been defined on the link. This allows us to
determine whether we should force a class or use the one provided in
`_page_header.html.slim`.
We need a way to specify the class of the link in the header because the
"New import" button is supposed to be blue (`.btn-primary`), but the
default for primary action links is white.
Refs #5586
---
app/views/imports/index.html.slim | 2 --
app/views/layouts/navigation/_page_header.html.slim | 6 ++++--
2 files changed, 4 insertions(+), 4 deletions(-)
(limited to 'app/views')
diff --git a/app/views/imports/index.html.slim b/app/views/imports/index.html.slim
index 856b715e0..951910d18 100644
--- a/app/views/imports/index.html.slim
+++ b/app/views/imports/index.html.slim
@@ -1,6 +1,4 @@
- breadcrumb :imports, @workbench
-- content_for :page_header_actions do
- = link_to(t('imports.actions.new'), new_workbench_import_path(workbench_id: @workbench), class: 'btn btn-primary')
.page_content
.container-fluid
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
index e407e53da..23bc64db0 100644
--- a/app/views/layouts/navigation/_page_header.html.slim
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -24,13 +24,15 @@
- if action_links&.primary&.any?
- action_links.primary.each do |link|
= link.to_html do |l|
- - l.class "btn btn-default #{l.disabled ? "disabled" : ""}"
+ - if !l.class?
+ - l.class "btn btn-default #{l.disabled ? "disabled" : ""}"
- if action_links&.secondary&.any?
.row.mb-sm
.col-lg-12.text-right
- action_links.secondary.each do |link|
= link.to_html do |l|
- - l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
+ - if !l.class?
+ - l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
- if content_for? :page_header_content
= yield :page_header_content
--
cgit v1.2.3
From 5ef7e7c47e9639af6e76cac4a520909ef36a148d Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Tue, 23 Jan 2018 12:10:30 +0100
Subject: ImportDecorator: Convert to new action links interface
Also remove the `delete` link because the policy disables it for
everyone (3f5ac4764b859f97f776df565599e312b4584a03,
17e946771afcff10b6165dd3a97b38aa9c06b1f2).
Refs #5586
---
app/views/imports/show.html.slim | 9 ---------
1 file changed, 9 deletions(-)
(limited to 'app/views')
diff --git a/app/views/imports/show.html.slim b/app/views/imports/show.html.slim
index cf137867b..e59c0c8f6 100644
--- a/app/views/imports/show.html.slim
+++ b/app/views/imports/show.html.slim
@@ -1,13 +1,4 @@
- breadcrumb :import, @workbench, @import
-- content_for :page_header_content do
- .row
- .col-lg-12.text-right.mb-sm
- - @import.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
- page_header_content_for @import
--
cgit v1.2.3
From 4e034f42107a2016db3a032d3c0cd1a5f8e43635 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Tue, 23 Jan 2018 14:45:47 +0100
Subject: AF83::Decorator::Link: Change #class? to #default_class
Instead of checking for an existing class and then setting the class,
provide a method to set a default class when one hasn't been defined.
This does effectively the same thing but moves the condition inside the
method.
Thanks Johan for the suggestion!
Refs #5586
---
app/views/layouts/navigation/_page_header.html.slim | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
(limited to 'app/views')
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
index 23bc64db0..cd4d41793 100644
--- a/app/views/layouts/navigation/_page_header.html.slim
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -24,15 +24,13 @@
- if action_links&.primary&.any?
- action_links.primary.each do |link|
= link.to_html do |l|
- - if !l.class?
- - l.class "btn btn-default #{l.disabled ? "disabled" : ""}"
+ - l.default_class "btn btn-default #{l.disabled ? "disabled" : ""}"
- if action_links&.secondary&.any?
.row.mb-sm
.col-lg-12.text-right
- action_links.secondary.each do |link|
= link.to_html do |l|
- - if !l.class?
- - l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
+ - l.default_class "btn btn-primary #{l.disabled ? "disabled" : ""}"
- if content_for? :page_header_content
= yield :page_header_content
--
cgit v1.2.3
From 6c969baf047a7c13b871c5fea41cda54e2b1f7fd Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Tue, 23 Jan 2018 14:57:07 +0100
Subject: NetworkDecorator: Convert to new action links interface
And remove the "create" link from the gear menu and header links of the
:show page because it didn't make sense there. Leave a "create" link on
the index page though.
Refs #5586
---
app/views/networks/index.html.slim | 3 ---
app/views/networks/show.html.slim | 10 +---------
2 files changed, 1 insertion(+), 12 deletions(-)
(limited to 'app/views')
diff --git a/app/views/networks/index.html.slim b/app/views/networks/index.html.slim
index b13c73e9e..6aeb140cc 100644
--- a/app/views/networks/index.html.slim
+++ b/app/views/networks/index.html.slim
@@ -1,7 +1,4 @@
- breadcrumb :networks, @line_referential
-- content_for :page_header_actions do
- - if policy(Chouette::Network).create?
- = link_to(t('networks.actions.new'), new_line_referential_network_path(@line_referential), class: 'btn btn-primary')
.page_content
.container-fluid
diff --git a/app/views/networks/show.html.slim b/app/views/networks/show.html.slim
index 8e40a13b2..527fb8d5b 100644
--- a/app/views/networks/show.html.slim
+++ b/app/views/networks/show.html.slim
@@ -1,14 +1,6 @@
- breadcrumb :network, @network
- page_header_content_for @network
-- content_for :page_header_content do
- .row
- .col-lg-12.text-right.mb-sm
- - @network.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
+
.page_content
.container-fluid
.row
--
cgit v1.2.3
From 990ca5807a3237dc72f2b66630261118d81696bc Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Tue, 23 Jan 2018 15:38:08 +0100
Subject: ReferentialNetworkDecorator: Convert to new action links interface
Need to add a `collection_name` method to
`ReferentialNetworksController` because
`ApplicationController#decorated_collection` can't infer the `Network`
model from the controller name.
Refs #5586
---
app/views/referential_networks/index.html.slim | 3 ---
app/views/referential_networks/show.html.slim | 9 ---------
2 files changed, 12 deletions(-)
(limited to 'app/views')
diff --git a/app/views/referential_networks/index.html.slim b/app/views/referential_networks/index.html.slim
index d556e7e5e..efa28dc05 100644
--- a/app/views/referential_networks/index.html.slim
+++ b/app/views/referential_networks/index.html.slim
@@ -1,7 +1,4 @@
- breadcrumb :referential_networks, @referential
-- if policy(Chouette::Network).create?
- - content_for :page_header_actions do
- = link_to(t('networks.actions.new'), new_referential_network_path(@referential), class: 'btn btn-default')
.page_content
.container-fluid
diff --git a/app/views/referential_networks/show.html.slim b/app/views/referential_networks/show.html.slim
index 7de304671..3d13d9211 100644
--- a/app/views/referential_networks/show.html.slim
+++ b/app/views/referential_networks/show.html.slim
@@ -1,14 +1,5 @@
- breadcrumb :referential_network, @referential, @network
- page_header_content_for @network
-- content_for :page_header_content do
- .row
- .col-lg-12.text-right.mb-sm
- - @network.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
--
cgit v1.2.3
From 766dd36e253cfe00f0cec96e7fa55687428b0f2a Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Wed, 24 Jan 2018 12:43:50 +0100
Subject: RouteDecorator: Convert to new action links interface
Important to add the `action: :index` argument on the table builder in
the `ReferentialLines#show` page so that the gear menu links render
correctly.
Refs #5586
---
app/views/referential_lines/show.html.slim | 4 ++--
app/views/routes/show.html.slim | 13 -------------
2 files changed, 2 insertions(+), 15 deletions(-)
(limited to 'app/views')
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index cfba8cab3..70f4048b3 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -79,8 +79,8 @@
attribute: Proc.new{ |r| r.try(:journey_patterns).count } \
) \
],
- links: [:show, :edit],
- cls: 'table has-search'
+ cls: 'table has-search',
+ action: :index
= new_pagination @routes, 'pull-right'
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index 644f79022..4d5963cd1 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -1,18 +1,5 @@
- breadcrumb :route, @referential, @route
- page_header_content_for @route
-- content_for :page_header_actions do
- - if policy(@route).edit?
- = link_to(t('actions.edit'), edit_referential_line_route_path(@referential, @line, @route), class: 'btn btn-default')
-
-- content_for :page_header_content do
- .row.mb-sm
- .col-lg-12.text-right
- - @route.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
.page_content
.container-fluid
--
cgit v1.2.3
From 8957ab3e9b28e7548d3a4028308558bec1403c33 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Wed, 24 Jan 2018 13:25:28 +0100
Subject: ReferentialLineDecorator: Convert action links to new interface
Refs #5586
---
app/views/referential_lines/show.html.slim | 9 ---------
app/views/referentials/show.html.slim | 4 ++--
2 files changed, 2 insertions(+), 11 deletions(-)
(limited to 'app/views')
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index 70f4048b3..02d605d8c 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -1,13 +1,4 @@
- breadcrumb :referential_line, @referential, @line
-- content_for :page_header_content do
- .row
- .col-lg-12.text-right.mb-sm
- - @line.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
- page_header_content_for @line
.page_content
diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim
index 46019be35..6c88f5b81 100644
--- a/app/views/referentials/show.html.slim
+++ b/app/views/referentials/show.html.slim
@@ -56,8 +56,8 @@
attribute: Proc.new { |n| n&.company&.name || "-" } \
) \
],
- links: [:show],
- cls: 'table has-filter has-search'
+ cls: 'table has-filter has-search',
+ action: :index
= new_pagination @reflines, 'pull-right'
--
cgit v1.2.3
From 5e41dbed021522331532eb0151ac441553be2d13 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Wed, 24 Jan 2018 13:49:29 +0100
Subject: RoutingConstraintZoneDecorator: Convert action links to new interface
Refs #5586
---
app/views/routing_constraint_zones/index.html.slim | 3 ---
app/views/routing_constraint_zones/show.html.slim | 9 ---------
2 files changed, 12 deletions(-)
(limited to 'app/views')
diff --git a/app/views/routing_constraint_zones/index.html.slim b/app/views/routing_constraint_zones/index.html.slim
index 7c54fca68..2f67b467e 100644
--- a/app/views/routing_constraint_zones/index.html.slim
+++ b/app/views/routing_constraint_zones/index.html.slim
@@ -1,7 +1,4 @@
- breadcrumb :routing_constraint_zones, @referential, @line
-- content_for :page_header_actions do
- - if (policy(Chouette::RoutingConstraintZone).create? && @referential.organisation == current_organisation)
- = link_to(t('actions.new'), new_referential_line_routing_constraint_zone_path(@referential, @line), class: 'btn btn-primary')
.page_content
.container-fluid
diff --git a/app/views/routing_constraint_zones/show.html.slim b/app/views/routing_constraint_zones/show.html.slim
index 3d1988545..8c8e9b17a 100644
--- a/app/views/routing_constraint_zones/show.html.slim
+++ b/app/views/routing_constraint_zones/show.html.slim
@@ -1,14 +1,5 @@
- breadcrumb :routing_constraint_zone, @referential, @line, @routing_constraint_zone
- page_header_content_for @routing_constraint_zone
-- content_for :page_header_content do
- .row
- .col-lg-12.text-right.mb-sm
- - @routing_constraint_zone.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
.page_content
.container-fluid
--
cgit v1.2.3
From c02c597cfcd8d21c9bf59d41dbd312e9c26289b8 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Wed, 24 Jan 2018 17:01:42 +0100
Subject: PurchaseWindowDecorator: Convert to new action links interface
Also add a new method `AF83::Decorator.define_instance_method`. Thanks
to Johan for suggesting that and walking me through writing it. This new
method allows us to define methods on the instance decorator. We need
this to preserve the `#bounding_dates` method that was defined in
`PurchaseWindowDecorator`.
Refs #5586
---
app/views/purchase_windows/index.html.slim | 4 ----
app/views/purchase_windows/show.html.slim | 9 ---------
2 files changed, 13 deletions(-)
(limited to 'app/views')
diff --git a/app/views/purchase_windows/index.html.slim b/app/views/purchase_windows/index.html.slim
index 04f9fb0a8..0dba86935 100644
--- a/app/views/purchase_windows/index.html.slim
+++ b/app/views/purchase_windows/index.html.slim
@@ -1,7 +1,4 @@
- breadcrumb :purchase_windows, @referential
-- content_for :page_header_actions do
- - if policy(Chouette::PurchaseWindow).create?
- = link_to(t('actions.add'), new_referential_purchase_window_path(@referential), class: 'btn btn-default')
.page_content
.container-fluid
@@ -32,7 +29,6 @@
sortable: false \
) \
],
- links: [:show],
cls: 'table has-filter'
= new_pagination @purchase_windows, 'pull-right'
diff --git a/app/views/purchase_windows/show.html.slim b/app/views/purchase_windows/show.html.slim
index 4ddde1706..4e836f424 100644
--- a/app/views/purchase_windows/show.html.slim
+++ b/app/views/purchase_windows/show.html.slim
@@ -1,14 +1,5 @@
- breadcrumb :purchase_window, @referential, @purchase_window
- page_header_content_for @purchase_window
-- content_for :page_header_content do
- .row.mb-sm
- .col-lg-12.text-right
- - @purchase_window.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
.page_content
.container-fluid
--
cgit v1.2.3
From a636969d6e588f0fb7d155bbc22582f742da8e48 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Thu, 25 Jan 2018 11:57:30 +0100
Subject: AF83::Decorator::Link: Delete `#default_class`
This method was overriding classes that were added by `#add_class` in
addition to those added by `#class`. Obviously, the argument to
`#add_class` should be appended to the default.
That seemed like a pain to do, so instead I'm getting rid of the concept
of a default class. Instead, we're going to force all links to use the
template-defined styles for now. That goes in line with Luc's desire to
be more consistent in the links, as he stated yesterday.
Refs #5586
---
app/views/layouts/navigation/_page_header.html.slim | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'app/views')
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
index cd4d41793..e407e53da 100644
--- a/app/views/layouts/navigation/_page_header.html.slim
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -24,13 +24,13 @@
- if action_links&.primary&.any?
- action_links.primary.each do |link|
= link.to_html do |l|
- - l.default_class "btn btn-default #{l.disabled ? "disabled" : ""}"
+ - l.class "btn btn-default #{l.disabled ? "disabled" : ""}"
- if action_links&.secondary&.any?
.row.mb-sm
.col-lg-12.text-right
- action_links.secondary.each do |link|
= link.to_html do |l|
- - l.default_class "btn btn-primary #{l.disabled ? "disabled" : ""}"
+ - l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
- if content_for? :page_header_content
= yield :page_header_content
--
cgit v1.2.3
From 1ca38572b94ca174634a87c34eaafd9189fcd7eb Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Thu, 25 Jan 2018 12:08:21 +0100
Subject: StopAreaDecorator: Convert to new action links interface
Refs #5586
---
app/views/stop_areas/index.html.slim | 4 ----
app/views/stop_areas/show.html.slim | 9 ---------
2 files changed, 13 deletions(-)
(limited to 'app/views')
diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim
index 63e99fd75..71c7f995c 100644
--- a/app/views/stop_areas/index.html.slim
+++ b/app/views/stop_areas/index.html.slim
@@ -1,7 +1,4 @@
- breadcrumb :stop_areas, @stop_area_referential
-- content_for :page_header_actions do
- - if policy(Chouette::StopArea).create?
- = link_to(t('stop_areas.actions.new'), new_stop_area_referential_stop_area_path(@stop_area_referential), class: 'btn btn-primary')
.page_content
.container-fluid
@@ -51,7 +48,6 @@
attribute: Proc.new { |s| Chouette::AreaType.find(s.area_type).try :label } \
), \
],
- links: [:show],
cls: 'table has-filter has-search'
= new_pagination @stop_areas, 'pull-right'
diff --git a/app/views/stop_areas/show.html.slim b/app/views/stop_areas/show.html.slim
index f9de34a98..b5ec8ac00 100644
--- a/app/views/stop_areas/show.html.slim
+++ b/app/views/stop_areas/show.html.slim
@@ -1,14 +1,5 @@
- breadcrumb :stop_area, @stop_area_referential, @stop_area
- page_header_content_for @stop_area
-- content_for :page_header_content do
- .row
- .col-lg-12.text-right.mb-sm
- - @stop_area.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
--
cgit v1.2.3
From 6a00c37a43648fdeee5d6eceb92b52986e06bb31 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Thu, 25 Jan 2018 12:35:35 +0100
Subject: referential_stop_areas/_form: Fix syntax error
Remove the extra `}` from the end of this line as it was a syntax error
and caused the page to break.
Refs #5586
---
app/views/referential_stop_areas/_form.html.slim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'app/views')
diff --git a/app/views/referential_stop_areas/_form.html.slim b/app/views/referential_stop_areas/_form.html.slim
index 50f5d4aaf..8181ec3f3 100644
--- a/app/views/referential_stop_areas/_form.html.slim
+++ b/app/views/referential_stop_areas/_form.html.slim
@@ -7,7 +7,7 @@
= form.inputs do
= form.input :id, as: :hidden
= form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")}
- = form.input :stop_area_type, as: :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.area_type.options, :include_blank => false }
+ = form.input :stop_area_type, as: :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.area_type.options, :include_blank => false
.location_info
h3 = t("stop_areas.stop_area.localisation")
--
cgit v1.2.3
From c9e5f4e5ab03c0d8e4ff65e72b8c77260cba9c20 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Thu, 25 Jan 2018 12:39:52 +0100
Subject: StopPointDecorator: Convert to new action links interface
Subtleties were that the links need to reference `StopArea`s. In
particular, the `edit` link goes to the `StopAreaReferential` path
instead of the referential-StopArea path.
Refs #5586
---
app/views/referential_stop_areas/show.html.slim | 9 ---------
app/views/routes/show.html.slim | 4 ++--
2 files changed, 2 insertions(+), 11 deletions(-)
(limited to 'app/views')
diff --git a/app/views/referential_stop_areas/show.html.slim b/app/views/referential_stop_areas/show.html.slim
index 0470b4654..cb04ab7a6 100644
--- a/app/views/referential_stop_areas/show.html.slim
+++ b/app/views/referential_stop_areas/show.html.slim
@@ -1,14 +1,5 @@
- breadcrumb :referential_stop_area, @referential, @stop_area
- page_header_content_for @stop_area
-- content_for :page_header_content do
- .row
- .col-lg-12.text-right.mb-sm
- - @stop_area.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
.page_content
.container-fluid
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index 4d5963cd1..375d7c57b 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -54,9 +54,9 @@
attribute: Proc.new { |s| t("stop_points.stop_point.for_alighting.#{s.for_alighting}") } \
) \
],
- links: [:show],
sortable: false,
- cls: 'table has-stoppoints'
+ cls: 'table has-stoppoints',
+ action: :index
- else
= replacement_msg t('stop_areas.search_no_results')
--
cgit v1.2.3
From fe4aaf1fd512882c1767e63b8fe936186b95f295 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Thu, 25 Jan 2018 12:44:15 +0100
Subject: imports/index.html.slim: Remove unnecessary `links` field
This is no longer needed thanks to the new action links interface.
Refs #5586
---
app/views/imports/index.html.slim | 1 -
1 file changed, 1 deletion(-)
(limited to 'app/views')
diff --git a/app/views/imports/index.html.slim b/app/views/imports/index.html.slim
index 951910d18..4fc077bd6 100644
--- a/app/views/imports/index.html.slim
+++ b/app/views/imports/index.html.slim
@@ -32,7 +32,6 @@
attribute: 'creator' \
) \
],
- links: [:show],
cls: 'table has-search'
= new_pagination @imports, 'pull-right'
--
cgit v1.2.3
From 9ee14d84ccfd19fb6a53c83826f352088f06b57c Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Thu, 25 Jan 2018 13:11:31 +0100
Subject: ComplianceControlSetDecorator: Convert to new action links interface
Refs #5586
---
app/views/compliance_control_sets/index.html.slim | 4 ----
app/views/compliance_control_sets/show.html.slim | 12 ------------
app/views/imports/show.html.slim | 1 -
3 files changed, 17 deletions(-)
(limited to 'app/views')
diff --git a/app/views/compliance_control_sets/index.html.slim b/app/views/compliance_control_sets/index.html.slim
index 28d2254bf..144a4e5b9 100644
--- a/app/views/compliance_control_sets/index.html.slim
+++ b/app/views/compliance_control_sets/index.html.slim
@@ -1,7 +1,4 @@
- breadcrumb :compliance_control_sets
-- content_for :page_header_actions do
- - if policy(ComplianceControlSet).create?
- = link_to(t('compliance_control_sets.actions.new'), new_compliance_control_set_path, class: 'btn btn-default')
.page_content
.container-fluid
@@ -38,7 +35,6 @@
) \
],
sortable: true,
- links: [:show],
cls: 'table has-filter has-search'
= new_pagination @compliance_control_sets, 'pull-right'
diff --git a/app/views/compliance_control_sets/show.html.slim b/app/views/compliance_control_sets/show.html.slim
index d915bbdaf..59100681d 100644
--- a/app/views/compliance_control_sets/show.html.slim
+++ b/app/views/compliance_control_sets/show.html.slim
@@ -1,17 +1,5 @@
- breadcrumb :compliance_control_set, @compliance_control_set
- page_header_content_for @compliance_control_set
-- content_for :page_header_content do
- .row.mb-sm
- .col-lg-12.text-right
- - @compliance_control_set.action_links.each do |link|
- - if link.is_a?(HTMLElement)
- = link.to_html(class: 'btn btn-primary')
- - else
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
.page_content
.container-fluid
diff --git a/app/views/imports/show.html.slim b/app/views/imports/show.html.slim
index e59c0c8f6..7a9d02077 100644
--- a/app/views/imports/show.html.slim
+++ b/app/views/imports/show.html.slim
@@ -45,7 +45,6 @@
sortable: false, \
) \
],
- links: [],
cls: 'table',
overhead: [ \
{}, \
--
cgit v1.2.3
From 2bf4cf2e3a9e54bc9b91bf3efcac721951df730d Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Thu, 25 Jan 2018 14:01:13 +0100
Subject: ComplianceControlDecorator: Convert to new action links interface
I was getting this error:
ActionView::Template::Error (undefined method `split' for nil:NilClass
Did you mean? split_all):
16:
17: / compliance controls without block
18: = render_compliance_control_block
19: = render_compliance_controls(@direct_compliance_controls)
20:
21: / compliance controls with block
22: - if params[:q] && params[:q][:compliance_control_block_id_eq_any].try(:present?)
app/helpers/table_builder_helper.rb:110:in `item_row_class_name'
app/helpers/table_builder_helper.rb:290:in `tbody'
app/helpers/table_builder_helper.rb:97:in `table_builder_2'
app/helpers/compliance_control_sets_helper.rb:79:in `block in render_table_builder'
app/helpers/compliance_control_sets_helper.rb:78:in `render_table_builder'
app/helpers/compliance_control_sets_helper.rb:71:in `block (2 levels) in render_compliance_controls'
app/helpers/compliance_control_sets_helper.rb:70:in `block in render_compliance_controls'
app/helpers/compliance_control_sets_helper.rb:69:in `render_compliance_controls'
app/views/compliance_control_sets/show.html.slim:19:in `_app_views_compliance_control_sets_show_html_slim___3528509151208629266_70279137561480'
The model name wasn't accessible from the view because this collection
is set up in an unorthodox way without a decorated collection.
Got help from Johan, and we ended up using the `model` param passed into
the table builder for this. It looks terrible with `model` all over the
place, but at least it gets us past the problem.
Refs #5586
---
app/views/compliance_controls/show.html.slim | 2 --
1 file changed, 2 deletions(-)
(limited to 'app/views')
diff --git a/app/views/compliance_controls/show.html.slim b/app/views/compliance_controls/show.html.slim
index 54b07abf1..8a65bb864 100644
--- a/app/views/compliance_controls/show.html.slim
+++ b/app/views/compliance_controls/show.html.slim
@@ -1,6 +1,4 @@
- breadcrumb :compliance_control, @compliance_control
-- content_for :page_header_actions do
- = link_to(t('actions.edit'), edit_compliance_control_set_compliance_control_path(params[:compliance_control_set_id], params[:id]), class: 'btn btn-default')
- page_header_content_for @compliance_control
--
cgit v1.2.3
From 6d682ae928eb89d083b05279ee0f6f97a3bebf23 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Thu, 25 Jan 2018 15:27:07 +0100
Subject: ComplianceCheckSetDecorator: Convert to new action links interface
Refs #5586
---
app/views/compliance_check_sets/index.html.slim | 1 -
app/views/compliance_check_sets/show.html.slim | 13 +------------
2 files changed, 1 insertion(+), 13 deletions(-)
(limited to 'app/views')
diff --git a/app/views/compliance_check_sets/index.html.slim b/app/views/compliance_check_sets/index.html.slim
index f15e85bdd..ead467174 100644
--- a/app/views/compliance_check_sets/index.html.slim
+++ b/app/views/compliance_check_sets/index.html.slim
@@ -41,7 +41,6 @@
), \
],
sortable: true,
- links: [:show],
cls: 'table has-filter has-search'
- unless @compliance_check_sets.any?
.row.mt-xs
diff --git a/app/views/compliance_check_sets/show.html.slim b/app/views/compliance_check_sets/show.html.slim
index 4db2e805f..4df14ab06 100644
--- a/app/views/compliance_check_sets/show.html.slim
+++ b/app/views/compliance_check_sets/show.html.slim
@@ -1,15 +1,4 @@
-- breadcrumb :compliance_check_set, @workbench, @compliance_check_set
-/ PageHeader
-- content_for :page_header_content do
- .row
- .col-lg-12.text-right.mb-sm
- - @compliance_check_set.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
-
+- breadcrumb :compliance_check_sets, @workbench, @compliance_check_set
- page_header_content_for @compliance_check_set
/ PageContent
--
cgit v1.2.3
From 988d074946990dc72e41af4d5fa1839fdb39d59e Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Thu, 25 Jan 2018 16:14:59 +0100
Subject: ImportResources#index: Get rid of `ImportResourceDecorator`
Seems like the object decorator for `ImportResource` isn't needed here.
It doesn't contain anything except for an empty `action_links` method,
which I'm guessing was to appease the table builder which used to expect
one.
Get rid of that decorator because it doesn't seem to be needed.
Also get rid of the `links` argument to the table builder because we
don't need it any more with the new action links interface.
Refs #5586
---
app/views/import_resources/index.html.slim | 1 -
1 file changed, 1 deletion(-)
(limited to 'app/views')
diff --git a/app/views/import_resources/index.html.slim b/app/views/import_resources/index.html.slim
index 0c21a9e09..6b4e60026 100644
--- a/app/views/import_resources/index.html.slim
+++ b/app/views/import_resources/index.html.slim
@@ -43,7 +43,6 @@
end \
), \
],
- links: [],
cls: 'table has-search'
- else
.col-lg-12
--
cgit v1.2.3
From 6a3f5953be119a22a3f32b14eb751df2e16f2dd8 Mon Sep 17 00:00:00 2001
From: Zog
Date: Mon, 29 Jan 2018 21:02:00 +0100
Subject: Refs #5763; Don't truncate referentials name in merge list
---
app/views/workbench_outputs/show.html.slim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'app/views')
diff --git a/app/views/workbench_outputs/show.html.slim b/app/views/workbench_outputs/show.html.slim
index dc0a54204..4f71fb7ef 100644
--- a/app/views/workbench_outputs/show.html.slim
+++ b/app/views/workbench_outputs/show.html.slim
@@ -20,7 +20,7 @@
), \
TableBuilderHelper::Column.new( \
key: :name, \
- attribute: 'name', \
+ attribute: 'full_names', \
link_to: lambda do |merge| \
workbench_merge_path merge.workbench, merge \
end \
--
cgit v1.2.3