diff options
| author | jpl | 2017-06-06 15:59:39 +0200 |
|---|---|---|
| committer | jpl | 2017-06-06 15:59:39 +0200 |
| commit | 280cc337c7d2eb3d5e7457d0399e4f0ee5cdb2aa (patch) | |
| tree | ff76211b493de1c1c8a350447485e69f2d535e9d | |
| parent | 6e6a2158f88e0a4e8973cb8e098e92b444aecf77 (diff) | |
| download | chouette-core-280cc337c7d2eb3d5e7457d0399e4f0ee5cdb2aa.tar.bz2 | |
Refs #3488: updating itl#show
| -rw-r--r-- | app/assets/stylesheets/components/_tables.sass | 60 | ||||
| -rw-r--r-- | app/helpers/newapplication_helper.rb | 2 | ||||
| -rw-r--r-- | app/views/referential_lines/show.html.slim | 8 | ||||
| -rw-r--r-- | app/views/routing_constraint_zones/index.html.slim | 2 | ||||
| -rw-r--r-- | app/views/routing_constraint_zones/show.html.slim | 44 | ||||
| -rw-r--r-- | config/locales/actions.en.yml | 1 | ||||
| -rw-r--r-- | config/locales/actions.fr.yml | 1 | ||||
| -rw-r--r-- | config/locales/routing_constraint_zones.en.yml | 2 | ||||
| -rw-r--r-- | config/locales/routing_constraint_zones.fr.yml | 7 | ||||
| -rw-r--r-- | db/schema.rb | 472 | ||||
| -rw-r--r-- | spec/features/routing_constraint_zones_spec.rb | 4 |
11 files changed, 347 insertions, 256 deletions
diff --git a/app/assets/stylesheets/components/_tables.sass b/app/assets/stylesheets/components/_tables.sass index 0cd91a1a8..e3a33e131 100644 --- a/app/assets/stylesheets/components/_tables.sass +++ b/app/assets/stylesheets/components/_tables.sass @@ -82,6 +82,66 @@ border-top: 2px solid $darkgrey margin-top: 15px + // Specific for tables displaying stop points + &.has-stoppoints + tbody + > tr > td:first-child + position: relative + padding-left: 25px + + &:before + content: '' + display: block + width: 10px + height: 10px + background-color: #fff + border: 2px solid $blue + border-radius: 50% + position: absolute + z-index: 5 + left: 5px + top: 50% + margin-top: -5px + + &:after + content: '' + display: block + width: 4px + margin: 0 3px + background-color: rgba($grey, 0.5) + position: absolute + z-index: 3 + top: 0 + left: 5px + bottom: 0 + + > tr:first-child > td:first-child + &:after + content: '' + top: 50% + + > tr:last-child > td:first-child + &:after + content: '' + bottom: 50% + + > tr:first-child > td:first-child, > tr:last-child > td:first-child + &:before + content: '•' + color: $blue + text-align: center + font-size: 28px + letter-spacing: 0 + text-indent: -0.01em + line-height: 12px + width: 15px + height: 15px + left: 2px + top: 50% + margin-top: -8px + + + // select_toolbox .select_toolbox padding: 10px diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb index f03228d73..3d43e9fc7 100644 --- a/app/helpers/newapplication_helper.rb +++ b/app/helpers/newapplication_helper.rb @@ -16,7 +16,7 @@ module NewapplicationHelper end columns.map do |k, v| - if ["ID Codif", "Oid", "OiD", "ID Reflex", "Arrêt de départ", "Arrêt d'arrivée", "Période de validité englobante", "Période englobante", "Nombre de courses associées", "Journées d'application"].include? k + if ["ID Codif", "Oid", "OiD", "ID Reflex", "Arrêt de départ", "Arrêt d'arrivée", "Période de validité englobante", "Période englobante", "Nombre de courses associées", "Journées d'application", "Arrêts de l'itinéraire", "Arrêts inclus dans l'ITL"].include? k hcont << content_tag(:th, k) else hcont << content_tag(:th, sortable_columns(collection, k)) diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim index 43a70dfb5..db99381d3 100644 --- a/app/views/referential_lines/show.html.slim +++ b/app/views/referential_lines/show.html.slim @@ -1,7 +1,7 @@ / PageHeader = pageheader 'map-marker', @line.name, - 'Lorem ipsum dolor sit amet', + '', t('last_update', time: l(@line.updated_at, format: :short)) do / Below is secundary actions & optional contents @@ -11,13 +11,13 @@ = link_to t('routing_constraint_zones.index.title'), referential_line_routing_constraint_zones_path(@referential, @line), class: 'btn btn-primary' - if policy(Chouette::Line).create? && @referential.organisation == current_organisation - = link_to t('lines.actions.new'), new_referential_line_path(@referential), class: 'btn btn-primary' + = link_to t('actions.new'), new_referential_line_path(@referential), class: 'btn btn-primary' - if policy(@line).update? - = link_to t('lines.actions.edit'), edit_referential_line_path(@referential, @line), class: 'btn btn-primary' + = link_to t('actions.edit'), edit_referential_line_path(@referential, @line), class: 'btn btn-primary' - if policy(@line).destroy? = link_to referential_line_path(@referential, @line), method: :delete, data: {confirm: t('lines.actions.destroy_confirm')}, class: 'btn btn-primary' do span.fa.fa-trash - span = t('lines.actions.destroy') + span = t('actions.destroy') - if !@line.hub_restricted? || (@line.hub_restricted? && @line.routes.size < 2) - if policy(Chouette::Route).create? && @referential.organisation == current_organisation diff --git a/app/views/routing_constraint_zones/index.html.slim b/app/views/routing_constraint_zones/index.html.slim index 83d4b47c3..248efedb4 100644 --- a/app/views/routing_constraint_zones/index.html.slim +++ b/app/views/routing_constraint_zones/index.html.slim @@ -3,7 +3,7 @@ t('routing_constraint_zones.index.title'), '', '', - ((policy(Chouette::RoutingConstraintZone).create? && @referential.organisation == current_organisation) ? link_to(t('routing_constraint_zones.actions.new'), new_referential_line_routing_constraint_zone_path(@referential, @line), class: 'btn btn-primary') : '') + ((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 diff --git a/app/views/routing_constraint_zones/show.html.slim b/app/views/routing_constraint_zones/show.html.slim index 351784ecc..f0c244387 100644 --- a/app/views/routing_constraint_zones/show.html.slim +++ b/app/views/routing_constraint_zones/show.html.slim @@ -1,17 +1,35 @@ -= title_tag @routing_constraint_zone.name +/ PageHeader += pageheader 'map-marker', + @routing_constraint_zone.name, + '', + t('last_update', time: l(@routing_constraint_zone.updated_at, format: :short)) do -p - label => "#{@routing_constraint_zone.human_attribute_name(:name)} : " - = @routing_constraint_zone.name + / Below is secundary actions & optional contents + .row + .col-lg-12.text-right.mb-sm + - if policy(@routing_constraint_zone).update? + = link_to t('actions.edit'), edit_referential_line_routing_constraint_zone_path(@referential, @line, @routing_constraint_zone), class: 'btn btn-primary' -p - label => "#{Chouette::Route.model_name.human.capitalize} : " - = link_to @routing_constraint_zone.route.name, referential_line_route_path(@referential, @line, @routing_constraint_zone.route) + - if policy(@routing_constraint_zone).destroy? + = link_to referential_line_routing_constraint_zone_path(@referential, @line, @routing_constraint_zone), method: :delete, data: {confirm: t('routing_constraint_zones.actions.destroy_confirm')}, class: 'btn btn-primary' do + span.fa.fa-trash + span = t('actions.destroy') -p - label => "#{Chouette::StopPoint.model_name.human.pluralize.capitalize} : " - br - - @routing_constraint_zone.stop_points.each do |stop_point| - = link_to stop_point.name, referential_stop_area_path(@referential, stop_point.stop_area) - br +/ PageContent +.page_content + .container-fluid + .row + .col-lg-6.col-md-6.col-sm-12.col-xs-12 + = definition_list t('metadatas'), + { @routing_constraint_zone.human_attribute_name(:name) => @routing_constraint_zone.try(:name), + @routing_constraint_zone.human_attribute_name(:route) => link_to(@routing_constraint_zone.try(:route_name), [@referential, @line, @routing_constraint_zone.route]), + @routing_constraint_zone.human_attribute_name(:line) => link_to(@line.name, [@referential, @line])} + .row + .col-lg-12 + = table_builder @routing_constraint_zone.route.stop_points, + { "Arrêts de l'itinéraire" => 'name', + "Arrêts inclus dans l'ITL" => Proc.new{ |rsp| (@routing_constraint_zone.stop_points.collect{|c| c.name}.include? rsp.name) ? 'Oui' : 'Non' } }, + [], + [], + 'table has-stoppoints' diff --git a/config/locales/actions.en.yml b/config/locales/actions.en.yml index 6e2dd3aa2..fe4d3d4e5 100644 --- a/config/locales/actions.en.yml +++ b/config/locales/actions.en.yml @@ -5,6 +5,7 @@ en: delete: "Delete" search: "Search" add: "Add new" + new: "Add new" show: "See" archive: "Archive" unarchive: "Unarchive" diff --git a/config/locales/actions.fr.yml b/config/locales/actions.fr.yml index 8f2fc90f8..ae0537ebb 100644 --- a/config/locales/actions.fr.yml +++ b/config/locales/actions.fr.yml @@ -6,6 +6,7 @@ fr: search: "Chercher" submit: "Valider" add: 'Ajouter' + new: 'Ajouter' show: 'Consulter' archive: 'Conserver' unarchive: 'Déconserver' diff --git a/config/locales/routing_constraint_zones.en.yml b/config/locales/routing_constraint_zones.en.yml index e72e79148..8e9dbfb02 100644 --- a/config/locales/routing_constraint_zones.en.yml +++ b/config/locales/routing_constraint_zones.en.yml @@ -11,7 +11,7 @@ en: updated_at: Updated at objectid: Object ID stop_points_count: Number of stop points - route: Route + route: Associated route errors: models: routing_constraint_zone: diff --git a/config/locales/routing_constraint_zones.fr.yml b/config/locales/routing_constraint_zones.fr.yml index c793fe678..3e207fac0 100644 --- a/config/locales/routing_constraint_zones.fr.yml +++ b/config/locales/routing_constraint_zones.fr.yml @@ -6,12 +6,12 @@ fr: routing_constraint_zone: name: Nom stop_areas: Arrêts - line: Ligne + line: Ligne associée created_at: "Créé le" updated_at: "Edité le" objectid: Object ID stop_points_count: Nombre d'arrêts - route: Itinéraire + route: Itinéraire associé errors: models: routing_constraint_zone: @@ -23,9 +23,6 @@ fr: routing_constraint_zones: search_no_results: "Aucune ITL ne correspond à votre recherche" actions: - new: Ajouter un ITL - edit: Editer cette zone de contrainte - destroy: Supprimer cette zone de contrainte destroy_confirm: Etes vous sûr de supprimer cette zone de contrainte ? new: title: Ajouter un ITL diff --git a/db/schema.rb b/db/schema.rb index 9108ed169..251790a88 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -21,12 +21,12 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "access_links", id: :bigserial, force: :cascade do |t| t.integer "access_point_id", limit: 8 t.integer "stop_area_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.string "comment" - t.decimal "link_distance", precision: 19, scale: 2 + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "comment", limit: 255 + t.decimal "link_distance", precision: 19, scale: 2 t.boolean "lift_availability" t.boolean "mobility_restricted_suitability" t.boolean "stairs_availability" @@ -34,9 +34,9 @@ ActiveRecord::Schema.define(version: 20170605135126) do t.time "frequent_traveller_duration" t.time "occasional_traveller_duration" t.time "mobility_restricted_traveller_duration" - t.string "link_type" + t.string "link_type", limit: 255 t.integer "int_user_needs" - t.string "link_orientation" + t.string "link_orientation", limit: 255 t.datetime "created_at" t.datetime "updated_at" end @@ -44,26 +44,26 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "access_links", ["objectid"], name: "access_links_objectid_key", unique: true, using: :btree create_table "access_points", id: :bigserial, force: :cascade do |t| - t.string "objectid" + t.string "objectid", limit: 255 t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.string "comment" - t.decimal "longitude", precision: 19, scale: 16 - t.decimal "latitude", precision: 19, scale: 16 - t.string "long_lat_type" - t.string "country_code" - t.string "street_name" - t.string "contained_in" + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "comment", limit: 255 + t.decimal "longitude", precision: 19, scale: 16 + t.decimal "latitude", precision: 19, scale: 16 + t.string "long_lat_type", limit: 255 + t.string "country_code", limit: 255 + t.string "street_name", limit: 255 + t.string "contained_in", limit: 255 t.time "openning_time" t.time "closing_time" - t.string "access_type" + t.string "access_type", limit: 255 t.boolean "lift_availability" t.boolean "mobility_restricted_suitability" t.boolean "stairs_availability" t.integer "stop_area_id", limit: 8 - t.string "zip_code" - t.string "city_name" + t.string "zip_code", limit: 255 + t.string "city_name", limit: 255 t.text "import_xml" t.datetime "created_at" t.datetime "updated_at" @@ -73,18 +73,18 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "api_keys", id: :bigserial, force: :cascade do |t| t.integer "referential_id", limit: 8 - t.string "token" - t.string "name" + t.string "token", limit: 255 + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" end create_table "calendars", id: :bigserial, force: :cascade do |t| - t.string "name" - t.string "short_name" - t.daterange "date_ranges", array: true - t.date "dates", array: true - t.boolean "shared", default: false + t.string "name", limit: 255 + t.string "short_name", limit: 255 + t.daterange "date_ranges", array: true + t.date "dates", array: true + t.boolean "shared", default: false t.integer "organisation_id", limit: 8 t.datetime "created_at" t.datetime "updated_at" @@ -94,7 +94,7 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "calendars", ["short_name"], name: "index_calendars_on_short_name", unique: true, using: :btree create_table "clean_up_results", id: :bigserial, force: :cascade do |t| - t.string "message_key" + t.string "message_key", limit: 255 t.hstore "message_attributs" t.integer "clean_up_id", limit: 8 t.datetime "created_at" @@ -104,7 +104,7 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "clean_up_results", ["clean_up_id"], name: "index_clean_up_results_on_clean_up_id", using: :btree create_table "clean_ups", id: :bigserial, force: :cascade do |t| - t.string "status" + t.string "status", limit: 255 t.datetime "started_at" t.datetime "ended_at" t.integer "referential_id", limit: 8 @@ -118,20 +118,20 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "clean_ups", ["referential_id"], name: "index_clean_ups_on_referential_id", using: :btree create_table "companies", id: :bigserial, force: :cascade do |t| - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.string "short_name" - t.string "organizational_unit" - t.string "operating_department_name" - t.string "code" - t.string "phone" - t.string "fax" - t.string "email" - t.string "registration_number" - t.string "url" - t.string "time_zone" + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "short_name", limit: 255 + t.string "organizational_unit", limit: 255 + t.string "operating_department_name", limit: 255 + t.string "code", limit: 255 + t.string "phone", limit: 255 + t.string "fax", limit: 255 + t.string "email", limit: 255 + t.string "registration_number", limit: 255 + t.string "url", limit: 255 + t.string "time_zone", limit: 255 t.integer "line_referential_id", limit: 8 t.text "import_xml" t.datetime "created_at" @@ -145,13 +145,13 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "connection_links", id: :bigserial, force: :cascade do |t| t.integer "departure_id", limit: 8 t.integer "arrival_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.string "comment" - t.decimal "link_distance", precision: 19, scale: 2 - t.string "link_type" + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "comment", limit: 255 + t.decimal "link_distance", precision: 19, scale: 2 + t.string "link_type", limit: 255 t.time "default_duration" t.time "frequent_traveller_duration" t.time "occasional_traveller_duration" @@ -166,15 +166,31 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "connection_links", ["objectid"], name: "connection_links_objectid_key", unique: true, using: :btree + create_table "delayed_jobs", id: :bigserial, force: :cascade do |t| + t.integer "priority", default: 0 + t.integer "attempts", default: 0 + t.text "handler" + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by", limit: 255 + t.string "queue", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree + create_table "exports", id: :bigserial, force: :cascade do |t| t.integer "referential_id", limit: 8 - t.string "status" - t.string "type" - t.string "options" + t.string "status", limit: 255 + t.string "type", limit: 255 + t.string "options", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.string "references_type" - t.string "reference_ids" + t.string "references_type", limit: 255 + t.string "reference_ids", limit: 255 end add_index "exports", ["referential_id"], name: "index_exports_on_referential_id", using: :btree @@ -184,23 +200,23 @@ ActiveRecord::Schema.define(version: 20170605135126) do t.integer "line_id", limit: 8 t.integer "connection_link_id", limit: 8 t.integer "stop_point_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 t.datetime "creation_time" - t.string "creator_id" - t.string "name" - t.string "comment" - t.string "description" + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "comment", limit: 255 + t.string "description", limit: 255 t.boolean "free_access" - t.decimal "longitude", precision: 19, scale: 16 - t.decimal "latitude", precision: 19, scale: 16 - t.string "long_lat_type" - t.decimal "x", precision: 19, scale: 2 - t.decimal "y", precision: 19, scale: 2 - t.string "projection_type" - t.string "country_code" - t.string "street_name" - t.string "contained_in" + t.decimal "longitude", precision: 19, scale: 16 + t.decimal "latitude", precision: 19, scale: 16 + t.string "long_lat_type", limit: 255 + t.decimal "x", precision: 19, scale: 2 + t.decimal "y", precision: 19, scale: 2 + t.string "projection_type", limit: 255 + t.string "country_code", limit: 255 + t.string "street_name", limit: 255 + t.string "contained_in", limit: 255 end add_index "facilities", ["objectid"], name: "facilities_objectid_key", unique: true, using: :btree @@ -212,8 +228,8 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "footnotes", id: :bigserial, force: :cascade do |t| t.integer "line_id", limit: 8 - t.string "code" - t.string "label" + t.string "code", limit: 255 + t.string "label", limit: 255 t.datetime "created_at" t.datetime "updated_at" end @@ -224,12 +240,12 @@ ActiveRecord::Schema.define(version: 20170605135126) do end create_table "group_of_lines", id: :bigserial, force: :cascade do |t| - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.string "comment" - t.string "registration_number" + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "comment", limit: 255 + t.string "registration_number", limit: 255 t.integer "line_referential_id", limit: 8 t.text "import_xml" t.datetime "created_at" @@ -246,7 +262,7 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "import_messages", id: :bigserial, force: :cascade do |t| t.integer "criticity" - t.string "message_key" + t.string "message_key", limit: 255 t.hstore "message_attributs" t.integer "import_id", limit: 8 t.integer "resource_id", limit: 8 @@ -260,30 +276,30 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "import_resources", id: :bigserial, force: :cascade do |t| t.integer "import_id", limit: 8 - t.string "status" + t.string "status", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.string "type" - t.string "reference" - t.string "name" + t.string "type", limit: 255 + t.string "reference", limit: 255 + t.string "name", limit: 255 t.hstore "metrics" end add_index "import_resources", ["import_id"], name: "index_import_resources_on_import_id", using: :btree create_table "imports", id: :bigserial, force: :cascade do |t| - t.string "status" - t.string "current_step_id" + t.string "status", limit: 255 + t.string "current_step_id", limit: 255 t.float "current_step_progress" t.integer "workbench_id", limit: 8 t.integer "referential_id", limit: 8 - t.string "name" + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.string "file" + t.string "file", limit: 255 t.datetime "started_at" t.datetime "ended_at" - t.string "token_download" + t.string "token_download", limit: 255 t.string "type", limit: 255 end @@ -318,16 +334,16 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "journey_patterns", id: :bigserial, force: :cascade do |t| t.integer "route_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.string "comment" - t.string "registration_number" - t.string "published_name" + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "comment", limit: 255 + t.string "registration_number", limit: 255 + t.string "published_name", limit: 255 t.integer "departure_stop_point_id", limit: 8 t.integer "arrival_stop_point_id", limit: 8 - t.integer "section_status", default: 0, null: false + t.integer "section_status", default: 0, null: false t.datetime "created_at" t.datetime "updated_at" end @@ -349,7 +365,7 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "line_referential_sync_messages", id: :bigserial, force: :cascade do |t| t.integer "criticity" - t.string "message_key" + t.string "message_key", limit: 255 t.hstore "message_attributs" t.integer "line_referential_sync_id", limit: 8 t.datetime "created_at" @@ -364,42 +380,42 @@ ActiveRecord::Schema.define(version: 20170605135126) do t.datetime "updated_at" t.datetime "started_at" t.datetime "ended_at" - t.string "status" + t.string "status", limit: 255 end add_index "line_referential_syncs", ["line_referential_id"], name: "index_line_referential_syncs_on_line_referential_id", using: :btree create_table "line_referentials", id: :bigserial, force: :cascade do |t| - t.string "name" + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.integer "sync_interval", default: 1 + t.integer "sync_interval", default: 1 end create_table "lines", id: :bigserial, force: :cascade do |t| t.integer "network_id", limit: 8 t.integer "company_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.string "number" - t.string "published_name" - t.string "transport_mode" - t.string "registration_number" - t.string "comment" + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "number", limit: 255 + t.string "published_name", limit: 255 + t.string "transport_mode", limit: 255 + t.string "registration_number", limit: 255 + t.string "comment", limit: 255 t.boolean "mobility_restricted_suitability" t.integer "int_user_needs" t.boolean "flexible_service" - t.string "url" + t.string "url", limit: 255 t.string "color", limit: 6 t.string "text_color", limit: 6 - t.string "stable_id" + t.string "stable_id", limit: 255 t.integer "line_referential_id", limit: 8 - t.boolean "deactivated", default: false + t.boolean "deactivated", default: false t.text "import_xml" - t.string "transport_submode" - t.integer "secondary_company_ids", limit: 8, array: true + t.string "transport_submode", limit: 255 + t.integer "secondary_company_ids", limit: 8, array: true t.datetime "created_at" t.datetime "updated_at" t.boolean "seasonal" @@ -411,17 +427,17 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "lines", ["secondary_company_ids"], name: "index_lines_on_secondary_company_ids", using: :gin create_table "networks", id: :bigserial, force: :cascade do |t| - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" + t.string "creator_id", limit: 255 t.date "version_date" - t.string "description" - t.string "name" - t.string "registration_number" - t.string "source_name" - t.string "source_type" - t.string "source_identifier" - t.string "comment" + t.string "description", limit: 255 + t.string "name", limit: 255 + t.string "registration_number", limit: 255 + t.string "source_name", limit: 255 + t.string "source_type", limit: 255 + t.string "source_identifier", limit: 255 + t.string "comment", limit: 255 t.text "import_xml" t.integer "line_referential_id", limit: 8 t.datetime "created_at" @@ -433,11 +449,11 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "networks", ["registration_number"], name: "networks_registration_number_key", using: :btree create_table "organisations", id: :bigserial, force: :cascade do |t| - t.string "name" + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.string "data_format", default: "neptune" - t.string "code" + t.string "data_format", limit: 255, default: "neptune" + t.string "code", limit: 255 t.datetime "synced_at" t.hstore "sso_attributes" end @@ -448,12 +464,12 @@ ActiveRecord::Schema.define(version: 20170605135126) do t.integer "start_of_link_id", limit: 8 t.integer "end_of_link_id", limit: 8 t.integer "route_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.string "comment" - t.decimal "link_distance", precision: 19, scale: 2 + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "comment", limit: 255 + t.decimal "link_distance", precision: 19, scale: 2 t.datetime "created_at" t.datetime "updated_at" end @@ -461,7 +477,7 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "pt_links", ["objectid"], name: "pt_links_objectid_key", unique: true, using: :btree create_table "referential_clonings", id: :bigserial, force: :cascade do |t| - t.string "status" + t.string "status", limit: 255 t.datetime "started_at" t.datetime "ended_at" t.integer "source_referential_id", limit: 8 @@ -482,30 +498,30 @@ ActiveRecord::Schema.define(version: 20170605135126) do t.daterange "periodes", array: true end - add_index "referential_metadata", ["line_ids"], name: "index_referential_metadata_on_line_ids", using: :gin + add_index "referential_metadata", ["line_ids"], name: "index_referential_metadata_on_line_ids", using: :btree add_index "referential_metadata", ["referential_id"], name: "index_referential_metadata_on_referential_id", using: :btree add_index "referential_metadata", ["referential_source_id"], name: "index_referential_metadata_on_referential_source_id", using: :btree create_table "referentials", id: :bigserial, force: :cascade do |t| - t.string "name" - t.string "slug" + t.string "name", limit: 255 + t.string "slug", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.string "prefix" - t.string "projection_type" - t.string "time_zone" - t.string "bounds" + t.string "prefix", limit: 255 + t.string "projection_type", limit: 255 + t.string "time_zone", limit: 255 + t.string "bounds", limit: 255 t.integer "organisation_id", limit: 8 t.text "geographical_bounds" t.integer "user_id", limit: 8 - t.string "user_name" - t.string "data_format" + t.string "user_name", limit: 255 + t.string "data_format", limit: 255 t.integer "line_referential_id", limit: 8 t.integer "stop_area_referential_id", limit: 8 t.integer "workbench_id", limit: 8 t.datetime "archived_at" t.integer "created_from_id", limit: 8 - t.boolean "ready", default: false + t.boolean "ready", default: false end add_index "referentials", ["created_from_id"], name: "index_referentials_on_created_from_id", using: :btree @@ -513,29 +529,29 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "route_sections", id: :bigserial, force: :cascade do |t| t.integer "departure_id", limit: 8 t.integer "arrival_id", limit: 8 - t.geometry "input_geometry", limit: {:srid=>4326, :type=>"line_string"} - t.geometry "processed_geometry", limit: {:srid=>4326, :type=>"line_string"} - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" + t.string "creator_id", limit: 255 t.float "distance" t.boolean "no_processing" + t.geometry "input_geometry", limit: {:srid=>4326, :type=>"line_string"} + t.geometry "processed_geometry", limit: {:srid=>4326, :type=>"line_string"} t.datetime "created_at" t.datetime "updated_at" end create_table "routes", id: :bigserial, force: :cascade do |t| t.integer "line_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.string "comment" + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "comment", limit: 255 t.integer "opposite_route_id", limit: 8 - t.string "published_name" - t.string "number" - t.string "direction" - t.string "wayback" + t.string "published_name", limit: 255 + t.string "number", limit: 255 + t.string "direction", limit: 255 + t.string "wayback", limit: 255 t.datetime "created_at" t.datetime "updated_at" end @@ -543,14 +559,14 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "routes", ["objectid"], name: "routes_objectid_key", unique: true, using: :btree create_table "routing_constraint_zones", id: :bigserial, force: :cascade do |t| - t.string "name" + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" + t.string "creator_id", limit: 255 t.integer "route_id", limit: 8 - t.integer "stop_point_ids", limit: 8, array: true + t.integer "stop_point_ids", limit: 8, array: true end create_table "routing_constraints_lines", id: false, force: :cascade do |t| @@ -560,7 +576,7 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "rule_parameter_sets", id: :bigserial, force: :cascade do |t| t.text "parameters" - t.string "name" + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" t.integer "organisation_id", limit: 8 @@ -574,7 +590,7 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "stop_area_referential_sync_messages", id: :bigserial, force: :cascade do |t| t.integer "criticity" - t.string "message_key" + t.string "message_key", limit: 255 t.hstore "message_attributs" t.integer "stop_area_referential_sync_id", limit: 8 t.datetime "created_at" @@ -589,43 +605,43 @@ ActiveRecord::Schema.define(version: 20170605135126) do t.datetime "updated_at" t.datetime "ended_at" t.datetime "started_at" - t.string "status" + t.string "status", limit: 255 end add_index "stop_area_referential_syncs", ["stop_area_referential_id"], name: "index_stop_area_referential_syncs_on_stop_area_referential_id", using: :btree create_table "stop_area_referentials", id: :bigserial, force: :cascade do |t| - t.string "name" + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" end create_table "stop_areas", id: :bigserial, force: :cascade do |t| t.integer "parent_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.string "comment" - t.string "area_type" - t.string "registration_number" - t.string "nearest_topic_name" + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.string "comment", limit: 255 + t.string "area_type", limit: 255 + t.string "registration_number", limit: 255 + t.string "nearest_topic_name", limit: 255 t.integer "fare_code" t.decimal "longitude", precision: 19, scale: 16 t.decimal "latitude", precision: 19, scale: 16 - t.string "long_lat_type" - t.string "country_code" - t.string "street_name" + t.string "long_lat_type", limit: 255 + t.string "country_code", limit: 255 + t.string "street_name", limit: 255 t.boolean "mobility_restricted_suitability" t.boolean "stairs_availability" t.boolean "lift_availability" t.integer "int_user_needs" - t.string "zip_code" - t.string "city_name" - t.string "url" - t.string "time_zone" + t.string "zip_code", limit: 255 + t.string "city_name", limit: 255 + t.string "url", limit: 255 + t.string "time_zone", limit: 255 t.integer "stop_area_referential_id", limit: 8 - t.string "status" + t.string "status", limit: 255 t.text "import_xml" t.datetime "deleted_at" t.datetime "created_at" @@ -646,12 +662,12 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "stop_points", id: :bigserial, force: :cascade do |t| t.integer "route_id", limit: 8 t.integer "stop_area_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" + t.string "creator_id", limit: 255 t.integer "position" - t.string "for_boarding" - t.string "for_alighting" + t.string "for_boarding", limit: 255 + t.string "for_alighting", limit: 255 t.datetime "created_at" t.datetime "updated_at" end @@ -661,9 +677,9 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "taggings", id: :bigserial, force: :cascade do |t| t.integer "tag_id", limit: 8 t.integer "taggable_id", limit: 8 - t.string "taggable_type" + t.string "taggable_type", limit: 255 t.integer "tagger_id", limit: 8 - t.string "tagger_type" + t.string "tagger_type", limit: 255 t.string "context", limit: 128 t.datetime "created_at" end @@ -672,8 +688,8 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree create_table "tags", id: :bigserial, force: :cascade do |t| - t.string "name" - t.integer "taggings_count", default: 0 + t.string "name", limit: 255 + t.integer "taggings_count", default: 0 end add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree @@ -697,11 +713,11 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "time_table_periods", ["time_table_id"], name: "index_time_table_periods_on_time_table_id", using: :btree create_table "time_tables", id: :bigserial, force: :cascade do |t| - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8, default: 1 - t.string "creator_id" - t.string "version" - t.string "comment" + t.string "creator_id", limit: 255 + t.string "version", limit: 255 + t.string "comment", limit: 255 t.integer "int_day_types", default: 0 t.date "start_date" t.date "end_date" @@ -725,49 +741,49 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "time_tables_vehicle_journeys", ["vehicle_journey_id"], name: "index_time_tables_vehicle_journeys_on_vehicle_journey_id", using: :btree create_table "timebands", id: :bigserial, force: :cascade do |t| - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "name" - t.time "start_time", null: false - t.time "end_time", null: false + t.string "creator_id", limit: 255 + t.string "name", limit: 255 + t.time "start_time", null: false + t.time "end_time", null: false t.datetime "created_at" t.datetime "updated_at" end create_table "users", id: :bigserial, force: :cascade do |t| - t.string "email", default: "", null: false - t.string "encrypted_password", default: "" - t.string "reset_password_token" + t.string "email", limit: 255, default: "", null: false + t.string "encrypted_password", limit: 255, default: "" + t.string "reset_password_token", limit: 255 t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0 + t.integer "sign_in_count", default: 0 t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" + t.string "current_sign_in_ip", limit: 255 + t.string "last_sign_in_ip", limit: 255 t.datetime "created_at" t.datetime "updated_at" t.integer "organisation_id", limit: 8 - t.string "name" - t.string "confirmation_token" + t.string "name", limit: 255 + t.string "confirmation_token", limit: 255 t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "unconfirmed_email" - t.integer "failed_attempts", default: 0 - t.string "unlock_token" + t.string "unconfirmed_email", limit: 255 + t.integer "failed_attempts", default: 0 + t.string "unlock_token", limit: 255 t.datetime "locked_at" - t.string "authentication_token" - t.string "invitation_token" + t.string "authentication_token", limit: 255 + t.string "invitation_token", limit: 255 t.datetime "invitation_sent_at" t.datetime "invitation_accepted_at" t.integer "invitation_limit" t.integer "invited_by_id", limit: 8 - t.string "invited_by_type" + t.string "invited_by_type", limit: 255 t.datetime "invitation_created_at" - t.string "username" + t.string "username", limit: 255 t.datetime "synced_at" - t.string "permissions", array: true + t.string "permissions", limit: 255, array: true end add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree @@ -778,14 +794,14 @@ ActiveRecord::Schema.define(version: 20170605135126) do create_table "vehicle_journey_at_stops", id: :bigserial, force: :cascade do |t| t.integer "vehicle_journey_id", limit: 8 t.integer "stop_point_id", limit: 8 - t.string "connecting_service_id" - t.string "boarding_alighting_possibility" + t.string "connecting_service_id", limit: 255 + t.string "boarding_alighting_possibility", limit: 255 t.time "arrival_time" t.time "departure_time" - t.string "for_boarding" - t.string "for_alighting" - t.integer "departure_day_offset", default: 0 - t.integer "arrival_day_offset", default: 0 + t.string "for_boarding", limit: 255 + t.string "for_alighting", limit: 255 + t.integer "departure_day_offset", default: 0 + t.integer "arrival_day_offset", default: 0 end add_index "vehicle_journey_at_stops", ["stop_point_id"], name: "index_vehicle_journey_at_stops_on_stop_pointid", using: :btree @@ -795,20 +811,20 @@ ActiveRecord::Schema.define(version: 20170605135126) do t.integer "route_id", limit: 8 t.integer "journey_pattern_id", limit: 8 t.integer "company_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", limit: 255, null: false t.integer "object_version", limit: 8 - t.string "creator_id" - t.string "comment" - t.string "status_value" - t.string "transport_mode" - t.string "published_journey_name" - t.string "published_journey_identifier" - t.string "facility" - t.string "vehicle_type_identifier" + t.string "creator_id", limit: 255 + t.string "comment", limit: 255 + t.string "status_value", limit: 255 + t.string "transport_mode", limit: 255 + t.string "published_journey_name", limit: 255 + t.string "published_journey_identifier", limit: 255 + t.string "facility", limit: 255 + t.string "vehicle_type_identifier", limit: 255 t.integer "number", limit: 8 t.boolean "mobility_restricted_suitability" t.boolean "flexible_service" - t.integer "journey_category", default: 0, null: false + t.integer "journey_category", default: 0, null: false t.datetime "created_at" t.datetime "updated_at" end @@ -817,7 +833,7 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "vehicle_journeys", ["route_id"], name: "index_vehicle_journeys_on_route_id", using: :btree create_table "workbenches", id: :bigserial, force: :cascade do |t| - t.string "name" + t.string "name", limit: 255 t.integer "organisation_id", limit: 8 t.datetime "created_at" t.datetime "updated_at" @@ -829,20 +845,18 @@ ActiveRecord::Schema.define(version: 20170605135126) do add_index "workbenches", ["organisation_id"], name: "index_workbenches_on_organisation_id", using: :btree add_index "workbenches", ["stop_area_referential_id"], name: "index_workbenches_on_stop_area_referential_id", using: :btree - add_foreign_key "access_links", "access_points", name: "aclk_acpt_fkey" + add_foreign_key "access_links", "access_points", name: "aclk_acpt_fkey", on_delete: :cascade add_foreign_key "group_of_lines_lines", "group_of_lines", name: "groupofline_group_fkey", on_delete: :cascade - add_foreign_key "journey_frequencies", "timebands", on_delete: :nullify - add_foreign_key "journey_frequencies", "vehicle_journeys", on_delete: :nullify - add_foreign_key "journey_pattern_sections", "journey_patterns", on_delete: :cascade - add_foreign_key "journey_pattern_sections", "route_sections", on_delete: :cascade + add_foreign_key "journey_frequencies", "timebands", name: "journey_frequencies_timeband_id_fk", on_delete: :nullify + add_foreign_key "journey_frequencies", "vehicle_journeys", name: "journey_frequencies_vehicle_journey_id_fk", on_delete: :nullify + add_foreign_key "journey_pattern_sections", "journey_patterns", name: "journey_pattern_sections_journey_pattern_id_fk", on_delete: :cascade + add_foreign_key "journey_pattern_sections", "route_sections", name: "journey_pattern_sections_route_section_id_fk", on_delete: :cascade add_foreign_key "journey_patterns", "routes", name: "jp_route_fkey", on_delete: :cascade add_foreign_key "journey_patterns", "stop_points", column: "arrival_stop_point_id", name: "arrival_point_fkey", on_delete: :nullify add_foreign_key "journey_patterns", "stop_points", column: "departure_stop_point_id", name: "departure_point_fkey", on_delete: :nullify add_foreign_key "journey_patterns_stop_points", "journey_patterns", name: "jpsp_jp_fkey", on_delete: :cascade add_foreign_key "journey_patterns_stop_points", "stop_points", name: "jpsp_stoppoint_fkey", on_delete: :cascade - add_foreign_key "route_sections", "stop_areas", column: "arrival_id" - add_foreign_key "route_sections", "stop_areas", column: "departure_id" - add_foreign_key "routes", "routes", column: "opposite_route_id", name: "route_opposite_route_fkey" + add_foreign_key "routes", "routes", column: "opposite_route_id", name: "route_opposite_route_fkey", on_delete: :nullify add_foreign_key "stop_areas", "stop_areas", column: "parent_id", name: "area_parent_fkey", on_delete: :nullify add_foreign_key "stop_areas_stop_areas", "stop_areas", column: "child_id", name: "stoparea_child_fkey", on_delete: :cascade add_foreign_key "stop_areas_stop_areas", "stop_areas", column: "parent_id", name: "stoparea_parent_fkey", on_delete: :cascade diff --git a/spec/features/routing_constraint_zones_spec.rb b/spec/features/routing_constraint_zones_spec.rb index 9e8c7dad4..b116b38bd 100644 --- a/spec/features/routing_constraint_zones_spec.rb +++ b/spec/features/routing_constraint_zones_spec.rb @@ -20,7 +20,7 @@ describe 'RoutingConstraintZones', type: :feature do context 'user has permission to create routing_constraint_zones' do it 'shows a create link for routing_constraint_zones' do - expect(page).to have_content(I18n.t('routing_constraint_zones.actions.new')) + expect(page).to have_content(I18n.t('actions.new')) end end @@ -28,7 +28,7 @@ describe 'RoutingConstraintZones', type: :feature do it 'does not show a create link for routing_constraint_zones' do @user.update_attribute(:permissions, []) visit referential_line_routing_constraint_zones_path(referential, line) - expect(page).not_to have_content(I18n.t('routing_constraint_zones.actions.new')) + expect(page).not_to have_content(I18n.t('actions.new')) end end |
