aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/api/kml/access_links/index.kml.slim2
-rw-r--r--app/views/api/kml/access_points/index.kml.slim2
-rw-r--r--app/views/api/kml/connection_links/index.kml.slim2
-rw-r--r--app/views/api/kml/journey_patterns/show.kml.slim4
-rw-r--r--app/views/api/kml/lines/show.kml.slim2
-rw-r--r--app/views/api/kml/routes/show.kml.slim2
-rw-r--r--app/views/api/kml/stop_areas/index.kml.slim2
-rw-r--r--app/views/api/v1/compliance_check_sets/validated.rabl1
-rw-r--r--app/views/api/v1/group_of_lines/short_description.rabl2
-rw-r--r--app/views/api/v1/group_of_lines/show.rabl2
-rw-r--r--app/views/api/v1/trident_objects/show.rabl2
-rw-r--r--app/views/api_keys/edit.html.slim14
-rw-r--r--app/views/api_keys/new.html.slim7
-rw-r--r--app/views/calendars/edit.html.slim8
-rw-r--r--app/views/calendars/index.html.slim10
-rw-r--r--app/views/calendars/new.html.slim7
-rw-r--r--app/views/calendars/show.html.slim14
-rw-r--r--app/views/companies/_form.html.slim34
-rw-r--r--app/views/companies/edit.html.slim5
-rw-r--r--app/views/companies/index.html.slim10
-rw-r--r--app/views/companies/new.html.slim8
-rw-r--r--app/views/companies/show.html.slim12
-rw-r--r--app/views/compliance_check_sets/_filters.html.slim8
-rw-r--r--app/views/compliance_check_sets/executed.html.slim8
-rw-r--r--app/views/compliance_check_sets/index.html.slim16
-rw-r--r--app/views/compliance_check_sets/show.html.slim47
-rw-r--r--app/views/compliance_control_blocks/edit.html.slim8
-rw-r--r--app/views/compliance_control_blocks/new.html.slim8
-rw-r--r--app/views/compliance_control_sets/edit.html.slim5
-rw-r--r--app/views/compliance_control_sets/index.html.slim14
-rw-r--r--app/views/compliance_control_sets/new.html.slim5
-rw-r--r--app/views/compliance_control_sets/show.html.slim8
-rw-r--r--app/views/compliance_controls/edit.html.slim5
-rw-r--r--app/views/compliance_controls/new.html.slim9
-rw-r--r--app/views/compliance_controls/select_type.html.slim7
-rw-r--r--app/views/compliance_controls/show.html.slim12
-rw-r--r--app/views/dashboards/_dashboard.html.slim14
-rw-r--r--app/views/dashboards/show.html.slim9
-rw-r--r--app/views/errors/forbidden.html.slim5
-rw-r--r--app/views/errors/not_found.html.slim11
-rw-r--r--app/views/errors/server_error.html.slim11
-rw-r--r--app/views/import_resources/index.html.slim9
-rw-r--r--app/views/imports/index.html.slim9
-rw-r--r--app/views/imports/new.html.slim4
-rw-r--r--app/views/imports/show.html.slim11
-rw-r--r--app/views/journey_patterns_collections/show.html.slim8
-rw-r--r--app/views/layouts/application.html.slim1
-rw-r--r--app/views/layouts/navigation/_page_header.html.slim23
-rw-r--r--app/views/line_footnotes/edit.html.slim7
-rw-r--r--app/views/line_footnotes/show.html.slim13
-rw-r--r--app/views/line_referentials/edit.html.slim5
-rw-r--r--app/views/line_referentials/show.html.slim12
-rw-r--r--app/views/lines/_filters.html.slim4
-rw-r--r--app/views/lines/_form.html.slim63
-rw-r--r--app/views/lines/edit.html.slim9
-rw-r--r--app/views/lines/index.html.slim10
-rw-r--r--app/views/lines/new.html.slim9
-rw-r--r--app/views/lines/show.html.slim15
-rw-r--r--app/views/networks/_form.html.slim27
-rw-r--r--app/views/networks/edit.html.slim9
-rw-r--r--app/views/networks/index.html.slim12
-rw-r--r--app/views/networks/new.html.slim8
-rw-r--r--app/views/networks/show.html.slim11
-rw-r--r--app/views/referential_companies/edit.html.slim3
-rw-r--r--app/views/referential_companies/index.html.slim10
-rw-r--r--app/views/referential_companies/new.html.slim1
-rw-r--r--app/views/referential_companies/show.html.slim11
-rw-r--r--app/views/referential_lines/edit.html.slim5
-rw-r--r--app/views/referential_lines/new.html.slim4
-rw-r--r--app/views/referential_lines/show.html.slim10
-rw-r--r--app/views/referential_networks/edit.html.slim3
-rw-r--r--app/views/referential_networks/index.html.slim10
-rw-r--r--app/views/referential_networks/new.html.slim3
-rw-r--r--app/views/referential_networks/show.html.slim9
-rw-r--r--app/views/referential_stop_areas/edit.html.slim3
-rw-r--r--app/views/referential_stop_areas/index.html.slim1
-rw-r--r--app/views/referential_stop_areas/new.html.slim2
-rw-r--r--app/views/referential_stop_areas/show.html.slim8
-rw-r--r--app/views/referentials/edit.html.slim8
-rw-r--r--app/views/referentials/new.html.slim9
-rw-r--r--app/views/referentials/select_compliance_control_set.html.slim9
-rw-r--r--app/views/referentials/show.html.slim13
-rw-r--r--app/views/routes/edit.html.slim7
-rw-r--r--app/views/routes/new.html.slim6
-rw-r--r--app/views/routes/show.html.slim13
-rw-r--r--app/views/routing_constraint_zones/edit.html.slim7
-rw-r--r--app/views/routing_constraint_zones/index.html.slim10
-rw-r--r--app/views/routing_constraint_zones/new.html.slim4
-rw-r--r--app/views/routing_constraint_zones/show.html.slim10
-rw-r--r--app/views/stop_area_referentials/show.html.slim11
-rw-r--r--app/views/stop_areas/_form.html.slim180
-rw-r--r--app/views/stop_areas/edit.html.slim8
-rw-r--r--app/views/stop_areas/index.html.slim12
-rw-r--r--app/views/stop_areas/new.html.slim7
-rw-r--r--app/views/stop_areas/select_parent.html.slim4
-rw-r--r--app/views/stop_areas/show.html.slim7
-rw-r--r--app/views/time_table_combinations/new.html.slim7
-rw-r--r--app/views/time_tables/edit.html.slim8
-rw-r--r--app/views/time_tables/index.html.slim9
-rw-r--r--app/views/time_tables/new.html.slim7
-rw-r--r--app/views/time_tables/show.html.slim16
-rw-r--r--app/views/vehicle_journeys/index.html.slim7
-rw-r--r--app/views/vehicle_journeys/show.html.slim3
-rw-r--r--app/views/workbenches/index.html.slim5
-rw-r--r--app/views/workbenches/show.html.slim9
105 files changed, 391 insertions, 729 deletions
diff --git a/app/views/api/kml/access_links/index.kml.slim b/app/views/api/kml/access_links/index.kml.slim
index 1bcfdacf1..06db8bf9d 100644
--- a/app/views/api/kml/access_links/index.kml.slim
+++ b/app/views/api/kml/access_links/index.kml.slim
@@ -8,7 +8,7 @@ kml xmlns="http://www.opengis.net/kml/2.2"
placemark id="#{access_link.objectid}"
name = h(access_link.name)
extendeddata
- - [ :access_link_type, :objectid, :object_version, :created_at, :updated_at, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :link_orientation].each do |prop|
+ - [ :access_link_type, :objectid, :object_version, :created_at, :updated_at, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :link_orientation].each do |prop|
data name="#{prop.to_s}"
value = h(access_link.send( prop))
diff --git a/app/views/api/kml/access_points/index.kml.slim b/app/views/api/kml/access_points/index.kml.slim
index 1a162f7ed..c6f6b7797 100644
--- a/app/views/api/kml/access_points/index.kml.slim
+++ b/app/views/api/kml/access_points/index.kml.slim
@@ -9,7 +9,7 @@ kml xmlns="http://www.opengis.net/kml/2.2"
placemark id="#{access_point.objectid}"
name = h(access_point.name)
extendeddata
- - [ :objectid, :object_version, :creator_id, :created_at, :updated_at, :name, :comment, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :openning_time, :closing_time, :access_type, :access_point_type, :mobility_restricted_suitability, :stairs_availability, :lift_availability].each do |prop|
+ - [ :objectid, :object_version, :created_at, :updated_at, :name, :comment, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :openning_time, :closing_time, :access_type, :access_point_type, :mobility_restricted_suitability, :stairs_availability, :lift_availability].each do |prop|
data name="#{prop.to_s}"
value = h(access_point.send( prop))
diff --git a/app/views/api/kml/connection_links/index.kml.slim b/app/views/api/kml/connection_links/index.kml.slim
index 7305fbc78..0acdeaafe 100644
--- a/app/views/api/kml/connection_links/index.kml.slim
+++ b/app/views/api/kml/connection_links/index.kml.slim
@@ -8,7 +8,7 @@ kml xmlns="http://www.opengis.net/kml/2.2"
placemark id="#{connection_link.objectid}"
name = h(connection_link.name)
extendeddata
- - [ :connection_link_type, :objectid, :object_version, :creator_id, :created_at, :updated_at, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop|
+ - [ :connection_link_type, :objectid, :object_version, :created_at, :updated_at, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop|
data name="#{prop.to_s}"
value = h(connection_link.send( prop))
diff --git a/app/views/api/kml/journey_patterns/show.kml.slim b/app/views/api/kml/journey_patterns/show.kml.slim
index 15fb96daa..347d358cc 100644
--- a/app/views/api/kml/journey_patterns/show.kml.slim
+++ b/app/views/api/kml/journey_patterns/show.kml.slim
@@ -4,7 +4,7 @@ kml xmlns="http://www.opengis.net/kml/2.2"
document
name = "#{h(Chouette::JourneyPattern.model_name.human)} : #{h(@journey_pattern.name)}"
extendeddata
- - [:objectid, :object_version, :creator_id, :created_at, :updated_at, :name, :comment, :registration_number, :published_name].each do |prop|
+ - [:objectid, :object_version, :created_at, :updated_at, :name, :comment, :registration_number, :published_name].each do |prop|
data name="#{prop.to_s}"
value = h(@journey_pattern.send( prop))
@@ -17,7 +17,7 @@ kml xmlns="http://www.opengis.net/kml/2.2"
placemark id="#{stop_area.objectid}"
name = h(stop_area.name)
extendeddata
- - [ :objectid, :object_version, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop|
+ - [ :objectid, :object_version, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop|
data name="#{prop.to_s}"
value = h(stop_area.send( prop))
diff --git a/app/views/api/kml/lines/show.kml.slim b/app/views/api/kml/lines/show.kml.slim
index d1e48323d..1163c98d3 100644
--- a/app/views/api/kml/lines/show.kml.slim
+++ b/app/views/api/kml/lines/show.kml.slim
@@ -7,7 +7,7 @@ kml xmlns="http://www.opengis.net/kml/2.2"
placemark id="#{@line.objectid}"
name = h(@line.name)
extendeddata
- - [ :transport_mode, :objectid, :created_at, :updated_at, :object_version, :creator_id, :name, :number, :published_name, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs].each do |prop|
+ - [ :transport_mode, :objectid, :created_at, :updated_at, :object_version, :name, :number, :published_name, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs].each do |prop|
data name="#{prop.to_s}"
value = h(@line.send( prop))
diff --git a/app/views/api/kml/routes/show.kml.slim b/app/views/api/kml/routes/show.kml.slim
index 8a2843bc0..fdf73754d 100644
--- a/app/views/api/kml/routes/show.kml.slim
+++ b/app/views/api/kml/routes/show.kml.slim
@@ -6,7 +6,7 @@ kml xmlns="http://www.opengis.net/kml/2.2"
placemark id="#{@route.objectid}"
name = h(@route.name)
extendeddata
- - [:direction, :wayback, :objectid, :object_version, :creator_id, :created_at, :updated_at, :name, :comment, :published_name, :number, :direction_text, :wayback_text].each do |prop|
+ - [:direction, :wayback, :objectid, :object_version, :created_at, :updated_at, :name, :comment, :published_name, :number, :direction_text, :wayback_text].each do |prop|
data name="#{prop.to_s}"
value = h(@route.send( prop))
diff --git a/app/views/api/kml/stop_areas/index.kml.slim b/app/views/api/kml/stop_areas/index.kml.slim
index a08dbf963..284bd3e34 100644
--- a/app/views/api/kml/stop_areas/index.kml.slim
+++ b/app/views/api/kml/stop_areas/index.kml.slim
@@ -8,7 +8,7 @@ kml xmlns="http://www.opengis.net/kml/2.2"
placemark id="#{stop_area.objectid}"
name = h(stop_area.name)
extendeddata
- - [:objectid, :object_version, :creator_id, :created_at, :updated_at, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop|
+ - [:objectid, :object_version, :created_at, :updated_at, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop|
data name="#{prop.to_s}"
value = h(stop_area.send( prop))
diff --git a/app/views/api/v1/compliance_check_sets/validated.rabl b/app/views/api/v1/compliance_check_sets/validated.rabl
index 1368a8014..4dfa9e420 100644
--- a/app/views/api/v1/compliance_check_sets/validated.rabl
+++ b/app/views/api/v1/compliance_check_sets/validated.rabl
@@ -4,7 +4,6 @@ attributes(
:id,
:referential_id,
:name,
- :creator,
:status,
:started_at,
:ended_at
diff --git a/app/views/api/v1/group_of_lines/short_description.rabl b/app/views/api/v1/group_of_lines/short_description.rabl
index 770b334ec..15465874c 100644
--- a/app/views/api/v1/group_of_lines/short_description.rabl
+++ b/app/views/api/v1/group_of_lines/short_description.rabl
@@ -1,6 +1,6 @@
object @group_of_line
extends "api/v1/trident_objects/short_description"
-[ :creator_id, :name].each do |attr|
+[:name].each do |attr|
attributes attr, :unless => lambda { |m| m.send( attr).nil?}
end
diff --git a/app/views/api/v1/group_of_lines/show.rabl b/app/views/api/v1/group_of_lines/show.rabl
index 96e4bfc58..d02247da9 100644
--- a/app/views/api/v1/group_of_lines/show.rabl
+++ b/app/views/api/v1/group_of_lines/show.rabl
@@ -1,6 +1,6 @@
object @group_of_line
extends "api/v1/trident_objects/show"
-[ :creator_id, :name].each do |attr|
+[:name].each do |attr|
attributes attr, :unless => lambda { |m| m.send( attr).nil?}
end
diff --git a/app/views/api/v1/trident_objects/show.rabl b/app/views/api/v1/trident_objects/show.rabl
index e58c0a866..9722594e1 100644
--- a/app/views/api/v1/trident_objects/show.rabl
+++ b/app/views/api/v1/trident_objects/show.rabl
@@ -1,5 +1,5 @@
attributes :objectid => :object_id
-[ :object_version, :created_at, :updated_at, :creator_id].each do |attr|
+[ :object_version, :created_at, :updated_at].each do |attr|
attributes attr, :unless => lambda { |m| m.send( attr).nil?}
end
diff --git a/app/views/api_keys/edit.html.slim b/app/views/api_keys/edit.html.slim
index 9d7d1fdb7..50808b5a4 100644
--- a/app/views/api_keys/edit.html.slim
+++ b/app/views/api_keys/edit.html.slim
@@ -1,16 +1,10 @@
-/ PageHeader
-= pageheader 'Clé d\'API',
- t('api_keys.edit.title'),
- 'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@api_key.updated_at, format: :short)),
- ''
-
- / Below are secondary actions & optional content (filters, ...)
+- page_header_content_for @api_key
+- content_for :page_header_content do
+ - if policy(@api_key).destroy?
.row.mb-sm
.col-lg-12.text-right
- = ( policy(@api_key).destroy? ? link_to(t('actions.destroy'), api_key_path(@api_key), :method => :delete, class: 'btn btn-default') : '' )
+ = link_to(t('actions.destroy'), api_key_path(@api_key), :method => :delete, class: 'btn btn-default')
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/api_keys/new.html.slim b/app/views/api_keys/new.html.slim
index 9acb08a94..2bed9f912 100644
--- a/app/views/api_keys/new.html.slim
+++ b/app/views/api_keys/new.html.slim
@@ -1,10 +1,3 @@
-/ PageHeader
-= pageheader 'Clé d\'API',
- t('api_keys.new.title'),
- 'Lorem ipsum dolor sit amet',
- ''
-
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/calendars/edit.html.slim b/app/views/calendars/edit.html.slim
index 3463bd05c..e806fc94b 100644
--- a/app/views/calendars/edit.html.slim
+++ b/app/views/calendars/edit.html.slim
@@ -1,11 +1,5 @@
- breadcrumb :calendar, @calendar
-/ PageHeader
-= pageheader 'modele-calendrier',
- t('.title', calendar: @calendar.name),
- '',
- t('last_update', time: l(@calendar.updated_at, format: :short))
-
-/ PageContent
+- page_header_content_for @calendar
.page_content
.container-fluid
.row
diff --git a/app/views/calendars/index.html.slim b/app/views/calendars/index.html.slim
index a95d54428..77478a624 100644
--- a/app/views/calendars/index.html.slim
+++ b/app/views/calendars/index.html.slim
@@ -1,12 +1,8 @@
- breadcrumb :calendars
-/ PageHeader
-- header_params = ['modele-calendrier',
- t('.title'),
- '']
-- header_params << link_to(t('actions.add'), new_calendar_path, class: 'btn btn-default') if policy(Calendar).create?
-= pageheader(*header_params) do
+- content_for :page_header_actions do
+ - if policy(Calendar).create?
+ = link_to(t('actions.add'), new_calendar_path, class: 'btn btn-default')
-/ PageContent
.page_content
.container-fluid
- if params[:q].present? or @calendars.any?
diff --git a/app/views/calendars/new.html.slim b/app/views/calendars/new.html.slim
index 146173d35..ce8b6a036 100644
--- a/app/views/calendars/new.html.slim
+++ b/app/views/calendars/new.html.slim
@@ -1,11 +1,4 @@
- breadcrumb :calendars
-/ PageHeader
-= pageheader 'modele-calendrier',
- t('.title'),
- '',
- ''
-
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/calendars/show.html.slim b/app/views/calendars/show.html.slim
index b2ace0ccc..da4afa3e6 100644
--- a/app/views/calendars/show.html.slim
+++ b/app/views/calendars/show.html.slim
@@ -1,12 +1,6 @@
- breadcrumb :calendar, @calendar
-/ PageHeader
-= pageheader 'modele-calendrier',
- @calendar.name,
- '',
- t('last_update', time: l(@calendar.updated_at, format: :short)),
- (policy(@calendar).edit? ? link_to(t('actions.edit'), edit_calendar_path(@calendar), class: 'btn btn-default') : '') do
-
- / Below is secondary actions & optional contents (filters, ...)
+- 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|
@@ -15,8 +9,10 @@
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')
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/companies/_form.html.slim b/app/views/companies/_form.html.slim
index caf75bd8b..3979c5800 100644
--- a/app/views/companies/_form.html.slim
+++ b/app/views/companies/_form.html.slim
@@ -1,18 +1,18 @@
-= semantic_form_for [@line_referential, @company] do |form|
- = form.inputs do
- = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.company.name") }
- = form.input :short_name
- = form.input :organizational_unit
- = form.input :operating_department_name
- = form.input :code
- = form.input :phone, as: :phone
- = form.input :fax, as: :phone
- = form.input :email, as: :email
- = form.input :time_zone, include_blank: true
- = form.input :url
- = form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.company.registration_number") }
- = form.input :objectid, :required => !@company.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.company.objectid") }
+= simple_form_for [@line_referential, @company], html: {class: 'form-horizontal', id: 'company_form'}, wrapper: :horizontal_form do |f|
+ .row
+ .col-lg-12
+ = f.input :name, :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.company.name")}
+ = f.input :short_name
+ = f.input :organizational_unit
+ = f.input :operating_department_name
+ = f.input :code
+ = f.input :phone
+ = f.input :fax
+ = f.input :email, as: :email
+ = f.input :time_zone, include_blank: true
+ = f.input :url
+ = f.input :registration_number, :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.company.registration_number")}
- = form.actions do
- = form.action :submit, as: :button
- = form.action :cancel, as: :link \ No newline at end of file
+ .separator
+
+ = f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'company_form'
diff --git a/app/views/companies/edit.html.slim b/app/views/companies/edit.html.slim
index 2f4c559b9..faa88f829 100644
--- a/app/views/companies/edit.html.slim
+++ b/app/views/companies/edit.html.slim
@@ -1,4 +1,3 @@
- breadcrumb :company, @company
-
-= title_tag t('companies.edit.title', company: @company.name)
-= render 'form'
+- page_header_content_for @company
+= render 'form' \ No newline at end of file
diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim
index 8fcadc370..5d746642f 100644
--- a/app/views/companies/index.html.slim
+++ b/app/views/companies/index.html.slim
@@ -1,12 +1,8 @@
- breadcrumb :companies, @line_referential
-/ PageHeader
-= pageheader 'transporteur',
- t('companies.index.title'),
- 'Lorem ipsum dolor sit amet',
- '',
- (policy(Chouette::Company).create? ? link_to(t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'btn btn-primary') : '')
+- 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')
-/ PageContent
.page_content
.container-fluid
- if params[:q].present? or @companies.any?
diff --git a/app/views/companies/new.html.slim b/app/views/companies/new.html.slim
index 68c0f76c3..cc085ffe2 100644
--- a/app/views/companies/new.html.slim
+++ b/app/views/companies/new.html.slim
@@ -1,2 +1,6 @@
-= title_tag t('companies.new.title')
-= render 'form'
+- breadcrumb :lines, @line_referential
+.page_content
+ .container-fluid
+ .row
+ .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
+ = render 'form' \ No newline at end of file
diff --git a/app/views/companies/show.html.slim b/app/views/companies/show.html.slim
index 4219595b8..0d6b4aae3 100644
--- a/app/views/companies/show.html.slim
+++ b/app/views/companies/show.html.slim
@@ -1,11 +1,6 @@
- breadcrumb :company, @company
-/ PageHeader
-= pageheader 'transporteur',
- @company.name,
- 'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@company.updated_at, format: :short)) do
- / Below is secundary actions & optional contents (filters, ...)
+- content_for :page_header_content do
.row
.col-lg-12.text-right.mb-sm
- if policy(Chouette::Company).create?
@@ -16,14 +11,15 @@
= 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
+
-/ PageContent
.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(:local_id),
+ { '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 }
diff --git a/app/views/compliance_check_sets/_filters.html.slim b/app/views/compliance_check_sets/_filters.html.slim
index 3051bda64..bf929bc08 100644
--- a/app/views/compliance_check_sets/_filters.html.slim
+++ b/app/views/compliance_check_sets/_filters.html.slim
@@ -10,14 +10,18 @@
.form-group.togglable
= f.label t('activerecord.attributes.compliance_check_set.assigned_to'), required: false, class: 'control-label'
= f.input :parent_type_eq_any, collection: ComplianceCheckSet.order('parent_type'), as: :check_boxes, label: false, label_method: lambda {|w| ("<span>#{w}</span>").html_safe}, required: false, wrapper_html: {class: 'checkbox_list'}
-
.form-group.togglable
= f.label Import.human_attribute_name(:created_at), required: false, class: 'control-label'
.filter_menu
= f.simple_fields_for :created_at do |p|
= p.input :start_date, as: :date, label: false, wrapper_html: {class: 'date smart_date filter_menu-item'}, default: @begin_range, include_blank: @begin_range ? false : true
= p.input :end_date, as: :date, label: false, wrapper_html: {class: 'date smart_date filter_menu-item'}, default: @end_range, include_blank: @end_range ? false : true
-
+ .form-group.search
+ .input-group.search_bar
+ = f.search_field :compliance_control_set_name_cont, class: 'form-control', placeholder: t('compliance_check_sets.filters.name_compliance_control_set')
+ span.input-group-btn
+ button.btn.btn-default type='submit'
+ span.fa.fa-search
.actions
= link_to t('actions.erase'), @compliance_checks_sets, class: 'btn btn-link'
= f.submit t('actions.filter'), class: 'btn btn-default', id: 'compliance_check_set_filter_btn'
diff --git a/app/views/compliance_check_sets/executed.html.slim b/app/views/compliance_check_sets/executed.html.slim
index bb055272d..da8a2a3de 100644
--- a/app/views/compliance_check_sets/executed.html.slim
+++ b/app/views/compliance_check_sets/executed.html.slim
@@ -1,8 +1,6 @@
- breadcrumb :compliance_check_set, @workbench, @compliance_check_set
-/ PageHeader
-= pageheader 'jeux-de-donnees',
- t('compliance_check_sets.executed.title', name: @compliance_check_set.name)
-/ PageContent
+- page_header_content_for @compliance_check_set
+
.page_content
.container-fluid
.row
@@ -47,7 +45,7 @@
sortable: true,
cls: 'table has-filter has-search',
model: ComplianceCheck
-
+
- @blocks_to_compliance_checks_map.each do |block, compliance_checks|
- if compliance_checks.try(:any?)
diff --git a/app/views/compliance_check_sets/index.html.slim b/app/views/compliance_check_sets/index.html.slim
index 4ca5a2ee7..f5d1bd777 100644
--- a/app/views/compliance_check_sets/index.html.slim
+++ b/app/views/compliance_check_sets/index.html.slim
@@ -1,15 +1,5 @@
- breadcrumb :compliance_check_sets, @workbench
-/ PageHeader
-- header_params = ['jeux-de-donnees',
- t('compliance_check_sets.index.title'),
- '']
-= pageheader(*header_params) do
- / Below is secundary actions & optional contents (filters, ...)
- .row.mb-sm
- .col-lg-12.text-right
-
-/ PageContent
.page_content
.container-fluid
.row
@@ -22,7 +12,7 @@
[ \
TableBuilderHelper::Column.new( \
key: :ref, \
- attribute: 'referential_id' \
+ attribute: 'compliance_check_set_id' \
), \
TableBuilderHelper::Column.new( \
key: :creation_date, \
@@ -31,8 +21,8 @@
TableBuilderHelper::Column.new( \
key: :associated_object, \
attribute: Proc.new{|n| n.referential.name}, \
- link_to: lambda do |referential| \
- referential_path(referential, current_workbench_id: params[:id]) \
+ link_to: lambda do |compliance_check_set| \
+ referential_path(compliance_check_set.referential_id) \
end \
), \
TableBuilderHelper::Column.new( \
diff --git a/app/views/compliance_check_sets/show.html.slim b/app/views/compliance_check_sets/show.html.slim
new file mode 100644
index 000000000..c9d0583a5
--- /dev/null
+++ b/app/views/compliance_check_sets/show.html.slim
@@ -0,0 +1,47 @@
+- breadcrumb :compliance_check_sets, @workbench, @compliance_check_set
+/ PageHeader
+= pageheader 'jeux-de-donnees',
+ @compliance_check_set.name,
+ '',
+ t('last_update', time: l(@compliance_check_set.updated_at, format: :short)) do
+
+ / Below is secundary actions & optional contents (filters, ...)
+ .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
+
+/ PageContent
+.page_content.import_messages
+ .container-fluid
+ .row
+ .col-lg-12
+ h1
+ span.status_icon = compliance_check_set_status(@compliance_check_set.status)
+ span = t('compliance_check_sets.show.table_state', lines_status: @compliance_check_set.lines_status , lines_in_compliance_check_set: @compliance_check_set.lines_in_compliance_check_set )
+ .col-lg-12
+ = t('compliance_check_sets.show.table_explanation')
+ .row
+ .col-lg-12
+ = table_builder_2 @compliance_check_set.compliance_check_resources,
+ [ \
+ TableBuilderHelper::Column.new( \
+ key: :name, \
+ attribute: 'name' \
+ ), \
+ TableBuilderHelper::Column.new( \
+ key: :status, \
+ attribute: Proc.new { |n| compliance_check_set_status(n.status) } \
+ ), \
+ TableBuilderHelper::Column.new( \
+ key: :metrics, \
+ attribute: Proc.new { |n| I18n.t('compliance_check_sets.show.metrics', n.metrics.deep_symbolize_keys) } \
+ ) \
+ ],
+ sortable: false, \
+ links: [],
+ cls: 'table'
diff --git a/app/views/compliance_control_blocks/edit.html.slim b/app/views/compliance_control_blocks/edit.html.slim
index 637bb7311..49aee7705 100644
--- a/app/views/compliance_control_blocks/edit.html.slim
+++ b/app/views/compliance_control_blocks/edit.html.slim
@@ -1,11 +1,7 @@
-/ PageHeader
-= pageheader 'jeux-de-controle',
- t('compliance_control_blocks.edit.title', compliance_control_block: @compliance_control_block.id)
+- page_header_content_for @compliance_control_block
-
-/ PageContent
.page_content
.container-fluid
.row
.col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
- = render 'form' \ No newline at end of file
+ = render 'form'
diff --git a/app/views/compliance_control_blocks/new.html.slim b/app/views/compliance_control_blocks/new.html.slim
index 49404c552..7d2551311 100644
--- a/app/views/compliance_control_blocks/new.html.slim
+++ b/app/views/compliance_control_blocks/new.html.slim
@@ -1,11 +1,5 @@
-/ PageHeader
-= pageheader 'jeux-de-controle',
- t('compliance_control_blocks.new.title')
-
-
-/ PageContent
.page_content
.container-fluid
.row
.col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
- = render 'form' \ No newline at end of file
+ = render 'form'
diff --git a/app/views/compliance_control_sets/edit.html.slim b/app/views/compliance_control_sets/edit.html.slim
index dbe537c93..fd68f0abb 100644
--- a/app/views/compliance_control_sets/edit.html.slim
+++ b/app/views/compliance_control_sets/edit.html.slim
@@ -1,9 +1,6 @@
- breadcrumb :compliance_control_set, @compliance_control_set
-/ PageHeader
-= pageheader 'jeux-de-controle',
- t('compliance_control_sets.edit.title', name: @compliance_control_set.name)
+- page_header_content_for @compliance_control_set
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/compliance_control_sets/index.html.slim b/app/views/compliance_control_sets/index.html.slim
index 69bff4725..2a5651280 100644
--- a/app/views/compliance_control_sets/index.html.slim
+++ b/app/views/compliance_control_sets/index.html.slim
@@ -1,16 +1,8 @@
- breadcrumb :compliance_control_sets
-/ PageHeader
-- header_params = ['jeux-de-controle',
- t('compliance_control_sets.index.title'),
- '']
-- header_params << link_to(t('compliance_control_sets.actions.new'), new_compliance_control_set_path, class: 'btn btn-default') if policy(Calendar).create?
-= pageheader(*header_params) do
+- 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')
- / Below is secundary actions & optional contents (filters, ...)
- .row.mb-sm
- .col-lg-12.text-right
-
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/compliance_control_sets/new.html.slim b/app/views/compliance_control_sets/new.html.slim
index d543a6395..ada0de5bf 100644
--- a/app/views/compliance_control_sets/new.html.slim
+++ b/app/views/compliance_control_sets/new.html.slim
@@ -1,10 +1,5 @@
- breadcrumb :compliance_control_sets
-/ PageHeader
-= pageheader 'jeux-de-controle',
- t('compliance_control_sets.index.new')
-
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/compliance_control_sets/show.html.slim b/app/views/compliance_control_sets/show.html.slim
index a6e2c192a..2291eda06 100644
--- a/app/views/compliance_control_sets/show.html.slim
+++ b/app/views/compliance_control_sets/show.html.slim
@@ -1,9 +1,6 @@
- breadcrumb :compliance_control_set, @compliance_control_set
-/ PageHeader
-= pageheader 'jeux-de-controle',
- t('compliance_control_sets.show.title', name: @compliance_control_set.name)
-
- / Below is secondary actions & optional contents (filters, ...)
+- 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|
@@ -16,7 +13,6 @@
class: 'btn btn-primary' do
= link.content
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/compliance_controls/edit.html.slim b/app/views/compliance_controls/edit.html.slim
index 192e3521f..00456410c 100644
--- a/app/views/compliance_controls/edit.html.slim
+++ b/app/views/compliance_controls/edit.html.slim
@@ -1,8 +1,5 @@
- breadcrumb :compliance_control, @compliance_control
-
-= pageheader 'jeux-de-controle',
- t('compliance_controls.edit.title')
-
+- page_header_content_for @compliance_control
.page_content
.container-fluid
diff --git a/app/views/compliance_controls/new.html.slim b/app/views/compliance_controls/new.html.slim
index bd2db230b..f7f47fba3 100644
--- a/app/views/compliance_controls/new.html.slim
+++ b/app/views/compliance_controls/new.html.slim
@@ -1,11 +1,4 @@
- breadcrumb :compliance_control_set, parent
-/ PageHeader
-- header_params = ['jeux-de-controle',
- t('compliance_controls.new.title'),
- '']
-= pageheader(*header_params) do
-
-
.page_content
.container-fluid
.row
@@ -14,4 +7,4 @@
= definition_list t('metadatas'),
I18n.t('activerecord.attributes.compliance_control.predicate') => @compliance_control.class.predicate,
- I18n.t('activerecord.attributes.compliance_control.prerequisite') => @compliance_control.class.prerequisite \ No newline at end of file
+ I18n.t('activerecord.attributes.compliance_control.prerequisite') => @compliance_control.class.prerequisite
diff --git a/app/views/compliance_controls/select_type.html.slim b/app/views/compliance_controls/select_type.html.slim
index ec1c360cb..d1c518ecf 100644
--- a/app/views/compliance_controls/select_type.html.slim
+++ b/app/views/compliance_controls/select_type.html.slim
@@ -1,11 +1,4 @@
- breadcrumb :compliance_control_set, parent
-/ PageHeader
-- header_params = ['jeux-de-controle',
- t('compliance_controls.select_type.title'),
- '']
-= pageheader(*header_params) do
-
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/compliance_controls/show.html.slim b/app/views/compliance_controls/show.html.slim
index f7ec118b0..54b07abf1 100644
--- a/app/views/compliance_controls/show.html.slim
+++ b/app/views/compliance_controls/show.html.slim
@@ -1,11 +1,9 @@
- breadcrumb :compliance_control, @compliance_control
-/ PageHeader
-= pageheader 'jeux-de-controle',
- t('compliance_controls.show.title'),
- '',
- link_to(t('actions.edit'), edit_compliance_control_set_compliance_control_path(params[:compliance_control_set_id], params[:id]), class: 'btn btn-default') do
+- 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
+
-/ PageContent
.page_content
.container-fluid
.row
@@ -29,4 +27,4 @@
- if @compliance_control.compliance_control_block
= definition_list t('compliance_controls.show.metadatas.compliance_control_block'),
I18n.t('activerecord.attributes.compliance_control_blocks.transport_mode') => I18n.t("enumerize.transport_mode.#{@compliance_control.compliance_control_block.transport_mode}"),
- I18n.t('activerecord.attributes.compliance_control_blocks.transport_submode') => I18n.t("enumerize.transport_submode.#{@compliance_control.compliance_control_block.transport_submode}") \ No newline at end of file
+ I18n.t('activerecord.attributes.compliance_control_blocks.transport_submode') => I18n.t("enumerize.transport_submode.#{@compliance_control.compliance_control_block.transport_submode}")
diff --git a/app/views/dashboards/_dashboard.html.slim b/app/views/dashboards/_dashboard.html.slim
index 0b5deffc6..f03301e23 100644
--- a/app/views/dashboards/_dashboard.html.slim
+++ b/app/views/dashboards/_dashboard.html.slim
@@ -19,6 +19,20 @@
.panel-body
em.small.text-muted = t('.offers.no_content')
+ .panel.panel-default
+ .panel-heading
+ h3.panel-title.with_actions
+ = "Modèles de calendrier"
+ div
+ = link_to '', calendars_path, class: ' fa fa-chevron-right pull-right'
+ - if @dashboard.current_organisation.calendars.present?
+ .list-group
+ - @dashboard.current_organisation.calendars.order("updated_at desc").limit(5).each do |calendar|
+ = link_to calendar.name, calendar_path(calendar), class: 'list-group-item'
+ - else
+ .panel-body
+ em.small.text-muted Aucun modèle de calendrier défini
+
.col-lg-6.col-md-6.col-sm-6.col-xs-12
.panel.panel-default
.panel-heading
diff --git a/app/views/dashboards/show.html.slim b/app/views/dashboards/show.html.slim
index e86af55a6..8df880f89 100644
--- a/app/views/dashboards/show.html.slim
+++ b/app/views/dashboards/show.html.slim
@@ -1,16 +1,11 @@
- breadcrumb :root
-/ PageHeader
-= pageheader 'tableau-de-bord',
- t('.title', organisation: current_organisation.name)
-
- / Below is secundary actions & optional contents (filters, ...)
+- content_for :page_header_title, t('.title', organisation: current_organisation.name)
+- content_for :page_header_content do
.row.mb-sm
.col-lg-12.text-right
- if policy(Api::V1::ApiKey).create?
= link_to t('actions.create_api_key'), new_api_key_path, class: 'btn btn-primary'
-
-/ PageContent
.page_content
.container-fluid
= render partial: @dashboard
diff --git a/app/views/errors/forbidden.html.slim b/app/views/errors/forbidden.html.slim
index 4ca3a6dbf..23ea67eff 100644
--- a/app/views/errors/forbidden.html.slim
+++ b/app/views/errors/forbidden.html.slim
@@ -1,7 +1,4 @@
-/ PageHeader
-= pageheader 'bug',
- 'Erreur 403',
- ''
+- content_for :page_header_title, 'Erreur 403'
.page_content
.container-fluid
diff --git a/app/views/errors/not_found.html.slim b/app/views/errors/not_found.html.slim
index 6348ea1be..8821e9ec3 100644
--- a/app/views/errors/not_found.html.slim
+++ b/app/views/errors/not_found.html.slim
@@ -1,7 +1,4 @@
-/ PageHeader
-= pageheader 'bug',
- 'Erreur 404',
- ''
+- content_for :page_header_title, 'Erreur 404'
.page_content
.container-fluid
@@ -11,11 +8,11 @@
- if I18n.locale == :fr
p
strong = "Désolé, la page demandée n'existe pas."
-
+
p = "Vous pouvez néanmoins continuer à utiliser l'application IBOO."
-
+
- else
p
strong = "The page you were looking for doesn't exist."
-
+
p = "You can still continue the use the IBOO application. Thank you for understanding."
diff --git a/app/views/errors/server_error.html.slim b/app/views/errors/server_error.html.slim
index 09884dc29..189a48760 100644
--- a/app/views/errors/server_error.html.slim
+++ b/app/views/errors/server_error.html.slim
@@ -1,7 +1,4 @@
-/ PageHeader
-= pageheader 'bug',
- 'Erreur serveur',
- ''
+- content_for :page_header_title, 'Erreur serveur'
.page_content
.container-fluid
@@ -11,11 +8,11 @@
- if I18n.locale == :fr
p
strong = "Désolé, une erreur est survenue."
-
+
p = "Vous pouvez néanmoins continuer à utiliser l'application IBOO."
-
+
- else
p
strong = "We're sorry, but something went wrong."
-
+
p = "You can still continue the use the IBOO application. Thank you for understanding."
diff --git a/app/views/import_resources/index.html.slim b/app/views/import_resources/index.html.slim
index 57c83ce82..1c4a5a765 100644
--- a/app/views/import_resources/index.html.slim
+++ b/app/views/import_resources/index.html.slim
@@ -1,11 +1,4 @@
-/ PageHeader
-= pageheader 'importer',
- t('.title'),
- '',
- '',
- ''
-/ PageContent
.page_content.import_messages
.container-fluid
.row
@@ -38,7 +31,7 @@
), \
TableBuilderHelper::Column.new( \
name: 'Résultat des tests' , \
- attribute: Proc.new { |n| I18n.t('import_resources.index.metrics', import_resoruce_metrics(n.metrics) }, \
+ attribute: Proc.new { |n| I18n.t('import_resources.index.metrics', n.metrics.deep_symbolize_keys) }, \
sortable: false, \
), \
TableBuilderHelper::Column.new( \
diff --git a/app/views/imports/index.html.slim b/app/views/imports/index.html.slim
index 35cd666b1..79452bbfc 100644
--- a/app/views/imports/index.html.slim
+++ b/app/views/imports/index.html.slim
@@ -1,12 +1,7 @@
- breadcrumb :imports, @workbench
-/ PageHeader
-= pageheader 'importer',
- t('.title'),
- '',
- '',
- link_to(t('imports.actions.new'), new_workbench_import_path(workbench_id: @workbench), class: 'btn btn-primary')
+- content_for :page_header_actions do
+ = link_to(t('imports.actions.new'), new_workbench_import_path(workbench_id: @workbench), class: 'btn btn-primary')
-/ PageContent
.page_content
.container-fluid
- if params[:q].present? or @imports.any?
diff --git a/app/views/imports/new.html.slim b/app/views/imports/new.html.slim
index b74d8eaf2..3e35028f7 100644
--- a/app/views/imports/new.html.slim
+++ b/app/views/imports/new.html.slim
@@ -1,9 +1,5 @@
- breadcrumb :imports, @workbench
-/ PageHeader
-= pageheader 'importer',
- t('.title')
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/imports/show.html.slim b/app/views/imports/show.html.slim
index 775b09e8b..5e22e03e0 100644
--- a/app/views/imports/show.html.slim
+++ b/app/views/imports/show.html.slim
@@ -1,11 +1,5 @@
- breadcrumb :import, @workbench, @import
-/ PageHeader
-= pageheader 'importer',
- @import.name,
- '',
- t('last_update', time: l(@import.updated_at, format: :short)) do
-
- / Below is secundary actions & optional contents (filters, ...)
+- content_for :page_header_content do
.row
.col-lg-12.text-right.mb-sm
- @import.action_links.each do |link|
@@ -15,7 +9,8 @@
class: 'btn btn-primary' do
= link.content
-/ PageContent
+- page_header_content_for @import
+
.page_content
.container-fluid
.row
diff --git a/app/views/journey_patterns_collections/show.html.slim b/app/views/journey_patterns_collections/show.html.slim
index 7c62b69ee..834501da3 100644
--- a/app/views/journey_patterns_collections/show.html.slim
+++ b/app/views/journey_patterns_collections/show.html.slim
@@ -1,9 +1,7 @@
- breadcrumb :journey_patterns, @referential, @route
-/ pageheader
-= pageheader 'mission',
- "Missions de #{@route.try(:stop_points).first.try(:stop_area).name} vers #{@route.try(:stop_points).last.try(:stop_area).name}",
- 'Lorem ipsum dolor sit amet',
- ''
+- page_header_content_for @route
+- content_for :page_header_title, t('journey_patterns.index.title', route: @route.name), flush: true
+
- @journey_patterns.each do |jp|
- jp.errors.each do |error_message|
= error_message
diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim
index 8c731007d..567e14ef0 100644
--- a/app/views/layouts/application.html.slim
+++ b/app/views/layouts/application.html.slim
@@ -17,6 +17,7 @@ html lang=I18n.locale
body
= render 'layouts/navigation/main_nav'
= render 'layouts/flash_messages', flash: flash
+ = render 'layouts/navigation/page_header'
= yield
#sidebar
= yield :sidebar
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
new file mode 100644
index 000000000..90fd7d855
--- /dev/null
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -0,0 +1,23 @@
+div.page_header
+ div.container-fluid
+ div.row
+ div.col-lg-9.col-md-8.col-sm-7.col-xs-7
+ - if defined?(resource_class)
+ div.page-icon
+ span.sb class="sb-#{resource_class.model_name.name.underscore}"
+ div.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
+ - if content_for? :page_header_meta
+ = yield :page_header_meta
+ - if content_for? :page_header_actions
+ = yield :page_header_actions
+
+ - if content_for? :page_header_content
+ = yield :page_header_content
diff --git a/app/views/line_footnotes/edit.html.slim b/app/views/line_footnotes/edit.html.slim
index 4a0fbb931..203bdab94 100644
--- a/app/views/line_footnotes/edit.html.slim
+++ b/app/views/line_footnotes/edit.html.slim
@@ -1,10 +1,5 @@
-/ PageHeader
-= pageheader 'ligne',
- "Notes sur la ligne #{@line.name}",
- 'Lorem ipsum dolor sit amet',
- (@line.footnotes.any? ? t('last_update', time: l(@line.footnotes.last.updated_at, format: :short)) : '')
+- page_header_content_for @line
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/line_footnotes/show.html.slim b/app/views/line_footnotes/show.html.slim
index 0ed1d2958..e4f2a1d42 100644
--- a/app/views/line_footnotes/show.html.slim
+++ b/app/views/line_footnotes/show.html.slim
@@ -1,12 +1,11 @@
- breadcrumb :line_footnotes, @referential, @line
-/ PageHeader
-= pageheader 'ligne',
- "Notes sur la ligne #{@line.name}",
- 'Lorem ipsum dolor sit amet',
- '',
- (policy(@line).update_footnote? ? link_to(t('actions.edit'), edit_referential_line_footnotes_path(@referential, @line), class: 'btn btn-primary') : '')
-/ PageContent
+- content_for :page_header_actions do
+ - if policy(@line).update_footnote?
+ = link_to(t('actions.edit'), edit_referential_line_footnotes_path(@referential, @line), class: 'btn btn-primary')
+
+- page_header_content_for @line
+
.page_content
.container-fluid
.row
diff --git a/app/views/line_referentials/edit.html.slim b/app/views/line_referentials/edit.html.slim
index 820b788e5..374d34ed3 100644
--- a/app/views/line_referentials/edit.html.slim
+++ b/app/views/line_referentials/edit.html.slim
@@ -1,3 +1,2 @@
-= title_tag t('line_referentials.edit.title', line_referential: @line_referential.name)
-
-= render 'form' \ No newline at end of file
+- page_header_content_for @line_referential
+= render 'form'
diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim
index b98e9d5bb..b4b32bc52 100644
--- a/app/views/line_referentials/show.html.slim
+++ b/app/views/line_referentials/show.html.slim
@@ -1,12 +1,9 @@
- breadcrumb :line_referential, @line_referential
-/ PageHeader
-= pageheader 'synchro-ilico',
- t('.title'),
- 'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@line_referential.updated_at, format: :short)),
- link_to(t('actions.sync'), sync_line_referential_path(@line_referential), method: :post, class: 'btn btn-default') do
+- page_header_content_for @line_referential
+- content_for :page_header_actions do
+ = link_to(t('actions.sync'), sync_line_referential_path(@line_referential), method: :post, class: 'btn btn-default')
- / Below is secundary actions & opt. contents
+- content_for :page_header_content do
.row.mb-md
.col-lg-12.text-right
= link_to line_referential_companies_path(@line_referential), class: 'btn btn-primary' do
@@ -19,7 +16,6 @@
= Referential.human_attribute_name(:lines)
em.small = " (#{@line_referential.lines.size})"
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/lines/_filters.html.slim b/app/views/lines/_filters.html.slim
index 58f8f2431..e3674656a 100644
--- a/app/views/lines/_filters.html.slim
+++ b/app/views/lines/_filters.html.slim
@@ -8,11 +8,11 @@
.ffg-row
.form-group.togglable
- = f.label Chouette::Line.human_attribute_name(:network), required: false, class: 'control-label'
+ = f.label Chouette::Line.human_attribute_name(:network_id), required: false, class: 'control-label'
= f.input :network_id_eq_any, collection: @line_referential.networks.order(name: :asc), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + l.name + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'}
.form-group.togglable
- = f.label Chouette::Line.human_attribute_name(:company), required: false, class: 'control-label'
+ = f.label Chouette::Line.human_attribute_name(:company_id), required: false, class: 'control-label'
= f.input :company_id_eq_any, collection: @line_referential.companies.order(name: :asc), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + l.name + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'}
.form-group.togglable
diff --git a/app/views/lines/_form.html.slim b/app/views/lines/_form.html.slim
index d7b5a65ed..4952b72ff 100644
--- a/app/views/lines/_form.html.slim
+++ b/app/views/lines/_form.html.slim
@@ -1,45 +1,22 @@
-= semantic_form_for [@line_referential, @line] do |form|
- = form.inputs do
- / = form.input :network, as: :select, :collection => Chouette::Network.all, include_blank: false
- / = form.input :company, as: :select, :collection => Chouette::Company.all, include_blank: false
- / = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.name") }
- / = form.input :published_name
- / = form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.registration_number")}
- / = form.input :number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.number") }
- / = form.input :transport_mode, include_blank: false
- / = form.input :color, as: :string
- / = form.input :text_color
- / = form.input :stable_id
- / = form.input :url
- / = form.input :mobility_restricted_suitability, as: :select, :collection => [[@line.human_attribute_name("accessible"), true], [@line.human_attribute_name("not_accessible"), false]], :include_blank => true
- / = form.input :flexible_service, as: :select, :collection => [[@line.human_attribute_name("on_demaond_fs"), true], [@line.human_attribute_name("regular_fs"), false]], :include_blank => true
- / = form.input :comment
- / = form.input :objectid, :required => !@line.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.objectid")}
- / = form.input :group_of_line_tokens, :label => t('.group_of_lines'), as: :text, :input_html => { :"data-pre" => ( @line.group_of_lines.map { |group_of_line| { :id => group_of_line.id, :name => group_of_line.name } } ).to_json }
+= simple_form_for [@line_referential, @line], html: {class: 'form-horizontal', id: 'lines_form'}, wrapper: :horizontal_form do |f|
+ .row
+ .col-lg-12
+ = f.input :name
+ = f.input :network_id, as: :select, :collection => @line_referential.networks, include_blank: false
+ = f.input :company_id, as: :select, :collection => @line_referential.companies, include_blank: false
+ = f.input :published_name
+ = f.input :registration_number
+ = f.input :number
+ = f.input :transport_mode, as: :select, collection: Chouette::Line.sorted_transport_modes, label: t('activerecord.attributes.compliance_control_blocks.transport_mode'), label_method: lambda {|t| ("<span>" + t("enumerize.transport_mode.#{t}") + "</span>").html_safe}, required: true, :include_blank => false
+ = f.input :transport_submode, as: :select, collection: Chouette::Line.sorted_transport_submodes, label: t('activerecord.attributes.compliance_control_blocks.transport_submode'), label_method: lambda {|t| ("<span>" + t("enumerize.transport_submode.#{t}") + "</span>").html_safe}, :include_blank => true
+ = f.input :color, as: :string
+ = f.input :text_color
+ = f.input :stable_id
+ = f.input :url
+ = f.input :mobility_restricted_suitability, as: :select, :collection => [[@line.human_attribute_name("accessible"), true], [@line.human_attribute_name("not_accessible"), false]], :include_blank => true
+ = f.input :flexible_service, as: :select, :collection => [[@line.human_attribute_name("on_demaond_fs"), true], [@line.human_attribute_name("regular_fs"), false]], :include_blank => true
+ = f.input :comment
+ .separator
- .footnotes_block
- h3 = t("footnotes.index.title")
+ = f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'lines_form'
- #footnotes
- = form.semantic_fields_for :footnotes do |f|
- = render "footnotes/footnote_fields", :f => f
-
- .add_footnote
- = link_to_add_association t("footnotes.actions.add_footnote"), form, :footnotes , :partial => "footnotes/footnote_fields", :"data-association-insertion-method" => "append", :"data-association-insertion-node" => "div#footnotes", class: 'add'
-
- = form.actions do
- = form.action :submit, as: :button
- = form.action :cancel, as: :link
-
-javascript:
- $(function() {
- $("#line_group_of_line_tokens").tokenInput("#{name_filter_referential_group_of_lines_path(@line_referential, format: :json)}", {
- crossDomain: false,
- prePopulate: $('#group_of_line_tokens').data('pre'),
- minChars: 3,
- preventDuplicates: true,
- hintText: "#{I18n.t('search_hint')}",
- noResultsText: "#{I18n.t('no_result_text')}",
- searchingText: "#{I18n.t('searching_term')}"
- });
- });
diff --git a/app/views/lines/edit.html.slim b/app/views/lines/edit.html.slim
index 3c2eee03f..efe674ba4 100644
--- a/app/views/lines/edit.html.slim
+++ b/app/views/lines/edit.html.slim
@@ -1,5 +1,8 @@
- breadcrumb :line, @line
+- page_header_content_for @line
-= title_tag t('lines.edit.title', line: @line.name)
-
-= render 'form'
+.page_content
+ .container-fluid
+ .row
+ .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
+ = render 'form'
diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim
index 911c95e0c..8b035b477 100644
--- a/app/views/lines/index.html.slim
+++ b/app/views/lines/index.html.slim
@@ -1,12 +1,8 @@
- breadcrumb :lines, @line_referential
-/ PageHeader
-= pageheader 'ligne',
- t('lines.index.title'),
- 'Lorem ipsum dolor sit amet',
- '',
- ((policy(Chouette::Line).create? && @line_referential.organisations.include?(current_organisation)) ? link_to(t('lines.actions.new'), new_line_referential_line_path(@line_referential), class: 'btn btn-primary') : '')
+- content_for :page_header_actions do
+ - if (policy(Chouette::Line).create? && @line_referential.organisations.include?(current_organisation))
+ = link_to(t('lines.actions.new'), new_line_referential_line_path(@line_referential), class: 'btn btn-primary')
-/ PageContent
.page_content
.container-fluid
- if params[:q].present? or @lines.any?
diff --git a/app/views/lines/new.html.slim b/app/views/lines/new.html.slim
index f09a4b4aa..6eecf1e7d 100644
--- a/app/views/lines/new.html.slim
+++ b/app/views/lines/new.html.slim
@@ -1,5 +1,6 @@
- breadcrumb :lines, @line_referential
-
-= title_tag t('lines.new.title')
-
-= render 'form'
+.page_content
+ .container-fluid
+ .row
+ .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
+ = render 'form'
diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim
index ccf237154..4969ca3cd 100644
--- a/app/views/lines/show.html.slim
+++ b/app/views/lines/show.html.slim
@@ -1,11 +1,5 @@
- breadcrumb :line, @line
-/ PageHeader
-= pageheader 'ligne',
- @line.name,
- 'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@line.updated_at, format: :short)) do
-
- / Below is secundary actions & optional contents
+- content_for :page_header_content do
.row
.col-lg-12.text-right.mb-sm
- @line.action_links.each do |link|
@@ -15,7 +9,8 @@
class: 'btn btn-primary' do
= link.content
-/ PageContent
+- page_header_content_for @line
+
.page_content
.container-fluid
.row
@@ -23,8 +18,8 @@
= definition_list t('metadatas'),
{ 'ID Codif' => @line.get_objectid.short_id,
'Activé' => (@line.deactivated? ? t('false') : t('true')),
- @line.human_attribute_name(:network) => (@line.network.nil? ? t('lines.index.unset') : @line.network.name),
- @line.human_attribute_name(:company) => (@line.company.nil? ? t('lines.index.unset') : @line.company.name),
+ @line.human_attribute_name(:network_id) => (@line.network.nil? ? t('lines.index.unset') : @line.network.name),
+ @line.human_attribute_name(:company_id) => (@line.company.nil? ? t('lines.index.unset') : @line.company.name),
'Transporteur(s) secondaire(s)' => (@line.secondary_companies.nil? ? t('lines.index.unset') : @line.secondary_companies.collect(&:name).join(', ')),
'Nom court' => @line.number,
'Code public' => (@line.registration_number ? @line.registration_number : '-'),
diff --git a/app/views/networks/_form.html.slim b/app/views/networks/_form.html.slim
index 7b048edc9..362584f97 100644
--- a/app/views/networks/_form.html.slim
+++ b/app/views/networks/_form.html.slim
@@ -1,15 +1,14 @@
-= semantic_form_for [@line_referential, @network] do |form|
- = form.inputs do
- = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.network.name")}
- = form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.network.registration_number")}
- = form.input :comment
- = form.input :version_date, as: :date_picker
- = form.input :description
- = form.input :source_name
- = form.input :source_type_name, as: :select, :collection => source_type_name_label_pairs, :include_blank => true
- = form.input :source_identifier
- = form.input :objectid, :required => !@network.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.network.objectid")}
+= simple_form_for [@line_referential, @network], html: {class: 'form-horizontal', id: 'network_form'}, wrapper: :horizontal_form do |f|
+ .row
+ .col-lg-12
+ = f.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.network.name")}
+ = f.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.network.registration_number")}
+ = f.input :comment
+ = f.input :version_date, :label_html => { :class => 'string optional col-sm-4 col-xs-5 control-label' }, :wrapper => :multi_select_inline
+ = f.input :description
+ = f.input :source_name
+ = f.input :source_type_name, as: :select, :collection => Chouette::Network.source_type_name.options, :include_blank => true
+ = f.input :source_identifier
+ .separator
- = form.actions do
- = form.action :submit, as: :button
- = form.action :cancel, as: :link
+ = f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'network_form'
diff --git a/app/views/networks/edit.html.slim b/app/views/networks/edit.html.slim
index 2d511e15d..64513d250 100644
--- a/app/views/networks/edit.html.slim
+++ b/app/views/networks/edit.html.slim
@@ -1,4 +1,7 @@
- breadcrumb :network, @network
-= title_tag t('networks.edit.title', network: @network.name)
-
-= render 'form'
+- page_header_content_for @network
+.page_content
+ .container-fluid
+ .row
+ .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
+ = render 'form' \ No newline at end of file
diff --git a/app/views/networks/index.html.slim b/app/views/networks/index.html.slim
index 6004f5859..b13c73e9e 100644
--- a/app/views/networks/index.html.slim
+++ b/app/views/networks/index.html.slim
@@ -1,12 +1,8 @@
- breadcrumb :networks, @line_referential
-/ PageHeader
-= pageheader 'reseau',
- t('networks.index.title'),
- 'Lorem ipsum dolor sit amet',
- '',
- (policy(Chouette::Network).create? ? link_to(t('networks.actions.new'), new_line_referential_network_path(@line_referential), class: 'btn btn-primary') : '')
+- 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')
-/ PageContent
.page_content
.container-fluid
- if params[:q].present? or @networks.any?
@@ -27,7 +23,7 @@
[ \
TableBuilderHelper::Column.new( \
name: 'Oid', \
- attribute: Proc.new { |n| n.get_objectid.try(:short_id) }, \
+ attribute: Proc.new { |n| n.try(:get_objectid).try(:short_id) }, \
sortable: false \
),
TableBuilderHelper::Column.new( \
diff --git a/app/views/networks/new.html.slim b/app/views/networks/new.html.slim
index cf04ab03f..590d2b409 100644
--- a/app/views/networks/new.html.slim
+++ b/app/views/networks/new.html.slim
@@ -1,4 +1,6 @@
- breadcrumb :networks, @line_referential
-= title_tag t('networks.new.title')
-
-= render 'form'
+.page_content
+ .container-fluid
+ .row
+ .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
+ = render 'form' \ No newline at end of file
diff --git a/app/views/networks/show.html.slim b/app/views/networks/show.html.slim
index 89aa1e50a..f7d40a049 100644
--- a/app/views/networks/show.html.slim
+++ b/app/views/networks/show.html.slim
@@ -1,11 +1,6 @@
- breadcrumb :network, @network
-/ PageHeader
-= pageheader 'reseau',
- @network.name,
- '',
- t('last_update', time: l(@network.updated_at, format: :short)) do
-
- / Below is secundary actions & optional contents (filters, ...)
+- 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|
@@ -14,8 +9,6 @@
data: link.data,
class: 'btn btn-primary' do
= link.content
-
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/referential_companies/edit.html.slim b/app/views/referential_companies/edit.html.slim
index d191d2a37..b3fcf6cd8 100644
--- a/app/views/referential_companies/edit.html.slim
+++ b/app/views/referential_companies/edit.html.slim
@@ -1,4 +1,3 @@
- breadcrumb :referential_company, @referential, @company
-
-= title_tag t('companies.edit.title', company: @company.name)
+- page_header_content_for @company
= render 'form'
diff --git a/app/views/referential_companies/index.html.slim b/app/views/referential_companies/index.html.slim
index 3348dc722..de0f7de69 100644
--- a/app/views/referential_companies/index.html.slim
+++ b/app/views/referential_companies/index.html.slim
@@ -1,12 +1,8 @@
- breadcrumb :referential_companies, @referential
-/ PageHeader
-= pageheader 'transporteur',
- t('companies.index.title'),
- '',
- '',
- (policy(Chouette::Company).create? ? link_to(t('companies.actions.new'), new_referential_company_path(@referential), class: 'btn btn-default') : '')
+- 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')
-/ PageContent
.page_content
.container-fluid
- if params[:q].present? or @companies.any?
diff --git a/app/views/referential_companies/new.html.slim b/app/views/referential_companies/new.html.slim
index 1c7fc7297..5e59db139 100644
--- a/app/views/referential_companies/new.html.slim
+++ b/app/views/referential_companies/new.html.slim
@@ -1,3 +1,2 @@
- breadcrumb :referential_companies, @referential
-= title_tag t('companies.new.title')
= render 'form'
diff --git a/app/views/referential_companies/show.html.slim b/app/views/referential_companies/show.html.slim
index 0dbc3cdd0..1599145be 100644
--- a/app/views/referential_companies/show.html.slim
+++ b/app/views/referential_companies/show.html.slim
@@ -1,11 +1,5 @@
- breadcrumb :referential_company, @referential, @company
-/ PageHeader
-= pageheader 'transporteur',
- @company.name,
- 'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@company.updated_at, format: :short)) do
-
- / Below is secundary actions & optional contents (filters, ...)
+- content_for :page_header_content do
.row
.col-lg-12.text-right.mb-sm
- if policy(Chouette::Company).create?
@@ -17,7 +11,8 @@
span.fa.fa-trash
span = t('companies.actions.destroy')
-/ PageContent
+- page_header_content_for @company
+
.page_content
.container-fluid
.row
diff --git a/app/views/referential_lines/edit.html.slim b/app/views/referential_lines/edit.html.slim
index 8c51715ba..45f26a05c 100644
--- a/app/views/referential_lines/edit.html.slim
+++ b/app/views/referential_lines/edit.html.slim
@@ -1,4 +1,3 @@
-- breadcrumb :referential_line, @line, @referential
-= title_tag t('lines.edit.title', line: @line.name)
-
+- breadcrumb :referential_line, @referential, @line
+- page_header_content_for @line
= render 'form'
diff --git a/app/views/referential_lines/new.html.slim b/app/views/referential_lines/new.html.slim
index 56da24d7c..bcc583279 100644
--- a/app/views/referential_lines/new.html.slim
+++ b/app/views/referential_lines/new.html.slim
@@ -1,3 +1 @@
-= title_tag t('lines.new.title')
-
-= render 'form' \ No newline at end of file
+= render 'form'
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index 7607c391b..cfba8cab3 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -1,11 +1,5 @@
- breadcrumb :referential_line, @referential, @line
-/ PageHeader
-= pageheader 'ligne',
- t('lines.index.line', line: @line.name),
- '',
- t('last_update', time: l(@line.updated_at, format: :short)) do
-
- / Below is secundary actions & optional contents
+- content_for :page_header_content do
.row
.col-lg-12.text-right.mb-sm
- @line.action_links.each do |link|
@@ -14,8 +8,8 @@
data: link.data,
class: 'btn btn-primary' do
= link.content
+- page_header_content_for @line
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/referential_networks/edit.html.slim b/app/views/referential_networks/edit.html.slim
index dded4b176..a77d2db34 100644
--- a/app/views/referential_networks/edit.html.slim
+++ b/app/views/referential_networks/edit.html.slim
@@ -1,4 +1,3 @@
- breadcrumb :referential_network, @referential, @network
-= title_tag t('networks.edit.title', network: @network.name)
-
+- page_header_content_for @network
= render 'form'
diff --git a/app/views/referential_networks/index.html.slim b/app/views/referential_networks/index.html.slim
index 6a2df6d16..d556e7e5e 100644
--- a/app/views/referential_networks/index.html.slim
+++ b/app/views/referential_networks/index.html.slim
@@ -1,12 +1,8 @@
- breadcrumb :referential_networks, @referential
-/ PageHeader
-= pageheader 'reseau',
- t('networks.index.title'),
- 'Lorem ipsum dolor sit amet',
- '',
- (policy(Chouette::Network).create? ? link_to(t('networks.actions.new'), new_referential_network_path(@referential), class: 'btn btn-default') : '')
+- 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')
-/PageContent
.page_content
.container-fluid
- if params[:q].present? or @networks.any?
diff --git a/app/views/referential_networks/new.html.slim b/app/views/referential_networks/new.html.slim
index 4a737d9f7..9c2020eb3 100644
--- a/app/views/referential_networks/new.html.slim
+++ b/app/views/referential_networks/new.html.slim
@@ -1,5 +1,2 @@
- breadcrumb :referential_networks, @referential
-
-= title_tag t('networks.new.title')
-
= render 'form'
diff --git a/app/views/referential_networks/show.html.slim b/app/views/referential_networks/show.html.slim
index c2cc79e0d..7de304671 100644
--- a/app/views/referential_networks/show.html.slim
+++ b/app/views/referential_networks/show.html.slim
@@ -1,11 +1,6 @@
- breadcrumb :referential_network, @referential, @network
-/ PageHeader
-= pageheader 'reseau',
- @network.name,
- 'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@network.updated_at, format: :short)) do
-
- / Below is secundary actions & optional contents (filters, ...)
+- 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|
diff --git a/app/views/referential_stop_areas/edit.html.slim b/app/views/referential_stop_areas/edit.html.slim
index fc7220095..d88230b58 100644
--- a/app/views/referential_stop_areas/edit.html.slim
+++ b/app/views/referential_stop_areas/edit.html.slim
@@ -1,4 +1,3 @@
- breadcrumb :referential_stop_area, @referential, @stop_area
-= title_tag t('stop_areas.edit.title', stop_area: @stop_area.name)
-
+- page_header_content_for @stop_area
= render 'form'
diff --git a/app/views/referential_stop_areas/index.html.slim b/app/views/referential_stop_areas/index.html.slim
index 718cbb472..ad04fb02e 100644
--- a/app/views/referential_stop_areas/index.html.slim
+++ b/app/views/referential_stop_areas/index.html.slim
@@ -1,5 +1,4 @@
- breadcrumb :referential_stop_areas, @referential
-= title_tag t('stop_areas.index.title')
= search_form_for @q, :url => referential_stop_areas_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f|
.panel.panel-default
diff --git a/app/views/referential_stop_areas/new.html.slim b/app/views/referential_stop_areas/new.html.slim
index 87ba9b657..9342b673b 100644
--- a/app/views/referential_stop_areas/new.html.slim
+++ b/app/views/referential_stop_areas/new.html.slim
@@ -1,4 +1,2 @@
- breadcrumb :referential_stop_areas, @referential
-= title_tag t('stop_areas.new.title')
-
= render 'form'
diff --git a/app/views/referential_stop_areas/show.html.slim b/app/views/referential_stop_areas/show.html.slim
index 7cc078ee0..0470b4654 100644
--- a/app/views/referential_stop_areas/show.html.slim
+++ b/app/views/referential_stop_areas/show.html.slim
@@ -1,9 +1,6 @@
- breadcrumb :referential_stop_area, @referential, @stop_area
-/ PageHeader
-= pageheader 'arret',
- @stop_area.name,
- 'Lorem ipsum dolor sit amet'
-
+- 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|
@@ -13,7 +10,6 @@
class: 'btn btn-primary' do
= link.content
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/referentials/edit.html.slim b/app/views/referentials/edit.html.slim
index 1fac626e6..904dc5439 100644
--- a/app/views/referentials/edit.html.slim
+++ b/app/views/referentials/edit.html.slim
@@ -1,10 +1,6 @@
-/ PageHeader
-= pageheader 'jeux-de-donnees',
- t('.title'),
- '',
- t('last_update', time: l(@referential.updated_at, format: :short))
+- breadcrumb @referential
+- page_header_content_for @referential
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/referentials/new.html.slim b/app/views/referentials/new.html.slim
index f4a7e4707..2bed9f912 100644
--- a/app/views/referentials/new.html.slim
+++ b/app/views/referentials/new.html.slim
@@ -1,12 +1,3 @@
-/ PageHeader
-- if @referential.created_from.present?
- = pageheader 'jeux-de-donnees',
- t('.duplicated.title')
-- else
- = pageheader 'jeux-de-donnees',
- t('.title')
-
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/referentials/select_compliance_control_set.html.slim b/app/views/referentials/select_compliance_control_set.html.slim
index 2d3f2344c..87a888c0a 100644
--- a/app/views/referentials/select_compliance_control_set.html.slim
+++ b/app/views/referentials/select_compliance_control_set.html.slim
@@ -1,10 +1,3 @@
-/ PageHeader
-- header_params = ['jeux-de-controle',
- t('referentials.select_compliance_control_set.title'),
- '']
-= pageheader(*header_params) do
-
-/ PageContent
.page_content
.container-fluid
.row
@@ -17,4 +10,4 @@
.col-sm-8.col-xs-7
= select_tag :compliance_control_set, options_from_collection_for_select(@compliance_control_sets, "id", "name"), class: 'select optional form-control'
.separator
- = button_tag t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'select_compliance_control_set' \ No newline at end of file
+ = button_tag t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'select_compliance_control_set'
diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim
index 0abeb0669..9852fb0a3 100644
--- a/app/views/referentials/show.html.slim
+++ b/app/views/referentials/show.html.slim
@@ -1,12 +1,10 @@
- breadcrumb @referential
-/ PageHeader
-= pageheader 'jeux-de-donnees',
- @referential.name,
- 'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@referential.updated_at, format: :short)),
- ((@referential.archived? || !policy(@referential).edit?) ? '' : link_to(t('actions.edit'), edit_referential_path(@referential), class: 'btn btn-default')) do
+- page_header_content_for @referential
+- content_for :page_header_actions do
+ - unless (@referential.archived? || !policy(@referential).edit?)
+ = link_to(t('actions.edit'), edit_referential_path(@referential), class: 'btn btn-default')
- / Below is secondary actions & optional contents (filters, ...)
+- content_for :page_header_content do
.row.mb-sm
.col-lg-12.text-right
- @referential.action_links.each do |link|
@@ -19,7 +17,6 @@
class: 'btn btn-primary' do
= link.content
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/routes/edit.html.slim b/app/views/routes/edit.html.slim
index a69c5aeff..78f9a2e85 100644
--- a/app/views/routes/edit.html.slim
+++ b/app/views/routes/edit.html.slim
@@ -1,11 +1,6 @@
- breadcrumb :route, @referential, @route
-/ PageHeader
-= pageheader 'itineraire',
- @route.name,
- 'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@route.updated_at, format: :short))
+- page_header_content_for @route
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/routes/new.html.slim b/app/views/routes/new.html.slim
index 3a8ceb963..9d5ca2e23 100644
--- a/app/views/routes/new.html.slim
+++ b/app/views/routes/new.html.slim
@@ -1,10 +1,4 @@
- breadcrumb :referential_line, @referential, @line
-/ PageHeader
-= pageheader 'itineraire',
- t('routes.new.title'),
- ''
-
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index 734d6ebf3..3adf3e2f6 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -1,12 +1,10 @@
- breadcrumb :route, @referential, @route
-/ PageHeader
-= pageheader 'itineraire',
- t('routes.index.title', route: @route.name),
- '',
- t('last_update', time: l(@route.updated_at, format: :short)),
- (policy(@route).edit? ? link_to(t('actions.edit'), edit_referential_line_route_path(@referential, @line, @route), class: 'btn btn-default') : '') do
+- 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')
- / Below is secundary actions & optional contents (filters, ...)
+- content_for :page_header_content do
.row.mb-sm
.col-lg-12.text-right
- @route.action_links.each do |link|
@@ -16,7 +14,6 @@
class: 'btn btn-primary' do
= link.content
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/routing_constraint_zones/edit.html.slim b/app/views/routing_constraint_zones/edit.html.slim
index c9b9b0c41..e971ee5dd 100644
--- a/app/views/routing_constraint_zones/edit.html.slim
+++ b/app/views/routing_constraint_zones/edit.html.slim
@@ -1,11 +1,6 @@
- breadcrumb :routing_constraint_zone, @referential, @line, @routing_constraint_zone
-/ PageHeader
-= pageheader 'itl',
- t('.title', routing_constraint_zone: @routing_constraint_zone.name),
- '',
- t('last_update', time: l(@routing_constraint_zone.updated_at, format: :short))
+- page_header_content_for @routing_constraint_zone
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/routing_constraint_zones/index.html.slim b/app/views/routing_constraint_zones/index.html.slim
index fcf904070..7c54fca68 100644
--- a/app/views/routing_constraint_zones/index.html.slim
+++ b/app/views/routing_constraint_zones/index.html.slim
@@ -1,12 +1,8 @@
- breadcrumb :routing_constraint_zones, @referential, @line
-/ PageHeader
-= pageheader 'itl',
- t('routing_constraint_zones.index.title'),
- '',
- '',
- ((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') : '')
+- 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')
-/ PageContent
.page_content
.container-fluid
- if params[:q].present? or @routing_constraint_zones.any?
diff --git a/app/views/routing_constraint_zones/new.html.slim b/app/views/routing_constraint_zones/new.html.slim
index d15de13a4..62ecf5e95 100644
--- a/app/views/routing_constraint_zones/new.html.slim
+++ b/app/views/routing_constraint_zones/new.html.slim
@@ -1,9 +1,5 @@
- breadcrumb :routing_constraint_zones, @referential, @line
-/ PageHeader
-= pageheader 'itl',
- t('.title')
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/routing_constraint_zones/show.html.slim b/app/views/routing_constraint_zones/show.html.slim
index d0c0619c3..6235ade68 100644
--- a/app/views/routing_constraint_zones/show.html.slim
+++ b/app/views/routing_constraint_zones/show.html.slim
@@ -1,11 +1,6 @@
- breadcrumb :routing_constraint_zone, @referential, @line, @routing_constraint_zone
-/ PageHeader
-= pageheader 'itl',
- @routing_constraint_zone.name,
- '',
- t('last_update', time: l(@routing_constraint_zone.updated_at, format: :short)) do
-
- / Below is secundary actions & optional contents
+- 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|
@@ -15,7 +10,6 @@
class: 'btn btn-primary' do
= link.content
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim
index 896ce756e..d43333fd9 100644
--- a/app/views/stop_area_referentials/show.html.slim
+++ b/app/views/stop_area_referentials/show.html.slim
@@ -1,18 +1,15 @@
- breadcrumb :stop_area_referential, @stop_area_referential
-/ PageHeader
-= pageheader 'synchro-icar',
- t('.title'),
- 'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@stop_area_referential.updated_at, format: :short)),
- link_to(t('actions.sync'), sync_stop_area_referential_path(@stop_area_referential), method: :post, class: 'btn btn-default') do
+- content_for :page_header_actions do
+ = link_to(t('actions.sync'), sync_stop_area_referential_path(@stop_area_referential), method: :post, class: 'btn btn-default')
+- content_for :page_header_content do
.row.mb-md
.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})"
+- page_header_content_for @stop_area_referential
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/stop_areas/_form.html.slim b/app/views/stop_areas/_form.html.slim
index 546143393..20c7c0468 100644
--- a/app/views/stop_areas/_form.html.slim
+++ b/app/views/stop_areas/_form.html.slim
@@ -1,153 +1,45 @@
-= semantic_form_for [@stop_area_referential, @stop_area] do |form|
+= simple_form_for [@stop_area_referential, @stop_area], html: {class: 'form-horizontal', id: 'stop_area_form'}, wrapper: :horizontal_form do |f|
.row
- .container-fluid
- - if !manage_itl && @map
- = @map.to_html
-
- = 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
+ .col-lg-12
+ /- if !manage_itl && @map
+ - if !manage_itl
+ /= @map.to_html
+ = f.input :id, as: :hidden
+ = f.input :name, :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")}
+ = f.input :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")
- #prefetch
label = t('.geolocalize')
input.typeahead.form-control.input-lg maxlength="255" type="text" placeholder="#{t('.address')}"
- unless @stop_area.projection.blank? or @stop_area.projection_type_label.empty?
- = form.input :projection_xy, :label => t("activerecord.attributes.stop_area.projection_xy", :projection => @referential.projection_type_label), :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.projection_xy")}
-
- = form.input :coordinates, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.coordinates")}
- = form.input :street_name
- = form.input :country_code, required: format_restriction_for_locales(@referential) == '.hub'
- = form.input :zip_code, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.zip_code")}
- = form.input :city_name, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.city_name")}
-
- .stop_areas.stop_area.general_info
- h3 = t("stop_areas.stop_area.general")
-
- = form.inputs do
- = form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.objectid")}
- = form.input :registration_number, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.registration_number")}
- = form.input :fare_code, as: :number
- = form.input :nearest_topic_name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.nearest_topic_name")}
- = form.input :comment, as: :text, :input_html => { :rows => 5, :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.comment") }
- = form.input :time_zone, :include_blank => true
- = form.input :url
-
- .pmr_info
- h3 = t("stop_areas.stop_area.accessibility")
- = form.inputs do
- - if !manage_itl
- = form.input :mobility_restricted_suitability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true
- = form.input :stairs_availability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true
- = form.input :lift_availability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true
-
- = form.actions do
- = form.action :submit, as: :button
- = form.action :cancel, as: :link
-
-javascript:
- $(document).ready(function() {
- var address_display = function( address ) {
- var name = "";
- if ( address.house_number) {
- name += address.house_number+" ";
- }
- name += address.road+", ";
- if ( address.suburb) {
- name += address.suburb+", ";
- }
- if ( address.postcode) {
- name += address.postcode+" ";
- }
- if ( address.city) {
- name += address.city;
- } else if ( address.village) {
- name += address.village;
- } else if ( address.town) {
- name += address.town;
- } else if ( address.county ) {
- name += address.county;
- } else if ( address.country ) {
- name += address.country;
- }
-
-
- return name;
- };
- var filtering = function(list) {
- // update map view
- removeAddress();
-
- var selection = $.grep( list, function(item) {
- return (item.type == "house" || item.type == "residential" ||
- item.type == "tertiary" || item.type == "primary" ||
- item.type == "secondary") && item.address.road ;
- });
- return $.map( selection, function( d) {
- var city = "";
- if ( d.address.city) {
- city = d.address.city;
- } else if ( d.address.town) {
- city = d.address.town;
- } else if ( d.address.village) {
- city = d.address.village;
- }
- return { postcode: d.address.postcode,
- road: d.address.road,
- lon: d.lon, lat: d.lat,
- suburb: d.address.suburb,
- city: city,
- postcode: d.address.postcode,
- the_key: address_display( d.address)};
- });
- };
-
- var addressesEngine = new Bloodhound({
- datumTokenizer: function(d) {
- return Bloodhound.tokenizers.whitespace(d.id+" : "+d.road);
- },
- queryTokenizer: function(d) {
- return Bloodhound.tokenizers.whitespace(d.id+" :: "+d.road);
- },
- limit: 10,
- remote: {
- url: 'http://nominatim.openstreetmap.org/search?q=%QUERY&format=json&addressdetails=1&bounded=1&viewbox='+
- // FIXME #821
- //= @stop_area_referential.viewbox_left_top_right_bottom
- filter: filtering,
- }
- });
-
- // kicks off the loading/processing of `local` and `prefetch`
- var promise = addressesEngine.initialize();
-
- // passing in `null` for the `options` arguments will result in the default
- // options being used
- $('#prefetch .typeahead').typeahead(
- {
- hint: true,
- highlight: true,
- minLength: 1
- },
- {
- name: 'addresses',
- displayKey: 'the_key',
- source: addressesEngine.ttAdapter(),
- }
- );
-
- $('.typeahead').on('typeahead:selected', function($e, datum) {
- // update map view
- addAddress( datum.lon, datum.lat, datum.road);
- // update form fields
- <% if @stop_area.new_record? %>
- $('input[name="stop_area[street_name]"]').val(datum.road);
- $('input[name="stop_area[zip_code]"]').val(datum.postcode);
- $('input[name="stop_area[city_name]"]').val(datum.city);
- <% end %>
- })
- });
+ = f.input :projection_xy, :label => t("activerecord.attributes.stop_area.projection_xy", :projection => @referential.projection_type_label), :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.projection_xy")}
+
+ = f.input :coordinates, :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.coordinates")}, required: true
+ = f.input :street_name
+ /= f.input :country_code, required: format_restriction_for_locales(@referential) == '.hub'
+ = f.input :zip_code, :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.zip_code")}
+ = f.input :city_name, required: format_restriction_for_locales(@referential) == '.hub', :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.city_name")}
+
+ .stop_areas.stop_area.general_info
+ h3 = t("stop_areas.stop_area.general")
+
+ = f.input :registration_number, required: format_restriction_for_locales(@referential) == '.hub', :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.registration_number")}
+ = f.input :fare_code
+ = f.input :nearest_topic_name, :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.nearest_topic_name")}
+ = f.input :comment, as: :text, :input_html => {:rows => 5, :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.comment")}
+ = f.input :time_zone, :include_blank => true
+ = f.input :url
+
+ .pmr_info
+ h3 = t("stop_areas.stop_area.accessibility")
+ - if !manage_itl
+ = f.input :mobility_restricted_suitability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true
+ = f.input :stairs_availability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true
+ = f.input :lift_availability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true
+
+ .separator
+
+ = f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'stop_area_form'
diff --git a/app/views/stop_areas/edit.html.slim b/app/views/stop_areas/edit.html.slim
index 8005f5a08..4f2b3f4de 100644
--- a/app/views/stop_areas/edit.html.slim
+++ b/app/views/stop_areas/edit.html.slim
@@ -1,4 +1,8 @@
- breadcrumb :stop_area, @stop_area_referential, @stop_area
-= title_tag t('stop_areas.edit.title', stop_area: @stop_area.name )
+- page_header_content_for @stop_area
-== render 'form'
+.page_content
+ .container-fluid
+ .row
+ .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
+ = render 'form'
diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim
index 1b28f411e..c4d880081 100644
--- a/app/views/stop_areas/index.html.slim
+++ b/app/views/stop_areas/index.html.slim
@@ -1,18 +1,14 @@
- breadcrumb :stop_areas, @stop_area_referential
-/ PageHeader
-= pageheader 'arret',
- t('stop_areas.index.title'),
- '',
- '',
- (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') : '')
+- 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')
-/ PageContent
.page_content
.container-fluid
- if params[:q].present? or @stop_areas.any?
.row
.col-lg-12
- = render 'filters'
+ = render 'filters'
- if @stop_areas.any?
.row
diff --git a/app/views/stop_areas/new.html.slim b/app/views/stop_areas/new.html.slim
index e0c5b7a61..69d78c533 100644
--- a/app/views/stop_areas/new.html.slim
+++ b/app/views/stop_areas/new.html.slim
@@ -1,4 +1,7 @@
- breadcrumb :stop_areas, @stop_area_referential
-= title_tag t('stop_areas.new.title')
-== render 'form'
+.page_content
+ .container-fluid
+ .row
+ .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
+ = render 'form'
diff --git a/app/views/stop_areas/select_parent.html.slim b/app/views/stop_areas/select_parent.html.slim
index 1289eafef..e387e83b8 100644
--- a/app/views/stop_areas/select_parent.html.slim
+++ b/app/views/stop_areas/select_parent.html.slim
@@ -1,5 +1,3 @@
-= title_tag t('stop_areas.select_parent.title', stop_area: @stop_area.name )
-
= semantic_form_for [@referential, @stop_area] do |form|
div
= form.inputs do
@@ -10,4 +8,4 @@
= form.action :cancel, as: :link
- content_for :sidebar do
- ul.actions \ No newline at end of file
+ ul.actions
diff --git a/app/views/stop_areas/show.html.slim b/app/views/stop_areas/show.html.slim
index 7f7c2e07f..af673bb25 100644
--- a/app/views/stop_areas/show.html.slim
+++ b/app/views/stop_areas/show.html.slim
@@ -1,9 +1,6 @@
- breadcrumb :stop_area, @stop_area_referential, @stop_area
-/ PageHeader
-= pageheader 'arret',
- @stop_area.name,
- 'Lorem ipsum dolor sit amet'
-
+- 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|
diff --git a/app/views/time_table_combinations/new.html.slim b/app/views/time_table_combinations/new.html.slim
index e49a10bc6..7d2551311 100644
--- a/app/views/time_table_combinations/new.html.slim
+++ b/app/views/time_table_combinations/new.html.slim
@@ -1,10 +1,3 @@
-/ PageHeader
-= pageheader 'map-marker',
- t('time_tables.show.combine_form'),
- '',
- ''
-
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/time_tables/edit.html.slim b/app/views/time_tables/edit.html.slim
index a1ebb2c72..e1c566ff4 100644
--- a/app/views/time_tables/edit.html.slim
+++ b/app/views/time_tables/edit.html.slim
@@ -1,11 +1,7 @@
- breadcrumb :time_table, @referential, @time_table
-/ PageHeader
-= pageheader 'calendrier-application',
- @time_table.comment,
- '',
- ''
+- page_header_content_for @time_table
+- content_for :page_header_title, t('time_tables.show.title', name: @time_table.comment), flush: true
-/ PageContent
.page_content
.container-fluid
#periods
diff --git a/app/views/time_tables/index.html.slim b/app/views/time_tables/index.html.slim
index edbf89c43..b684b0bcb 100644
--- a/app/views/time_tables/index.html.slim
+++ b/app/views/time_tables/index.html.slim
@@ -1,11 +1,8 @@
- breadcrumb :time_tables, @referential
-/ PageHeader
-= pageheader 'calendrier-application',
- t('time_tables.index.title'),
- '',
- ((policy(Chouette::TimeTable).create? && @referential.organisation == current_organisation) ? link_to(t('actions.add'), new_referential_time_table_path(@referential), class: 'btn btn-default') : '')
+- 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')
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/time_tables/new.html.slim b/app/views/time_tables/new.html.slim
index c8c2658ba..ddb34e0b7 100644
--- a/app/views/time_tables/new.html.slim
+++ b/app/views/time_tables/new.html.slim
@@ -1,11 +1,4 @@
- breadcrumb :time_tables, @referential
-/ PageHeader
-= pageheader 'calendrier-application',
- t("time_tables.#{params[:action]}.title"),
- '',
- ''
-
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/time_tables/show.html.slim b/app/views/time_tables/show.html.slim
index 85de7f8ec..036581268 100644
--- a/app/views/time_tables/show.html.slim
+++ b/app/views/time_tables/show.html.slim
@@ -1,14 +1,14 @@
- require 'calendar_helper'
- breadcrumb :time_table, @referential, @time_table
-/ PageHeader
+- page_header_content_for @time_table
-= pageheader 'calendrier-application',
- @time_table.comment,
- '',
- t('last_update', time: l(@time_table.updated_at, format: :short)),
- (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_title, t('time_tables.show.title', name: @time_table.comment), flush: true
- / Below is secundary actions & optional contents (filters, ...)
+- 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|
@@ -18,7 +18,7 @@
class: 'btn btn-primary' do
= link.content
-/ PageContent
+
.page_content
.container-fluid
.row
diff --git a/app/views/vehicle_journeys/index.html.slim b/app/views/vehicle_journeys/index.html.slim
index 2046ecca6..52c1a9728 100644
--- a/app/views/vehicle_journeys/index.html.slim
+++ b/app/views/vehicle_journeys/index.html.slim
@@ -1,11 +1,6 @@
- breadcrumb :vehicle_journeys, @referential, @route
-/ PageHeader
-= pageheader 'horaires-des-courses',
- t('vehicle_journeys.index.title', route: @route.name ),
- 'Lorem ipsum dolor sit amet',
- '' do
+- content_for :page_header_title, t('vehicle_journeys.index.title', route: @route.name)
-/ PageContent
.page_content
.container-fluid
.row
diff --git a/app/views/vehicle_journeys/show.html.slim b/app/views/vehicle_journeys/show.html.slim
index 8ff4b188d..c67632864 100644
--- a/app/views/vehicle_journeys/show.html.slim
+++ b/app/views/vehicle_journeys/show.html.slim
@@ -1,2 +1,3 @@
+- page_header_content_for @vehicle_journey
== render 'show_details', vehicle_journey: @vehicle_journey
-== render 'show_sidebar' \ No newline at end of file
+== render 'show_sidebar'
diff --git a/app/views/workbenches/index.html.slim b/app/views/workbenches/index.html.slim
index d35ed8121..14fc79222 100644
--- a/app/views/workbenches/index.html.slim
+++ b/app/views/workbenches/index.html.slim
@@ -1,8 +1,5 @@
-/ PageHeader
-= pageheader 'tableau-de-bord',
- t('.title', organisation: current_organisation.name)
- / Below is secundary actions & optional contents (filters, ...)
+- content_for :page_header_content do
.row.mb-sm
.col-lg-12.text-right
- if policy(Api::V1::ApiKey).create?
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index 66eedb68d..22869b2d7 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -1,17 +1,12 @@
- breadcrumb @workbench
-/ PageHeader
-= pageheader 'jeux-de-donnees',
- t('referentials.index.title'),
- '',
- '' do
- / Below is secundary actions & optional contents (filters, ...)
+- page_header_content_for @workbench
+- content_for :page_header_content do
.row.mb-sm
.col-lg-12.text-right
- if policy(Referential).create?
= link_to t('actions.import'), workbench_imports_path(@workbench), class: 'btn btn-primary'
= link_to t('actions.add'), new_referential_path(workbench_id: @workbench), class: 'btn btn-primary'
-/ PageContent
.page_content
.container-fluid
- if params[:q].present? or @wbench_refs.any?