diff options
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/api/v1/stop_areas/short_description.rabl | 2 | ||||
| -rw-r--r-- | app/views/lines/_filters.html.slim | 20 | ||||
| -rw-r--r-- | app/views/lines/index.html.slim | 5 | ||||
| -rw-r--r-- | app/views/referentials/show.html.slim | 2 | ||||
| -rw-r--r-- | app/views/stop_areas/_filters.html.slim | 26 | ||||
| -rw-r--r-- | app/views/stop_areas/_form.html.slim | 2 | ||||
| -rw-r--r-- | app/views/stop_areas/index.html.slim | 4 | ||||
| -rw-r--r-- | app/views/stop_areas/show.html.slim | 2 | ||||
| -rw-r--r-- | app/views/vehicle_journeys/index.html.slim | 1 |
9 files changed, 57 insertions, 7 deletions
diff --git a/app/views/api/v1/stop_areas/short_description.rabl b/app/views/api/v1/stop_areas/short_description.rabl index 7d571b0a2..2f27f04d8 100644 --- a/app/views/api/v1/stop_areas/short_description.rabl +++ b/app/views/api/v1/stop_areas/short_description.rabl @@ -1,7 +1,7 @@ object @stop_area extends "api/v1/trident_objects/short_description" -[:id, :name, :city_name, :zip_code, :area_type, :longitude, :latitude, :long_lat_type].each do |attr| +[:id, :name, :city_name, :zip_code, :area_type, :kind, :longitude, :latitude, :long_lat_type].each do |attr| attributes attr, :unless => lambda { |m| m.send( attr).nil?} end node(:parent_object_id) do |stop_area| diff --git a/app/views/lines/_filters.html.slim b/app/views/lines/_filters.html.slim index 67ba297cf..da0539bd0 100644 --- a/app/views/lines/_filters.html.slim +++ b/app/views/lines/_filters.html.slim @@ -23,6 +23,26 @@ = f.label Chouette::Line.human_attribute_name(:transport_submode), required: false, class: 'control-label' = f.input :transport_submode_eq_any, collection: StifTransportSubmodeEnumerations.sorted_transport_submodes, as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + t("enumerize.transport_submode.#{l}") + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'} + .form-group.togglable class=filter_item_class(params[:q], :status) + = f.label Chouette::Line.human_attribute_name(:state), required: false, class: 'control-label' + .form-group.checkbox_list + = f.simple_fields_for :status do |p| + = p.input :activated, + label: ("<span>#{t('activerecord.attributes.line.activated')}<span class='fa fa-check-circle text-success'></span></span>").html_safe, + as: :boolean, + wrapper_html: { class: 'checkbox-wrapper' }, + checked_value: true, + unchecked_value: false, + input_html: { checked: @status.try(:[], :activated) } + = p.input :deactivated, + label: ("<span>#{t('activerecord.attributes.line.deactivated')}<span class='fa fa-exclamation-circle text-danger'></span></span>").html_safe, + as: :boolean, + wrapper_html: { class: 'checkbox-wrapper' }, + checked_value: true, + unchecked_value: false, + input_html: { checked: @status.try(:[], :deactivated) } + + .actions = link_to 'Effacer', @workbench, class: 'btn btn-link' = f.submit 'Filtrer', class: 'btn btn-default' diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim index 2d64e5f73..9d491ace4 100644 --- a/app/views/lines/index.html.slim +++ b/app/views/lines/index.html.slim @@ -29,8 +29,9 @@ end \ ), \ TableBuilderHelper::Column.new( \ - key: :deactivated, \ - attribute: Proc.new { |n| line_status(n.deactivated?) } \ + name: t('activerecord.attributes.line.state'), \ + class: :state, \ + attribute: Proc.new { |n| line_status(n.deactivated) } \ ), \ TableBuilderHelper::Column.new( \ key: 'networks.name', \ diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim index 289e802d7..b2a079ab4 100644 --- a/app/views/referentials/show.html.slim +++ b/app/views/referentials/show.html.slim @@ -40,7 +40,7 @@ end \ ), \ TableBuilderHelper::Column.new( \ - key: :deactivated, \ + key: :state, \ attribute: Proc.new { |n| line_status(n.deactivated?) } \ ), \ TableBuilderHelper::Column.new( \ diff --git a/app/views/stop_areas/_filters.html.slim b/app/views/stop_areas/_filters.html.slim index 00369d3ed..a32638567 100644 --- a/app/views/stop_areas/_filters.html.slim +++ b/app/views/stop_areas/_filters.html.slim @@ -13,6 +13,32 @@ .form-group.togglable class=filter_item_class(params[:q], :area_type_eq_any) = f.label Chouette::StopArea.human_attribute_name(:area_type), required: false, class: 'control-label' = f.input :area_type_eq_any, checked: params[:q] && params[:q][:area_type_eq_any], collection: Chouette::AreaType.options, as: :check_boxes, label: false, label_method: lambda{|w| ("<span>" + w[0] + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' } + + .form-group.togglable class=filter_item_class(params[:q], :status) + = f.label Chouette::StopArea.human_attribute_name(:state), required: false, class: 'control-label' + .form-group.checkbox_list + = f.simple_fields_for :status do |p| + = p.input :in_creation, + label: ("<span>#{t('activerecord.attributes.stop_area.in_creation')}<span class='fa fa-pencil text-info'></span></span>").html_safe, + as: :boolean, + wrapper_html: { class: 'checkbox-wrapper' }, + checked_value: true, + unchecked_value: false, + input_html: { checked: @status.try(:[], :in_creation) } + = p.input :confirmed, + label: ("<span>#{t('activerecord.attributes.stop_area.confirmed')}<span class='fa fa-check-circle text-success'></span></span>").html_safe, + as: :boolean, + wrapper_html: { class: 'checkbox-wrapper' }, + checked_value: true, + unchecked_value: false, + input_html: { checked: @status.try(:[], :confirmed) } + = p.input :deactivated, + label: ("<span>#{t('activerecord.attributes.stop_area.deleted')}<span class='fa fa-exclamation-circle text-danger'></span></span>").html_safe, + as: :boolean, + wrapper_html: { class: 'checkbox-wrapper' }, + checked_value: true, + unchecked_value: false, + input_html: { checked: @status.try(:[], :deactivated) } .actions = link_to 'Effacer', @workbench, class: 'btn btn-link' diff --git a/app/views/stop_areas/_form.html.slim b/app/views/stop_areas/_form.html.slim index c63e95c89..d6682ef70 100644 --- a/app/views/stop_areas/_form.html.slim +++ b/app/views/stop_areas/_form.html.slim @@ -27,6 +27,8 @@ .slave data-master="[name='stop_area[kind]']" data-value=kind = f.input :area_type, as: :select, :input_html => {id: kind, :disabled => !@stop_area.new_record?}, :collection => Chouette::AreaType.options(kind), :include_blank => false, disabled: !@stop_area.new_record? + = f.input :status, as: :select, :collection => stop_area_status_options, :include_blank => false + .location_info h3 = t("stop_areas.stop_area.localisation") diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim index 71c7f995c..587efbdaa 100644 --- a/app/views/stop_areas/index.html.slim +++ b/app/views/stop_areas/index.html.slim @@ -32,8 +32,8 @@ attribute: 'registration_number' \ ), \ TableBuilderHelper::Column.new( \ - key: :deleted_at, \ - attribute: Proc.new { |s| line_status(s.deleted_at) } \ + name: t('activerecord.attributes.stop_area.state'), \ + attribute: Proc.new { |s| stop_area_status(s) } \ ), \ TableBuilderHelper::Column.new( \ key: :zip_code, \ diff --git a/app/views/stop_areas/show.html.slim b/app/views/stop_areas/show.html.slim index 34b872e91..a6147b86d 100644 --- a/app/views/stop_areas/show.html.slim +++ b/app/views/stop_areas/show.html.slim @@ -20,7 +20,7 @@ @stop_area.human_attribute_name(:zip_code) => @stop_area.zip_code, @stop_area.human_attribute_name(:city_name) => @stop_area.city_name, @stop_area.human_attribute_name(:country_code) => @stop_area.country_code.presence || '-', - t('activerecord.attributes.stop_area.state') => (@stop_area.deleted_at ? t('stop_areas.show.state.deactivated') : t('stop_areas.show.state.active')), + t('activerecord.attributes.stop_area.state') => stop_area_status(@stop_area), @stop_area.human_attribute_name(:comment) => @stop_area.try(:comment), }) = definition_list t('metadatas'), attributes diff --git a/app/views/vehicle_journeys/index.html.slim b/app/views/vehicle_journeys/index.html.slim index d53d8b50c..d23c61394 100644 --- a/app/views/vehicle_journeys/index.html.slim +++ b/app/views/vehicle_journeys/index.html.slim @@ -29,6 +29,7 @@ | window.features = #{raw @features}; | window.all_missions = #{(@all_missions.to_json).html_safe}; | window.custom_fields = #{(@custom_fields.to_json).html_safe}; + | window.extra_headers = #{(@extra_headers.to_json).html_safe}; // | window.I18n = #{(I18n.backend.send(:translations).to_json).html_safe}; - if has_feature?(:vehicle_journeys_return_route) |
