aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]app/assets/fonts/sBoiv/sboiv.eotbin15728 -> 16348 bytes
-rwxr-xr-x[-rw-r--r--]app/assets/fonts/sBoiv/sboiv.svg2
-rwxr-xr-x[-rw-r--r--]app/assets/fonts/sBoiv/sboiv.ttfbin15572 -> 16192 bytes
-rwxr-xr-x[-rw-r--r--]app/assets/fonts/sBoiv/sboiv.woffbin15648 -> 16268 bytes
-rw-r--r--app/assets/stylesheets/components/_tables.sass3
-rw-r--r--app/assets/stylesheets/typography/_sboiv.sass5
-rw-r--r--app/controllers/import_messages_controller.rb2
-rw-r--r--app/controllers/import_resources_controller.rb2
-rw-r--r--app/controllers/stop_areas_controller.rb25
-rw-r--r--app/controllers/vehicle_journeys_controller.rb4
-rw-r--r--app/helpers/stop_areas_helper.rb20
-rw-r--r--app/javascript/journey_patterns/components/JourneyPattern.js23
-rw-r--r--app/javascript/journey_patterns/components/JourneyPatterns.js2
-rw-r--r--app/javascript/vehicle_journeys/components/VehicleJourney.js21
-rw-r--r--app/javascript/vehicle_journeys/components/VehicleJourneys.js17
-rw-r--r--app/javascript/vehicle_journeys/containers/VehicleJourneysList.js4
-rw-r--r--app/models/chouette/stop_area.rb30
-rw-r--r--app/models/chouette/vehicle_journey.rb2
-rw-r--r--app/models/import/message_export.rb48
-rw-r--r--app/models/import/resource.rb2
-rw-r--r--app/models/line_referential.rb1
-rw-r--r--app/models/merge.rb1
-rw-r--r--app/models/stop_area_referential.rb1
-rw-r--r--app/models/workgroup.rb2
-rw-r--r--app/views/api/v1/stop_areas/short_description.rabl2
-rw-r--r--app/views/stop_areas/_filters.html.slim26
-rw-r--r--app/views/stop_areas/_form.html.slim2
-rw-r--r--app/views/stop_areas/index.html.slim4
-rw-r--r--app/views/stop_areas/show.html.slim2
-rw-r--r--app/views/vehicle_journeys/index.html.slim1
-rw-r--r--config/application.rb1
-rw-r--r--config/breadcrumbs.rb2
-rw-r--r--config/locales/footnotes.fr.yml4
-rw-r--r--config/locales/import_resources.en.yml22
-rw-r--r--config/locales/import_resources.fr.yml22
-rw-r--r--config/locales/import_tasks.en.yml52
-rw-r--r--config/locales/import_tasks.fr.yml53
-rw-r--r--config/locales/journey_patterns.en.yml3
-rw-r--r--config/locales/journey_patterns.fr.yml4
-rw-r--r--config/locales/routing_constraint_zones.fr.yml6
-rw-r--r--config/locales/stop_areas.en.yml9
-rw-r--r--config/locales/stop_areas.fr.yml10
-rw-r--r--config/locales/vehicle_journeys.fr.yml2
-rw-r--r--db/migrate/20180307202627_add_confirmed_at_to_stop_areas.rb5
-rw-r--r--db/migrate/20180308063549_update_stop_areas_confirmed_at_attribute.rb9
-rw-r--r--db/schema.rb54
-rw-r--r--lib/model_attribute.rb18
-rw-r--r--spec/controllers/referential_vehicle_journeys_controller_spec.rb12
-rw-r--r--spec/features/stop_areas_spec.rb40
-rw-r--r--spec/lib/model_attribute_spec.rb6
-rw-r--r--spec/models/merge_spec.rb18
-rw-r--r--spec/models/simple_importer_spec.rb6
-rw-r--r--spec/models/workgroup_spec.rb2
53 files changed, 381 insertions, 233 deletions
diff --git a/app/assets/fonts/sBoiv/sboiv.eot b/app/assets/fonts/sBoiv/sboiv.eot
index 7bf5449a2..3deb9e00b 100644..100755
--- a/app/assets/fonts/sBoiv/sboiv.eot
+++ b/app/assets/fonts/sBoiv/sboiv.eot
Binary files differ
diff --git a/app/assets/fonts/sBoiv/sboiv.svg b/app/assets/fonts/sBoiv/sboiv.svg
index 42e8988cb..497f783bd 100644..100755
--- a/app/assets/fonts/sBoiv/sboiv.svg
+++ b/app/assets/fonts/sBoiv/sboiv.svg
@@ -17,7 +17,7 @@
<glyph unicode="&#xe907;" glyph-name="transporteur" d="M512 741.069c-81.92 0-147.661-73.318-147.661-163.84 0-93.389 69.018-175.104 147.661-175.104s147.661 81.92 147.661 175.104c0 90.522-65.741 163.84-147.661 163.84zM512 441.651c-56.73 0-108.339 64.717-108.339 135.782s48.538 124.109 108.339 124.109 108.339-55.706 108.339-124.109-51.61-135.782-108.339-135.782zM837.837 960h-651.674c-79.176 0-143.36-64.184-143.36-143.36v0-736.051l6.349-5.734c5.53-5.12 124.723-112.026 376.832-133.939l15.974-1.229 26.010-1.638c15.565 0 31.539-1.229 48.333-1.229s32.563 0 47.923 1.229c11.469 0 22.528 1.229 33.382 2.253h6.554c252.723 20.48 366.797 129.229 371.917 134.349l5.939 5.734v735.027c0.003 0.366 0.005 0.798 0.005 1.231 0 79.176-64.184 143.36-143.36 143.36-0.29 0-0.58-0.001-0.869-0.003h0.045zM586.547-21.197h-9.626l-19.046-1.024c-13.722 0-27.648 0-41.984 0s-28.672 0-42.394 0h-31.13c-36.211 2.821-68.876 7.322-100.909 13.59l5.472-0.892c3.223 88.741 75.939 159.457 165.171 159.457s161.948-70.716 165.163-159.163l0.008-0.293c-25.397-5.041-56.477-9.184-88.060-11.516l-2.666-0.158zM715.981-0.717c-9.114 105.498-97.002 187.68-204.083 187.68s-194.969-82.182-204.030-186.914l-0.053-0.766c-18.227 4.506-32.358 8.806-40.96 11.878 2.048 179.814 46.080 290.611 245.76 290.611s243.507-111.002 245.76-290.816c-9.83-2.253-23.757-6.758-41.574-11.469zM941.261 97.792c-41.585-32.278-89.897-58.509-142.149-76.192l-3.464-1.018c-3.277 162.406-44.646 321.331-284.672 321.331-137.011 0-276.89-38.707-284.467-319.488-55.233 19.071-103.124 44.821-145.948 76.957l1.359-0.976v716.8c0.462 57.303 46.908 103.604 104.221 103.834h651.696c57.264-0.228 103.666-46.414 104.243-103.574v-0.055z" />
<glyph unicode="&#xe908;" glyph-name="trace" d="M220.57 153.702c7.656 11.232 12.225 25.102 12.225 40.038s-4.568 28.806-12.384 40.287l0.16-0.249c-5.259 7.728-11.728 14.197-19.207 19.296l-0.249 0.16c-11.212 7.698-25.077 12.294-40.016 12.294-0.332 0-0.663-0.002-0.994-0.007l0.050 0.001c-0.201 0.002-0.438 0.003-0.676 0.003-5.716 0-11.276-0.673-16.603-1.944l0.485 0.098c-3.413 6.868-10.381 11.506-18.432 11.506-11.331 0-20.517-9.186-20.517-20.517 0-3.28 0.77-6.381 2.139-9.13l-0.054 0.119c0.592-1.011 1.201-1.881 1.872-2.698l-0.028 0.036c-12.243-12.806-19.779-30.202-19.779-49.358 0-39.475 32.001-71.475 71.475-71.475 0.113 0 0.227 0 0.34 0.001h-0.017c0.281-0.004 0.612-0.006 0.944-0.006 14.939 0 28.804 4.596 40.259 12.452l-0.243-0.157c7.635 5.218 14.033 11.617 19.092 19.005l0.159 0.247zM561.357 67.072c-11.212 7.698-25.077 12.294-40.016 12.294-0.332 0-0.663-0.002-0.994-0.007l0.050 0.001c-0.080 0-0.175 0.001-0.27 0.001-31.454 0-58.121-20.493-67.378-48.856l-0.142-0.501c-2.637 2.573-5.971 4.443-9.693 5.298l-0.138 0.027c-1.139 0.221-2.449 0.348-3.789 0.348-11.503 0-20.828-9.325-20.828-20.828 0-10.163 7.279-18.626 16.909-20.459l0.13-0.021h3.891c0.198-0.007 0.43-0.011 0.663-0.011 4.002 0 7.736 1.148 10.891 3.133l-0.085-0.050c4.426-34.809 33.858-61.449 69.513-61.449 0.402 0 0.803 0.003 1.204 0.010l-0.060-0.001c0.281-0.004 0.612-0.006 0.944-0.006 14.939 0 28.804 4.596 40.259 12.452l-0.243-0.157c7.728 5.259 14.197 11.728 19.296 19.207l0.16 0.249c7.656 11.232 12.225 25.102 12.225 40.038s-4.568 28.806-12.384 40.287l0.16-0.249c-5.494 7.696-12.234 14.109-19.987 19.079l-0.288 0.173zM966.246 274.125c-3.801 5.452-8.124 10.165-12.995 14.244l-0.112 0.092c18.132 47.444 28.632 102.317 28.632 159.643 0 64.372-13.241 125.652-37.147 181.264l1.142-2.986c13.419 12.977 21.749 31.143 21.749 51.255 0 39.362-31.909 71.27-71.27 71.27-8.378 0-16.419-1.446-23.886-4.101l0.498 0.155c-70.085 82.874-167.895 140.378-278.969 158.168l-2.631 0.347c-2.074 9.484-5.766 17.855-10.808 25.23l0.158-0.245c-5.218 7.635-11.617 14.033-19.005 19.092l-0.247 0.159c-11.212 7.698-25.077 12.294-40.016 12.294-0.332 0-0.663-0.002-0.994-0.007l0.050 0.001c-34.182-0.131-62.713-24.169-69.75-56.255l-0.087-0.474c-138.493-22.099-254.554-103.131-323.456-216.080l-1.152-2.032c-3.778 0.747-8.123 1.175-12.567 1.175-9.827 0-19.165-2.091-27.595-5.852l0.431 0.172c-26.103-11.293-44.035-36.823-44.035-66.543 0-39.927 32.367-72.294 72.294-72.294s72.294 32.367 72.294 72.294c0 20.824-8.804 39.592-22.894 52.784l-0.040 0.037c63.358 102.396 166.932 174.75 288.137 195.238l2.474 0.346s0-1.434 0-2.048c11.157-25.972 36.517-43.831 66.049-43.831 0.252 0 0.503 0.001 0.754 0.004h-0.038c0.281-0.004 0.612-0.006 0.944-0.006 14.939 0 28.804 4.596 40.259 12.452l-0.243-0.157c7.728 5.259 14.197 11.728 19.296 19.207l0.16 0.249c2.682 3.948 5.090 8.467 6.998 13.24l0.17 0.482c101.026-16.869 187.935-67.795 250.419-140.354l0.461-0.548c-9.791-12.103-15.719-27.684-15.719-44.649 0-39.362 31.909-71.27 71.27-71.27 0.198 0 0.396 0.001 0.594 0.002h-0.030c0.015 0 0.033 0 0.051 0 5.056 0 9.99 0.522 14.752 1.515l-0.467-0.081c19.62-46.693 31.019-100.964 31.019-157.897 0-51.76-9.422-101.32-26.644-147.058l0.95 2.875c-3.225 0.59-6.936 0.928-10.725 0.928-9.403 0-18.32-2.078-26.319-5.799l0.385 0.161c-25.94-11.145-43.784-36.456-43.827-65.94v-0.006c0-39.588 32.092-71.68 71.68-71.68s71.68 32.092 71.68 71.68v0 0c0.001 0.129 0.001 0.282 0.001 0.436 0 14.807-4.515 28.559-12.244 39.955l0.16-0.25zM637.338 500.429c-5.189 5.188-12.356 8.398-20.274 8.398-0.072 0-0.145 0-0.217-0.001h0.011c-0.187 0.005-0.408 0.007-0.629 0.007-7.786 0-14.82-3.218-19.845-8.397l-0.007-0.007-36.864-36.659 92.365-92.16 36.864 36.864c5.067 5.137 8.196 12.196 8.196 19.987 0 0.173-0.002 0.347-0.005 0.519v-0.026c0 0.024 0 0.053 0 0.082 0 7.92-3.122 15.11-8.202 20.408l0.010-0.010zM361.677 265.114v-92.365h92.365l184.525 184.73-92.365 92.16-184.525-184.525zM299.008 91.853c-3.082 1.95-6.833 3.107-10.854 3.107-11.33 0-20.515-9.185-20.515-20.515 0-7.309 3.822-13.724 9.576-17.358l0.085-0.050c3.050-1.901 6.752-3.028 10.718-3.028 7.27 0 13.656 3.788 17.29 9.499l0.049 0.083c1.994 3.104 3.178 6.892 3.178 10.958 0 7.247-3.765 13.616-9.445 17.256l-0.082 0.049zM102.4 311.194c8.784 2.437 15.124 10.362 15.124 19.767 0 2.005-0.288 3.942-0.825 5.773l0.036-0.145c-2.519 8.66-10.383 14.881-19.7 14.881-1.954 0-3.845-0.274-5.635-0.785l0.144 0.035c-9.005-2.283-15.56-10.316-15.56-19.88 0-2.038 0.298-4.007 0.852-5.865l-0.037 0.145c2.491-8.702 10.376-14.964 19.723-14.964 0.266 0 0.531 0.005 0.795 0.015l-0.038-0.001c1.888 0.167 3.628 0.529 5.287 1.071l-0.167-0.047zM83.968 391.27c10.421 1.048 18.489 9.773 18.489 20.383 0 0.539-0.021 1.072-0.062 1.601l0.004-0.070c-0.84 10.616-9.661 18.912-20.42 18.912-0.598 0-1.19-0.026-1.775-0.076l0.076 0.005c-10.962-0.452-19.677-9.448-19.677-20.48 0-11.32 9.177-20.496 20.496-20.496 0.288 0 0.575 0.006 0.86 0.018l-0.041-0.001zM81.92 472.986h2.048c10.861 0.561 19.456 9.504 19.456 20.454 0 11.311-9.169 20.48-20.48 20.48s-20.48-9.169-20.48-20.48c0-10.951 8.595-19.894 19.406-20.452l0.050-0.002zM208.077 137.933c-3.68-3.702-5.955-8.804-5.955-14.438s2.275-10.737 5.956-14.439l-0.001 0.001c3.635-3.41 8.534-5.51 13.923-5.53h0.004c6.006 0.015 11.403 2.613 15.14 6.741l0.016 0.018c3.897 3.735 6.32 8.982 6.32 14.796 0 11.311-9.169 20.48-20.48 20.48-6.426 0-12.16-2.959-15.915-7.59l-0.030-0.038zM368.64 56.832c-2.218 0.878-4.787 1.387-7.475 1.387-11.511 0-20.843-9.332-20.843-20.843 0-8.823 5.482-16.365 13.226-19.407l0.142-0.049c2.143-0.907 4.635-1.434 7.25-1.434 0.043 0 0.086 0 0.129 0h-0.007c0.043 0 0.093-0.001 0.144-0.001 8.659 0 16.063 5.374 19.059 12.969l0.048 0.139c1.042 2.374 1.648 5.141 1.648 8.050 0 8.74-5.475 16.201-13.182 19.141l-0.141 0.047z" />
<glyph unicode="&#xe909;" glyph-name="tableau-de-bord" d="M349.594 623.923c0-22.622-18.338-40.96-40.96-40.96v0h-134.963c-22.622 0-40.96 18.338-40.96 40.96v0 81.92c0 22.622 18.338 40.96 40.96 40.96v0h135.373c22.622 0 40.96-18.338 40.96-40.96v0zM349.594 407.45c0-22.622-18.338-40.96-40.96-40.96v0h-134.963c-22.622 0-40.96 18.338-40.96 40.96v0 81.51c0 22.622 18.338 40.96 40.96 40.96v0h135.373c22.622 0 40.96-18.338 40.96-40.96v0zM349.594 190.976c0-22.622-18.338-40.96-40.96-40.96v0h-134.963c-22.622 0-40.96 18.338-40.96 40.96v0 81.92c0 22.622 18.338 40.96 40.96 40.96v0h135.373c22.622 0 40.96-18.338 40.96-40.96v0zM620.339 623.923c0-22.622-18.338-40.96-40.96-40.96v0h-134.963c-22.622 0-40.96 18.338-40.96 40.96v0 81.92c0 22.622 18.338 40.96 40.96 40.96v0h135.168c22.622 0 40.96-18.338 40.96-40.96v0zM620.339 407.45c0-22.622-18.338-40.96-40.96-40.96v0h-134.963c-22.622 0-40.96 18.338-40.96 40.96v0 81.51c0 22.622 18.338 40.96 40.96 40.96v0h135.168c22.622 0 40.96-18.338 40.96-40.96v0zM620.339 190.976c0-22.622-18.338-40.96-40.96-40.96v0h-134.963c-22.622 0-40.96 18.338-40.96 40.96v0 81.92c0 22.622 18.338 40.96 40.96 40.96v0h135.168c22.622 0 40.96-18.338 40.96-40.96v0zM890.88 623.923c0-22.622-18.338-40.96-40.96-40.96v0h-134.963c-22.622 0-40.96 18.338-40.96 40.96v0 81.92c0 22.622 18.338 40.96 40.96 40.96v0h135.373c22.622 0 40.96-18.338 40.96-40.96v0zM890.88 407.040c0-22.622-18.338-40.96-40.96-40.96v0h-134.963c-22.622 0-40.96 18.338-40.96 40.96v0 81.92c0 22.622 18.338 40.96 40.96 40.96v0h135.373c22.622 0 40.96-18.338 40.96-40.96v0zM890.88 190.566c0-22.622-18.338-40.96-40.96-40.96v0h-134.963c-22.622 0-40.96 18.338-40.96 40.96v0 81.92c0 22.622 18.338 40.96 40.96 40.96v0h135.373c22.622 0 40.96-18.338 40.96-40.96v0z" />
-<glyph unicode="&#xe90a;" glyph-name="synchro-ilico" d="M581.837 816.64l-139.674 143.36v-122.88c-0.227 0-0.496 0.001-0.765 0.001-214.905 0-389.12-174.215-389.12-389.12 0-134.343 68.080-252.785 171.622-322.707l1.379-0.878 22.733 33.997c-93.932 63.339-154.888 169.345-154.888 289.588 0 192.283 155.877 348.16 348.16 348.16 0.309 0 0.618 0 0.927-0.001h-0.048v-122.88zM277.914 537.907q0 17.818 20.48 17.818t20.48-17.818c0.024-0.344 0.038-0.745 0.038-1.15 0-4.734-1.89-9.027-4.956-12.165l0.003 0.003c-3.533-2.979-8.136-4.789-13.161-4.789-0.63 0-1.253 0.028-1.869 0.084l0.079-0.006q-21.094 0-21.094 18.022zM316.006 369.152h-36.454v133.939h36.659zM390.963 368.947h-36.454v186.778h36.659zM427.827 537.907q0 17.818 20.48 17.818t20.48-17.818c0.024-0.344 0.038-0.745 0.038-1.15 0-4.734-1.89-9.027-4.956-12.165l0.003 0.003c-3.533-2.979-8.136-4.789-13.161-4.789-0.63 0-1.253 0.028-1.869 0.084l0.079-0.006q-21.094 0-21.094 18.022zM465.92 369.152h-35.84v133.939h36.659zM558.899 366.080q-62.669 0-62.669 68.813c-0.112 1.517-0.176 3.287-0.176 5.071 0 18.008 6.492 34.5 17.264 47.262l-0.090-0.109c11.504 11.229 27.251 18.156 44.616 18.156 1.452 0 2.892-0.048 4.32-0.144l-0.194 0.010c0.164 0.001 0.357 0.002 0.551 0.002 14.696 0 28.597-3.402 40.958-9.461l-0.549 0.243-9.011-27.443q-8.602 3.482-16.179 5.734c-4.469 1.413-9.611 2.236-14.942 2.253h-0.009q-28.467 0-28.467-40.96t28.467-39.322c0.394-0.009 0.859-0.013 1.325-0.013 6.836 0 13.426 1.053 19.616 3.006l-0.461-0.126c6.87 2.249 12.839 5.237 18.262 8.962l-0.24-0.156v-31.334c-5.173-3.395-11.184-6.071-17.614-7.695l-0.409-0.087c-6.923-1.697-14.871-2.671-23.047-2.671-0.466 0-0.931 0.003-1.395 0.009l0.070-0.001zM752.64 436.326c0.082-1.289 0.129-2.795 0.129-4.311 0-17.949-6.559-34.365-17.412-46.984l0.080 0.095c-11.359-11.45-27.099-18.537-44.495-18.537-1.278 0-2.547 0.038-3.806 0.114l0.173-0.008c-0.416-0.009-0.906-0.014-1.397-0.014-11.964 0-23.2 3.118-32.939 8.586l0.339-0.175c-9.865 5.717-17.665 14.043-22.586 24.041l-0.147 0.331c-5.049 10.329-8.002 22.476-8.002 35.313 0 0.545 0.005 1.090 0.016 1.632l-0.001-0.081c-0.088 1.331-0.138 2.886-0.138 4.452 0 17.905 6.565 34.277 17.419 46.839l-0.077-0.091c11.402 11.337 27.119 18.345 44.473 18.345 1.358 0 2.706-0.043 4.043-0.127l-0.183 0.009c0.386 0.008 0.84 0.012 1.295 0.012 11.998 0 23.268-3.117 33.044-8.585l-0.343 0.176c9.848-5.656 17.644-13.913 22.586-23.841l0.147-0.326c4.927-10.221 7.806-22.224 7.806-34.9 0-0.691-0.009-1.379-0.026-2.066l0.002 0.102zM659.866 436.326c-0.044-0.833-0.069-1.808-0.069-2.789 0-9.7 2.452-18.827 6.77-26.795l-0.147 0.297c4.256-6.231 11.327-10.268 19.34-10.268 0.401 0 0.8 0.010 1.196 0.030l-0.056-0.002c0.404-0.025 0.876-0.040 1.351-0.040 7.954 0 14.962 4.048 19.077 10.197l0.052 0.083c4.075 7.663 6.469 16.756 6.469 26.408 0 1.301-0.043 2.592-0.129 3.871l0.009-0.173c0.072 1.055 0.112 2.287 0.112 3.529 0 9.662-2.469 18.748-6.811 26.66l0.145-0.288c-5.106 6.068-12.704 9.897-21.197 9.897s-16.091-3.829-21.162-9.855l-0.034-0.042c-3.28-6.858-5.197-14.907-5.197-23.403 0-2.58 0.177-5.119 0.519-7.605l-0.032 0.288zM581.837-64l-139.674 143.36 139.674 143.36v-122.88c0.017 0 0.037 0 0.058 0 192.283 0 348.16 155.877 348.16 348.16 0 120.242-60.955 226.247-153.651 288.801l-1.236 0.786 23.552 33.997c104.921-70.8 173.001-189.242 173.001-323.585 0-214.905-174.215-389.12-389.12-389.12-0.269 0-0.537 0-0.806 0.001h0.041z" />
+<glyph unicode="&#xe90a;" glyph-name="synchro" d="M581.837-64l-139.674 143.36 139.674 143.36v-122.88c0.017 0 0.037 0 0.058 0 192.283 0 348.16 155.877 348.16 348.16 0 120.242-60.955 226.247-153.651 288.801l-1.236 0.786 23.552 33.997c104.921-70.8 173.001-189.242 173.001-323.585 0-214.905-174.215-389.12-389.12-389.12-0.269 0-0.537 0-0.806 0.001h0.041zM581.837 816.64l-139.674 143.36v-122.88c-0.227 0-0.496 0.001-0.765 0.001-214.905 0-389.12-174.215-389.12-389.12 0-134.343 68.080-252.785 171.622-322.707l1.379-0.878 22.733 33.997c-93.932 63.339-154.888 169.345-154.888 289.588 0 192.283 155.877 348.16 348.16 348.16 0.309 0 0.618 0 0.927-0.001h-0.048v-122.88z" />
<glyph unicode="&#xe90b;" glyph-name="synchro-icar" d="M581.837-64l-139.674 143.36 139.674 143.36v-122.88c0.017 0 0.037 0 0.058 0 192.283 0 348.16 155.877 348.16 348.16 0 120.242-60.955 226.247-153.651 288.801l-1.236 0.786 23.552 33.997c104.921-70.8 173.001-189.242 173.001-323.585 0-214.905-174.215-389.12-389.12-389.12-0.269 0-0.537 0-0.806 0.001h0.041zM581.837 816.64l-139.674 143.36v-122.88c-0.227 0-0.496 0.001-0.765 0.001-214.905 0-389.12-174.215-389.12-389.12 0-134.343 68.080-252.785 171.622-322.707l1.379-0.878 22.733 33.997c-93.932 63.339-154.888 169.345-154.888 289.588 0 192.283 155.877 348.16 348.16 348.16 0.309 0 0.618 0 0.927-0.001h-0.048v-122.88zM299.008 537.907q0 17.818 20.48 17.818t20.48-17.818c0.024-0.344 0.038-0.745 0.038-1.15 0-4.734-1.89-9.027-4.956-12.165l0.003 0.003c-3.533-2.979-8.136-4.789-13.161-4.789-0.63 0-1.253 0.028-1.869 0.084l0.079-0.006q-21.094 0-21.094 18.022zM337.101 369.152h-36.659v133.939h36.659zM430.080 366.080q-62.669 0-62.669 68.813c-0.112 1.517-0.176 3.287-0.176 5.071 0 18.008 6.492 34.5 17.264 47.262l-0.090-0.109c11.504 11.229 27.251 18.156 44.616 18.156 1.452 0 2.892-0.048 4.32-0.144l-0.194 0.010c0.164 0.001 0.357 0.002 0.551 0.002 14.696 0 28.597-3.402 40.958-9.461l-0.549 0.243-10.035-27.443q-8.602 3.482-16.179 5.734c-4.469 1.413-9.611 2.236-14.942 2.253h-0.009q-28.467 0-28.467-40.96t28.467-39.322c0.394-0.009 0.859-0.013 1.325-0.013 6.836 0 13.426 1.053 19.616 3.006l-0.461-0.126c6.704 2.019 12.546 4.737 17.897 8.157l-0.284-0.17v-31.334c-5.172-3.399-11.184-6.076-17.615-7.696l-0.407-0.087c-5.864-1.209-12.603-1.902-19.503-1.902-1.208 0-2.41 0.021-3.608 0.063l0.174-0.005zM586.957 368.947l-6.963 17.613c-5.005-6.763-11.38-12.222-18.745-16.037l-0.301-0.142c-6.763-2.787-14.615-4.405-22.844-4.405-1.258 0-2.506 0.038-3.745 0.112l0.17-0.008c-0.73-0.046-1.584-0.073-2.443-0.073-10.874 0-20.759 4.237-28.092 11.151l0.020-0.019c-6.917 7.519-11.157 17.595-11.157 28.662 0 1.013 0.035 2.017 0.105 3.012l-0.008-0.134c-0.059 0.767-0.093 1.66-0.093 2.562 0 11.93 5.896 22.483 14.934 28.903l0.109 0.074c12.294 7.103 27.043 11.294 42.77 11.294 0.804 0 1.605-0.011 2.404-0.033l-0.118 0.003h23.347v5.939c0.102 0.725 0.16 1.562 0.16 2.413 0 10.067-8.161 18.227-18.227 18.227-0.851 0-1.688-0.058-2.508-0.171l0.095 0.011c-13.895-0.602-26.841-4.090-38.44-9.875l0.552 0.249-12.083 24.781c14.51 7.621 31.702 12.093 49.939 12.093 0.515 0 1.030-0.004 1.544-0.011l-0.078 0.001c1.186 0.079 2.572 0.123 3.968 0.123 13.871 0 26.709-4.42 37.184-11.928l-0.192 0.131c8.901-7.985 14.475-19.523 14.475-32.364 0-1.223-0.051-2.435-0.15-3.633l0.010 0.157v-89.498zM576.102 430.387h-14.131c-0.493 0.019-1.072 0.030-1.653 0.030-8.119 0-15.739-2.138-22.328-5.882l0.224 0.117c-4.755-3.292-7.83-8.719-7.83-14.864 0-0.463 0.017-0.922 0.052-1.376l-0.004 0.060q0-15.565 17.818-15.565c0.442-0.025 0.96-0.039 1.48-0.039 7.339 0 14.019 2.817 19.019 7.429l-0.019-0.018c4.697 4.674 7.604 11.144 7.604 18.292 0 0.409-0.010 0.816-0.028 1.221l0.002-0.057zM725.197 505.754c0.379 0.009 0.825 0.014 1.273 0.014 3.896 0 7.703-0.378 11.388-1.098l-0.373 0.061-2.662-34.406c-3 0.786-6.444 1.238-9.994 1.238-0.303 0-0.605-0.003-0.906-0.010l0.045 0.001c-0.675 0.042-1.464 0.066-2.258 0.066-9.537 0-18.272-3.431-25.039-9.125l0.059 0.048c-6.098-5.925-9.882-14.203-9.882-23.365 0-0.642 0.019-1.28 0.055-1.913l-0.004 0.087v-68.198h-36.659v133.939h27.648l5.325-22.528h1.843c4.093 7.467 9.767 13.6 16.605 18.11l0.189 0.117c6.412 4.363 14.327 6.966 22.85 6.966 0.175 0 0.349-0.001 0.523-0.003h-0.026z" />
<glyph unicode="&#xe90c;" glyph-name="reseau" d="M977.51 251.597c26.584 59.488 42.066 128.918 42.066 201.963 0 103.349-30.993 199.459-84.191 279.543l1.165-1.865c8.182 11.447 13.082 25.728 13.082 41.153 0 39.362-31.909 71.27-71.27 71.27-12.124 0-23.54-3.027-33.535-8.367l0.383 0.187c-88.479 77.598-205.176 124.937-332.929 124.937-155.213 0-294.106-69.876-386.936-179.887l-0.621-0.756c-7.012 2.526-15.104 3.987-23.537 3.987-39.475 0-71.475-32.001-71.475-71.475 0-19.503 7.811-37.181 20.475-50.077l-0.010 0.011c-28.679-61.497-45.412-133.512-45.412-209.436 0-95.079 26.242-184.028 71.877-260.001l-1.275 2.288c-6.678-10.339-10.648-22.972-10.648-36.532 0-37.552 30.442-67.994 67.994-67.994 7.54 0 14.794 1.227 21.572 3.493l-0.48-0.139c91.659-91.687 218.299-148.399 358.186-148.399 160.251 0 303.119 74.426 395.924 190.597l0.783 1.014c6.094-2.102 13.12-3.368 20.426-3.481l0.054-0.001c0.141-0.001 0.308-0.002 0.475-0.002 37.891 0 68.608 30.717 68.608 68.608 0 19.37-8.027 36.864-20.936 49.34l-0.020 0.019zM940.851 270.029c-3.742 0.74-8.044 1.163-12.445 1.163-31.627 0-58.149-21.857-65.285-51.289l-0.094-0.459c-152.576 0-287.949 56.73-399.974 133.325 4.965 8.943 7.887 19.611 7.887 30.963 0 7.388-1.238 14.488-3.518 21.102l0.136-0.455 365.158 311.501c11.97-9.766 27.415-15.683 44.243-15.683 9.599 0 18.748 1.925 27.082 5.41l-0.464-0.172c46.912-71.411 74.829-158.943 74.829-252.995 0-65.983-13.74-128.756-38.515-185.615l1.165 3zM512 919.040c0.097 0 0.211 0 0.325 0 115.788 0 221.672-42.404 302.969-112.531l-0.599 0.505c-5.939-9.892-9.452-21.827-9.452-34.584 0-8.16 1.437-15.984 4.073-23.233l-0.15 0.473-364.954-311.501c-11.41 9.098-26.039 14.598-41.953 14.598-17.258 0-33.006-6.469-44.95-17.114l0.067 0.059c-75.968 67.814-143.303 142.429-202.013 223.686l-2.787 4.052c12.214 12.682 19.737 29.955 19.737 48.985 0 16.15-5.418 31.034-14.536 42.935l0.124-0.169c85.806 100.438 212.55 163.733 354.080 163.84h0.019zM86.221 642.355c4.797-1.221 10.304-1.921 15.974-1.921s11.177 0.7 16.439 2.020l-0.465-0.099c64.986-90.797 136.529-170.074 216.023-240.585l1.474-1.284c-1.426-5.076-2.245-10.906-2.245-16.926 0-12.023 3.268-23.282 8.964-32.938l-0.165 0.303-163.84-139.878c-11.916 10.631-27.72 17.127-45.041 17.127-9.626 0-18.783-2.006-27.076-5.623l0.437 0.17c-38.346 66.114-60.976 145.471-60.976 230.113 0 68.715 14.915 133.947 41.684 192.635l-1.188-2.907zM512-13.619c-0.055 0-0.12 0-0.186 0-125.876 0-240.057 50.071-323.713 131.383l0.11-0.106c8.961 11.164 14.382 25.504 14.382 41.109 0 6.14-0.839 12.083-2.409 17.722l0.11-0.464 171.622 146.432c8.912-4.75 19.49-7.539 30.72-7.539s21.808 2.79 31.079 7.713l-0.359-0.174c119.603-81.306 262.963-144.384 426.803-144.384h5.12c2.593-6.654 5.905-12.403 9.943-17.557l-0.112 0.149c-86.016-106.627-216.662-174.268-363.108-174.285h-0.003z" />
<glyph unicode="&#xe90d;" glyph-name="rapport-de-controle" d="M536.781 960h-467.763v-1002.496h527.565c-24.786 11.033-46.126 24.762-65.024 41.222l0.308-0.262h-421.888v920.576h397.312v-241.459h241.459v-234.496c15.787-3.204 29.504-7.303 42.682-12.474l-1.722 0.595v275.866zM548.25 890.573l172.032-172.032h-172.032zM210.33 619.008h437.862v-41.984h-437.862v41.984zM563.405 408.883h-353.075v-40.96h301.67c15.016 15.482 31.885 29.029 50.287 40.322l1.118 0.638zM210.33 304.64v-40.96h242.688c4.702 15.893 10.133 29.474 16.639 42.42l-0.665-1.46zM210.33 513.946h437.862v-41.984h-437.862v41.984zM698.982 407.040c118.763 0 215.040-96.277 215.040-215.040s-96.277-215.040-215.040-215.040c-118.763 0-215.040 96.277-215.040 215.040v0c0.117 118.716 96.324 214.923 215.029 215.040h0.011zM698.982 448c-141.385 0-256-114.615-256-256s114.615-256 256-256c141.385 0 256 114.615 256 256v0c0 141.385-114.615 256-256 256v0zM667.853 86.733c-5.799 0.023-11.026 2.452-14.738 6.341l-0.008 0.008-85.606 88.678c-3.557 3.681-5.749 8.701-5.749 14.234 0 11.319 9.176 20.495 20.495 20.495 5.787 0 11.013-2.398 14.74-6.255l0.006-0.006 70.042-72.499 119.603 136.806c3.784 4.313 9.307 7.021 15.462 7.021 11.343 0 20.538-9.195 20.538-20.538 0-5.187-1.923-9.925-5.095-13.54l0.020 0.023-134.144-153.6c-3.678-4.174-8.991-6.831-14.928-6.963h-0.023z" />
diff --git a/app/assets/fonts/sBoiv/sboiv.ttf b/app/assets/fonts/sBoiv/sboiv.ttf
index d6b4d8441..a04a1e09a 100644..100755
--- a/app/assets/fonts/sBoiv/sboiv.ttf
+++ b/app/assets/fonts/sBoiv/sboiv.ttf
Binary files differ
diff --git a/app/assets/fonts/sBoiv/sboiv.woff b/app/assets/fonts/sBoiv/sboiv.woff
index 8e10ad072..5ceec6b78 100644..100755
--- a/app/assets/fonts/sBoiv/sboiv.woff
+++ b/app/assets/fonts/sBoiv/sboiv.woff
Binary files differ
diff --git a/app/assets/stylesheets/components/_tables.sass b/app/assets/stylesheets/components/_tables.sass
index ef19bd538..ba51f7de7 100644
--- a/app/assets/stylesheets/components/_tables.sass
+++ b/app/assets/stylesheets/components/_tables.sass
@@ -376,6 +376,9 @@
border-top-color: transparent
> div:not(.btn-group)
min-height: 20px
+ white-space: nowrap
+ overflow: hidden
+ text-overflow: ellipsis
.td > .headlined
&:before
diff --git a/app/assets/stylesheets/typography/_sboiv.sass b/app/assets/stylesheets/typography/_sboiv.sass
index f0943f843..5419708ac 100644
--- a/app/assets/stylesheets/typography/_sboiv.sass
+++ b/app/assets/stylesheets/typography/_sboiv.sass
@@ -73,12 +73,9 @@
.sb-dashboard:before
content: '\e909'
-.sb-line_referential:before
+.sb-line_referential:before, .sb-stop_area_referential:before
content: '\e90a'
-.sb-stop_area_referential:before
- content: '\e90b'
-
.sb-network:before
content: '\e90c'
diff --git a/app/controllers/import_messages_controller.rb b/app/controllers/import_messages_controller.rb
index 5e39445fb..e9a071177 100644
--- a/app/controllers/import_messages_controller.rb
+++ b/app/controllers/import_messages_controller.rb
@@ -9,7 +9,7 @@ class ImportMessagesController < ChouetteController
def index
index! do |format|
format.csv {
- send_data ImportMessageExport.new(:import_messages => @import_messages).to_csv(:col_sep => "\;", :quote_char=>'"', force_quotes: true) , :filename => "import_errors_#{@import_resource.name.gsub('.xml', '')}_#{Date.today.to_s}.csv"
+ send_data Import::MessageExport.new(:import_messages => @import_messages).to_csv(:col_sep => "\;", :quote_char=>'"', force_quotes: true) , :filename => "import_errors_#{@import_resource.name.gsub('.xml', '')}_#{Date.today.to_s}.csv"
}
end
end
diff --git a/app/controllers/import_resources_controller.rb b/app/controllers/import_resources_controller.rb
index 6d1977e0c..1535fd171 100644
--- a/app/controllers/import_resources_controller.rb
+++ b/app/controllers/import_resources_controller.rb
@@ -1,7 +1,7 @@
class ImportResourcesController < ChouetteController
defaults resource_class: Import::Resource, collection_name: 'import_resources', instance_name: 'import_resource'
respond_to :html
- belongs_to :import
+ belongs_to :import, :parent_class => Import::Base
def index
index! do |format|
diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb
index 41a1a8c6d..c77500132 100644
--- a/app/controllers/stop_areas_controller.rb
+++ b/app/controllers/stop_areas_controller.rb
@@ -53,6 +53,7 @@ class StopAreasController < ChouetteController
index! do |format|
format.html {
+ # binding.pry
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)
end
@@ -133,7 +134,9 @@ class StopAreasController < ChouetteController
end
def collection
- @q = parent.present? ? parent.stop_areas.search(params[:q]) : referential.stop_areas.search(params[:q])
+ scope = parent.present? ? parent.stop_areas : referential.stop_areas
+ scope = ransack_status(scope)
+ @q = scope.search(params[:q])
if sort_column && sort_direction
@stop_areas ||=
@@ -202,8 +205,28 @@ class StopAreasController < ChouetteController
:waiting_time,
:zip_code,
:kind,
+ :status,
localized_names: Chouette::StopArea::AVAILABLE_LOCALIZATIONS
)
end
+ # Fake ransack filter
+ def ransack_status scope
+ return scope unless params[:q].try(:[], :status)
+ return scope if params[:q][:status].values.uniq.length == 1
+
+ @status = {
+ in_creation: params[:q][:status]['in_creation'] == 'true',
+ confirmed: params[:q][:status]['confirmed'] == 'true',
+ deactivated: params[:q][:status]['deactivated'] == 'true',
+ }
+
+ scope = Chouette::StopArea.where(
+ "confirmed_at #{@status[:confirmed] ? "IS NOT NULL" : "IS NULL"}
+ AND deleted_at #{@status[:deactivated] ? "IS NOT NULL" : "IS NULL"}"
+ )
+
+ params[:q].delete :status
+ scope
+ end
end
diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb
index 14795227c..e532712d2 100644
--- a/app/controllers/vehicle_journeys_controller.rb
+++ b/app/controllers/vehicle_journeys_controller.rb
@@ -155,6 +155,10 @@ class VehicleJourneysController < ChouetteController
private
def load_custom_fields
@custom_fields = referential.workgroup&.custom_fields_definitions || {}
+
+ @extra_headers = Rails.application.config.vehicle_journeys_extra_headers.dup.delete_if do |header|
+ header[:type] == :custom_field and not @custom_fields.has_key?(header[:name].to_s)
+ end
end
def map_stop_points points
diff --git a/app/helpers/stop_areas_helper.rb b/app/helpers/stop_areas_helper.rb
index fa99f1b4c..1c9d974a1 100644
--- a/app/helpers/stop_areas_helper.rb
+++ b/app/helpers/stop_areas_helper.rb
@@ -70,4 +70,24 @@ module StopAreasHelper
def stop_area_registration_number_value stop_area
stop_area&.registration_number || stop_area&.stop_area_referential&.generate_registration_number
end
+
+ def stop_area_status(stop_area)
+ if stop_area.activated?
+ content_tag(:span, nil, class: 'fa fa-check-circle fa-lg text-success') +
+ t('activerecord.attributes.stop_area.confirmed')
+ elsif stop_area.deactivated?
+ content_tag(:span, nil, class: 'fa fa-exclamation-circle fa-lg text-danger') +
+ t('activerecord.attributes.stop_area.deactivated')
+ else
+ content_tag(:span, nil, class: 'fa fa-pencil fa-lg text-info') +
+ t('activerecord.attributes.stop_area.in_creation')
+ end
+ end
+
+ def stop_area_status_options
+ Chouette::StopArea.statuses.map do |status|
+ [ t(status, scope: 'activerecord.attributes.stop_area'), status ]
+ end
+ end
+
end
diff --git a/app/javascript/journey_patterns/components/JourneyPattern.js b/app/javascript/journey_patterns/components/JourneyPattern.js
index 35765b99a..d20294594 100644
--- a/app/javascript/journey_patterns/components/JourneyPattern.js
+++ b/app/javascript/journey_patterns/components/JourneyPattern.js
@@ -74,17 +74,22 @@ export default class JourneyPattern extends Component{
return !this.props.status.policy[`journey_patterns.${action}`]
}
- totals(){
+ totals(onlyCommercial=false){
let totalTime = 0
let totalDistance = 0
let from = null
this.props.value.stop_points.map((stopPoint, i) =>{
- if(from && stopPoint.checked){
+ let usePoint = stopPoint.checked
+ console.log(stopPoint)
+ if(onlyCommercial && (i == 0 || i == this.props.value.stop_points.length - 1) && stopPoint.kind == "non_commercial"){
+ usePoint = false
+ }
+ if(from && usePoint){
let [costsKey, costs, time, distance] = this.getTimeAndDistanceBetweenStops(from, stopPoint.id)
totalTime += time
totalDistance += distance
}
- if(stopPoint.checked){
+ if(usePoint){
from = stopPoint.id
}
})
@@ -109,13 +114,15 @@ export default class JourneyPattern extends Component{
}
else{
let hours = parseInt(time/60)
- return hours + " h " + (time - 60*hours)
+ let minutes = (time - 60*hours)
+ return hours + " h " + (minutes > 0 ? minutes : '')
}
}
render() {
this.previousSpId = undefined
- let [totalTime, totalDistance] = this.totals()
+ let [totalTime, totalDistance] = this.totals(false)
+ let [commercialTotalTime, commercialTotalDistance] = this.totals(true)
return (
<div className={'t2e-item' + (this.props.value.deletable ? ' disabled' : '') + (this.props.value.object_id ? '' : ' to_record') + (this.props.value.errors ? ' has-error': '') + (this.hasFeature('costs_in_journey_patterns') ? ' with-costs' : '')}>
<div className='th'>
@@ -128,6 +135,12 @@ export default class JourneyPattern extends Component{
<span className="col-md-6"><i className="fa fa-clock-o"></i>{totalTime}</span>
</div>
}
+ {this.hasFeature('costs_in_journey_patterns') &&
+ <div className="small row totals commercial">
+ <span className="col-md-6"><i className="fa fa-arrows-h"></i>{commercialTotalDistance}</span>
+ <span className="col-md-6"><i className="fa fa-clock-o"></i>{commercialTotalTime}</span>
+ </div>
+ }
<div className={this.props.value.deletable ? 'btn-group disabled' : 'btn-group'}>
<div
className={this.props.value.deletable ? 'btn dropdown-toggle disabled' : 'btn dropdown-toggle'}
diff --git a/app/javascript/journey_patterns/components/JourneyPatterns.js b/app/javascript/journey_patterns/components/JourneyPatterns.js
index 31727fefc..1e39f3ac7 100644
--- a/app/javascript/journey_patterns/components/JourneyPatterns.js
+++ b/app/javascript/journey_patterns/components/JourneyPatterns.js
@@ -110,6 +110,8 @@ export default class JourneyPatterns extends Component {
<div className='strong mb-xs'>ID Mission</div>
<div>Code mission</div>
<div>Nb arrêts</div>
+ <div>{I18n.attribute_name('journey_pattern', 'full_journey_time')}</div>
+ <div>{I18n.attribute_name('journey_pattern', 'commercial_journey_time')}</div>
</div>
{this.props.stopPointsList.map((sp, i) =>{
return (
diff --git a/app/javascript/vehicle_journeys/components/VehicleJourney.js b/app/javascript/vehicle_journeys/components/VehicleJourney.js
index a667bf8aa..73d99d120 100644
--- a/app/javascript/vehicle_journeys/components/VehicleJourney.js
+++ b/app/javascript/vehicle_journeys/components/VehicleJourney.js
@@ -75,6 +75,21 @@ export default class VehicleJourney extends Component {
return (bool1 || bool2)
}
+ extraHeaderValue(header) {
+ if(header.type == "custom_field"){
+ let field = this.props.value.custom_fields[header["name"]]
+ if(field.field_type == "list"){
+ return field.options.list_values[field.value]
+ }
+ else{
+ return field.value
+ }
+ }
+ else{
+ return this.props.value[header["name"]]
+ }
+ }
+
render() {
this.previousCity = undefined
let detailed_calendars = this.hasFeature('detailed_calendars') && !this.disabled
@@ -95,6 +110,11 @@ export default class VehicleJourney extends Component {
<div>{this.props.value.published_journey_name && this.props.value.published_journey_name != I18n.t('undefined') ? this.props.value.published_journey_name : '-'}</div>
<div>{this.props.value.journey_pattern.short_id || '-'}</div>
<div>{this.props.value.company ? this.props.value.company.name : '-'}</div>
+ {
+ this.props.extraHeaders.map((header, i) =>
+ <div key={i}>{this.extraHeaderValue(header)}</div>
+ )
+ }
{ this.hasFeature('purchase_windows') &&
<div>
{purchase_windows.slice(0,3).map((tt, i)=>
@@ -222,4 +242,5 @@ VehicleJourney.propTypes = {
vehicleJourneys: PropTypes.object.isRequired,
allTimeTables: PropTypes.array.isRequired,
allPurchaseWindows: PropTypes.array.isRequired,
+ extraHeaders: PropTypes.array.isRequired,
}
diff --git a/app/javascript/vehicle_journeys/components/VehicleJourneys.js b/app/javascript/vehicle_journeys/components/VehicleJourneys.js
index ae38a21af..ca08ba3b1 100644
--- a/app/javascript/vehicle_journeys/components/VehicleJourneys.js
+++ b/app/javascript/vehicle_journeys/components/VehicleJourneys.js
@@ -163,6 +163,15 @@ export default class VehicleJourneys extends Component {
)
}
+ extraHeaderLabel(header) {
+ if(header["type"] == "custom_field"){
+ return this.props.customFields[header["name"]]["name"]
+ }
+ else{
+ return I18n.attribute_name("vehicle_journey", header)
+ }
+ }
+
render() {
this.previousBreakpoint = undefined
this._allTimeTables = null
@@ -208,6 +217,11 @@ export default class VehicleJourneys extends Component {
<div>{I18n.attribute_name("vehicle_journey", "name")}</div>
<div>{I18n.attribute_name("vehicle_journey", "journey_pattern_id")}</div>
<div>{I18n.model_name("company")}</div>
+ {
+ this.props.extraHeaders.map((header, i) =>
+ <div key={i}>{this.extraHeaderLabel(header)}</div>
+ )
+ }
{ this.hasFeature('purchase_windows') &&
<div>
{ detailed_purchase_windows &&
@@ -278,6 +292,7 @@ export default class VehicleJourneys extends Component {
disabled={this.isReturn()}
allTimeTables={this.allTimeTables()}
allPurchaseWindows={this.allPurchaseWindows()}
+ extraHeaders={this.props.extraHeaders}
/>
)}
</div>
@@ -293,6 +308,8 @@ export default class VehicleJourneys extends Component {
VehicleJourneys.propTypes = {
status: PropTypes.object.isRequired,
filters: PropTypes.object.isRequired,
+ extraHeaders: PropTypes.array.isRequired,
+ customFields: PropTypes.object.isRequired,
stopPointsList: PropTypes.array.isRequired,
onLoadFirstPage: PropTypes.func.isRequired,
onUpdateTime: PropTypes.func.isRequired,
diff --git a/app/javascript/vehicle_journeys/containers/VehicleJourneysList.js b/app/javascript/vehicle_journeys/containers/VehicleJourneysList.js
index 81d603fd4..f21e2c87e 100644
--- a/app/javascript/vehicle_journeys/containers/VehicleJourneysList.js
+++ b/app/javascript/vehicle_journeys/containers/VehicleJourneysList.js
@@ -10,7 +10,9 @@ const mapStateToProps = (state) => {
status: state.status,
filters: state.filters,
stopPointsList: state.stopPointsList,
- returnStopPointsList: state.returnStopPointsList
+ returnStopPointsList: state.returnStopPointsList,
+ extraHeaders: window.extra_headers,
+ customFields: window.custom_fields,
}
}
diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb
index 0a27b2f39..1918c90d1 100644
--- a/app/models/chouette/stop_area.rb
+++ b/app/models/chouette/stop_area.rb
@@ -383,29 +383,55 @@ module Chouette
end
def activated?
- deleted_at.nil?
+ deleted_at.nil? && confirmed_at
end
def deactivated?
- !activated?
+ deleted_at && confirmed_at.nil?
end
def activate
+ self.confirmed_at = Time.now
self.deleted_at = nil
end
def deactivate
+ self.confirmed_at = nil
self.deleted_at = Time.now
end
def activate!
+ update_attribute :confirmed_at, Time.now
update_attribute :deleted_at, nil
end
def deactivate!
+ update_attribute :confirmed_at, nil
update_attribute :deleted_at, Time.now
end
+ def status
+ return :deleted if deleted_at
+ return :confirmed if confirmed_at
+
+ :in_creation
+ end
+
+ def status=(status)
+ case status&.to_sym
+ when :deleted
+ deactivate
+ when :confirmed
+ activate
+ when :in_creation
+ self.confirmed_at = self.deleted_at = nil
+ end
+ end
+
+ def self.statuses
+ %i{in_creation confirmed deleted}
+ end
+
def time_zone_offset
return 0 unless time_zone.present?
ActiveSupport::TimeZone[time_zone]&.utc_offset
diff --git a/app/models/chouette/vehicle_journey.rb b/app/models/chouette/vehicle_journey.rb
index 46522c354..b3987060a 100644
--- a/app/models/chouette/vehicle_journey.rb
+++ b/app/models/chouette/vehicle_journey.rb
@@ -62,7 +62,7 @@ module Chouette
scope :with_ordered_stop_area_ids, ->(first, second){
if first.present? && second.present?
joins(journey_pattern: :stop_points).
- joins('INNER JOIN "journey_patterns" ON "journey_patterns"."id" = "vehicle_journeys"."journey_pattern_id" INNER JOIN "journey_patterns_stop_points" ON "journey_patterns_stop_points"."journey_pattern_id" = "journey_patterns"."id" INNER JOIN "stop_points" as "second_stop_points" ON "stop_points"."id" = "journey_patterns_stop_points"."stop_point_id"').
+ joins('INNER JOIN "journey_patterns" ON "journey_patterns"."id" = "vehicle_journeys"."journey_pattern_id" INNER JOIN "journey_patterns_stop_points" ON "journey_patterns_stop_points"."journey_pattern_id" = "journey_patterns"."id" INNER JOIN "stop_points" as "second_stop_points" ON "second_stop_points"."id" = "journey_patterns_stop_points"."stop_point_id"').
where('stop_points.stop_area_id = ?', first).
where('second_stop_points.stop_area_id = ? and stop_points.position < second_stop_points.position', second)
else
diff --git a/app/models/import/message_export.rb b/app/models/import/message_export.rb
new file mode 100644
index 000000000..7a7add08c
--- /dev/null
+++ b/app/models/import/message_export.rb
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+require "csv"
+require "zip"
+
+class Import::MessageExport
+ include ActiveModel::Validations
+ include ActiveModel::Conversion
+ extend ActiveModel::Naming
+
+ attr_accessor :import_messages
+
+ def initialize(attributes = {})
+ attributes.each { |name, value| send("#{name}=", value) }
+ end
+
+ def persisted?
+ false
+ end
+
+ def label(name)
+ I18n.t "vehicle_journey_exports.label.#{name}"
+ end
+
+ def column_names
+ ["criticity", "message key", "message", "file name", "line", "column"]
+ end
+
+ def to_csv(options = {})
+ csv_string = CSV.generate(options) do |csv|
+ csv << column_names
+ import_messages.each do |import_message|
+ csv << [import_message.criticity, import_message.message_attributes['test_id'], I18n.t("import_messages.#{import_message.message_key}", import_message.message_attributes.deep_symbolize_keys), *import_message.resource_attributes.values_at("filename", "line_number", "column_number") ]
+ end
+ end
+ # We add a BOM to indicate we use UTF-8
+ "\uFEFF" + csv_string
+ end
+
+ def to_zip(temp_file,options = {})
+ ::Zip::OutputStream.open(temp_file) { |zos| }
+ ::Zip::File.open(temp_file.path, ::Zip::File::CREATE) do |zipfile|
+ zipfile.get_output_stream(label("vj_filename")+route.id.to_s+".csv") { |f| f.puts to_csv(options) }
+ zipfile.get_output_stream(label("tt_filename")+".csv") { |f| f.puts time_tables_to_csv(options) }
+ zipfile.get_output_stream(label("ftn_filename")+".csv") { |f| f.puts footnotes_to_csv(options) }
+ end
+ end
+
+end
diff --git a/app/models/import/resource.rb b/app/models/import/resource.rb
index 73be04d0e..5bd011039 100644
--- a/app/models/import/resource.rb
+++ b/app/models/import/resource.rb
@@ -4,5 +4,5 @@ class Import::Resource < ActiveRecord::Base
include IevInterfaces::Resource
belongs_to :import, class_name: Import::Base
- has_many :messages, class_name: "ImportMessage", foreign_key: :resource_id
+ has_many :messages, class_name: "Import::Message", foreign_key: :resource_id
end
diff --git a/app/models/line_referential.rb b/app/models/line_referential.rb
index 15b2f6276..0d2ed39b1 100644
--- a/app/models/line_referential.rb
+++ b/app/models/line_referential.rb
@@ -10,6 +10,7 @@ class LineReferential < ActiveRecord::Base
has_many :networks, class_name: 'Chouette::Network'
has_many :line_referential_syncs, -> { order created_at: :desc }
has_many :workbenches
+ has_one :workgroup
def add_member(organisation, options = {})
attributes = options.merge organisation: organisation
diff --git a/app/models/merge.rb b/app/models/merge.rb
index d42d882ac..e72c794fe 100644
--- a/app/models/merge.rb
+++ b/app/models/merge.rb
@@ -159,7 +159,6 @@ class Merge < ActiveRecord::Base
route_id: nil,
objectid: objectid,
)
-
new_route.stop_points.build attributes
end
diff --git a/app/models/stop_area_referential.rb b/app/models/stop_area_referential.rb
index 9e9e02d80..a9d3cc9b1 100644
--- a/app/models/stop_area_referential.rb
+++ b/app/models/stop_area_referential.rb
@@ -8,6 +8,7 @@ class StopAreaReferential < ActiveRecord::Base
has_many :stop_areas, class_name: 'Chouette::StopArea'
has_many :stop_area_referential_syncs, -> {order created_at: :desc}
has_many :workbenches
+ has_one :workgroup
def add_member(organisation, options = {})
attributes = options.merge organisation: organisation
diff --git a/app/models/workgroup.rb b/app/models/workgroup.rb
index 3af20ae23..708225a2a 100644
--- a/app/models/workgroup.rb
+++ b/app/models/workgroup.rb
@@ -11,6 +11,8 @@ class Workgroup < ActiveRecord::Base
validates_presence_of :line_referential_id
validates_presence_of :stop_area_referential_id
+ validates_uniqueness_of :stop_area_referential_id
+ validates_uniqueness_of :line_referential_id
has_many :custom_fields
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/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)
diff --git a/config/application.rb b/config/application.rb
index 8da6a7428..fabea41de 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -40,6 +40,7 @@ module ChouetteIhm
)
config.development_toolbar = false
+ config.vehicle_journeys_extra_headers = []
unless Rails.env.production?
# Work around sprockets+teaspoon mismatch:
diff --git a/config/breadcrumbs.rb b/config/breadcrumbs.rb
index 87d6f5846..e57cbc4f2 100644
--- a/config/breadcrumbs.rb
+++ b/config/breadcrumbs.rb
@@ -127,7 +127,7 @@ crumb :export do |workbench, export|
end
crumb :import_resources do |import, import_resources|
- link I18n.t('import_resources.index.title'), workbench_import_import_resources_path(import.workbench, import.parent)
+ link I18n.t('import.resources.index.title'), workbench_import_import_resources_path(import.workbench, import.parent)
parent :import, import.workbench, import.parent
end
diff --git a/config/locales/footnotes.fr.yml b/config/locales/footnotes.fr.yml
index 692098046..5169cfc11 100644
--- a/config/locales/footnotes.fr.yml
+++ b/config/locales/footnotes.fr.yml
@@ -15,6 +15,6 @@ fr:
other: "notes"
attributes:
footnote:
- code: "numéro"
+ code: "titre"
checksum: Signature métier
- label: "ligne de texte"
+ label: "texte"
diff --git a/config/locales/import_resources.en.yml b/config/locales/import_resources.en.yml
index 3e737f9bc..386039319 100644
--- a/config/locales/import_resources.en.yml
+++ b/config/locales/import_resources.en.yml
@@ -1,11 +1,14 @@
en:
- import_resources: &resources
- index:
- title: "NeTEx conformity"
- table_state: "%{lines_imported} line(s) imported on %{lines_in_zipfile} presents in zipfile"
- table_title: "Satus of anlyzed files"
- table_explanation: "When calendriers.xml and/or commun.xml are not imported, then all lines file are not processed."
- metrics: "%{ok_count} ok, %{error_count} errors, %{warning_count} warnings, %{uncheck_count} n/a"
+ import:
+ resources: &resources
+ index:
+ title: "NeTEx conformity"
+ table_state: "%{lines_imported} line(s) imported on %{lines_in_zipfile} presents in zipfile"
+ table_title: "Satus of anlyzed files"
+ table_explanation: "When calendriers.xml and/or commun.xml are not imported, then all lines file are not processed."
+ metrics: "%{ok_count} ok, %{error_count} errors, %{warning_count} warnings, %{uncheck_count} n/a"
+ import_resources:
+ <<: *resources
activerecord:
models:
import_resource:
@@ -14,5 +17,6 @@ en:
other: "netex conformities"
attributes:
import:
- name: "Filename"
- status: "Status"
+ resource:
+ name: "Filename"
+ status: "Status"
diff --git a/config/locales/import_resources.fr.yml b/config/locales/import_resources.fr.yml
index a271ae1ca..50fb7f1ca 100644
--- a/config/locales/import_resources.fr.yml
+++ b/config/locales/import_resources.fr.yml
@@ -1,11 +1,14 @@
fr:
+ import:
+ resources: &resources
+ index:
+ title: "Rapport de conformité NeTEx"
+ table_state: "%{lines_imported} ligne(s) importée(s) sur %{lines_in_zipfile} présente(s) dans l'archive"
+ table_title: "Etat des fichiers analysés"
+ table_explanation: "Dans le cas ou le(s) fichiers calendriers.xml et/ou commun.xml sont dans un état non importé, alors tous les fichiers lignes sont automatiquement dans un état non traité."
+ metrics: "%{ok_count} ok, %{error_count} errors, %{warning_count} warnings, %{uncheck_count} n/a"
import_resources:
- index:
- title: "Rapport de conformité NeTEx"
- table_state: "%{lines_imported} ligne(s) importée(s) sur %{lines_in_zipfile} présente(s) dans l'archive"
- table_title: "Etat des fichiers analysés"
- table_explanation: "Dans le cas ou le(s) fichiers calendriers.xml et/ou commun.xml sont dans un état non importé, alors tous les fichiers lignes sont automatiquement dans un état non traité."
- metrics: "%{ok_count} ok, %{error_count} errors, %{warning_count} warnings, %{uncheck_count} n/a"
+ <<: *resources
activerecord:
models:
import_resource:
@@ -13,6 +16,7 @@ fr:
one: "rapport de conformité Netex"
other: "rapports de conformité Netex"
attributes:
- import_resource:
- name: "Fichier"
- status: "Etat"
+ import:
+ resource:
+ name: "Fichier"
+ status: "Etat"
diff --git a/config/locales/import_tasks.en.yml b/config/locales/import_tasks.en.yml
deleted file mode 100644
index 34f7e6998..000000000
--- a/config/locales/import_tasks.en.yml
+++ /dev/null
@@ -1,52 +0,0 @@
-en:
- import_tasks:
- actions:
- new: "New import"
- new:
- title: "New import"
- all: "All"
- flash: "Import task on queue, refresh page to see progression"
- activemodel:
- models:
- import_task:
- zero: "import"
- one: "import"
- other: "imports"
- neptune_import:
- zero: "import"
- one: "Neptune import"
- other: "imports"
- gtfs_import:
- zero: "import"
- one: "GTFS import"
- other: "imports"
- netex_import:
- zero: "import"
- one: "NeTEx import"
- other: "imports"
- attributes:
- import_task:
- name: "Import name"
- no_save: "No save"
- resources: "File to import"
- references_type: "Data to be imported"
- object_id_prefix: "Neptune Id prefix"
- max_distance_for_commercial: "Max distance for commercial stop"
- max_distance_for_connection_link: "Max distance for connection link"
- ignore_last_word: "ignore last word"
- ignore_end_chars: "ignore last chars"
- errors:
- models:
- import_task:
- attributes:
- resources:
- maximum_file_size: "File should smaller than %{maximum_file_size} (%{file_size} sent)"
- invalid_mime_type: "File doesn't use the expected format (%{mime_type} sent)"
- formtastic:
- titles:
- import_task:
- max_distance_for_commercial: "Maximal distance to merge homonymous stops in commercial stop in meter"
- max_distance_for_connection_link: "Maximal distance to link stops by connection link stop in meter"
- ignore_last_word: "ignore last word on stop name in homonymous detection (inappliable when just one word occurs)"
- ignore_end_chars: "ignore some chars at the end of stop names in homonymous detection"
- references_type: "Filter on stop areas import only GTFS stops and transfers files, these may contain extra attributes"
diff --git a/config/locales/import_tasks.fr.yml b/config/locales/import_tasks.fr.yml
deleted file mode 100644
index 002ca03cb..000000000
--- a/config/locales/import_tasks.fr.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-fr:
- import_tasks:
- actions:
- new: "Nouvel import"
- new:
- title: "Nouvel import"
- all: "Tout"
- flash: "La demande d'import est mise en file d'attente, veuillez rafraichir régulièrement la page pour en suivre la progression"
- activemodel:
- models:
- import_task:
- zero: "import"
- one: "import"
- other: "imports"
- neptune_import:
- zero: "import"
- one: "import Neptune"
- other: "imports"
- gtfs_import:
- zero: "import"
- one: "import GTFS"
- other: "imports"
- netex_import:
- zero: "import"
- one: "import NeTEx"
- other: "imports"
- attributes:
- import_task:
- name: "Nom de l'import"
- no_save: "Pas de sauvegarde"
- resources: "Fichier à importer"
- references_type: "Données à importer"
- object_id_prefix: "Préfixe d'identifiants"
- max_distance_for_commercial: "Distance max pour créer les zones"
- max_distance_for_connection_link: "Distance max pour créer les correspondances"
- ignore_last_word: "ignorer le dernier mot"
- ignore_end_chars: "ignorer les n derniers caractères"
- errors:
- models:
- import_task:
- attributes:
- resources:
- maximum_file_size: "Le fichier ne peut dépasser %{maximum_file_size} (%{file_size} soumis)"
- invalid_mime_type: "Le fichier n'utilise pas le format attendu (%{mime_type} soumis)"
-
- formtastic:
- titles:
- import_task:
- max_distance_for_commercial: "Distance maximale entre deux arrêts homonymes pour créer les zones d'arrêt (en mètre)"
- max_distance_for_connection_link: "Distance maximale entre deux arrêts pour créer les correspondances (en mètre)"
- ignore_last_word: "Ignorer le dernier mot pour détecter l'homonymie des noms d'arrêt (inapplicable quand le nom ne comporte qu'un mot)"
- ignore_end_chars: "Ignorer les n derniers caractères du nom de l'arrêt pour détecter l'homonymie"
- references_type: "Le filtre sur arrêts importe uniquement les fichiers GTFS stops et transfers gtfs, ceux-ci pouvant contenir des attributs supplémentaires"
diff --git a/config/locales/journey_patterns.en.yml b/config/locales/journey_patterns.en.yml
index 9d9bc21e2..5f3de0b05 100644
--- a/config/locales/journey_patterns.en.yml
+++ b/config/locales/journey_patterns.en.yml
@@ -49,6 +49,9 @@ en:
created_at: Created at
updated_at: Updated at
creator_id: "Created by"
+ full_journey_time: Full journey
+ commercial_journey_time: Commercial journey
+
formtastic:
titles:
journey_pattern:
diff --git a/config/locales/journey_patterns.fr.yml b/config/locales/journey_patterns.fr.yml
index fb69f4190..2aa95248f 100644
--- a/config/locales/journey_patterns.fr.yml
+++ b/config/locales/journey_patterns.fr.yml
@@ -42,13 +42,15 @@ fr:
published_name: "Nom public"
section_status: "Status section"
comment: "Commentaire"
- registration_number: "Numéro d'enregistrement"
+ registration_number: "Code mission"
stop_point_ids: "Sélection des arrêts desservis"
objectid: "Identifiant Neptune"
object_version: "Version"
created_at: "Créé le"
updated_at: "Edité le"
creator_id: "Créé par"
+ full_journey_time: Parcours complet
+ commercial_journey_time: Parcours commercial
formtastic:
titles:
journey_pattern:
diff --git a/config/locales/routing_constraint_zones.fr.yml b/config/locales/routing_constraint_zones.fr.yml
index 024dd3288..d4b97fff2 100644
--- a/config/locales/routing_constraint_zones.fr.yml
+++ b/config/locales/routing_constraint_zones.fr.yml
@@ -2,9 +2,9 @@ fr:
activerecord:
models:
routing_constraint_zone:
- zero: zone de contrainte
- one: zone de contrainte
- other: zone de contraintes
+ zero: ITL
+ one: ITL
+ other: ITLs
attributes:
routing_constraint_zone:
checksum: Signature métier
diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml
index 74b6fae73..9e70993aa 100644
--- a/config/locales/stop_areas.en.yml
+++ b/config/locales/stop_areas.en.yml
@@ -110,8 +110,11 @@ en:
name: "Name"
registration_number: "Registration number"
published_name: "Published name"
- deleted: "Deleted"
- deleted_at: "Deleted at"
+ in_creation: "In creation"
+ confirmed: "Activated"
+ confirmed_at: "Activated at"
+ deleted: "Deactivated"
+ deleted_at: "Deactivated at"
comment: "Description"
stop_area_type: "Area type"
area_type: "Area type"
@@ -143,8 +146,6 @@ en:
coordinates: "Coordinates (lat,lng) WGS84"
zip_code: "Zip code"
city_name: "City"
- created_at: Created at
- updated_at: Updated at
waiting_time: Waiting time (minutes)
state: State
formtastic:
diff --git a/config/locales/stop_areas.fr.yml b/config/locales/stop_areas.fr.yml
index 605e6158e..aee112be7 100644
--- a/config/locales/stop_areas.fr.yml
+++ b/config/locales/stop_areas.fr.yml
@@ -112,8 +112,12 @@ fr:
kind: "Catégorie"
registration_number: "Numéro d'enregistrement"
published_name: "Nom public"
- deleted: "Supprimé"
- deleted_at: "Activé"
+ in_creation: "En création"
+ confirmed: "Actif"
+ confirmed_at: "Activé le"
+ deleted: "Désactivé"
+ deactivated: "Désactivé"
+ deleted_at: "Désactivé le"
comment: "Commentaire"
stop_area_type: "Type d'arrêt"
area_type: "Type d'arrêt"
@@ -145,8 +149,6 @@ fr:
coordinates: "Coordonnées (lat,lng) WGS84"
zip_code: "Code postal"
city_name: "Commune"
- created_at: "Créé le"
- updated_at: "Edité le"
waiting_time: Temps de desserte (minutes)
state: État
formtastic:
diff --git a/config/locales/vehicle_journeys.fr.yml b/config/locales/vehicle_journeys.fr.yml
index a43fa4580..a1eb5b3f7 100644
--- a/config/locales/vehicle_journeys.fr.yml
+++ b/config/locales/vehicle_journeys.fr.yml
@@ -122,7 +122,7 @@ fr:
object_version: "Version"
objectid: "Identifiant Neptune"
on_demand_fs: "Service à la demande"
- published_journey_identifier: "Identifiant public"
+ published_journey_identifier: "Numéro de train"
published_journey_name: "Nom public"
purchase_window: "Disponibilité commerciale"
regular_fs: "Service régulier"
diff --git a/db/migrate/20180307202627_add_confirmed_at_to_stop_areas.rb b/db/migrate/20180307202627_add_confirmed_at_to_stop_areas.rb
new file mode 100644
index 000000000..602d3afdc
--- /dev/null
+++ b/db/migrate/20180307202627_add_confirmed_at_to_stop_areas.rb
@@ -0,0 +1,5 @@
+class AddConfirmedAtToStopAreas < ActiveRecord::Migration
+ def change
+ add_column :stop_areas, :confirmed_at, :datetime
+ end
+end
diff --git a/db/migrate/20180308063549_update_stop_areas_confirmed_at_attribute.rb b/db/migrate/20180308063549_update_stop_areas_confirmed_at_attribute.rb
new file mode 100644
index 000000000..7bc0471f7
--- /dev/null
+++ b/db/migrate/20180308063549_update_stop_areas_confirmed_at_attribute.rb
@@ -0,0 +1,9 @@
+class UpdateStopAreasConfirmedAtAttribute < ActiveRecord::Migration
+ def up
+ Chouette::StopArea.where(deleted_at: nil).update_all(confirmed_at: Time.now)
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index cf0a32a3b..2f9ffa840 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -298,58 +298,18 @@ ActiveRecord::Schema.define(version: 20180308095116) do
add_index "custom_fields", ["resource_type"], name: "index_custom_fields_on_resource_type", using: :btree
- create_table "export_messages", id: :bigserial, force: :cascade do |t|
- t.string "criticity"
- t.string "message_key"
- t.hstore "message_attributes"
- t.integer "export_id", limit: 8
- t.integer "resource_id", limit: 8
- t.datetime "created_at"
- t.datetime "updated_at"
- t.hstore "resource_attributes"
- end
-
- add_index "export_messages", ["export_id"], name: "index_export_messages_on_export_id", using: :btree
- add_index "export_messages", ["resource_id"], name: "index_export_messages_on_resource_id", using: :btree
-
- create_table "export_resources", id: :bigserial, force: :cascade do |t|
- t.integer "export_id", limit: 8
- t.string "status"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "resource_type"
- t.string "reference"
- t.string "name"
- t.hstore "metrics"
- end
-
- add_index "export_resources", ["export_id"], name: "index_export_resources_on_export_id", using: :btree
-
create_table "exports", id: :bigserial, force: :cascade do |t|
+ t.integer "referential_id", limit: 8
t.string "status"
- t.string "current_step_id"
- t.float "current_step_progress"
- t.integer "workbench_id", limit: 8
- t.integer "referential_id", limit: 8
- t.string "name"
+ t.string "type"
+ t.string "options"
t.datetime "created_at"
t.datetime "updated_at"
- t.string "file"
- t.datetime "started_at"
- t.datetime "ended_at"
- t.string "token_upload"
- t.string "type"
- t.integer "parent_id", limit: 8
- t.string "parent_type"
- t.datetime "notified_parent_at"
- t.integer "current_step", default: 0
- t.integer "total_steps", default: 0
- t.string "creator"
- t.hstore "options"
+ t.string "references_type"
+ t.string "reference_ids"
end
add_index "exports", ["referential_id"], name: "index_exports_on_referential_id", using: :btree
- add_index "exports", ["workbench_id"], name: "index_exports_on_workbench_id", using: :btree
create_table "facilities", id: :bigserial, force: :cascade do |t|
t.integer "stop_area_id", limit: 8
@@ -460,9 +420,9 @@ ActiveRecord::Schema.define(version: 20180308095116) do
t.string "type"
t.integer "parent_id", limit: 8
t.string "parent_type"
- t.datetime "notified_parent_at"
t.integer "current_step", default: 0
t.integer "total_steps", default: 0
+ t.datetime "notified_parent_at"
t.string "creator"
end
@@ -805,7 +765,6 @@ ActiveRecord::Schema.define(version: 20180308095116) do
t.datetime "created_at"
t.datetime "updated_at"
t.string "objectid_format"
- t.string "registration_number_format"
end
create_table "stop_areas", id: :bigserial, force: :cascade do |t|
@@ -841,6 +800,7 @@ ActiveRecord::Schema.define(version: 20180308095116) do
t.integer "waiting_time"
t.string "kind"
t.jsonb "localized_names"
+ t.datetime "confirmed_at"
end
add_index "stop_areas", ["name"], name: "index_stop_areas_on_name", using: :btree
diff --git a/lib/model_attribute.rb b/lib/model_attribute.rb
index 872c00152..4880d2490 100644
--- a/lib/model_attribute.rb
+++ b/lib/model_attribute.rb
@@ -64,27 +64,16 @@ class ModelAttribute
# Chouette::Route
define :route, :name, :string
define :route, :published_name, :string
- define :route, :comment, :string
- define :route, :number, :string
- define :route, :direction, :string
define :route, :wayback, :string
# Chouette::JourneyPattern
define :journey_pattern, :name, :string
define :journey_pattern, :published_name, :string
- define :journey_pattern, :comment, :string
define :journey_pattern, :registration_number, :string
- define :journey_pattern, :section_status, :integer
# Chouette::VehicleJourney
- define :vehicle_journey, :comment, :string
- define :vehicle_journey, :status_value, :string
- define :vehicle_journey, :transport_mode, :string
- define :vehicle_journey, :facility, :string
define :vehicle_journey, :published_journey_name, :string
define :vehicle_journey, :published_journey_identifier, :string
- define :vehicle_journey, :vehicle_type_identifier, :string
- define :vehicle_journey, :number, :integer
define :vehicle_journey, :mobility_restricted_suitability, :boolean
define :vehicle_journey, :flexible_service, :boolean
@@ -92,13 +81,6 @@ class ModelAttribute
define :footnote, :code, :string
define :footnote, :label, :string
- # Chouette::TimeTable
- define :time_table, :version, :string
- define :time_table, :comment, :string
- define :time_table, :start_date, :date
- define :time_table, :end_date, :date
- define :time_table, :color, :string
-
# Chouette::RoutingConstraintZone
define :routing_constraint_zone, :name, :string
diff --git a/spec/controllers/referential_vehicle_journeys_controller_spec.rb b/spec/controllers/referential_vehicle_journeys_controller_spec.rb
index 50230dd9e..6bf4c7553 100644
--- a/spec/controllers/referential_vehicle_journeys_controller_spec.rb
+++ b/spec/controllers/referential_vehicle_journeys_controller_spec.rb
@@ -80,6 +80,18 @@ RSpec.describe ReferentialVehicleJourneysController, type: :controller do
expect(assigns[:vehicle_journeys]).to_not include(vehicle_journey_2)
end
end
+
+ context "with both stops one being unused" do
+ let(:from_area_id){ vehicle_journey_1.stop_areas.first.id }
+ let(:to_area_id){
+ stop_area = create :stop_area
+ create :stop_point, stop_area: stop_area, route: vehicle_journey_1.route
+ stop_area
+ }
+ it "should apply filters" do
+ expect(assigns[:vehicle_journeys]).to eq []
+ end
+ end
end
end
diff --git a/spec/features/stop_areas_spec.rb b/spec/features/stop_areas_spec.rb
index 668eb2fa3..02e853999 100644
--- a/spec/features/stop_areas_spec.rb
+++ b/spec/features/stop_areas_spec.rb
@@ -30,6 +30,46 @@ describe "StopAreas", :type => :feature do
expect(page).to have_content(stop_areas.first.name)
expect(page).not_to have_content(stop_areas.last.name)
end
+
+ context 'filtering by status' do
+ before do
+ stop_areas.first.activate!
+ stop_areas.last.deactivate!
+ end
+
+ describe 'updated stop areas in before block' do
+
+ it 'supports displaying only stop areas in creation' do
+ find("#q_status_in_creation").set(true)
+ click_button 'search-btn'
+ expect(page).not_to have_content(stop_areas.first.name)
+ expect(page).not_to have_content(stop_areas.last.name)
+ end
+
+ it 'supports displaying only confirmed stop areas' do
+ find("#q_status_confirmed").set(true)
+ click_button 'search-btn'
+ expect(page).to have_content(stop_areas.first.name)
+ expect(page).not_to have_content(stop_areas.last.name)
+ end
+
+ it 'supports displaying only deactivated stop areas' do
+ find("#q_status_deactivated").set(true)
+ click_button 'search-btn'
+ expect(page).not_to have_content(stop_areas.first.name)
+ expect(page).to have_content(stop_areas.last.name)
+ end
+
+ it 'should display all stop areas if all filters are checked' do
+ find("#q_status_in_creation").set(true)
+ find("#q_status_confirmed").set(true)
+ find("#q_status_deactivated").set(true)
+ click_button 'search-btn'
+ expect(page).to have_content(stop_areas.first.name)
+ expect(page).to have_content(stop_areas.last.name)
+ end
+ end
+ end
end
end
diff --git a/spec/lib/model_attribute_spec.rb b/spec/lib/model_attribute_spec.rb
index cdba87a90..6da740dcb 100644
--- a/spec/lib/model_attribute_spec.rb
+++ b/spec/lib/model_attribute_spec.rb
@@ -22,12 +22,10 @@ RSpec.describe ModelAttribute do
it "returns the list of classes of ModelAttributes in .all" do
ModelAttribute.define(:route, :name, :string)
ModelAttribute.define(:journey_pattern, :name, :string)
- ModelAttribute.define(:time_table, :start_date, :date)
expect(ModelAttribute.classes).to match_array([
'Route',
'JourneyPattern',
- 'TimeTable'
])
end
end
@@ -68,13 +66,13 @@ RSpec.describe ModelAttribute do
it "returns all ModelAttributes for a given class" do
ModelAttribute.define(:route, :name, :string)
ModelAttribute.define(:route, :published_name, :string)
- ModelAttribute.define(:route, :direction, :string)
+ ModelAttribute.define(:route, :wayback, :string)
ModelAttribute.define(:journey_pattern, :name, :string)
expect(ModelAttribute.methods_by_class(:route)).to match_array([
ModelAttribute.new(:route, :name, :string),
ModelAttribute.new(:route, :published_name, :string),
- ModelAttribute.new(:route, :direction, :string)
+ ModelAttribute.new(:route, :wayback, :string)
])
end
end
diff --git a/spec/models/merge_spec.rb b/spec/models/merge_spec.rb
index 92f8f74b1..95181a80e 100644
--- a/spec/models/merge_spec.rb
+++ b/spec/models/merge_spec.rb
@@ -20,6 +20,7 @@ RSpec.describe Merge do
metadatas: [referential_metadata]
factor = 1
+ stop_points_positions = {}
referential.switch do
line_referential.lines.each do |line|
@@ -30,12 +31,17 @@ RSpec.describe Merge do
end
referential.routes.each do |route|
+ route.stop_points.each do |sp|
+ sp.set_list_position 0
+ end
+ route.reload.update_checksum!
factor.times do
FactoryGirl.create :journey_pattern, route: route, stop_points: route.stop_points.sample(3)
end
end
referential.journey_patterns.each do |journey_pattern|
+ stop_points_positions[journey_pattern.name] = Hash[*journey_pattern.stop_points.map{|sp| [sp.stop_area_id, sp.position]}.flatten]
factor.times do
FactoryGirl.create :vehicle_journey, journey_pattern: journey_pattern, company: company
end
@@ -53,6 +59,18 @@ RSpec.describe Merge do
merge = Merge.create!(workbench: referential.workbench, referentials: [referential, referential])
merge.merge!
+
+ output = merge.output.current
+ output.switch
+
+ # Let's check stop_point positions are respected
+ # This should be enforced by the checksum preservation though
+ output.journey_patterns.each do |journey_pattern|
+ journey_pattern.stop_points.each do |sp|
+ expect(sp.position).to eq stop_points_positions[journey_pattern.name][sp.stop_area_id]
+ end
+ end
+
end
end
diff --git a/spec/models/simple_importer_spec.rb b/spec/models/simple_importer_spec.rb
index 8f4d7cfdd..6e8620d94 100644
--- a/spec/models/simple_importer_spec.rb
+++ b/spec/models/simple_importer_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
RSpec.describe SimpleImporter do
describe "#define" do
context "with an incomplete configuration" do
@@ -45,6 +46,7 @@ RSpec.describe SimpleImporter do
config.add_column :street_name
config.add_column :stop_area_referential, value: stop_area_referential
config.add_value :kind, :commercial
+ config.add_value :status, :confirmed
end
end
@@ -141,8 +143,8 @@ RSpec.describe SimpleImporter do
end
context "with a custom behaviour" do
- let!(:present){ create :stop_area, name: "Nom du Stop", stop_area_referential: stop_area_referential }
- let!(:missing){ create :stop_area, name: "Another", stop_area_referential: stop_area_referential }
+ let!(:present){ create :stop_area, name: "Nom du Stop", stop_area_referential: stop_area_referential, status: :confirmed }
+ let!(:missing){ create :stop_area, name: "Another", stop_area_referential: stop_area_referential, status: :confirmed }
before(:each){
importer.configure do |config|
config.before do |importer|
diff --git a/spec/models/workgroup_spec.rb b/spec/models/workgroup_spec.rb
index ac8d3fc98..97fff3d86 100644
--- a/spec/models/workgroup_spec.rb
+++ b/spec/models/workgroup_spec.rb
@@ -6,6 +6,8 @@ RSpec.describe Workgroup, type: :model do
it{ should have_many(:workbenches) }
it{ should validate_uniqueness_of(:name) }
+ it{ should validate_uniqueness_of(:stop_area_referential_id) }
+ it{ should validate_uniqueness_of(:line_referential_id) }
it 'is not valid without a stop_area_referential' do
workgroup.stop_area_referential_id = nil