aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpl2017-03-03 11:59:26 +0100
committerjpl2017-03-03 11:59:26 +0100
commitece023e308b97d9062d2ec6bf242b1e50188e1df (patch)
treefba7c42a0f4c2406b7da7db2c91066824a8119b6
parentb2e981ab9980898686c7a80ac24c7c4f18b8b335 (diff)
downloadchouette-core-ece023e308b97d9062d2ec6bf242b1e50188e1df.tar.bz2
updating tables+metas attributes display
-rw-r--r--app/assets/javascripts/es6_browserified/journey_patterns/components/Navigate.js12
-rw-r--r--app/views/line_footnotes/edit.html.slim2
-rw-r--r--app/views/line_footnotes/show.html.slim2
-rw-r--r--app/views/lines/show.html.slim14
-rw-r--r--app/views/referential_lines/show.html.slim25
-rw-r--r--app/views/referential_stop_areas/show.html.slim9
-rw-r--r--app/views/referentials/show.html.slim4
-rw-r--r--app/views/routes/show.html.slim4
8 files changed, 48 insertions, 24 deletions
diff --git a/app/assets/javascripts/es6_browserified/journey_patterns/components/Navigate.js b/app/assets/javascripts/es6_browserified/journey_patterns/components/Navigate.js
index def7d1471..839d8f72e 100644
--- a/app/assets/javascripts/es6_browserified/journey_patterns/components/Navigate.js
+++ b/app/assets/javascripts/es6_browserified/journey_patterns/components/Navigate.js
@@ -28,20 +28,24 @@ let Navigate = ({ dispatch, journeyPatterns, pagination, status }) => {
e.preventDefault()
dispatch(actions.checkConfirmModal(e, actions.goToPreviousPage(dispatch, pagination), pagination.stateChanged, dispatch))
}}
- type="submit"
+ type='button'
data-toggle=''
data-target='#ConfirmModal'
- className={'previous_page' + (pagination.page == firstPage ? ' disabled' : '')}>
+ className={'previous_page' + (pagination.page == firstPage ? ' disabled' : '')}
+ disabled={'previous_page' + (pagination.page == firstPage ? ' disabled' : '')}
+ >
</button>
<button
onClick={e => {
e.preventDefault()
dispatch(actions.checkConfirmModal(e, actions.goToNextPage(dispatch, pagination), pagination.stateChanged, dispatch))
}}
- type="submit"
+ type='button'
data-toggle=''
data-target='#ConfirmModal'
- className={'next_page' + (pagination.page == lastPage ? ' disabled' : '')}>
+ className={'next_page' + (pagination.page == lastPage ? ' disabled' : '')}
+ disabled={'next_page' + (pagination.page == lastPage ? ' disabled' : '')}
+ >
</button>
</form>
</div>
diff --git a/app/views/line_footnotes/edit.html.slim b/app/views/line_footnotes/edit.html.slim
index 28e41b089..0dda8bf0f 100644
--- a/app/views/line_footnotes/edit.html.slim
+++ b/app/views/line_footnotes/edit.html.slim
@@ -2,7 +2,7 @@
= pageheader 'map-marker',
"Notes sur la ligne #{@line.name}",
'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@line.footnotes.last.updated_at, format: :short))
+ (@line.footnotes.any? ? t('last_update', time: l(@line.footnotes.last.updated_at, format: :short)) : '')
/ PageContent
.page_content
diff --git a/app/views/line_footnotes/show.html.slim b/app/views/line_footnotes/show.html.slim
index e32d97292..36eebe288 100644
--- a/app/views/line_footnotes/show.html.slim
+++ b/app/views/line_footnotes/show.html.slim
@@ -2,7 +2,7 @@
= pageheader 'map-marker',
"Notes sur la ligne #{@line.name}",
'Lorem ipsum dolor sit amet',
- t('last_update', time: l(@line.footnotes.last.updated_at, format: :short)),
+ (@line.footnotes.any? ? t('last_update', time: l(@line.footnotes.last.updated_at, format: :short)) : ''),
(policy(@line).update_footnote? ? link_to(t('actions.edit'), edit_referential_line_footnotes_path(@referential, @line), class: 'btn btn-primary') : '')
/ PageContent
diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim
index 0589b1923..9dbdd2bfe 100644
--- a/app/views/lines/show.html.slim
+++ b/app/views/lines/show.html.slim
@@ -24,13 +24,19 @@
.container-fluid
.row
.col-lg-6.col-md-6.col-sm-12.col-xs-12
+ p = 'toto'
+ ul
+ - @line.secondary_companies.each do |sc|
+ li = sc.inspect
+
= definition_list t('metadatas'),
- { 'Activé' => (@line.deactivated? ? t('false') : t('true')),
+ { 'ID Codif' => @line.objectid.local_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(:number) => @line.number,
- @line.human_attribute_name(:published_name) => @line.published_name,
- @line.human_attribute_name(:registration_number) => @line.registration_number,
+ # 'Transporteur(s) secondaire(s)' => (@line.secondary_companies.nil? ? t('lines.index.unset') : @line.secondary_companies.pluck(:name)),
+ 'Nom court' => @line.number,
+ 'Code public' => (@line.registration_number ? @line.registration_number : '-'),
@line.human_attribute_name(:transport_mode) => (@line.transport_mode ? t("enumerize.line.transport_mode.#{@line.transport_mode}") : '-'),
@line.human_attribute_name(:transport_submode) => (@line.transport_submode ? t("enumerize.line.transport_submode.#{@line.transport_submode}") : '-'),
@line.human_attribute_name(:url) => (@line.url ? @line.url : '-') }
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index 4fd1ff9ca..f57843833 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -31,13 +31,19 @@
.container-fluid
.row
.col-lg-6.col-md-6.col-sm-12.col-xs-12
+ p = 'toto'
+ ul
+ - @line.secondary_companies.each do |sc|
+ li = sc.inspect
+
= definition_list t('metadatas'),
- { 'Activé' => (@line.deactivated? ? t('false') : t('true')),
+ { 'ID Codif' => @line.objectid.local_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(:number) => @line.number,
- @line.human_attribute_name(:published_name) => @line.published_name,
- @line.human_attribute_name(:registration_number) => @line.registration_number,
+ # 'Transporteur(s) secondaire(s)' => (@line.secondary_companies.nil? ? t('lines.index.unset') : @line.secondary_companies.pluck(:name)),
+ 'Nom court' => @line.number,
+ 'Code public' => (@line.registration_number ? @line.registration_number : '-'),
@line.human_attribute_name(:transport_mode) => (@line.transport_mode ? t("enumerize.line.transport_mode.#{@line.transport_mode}") : '-'),
@line.human_attribute_name(:transport_submode) => (@line.transport_submode ? t("enumerize.line.transport_submode.#{@line.transport_submode}") : '-'),
@line.human_attribute_name(:url) => (@line.url ? @line.url : '-') }
@@ -64,10 +70,13 @@
.row
.col-lg-12
= table_builder @routes,
- { @routes.human_attribute_name(:number) => 'number', @routes.human_attribute_name(:name) => 'name',
- 'Arrêt de départ' => Proc.new{|r| r.try(:stop_points).first.try(:stop_area).try(:name)},
- "Arrêt d'arrivée" => Proc.new{|r| r.try(:stop_points).last.try(:stop_area).try(:name)},
- 'Nb arrêts' => Proc.new{|r| r.try(:stop_points).count}, 'Nb missions' => Proc.new{|r| r.try(:journey_patterns).count} },
+ { 'OiD' => Proc.new { |n| n.objectid.local_id },
+ @routes.human_attribute_name(:name) => 'name',
+ @routes.human_attribute_name(:published_name) => 'published_name',
+ @routes.human_attribute_name(:wayback) => 'wayback_text',
+ 'Arrêt de départ' => Proc.new{|r| r.try(:stop_points).first.try(:stop_area).try(:name)},
+ "Arrêt d'arrivée" => Proc.new{|r| r.try(:stop_points).last.try(:stop_area).try(:name)},
+ 'Nb arrêts' => Proc.new{|r| r.try(:stop_points).count}, 'Nb missions' => Proc.new{|r| r.try(:journey_patterns).count} },
[:show, :edit, :delete],
[],
'table has-search'
diff --git a/app/views/referential_stop_areas/show.html.slim b/app/views/referential_stop_areas/show.html.slim
index 9affba08e..7932b6c2e 100644
--- a/app/views/referential_stop_areas/show.html.slim
+++ b/app/views/referential_stop_areas/show.html.slim
@@ -20,10 +20,11 @@
.row
.col-lg-6.col-md-6.col-sm-12.col-xs-12
= definition_list t('metadatas'),
- { @stop_area.human_attribute_name(:stop_area_type) => t("area_types.label.#{@stop_area.stop_area_type}"),
+ { 'ID Reflex' => @stop_area.try(:user_objectid),
+ 'Activé' => (@stop_area.deleted_at ? t('false') : t('true')),
+ @stop_area.human_attribute_name(:comment) => @stop_area.try(:comment),
+ @stop_area.human_attribute_name(:stop_area_type) => t("area_types.label.#{@stop_area.stop_area_type}"),
@stop_area.human_attribute_name(:registration_number) => @stop_area.registration_number,
- 'Code Reflex' => @stop_area.try(:objectid),
'Coordonnées' => geo_data(@stop_area, @stop_area_referential),
@stop_area.human_attribute_name(:zip_code) => @stop_area.zip_code,
- @stop_area.human_attribute_name(:city_name) => @stop_area.city_name,
- 'Etat' => (@stop_area.deleted_at ? 'Supprimé' : 'Actif') }
+ @stop_area.human_attribute_name(:city_name) => @stop_area.city_name }
diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim
index 8f2e7a8fd..fa89b220d 100644
--- a/app/views/referentials/show.html.slim
+++ b/app/views/referentials/show.html.slim
@@ -55,8 +55,10 @@
.col-lg-12
/ ID Codif, nom court, nom de la ligne, réseau, mode, transporteur principal, actions = [show, edit_notes]
= table_builder @reflines,
- { 'ID Codif' => Proc.new { |n| n.objectid.local_id }, @reflines.human_attribute_name(:registration_number) => 'registration_number',
+ { 'ID Codif' => Proc.new { |n| n.objectid.local_id },
+ 'Nom court' => 'number',
@reflines.human_attribute_name(:name) => 'name',
+ 'Activé' => Proc.new{|n| n.deactivated? ? t('false') : t('true')},
@reflines.human_attribute_name(:transport_mode) => 'transport_mode',
@reflines.human_attribute_name(:network) => Proc.new { |n| n.try(:network).try(:name) },
@reflines.human_attribute_name(:company) => Proc.new { |n| n.try(:company).try(:name) } },
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index dca13094a..88b93bb06 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -25,7 +25,8 @@
.row
.col-lg-6.col-md-6.col-sm-12.col-xs-12
= definition_list t('metadatas'),
- { @route.human_attribute_name(:direction) => (@route.direction ? @route.direction_text : '-'),
+ { 'OiD' => @route.try(:objectid).try(:local_id),
+ 'Direction' => (@route.published_name ? @route.published_name : '-'),
@route.human_attribute_name(:wayback) => (@route.wayback ? @route.wayback_text : '-' ),
@route.human_attribute_name(:opposite_route) => (@route.opposite_route ? @route.opposite_route.name : '-') }
@@ -35,6 +36,7 @@
= table_builder @route_sp,
{ 'ID Reflex' => Proc.new {|s| s.try(:stop_area).try(:user_objectid)},
Chouette::StopArea.human_attribute_name(:name) => Proc.new {|s| s.try(:stop_area).try(:name)},
+ 'Activé' => Proc.new{|s| s.try(:stop_area).deleted_at ? t('false') : t('true')},
Chouette::StopArea.human_attribute_name(:zip_code) => Proc.new {|s| s.try(:stop_area).try(:zip_code)},
Chouette::StopArea.human_attribute_name(:city_name) => Proc.new {|s| s.try(:stop_area).try(:city_name)},
Chouette::StopArea.human_attribute_name(:area_type) => Proc.new {|s| t("area_types.label.#{s.try(:stop_area).try(:area_type)}")},