From 070c93312ab8db54d6b5e5babbf5ea433ebd6f33 Mon Sep 17 00:00:00 2001 From: Thomas Haddad Date: Tue, 28 Feb 2017 17:41:00 +0100 Subject: Fix fetch API in jp when no entries Signed-off-by: Thomas Shawarma Haddad Signed-off-by: Jean-Paul Lescouzeres --- app/views/journey_patterns_collections/show.html.slim | 4 ++-- app/views/routes/show.html.slim | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/journey_patterns_collections/show.html.slim b/app/views/journey_patterns_collections/show.html.slim index 28fdaf1ae..bfcc963cc 100644 --- a/app/views/journey_patterns_collections/show.html.slim +++ b/app/views/journey_patterns_collections/show.html.slim @@ -2,7 +2,7 @@ = pageheader 'map-marker', "Missions de #{@route.name}", 'Lorem ipsum dolor sit amet', - t('last_update', time: l(@journey_patterns.last.updated_at, format: :short)) + (@journey_patterns.any? ? t('last_update', time: l(@journey_patterns.last.updated_at, format: :short)) : '') / PageContent .page_content @@ -11,8 +11,8 @@ .col-lg-12 #journey_patterns - = javascript_tag do + | window.stopPoints = #{(@route.stop_points.to_json).html_safe}; | window.journeyPatternLength = #{@journey_patterns.total_entries()}; | window.journeyPatternsPerPage = #{@ppage} = javascript_include_tag 'es6_browserified/journey_patterns/index.js' diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim index 428c82c58..f6243564b 100644 --- a/app/views/routes/show.html.slim +++ b/app/views/routes/show.html.slim @@ -8,8 +8,8 @@ / Below is secundary actions & optional contents (filters, ...) .row.mb-sm .col-lg-12.text-right + = link_to t('journey_patterns.index.title'), [@referential, @line, @route, :journey_patterns_collection], class: 'btn btn-primary' - if @route.journey_patterns.present? - = link_to t('journey_patterns.index.title'), [@referential, @line, @route, :journey_patterns_collection], class: 'btn btn-primary' = link_to t('vehicle_journeys.actions.index'), [@referential, @line, @route, :vehicle_journeys], class: 'btn btn-primary' = link_to t('vehicle_journey_exports.new.title'), referential_line_route_vehicle_journey_exports_path(@referential, @line, @route, format: :zip), class: 'btn btn-primary' -- cgit v1.2.3