diff options
Diffstat (limited to 'app')
257 files changed, 2548 insertions, 3615 deletions
diff --git a/app/assets/fonts/sBoiv/sboiv.eot b/app/assets/fonts/sBoiv/sboiv.eot Binary files differindex 0bc305533..7bf5449a2 100644 --- a/app/assets/fonts/sBoiv/sboiv.eot +++ b/app/assets/fonts/sBoiv/sboiv.eot diff --git a/app/assets/fonts/sBoiv/sboiv.svg b/app/assets/fonts/sBoiv/sboiv.svg index 018422b09..42e8988cb 100644 --- a/app/assets/fonts/sBoiv/sboiv.svg +++ b/app/assets/fonts/sBoiv/sboiv.svg @@ -11,4 +11,31 @@ <glyph unicode="" glyph-name="preparing" d="M1011.173 614.391l-80.38 80.38c-7.765 8.206-18.731 13.312-30.889 13.312-0.12 0-0.239 0-0.359-0.001-0.129 0.002-0.303 0.003-0.478 0.003-11.951 0-22.708-5.119-30.194-13.284l-56.856-56.347 142.328-142.84 56.829 54.781c7.9 7.644 12.802 18.341 12.802 30.183 0 0.188-0.001 0.376-0.004 0.563 0.035 0.625 0.055 1.389 0.055 2.159 0 12.137-4.911 23.128-12.854 31.092zM504.32 330.758v-142.84h142.84l285.17 285.681-142.328 142.328zM805.872 544.251l-185.847-185.847c-0.834-0.338-1.802-0.535-2.816-0.535s-1.982 0.196-2.868 0.553c-0.285-0.079-0.672-0.113-1.067-0.113-3.676 0-6.656 2.98-6.656 6.656 0 0.395 0.034 0.782 0.1 1.159-0.322 0.797-0.505 1.765-0.505 2.776s0.183 1.979 0.518 2.873l188.387 183.741c0.834 0.338 1.802 0.535 2.816 0.535s1.982-0.196 2.868-0.553c0.285 0.079 0.672 0.113 1.067 0.113 3.676 0 6.656-2.98 6.656-6.656 0-0.395-0.034-0.782-0.1-1.159-0.528-1.405-1.409-2.616-2.539-3.532zM592.38 231.948v44.030h-44.030v36.862l31.23 31.23 80.38-80.38-31.23-31.23zM0.028 239.627h416.234v-51.197h-416.234v51.197z" /> <glyph unicode="" glyph-name="current-ref" d="M530.92 258.291l-70.054 71.588c-17.993 18.204-42.963 29.478-70.566 29.478s-52.573-11.274-70.557-29.468l-30.178 30.159c18.419 18.312 29.902 43.583 30.169 71.537-0.795 26.578-11.995 50.343-29.636 67.527l-70.586 71.609c-17.861 17.868-42.538 28.92-69.798 28.92s-51.937-11.052-69.798-28.92l-51.134-51.134c-17.868-17.861-28.92-42.538-28.92-69.798s11.052-51.937 28.92-69.798l74.145-69.543c17.993-18.204 42.963-29.478 70.566-29.478s52.573 11.274 70.557 29.468l30.178-30.159c-18.419-18.312-29.902-43.583-30.169-71.537-0.004-0.365-0.006-0.734-0.006-1.105 0-25.692 9.92-49.067 26.139-66.504l70.511-71.528c17.835-17.716 42.411-28.665 69.543-28.665s51.708 10.949 69.549 28.67l51.128 51.129c17.992 17.803 29.134 42.5 29.134 69.798s-11.142 51.995-29.126 69.791zM241.499 405.047c-11.25 11.25-20.965 24.545-38.351 24.545-18.074 0-32.726-14.652-32.726-32.726 0-17.386 13.295-27.101 24.545-38.351-5.924-6.606-14.486-10.742-24.015-10.742-0.186 0-0.372 0.002-0.557 0.005-0.198-0.006-0.464-0.009-0.731-0.009-8.851 0-16.88 3.513-22.771 9.221l-71.068 71.58c-5.845 5.909-9.456 14.038-9.456 23.010s3.61 17.101 9.459 23.013l51.131 51.131c6.103 5.703 14.326 9.204 23.366 9.204 0.055 0 0.11 0 0.164 0 0.003 0 0.017 0 0.031 0 9.168 0 17.47-3.712 23.483-9.716l69.543-72.1c6.338-6.063 10.278-14.588 10.278-24.033s-3.94-17.97-10.266-24.021zM493.592 188.748c-0.074-9.007-3.775-17.135-9.713-23.007l-51.137-51.137c-5.96-5.4-13.905-8.705-22.623-8.705-0.317 0-0.631 0.004-0.946 0.013-0.18-0.007-0.446-0.010-0.713-0.010-8.851 0-16.88 3.513-22.771 9.221l-69.022 72.092c-6.338 6.063-10.278 14.588-10.278 24.033s3.94 17.97 10.266 24.021c11.262-11.238 20.977-24.533 38.363-24.533 0.611-0.041 1.326-0.064 2.045-0.064 18.074 0 32.726 14.652 32.726 32.726 0 0.023 0 0.045 0 0.068 0 17.382-13.295 27.097-24.545 38.347 5.712 7.509 14.519 12.409 24.486 12.782 0.070 0.002 0.084 0.002 0.098 0.002 9.168 0 17.47-3.712 23.483-9.716l71.077-71.077c5.998-5.856 9.719-14.023 9.719-23.059 0-0.163-0.001-0.325-0.004-0.487zM1013.117 794.18l-51.134 51.134c-6.502 6.632-15.554 10.743-25.567 10.743s-19.066-4.111-25.561-10.737l-245.451-243.917-107.894 108.405c-6.502 6.632-15.554 10.743-25.567 10.743s-19.066-4.111-25.561-10.737l-51.14-51.14c-6.632-6.502-10.743-15.554-10.743-25.567s4.111-19.066 10.737-25.561l135.512-133.978 51.134-51.134c6.502-6.632 15.554-10.743 25.567-10.743s19.066 4.111 25.561 10.737l51.14 51.14 268.967 269.99c6.632 6.502 10.743 15.554 10.743 25.567s-4.111 19.066-10.737 25.561z" /> <glyph unicode="" glyph-name="chrono" horiz-adv-x="931" d="M440.957-64c243.751 0 440.957 196.267 440.957 438.857 0 225.524-171.483 412.038-391.962 436.419v51.2h73.493v97.524h-244.976v-97.524h73.493v-51.2c-220.478-24.381-391.962-209.676-391.962-436.419 0-242.59 197.206-438.857 440.957-438.857zM756.974 864.917l-71.043-70.705c71.043-41.448 131.062-101.181 172.708-171.886l71.055 70.705c-44.108 69.486-104.115 128-172.72 171.886z" /> +<glyph unicode="" glyph-name="ZDLR" d="M510.771 898.56c248.837 0 450.56-201.723 450.56-450.56s-201.723-450.56-450.56-450.56c-248.837 0-450.56 201.723-450.56 450.56v0c0 248.837 201.723 450.56 450.56 450.56v0zM510.771 929.28c-265.804 0-481.28-215.476-481.28-481.28s215.476-481.28 481.28-481.28c265.804 0 481.28 215.476 481.28 481.28v0c-0.349 265.663-215.617 480.931-481.246 481.28h-0.034zM553.984 778.547c-12.888 4.792-27.778 7.565-43.315 7.565s-30.427-2.773-44.201-7.85l0.886 0.286c-164.787-22.179-290.509-161.908-290.509-331.002 0-184.366 149.458-333.824 333.824-333.824s333.824 149.458 333.824 333.824c0 169.093-125.722 308.823-288.79 330.812l-1.718 0.19zM410.624 655.667c-0.065 1.347-0.102 2.926-0.102 4.514 0 54.97 44.562 99.533 99.533 99.533s99.533-44.562 99.533-99.533c0-1.588-0.037-3.166-0.111-4.736l0.008 0.222c-0.119-4.799-0.561-9.394-1.308-13.886l0.079 0.574c0-2.662 0-5.12-1.229-7.578-8.335-37.442-36.943-66.529-73.458-75.431l-0.68-0.14v-125.952c0-12.668-10.27-22.938-22.938-22.938s-22.938 10.27-22.938 22.938v126.157c-37.195 9.042-65.803 38.129-74.014 74.909l-0.124 0.662c0 2.458 0 5.12-1.229 7.578-0.667 3.917-1.109 8.512-1.226 13.188l-0.002 0.124zM510.157 379.597c29.634 0 53.658 24.023 53.658 53.658v20.48c27.443-10.445 45.875-28.058 45.875-48.742 0-32.154-44.442-58.368-99.533-58.368s-98.918 27.443-98.918 60.416c0 20.48 18.432 38.298 45.875 48.742v-20.48c-0.016-0.488-0.025-1.062-0.025-1.638 0-29.634 24.023-53.658 53.658-53.658 0.009 0 0.018 0 0.026 0h-0.001zM510.157 236.237c-0.112 0-0.244 0-0.377 0-116.275 0-210.534 94.259-210.534 210.534 0 69.683 33.854 131.459 86.012 169.779l0.586 0.41c11.324-36.013 36.951-64.648 70.051-79.746l0.81-0.331v-50.381l-4.71-1.638c-44.237-14.95-70.861-44.646-70.861-79.462 0-50.79 55.91-89.088 130.253-89.088s130.253 38.298 130.253 89.088c0 34.611-26.419 64.307-70.861 79.462l-4.71 1.638v51.2c33.079 15.862 57.944 44.403 68.572 79.16l0.241 0.917c52.743-38.73 86.597-100.506 86.597-170.189 0-116.275-94.259-210.534-210.534-210.534-0.060 0-0.12 0-0.181 0h0.009z" /> +<glyph unicode="" glyph-name="ZDER" d="M510.771 898.56c248.837 0 450.56-201.723 450.56-450.56s-201.723-450.56-450.56-450.56c-248.837 0-450.56 201.723-450.56 450.56v0c0 248.837 201.723 450.56 450.56 450.56v0zM510.771 929.28c-265.804 0-481.28-215.476-481.28-481.28s215.476-481.28 481.28-481.28c265.804 0 481.28 215.476 481.28 481.28v0c-0.349 265.663-215.617 480.931-481.246 481.28h-0.034zM610.099 656.077c0 0.088 0 0.191 0 0.295 0 54.97-44.562 99.533-99.533 99.533s-99.533-44.562-99.533-99.533c0-46.684 32.14-85.862 75.501-96.612l0.684-0.144v-125.952c0-12.668 10.27-22.938 22.938-22.938s22.938 10.27 22.938 22.938v125.747c44.403 10.501 76.946 49.775 77.005 96.659v0.007zM614.4 732.672c8.961-12.008 15.986-26.074 20.264-41.289l0.216-0.9c89.003-46.035 148.787-137.4 148.787-242.728 0-150.434-121.95-272.384-272.384-272.384s-272.384 121.95-272.384 272.384c0 105.328 59.784 196.693 147.27 242.013l1.518 0.715c4.494 16.115 11.519 30.18 20.721 42.527l-0.241-0.338c-118.013-43.249-200.704-154.609-200.704-285.283 0-167.4 135.704-303.104 303.104-303.104s303.104 135.704 303.104 303.104c0 130.674-82.691 242.034-198.601 284.607l-2.103 0.676zM570.163 485.478l-4.71 1.638h-2.662v-31.539c28.467-10.24 47.514-28.467 47.514-49.357 0-32.154-44.442-58.368-99.533-58.368s-99.533 26.010-99.533 59.187c0 20.48 19.251 39.117 47.514 49.357v30.72h-2.662l-4.71-1.638c-44.237-14.95-70.861-44.646-70.861-79.462 0-50.79 55.91-89.088 130.253-89.088s130.253 38.298 130.253 89.088c-0.205 34.816-26.624 64.512-70.861 79.462z" /> +<glyph unicode="" glyph-name="ZDEP" d="M510.771 898.56c248.837 0 450.56-201.723 450.56-450.56s-201.723-450.56-450.56-450.56c-248.837 0-450.56 201.723-450.56 450.56v0c0 248.837 201.723 450.56 450.56 450.56v0zM510.771 929.28c-265.804 0-481.28-215.476-481.28-481.28s215.476-481.28 481.28-481.28c265.804 0 481.28 215.476 481.28 481.28v0c-0.349 265.663-215.617 480.931-481.246 481.28h-0.034zM616.653 731.443c-23.824 33.267-62.351 54.688-105.882 54.688s-82.057-21.421-105.615-54.297l-0.266-0.391c-116.172-44.199-197.222-154.639-197.222-284.009 0-167.4 135.704-303.104 303.104-303.104s303.104 135.704 303.104 303.104c0 129.37-81.050 239.81-195.142 283.312l-2.080 0.697zM545.587 748.851v0c5.438-2.071 10.025-4.275 14.399-6.806l-0.473 0.253 2.048-1.024c4.507-2.73 8.386-5.5 12.043-8.529l-0.164 0.132 2.048-1.638c3.771-3.26 7.185-6.674 10.338-10.319l0.106-0.126 1.024-1.434c3.219-3.804 6.26-8.019 8.965-12.46l0.251-0.443c9.009-14.585 14.347-32.266 14.347-51.194 0-46.344-32.002-85.213-75.113-95.714l-0.674-0.139v-125.952c0-12.668-10.27-22.938-22.938-22.938s-22.938 10.27-22.938 22.938v0 125.952c-43.785 10.64-75.787 49.509-75.787 95.853 0 18.928 5.338 36.609 14.591 51.619l-0.244-0.425c2.956 4.884 5.997 9.098 9.338 13.051l-0.122-0.148 1.024 1.229c3.26 3.771 6.674 7.185 10.319 10.338l0.126 0.106 2.048 1.638c3.492 2.896 7.371 5.666 11.443 8.15l0.435 0.247 2.048 1.024c13.841 8.242 30.52 13.114 48.337 13.114 12.527 0 24.492-2.409 35.457-6.788l-0.645 0.227zM510.976 175.411c-0.337-0.002-0.735-0.002-1.133-0.002-150.32 0-272.179 121.859-272.179 272.179 0 104.729 59.15 195.643 145.866 241.157l1.494 0.714c-2.847-10.119-4.483-21.74-4.483-33.742 0-52.303 31.072-97.348 75.763-117.684l0.81-0.33v-52.224l-4.506-1.638c-43.622-14.746-69.632-43.827-69.632-77.619 0-49.766 55.296-87.245 128.41-87.245s128.41 37.478 128.41 87.245c0 33.792-26.010 62.874-69.632 77.619l-4.506 1.638v52.224c45.501 20.666 76.573 65.712 76.573 118.014 0 12.003-1.636 23.623-4.698 34.651l0.215-0.908c87.994-46.294 146.97-137.094 146.97-241.67 0-150.32-121.859-272.179-272.179-272.179-0.621 0-1.242 0.002-1.863 0.006l0.095-0.001z" /> +<glyph unicode="" 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="" 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="" 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="" 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="" 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="" 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="" 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" /> +<glyph unicode="" glyph-name="OAT" d="M1018.061 298.701l-125.952 125.952c-4.509 4.641-10.809 7.52-17.781 7.52-0.951 0-1.889-0.054-2.812-0.158l0.113 0.010c-14.131-2.048-20.48-14.336-28.467-28.672-5.72-11.506-12.549-21.411-20.572-30.208l0.092 0.102c-7.913-8.859-19.369-14.409-32.122-14.409-11.342 0-21.659 4.391-29.343 11.565l0.025-0.023c-6.865 7.041-11.1 16.675-11.1 27.298 0 0.627 0.015 1.251 0.044 1.871l-0.003-0.088c0.459 12.391 5.7 23.475 13.919 31.532l0.008 0.007c8.702 7.913 18.604 14.741 29.35 20.136l0.756 0.344c14.131 7.782 26.419 14.336 28.672 28.672 0.094 0.81 0.147 1.748 0.147 2.699 0 6.972-2.88 13.272-7.514 17.775l-0.006 0.006-124.928 125.542-111.821 111.821c14.183 7.172 26.383 15.775 37.153 25.883l-0.084-0.078c15.895 15.301 25.768 36.761 25.768 60.526 0 22.438-8.801 42.82-23.139 57.883l0.033-0.035c-14.404 14.341-34.269 23.206-56.205 23.206-1.121 0-2.236-0.023-3.346-0.069l0.159 0.005c-23.237-0.826-44.038-10.617-59.176-25.998l-0.011-0.011c-9.978-10.676-18.518-22.879-25.195-36.178l-0.405-0.89-111.616 111.616c-3.702 3.68-8.804 5.955-14.438 5.955s-10.737-2.275-14.439-5.956l-327.679-327.679c-3.68-3.702-5.955-8.804-5.955-14.438s2.275-10.737 5.956-14.439l655.359-655.359c3.702-3.68 8.804-5.955 14.438-5.955s10.737 2.275 14.439 5.956l327.679 327.679c3.68 3.702 5.955 8.804 5.955 14.438s-2.275 10.737-5.956 14.439l0.001-0.001zM348.16 910.438l111.206-111.206c4.509-4.641 10.809-7.52 17.781-7.52 0.951 0 1.889 0.054 2.812 0.158l-0.113-0.010c14.131 2.048 20.48 14.336 28.262 28.467 5.72 11.429 12.548 21.266 20.565 29.994l-0.085-0.093c8.064 8.227 19.148 13.467 31.455 13.924l0.084 0.002c0.556 0.028 1.208 0.045 1.863 0.045 10.599 0 20.208-4.237 27.225-11.11l-0.007 0.007c7.207-7.672 11.635-18.028 11.635-29.418 0-12.7-5.505-24.114-14.258-31.987l-0.039-0.035c-8.697-7.926-18.601-14.754-29.353-20.139l-0.752-0.341c-14.131-7.578-26.419-14.131-28.467-28.467-0.094-0.81-0.147-1.748-0.147-2.699 0-6.972 2.88-13.272 7.514-17.775l0.006-0.006 111.821-110.387-96.87-96.87c-7.241 14.336-15.911 26.669-26.095 37.57l0.085-0.092c-15.175 15.317-35.976 25.037-59.045 25.801l-0.142 0.004c-0.677 0.020-1.474 0.032-2.274 0.032-5.059 0-10.011-0.459-14.816-1.336l0.502 0.076c-2.048 0-3.891-1.229-5.939-1.638-3.827-0.81-7.052-1.728-10.186-2.835l0.561 0.173c-3.196-1.418-5.817-2.787-8.346-4.294l0.359 0.198c-2.048-1.229-4.506-2.048-6.349-3.277-2.516-1.849-4.719-3.661-6.819-5.584l0.060 0.055c-1.843-1.638-4.096-2.867-5.734-4.71v0c-14.096-14.361-22.797-34.060-22.797-55.791 0-1.122 0.023-2.239 0.069-3.351l-0.005 0.159c0.826-23.237 10.617-44.038 25.998-59.176l0.011-0.011c10.804-10.035 23.139-18.642 36.569-25.391l0.91-0.414-98.714-98.304-298.803 299.008zM675.84-14.438l-298.394 298.598 110.797 110.797c4.641 4.509 7.52 10.809 7.52 17.781 0 0.951-0.054 1.889-0.158 2.812l0.010-0.113c-2.048 14.336-14.541 20.48-28.672 28.467-11.504 5.728-21.408 12.557-30.21 20.574l0.104-0.094c-8.859 7.913-14.409 19.369-14.409 32.122 0 11.342 4.391 21.659 11.565 29.343l-0.023-0.025c7.305 6.857 17.163 11.069 28.004 11.069 0.307 0 0.613-0.003 0.918-0.010l-0.046 0.001c12.391-0.459 23.475-5.7 31.532-13.919l0.007-0.008c7.901-8.707 14.727-18.607 20.133-29.346l0.347-0.76c7.782-14.336 14.541-26.624 28.672-28.672 0.787-0.088 1.698-0.138 2.622-0.138 6.995 0 13.318 2.874 17.854 7.506l0.004 0.004 111.821 111.206 96.87-96.87c-14.259-7.241-26.525-15.91-37.357-26.087l0.083 0.078c-15.317-15.175-25.037-35.976-25.801-59.045l-0.004-0.142c-0.036-0.892-0.056-1.938-0.056-2.99 0-21.932 8.862-41.794 23.202-56.201l-0.003 0.003c14.978-14.069 35.195-22.713 57.432-22.713 23.873 0 45.419 9.963 60.708 25.958l0.030 0.032c10.045 10.74 18.65 23.009 25.395 36.377l0.41 0.896 97.894-97.894z" /> +<glyph unicode="" glyph-name="OAS" d="M1024 786.944v0c0.102 0.769 0.161 1.658 0.161 2.56s-0.058 1.791-0.172 2.663l0.011-0.103v1.638c-0.543 1.416-1.163 2.631-1.892 3.768l0.049-0.082v1.434c-1.188 1.483-2.535 2.766-4.036 3.85l-0.060 0.041c-1.702 1.208-3.676 2.186-5.794 2.829l-0.145 0.038-493.978 154.419c-1.807 0.578-3.885 0.911-6.042 0.911s-4.235-0.333-6.187-0.951l0.145 0.040-491.725-153.395c-1.951-0.631-3.647-1.465-5.193-2.504l0.073 0.046c-1.565-1.182-2.914-2.531-4.059-4.044l-0.037-0.052v-1.434c-0.753-1.063-1.438-2.275-1.997-3.554l-0.051-0.132v-1.638c-1.23-1.529-2.265-3.288-3.023-5.187l-0.049-0.138v-663.552c0-0.016 0-0.034 0-0.053 0-8.965 5.761-16.585 13.783-19.36l0.144-0.043 491.52-166.912c1.9-0.991 4.11-1.71 6.446-2.036l0.108-0.012c2.979 0.046 5.789 0.72 8.318 1.896l-0.126-0.053 489.882 166.093c8.166 2.818 13.926 10.438 13.926 19.403 0 0.019 0 0.037 0 0.056v-0.003 663.347zM512 919.040l425.165-133.12-110.182-37.069c-10.612-3.423-19.141-10.752-24.059-20.252l-0.108-0.228c-9.421-19.251-1.434-40.96 7.578-66.97 6.735-15.859 11.518-34.244 13.452-53.47l0.065-0.802c0.266-2.661 0.418-5.752 0.418-8.878 0-21.818-7.401-41.908-19.829-57.895l0.159 0.213c-7.007-7.22-16.801-11.701-27.642-11.701-0.506 0-1.010 0.010-1.512 0.029l0.072-0.002c-35.021 0-37.683 46.694-37.683 61.44 1.205 23.344 6.059 45.208 14.006 65.522l-0.489-1.419c7.578 22.733 13.312 40.96 0 53.453-5.866 4.359-13.251 6.978-21.248 6.978-6.247 0-12.122-1.598-17.236-4.409l0.186 0.094-201.114-68.813-130.867 44.442c43.622 11.674 95.232 27.034 95.232 71.066 0 35.84-31.949 59.187-81.92 59.187-37.951-2.214-72.007-17.288-98.246-40.885l0.146 0.13c-9.306-7.308-19.766-14.104-30.815-19.935l-1.134-0.545c-33.587-15.77-40.96-16.179-55.501-11.264l-73.318 25.6-48.742 16.589zM40.96 758.477l53.248-18.022 67.584-23.142 33.792-11.469c30.515-10.445 50.586-3.686 86.221 12.902 14.766 7.506 27.447 15.604 39.25 24.777l-0.543-0.406c19.79 18.314 45.69 30.283 74.321 32.536l0.431 0.027c1.638 0 40.96 0 40.96-18.227 0-14.131-45.056-26.214-69.222-32.563-22.672-4.119-42.85-12.348-60.638-23.938l0.631 0.386c-4.426-3.78-7.214-9.366-7.214-15.602 0-8.982 5.782-16.614 13.828-19.375l0.144-0.043 178.79-61.44v-209.306c-19.852 15.013-44.473 24.719-71.254 26.6l-0.426 0.024c-0.391 0.005-0.853 0.008-1.315 0.008-30.197 0-57.643-11.775-77.998-30.984l0.055 0.052c-15.44-15.359-24.996-36.622-24.996-60.116 0-0.466 0.004-0.931 0.011-1.394l-0.001 0.070c0-59.392 31.744-92.774 96.051-102.4 5.251-0.664 11.326-1.042 17.49-1.042 20.21 0 39.47 4.072 57.002 11.439l-0.97-0.362 5.939 2.048c0-2.253 0-4.915 0-8.602v0-245.76l-451.174 152.986zM983.040 138.138l-450.56-152.781v245.76c0.365 2.33 0.574 5.017 0.574 7.753 0 14.99-6.266 28.516-16.323 38.103l-0.021 0.020c-6.503 3.629-14.266 5.765-22.528 5.765s-16.025-2.136-22.767-5.887l0.239 0.122c-12.684-5.532-27.462-8.751-42.992-8.751-3.901 0-7.754 0.203-11.55 0.599l0.474-0.040c-50.586 7.373-61.44 29.286-61.44 61.44-0.011 0.359-0.017 0.782-0.017 1.206 0 11.965 4.773 22.816 12.518 30.752l-0.009-0.009c12.913 11.815 30.184 19.054 49.146 19.054 0.362 0 0.724-0.003 1.085-0.008l-0.055 0.001c22.378-3.426 42.162-12.605 58.367-25.968l-0.204 0.164c15.565-10.65 28.058-19.251 41.984-11.674 8.068 3.912 13.533 12.040 13.533 21.444 0 0.309-0.006 0.617-0.018 0.923l0.001-0.044v239.411l181.043 61.44c-8.811-22.683-14.422-48.919-15.549-76.312l-0.016-0.488c0-61.44 30.925-102.4 78.643-102.4 0.442-0.009 0.964-0.014 1.487-0.014 22.29 0 42.436 9.177 56.866 23.96l0.015 0.016c19.402 22.74 31.206 52.475 31.206 84.968 0 3.974-0.177 7.906-0.522 11.79l0.036-0.502c-1.983 24.524-7.67 47.199-16.517 68.217l0.543-1.452c-4.748 10.183-7.9 22.025-8.788 34.493l-0.018 0.323 142.131 48.538z" /> +<glyph unicode="" glyph-name="modele-calendrier" d="M190.464 803.738h43.213v-40.96h-43.213v40.96zM93.389 628.224h40.96v-61.44h-40.96v61.44zM93.389 730.624h40.96v-61.44h-40.96v61.44zM134.349 474.214v51.61h-40.96v-61.44h40.96v9.83zM93.389 116.224h40.96v-61.44h-40.96v61.44zM93.389 218.624h40.96v-61.44h-40.96v61.44zM93.389 423.424h40.96v-61.44h-40.96v61.44zM93.389 321.024h40.96v-61.44h-40.96v61.44zM276.48-8.909h61.44v-40.96h-61.44v40.96zM174.080-8.909h61.44v-40.96h-61.44v40.96zM378.88-8.909h61.44v-40.96h-61.44v40.96zM481.28-8.909h61.44v-40.96h-61.44v40.96zM583.68-8.909h61.44v-40.96h-61.44v40.96zM686.080-8.909h61.44v-40.96h-61.44v40.96zM788.48-8.909h61.44v-40.96h-61.44v40.96zM889.651 218.624h40.96v-61.44h-40.96v61.44zM889.651 116.224h40.96v-61.44h-40.96v61.44zM889.651 423.424h40.96v-61.44h-40.96v61.44zM889.651 321.024h40.96v-61.44h-40.96v61.44zM889.651 730.624h40.96v-61.44h-40.96v61.44zM889.651 525.005v-60.621h40.96v61.44h-40.96v-0.819zM889.651 628.224h40.96v-61.44h-40.96v61.44zM481.28 494.694h61.44v-40.96h-61.44v40.96zM174.080 494.694h61.44v-40.96h-61.44v40.96zM276.48 494.694h61.44v-40.96h-61.44v40.96zM686.080 494.694h61.44v-40.96h-61.44v40.96zM788.48 494.694h61.44v-40.96h-61.44v40.96zM583.68 494.694h61.44v-40.96h-61.44v40.96zM378.88 494.694h61.44v-40.96h-61.44v40.96zM710.246 743.526h40.96v-61.44h-40.96v61.44zM710.246 845.926h40.96v-61.44h-40.96v61.44zM313.754 682.086h-40.96v61.44h40.96zM313.754 784.486h-40.96v61.44h40.96zM136.192 750.899c3.97 6.299 10.504 10.672 18.101 11.66l0.127 0.013-4.915 40.96c-21.267-2.501-39.179-14.926-49.189-32.448l-0.168-0.32zM481.28 803.738h61.44v-40.96h-61.44v40.96zM378.88 803.738h61.44v-40.96h-61.44v40.96zM583.68 803.738h61.44v-40.96h-61.44v40.96zM790.323 803.738h43.213v-40.96h-43.213v40.96zM887.808 750.899c-3.97 6.299-10.504 10.672-18.101 11.66l-0.127 0.013 4.915 40.96c21.267-2.501 39.179-14.926 49.189-32.448l0.168-0.32zM710.246 948.326h40.96v-61.44h-40.96v61.44zM272.794 948.326h40.96v-61.44h-40.96v61.44zM143.36-4.403c-4.788 3.295-8.076 8.474-8.797 14.443l-0.010 0.098v3.686h-40.96c-0.057-0.963-0.089-2.090-0.089-3.224 0-20.354 10.455-38.266 26.288-48.659l0.22-0.136zM880.64-4.403c4.788 3.295 8.076 8.474 8.797 14.443l0.010 0.098v3.686h40.96c0.057-0.963 0.089-2.090 0.089-3.224 0-20.354-10.455-38.266-26.288-48.659l-0.22-0.136z" /> +<glyph unicode="" glyph-name="mission" d="M344.883 737.792l-17.203-59.392 62.874-17.408c-55.891-35.521-104.315-75.352-147.391-120.344l-0.269-0.283 43.827-42.803c41.083 43.148 87.186 80.915 137.535 112.545l2.958 1.734-20.48-71.68 59.187-16.384 46.49 168.141zM592.896 6.656c0-39.588-32.092-71.68-71.68-71.68s-71.68 32.092-71.68 71.68c0 39.588 32.092 71.68 71.68 71.68s71.68-32.092 71.68-71.68zM521.216 78.336c-39.588 0-71.68-32.092-71.68-71.68s32.092-71.68 71.68-71.68c39.588 0 71.68 32.092 71.68 71.68v0c0 39.588-32.092 71.68-71.68 71.68v0zM333.619 25.702c-28.662 12.576-53.144 26.267-76.132 41.983l1.585-1.023 23.347 33.587c19.57-13.754 41.889-26.542 65.367-37.227l2.627-1.070zM73.728 341.504c-5.080 25.685-7.988 55.216-7.988 85.426 0 0.208 0 0.415 0 0.623v-0.032h40.96c0.036-27.474 2.718-54.298 7.804-80.262l-0.431 2.643zM232.858 192.819c0-39.588-32.092-71.68-71.68-71.68s-71.68 32.092-71.68 71.68c0 39.588 32.092 71.68 71.68 71.68s71.68-32.092 71.68-71.68zM161.178 263.68c-39.588 0-71.68-32.092-71.68-71.68s32.092-71.68 71.68-71.68c39.588 0 71.68 32.092 71.68 71.68v0c0 39.588-32.092 71.68-71.68 71.68v0zM952.934 287.437c18.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.037 82.835-167.769 140.329-278.759 158.166l-2.636 0.349c-2.074 9.484-5.766 17.855-10.808 25.23l0.158-0.245c-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-34.154-0.253-62.606-24.354-69.546-56.462l-0.086-0.472c-138.318-22.577-254.211-103.458-323.454-216.094l-1.154-2.018c-3.814 0.759-8.199 1.194-12.686 1.194-9.858 0-19.226-2.098-27.682-5.872l0.432 0.172c-25.827-11.283-43.549-36.604-43.549-66.064 0-39.701 32.184-71.885 71.885-71.885s71.885 32.184 71.885 71.885c0 20.509-8.589 39.013-22.366 52.109l-0.031 0.029c63.709 102.142 167.215 174.376 288.298 195.225l2.518 0.359s0-1.434 0-2.048c11.145-25.94 36.456-43.784 65.94-43.827h0.006c0.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.238-16.67 188.38-67.553 251.039-140.158l0.455-0.54c-9.753-12.040-15.657-27.544-15.657-44.428 0-9.991 2.068-19.5 5.799-28.121l-0.177 0.459c11.185-25.907 36.512-43.709 65.997-43.709 4.836 0 9.56 0.479 14.127 1.392l-0.457-0.076c19.767-46.851 31.254-101.32 31.254-158.471 0-51.163-9.205-100.175-26.050-145.472l0.94 2.886c-1.286 0.083-2.788 0.131-4.301 0.131s-3.015-0.048-4.505-0.141l0.204 0.010c-0.367 0.007-0.799 0.010-1.233 0.010-40.606 0-73.523-32.917-73.523-73.523s32.917-73.523 73.523-73.523c40.606 0 73.523 32.917 73.523 73.523 0 22.44-10.053 42.532-25.902 56.018l-0.104 0.086z" /> +<glyph unicode="" glyph-name="ligne_commerciale" d="M921.6 960h-819.2c-56.554 0-102.4-45.846-102.4-102.4v0-819.2c0-56.554 45.846-102.4 102.4-102.4v0h819.2c56.554 0 102.4 45.846 102.4 102.4v0 819.2c0 56.554-45.846 102.4-102.4 102.4v0zM565.453 278.221c47.452 1.66 92.195 11.209 133.631 27.368l-2.764-0.949v-90.931c-40.084-16.608-86.635-26.253-135.439-26.253-1.849 0-3.695 0.014-5.537 0.041l0.278-0.003q-111.616 0-170.803 67.789t-59.597 194.765c-0.049 2.078-0.077 4.526-0.077 6.981 0 48.212 10.748 93.913 29.978 134.839l-0.82-1.941c18.41 38.818 47.109 70.217 82.601 91.425l0.958 0.53c35.125 20.385 77.29 32.416 122.265 32.416 1.873 0 3.741-0.021 5.603-0.062l-0.278 0.005c54.657-0.612 106.081-13.859 151.675-36.948l-1.966 0.903-35.021-88.269c-15.061 7.462-34.135 15.484-53.693 22.488l-4.060 1.269c-16.98 6.327-36.596 10.066-57.063 10.239l-0.076 0.001c-1.246 0.050-2.709 0.079-4.178 0.079-36.983 0-69.726-18.153-89.805-46.036l-0.225-0.328c-21.292-32.696-33.954-72.707-33.954-115.675 0-4.408 0.133-8.785 0.396-13.127l-0.029 0.597q-0.614-171.213 128-171.213z" /> +<glyph unicode="" glyph-name="ligne_administrative" d="M921.6 960h-819.2c-56.554 0-102.4-45.846-102.4-102.4v0-819.2c0-56.554 45.846-102.4 102.4-102.4v0h819.2c56.554 0 102.4 45.846 102.4 102.4v0 819.2c0 56.554-45.846 102.4-102.4 102.4v0zM102.4-23.040c-33.932 0-61.44 27.508-61.44 61.44v0 819.2c0 33.932 27.508 61.44 61.44 61.44v0h819.2c33.932 0 61.44-27.508 61.44-61.44v0-819.2c0-33.932-27.508-61.44-61.44-61.44v0zM642.458 194.867l-37.069 121.856h-186.573l-37.069-121.856h-116.941l180.634 513.843h132.71l181.248-513.843zM579.379 407.040q-51.405 165.478-57.958 187.187t-9.421 35.021q-11.264-44.851-65.946-222.208z" /> +<glyph unicode="" glyph-name="LDA" d="M510.771-64c-282.77 0-512 229.23-512 512s229.23 512 512 512c282.77 0 512-229.23 512-512v0c0-282.77-229.23-512-512-512v0zM510.771 837.12c-214.905 0-389.12-174.215-389.12-389.12s174.215-389.12 389.12-389.12c214.905 0 389.12 174.215 389.12 389.12v0c0 214.905-174.215 389.12-389.12 389.12v0zM616.653 731.443c-23.824 33.267-62.351 54.688-105.882 54.688s-82.057-21.421-105.615-54.297l-0.266-0.391c-116.172-44.199-197.222-154.639-197.222-284.009 0-167.4 135.704-303.104 303.104-303.104s303.104 135.704 303.104 303.104c0 129.37-81.050 239.81-195.142 283.312l-2.080 0.697zM545.587 748.851c5.438-2.071 10.025-4.275 14.399-6.806l-0.473 0.253 2.048-1.024c4.507-2.73 8.386-5.5 12.043-8.529l-0.164 0.132 2.048-1.638c3.771-3.259 7.185-6.673 10.338-10.319l0.106-0.126 1.024-1.229c3.219-3.804 6.26-8.019 8.965-12.46l0.251-0.443c9.009-14.585 14.347-32.266 14.347-51.194 0-46.344-32.002-85.213-75.113-95.714l-0.674-0.139v-125.952c0-12.668-10.27-22.938-22.938-22.938s-22.938 10.27-22.938 22.938v0 125.747c-44.128 10.565-76.423 49.674-76.423 96.327 0 24.298 8.761 46.55 23.296 63.77l-0.121-0.147 1.024 1.229c3.26 3.771 6.674 7.185 10.319 10.338l0.126 0.106 2.048 1.638c3.492 2.896 7.371 5.666 11.443 8.15l0.435 0.247 2.048 1.024c13.841 8.242 30.52 13.114 48.337 13.114 12.527 0 24.492-2.409 35.457-6.788l-0.645 0.227zM510.976 380.211c29.634 0 53.658 24.023 53.658 53.658v0 20.48c27.443-10.445 45.875-28.058 45.875-48.742 0-32.154-44.442-58.368-99.533-58.368s-99.738 26.624-99.738 59.802c0 20.48 18.432 38.298 45.875 48.742v-20.48c-0.016-0.488-0.025-1.062-0.025-1.638 0-29.634 24.023-53.658 53.658-53.658 0.009 0 0.018 0 0.026 0h-0.001zM510.976 175.411c-0.337-0.002-0.735-0.002-1.133-0.002-150.32 0-272.179 121.859-272.179 272.179 0 104.729 59.15 195.643 145.866 241.157l1.494 0.714c-2.847-10.119-4.483-21.74-4.483-33.742 0-52.303 31.072-97.348 75.763-117.684l0.81-0.33v-50.381l-4.71-1.638c-44.237-14.95-70.861-44.646-70.861-79.462 0-50.79 55.91-89.088 130.253-89.088s130.253 38.298 130.253 89.088c0 34.611-26.419 64.307-70.861 79.462l-4.71 1.638v50.176c45.501 20.666 76.573 65.712 76.573 118.014 0 12.003-1.636 23.623-4.698 34.651l0.215-0.908c87.779-46.36 146.582-137.047 146.582-241.468 0-150.32-121.859-272.179-272.179-272.179-0.773 0-1.545 0.003-2.316 0.010l0.118-0.001z" /> +<glyph unicode="" glyph-name="jeux-de-donnees" d="M512-34.304l-482.304 482.304 482.304 482.304 161.587-161.178 2.253 6.554c9.971 20.297 22.001 37.758 36.19 53.204l-0.145-0.16c21.959 20.774 51.675 33.547 84.374 33.547 2.234 0 4.455-0.060 6.66-0.177l-0.308 0.013c34.426-0.938 65.025-16.562 85.886-40.806l0.13-0.154c20.245-21.611 32.679-50.754 32.679-82.802 0-32.882-13.090-62.707-34.343-84.547l0.027 0.027c-15.289-14.109-32.749-26.203-51.749-35.666l-1.295-0.584-6.144-3.277 166.502-166.298-180.019-180.224c-4.745-4.964-11.419-8.049-18.813-8.049-1.311 0-2.599 0.097-3.858 0.284l0.142-0.017c-16.179 2.458-24.371 17.613-35.635 38.502-8.399 18.002-18.531 33.507-30.524 47.356l0.214-0.252c-13.732 15.139-33.48 24.608-55.439 24.608-20.971 0-39.925-8.636-53.5-22.545l-0.015-0.015c-14.161-13.751-22.948-32.968-22.948-54.239 0-0.444 0.004-0.887 0.011-1.329l-0.001 0.067c0.098-22.48 9.235-42.807 23.962-57.549l-0.001 0.001c12.632-11.4 26.802-21.521 42.050-29.928l1.163-0.588c20.48-12.698 36.659-21.914 38.707-38.298 0.124-0.963 0.195-2.077 0.195-3.208 0-7.514-3.137-14.295-8.173-19.106l-0.010-0.010zM87.45 448l424.55-424.55 139.878 137.83-11.878 7.373c-19.452 10.737-36.246 22.897-51.385 36.827l0.185-0.168c-22.147 22.222-35.84 52.881-35.84 86.738 0 0.034 0 0.068 0 0.102v-0.005c0.136 32.656 13.589 62.144 35.206 83.335l0.019 0.019c21.003 21.332 50.194 34.548 82.473 34.548 33.277 0 63.273-14.047 84.382-36.535l0.058-0.062c14.704-16.045 27.284-34.386 37.079-54.342l0.605-1.364 4.915-9.011 138.854 139.264-149.094 148.685c-5.080 4.792-8.242 11.569-8.242 19.084 0 1.287 0.093 2.552 0.272 3.79l-0.017-0.141c2.253 15.77 16.998 23.757 35.43 33.792 16.592 8.179 30.876 17.948 43.58 29.431l-0.163-0.145c14.023 14.438 22.669 34.164 22.669 55.91s-8.646 41.473-22.688 55.93l0.019-0.019c-13.846 15.876-33.963 25.979-56.449 26.418l-0.076 0.001c-1.677 0.122-3.632 0.192-5.605 0.192-20.919 0-40.006-7.841-54.483-20.743l0.081 0.071c-11.525-12.98-21.384-27.818-29.008-43.921l-0.483-1.135c-10.035-18.637-17.818-33.382-33.587-35.635-1.038-0.144-2.237-0.227-3.455-0.227-7.919 0-15.024 3.484-19.867 9.003l-0.026 0.030-143.36 144.179z" /> +<glyph unicode="" glyph-name="jeux-de-controle" d="M597.811 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 256v0zM597.811-23.040c-118.763 0-215.040 96.277-215.040 215.040s96.277 215.040 215.040 215.040c118.763 0 215.040-96.277 215.040-215.040v0c-0.117-118.716-96.324-214.923-215.029-215.040h-0.011zM1009.050 471.757l-162.611 161.997 7.987 4.301c21.47 10.68 39.939 23.523 56.27 38.644l-0.155-0.141c22.279 22.974 36.013 54.346 36.013 88.925 0 33.744-13.078 64.433-34.442 87.275l0.067-0.072c-22.091 25.622-54.317 41.98-90.381 42.801l-0.141 0.003c-2.19 0.134-4.749 0.21-7.326 0.21-34.182 0-65.23-13.42-88.162-35.28l0.051 0.049c-14.917-16.17-27.696-34.643-37.683-54.747l-0.615-1.368-4.301-8.192-157.696 157.491c-3.702 3.68-8.804 5.955-14.438 5.955s-10.737-2.275-14.439-5.956l0.001 0.001-482.099-483.328c-3.68-3.702-5.955-8.804-5.955-14.438s2.275-10.737 5.956-14.439l-0.001 0.001 345.498-344.678c-9.159 22.101-15.43 47.705-17.556 74.477l-0.057 0.889-284.467 283.853 453.632 454.246 154.214-155.034c4.904-5.199 11.84-8.436 19.532-8.436 1.273 0 2.526 0.089 3.752 0.26l-0.141-0.016c16.179 2.458 23.962 16.998 34.816 37.274 8.656 17.849 19.047 33.216 31.295 46.882l-0.166-0.188c15.793 14.879 37.134 24.023 60.611 24.023 1.156 0 2.307-0.022 3.452-0.066l-0.165 0.005c24.497-0.367 46.377-11.272 61.358-28.372l0.082-0.096c15.181-15.589 24.544-36.909 24.544-60.416s-9.363-44.827-24.562-60.435l0.019 0.019c-13.427-12.136-28.723-22.588-45.32-30.81l-1.17-0.524c-20.48-10.854-34.816-18.842-37.069-35.021-0.148-1.053-0.232-2.27-0.232-3.506 0-7.658 3.233-14.561 8.41-19.418l0.014-0.013 159.539-159.13-143.36-143.36c6.302-11.528 12.194-25.071 16.889-39.162l0.519-1.798 168.55 169.37c4.378 3.778 7.132 9.334 7.132 15.533 0 5.4-2.090 10.312-5.505 13.97l0.011-0.012zM566.682 87.142c-5.799 0.023-11.026 2.452-14.738 6.341l-0.008 0.008-85.606 88.269c-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.805 4.426 9.411 7.211 15.667 7.211 11.391 0 20.625-9.234 20.625-20.625 0-5.135-1.876-9.832-4.981-13.442l0.023 0.027-134.144-153.6c-3.678-4.174-8.991-6.831-14.928-6.963h-0.023z" /> +<glyph unicode="" glyph-name="itl" d="M958.054 287.642c18.122 47.443 28.617 102.315 28.617 159.638 0 64.372-13.235 125.654-37.132 181.271l1.142-2.989c13.282 13.021 21.516 31.15 21.516 51.201 0 39.588-32.092 71.68-71.68 71.68-0.148 0-0.296 0-0.444-0.001h0.023c-7.957-0.123-15.543-1.538-22.614-4.044l0.496 0.153c-70.137 82.717-167.943 140.079-278.977 157.761l-2.623 0.344c-7.254 32.506-35.853 56.442-70.042 56.442s-62.787-23.936-69.952-55.964l-0.090-0.478c-135.004-21.385-248.625-98.727-318.18-207.060l-1.103-1.836c-5.207 1.178-11.188 1.853-17.325 1.853-45.243 0-81.92-36.677-81.92-81.92 0-28.864 14.928-54.241 37.485-68.833l0.321-0.194c-6.72-29.308-10.572-62.963-10.572-97.518 0-71.069 16.291-138.333 45.343-198.26l-1.185 2.709c-14.18-14.707-22.916-34.747-22.916-56.828 0-45.243 36.677-81.92 81.92-81.92 12.397 0 24.151 2.754 34.683 7.683l-0.503-0.211c66.833-66.398 153.998-112.405 251.338-127.863l2.614-0.342c7.028-32.914 35.862-57.239 70.377-57.239 39.701 0 71.885 32.184 71.885 71.885s-32.184 71.885-71.885 71.885c-30.229 0-56.1-18.659-66.724-45.087l-0.172-0.484c-88.483 14.724-165.626 55.364-225.36 113.742l0.080-0.078c8.895 12.911 14.207 28.888 14.207 46.106 0 45.243-36.677 81.92-81.92 81.92-7.678 0-15.109-1.056-22.156-3.031l0.577 0.138c-24.691 51.022-39.122 110.966-39.122 174.281 0 30.547 3.359 60.309 9.728 88.938l-0.507-2.713h3.891c0.148-0.001 0.323-0.002 0.498-0.002 45.243 0 81.92 36.677 81.92 81.92 0 24.427-10.691 46.357-27.65 61.366l-0.087 0.075c64.055 98.243 165.816 167.32 284.28 186.855l2.44 0.332c10.705-26.821 36.459-45.428 66.56-45.428s55.855 18.607 66.39 44.946l0.17 0.482c100.98-17.46 187.671-68.923 249.771-141.945l0.494-0.596c-9.562-12.045-15.34-27.47-15.34-44.244 0-39.475 32.001-71.475 71.475-71.475 0.353 0 0.705 0.003 1.057 0.008l-0.053-0.001c0.015 0 0.033 0 0.051 0 5.056 0 9.99 0.522 14.752 1.515l-0.467-0.081c19.478-46.54 30.793-100.619 30.793-157.342 0-51.738-9.414-101.278-26.622-146.999l0.949 2.876c-1.286 0.083-2.788 0.131-4.301 0.131s-3.015-0.048-4.505-0.141l0.204 0.010c-39.588 0-71.68-32.092-71.68-71.68v0 0c-0.008-0.395-0.012-0.86-0.012-1.327 0-39.814 32.276-72.090 72.090-72.090s72.090 32.276 72.090 72.090c0 22.325-10.148 42.28-26.083 55.503l-0.119 0.096zM227.738 193.024c0-33.932-27.508-61.44-61.44-61.44s-61.44 27.508-61.44 61.44c0 33.932 27.508 61.44 61.44 61.44v0c33.932 0 61.44-27.508 61.44-61.44v0zM180.634 613.888c0-33.932-27.508-61.44-61.44-61.44s-61.44 27.508-61.44 61.44c0 33.932 27.508 61.44 61.44 61.44v0c33.932 0 61.44-27.508 61.44-61.44v0zM525.926 673.28c-124.419 0-225.28-100.861-225.28-225.28s100.861-225.28 225.28-225.28c124.419 0 225.28 100.861 225.28 225.28v0c0 124.419-100.861 225.28-225.28 225.28v0zM525.926 263.68c-101.797 0-184.32 82.523-184.32 184.32s82.523 184.32 184.32 184.32c101.797 0 184.32-82.523 184.32-184.32v0c0.003-0.365 0.004-0.797 0.004-1.229 0-101.797-82.523-184.32-184.32-184.32-0.001 0-0.003 0-0.004 0v0zM405.914 486.912h240.026v-79.258h-240.026v79.258z" /> +<glyph unicode="" glyph-name="itineraire" d="M966.042 274.125c-3.801 5.452-8.124 10.165-12.995 14.244l-0.112 0.092c18.122 47.443 28.617 102.315 28.617 159.638 0 64.372-13.235 125.654-37.132 181.271l1.142-2.989c13.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.037 82.835-167.769 140.329-278.759 158.166l-2.636 0.349c-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.155-0.028-62.702-24.010-69.749-56.051l-0.087-0.474c-138.515-22.176-254.573-103.274-323.455-216.281l-1.153-2.035c-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-25.899-11.189-43.695-36.512-43.695-65.991 0-24.202 11.994-45.602 30.363-58.581l0.225-0.151c-8.163-32.383-12.847-69.56-12.847-107.83 0-74.679 17.836-145.192 49.481-207.511l-1.203 2.612c-11.866-12.696-19.153-29.804-19.153-48.613 0-10.032 2.073-19.58 5.814-28.24l-0.178 0.462c11.081-25.999 36.42-43.894 65.939-43.894 10.375 0 20.235 2.211 29.132 6.187l-0.454-0.181c67.716-70.683 157.509-119.73 258.272-136.044l2.643-0.353c6.969-32.512 35.461-56.533 69.564-56.533 0.384 0 0.767 0.003 1.15 0.009l-0.058-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.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.037 0-0.081 0-0.125 0-30.078 0-55.804-18.632-66.266-44.984l-0.169-0.482c-92.341 15.058-172.625 58.425-233.603 120.756l-0.074 0.076c7.513 11.137 11.992 24.86 11.992 39.629s-4.479 28.492-12.154 39.884l0.162-0.255c-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-6.135-0.052-12.055-0.871-17.7-2.365l0.497 0.112c-26.921 53.265-42.688 116.111-42.688 182.64 0 34.396 4.214 67.808 12.155 99.747l-0.596-2.835h1.843c39.256 0.288 70.968 32.177 70.968 71.473 0 20.172-8.356 38.392-21.796 51.387l-0.020 0.019c63.41 102.775 167.346 175.348 288.976 195.655l2.455 0.339v-1.638c11.158-25.971 36.517-43.829 66.048-43.829 0.18 0 0.36 0.001 0.54 0.002h-0.028c0.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-1.286 0.083-2.788 0.131-4.301 0.131s-3.015-0.048-4.505-0.141l0.204 0.010c-39.588 0-71.68-32.092-71.68-71.68v0 0c0-39.588 32.092-71.68 71.68-71.68s71.68 32.092 71.68 71.68v0 0c0.003 0.253 0.005 0.551 0.005 0.85 0 15.066-4.675 29.040-12.653 40.55l0.155-0.236zM346.522 738.816l-16.384-59.187 62.874-17.408c-55.726-35.538-104.014-75.364-146.969-120.329l-0.282-0.298 43.827-43.008c40.758 42.703 86.451 80.126 136.318 111.523l2.946 1.731-20.48-71.68 59.187-16.384 46.49 168.141z" /> +<glyph unicode="" glyph-name="importer" d="M953.754 216.986c-12.448 125.912-114.58 224.369-241.035 230.988l-0.629 0.026c-4.301 0-8.602 0-13.107 0-141.385 0-256-114.615-256-256s114.615-256 256-256c141.385 0 256 114.615 256 256v0c0 8.397-0.41 16.794-1.229 24.986zM698.982-23.040c-118.763 0-215.040 96.277-215.040 215.040s96.277 215.040 215.040 215.040c118.763 0 215.040-96.277 215.040-215.040v0c-0.117-118.716-96.324-214.923-215.029-215.040h-0.011zM731.136 309.555c-3.723 3.8-8.908 6.157-14.643 6.157-11.318 0-20.493-9.175-20.493-20.493 0-5.582 2.232-10.644 5.853-14.339l65.533-67.171h-187.802c-11.311 0-20.48-9.169-20.48-20.48s9.169-20.48 20.48-20.48v0h187.802l-65.536-67.174c-3.617-3.692-5.849-8.754-5.849-14.336 0-11.318 9.175-20.493 20.493-20.493 5.735 0 10.92 2.356 14.64 6.153l0.003 0.003 113.254 116.326zM536.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.786-3.202 29.503-7.302 42.681-12.473l-1.721 0.595v275.866zM548.25 890.573l172.032-172.032h-172.032z" /> +<glyph unicode="" glyph-name="horaires-des-courses" d="M512 919.040c260.148 0 471.040-210.892 471.040-471.040s-210.892-471.040-471.040-471.040c-260.148 0-471.040 210.892-471.040 471.040v0c0 260.148 210.892 471.040 471.040 471.040v0zM512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512c282.77 0 512 229.23 512 512v0c0 282.77-229.23 512-512 512v0zM761.651 468.48h-177.971c-7.25 24.808-26.392 43.95-50.673 51.068l-0.527 0.132v266.24h-40.96v-266.24c-31.737-9.111-54.567-37.877-54.567-71.975 0-41.284 33.468-74.752 74.752-74.752 34.098 0 62.864 22.831 71.845 54.040l0.13 0.528h177.971z" /> +<glyph unicode="" glyph-name="calendrier-application" d="M314.573 660.582c11.311 0 20.48 9.169 20.48 20.48v0 244.326c0 11.311-9.169 20.48-20.48 20.48s-20.48-9.169-20.48-20.48v0-244.326c0-11.311 9.169-20.48 20.48-20.48v0zM376.013 803.738h270.746v-40.96h-270.746v40.96zM707.994 660.582c11.311 0 20.48 9.169 20.48 20.48v0 244.326c0 11.311-9.169 20.48-20.48 20.48s-20.48-9.169-20.48-20.48v0-244.326c0-11.311 9.169-20.48 20.48-20.48v0zM930.611 494.694v0 249.242c-1.563 33.365-28.994 59.825-62.604 59.825-0.599 0-1.196-0.008-1.79-0.025l0.087 0.002h-96.87v-40.96h96.87c0.438 0.031 0.95 0.049 1.466 0.049 11.077 0 20.251-8.142 21.866-18.768l0.015-0.123v-249.242h-755.302v249.242c1.63 10.748 10.805 18.89 21.882 18.89 0.516 0 1.027-0.018 1.534-0.052l-0.068 0.004h95.437v40.96h-95.437c-0.507 0.015-1.104 0.023-1.703 0.023-33.611 0-61.041-26.459-62.599-59.685l-0.005-0.14v-734.003c1.563-33.365 28.994-59.825 62.604-59.825 0.599 0 1.196 0.008 1.79 0.025l-0.087-0.002h708.608c0.507-0.015 1.104-0.023 1.703-0.023 33.611 0 61.041 26.459 62.599 59.685l0.005 0.14v443.802zM889.651 438.17v-428.032c-1.63-10.748-10.805-18.89-21.882-18.89-0.516 0-1.027 0.018-1.534 0.052l0.068-0.004h-708.608c-0.438-0.031-0.95-0.049-1.466-0.049-11.077 0-20.251 8.142-21.866 18.768l-0.015 0.123v443.597h755.302z" /> +<glyph unicode="" glyph-name="arret" d="M921.6 960h-819.2c-56.554 0-102.4-45.846-102.4-102.4v0-819.2c0-56.554 45.846-102.4 102.4-102.4v0h819.2c56.554 0 102.4 45.846 102.4 102.4v0 819.2c0 56.554-45.846 102.4-102.4 102.4v0zM102.4-23.040c-33.932 0-61.44 27.508-61.44 61.44v0 221.184c60.305 19.387 129.686 30.612 201.674 30.72h0.054c0.213 0 0.465 0 0.716 0 38.796 0 77.035-2.381 114.58-7.006l-4.5 0.452c6.144-40.96 64.102-72.294 134.758-72.294 0.656-0.008 1.431-0.012 2.207-0.012 27.309 0 53.369 5.345 77.192 15.046l-1.37-0.493c156.058-70.656 234.086-183.091 257.638-249.037zM488.243 259.789c17.192 0 31.13 13.937 31.13 31.13v0 58.573c51.814-7.987 86.016-34.406 86.016-58.573 0-28.877-48.128-61.44-117.146-61.44s-117.146 32.358-117.146 61.44c0 24.371 34.202 50.79 86.016 58.573v-58.573c0-17.192 13.937-31.13 31.13-31.13v0zM983.040 38.4c0-33.932-27.508-61.44-61.44-61.44v0h-28.058c-20.48 84.378-107.52 212.992-273.203 296.96v0c2.010 5.035 3.206 10.867 3.277 16.969v0.029c0 37.478-44.442 68.813-104.243 77.21v131.277c60.423 14.435 104.653 67.973 104.653 131.841 0 74.764-60.608 135.373-135.373 135.373s-135.373-60.608-135.373-135.373c0-63.868 44.23-117.406 103.731-131.655l0.922-0.186v-131.482c-25.035-3.073-47.693-10.979-67.796-22.771l0.827 0.448c-43.823 7.040-94.344 11.062-145.805 11.062-0.796 0-1.593-0.001-2.389-0.003h0.123c-0.615 0.002-1.344 0.003-2.072 0.003-71.124 0-139.943-9.871-205.161-28.318l5.3 1.281v527.974c0 33.932 27.508 61.44 61.44 61.44v0h819.2c33.932 0 61.44-27.508 61.44-61.44v0z" /> +<glyph unicode="" glyph-name="Acces" d="M631.194 810.701l-36.864-35.84 117.35-121.242h-352.461v-51.405h352.461l-117.35-121.446 36.864-35.635 176.947 182.682-176.947 182.886zM685.261 293.99h-373.146l117.555 121.242-36.864 35.635-176.947-182.682 176.947-182.682 36.864 35.635-117.555 121.446h373.146v51.405zM880.64-64h-737.28c-79.176 0-143.36 64.184-143.36 143.36v0 737.28c0 79.176 64.184 143.36 143.36 143.36v0h737.28c79.176 0 143.36-64.184 143.36-143.36v0-737.28c0-79.176-64.184-143.36-143.36-143.36v0zM143.36 919.040c-56.554 0-102.4-45.846-102.4-102.4v0-737.28c0-56.554 45.846-102.4 102.4-102.4v0h737.28c56.554 0 102.4 45.846 102.4 102.4v0 737.28c0 56.554-45.846 102.4-102.4 102.4v0z" /> +<glyph unicode="" glyph-name="ligne" d="M966.042 274.125c-3.801 5.452-8.124 10.165-12.995 14.244l-0.112 0.092c18.122 47.443 28.617 102.315 28.617 159.638 0 64.372-13.235 125.654-37.132 181.271l1.142-2.989c13.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.037 82.835-167.769 140.329-278.759 158.166l-2.636 0.349c-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.155-0.028-62.702-24.010-69.749-56.051l-0.087-0.474c-138.515-22.176-254.573-103.274-323.455-216.281l-1.153-2.035c-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-25.899-11.189-43.695-36.512-43.695-65.991 0-24.202 11.994-45.602 30.363-58.581l0.225-0.151c-8.163-32.383-12.847-69.56-12.847-107.83 0-74.679 17.836-145.192 49.481-207.511l-1.203 2.612c-11.866-12.696-19.153-29.804-19.153-48.613 0-10.032 2.073-19.58 5.814-28.24l-0.178 0.462c11.081-25.999 36.42-43.894 65.939-43.894 10.375 0 20.235 2.211 29.132 6.187l-0.454-0.181c67.716-70.683 157.509-119.73 258.272-136.044l2.643-0.353c6.969-32.512 35.461-56.533 69.564-56.533 0.384 0 0.767 0.003 1.15 0.009l-0.058-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.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.037 0-0.081 0-0.125 0-30.078 0-55.804-18.632-66.266-44.984l-0.169-0.482c-92.341 15.058-172.625 58.425-233.603 120.756l-0.074 0.076c7.513 11.137 11.992 24.86 11.992 39.629s-4.479 28.492-12.154 39.884l0.162-0.255c-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-6.135-0.052-12.055-0.871-17.7-2.365l0.497 0.112c-26.921 53.265-42.688 116.111-42.688 182.64 0 34.396 4.214 67.808 12.155 99.747l-0.596-2.835h1.843c39.256 0.288 70.968 32.177 70.968 71.473 0 20.172-8.356 38.392-21.796 51.387l-0.020 0.019c63.41 102.775 167.346 175.348 288.976 195.655l2.455 0.339v-1.638c11.158-25.971 36.517-43.829 66.048-43.829 0.18 0 0.36 0.001 0.54 0.002h-0.028c0.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-1.286 0.083-2.788 0.131-4.301 0.131s-3.015-0.048-4.505-0.141l0.204 0.010c-39.588 0-71.68-32.092-71.68-71.68v0 0c0-39.588 32.092-71.68 71.68-71.68s71.68 32.092 71.68 71.68v0 0c0.003 0.253 0.005 0.551 0.005 0.85 0 15.066-4.675 29.040-12.653 40.55l0.155-0.236z" /> </font></defs></svg>
\ No newline at end of file diff --git a/app/assets/fonts/sBoiv/sboiv.ttf b/app/assets/fonts/sBoiv/sboiv.ttf Binary files differindex 21c79549a..d6b4d8441 100644 --- a/app/assets/fonts/sBoiv/sboiv.ttf +++ b/app/assets/fonts/sBoiv/sboiv.ttf diff --git a/app/assets/fonts/sBoiv/sboiv.woff b/app/assets/fonts/sBoiv/sboiv.woff Binary files differindex fa2e097d7..8e10ad072 100644 --- a/app/assets/fonts/sBoiv/sboiv.woff +++ b/app/assets/fonts/sBoiv/sboiv.woff diff --git a/app/assets/javascripts/es6_browserified/journey_patterns/actions/index.js b/app/assets/javascripts/es6_browserified/journey_patterns/actions/index.js index 3577df2b6..825e7bb7d 100644 --- a/app/assets/javascripts/es6_browserified/journey_patterns/actions/index.js +++ b/app/assets/javascripts/es6_browserified/journey_patterns/actions/index.js @@ -90,10 +90,7 @@ const actions = { resetValidation: (target) => { $(target).parent().removeClass('has-error').children('.help-block').remove() }, - humanOID : (oid) => { - var a = oid.split(':') - return a[a.length - 1] - }, + humanOID : (oid) => oid.split(':')[2].split("-").pop(), validateFields : (fields) => { const test = [] diff --git a/app/assets/javascripts/es6_browserified/time_tables/actions/index.js b/app/assets/javascripts/es6_browserified/time_tables/actions/index.js index 7a1ba10ff..a6add8418 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/actions/index.js +++ b/app/assets/javascripts/es6_browserified/time_tables/actions/index.js @@ -105,12 +105,13 @@ const actions = { group, selectType }), - validatePeriodForm: (modalProps, timeTablePeriods, metas, timetableInDates) => ({ + validatePeriodForm: (modalProps, timeTablePeriods, metas, timetableInDates, error) => ({ type: 'VALIDATE_PERIOD_FORM', modalProps, timeTablePeriods, metas, - timetableInDates + timetableInDates, + error }), addIncludedDate: (index, dayTypes, date) => ({ type: 'ADD_INCLUDED_DATE', @@ -233,12 +234,16 @@ const actions = { let error = '' start = new Date(start) end = new Date(end) - _.each(periods, (period, i) => { - if(index !== i && !period.deleted){ - if((new Date(period.period_start) <= start && new Date(period.period_end) >= start) || (new Date(period.period_start) <= end && new Date(period.period_end) >= end) || (start >= new Date(period.period_start) && end <= new Date(period.period_end)) || (start <= new Date(period.period_start) && end >= new Date(period.period_end))) - error = 'Les périodes ne peuvent pas se chevaucher' + + for (let i = 0; i < periods.length; i++) { + let period = periods[i] + if (index !== i && !period.deleted) { + if (new Date(period.period_start) <= end && new Date(period.period_end) >= start) { + error = 'Les périodes ne peuvent pas se chevaucher' + break + } } - }) + } return error }, checkErrorsInDates: (start, end, in_days, dayTypes) => { @@ -246,11 +251,12 @@ const actions = { start = new Date(start) end = new Date(end) - _.each(in_days, ({date}) => { - if (start <= new Date(date) && end >= new Date(date) && dayTypes[new Date(date).getDay()]) { + for (let day of in_days) { + if (start <= new Date(day.date) && end >= new Date(day.date)) { error = 'Une période ne peut chevaucher une date dans un calendrier' + break } - }) + } return error }, fetchTimeTables: (dispatch, nextPage) => { diff --git a/app/assets/javascripts/es6_browserified/time_tables/containers/PeriodForm.js b/app/assets/javascripts/es6_browserified/time_tables/containers/PeriodForm.js index 723a4a7fb..951a09741 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/containers/PeriodForm.js +++ b/app/assets/javascripts/es6_browserified/time_tables/containers/PeriodForm.js @@ -28,7 +28,13 @@ const mapDispatchToProps = (dispatch) => { dispatch(actions.updatePeriodForm(val, group, 'day')) }, onValidatePeriodForm: (modalProps, timeTablePeriods, metas, timetableInDates) => { - dispatch(actions.validatePeriodForm(modalProps, timeTablePeriods, metas, timetableInDates)) + let period_start = actions.formatDate(modalProps.begin) + let period_end = actions.formatDate(modalProps.end) + let error = '' + if (new Date(period_end) <= new Date(period_start)) error = 'La date de départ doit être antérieure à la date de fin' + if (error == '') error = actions.checkErrorsInPeriods(period_start, period_end, modalProps.index, timeTablePeriods) + if (error == '') error = actions.checkErrorsInDates(period_start, period_end, timetableInDates) + dispatch(actions.validatePeriodForm(modalProps, timeTablePeriods, metas, timetableInDates, error)) } } } diff --git a/app/assets/javascripts/es6_browserified/time_tables/reducers/modal.js b/app/assets/javascripts/es6_browserified/time_tables/reducers/modal.js index 3329aa56f..c61296f1c 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/reducers/modal.js +++ b/app/assets/javascripts/es6_browserified/time_tables/reducers/modal.js @@ -27,7 +27,7 @@ const modal = (state = {}, action) => { newModalProps = _.assign({}, state.modalProps, {error: ''}) return _.assign({}, state, {type: ''}, {modalProps: newModalProps}) case 'CLOSE_PERIOD_FORM': - newModalProps = _.assign({}, state.modalProps, {active: false}) + newModalProps = _.assign({}, state.modalProps, {active: false, error: ""}) return _.assign({}, state, {modalProps: newModalProps}) case 'OPEN_EDIT_PERIOD_FORM': period_start = action.period.period_start.split('-') @@ -54,21 +54,9 @@ const modal = (state = {}, action) => { newModalProps[action.group][action.selectType] = action.val return _.assign({}, state, {modalProps: newModalProps}) case 'VALIDATE_PERIOD_FORM': - period_start = actions.formatDate(action.modalProps.begin) - period_end = actions.formatDate(action.modalProps.end) - newModalProps = _.assign({}, state.modalProps) - - if(new Date(period_end) <= new Date(period_start)){ - newModalProps.error = 'La date de départ doit être antérieure à la date de fin' - return _.assign({}, state, {modalProps: newModalProps}) - } - - let newPeriods = JSON.parse(JSON.stringify(action.timeTablePeriods)) - let newDays = JSON.parse(JSON.stringify(action.timetableInDates)) - let error = actions.checkErrorsInPeriods(period_start, period_end, action.modalProps.index, newPeriods) - if (error == '') error = actions.checkErrorsInDates(period_start, period_end, newDays, action.metas.day_types) - newModalProps.error = error - newModalProps.active = (error == '') ? false : true + newModalProps = JSON.parse(JSON.stringify(state.modalProps)) + newModalProps.error = action.error + newModalProps.active = (newModalProps.error == '') ? false : true return _.assign({}, state, {modalProps: newModalProps}) default: return state diff --git a/app/assets/javascripts/es6_browserified/time_tables/reducers/timetable.js b/app/assets/javascripts/es6_browserified/time_tables/reducers/timetable.js index cbdf8fa60..d61c813ec 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/reducers/timetable.js +++ b/app/assets/javascripts/es6_browserified/time_tables/reducers/timetable.js @@ -83,23 +83,27 @@ const timetable = (state = {}, action) => { }) newState = _.assign({}, state, {current_month: newCM, time_table_dates: newDates}) return _.assign({}, newState, {current_month: actions.updateSynthesis(newState, action.dayTypes)}) + case 'UPDATE_DAY_TYPES': + // We get the week days of the activated day types to reject the out_dates that that are out of newDayTypes + let weekDays = _.reduce(action.dayTypes, (array, dt, i) => { + if (dt) array.push(i) + return array + }, []) + + newDates = _.reject(state.time_table_dates, (d) => { + return d.in_out == false && !weekDays.includes(new Date(d.date).getDay()) + }) + return _.assign({}, state, {time_table_dates: newDates}) case 'UPDATE_CURRENT_MONTH_FROM_DAYTYPES': return _.assign({}, state, {current_month: actions.updateSynthesis(state, action.dayTypes)}) case 'VALIDATE_PERIOD_FORM': + if (action.error != '') return state + let period_start = actions.formatDate(action.modalProps.begin) let period_end = actions.formatDate(action.modalProps.end) - if(new Date(period_end) <= new Date(period_start)){ - return state - } - newPeriods = JSON.parse(JSON.stringify(action.timeTablePeriods)) - let inDates = JSON.parse(JSON.stringify(action.timetableInDates)) - let error = actions.checkErrorsInPeriods(period_start, period_end, action.modalProps.index, newPeriods) - if (error == '') error = actions.checkErrorsInDates(period_start, period_end, inDates, action.metas.day_types) - if(error != ''){ - return state - } - let updatePeriod + let newPeriods = JSON.parse(JSON.stringify(action.timeTablePeriods)) + if (action.modalProps.index !== false){ updatePeriod = state.time_table_periods[action.modalProps.index] updatePeriod.period_start = period_start @@ -116,7 +120,6 @@ const timetable = (state = {}, action) => { newDates = newDates || state.time_table_dates newState =_.assign({}, state, {time_table_periods: newPeriods, time_table_dates: newDates}) return _.assign({}, newState, {current_month: actions.updateSynthesis(newState, action.metas.day_types)}) - default: return state } diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/actions/index.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/actions/index.js index 0b35591b2..2e2e06514 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/actions/index.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/actions/index.js @@ -139,13 +139,14 @@ const actions = { type: 'EDIT_VEHICLEJOURNEY_NOTES', footnotes }), - shiftVehicleJourney : (data) => ({ + shiftVehicleJourney : (addtionalTime) => ({ type: 'SHIFT_VEHICLEJOURNEY', - data + addtionalTime }), - duplicateVehicleJourney : (data, departureDelta) => ({ + duplicateVehicleJourney : (addtionalTime, duplicateNumber, departureDelta) => ({ type: 'DUPLICATE_VEHICLEJOURNEY', - data, + addtionalTime, + duplicateNumber, departureDelta }), deleteVehicleJourneys : () => ({ @@ -268,10 +269,7 @@ const actions = { type: 'RECEIVE_TOTAL_COUNT', total }), - humanOID : (oid) => { - var a = oid.split(':') - return a[a.length - 1] - }, + humanOID: (oid) => oid.split(':')[2].split("-").pop(), fetchVehicleJourneys : (dispatch, currentPage, nextPage, queryString) => { if(currentPage == undefined){ currentPage = 1 @@ -394,7 +392,7 @@ const actions = { }, simplePad: (d) => { if(d.toString().length == 1){ - return (d < 10) ? '0' + d.toString() : d.toString(); + return '0' + d.toString() }else{ return d.toString() } @@ -428,8 +426,8 @@ const actions = { return vjas }, getDuplicateDelta: (original, newDeparture) => { - if (original.departure_time.hour != '' && original.departure_time.minute != '' && newDeparture.departure_time.hour != '' && newDeparture.departure_time.minute != ''){ - return (parseInt(newDeparture.departure_time.hour) - parseInt(original.departure_time.hour)) * 60 + (parseInt(newDeparture.departure_time.minute) - parseInt(original.departure_time.minute)) + if (original.departure_time.hour != '' && original.departure_time.minute != '' && newDeparture.departure_time.hour != undefined && newDeparture.departure_time.minute != undefined){ + return (newDeparture.departure_time.hour - parseInt(original.departure_time.hour)) * 60 + (newDeparture.departure_time.minute - parseInt(original.departure_time.minute)) } return 0 }, @@ -441,69 +439,25 @@ const actions = { vjas.delta = delta return vjas }, - checkSchedules: (schedule) => { - let hours = 0 - let minutes = 0 - if (parseInt(schedule.departure_time.minute) > 59){ - hours = Math.floor(parseInt(schedule.departure_time.minute) / 60) - minutes = parseInt(schedule.departure_time.minute) % 60 - schedule.departure_time.minute = actions.simplePad(minutes, 'minute') - schedule.departure_time.hour = parseInt(schedule.departure_time.hour) + hours - } - if (parseInt(schedule.arrival_time.minute) > 59){ - hours = Math.floor(parseInt(schedule.arrival_time.minute) / 60) - minutes = parseInt(schedule.arrival_time.minute) % 60 - schedule.arrival_time.minute = actions.simplePad(minutes, 'minute') - schedule.arrival_time.hour = parseInt(schedule.arrival_time.hour) + hours - } - if (parseInt(schedule.departure_time.minute) < 0){ - hours = Math.floor(parseInt(schedule.departure_time.minute) / 60) - minutes = (parseInt(schedule.departure_time.minute) % 60) + 60 - if(minutes == 60){ - minutes = 0 - } - schedule.departure_time.minute = actions.simplePad(minutes, 'minute') - schedule.departure_time.hour = parseInt(schedule.departure_time.hour) + hours - } - if (parseInt(schedule.arrival_time.minute) < 0){ - hours = Math.floor(parseInt(schedule.arrival_time.minute) / 60) - minutes = (parseInt(schedule.arrival_time.minute) % 60) + 60 - if(minutes == 60){ - minutes = 0 - } - schedule.arrival_time.minute = actions.simplePad(minutes, 'minute') - schedule.arrival_time.hour = parseInt(schedule.arrival_time.hour) + hours - } + getShiftedSchedule: ({departure_time, arrival_time}, additional_time) => { + // We create dummy dates objects to manipulate time more easily + let departureDT = new Date (Date.UTC(2017, 2, 1, parseInt(departure_time.hour), parseInt(departure_time.minute))) + let arrivalDT = new Date (Date.UTC(2017, 2, 1, parseInt(arrival_time.hour), parseInt(arrival_time.minute))) - if(parseInt(schedule.departure_time.hour) > 23){ - schedule.departure_time.hour = '23' - schedule.departure_time.minute = '59' - } - if(parseInt(schedule.arrival_time.hour) > 23){ - schedule.arrival_time.hour = '23' - schedule.arrival_time.minute = '59' - } + let newDepartureDT = new Date (departureDT.getTime() + additional_time * 60000) + let newArrivalDT = new Date (arrivalDT.getTime() + additional_time * 60000) - if(parseInt(schedule.departure_time.hour) < 0){ - schedule.departure_time.hour = '00' - schedule.departure_time.minute = '00' - } - if(parseInt(schedule.arrival_time.hour) < 0){ - schedule.arrival_time.hour = '00' - schedule.arrival_time.minute = '00' + return { + departure_time: { + hour: actions.simplePad(newDepartureDT.getUTCHours()), + minute: actions.simplePad(newDepartureDT.getUTCMinutes()) + }, + arrival_time: { + hour: actions.simplePad(newArrivalDT.getUTCHours()), + minute: actions.simplePad(newArrivalDT.getUTCMinutes()) + } } - - schedule.departure_time.hour = actions.simplePad(parseInt(schedule.departure_time.hour), 'hour') - schedule.arrival_time.hour = actions.simplePad(parseInt(schedule.arrival_time.hour), 'hour') - // if (parseInt(schedule.departure_time.hour) > 23){ - // schedule.departure_time.hour = parseInt(schedule.departure_time.hour) - 24 - // } - // if (parseInt(schedule.arrival_time.hour) > 23){ - // schedule.arrival_time.hour = parseInt(schedule.arrival_time.hour) - 24 - // } - // schedule.departure_time.hour = actions.pad(schedule.departure_time.hour, 'hour') - // schedule.arrival_time.hour = actions.pad(schedule.arrival_time.hour, 'hour') - } + }, } module.exports = actions diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/DuplicateVehicleJourney.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/DuplicateVehicleJourney.js index 34463600a..9446b993a 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/DuplicateVehicleJourney.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/DuplicateVehicleJourney.js @@ -7,33 +7,64 @@ var _ = require('lodash') class DuplicateVehicleJourney extends Component { constructor(props) { super(props) + this.state = {} + this.onFormChange = this.onFormChange.bind(this) + this.handleSubmit = this.handleSubmit.bind(this) + } + + componentWillReceiveProps() { + if (actions.getSelected(this.props.vehicleJourneys).length > 0) { + let hour = parseInt(this.getDefaultValue('hour')) + let miunte = parseInt(this.getDefaultValue('minute')) + this.setState((state, props) => { + return { + originalDT: { + hour: hour, + minute: miunte + }, + duplicate_time_hh: hour, + duplicate_time_mm: miunte, + additional_time: 0, + duplicate_number: 1 + } + }) + } } handleSubmit() { if(actions.validateFields(this.refs) == true) { let newDeparture = { departure_time : { - hour: this.refs.duplicate_time_hh.value, - minute: this.refs.duplicate_time_mm.value + hour: this.state.duplicate_time_hh, + minute: this.state.duplicate_time_mm } } let val = actions.getDuplicateDelta(_.find(actions.getSelected(this.props.vehicleJourneys)[0].vehicle_journey_at_stops, {'dummy': false}), newDeparture) - this.refs.additional_time.value = parseInt(this.refs.additional_time.value) - this.props.onDuplicateVehicleJourney(this.refs, val) + this.props.onDuplicateVehicleJourney(this.state.additional_time, this.state.duplicate_number, val) this.props.onModalClose() $('#DuplicateVehicleJourneyModal').modal('hide') } } + onFormChange(e) { + let {name, value} = e.target + this.setState((state, props) => { + return { + [name]: parseInt(value) + } + }) + } + getDefaultValue(type) { let vjas = _.find(actions.getSelected(this.props.vehicleJourneys)[0].vehicle_journey_at_stops, {'dummy': false}) return vjas.departure_time[type] } + render() { if(this.props.status.isFetching == true) { return false } - if(this.props.status.fetchSuccess == true) { + if(this.props.status.fetchSuccess == true && actions.getSelected(this.props.vehicleJourneys).length > 0) { return ( <li className='st_action'> <button @@ -65,22 +96,26 @@ class DuplicateVehicleJourney extends Component { <span className={'input-group time' + (actions.getSelected(this.props.vehicleJourneys).length > 1 ? ' disabled' : '')}> <input type='number' + name='duplicate_time_hh' ref='duplicate_time_hh' min='00' max='23' className='form-control' - defaultValue={this.getDefaultValue('hour')} - disabled={(actions.getSelected(this.props.vehicleJourneys).length > 1 ? 'disabled' : '')} + value={this.state.duplicate_time_hh} + onChange={e => this.onFormChange(e)} + disabled={actions.getSelected(this.props.vehicleJourneys) && (actions.getSelected(this.props.vehicleJourneys).length > 1 ? 'disabled' : '')} /> <span>:</span> <input type='number' + name='duplicate_time_mm' ref='duplicate_time_mm' min='00' max='59' className='form-control' - defaultValue={this.getDefaultValue('minute')} - disabled={(actions.getSelected(this.props.vehicleJourneys).length > 1 ? 'disabled' : '')} + value={this.state.duplicate_time_mm} + onChange={e => this.onFormChange(e)} + disabled={actions.getSelected(this.props.vehicleJourneys) && (actions.getSelected(this.props.vehicleJourneys).length > 1 ? 'disabled' : '')} /> </span> </span> @@ -92,11 +127,13 @@ class DuplicateVehicleJourney extends Component { <input type='number' style={{'width': 104}} + name='duplicate_number' ref='duplicate_number' min='1' max='20' - defaultValue='1' + value={this.state.duplicate_number} className='form-control' + onChange={e => this.onFormChange(e)} onKeyDown={(e) => actions.resetValidation(e.currentTarget)} required /> @@ -105,19 +142,21 @@ class DuplicateVehicleJourney extends Component { <div className='form-group'> <label className='control-label is-required col-sm-8'>Décalage à partir duquel on créé les courses</label> - <div className="col-sm-4"> + <span className="col-sm-4"> <input type='number' style={{'width': 104}} + name='additional_time' ref='additional_time' - min='-59' - max='59' - defaultValue='0' - className='form-control' + min='-720' + max='720' + value={this.state.additional_time} + className='form-control disabled' + onChange={e => this.onFormChange(e)} onKeyDown={(e) => actions.resetValidation(e.currentTarget)} required - /> - </div> + /> + </span> </div> </div> @@ -131,9 +170,9 @@ class DuplicateVehicleJourney extends Component { Annuler </button> <button - className='btn btn-primary' + className={'btn btn-primary ' + (this.state.additional_time == 0 && this.state.originalDT.hour == this.state.duplicate_time_hh && this.state.originalDT.minute == this.state.duplicate_time_mm ? 'disabled' : '')} type='button' - onClick={this.handleSubmit.bind(this)} + onClick={this.handleSubmit} > Valider </button> diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/ShiftVehicleJourney.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/ShiftVehicleJourney.js index 269bb1b8c..dd0bade39 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/ShiftVehicleJourney.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/ShiftVehicleJourney.js @@ -6,16 +6,27 @@ var actions = require('../../actions') class ShiftVehicleJourney extends Component { constructor(props) { super(props) + this.state = { + additional_time: 0 + } } handleSubmit() { if(actions.validateFields(this.refs) == true) { - this.props.onShiftVehicleJourney(this.refs) + this.props.onShiftVehicleJourney(this.state.additional_time) this.props.onModalClose() $('#ShiftVehicleJourneyModal').modal('hide') } } + handleAdditionalTimeChange() { + this.setState((state, props) => { + return { + additional_time: parseInt(this.refs.additional_time.value) + } + }) + } + render() { if(this.props.status.isFetching == true) { return false @@ -53,14 +64,16 @@ class ShiftVehicleJourney extends Component { <label className='control-label is-required'>Avec un décalage de</label> <input type='number' + style={{'width': 104}} ref='additional_time' - min='-59' - max='59' + min='-720' + max='720' + value={this.state.additional_time} className='form-control' - defaultValue='0' + onChange={this.handleAdditionalTimeChange.bind(this)} onKeyDown={(e) => actions.resetValidation(e.currentTarget)} required - /> + /> </div> </div> </div> @@ -75,7 +88,7 @@ class ShiftVehicleJourney extends Component { Annuler </button> <button - className='btn btn-primary' + className={'btn btn-primary ' + (this.state.additional_time == 0 ? 'disabled' : '')} type='button' onClick={this.handleSubmit.bind(this)} > diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/MissionSelect2.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/MissionSelect2.js index 922a1e5ee..2f49e9980 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/MissionSelect2.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/MissionSelect2.js @@ -2,6 +2,7 @@ var _ = require('lodash') var React = require('react') var PropTypes = require('react').PropTypes var Select2 = require('react-select2') +var humanOID = require('../../../actions').humanOID // get JSON full path var origin = window.location.origin @@ -34,7 +35,7 @@ class BSelect4 extends React.Component{ delay: '500', data: function(params) { return { - q: {published_name_cont_or_short_id_or_registration_number_cont: params.term}, + q: {published_name_or_objectid_or_registration_number_cont: params.term}, }; }, processResults: function(data, params) { @@ -43,7 +44,7 @@ class BSelect4 extends React.Component{ item => _.assign( {}, item, - { text: "<strong>" + item.published_name + " - " + item.short_id + "</strong><br/><small>" + item.registration_number + "</small>" } + { text: "<strong>" + item.published_name + " - " + humanOID(item.object_id) + "</strong><br/><small>" + item.registration_number + "</small>" } ) ) }; diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/TimetableSelect2.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/TimetableSelect2.js index 0183aac43..2248175ab 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/TimetableSelect2.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/TimetableSelect2.js @@ -2,7 +2,7 @@ var _ = require('lodash') var React = require('react') var PropTypes = require('react').PropTypes var Select2 = require('react-select2') -var actions = require('../../../actions') +var humanOID = require('../../../actions').humanOID // get JSON full path var origin = window.location.origin @@ -33,8 +33,13 @@ class BSelect4 extends React.Component{ dataType: 'json', delay: '500', data: function(params) { + let newParmas = params.term.split(" ") return { - q: {short_id_or_comment_cont: params.term}, + q: { + objectid_cont_any: newParmas, + comment_cont_any: newParmas, + m: 'or' + } }; }, processResults: function(data, params) { @@ -43,7 +48,7 @@ class BSelect4 extends React.Component{ item => _.assign( {}, item, - {text: '<strong>' + "<span class='fa fa-circle' style='color:" + (item.color ? item.color : '#4B4B4B') + "'></span> " + item.comment + ' - ' + item.short_id + '</strong><br/><small>' + (item.day_types ? item.day_types.match(/[A-Z]?[a-z]+/g).join(', ') : "") + '</small>'} + {text: '<strong>' + "<span class='fa fa-circle' style='color:" + (item.color ? item.color : '#4B4B4B') + "'></span> " + item.comment + ' - ' + humanOID(item.objectid) + '</strong><br/><small>' + (item.day_types ? item.day_types.match(/[A-Z]?[a-z]+/g).join(', ') : "") + '</small>'} ) ) }; diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/VJSelect2.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/VJSelect2.js index cc2ee4b9e..b9678ea9a 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/VJSelect2.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/VJSelect2.js @@ -2,6 +2,7 @@ var _ = require('lodash') var React = require('react') var PropTypes = require('react').PropTypes var Select2 = require('react-select2') +var humanOID = require('../../../actions').humanOID // get JSON full path var origin = window.location.origin @@ -12,10 +13,6 @@ class BSelect4b extends React.Component{ constructor(props) { super(props) } - humanOID(oid) { - var a = oid.split(':') - return a[a.length - 1] - } render() { return ( @@ -46,7 +43,7 @@ class BSelect4b extends React.Component{ item => _.assign( {}, item, - { id: item.objectid, text: _.last(_.split(item.objectid, ':')) } + { id: item.objectid, text: humanOID(item.objectid) } ) ) }; diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/containers/tools/DuplicateVehicleJourney.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/containers/tools/DuplicateVehicleJourney.js index 224b52a19..70e8fde4d 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/containers/tools/DuplicateVehicleJourney.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/containers/tools/DuplicateVehicleJourney.js @@ -19,8 +19,8 @@ const mapDispatchToProps = (dispatch) => { onOpenDuplicateModal: () =>{ dispatch(actions.openDuplicateModal()) }, - onDuplicateVehicleJourney: (data, departureDelta) =>{ - dispatch(actions.duplicateVehicleJourney(data, departureDelta)) + onDuplicateVehicleJourney: (addtionalTime, duplicateNumber, departureDelta) =>{ + dispatch(actions.duplicateVehicleJourney(addtionalTime, duplicateNumber, departureDelta)) } } } diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/reducers/vehicleJourneys.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/reducers/vehicleJourneys.js index d463d4b8f..969b2ddd8 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/reducers/vehicleJourneys.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/reducers/vehicleJourneys.js @@ -51,17 +51,8 @@ const vehicleJourney= (state = {}, action, keep) => { let shiftedArray, shiftedSchedule, shiftedVjas shiftedArray = state.vehicle_journey_at_stops.map((vjas, i) => { if (!vjas.dummy){ - shiftedSchedule = { - departure_time: { - hour: vjas.departure_time.hour, - minute: actions.simplePad(parseInt(vjas.departure_time.minute) + parseInt(action.data.additional_time.value)) - }, - arrival_time: { - hour: vjas.arrival_time.hour, - minute: actions.simplePad(parseInt(vjas.arrival_time.minute) + parseInt(action.data.additional_time.value)) - } - } - actions.checkSchedules(shiftedSchedule) + shiftedSchedule = actions.getShiftedSchedule(vjas, action.addtionalTime) + shiftedVjas = _.assign({}, state.vehicle_journey_at_stops[i], shiftedSchedule) vjas = _.assign({}, state.vehicle_journey_at_stops[i], shiftedVjas) if(!keep){ @@ -181,13 +172,16 @@ const vehicleJourneys = (state = [], action) => { let dupeVj let dupes = [] let selectedIndex - let val = action.data.additional_time.value + let val = action.addtionalTime let departureDelta = action.departureDelta state.map((vj, i) => { if(vj.selected){ selectedIndex = i - for (i = 0; i< action.data.duplicate_number.value; i++){ - action.data.additional_time.value = (parseInt(val) * (i + 1)) + departureDelta + for (i = 0; i< action.duplicateNumber; i++){ + // We check if the departureDelta is != 0 to create the first VJ on the updated deparure time if it is the case + // let delta = departureDelta == 0 ? 1 : 0 + // action.addtionalTime = (val * (i + delta)) + departureDelta + action.addtionalTime = (val * (i + 1)) + departureDelta dupeVj = vehicleJourney(vj, action, false) dupeVj.published_journey_name = dupeVj.published_journey_name + '-' + i dupeVj.selected = false diff --git a/app/assets/javascripts/filters/calendar.js b/app/assets/javascripts/filters/calendar.js new file mode 100644 index 000000000..a4e84777c --- /dev/null +++ b/app/assets/javascripts/filters/calendar.js @@ -0,0 +1,6 @@ +const DateFilter = require('../helpers/date_filters') + +$(document).ready(function(){ + const calendarDF = new DateFilter("#calendar_filter_btn", "Tous les champs du filtre de date doivent être remplis", "#q_contains_date_NUMi") + calendarDF() +}) diff --git a/app/assets/javascripts/filters/import.js b/app/assets/javascripts/filters/import.js new file mode 100644 index 000000000..bb665d5ad --- /dev/null +++ b/app/assets/javascripts/filters/import.js @@ -0,0 +1,6 @@ +const DateFilter = require('../helpers/date_filters') + +$(document).ready(function(){ + const importDF = new DateFilter("#import_filter_btn", "Tous les champs du filtre de date doivent être remplis", "#q_started_at_begin_NUMi", "#q_started_at_end_NUMi") + importDF() +}) diff --git a/app/assets/javascripts/filters/time_table.js b/app/assets/javascripts/filters/time_table.js new file mode 100644 index 000000000..9e24d03fe --- /dev/null +++ b/app/assets/javascripts/filters/time_table.js @@ -0,0 +1,7 @@ +$(document).ready(function(){ + const DateFilter = require('../helpers/date_filters') + + const timetableDF = new DateFilter("#time_table_filter_btn", window.I18n.fr.time_tables.error_period_filter, "#q_start_date_gteq_NUMi", "#q_end_date_lteq_NUMi") + + timetableDF() +}) diff --git a/app/assets/javascripts/filters/workbench.js b/app/assets/javascripts/filters/workbench.js new file mode 100644 index 000000000..af3e13c59 --- /dev/null +++ b/app/assets/javascripts/filters/workbench.js @@ -0,0 +1,6 @@ +const DateFilter = require('../helpers/date_filters') + +$(document).ready(function(){ + const workbenchDF = new DateFilter("#referential_filter_btn", window.I18n.fr.referentials.error_period_filter, "#q_validity_period_begin_gteq_NUMi", "#q_validity_period_end_lteq_NUMi") + workbenchDF() +}) diff --git a/app/assets/javascripts/helpers/date_filters.js b/app/assets/javascripts/helpers/date_filters.js new file mode 100644 index 000000000..1f48bb28f --- /dev/null +++ b/app/assets/javascripts/helpers/date_filters.js @@ -0,0 +1,38 @@ +const DateFilter = function(buttonId, message, ...inputIds) { + this.buttonId = buttonId + this.inputIds = inputIds + this.message = message + + const getVal = (str, key) => { + let newStr = str.replace(/NUM/, key) + return $(newStr).val() + } + + const getDates = () => { + return this.inputIds.reduce((arr, id) => { + let newIds = [1, 2, 3].map(key => getVal(id, key)) + arr.push(...newIds) + return arr + },[]) + } + + const allInputFilled = () => { + return getDates().every(date => !!date) + } + + const noInputFilled = () => { + return getDates().every(date => !date) + } + + const execute = () => { + $(this.buttonId).on("click", (e) => { + if (allInputFilled() == false && noInputFilled() == false) { + e.preventDefault() + alert(this.message) + } + }) + } + return execute +} + +module.exports = DateFilter diff --git a/app/assets/javascripts/routes.coffee b/app/assets/javascripts/routes.coffee index 2e36061b8..4492b381d 100644 --- a/app/assets/javascripts/routes.coffee +++ b/app/assets/javascripts/routes.coffee @@ -1,5 +1,5 @@ $(document).on("change", '#route_wayback', (e) -> - way = if $(this).is(':checked') then "backward" else "straight_forward" + way = if $(this).is(':checked') then "inbound" else "outbound" $('.opposite_route').hide().find('select').prop('disabled', true) field = $(".opposite_route.#{way}") diff --git a/app/assets/javascripts/time_table.coffee b/app/assets/javascripts/time_table.coffee deleted file mode 100644 index 8789cb226..000000000 --- a/app/assets/javascripts/time_table.coffee +++ /dev/null @@ -1,14 +0,0 @@ - $(document).on("click", "#time_table_filter_btn", (e) -> - dates = [1, 2, 3].reduce (arr, key) -> - arr.push $("#q_start_date_gteq_#{key}i").val(), $("#q_end_date_lteq_#{key}i").val() - arr - , [] - - validDate = dates.every (date) -> !!date - - noDate = dates.every (date) -> !date - - unless (validDate || noDate) - e.preventDefault() - alert(window.I18n.fr.time_tables.error_period_filter) - ) diff --git a/app/assets/javascripts/workbench.coffee b/app/assets/javascripts/workbench.coffee deleted file mode 100644 index 0e9fe62a3..000000000 --- a/app/assets/javascripts/workbench.coffee +++ /dev/null @@ -1,18 +0,0 @@ - $(document).on("click", "#referential_filter_btn", (e) -> - dates = [1, 2, 3].reduce (arr, key) -> - arr.push $("#q_validity_period_begin_gteq_#{key}i").val(), $("#q_validity_period_end_lteq_#{key}i").val() - arr - , [] - - validDate = dates.every (date) -> !!date - - noDate = dates.every (date) -> !date - - console.log("valid dates :", validDate) - console.log("no dates :", noDate) - console.log(dates) - - unless (validDate || noDate) - e.preventDefault() - alert(window.I18n.fr.referentials.error_period_filter) - ) diff --git a/app/assets/stylesheets/application.sass b/app/assets/stylesheets/application.sass index e3f776640..50f8b64cb 100644 --- a/app/assets/stylesheets/application.sass +++ b/app/assets/stylesheets/application.sass @@ -18,3 +18,4 @@ @import 'modules/jp_collection' @import 'modules/vj_collection' @import 'modules/timetables' +@import 'modules/import_messages' diff --git a/app/assets/stylesheets/components/_page_header.sass b/app/assets/stylesheets/components/_page_header.sass index 18985083d..566f46d6b 100644 --- a/app/assets/stylesheets/components/_page_header.sass +++ b/app/assets/stylesheets/components/_page_header.sass @@ -9,13 +9,15 @@ .page-icon display: inline-block vertical-align: middle - width: 45px - height: 45px - background-color: rgba(#fff, 0.2) - line-height: 45px + width: 49px + height: 49px + line-height: 49px text-align: center - margin-right: 20px + margin-right: 15px + + > .sb + font-size: 3.5em .page-title display: inline-block diff --git a/app/assets/stylesheets/components/_tables.sass b/app/assets/stylesheets/components/_tables.sass index 3fc92d348..8fe7be374 100644 --- a/app/assets/stylesheets/components/_tables.sass +++ b/app/assets/stylesheets/components/_tables.sass @@ -85,6 +85,74 @@ border-top: 2px solid $darkgrey margin-top: 15px + // Overhead + > thead > tr.overhead + > th + font-size: 1.4rem + text-align: center + + &.overheaded-default + background-color: rgba($grey, 0.15) + + &.full-border + border-left: 2px solid rgba($grey, 0.15) + border-right: 2px solid rgba($grey, 0.15) + + &.overheaded-danger + background-color: $red + color: #fff + + &.full-border + border-left: 2px solid $red + border-right: 2px solid $red + + &.overheaded-warning + background-color: $orange + color: #fff + + &.full-border + border-left: 2px solid $orange + border-right: 2px solid $orange + + &.overheaded-success + background-color: $green + color: #fff + + &.full-border + border-left: 2px solid $green + border-right: 2px solid $green + + tr:not([class*='overhead']) > th, td + &.overheaded-default + border-left: 2px solid rgba($grey, 0.15) + border-right: 2px solid rgba($grey, 0.15) + + &.overheaded-danger + border-left: 2px solid $red + border-right: 2px solid $red + + &.overheaded-warning + border-left: 2px solid $orange + border-right: 2px solid $orange + + &.overheaded-success + border-left: 2px solid $green + border-right: 2px solid $green + + tr:last-child + td + &.overheaded-default + border-bottom: 2px solid rgba($grey, 0.15) + + &.overheaded-danger + border-bottom: 2px solid $red + + &.overheaded-warning + border-bottom: 2px solid $orange + + &.overheaded-success + border-bottom: 2px solid $green + // Specific for tables displaying stop points &.has-stoppoints tbody @@ -144,7 +212,6 @@ margin-top: -8px - // select_toolbox .select_toolbox padding: 10px diff --git a/app/assets/stylesheets/main/access_links.sass b/app/assets/stylesheets/main/access_links.sass deleted file mode 100644 index 65a81a2f8..000000000 --- a/app/assets/stylesheets/main/access_links.sass +++ /dev/null @@ -1,18 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -#workspace.access_links.show - .summary p label - font-weight: bold - - .duration - padding-left: 10px - -#workspace.access_links.edit, -#workspace.access_links.new, -#workspace.access_links.create, -#workspace.access_links.update - .time_select ol - padding: 0 0 0 40% - width: 100%
\ No newline at end of file diff --git a/app/assets/stylesheets/main/access_points.sass b/app/assets/stylesheets/main/access_points.sass deleted file mode 100644 index 11e41967b..000000000 --- a/app/assets/stylesheets/main/access_points.sass +++ /dev/null @@ -1,78 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -// #workspace.access_points.index - -#workspace.access_points.edit, -#workspace.access_points.new, -#workspace.access_points.create, -#workspace.access_points.update - .time_select ol - padding: 0 0 0 40% - width: 100% - -#workspace.access_points.edit - legend - padding-bottom: 20px - -#workspace.access_points.show - .geo_data - padding-left: 15px - - .summary - p label - font-weight: bold - - .access_link_pairs - table - border: 0px - border-collapse: separate - border-spacing: 3px - - .link - border: 2px solid black - - .access_point - padding: 3px 15px 0px 3px - height: 25px - - * - vertical-align: middle - - span - margin-left: 7px - - img - margin: 0px 5px 0px 5px - - .stop_area - padding: 3px 15px 0px 3px - height: 25px - - * - vertical-align: middle - - span - margin-left: 7px - - img - margin: 0px 5px 0px 5px - - .info - font-size: 10px - color: #777 - font-weight: normal - padding-top: 10px - padding-left: 45px - padding-right: 3px - padding-bottom: 3px - -#sidebar ul.selection li - a - line-height: 27px - - img - height: 25px - width: 25px - vertical-align: middle
\ No newline at end of file diff --git a/app/assets/stylesheets/main/api_keys.sass b/app/assets/stylesheets/main/api_keys.sass deleted file mode 100644 index 28bf171b9..000000000 --- a/app/assets/stylesheets/main/api_keys.sass +++ /dev/null @@ -1,7 +0,0 @@ -// Place all the styles related to the routes controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -#workspace.api_keys.show - .summary p label - font-weight: bold
\ No newline at end of file diff --git a/app/assets/stylesheets/main/calendar.sass b/app/assets/stylesheets/main/calendar.sass deleted file mode 100644 index f24f2b212..000000000 --- a/app/assets/stylesheets/main/calendar.sass +++ /dev/null @@ -1,98 +0,0 @@ -// A grey based theme, inspired by Blinksale and their ColorBurn widget. http://firewheeldesign.com - -// AUTHOR: Geoffrey Grosenbach http://nubyonrails.com - -// Colors: -// dk: 787888 -// lt: 4f4f5b -// lter: a8a8a8 -// white: ffffff - -$selected_period_color: #ffbd2b -$selected_date_color: #8fc861 -$excluded_date_color: #ff8f85 -$overlap_date_color: #c082f4 - -.year_choice - font-size: 16px - font-weight: bold - margin: 10px 0 0 0 - text-align: center - - .year - text-align: center - -.calendar_helper - padding: auto - -.calendar - font-size: 10px - color: white - text-align: center - margin-left: 15px - display: inline-table - -thead tr - color: black - -th.monthName - font-size: 12px - font-weight: bold - text-align: center - padding-top: 1em - padding-bottom: 0.7em - color: black - -.dayName th - text-align: center - padding-top: 0.6em - padding-bottom: 0.3em - background-color: #303030 - color: white - border-bottom: 1px solid white - -.otherMonth - color: #999999 - background-color: #4f4f5b - padding: 0.7em - border-right: 1px solid #111111 - border-bottom: 1px solid #111111 - -.day - background-color: #333333 - -.day, .specialDay - border-bottom: 1px solid #111111 - padding: 0.7em - border-right: 1px solid #111111 - border-bottom: 1px solid #111111 - -.specialDay - background-color: #a8a8a8 !important - -.selected_period - background-color: $selected_period_color !important - -.selected_date - background-color: $selected_date_color !important - -.excluded_date - background-color: $excluded_date_color !important - -.overlaped_date - background-color: $overlap_date_color !important - -.specialDay, .selected_period, .selected_date, .overlaped_date, .excluded_date - a, a:visited, a:hover - color: white - text-decoration: none - -.specialDay a:hover, .selected_period a:hover, .selected_date a:hover, .excluded_date a:hover, .overlaped_date a:hover - color: black - -.weekendDay - background-color: #787888 - -.today - background-color: white - color: black
\ No newline at end of file diff --git a/app/assets/stylesheets/main/calendars.sass b/app/assets/stylesheets/main/calendars.sass deleted file mode 100644 index 298ce2a62..000000000 --- a/app/assets/stylesheets/main/calendars.sass +++ /dev/null @@ -1,11 +0,0 @@ -#calendar_form - .btn - margin: 5px - #delete-btn - margin-top: 23px - .well - padding-left: 50px - -#calendar_search_form - button - margin-top: 24px diff --git a/app/assets/stylesheets/main/companies.sass b/app/assets/stylesheets/main/companies.sass deleted file mode 100644 index 2cf1f596c..000000000 --- a/app/assets/stylesheets/main/companies.sass +++ /dev/null @@ -1,9 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -// #workspace.companies.index - -#workspace.companies.show - .summary p label - font-weight: bold
\ No newline at end of file diff --git a/app/assets/stylesheets/main/compliance_checks.sass b/app/assets/stylesheets/main/compliance_checks.sass deleted file mode 100644 index 451972fd5..000000000 --- a/app/assets/stylesheets/main/compliance_checks.sass +++ /dev/null @@ -1,157 +0,0 @@ -// #workspace.compliance_checks.index - -#workspace.compliance_checks.show - @import '../modules/job_status_colors' - @import '../modules/job_status_title' - @import '../partials/ie_report' - @import '../modules/links' - -#validation_success - margin-top: 15px - -#workspace.compliance_checks.report, #workspace.imports.compliance_check - @import '../modules/job_status_colors' - @import '../modules/job_status_title' - @import '../modules/links' - - .status - margin-left: 10px - - .order - margin-bottom: 10px - padding: 5px - border-top: 1px solid #e4e4e4 - border-bottom: 1px solid #e4e4e4 - - .status_ok_error - color: #8fc861 - .status_nok_error - color: #e22b1b - .status_uncheck_error - color: #898e7f - - .status_ok_warning - color: #8fc861 - .status_nok_warning - color: #ffbd2b - .status_uncheck_warning - color: #898e7f - - .resume - &:after - content: " " - display: block - height: 0 - clear: both - visibility: hidden - - .col1 - float: left - width: 45% - - .col2 - margin-left: 10px - float: left - width: 45% - - .graph - height: 200px - - .caption - text-align: center - font-weight: bold - - .report - .table - margin-top: 20px - - dl.inline - width: 100% - overflow: hidden - - dt - float: left - clear: left - width: 35% - padding-top: 5px - border-top: 1px solid #eee - -ms-word-break: break-all - word-break: break-all - word-break: break-word - -webkit-hyphens: auto - -moz-hyphens: auto - -ms-hyphens: auto - hyphens: auto - - dd - float: left - width: 65% - padding-top: 10px - border-top: 1px solid #eee - - .severity__improvment, - .severity_warning, - .severity_error - border: 1px solid - margin: 10px 0px - padding: 10px 10px 10px 10px - background-repeat: no-repeat - background-position: 10px center - -moz-border-radius: 0.5em - -webkit-border-radius: 0.5em - border-radius: 0.5em - height: 100% - - &:after - content: " " - display: block - height: 0 - clear: both - visibility: hidden - - .status_icon - float: left - width: 20% - height: auto - - img - vertical-align: middle - width: 48px - height: 48px - - .status_text - float: left - width: 70% - - .code - font-size: 12px - font-weight: bold - - .severity - font-size: 10px - - .explanation - display: none - font-size: 12px - margin: 5px 0 0 0 - - .attributes - font-size: 10px - font-weight: bold - margin: 5px 0 0px 0 - - .severity_improvment - color: black - background-color: #c5cf4c - - .severity_warning - color: black - background-color: #f1dd30 - - .severity_error - color: black - background-color: #ff9a0c - - .file_error - font-size: 14px - color: #898e7f
\ No newline at end of file diff --git a/app/assets/stylesheets/main/connection_links.sass b/app/assets/stylesheets/main/connection_links.sass deleted file mode 100644 index a23fbcdff..000000000 --- a/app/assets/stylesheets/main/connection_links.sass +++ /dev/null @@ -1,30 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -// #workspace.connection_links.index - -#workspace.connection_links.show - .summary p label - font-weight: bold - - .duration - padding-left: 10px - -#workspace.connection_links.select_departure - .token-input-list - display: inline-block - -#workspace.connection_links.select_arrival - .token-input-list - display: inline-block - -#workspace.connection_links.edit, -#workspace.connection_links.new, -#workspace.connection_links.create, -#workspace.connection_links.update - legend - border: 0px - - .panel - margin-left: 25%
\ No newline at end of file diff --git a/app/assets/stylesheets/main/errors.sass b/app/assets/stylesheets/main/errors.sass deleted file mode 100644 index ee603e459..000000000 --- a/app/assets/stylesheets/main/errors.sass +++ /dev/null @@ -1,21 +0,0 @@ -#workspace.errors - body - text-align: center - - div.error - width: 45em - padding: 1em - margin: 2em auto 0 auto - border: 1px solid #ccc - border-right-color: #999 - border-bottom-color: #999 - - h2 - font-size: 100% - color: #f00 - line-height: 1.5em - font-weight: bold - - a, a:visited - text-decoration: underline - color: blue
\ No newline at end of file diff --git a/app/assets/stylesheets/main/export_tasks.sass b/app/assets/stylesheets/main/export_tasks.sass deleted file mode 100644 index 799b5a13f..000000000 --- a/app/assets/stylesheets/main/export_tasks.sass +++ /dev/null @@ -1,10 +0,0 @@ -#workspace.export_tasks.new, #workspace.export_tasks.create - .nav - margin: 30px 0 10px 0 - - .highlight - padding: 9px 14px - margin-bottom: 14px - background-color: #f7f7f9 - border: 1px solid #e1e1e8 - border-radius: 4px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/exports.sass b/app/assets/stylesheets/main/exports.sass deleted file mode 100644 index 875dc13f5..000000000 --- a/app/assets/stylesheets/main/exports.sass +++ /dev/null @@ -1,19 +0,0 @@ -// Place all the styles related to the Exports controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -#workspace.exports.index - .panel.export - .panel-footer - .history - margin-top: 5px - -#workspace.exports.show - @import '../partials/ie_report' - @import '../modules/job_status_colors' - @import '../modules/job_status_title' - @import '../modules/links' - - .export-attributes - font-size: 1.7em - margin-top: 20px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/group_of_lines.sass b/app/assets/stylesheets/main/group_of_lines.sass deleted file mode 100644 index d63eeb607..000000000 --- a/app/assets/stylesheets/main/group_of_lines.sass +++ /dev/null @@ -1,15 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -// #workspace.group_of_lines.index - -#workspace.group_of_lines.show - .summary p label - font-weight: bold - - .lines_detail div.page_info - margin-top: 0px - - .lines - margin-top: 10px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/help.sass b/app/assets/stylesheets/main/help.sass deleted file mode 100644 index 87f21c3c3..000000000 --- a/app/assets/stylesheets/main/help.sass +++ /dev/null @@ -1,121 +0,0 @@ -#workspace.help - ul li - list-style: circle - margin: 7px 0 7px 20px - - ol ul li - list-style: circle - margin: 7px 0 7px 20px - - ol - list-style: none - margin: 7px 0 7px 20px - padding: 0 - counter-reset: num - - li:before - content: counter(num) '. ' - counter-increment: num - - ol li:before - content: counters(num, '.') ' ' - - em, cite - font-style: italic - - strong - font-weight: bold - - p.attr_data - font-style: italic - text-decoration: underline - - p.olnext - margin: -7px 0 0 40px !important - - p.ddnext - margin: 0 0 0 30px !important - - p.note - margin-left: 20px !important - font-weight: bold - - p.border_image - text-align: center - - img - border-style: solid - border-width: 1px - border-color: rgb(187,187,187) - - table - width: 100% - - td - padding: 3px 5px - width: 30% - - &.meta - width: 50% - - th, td - border: 1px solid black - - dt - font-style: italic - margin: 5px 0 - - dd - padding-left: 10px - -#sidebarhelp.help - h2 - font-size: 17px - - h3 - font-size: 15px - - h4 - font-weight: bold - padding: 7px 0 - - ul li - list-style: circle - margin: 7px 0 7px 20px - - ol - list-style: none - margin: 7px 0 7px 20px - padding: 0 - counter-reset: num - - li:before - content: counter(num) '. ' - counter-increment: num - - ol li:before - content: counters(num, '.') ' ' - - em, cite - font-style: italic - - strong - font-weight: bold - - p.attr_data - font-style: italic - text-decoration: underline - - table - width: 100% - - td - padding: 3px 5px - width: 30% - - dt - font-style: italic - margin: 5px 0 - - dd - padding-left: 10px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/import_tasks.sass b/app/assets/stylesheets/main/import_tasks.sass deleted file mode 100644 index 810582cf2..000000000 --- a/app/assets/stylesheets/main/import_tasks.sass +++ /dev/null @@ -1,11 +0,0 @@ -#workspace.import_tasks.new, -#workspace.import_tasks.create - .nav - margin: 30px 0 10px 0 - - .highlight - padding: 9px 14px - margin-bottom: 14px - background-color: #f7f7f9 - border: 1px solid #e1e1e8 - border-radius: 4px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/imports.sass b/app/assets/stylesheets/main/imports.sass deleted file mode 100644 index af5e88218..000000000 --- a/app/assets/stylesheets/main/imports.sass +++ /dev/null @@ -1,40 +0,0 @@ -#workspace.imports.index - .panel.import - .panel-footer - min-height: 5.5em - - .save-mode - color: $brand-info - - .fa-lg - font-size: 1em - .fa-ban - opacity: 0.6 - - .history - margin-top: 5px - -#workspace.imports.index, -#workspace.imports.show - .import-attributes - .save-mode, .format - display: inline-block - - .save-mode - color: $brand-info - margin-left: 0.3em - - .fa-ban - opacity: 0.6 - .fa-stack - font-size: 0.9em - -#workspace.imports.show - @import '../partials/ie_report' - @import '../modules/job_status_colors' - @import '../modules/job_status_title' - @import '../modules/links' - - .import-attributes - font-size: 1.7em - margin-top: 20px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/journey_patterns.sass b/app/assets/stylesheets/main/journey_patterns.sass deleted file mode 100644 index 07c3260d4..000000000 --- a/app/assets/stylesheets/main/journey_patterns.sass +++ /dev/null @@ -1,49 +0,0 @@ -// Place all the styles related to the routes controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -#workspace.journey_patterns.edit, -#workspace.journey_patterns.new, -#workspace.journey_patterns.create, -#workspace.journey_patterns.update - #route_color - width: 100px - color: white - font-weight: bold - - #journey_pattern_stop_point_ids_input fieldset .choices-group - margin-top: 25px - -#workspace.journey_patterns.show - .journey_pattern_color - color: white - font-weight: bold - padding: 0 5px 0 5px - - .summary p label - font-weight: bold - - .stop_points_detail div.page_info - margin-top: 0px - - .stop_points - margin-top: 20px - - .journey_pattern_stop_points - clear: both - margin: 0px - padding: 0px - - .stop_point - .position - width: 25px - height: 20px - float: left - background-color: #61970B - font-weight: bold - color: white - margin-right: 10px - padding-left: 4px - - #middle #sidebar a.control-shape - color: orange
\ No newline at end of file diff --git a/app/assets/stylesheets/main/layout.sass b/app/assets/stylesheets/main/layout.sass deleted file mode 100644 index d75c359ae..000000000 --- a/app/assets/stylesheets/main/layout.sass +++ /dev/null @@ -1,133 +0,0 @@ -body - padding-top: 50px - -h1 - color: white - -h1, .h1, h2, .h2, h3, .h3 - margin-bottom: 20px - -label.label - color: black - font-size: 100% - -ol.breadcrumb - margin-top: 10px - -.ce-hide - display: none - -#middle - position: relative - min-height: 500px - -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, .2) - box-shadow: 0 0 5px 2px rgba(0, 0, 0, .2) - padding-top: 10px - padding-bottom: 10px - margin-top: 20px - margin-bottom: 20px - background: white - - .main_actions - text-align: right - - .alert - margin-top: 15px - - #sidebar - height: 100% - padding-top: 20px - border-left: 1px solid $gray-lighter - - &.ce-SidebarFloatBlock - position: absolute - height: auto - right: 0 - background-color: #fff - top: 45px - - label - color: #555555 - font-weight: normal - font-size: 12px - - a - color: #666 - - .actions - margin-bottom: 20px - - li - margin-bottom: 5px - - p - font-size: 12px - - fieldset.history_tag - font-size: 12px - color: $gray-light - - legend - font-size: 14px - margin-bottom: 10px - - fieldset - border-color: white - - p - margin-top: 5px - - label - font-size: 12px - span - font-style: oblique - font-size: 12px - - ol - padding: 0px - - li - list-style: none - - ul - padding: 0px - - li - list-style: none - - ul.selection li - a - padding-left: 20px - - &.current - text-decoration: none - color: black !important - background: url(image-path('icons/accept.png')) no-repeat - - &.all - background-image: none - - div#compact_form - form - border-bottom: 1px solid #BBB - - fieldset - padding: 0 - border: 0 - - li - padding: 0 - - label - padding-left: 20px - width: 70% - - input - width: 20px - - fieldset.actions - margin-bottom: 0 - padding-left: 20px - - fieldset.inputs - padding-top: 16px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/lines.sass b/app/assets/stylesheets/main/lines.sass deleted file mode 100644 index b9bdfae8f..000000000 --- a/app/assets/stylesheets/main/lines.sass +++ /dev/null @@ -1,87 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -#workspace.lines.index - input[type='checkbox'].multiple_selection - vertical-align: middle - - #search - label - margin-bottom: 0px - - input[type='checkbox'] - margin-left: 3px - -#workspace.lines.edit, -#workspace.lines.new, -#workspace.lines.create, -#workspace.lines.update - #line_color_old - width: 100px - color: white - font-weight: bold - - .nested-fields.footnote, .add_footnote - @extend .col-md-offset-3 - - .footnotes_block - margin-bottom: 30px - -#workspace.lines.show - .summary p - label - font-weight: bold - - .color - padding: 3px 15px 3px 15px - - .group_of_line - .position - width: 25px - height: 20px - float: left - background-color: #61970B - font-weight: bold - color: white - margin-right: 10px - padding-left: 4px - - .color - background-color: white - width: 64px - height: 64px - float: left - margin-right: 10px - border: 1px solid #999 - - a - text-decoration: none - - .name a - display: inline - -.ce-LineBlock-header-list - display: table - width: 100% - margin: 0 - padding: 0 - - > li - display: table-cell - vertical-align: middle - - > input - margin-top: 0 - - &:first-child - width: 37px - - &:last-child - text-align: right - width: 73px - -.ce-LineBlock-header-title - padding: 0 !important - line-height: 12px - font-size: 13px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/multiple_selection.sass b/app/assets/stylesheets/main/multiple_selection.sass deleted file mode 100644 index b46dded01..000000000 --- a/app/assets/stylesheets/main/multiple_selection.sass +++ /dev/null @@ -1,17 +0,0 @@ -input[type='checkbox'].multiple_selection - margin-left: 0px - position: absolute - top: 0px - -#multiple_selection_menu - h3 - margin-top: 20px - - div - padding: 6px 8px - - .actions - margin-top: 20px - - .select_all, .deselect_all - font-size: 0.8em
\ No newline at end of file diff --git a/app/assets/stylesheets/main/networks.sass b/app/assets/stylesheets/main/networks.sass deleted file mode 100644 index 4d3717f26..000000000 --- a/app/assets/stylesheets/main/networks.sass +++ /dev/null @@ -1,9 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -// #workspace.networks.index - -#workspace.networks.show - .summary p label - font-weight: bold
\ No newline at end of file diff --git a/app/assets/stylesheets/main/organisations.sass b/app/assets/stylesheets/main/organisations.sass deleted file mode 100644 index 4bfee860a..000000000 --- a/app/assets/stylesheets/main/organisations.sass +++ /dev/null @@ -1,5 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -// #workspace.organisations.show
\ No newline at end of file diff --git a/app/assets/stylesheets/main/referentials.sass b/app/assets/stylesheets/main/referentials.sass deleted file mode 100644 index 293807560..000000000 --- a/app/assets/stylesheets/main/referentials.sass +++ /dev/null @@ -1,34 +0,0 @@ -// Place all the styles related to the referentials controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -// #workspace.referentials.index - -#workspace.referentials.show - .summary p label - font-weight: bold - - .panel - font-size: 12px - width: 75% - - .panel-heading - font-weight: bold - - li.list-group-item - padding: 5px 15px - -#sidebar div#clean_up - form - fieldset - li - margin-bottom: 0px - - &.date - input - width: 125px - font-size: 12px - height: 25px - - label - width: 35%
\ No newline at end of file diff --git a/app/assets/stylesheets/main/route_sections.sass b/app/assets/stylesheets/main/route_sections.sass deleted file mode 100644 index fe3c98c10..000000000 --- a/app/assets/stylesheets/main/route_sections.sass +++ /dev/null @@ -1,54 +0,0 @@ -#workspace.route_sections_selectors.edit - td.route_section - .input - padding: 0 - margin: 0 - - select - width: 100% - - a.edit-route-section - background: url(image-path('icons/edit.png')) no-repeat 0% 50% - text-indent: -9999px - display: inline-block - width: 16px - height: 16px - margin-right: 8px - - &.disabled - background-image: url(image-path('icons/edit-disabled.png')) - - #map-selection - position: relative - - span - display: inline-block - - .departure, .arrival - width: 25% - - .actions - width: 25% - overflow: visible - padding-left: 0 - position: absolute - right: 0 - -#workspace.route_sections.index - th.distance, th.points - text-align: center - - td.distance, td.points, td.actions - text-align: center - -#workspace.route_sections.edit - .formtastic - .input .label - width: 40% - - .actions - padding-left: 19% - - #map - width: 600px - heigth: 600px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/routes.sass b/app/assets/stylesheets/main/routes.sass deleted file mode 100644 index 977d2f4b3..000000000 --- a/app/assets/stylesheets/main/routes.sass +++ /dev/null @@ -1,46 +0,0 @@ -// Place all the styles related to the routes controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -// #workspace.lines.show - -#workspace.routes.edit, -#workspace.routes.new, -#workspace.routes.create, -#workspace.routes.update - #route_color - width: 100px - color: white - font-weight: bold - - #stop_points .nested-fields - ol - margin-left: 25% - - .handle - margin-left: 5px - - .search_stop_area - margin-bottom: 0px !important - - div.resize - height: 40px - line-height: 40px - font-size: 16px - - #stop_points .links - margin: 10px 0 15px 25% - -#workspace.routes.edit_boarding_alighting - .stop_area - padding-top: 7px - -// #workspace.routes.show - -.large-map - width: 100% - height: 600px - - #map - width: 100% - height: 100%
\ No newline at end of file diff --git a/app/assets/stylesheets/main/rule_parameter_sets.sass b/app/assets/stylesheets/main/rule_parameter_sets.sass deleted file mode 100644 index ab58b7bf9..000000000 --- a/app/assets/stylesheets/main/rule_parameter_sets.sass +++ /dev/null @@ -1,45 +0,0 @@ -// Place all the styles related to the rule_parameter_sets controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -// #workspace.rule_parameter_sets.index - -#workspace.rule_parameter_sets.show, -#workspace.compliance_check_tasks.rule_parameter_set - .summary label - font-weight: bold - - div.attributes_group - margin: 15px 0 15px 0 - - .title - font-weight: bold - - .columns - margin-left: 10px - - div - display: inline-block - - &.two_columns - width: 45% - &.three_columns - width: 30% - &.four_columns - width: 23% - - label - color: #616161 - - .value - margin-left: 5px - - div.rule_parameter_by_mode - margin: 20px 0 0 0 !important - - .mode_specific - display: none - margin: 0 0 0 10px - - p label - color: #616161
\ No newline at end of file diff --git a/app/assets/stylesheets/main/simple_form.sass b/app/assets/stylesheets/main/simple_form.sass deleted file mode 100644 index 143ea692c..000000000 --- a/app/assets/stylesheets/main/simple_form.sass +++ /dev/null @@ -1,3 +0,0 @@ -#workspace - .submit - @extend .col-md-offset-3
\ No newline at end of file diff --git a/app/assets/stylesheets/main/stop_areas.sass b/app/assets/stylesheets/main/stop_areas.sass deleted file mode 100644 index f8e1e148a..000000000 --- a/app/assets/stylesheets/main/stop_areas.sass +++ /dev/null @@ -1,165 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -#workspace.stop_areas.index - #country_codes - display: none - -#workspace.stop_areas.edit, -#workspace.stop_areas.new, -#workspace.stop_areas.update, -#workspace.stop_areas.create - legend - padding-bottom: 20px - - #prefetch - padding: 10px 10px 20px 10px - - label - font-size: 16px - margin-right: 25px - - input - width: 330px - - #map - width: 50% - -#workspace.stop_areas.show - .geo_data - padding-left: 15px - - .summary - p label - font-weight: bold - -.genealogical - .parent - border: 2px solid black - float: left - padding: 3px 15px 3px 3px - - * - vertical-align: middle - - span - margin-left: 7px - img - margin: 0px 5px 0px 5px - - .lines - float: left - - .line - border: 2px solid black - padding: 3px 15px 3px 3px - height: 25px - margin-bottom: 5px - - * - vertical-align: middle - - span - margin-left: 7px - img - margin: 0px 5px 0px 5px - - .no_parent - float: left - padding: 3px 15px 3px 3px - width: 150px - - .target - border: 2px solid #86b41d - float: left - padding: 3px 15px 3px 3px - font-weight: bold - - * - vertical-align: middle - - span - margin-left: 7px - img - margin: 0px 5px 0px 5px - - .children - float: left - - .child - border: 2px solid black - padding: 3px 15px 3px 3px - margin-bottom: 5px - - * - vertical-align: middle - - span - margin-left: 7px - img - margin: 0px 5px 0px 5px - - .link - float: left - padding: 7px - margin-right: 10px - margin-left: 10px - height: 25px - -#workspace.stop_areas.select_parent - .token-input-list - display: inline-block - -#workspace.stop_areas.add_children - .token-input-list - display: inline-block - -#workspace.stop_areas.access_links - .access_link_pairs - .link - border: 2px solid black - - .access_point - float: left - padding: 3px 15px 0px 3px - height: 25px - - * - vertical-align: middle - - span - margin-left: 7px - img - margin: 0px 5px 0px 5px - - .stop_area - float: left - padding: 3px 15px 0px 3px - height: 25px - - * - vertical-align: middle - - span - margin-left: 7px - img - margin: 0px 5px 0px 5px - - .info - font-size: 10px - color: #777 - font-weight: normal - padding-top: 0px - padding-left: 45px - padding-right: 3px - padding-bottom: 3px - -#sidebar ul.selection li - a - line-height: 27px - - img - height: 25px - width: 25px - vertical-align: middle
\ No newline at end of file diff --git a/app/assets/stylesheets/main/stop_points.sass b/app/assets/stylesheets/main/stop_points.sass deleted file mode 100644 index a17814d3b..000000000 --- a/app/assets/stylesheets/main/stop_points.sass +++ /dev/null @@ -1,26 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -#workspace.stop_points.index - // .stop_points - - #sortable_stop_points .stop_point - /* to create multi-column index */ - width: 350px - padding-right: 10px - - .handle - cursor: move - margin-right: 7px - margin-bottom: 20px - - a.link - background: url(image-path('icons/link-small.png')) no-repeat 0% 50% - - .position - background-color: #61970B - font-weight: bold - color: white - margin-right: 10px - padding-left: 4px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/time_table_combinations.sass b/app/assets/stylesheets/main/time_table_combinations.sass deleted file mode 100644 index 9de2c2235..000000000 --- a/app/assets/stylesheets/main/time_table_combinations.sass +++ /dev/null @@ -1,7 +0,0 @@ -#modal_combine - .time_table_combination - .radio input[type='radio'] - position: inherit !important - - .inputs - overflow: visible !important
\ No newline at end of file diff --git a/app/assets/stylesheets/main/time_tables.sass b/app/assets/stylesheets/main/time_tables.sass deleted file mode 100644 index 6918bec1e..000000000 --- a/app/assets/stylesheets/main/time_tables.sass +++ /dev/null @@ -1,135 +0,0 @@ -// Place all the styles related to the lines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -// #workspace.time_tables.index - -#workspace.time_tables.show - .modal-body - overflow-y: visible - - .summary - margin-top: 20px - - p label - font-weight: bold - - .legend - margin-top: 20px - - .title - font-weight: bold - - .excluded_date, .overlaped_date, .selected_date, .selected_period - margin-left: 20px - margin-right: 5px - - .typeahead.dropdown-menu - z-index: 100001 - - .validity_out - color: red - - .validity_out_soon - color: orange - - .validity_regular - color: green - - span.included_day_type - font-weight: bolder - margin-right: 3px - - span.excluded_day_type - margin-right: 3px - - .period - padding-left: 50px - padding-right: 450px - - .date - padding-left: 50px - - .odd - padding-left: 50px - padding-right: 450px - - .even - padding-left: 50px - padding-right: 450px - - .actions - float: right - - #associated_calendars - padding-top: 15px - -#workspace.time_tables.edit, -#workspace.time_tables.new, -#workspace.time_tables.create, -#workspace.time_tables.update, -#workspace.time_tables.duplicate - fieldset.inputs - overflow: visible !important - - .tags - overflow: visible !important - - h3 - .dates - cursor: pointer - - .periods - cursor: pointer - - .excluded_dates - cursor: pointer - - #dates, - #excluded_dates, - #periods - margin-left: 25% - - .nested-fields - margin: 5px - - ol li - display: inline - - .day_type ol - float: left - margin: 0 - padding: 0 0 0 0 - width: 100% - list_style: none outside none - margin-top: 1em - margin-bottom: 1em - - li - float: left - margin: 0 0 0 0 - width: auto - padding: 0 - - label - padding-left: 10% - margin-top: 0 - - .day_type_label - float: left - margin-top: 0 - width: 25% - - a.add_fields - margin-left: 25% - margin-top: 20px - padding-left: 18px - background: url(image-path('icons/add.png')) no-repeat 0% 50% - - a.remove_fields - margin-left: 10px - padding-left: 18px - background: url(image-path('icons/remove.png')) no-repeat 0% 50% - - .actions - margin-top: 20px diff --git a/app/assets/stylesheets/main/vehicle_journey_frequencies.sass b/app/assets/stylesheets/main/vehicle_journey_frequencies.sass deleted file mode 100644 index a827cc4d2..000000000 --- a/app/assets/stylesheets/main/vehicle_journey_frequencies.sass +++ /dev/null @@ -1,155 +0,0 @@ -#workspace - .ce-TimeBandFormTable - .btn - white-space: normal - width: 130px - font-size: 11px - padding: 2px 0 - - .ce-TimeBandFormTable - th - text-align: left - padding: 6px 20px - - td - padding: 6px 20px - - .ce-TimeBandFormTable td - vertical-align: middle - - .ce-TimeBandFormTable-circleLine - position: relative - - .ce-TimeBandFormTable-line:after - content: '' - position: absolute - top: 0 - bottom: 0 - left: 50% - width: 2px - margin-left: -1px - background-color: #61970b - - tr:first-child td .ce-TimeBandFormTable-line:after - top: 50% - - tr:last-child td .ce-TimeBandFormTable-line:after - bottom: 50% - - .ce-TimeBandFormTable-circle - position: relative - z-index: 999 - display: block - width: 16px - height: 16px - border-radius: 8px - background-color: #4d7809 - - tr:hover .ce-TimeBandFormTable-circle - background-color: #fff - border: 2px solid #61970b - - .ce-FrequencyFormFields - display: table - width: 100% - padding-left: 25% - - .token-input-list - width: 80% - - .inline-errors - margin: 0 - - > li - display: table-cell - width: 21% - vertical-align: top - padding: 0 - margin: 0 - - &:first-child select - width: 160px - - &:nth-last-child(2), &:last-child - width: 8% - - label - font-size: 13px - padding-left: 0 - - legend - position: relative - width: auto - float: none - border: 0 - - label - position: relative - - .fragments-group - float: none - width: auto - padding: 0 - - > li - display: inline-block - vertical-align: top - - &.vehicle_journey_frequencies - .actions-add-fields - clear: both - padding-left: 25% - margin-top: 10px - - td.ce-VehicleJourneyBlock-frequency - background-color: rgba(95, 95, 95, 0.2) - - .ce-VehicleJourneyFrequencyTableBlock - margin: 0 !important - - .ce-VehicleJourneyFrequenciesMatrix - margin: 0 - padding: 0 - - > li - background-color: #eee - height: 22px - margin-bottom: 20px - position: relative - - > ul - margin: 0 - padding: 0 - - > li - cursor: pointer - position: absolute - padding: 0 2px - top: 0 - bottom: 0 - background-color: $brand-primary - border-left: 1px solid #000 - border-right: 1px solid #000 - - &:hover - z-index: 9999 - background-color: #4d7809 - top: -2px - bottom: -2px - - > span - display: block - - .ce-VehicleJourneyFrequenciesMatrix-firstDepartureTime, - .ce-VehicleJourneyFrequenciesMatrix-lastDepartureTime - display: none - position: absolute - top: -13px - font-size: 11px - color: #262626 - - .ce-VehicleJourneyFrequenciesMatrix-firstDepartureTime - left: -32px - - .ce-VehicleJourneyFrequenciesMatrix-lastDepartureTime - right: -32px
\ No newline at end of file diff --git a/app/assets/stylesheets/main/vehicle_journeys.sass b/app/assets/stylesheets/main/vehicle_journeys.sass deleted file mode 100644 index ec0b25dbc..000000000 --- a/app/assets/stylesheets/main/vehicle_journeys.sass +++ /dev/null @@ -1,118 +0,0 @@ -#workspace.vehicle_journeys.edit, -#workspace.vehicle_journeys.update, -#workspace.vehicle_journeys.create, -#workspace.vehicle_journeys.new, -#workspace.vehicle_journey_frequencies.edit, -#workspace.vehicle_journey_frequencies.update, -#workspace.vehicle_journey_frequencies.create, -#workspace.vehicle_journey_frequencies.new - #route_color - width: 100px - color: white - font-weight: bold - - .btn - padding: 6px 12px - - .time_table_list - padding-left: 25% - - #vehicle_journey_footnote_ids_input, - #vehicle_journey_frequency_footnote_ids_input - min-height: 3em - - .vehicle_journey_at_stops, - .vehicle_journey_frequency_at_stops - margin-left: 25% - - thead, tbody, tfoot - th, td - text-align: center - - .journey_pattern_dependent_list - tr.no_stop - display: none - - td.departure_time, td.arrival_time - &.missing - background-color: $brand-warning - - &.invalid_position - background-color: $brand-danger - - .title - font-weight: bold - margin-bottom: 20px - - span - margin-left: 10px - margin-right: 10px - - .slide - margin-left: 30px - -#workspace.vehicle_journeys.index, -#workspace.vehicle_journey_frequencies.index - #search - ul.token-input-list - display: inline-block - vertical-align: middle - margin-left: 15px - - .advanced_search - margin-left: 40px - - .time_tables_id_eq - margin-left: 20px - - .vehicle_journey_at_stops_departure_time_gt - margin-left: 20px - - table - margin: 20px 0 0 0 - - .calendars - font-size: 12px - - .stop_area - width: 200px - - td.hours - text-align: center - - tr th.vehicle_journey - text-align: center - -#workspace.vehicle_journeys.show, -#workspace.vehicle_journeys.edit, -#workspace.vehicle_journeys.update, -#workspace.vehicle_journeys.create, -#workspace.vehicle_journeys.new, -#workspace.vehicle_journey_journey.show, -#workspace.vehicle_journey_journey.edit, -#workspace.vehicle_journey_journey.update, -#workspace.vehicle_journey_journey.create, -#workspace.vehicle_journey_journey.new - .slide - cursor: pointer - -#workspace.vehicle_journeys.show, -#workspace.vehicle_journey_frequencies.show - .summary p label - font-weight: bold - -#workspace.vehicle_journeys.timeless, -#workspace.vehicle_journey_frequencies.timeless - .summary p label - font-weight: bold - - .vehicle_journeys, - .vehicle_journey_frequencies - margin-top: 20px - - .vehicle_journey, - .vehicle_journey_frequency - span.included_day_type - font-weight: bolder - - // span.excluded_day_type
\ No newline at end of file diff --git a/app/assets/stylesheets/main/vehicle_translation.sass b/app/assets/stylesheets/main/vehicle_translation.sass deleted file mode 100644 index f1fd12e14..000000000 --- a/app/assets/stylesheets/main/vehicle_translation.sass +++ /dev/null @@ -1,10 +0,0 @@ -#translate_form - .repeat_cloning - margin-top: 30px - - .modal-footer - .actions - padding-left: 75% - - li - margin: 0
\ No newline at end of file diff --git a/app/assets/stylesheets/modules/import_messages.sass b/app/assets/stylesheets/modules/import_messages.sass new file mode 100644 index 000000000..e5666cbcd --- /dev/null +++ b/app/assets/stylesheets/modules/import_messages.sass @@ -0,0 +1,5 @@ +.import_messages + .status_icon + padding-right: 20px + h1 + padding-bottom: 20px diff --git a/app/assets/stylesheets/typography/_fonts.sass b/app/assets/stylesheets/typography/_fonts.sass index 0cc387d74..03ef0b42d 100644 --- a/app/assets/stylesheets/typography/_fonts.sass +++ b/app/assets/stylesheets/typography/_fonts.sass @@ -7,34 +7,34 @@ @font-face // Regular font-family: 'Open Sans' - src: url(asset-path('OpenSans/Regular/OpenSans-Regular.woff2')) format('woff2'), url(asset-path('OpenSans/Regular/OpenSans-Regular.woff')) format('woff'), url(asset-path('OpenSans/Regular/OpenSans-Regular.ttf')) format('ttf') + src: url(asset-path('OpenSans/Regular/OpenSans-Regular.woff2')) format('woff2'), url(asset-path('OpenSans/Regular/OpenSans-Regular.woff')) format('woff'), url(asset-path('OpenSans/Regular/OpenSans-Regular.ttf')) format('truetype') font-weight: 400 font-style: normal @font-face // Regular Italic font-family: 'Open Sans' - src: url(asset-path('OpenSans/Regular/OpenSans-Italic.woff2')) format('woff2'), url(asset-path('OpenSans/Regular/OpenSans-Italic.woff')) format('woff'), url(asset-path('OpenSans/Regular/OpenSans-Italic.ttf')) format('ttf') + src: url(asset-path('OpenSans/Regular/OpenSans-Italic.woff2')) format('woff2'), url(asset-path('OpenSans/Regular/OpenSans-Italic.woff')) format('woff'), url(asset-path('OpenSans/Regular/OpenSans-Italic.ttf')) format('truetype') font-weight: 400 font-style: italic @font-face // Bold font-family: 'Open Sans' - src: url(asset-path('OpenSans/Bold/OpenSans-Bold.woff2')) format('woff2'), url(asset-path('OpenSans/Bold/OpenSans-Bold.woff')) format('woff'), url(asset-path('OpenSans/Bold/OpenSans-Bold.ttf')) format('ttf') + src: url(asset-path('OpenSans/Bold/OpenSans-Bold.woff2')) format('woff2'), url(asset-path('OpenSans/Bold/OpenSans-Bold.woff')) format('woff'), url(asset-path('OpenSans/Bold/OpenSans-Bold.ttf')) format('truetype') font-weight: 700 font-style: normal @font-face // Bold Italic font-family: 'Open Sans' - src: url(asset-path('OpenSans/Bold/OpenSans-BoldItalic.woff2')) format('woff2'), url(asset-path('OpenSans/Bold/OpenSans-BoldItalic.woff')) format('woff'), url(asset-path('OpenSans/Bold/OpenSans-BoldItalic.ttf')) format('ttf') + src: url(asset-path('OpenSans/Bold/OpenSans-BoldItalic.woff2')) format('woff2'), url(asset-path('OpenSans/Bold/OpenSans-BoldItalic.woff')) format('woff'), url(asset-path('OpenSans/Bold/OpenSans-BoldItalic.ttf')) format('truetype') font-weight: 700 font-style: italic //-- sBoiv --// @font-face font-family: 'sboiv' - src: url(asset-path('sBoiv/sboiv.woff?vhxdui')) format('woff'), url(asset-path('sBoiv/sboiv.ttf?vhxdui')) format('ttf') + src: url(asset-path('sBoiv/sboiv.woff?ctftl5')) format('woff'), url(asset-path('sBoiv/sboiv.ttf?ctftl5')) format('truetype') font-weight: normal font-style: normal diff --git a/app/assets/stylesheets/typography/_sboiv.sass b/app/assets/stylesheets/typography/_sboiv.sass index 1f89bad74..e37f89f2d 100644 --- a/app/assets/stylesheets/typography/_sboiv.sass +++ b/app/assets/stylesheets/typography/_sboiv.sass @@ -53,8 +53,86 @@ font-size: 5em -.sb-update-vj:before - content: '\e900' +.sb-ZDLR:before + content: '\e904' + +.sb-ZDER:before + content: '\e905' + +.sb-ZDEP:before + content: '\e906' + +.sb-transporteur:before + content: '\e907' + +.sb-trace:before + content: '\e908' + +.sb-tableau-de-bord:before + content: '\e909' + +.sb-synchro-ilico:before + content: '\e90a' + +.sb-synchro-icar:before + content: '\e90b' + +.sb-reseau:before + content: '\e90c' + +.sb-rapport-de-controle:before + content: '\e90d' + +.sb-OAT:before + content: '\e90e' + +.sb-OAS:before + content: '\e90f' + +.sb-modele-calendrier:before + content: '\e910' + +.sb-mission:before + content: '\e911' + +.sb-ligne_commerciale:before + content: '\e912' + +.sb-ligne_administrative:before + content: '\e913' + +.sb-LDA:before + content: '\e914' + +.sb-jeux-de-donnees:before + content: '\e915' + +.sb-jeux-de-controle:before + content: '\e916' + +.sb-itl:before + content: '\e917' + +.sb-itineraire:before + content: '\e918' + +.sb-importer:before + content: '\e919' + +.sb-horaires-des-courses:before + content: '\e91a' + +.sb-calendrier-application:before + content: '\e91b' + +.sb-arret:before + content: '\e91c' + +.sb-Acces:before + content: '\e91d' + +.sb-chrono:before + content: '\e903' .sb-preparing:before content: '\e901' @@ -62,5 +140,8 @@ .sb-current-ref:before content: '\e902' -.sb-chrono:before - content: '\e903' +.sb-update-vj:before + content: '\e900' + +.sb-ligne:before + content: '\e91e' diff --git a/app/controllers/api/v1/chouette_controller.rb b/app/controllers/api/v1/chouette_controller.rb index 7805074ee..98c2fff05 100644 --- a/app/controllers/api/v1/chouette_controller.rb +++ b/app/controllers/api/v1/chouette_controller.rb @@ -7,7 +7,6 @@ module Api before_action :authenticate private - def authenticate authenticate_or_request_with_http_token do |token, options| @referential = Api::V1::ApiKey.referential_from_token(token) @@ -16,10 +15,10 @@ module Api switch_referential if @api_key end end + def switch_referential Apartment::Tenant.switch!(@api_key.referential.slug) - end - + end end end end diff --git a/app/controllers/api/v1/iboo_controller.rb b/app/controllers/api/v1/iboo_controller.rb new file mode 100644 index 000000000..4db9e9007 --- /dev/null +++ b/app/controllers/api/v1/iboo_controller.rb @@ -0,0 +1,21 @@ +class Api::V1::IbooController < Api::V1::ChouetteController + protected + def begin_of_association_chain + @current_organisation + end + + private + def authenticate + authenticate_with_http_basic do |code, token| + if organisation = Organisation.find_by(code: code) + if organisation.api_keys.exists?(token: token) + @current_organisation = organisation + end + end + end + + unless @current_organisation + request_http_basic_authentication + end + end +end diff --git a/app/controllers/api/v1/imports_controller.rb b/app/controllers/api/v1/imports_controller.rb new file mode 100644 index 000000000..6050418d8 --- /dev/null +++ b/app/controllers/api/v1/imports_controller.rb @@ -0,0 +1,15 @@ +class Api::V1::ImportsController < Api::V1::IbooController + defaults :resource_class => WorkbenchImport + belongs_to :workbench + + def create + args = workbench_import_params.merge(creator: 'Webservice') + @import = parent.workbench_imports.create(args) + create! + end + + private + def workbench_import_params + params.require(:workbench_import).permit(:file, :name) + end +end diff --git a/app/controllers/api/v1/netex_imports_controller.rb b/app/controllers/api/v1/netex_imports_controller.rb index 8f7c8e67e..fc85e35dd 100644 --- a/app/controllers/api/v1/netex_imports_controller.rb +++ b/app/controllers/api/v1/netex_imports_controller.rb @@ -3,6 +3,8 @@ module Api class NetexImportsController < ChouetteController include ControlFlow + skip_before_action :authenticate + def create respond_to do | format | format.json(&method(:create_models)) @@ -26,8 +28,21 @@ module Api end def create_netex_import - @netex_import = NetexImport.new(netex_import_params.merge(referential_id: @new_referential.id, creator: 'Webservice')) + attributes = netex_import_params.merge creator: "Webservice" + + if @new_referential.persisted? + attributes = attributes.merge referential_id: @new_referential.id + else + attributes = attributes.merge status: "failed" + end + + @netex_import = NetexImport.new attributes @netex_import.save! + + unless @netex_import.referential + Rails.logger.info "Can't create referential for import #{@netex_import.id}: #{@new_referential.inspect} #{@new_referential.metadatas.inspect} #{@new_referential.errors.full_messages}" + @netex_import.messages.create criticity: :error, message_key: "referential_creation" + end rescue ActiveRecord::RecordInvalid render json: {errors: @netex_import.errors}, status: 406 finish_action! @@ -38,17 +53,34 @@ module Api Referential.new( name: netex_import_params['name'], organisation_id: @workbench.organisation_id, - workbench_id: @workbench.id) - @new_referential.save! - rescue ActiveRecord::RecordInvalid - render json: {errors: @new_referential.errors}, status: 406 - finish_action! + workbench_id: @workbench.id, + metadatas: [metadata] + ) + @new_referential.save + end + + def metadata + metadata = ReferentialMetadata.new + + if netex_import_params['file'] + netex_file = STIF::NetexFile.new(netex_import_params['file'].to_io) + frame = netex_file.frames.first + + if frame + metadata.periodes = frame.periods + + line_objectids = frame.line_refs.map { |ref| "STIF:CODIFLIGNE:Line:#{ref}" } + metadata.line_ids = @workbench.lines.where(objectid: line_objectids).pluck(:id) + end + end + + metadata end def netex_import_params params .require('netex_import') - .permit(:file, :name, :workbench_id) + .permit(:file, :name, :workbench_id, :parent_id, :parent_type) end end end diff --git a/app/controllers/api/v1/workbenches_controller.rb b/app/controllers/api/v1/workbenches_controller.rb new file mode 100644 index 000000000..3c07997ce --- /dev/null +++ b/app/controllers/api/v1/workbenches_controller.rb @@ -0,0 +1,3 @@ +class Api::V1::WorkbenchesController < Api::V1::IbooController + defaults :resource_class => Workbench +end diff --git a/app/controllers/api_keys_controller.rb b/app/controllers/api_keys_controller.rb index 35a84da87..f8b96afdc 100644 --- a/app/controllers/api_keys_controller.rb +++ b/app/controllers/api_keys_controller.rb @@ -1,22 +1,41 @@ -class ApiKeysController < ChouetteController - defaults :resource_class => Api::V1::ApiKey - - belongs_to :referential +class ApiKeysController < BreadcrumbController + defaults resource_class: Api::V1::ApiKey + include PolicyChecker def create - create! { referential_path(@referential) } + @api_key = Api::V1::ApiKey.new(api_key_params.merge(organisation: current_organisation)) + create! do |format| + format.html { + redirect_to workbenches_path + } + end end + def update - update! { referential_path(@referential) } + update! do |format| + format.html { + redirect_to workbenches_path + } + end end + def destroy - destroy! { referential_path(@referential) } + destroy! do |format| + format.html { + redirect_to workbenches_path + } + end end private def api_key_params - params.require(:api_key).permit( :name ) - end - -end + params.require(:api_key).permit(:name, :referential_id) + end + def decorate_api_keys(api_keys) + ModelDecorator.decorate( + api_keys, + with: ApiKeyDecorator, + ) + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d15aa336d..853c2f715 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -33,6 +33,17 @@ class ApplicationController < ActionController::Base end helper_method :current_organisation + def current_offer_workbench + current_organisation.workbenches.find_by_name("Gestion de l'offre") + end + helper_method :current_offer_workbench + + def current_functional_scope + functional_scope = current_organisation.sso_attributes.try(:[], "functional_scope") if current_organisation + JSON.parse(functional_scope) if functional_scope + end + helper_method :current_functional_scope + def begin_of_association_chain current_organisation end diff --git a/app/controllers/autocomplete_time_tables_controller.rb b/app/controllers/autocomplete_time_tables_controller.rb index e977a28b0..f65f5b9f6 100644 --- a/app/controllers/autocomplete_time_tables_controller.rb +++ b/app/controllers/autocomplete_time_tables_controller.rb @@ -9,20 +9,25 @@ class AutocompleteTimeTablesController < InheritedResources::Base end def referential - @referential ||= current_organisation.referentials.find params[:referential_id] + @referential ||= Referential.find params[:referential_id] end protected def select_time_tables - scope = referential.time_tables + scope = params[:source_id] ? referential.time_tables.where("time_tables.id != ?", params[:source_id]) : referential.time_tables if params[:route_id] scope = scope.joins(vehicle_journeys: :route).where( "routes.id IN (#{params[:route_id]})") end - scope + scope.distinct + end + + def split_params! search + params[:q][search] = params[:q][search].split(" ") if params[:q][search] end def collection + split_params! :comment_or_objectid_cont_any @time_tables = select_time_tables.search(params[:q]).result.paginate(page: params[:page]) end end diff --git a/app/controllers/compliance_check_tasks_controller.rb b/app/controllers/compliance_check_tasks_controller.rb deleted file mode 100644 index c2995c94d..000000000 --- a/app/controllers/compliance_check_tasks_controller.rb +++ /dev/null @@ -1,49 +0,0 @@ -class ComplianceCheckTasksController < ChouetteController - defaults :resource_class => ComplianceCheckTask - - respond_to :html, :only => [:new, :create] - respond_to :js, :only => [:new, :create] - - belongs_to :referential - - def new - begin - new! - rescue Ievkit::Error, Faraday::Error => error - logger.error("Iev failure : #{error.message}") - flash[:error] = t(error.locale_for_error) - redirect_to referential_path(@referential) - end - end - - def create - begin - create! do |success, failure| - success.html { redirect_to referential_compliance_checks_path(@referential) } - end - rescue Ievkit::Error, Faraday::Error => error - logger.error("Iev failure : #{error.message}") - flash[:error] = t(error.locale_for_error) - redirect_to referential_path(@referential) - end - end - - def references - references_type = params[:filter].pluralize - references = @referential.send(references_type).where("name ilike ?", "%#{params[:q]}%").select("id, name") - puts references.inspect - respond_to do |format| - format.json do - render :json => references.collect { |child| { :id => child.id, :name => child.name } } - end - end - end - - protected - - def build_resource - @compliance_check_task ||= ComplianceCheckTask.new( params[:compliance_check_task] || {} ) - end - - -end diff --git a/app/controllers/compliance_checks_controller.rb b/app/controllers/compliance_checks_controller.rb index 2d67aae98..07438cf99 100644 --- a/app/controllers/compliance_checks_controller.rb +++ b/app/controllers/compliance_checks_controller.rb @@ -1,87 +1,4 @@ -require 'will_paginate/array' - class ComplianceChecksController < ChouetteController - defaults :resource_class => ComplianceCheck - - respond_to :html, :js - respond_to :zip, :only => :export - belongs_to :referential - - def index - begin - index! do - build_breadcrumb :index - end - rescue Ievkit::Error, Faraday::Error => error - logger.error("Iev failure : #{error.message}") - flash[:error] = t(error.locale_for_error) - redirect_to referential_path(@referential) - end - end - - def show - begin - show! do |format| - build_breadcrumb :show - end - rescue Ievkit::Error, Faraday::Error => error - logger.error("Iev failure : #{error.message}") - flash[:error] = t(error.locale_for_error) - redirect_to referential_path(@referential) - end - end - - def report - resource - build_breadcrumb :report - end - - def references - @references = referential.send(params[:type]).where("name ilike ?", "%#{params[:q]}%") - respond_to do |format| - format.json do - render json: @references.collect { |child| { id: child.id, name: child.name } } - end - end - end - - def rule_parameter_set - begin - @rule_parameter_set = resource.rule_parameter_set - build_breadcrumb :rule_parameter_set - render "rule_parameter_sets/show" - rescue Ievkit::Error, Faraday::Error => error - logger.error("Iev failure : #{error.message}") - flash[:error] = t(error.locale_for_error) - redirect_to referential_path(@referential) - end - end - - def export - respond_to do |format| - format.zip { send_file ComplianceCheckExport.new(resource, @referential.id, request).export, :type => :zip } - end - end - - protected - - alias_method :compliance_check, :resource - - def compliance_check_service - ComplianceCheckService.new(@referential) - end - - def resource - @compliance_check ||= compliance_check_service.find(params[:id]) - @line_items = @compliance_check.report.line_items - if @line_items.size > 500 - @line_items = @line_items.paginate(page: params[:page], per_page: 20) - end - @compliance_check - end - def collection - @compliance_checks ||= compliance_check_service.all.sort_by{ |compliance_check| compliance_check.created_at }.reverse.paginate(:page => params[:page]) - end end diff --git a/app/controllers/compliance_control_sets_controller.rb b/app/controllers/compliance_control_sets_controller.rb new file mode 100644 index 000000000..1b23becaa --- /dev/null +++ b/app/controllers/compliance_control_sets_controller.rb @@ -0,0 +1,33 @@ +class ComplianceControlSetsController < BreadcrumbController + defaults resource_class: ComplianceControlSet + respond_to :html + + def index + index! do |format| + format.html { + @compliance_control_sets = decorate_compliance_control_sets(@compliance_control_sets) + } + end + end + + def show + show! do + @compliance_control_set = @compliance_control_set.decorate + end + end + + def decorate_compliance_control_sets(compliance_control_sets) + ModelDecorator.decorate( + compliance_control_sets, + with: ComplianceControlSetDecorator + ) + end + + protected + + private + + def compliance_control_set_params + params.require(:compliance_control_set).permit(:name) + end +end diff --git a/app/controllers/compliance_controls_controller.rb b/app/controllers/compliance_controls_controller.rb new file mode 100644 index 000000000..dad9b935a --- /dev/null +++ b/app/controllers/compliance_controls_controller.rb @@ -0,0 +1,38 @@ +class ComplianceControlsController < BreadcrumbController + include PolicyChecker + defaults resource_class: ComplianceControl + belongs_to :compliance_control_set + + def index + index! do |format| + format.html { + @compliance_controls = decorate_compliance_controls(@compliance_controls) + } + end + end + + def create + create!(notice: t('notice.compliance_control.created')) + end + + def update + path = compliance_control_set_compliance_control_path(parent, resource) + update!(notice: t('notice.compliance_control.updated')) { path } + end + + def destroy + destroy!(notice: t('notice.compliance_control.destroyed')) + end + + private + def decorate_compliance_controls(compliance_controls) + ModelDecorator.decorate( + compliance_controls, + with: ComplianceControlDecorator, + ) + end + + def compliance_control_params + params.require(:compliance_control).permit(:name, :code, :criticity, :comment, :control_attributes) + end +end diff --git a/app/controllers/import_messages_controller.rb b/app/controllers/import_messages_controller.rb new file mode 100644 index 000000000..4ad398cbb --- /dev/null +++ b/app/controllers/import_messages_controller.rb @@ -0,0 +1,26 @@ +class ImportMessagesController < BreadcrumbController + defaults resource_class: ImportMessage, collection_name: 'import_messages', instance_name: 'import_message' + respond_to :csv + belongs_to :import, :parent_class => Import do + belongs_to :import_resource, :parent_class => ImportResource + end + + + def index + index! do |format| + format.csv { + send_data ImportMessageExport.new(:import_messages => @import_messages).to_csv(:col_sep => ";") , :filename => "#{File.basename(@import_resource.name)}_#{Time.now.to_i}.csv" + } + end + end + + protected + def collection + @import_messages ||= parent.messages + end + + def parent + @import_resource ||= ImportResource.find(params[:import_resource_id]) + end + +end diff --git a/app/controllers/import_resources_controller.rb b/app/controllers/import_resources_controller.rb new file mode 100644 index 000000000..ac3dd042e --- /dev/null +++ b/app/controllers/import_resources_controller.rb @@ -0,0 +1,40 @@ +class ImportResourcesController < BreadcrumbController + defaults resource_class: ImportResource, collection_name: 'import_resources', instance_name: 'import_resource' + respond_to :html + belongs_to :import + + def index + index! do |format| + format.html { + @import_resources = decorate_import_resources(@import_resources) + } + + build_breadcrumb :index + end + end + + def download + if params[:token] == resource.token_download + send_file resource.file.path + else + user_not_authorized + end + end + + protected + def collection + @import_resources ||= parent.resources + end + + private + + def decorate_import_resources(import_resources) + ImportResourcesDecorator.decorate( + import_resources, + with: ImportResourceDecorator, + context: { + import: @import + } + ) + end +end diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb index 916e5ac23..fa8919f20 100644 --- a/app/controllers/imports_controller.rb +++ b/app/controllers/imports_controller.rb @@ -1,11 +1,17 @@ class ImportsController < BreadcrumbController skip_before_action :authenticate_user!, only: [:download] defaults resource_class: Import, collection_name: 'imports', instance_name: 'import' + before_action :ransack_started_at_params, only: [:index] + before_action :ransack_status_params, only: [:index] respond_to :html belongs_to :workbench def show show! do + @import = @import.decorate(context: { + workbench: @workbench + }) + build_breadcrumb :show end end @@ -30,10 +36,6 @@ class ImportsController < BreadcrumbController end end - def create - create! { workbench_import_path(parent, resource) } - end - def download if params[:token] == resource.token_download send_file resource.file.path @@ -44,7 +46,10 @@ class ImportsController < BreadcrumbController protected def collection - @q = parent.imports.search(params[:q]) + scope = parent.imports.where(type: "WorkbenchImport") + scope = ransack_period scope + + @q = scope.search(params[:q]) if sort_column && sort_direction @imports ||= @q.result(distinct: true).order(sort_column + ' ' + sort_direction).paginate(page: params[:page], per_page: 10) @@ -55,9 +60,44 @@ class ImportsController < BreadcrumbController private + def ransack_started_at_params + start_date = [] + end_date = [] + + if params[:q] && params[:q][:started_at] && !params[:q][:started_at].has_value?(nil) && !params[:q][:started_at].has_value?("") + [1, 2, 3].each do |key| + start_date << params[:q][:started_at]["begin(#{key}i)"].to_i + end_date << params[:q][:started_at]["end(#{key}i)"].to_i + end + params[:q].delete([:started_at]) + @begin_range = DateTime.new(*start_date,0,0,0) rescue nil + @end_range = DateTime.new(*end_date,23,59,59) rescue nil + end + end + + # Fake ransack filter + def ransack_period scope + return scope unless !!@begin_range && !!@end_range + + if @begin_range > @end_range + flash.now[:error] = t('imports.filters.error_period_filter') + else + scope = scope.where_started_at_between(@begin_range, @end_range) + end + scope + end + + def ransack_status_params + if params[:q] + binding.pry + return params[:q].delete(:status_eq_any) if params[:q][:status_eq_any].empty? || ( (Import.status.values & params[:q][:status_eq_any]).length >= 4 ) + params[:q][:status_eq_any].push("new", "running") if params[:q][:status_eq_any].include?("pending") + params[:q][:status_eq_any].push("aborted", "canceled") if params[:q][:status_eq_any].include?("failed") + end + end + def build_resource - # Manage only NetexImports for the moment - @import ||= NetexImport.new(*resource_params) do |import| + @import ||= WorkbenchImport.new(*resource_params) do |import| import.workbench = parent import.creator = current_user.name end diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb index 1da64991d..ec0bbbb18 100644 --- a/app/controllers/referential_lines_controller.rb +++ b/app/controllers/referential_lines_controller.rb @@ -11,7 +11,7 @@ class ReferentialLinesController < ChouetteController belongs_to :referential def show - @routes = resource.routes + @routes = resource.routes.order(:objectid) case sort_route_column when "stop_points", "journey_patterns" diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index afd376092..c8984076a 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -7,17 +7,19 @@ class ReferentialsController < BreadcrumbController respond_to :js, :only => :show def new - if params[:from] - source_referential = Referential.find(params[:from]) - @referential = Referential.new_from(source_referential) + new! do + build_referenial end + end - new! do - @referential.data_format = current_organisation.data_format - @referential.workbench_id ||= params[:workbench_id] + def create + create! do |format| + build_referenial - if @referential.in_workbench? - @referential.init_metadatas default_date_range: Range.new(Date.today, Date.today.advance(months: 1)) + if !!@referential.created_from_id + format.html { redirect_to workbench_path(@referential.workbench) } + else + build_breadcrumb :new end end end @@ -25,7 +27,7 @@ class ReferentialsController < BreadcrumbController def show resource.switch show! do |format| - @referential = @referential.decorate + @referential = @referential.decorate(context: { current_workbench_id: params[:current_workbench_id] } ) @reflines = lines_collection.paginate(page: params[:page], per_page: 10) @reflines = ModelDecorator.decorate( @reflines, @@ -123,6 +125,21 @@ class ReferentialsController < BreadcrumbController super end + def build_referenial + if params[:from] + source_referential = Referential.find(params[:from]) + @referential = Referential.new_from(source_referential, current_functional_scope) + @referential.workbench_id = params[:current_workbench_id] + end + + @referential.data_format = current_organisation.data_format + @referential.workbench_id ||= params[:workbench_id] + + if @referential.in_workbench? + @referential.init_metadatas default_date_range: Range.new(Date.today, Date.today.advance(months: 1)) + end + end + private def sort_column sortable_columns = Chouette::Line.column_names + ['networks.name', 'companies.name'] diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb index 7ba2c1a58..78daffb30 100644 --- a/app/controllers/routes_controller.rb +++ b/app/controllers/routes_controller.rb @@ -69,11 +69,11 @@ class RoutesController < ChouetteController end end - # def update - # update! do |success, failure| - # success.html { redirect_to referential_line_path(@referential,@line) } - # end - # end + def duplicate + route = Chouette::Route.find(params[:id]).duplicate + redirect_to edit_referential_line_route_path(@referential, route.line, route) + end + protected alias_method :route, :resource @@ -94,8 +94,8 @@ class RoutesController < ChouetteController else parent.routes.where(opposite_route: nil) end - @forward = scope.where(wayback: :straight_forward) - @backward = scope.where(wayback: :backward) + @forward = scope.where(wayback: :outbound) + @backward = scope.where(wayback: :inbound) end private diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb index 19af28a98..54ddb8be1 100644 --- a/app/controllers/workbenches_controller.rb +++ b/app/controllers/workbenches_controller.rb @@ -20,8 +20,13 @@ class WorkbenchesController < BreadcrumbController @q_for_form = scope.ransack(params[:q]) @q_for_result = scope.ransack(ransack_params) @wbench_refs = sort_result(@q_for_result.result).paginate(page: params[:page], per_page: 30) - @wbench_refs = ModelDecorator.decorate(@wbench_refs, with: ReferentialDecorator) - + @wbench_refs = ModelDecorator.decorate( + @wbench_refs, + with: ReferentialDecorator, + context: { + current_workbench_id: params[:id] + } + ) show! do build_breadcrumb :show end diff --git a/app/decorators/api_key_decorator.rb b/app/decorators/api_key_decorator.rb new file mode 100644 index 000000000..def3a6a01 --- /dev/null +++ b/app/decorators/api_key_decorator.rb @@ -0,0 +1,30 @@ +class ApiKeyDecorator < Draper::Decorator + decorates Api::V1::ApiKey + delegate_all + + + def action_links + links = [] + + links << Link.new( + content: h.t('api_keys.actions.show'), + href: h.organisation_api_key_path(object), + ) + + links << Link.new( + content: h.t('api_keys.actions.edit'), + href: h.edit_organisation_api_key_path(object), + ) + + if h.policy(object).destroy? + links << Link.new( + content: h.destroy_link_content, + href: h.organisation_api_key_path(object), + method: :delete, + data: { confirm: h.t('api_keys.actions.destroy_confirm') } + ) + end + + links + end +end diff --git a/app/decorators/compliance_control_decorator.rb b/app/decorators/compliance_control_decorator.rb new file mode 100644 index 000000000..38b968ad1 --- /dev/null +++ b/app/decorators/compliance_control_decorator.rb @@ -0,0 +1,25 @@ +class ComplianceControlDecorator < Draper::Decorator + delegate_all + + def action_links + links = [] + + if h.policy(object).destroy? + links << Link.new( + content: h.destroy_link_content, + href: h.compliance_control_set_compliance_control_path(object.compliance_control_set.id, object.id), + method: :delete, + data: { confirm: h.t('compliance_controls.actions.destroy_confirm') } + ) + end + + if h.policy(object).edit? + links << Link.new( + content: h.t('compliance_controls.actions.edit'), + href: h.edit_compliance_control_set_path(object.compliance_control_set.id, object.id) + ) + end + links + end + +end diff --git a/app/decorators/compliance_control_set_decorator.rb b/app/decorators/compliance_control_set_decorator.rb new file mode 100644 index 000000000..876a54d09 --- /dev/null +++ b/app/decorators/compliance_control_set_decorator.rb @@ -0,0 +1,26 @@ +class ComplianceControlSetDecorator < Draper::Decorator + delegate_all + + def action_links + links = [] + + # if h.policy(object).destroy? + links << Link.new( + content: h.destroy_link_content, + href: h.compliance_control_set_path(object.id), + method: :delete, + data: { confirm: h.t('compliance_control_sets.actions.destroy_confirm') } + ) + # end + + # if h.policy(object).edit? + links << Link.new( + content: h.t('compliance_control_sets.actions.edit'), + href: h.edit_compliance_control_set_path(object.id) + ) + # end + links + end + +end + diff --git a/app/decorators/import_decorator.rb b/app/decorators/import_decorator.rb index 4f621f890..d63d723cd 100644 --- a/app/decorators/import_decorator.rb +++ b/app/decorators/import_decorator.rb @@ -3,6 +3,14 @@ class ImportDecorator < Draper::Decorator delegate_all + def import_status_css_class + cls ='' + cls = 'overheaded-success' if object.status == 'successful' + cls = 'overheaded-warning' if object.status == 'warning' + cls = 'overheaded-danger' if %w[failed aborted canceled].include? object.status + cls + end + def action_links links = [] @@ -15,7 +23,7 @@ class ImportDecorator < Draper::Decorator ) links << Link.new( - content: "Téléch. fichier source", + content: h.t('imports.actions.download'), href: object.file.url ) diff --git a/app/decorators/import_resource_decorator.rb b/app/decorators/import_resource_decorator.rb new file mode 100644 index 000000000..9bfd1f757 --- /dev/null +++ b/app/decorators/import_resource_decorator.rb @@ -0,0 +1,10 @@ +class ImportResourceDecorator < Draper::Decorator + decorates ImportResource + + delegate_all + + def action_links + links = [] + end + +end diff --git a/app/decorators/import_resources_decorator.rb b/app/decorators/import_resources_decorator.rb new file mode 100644 index 000000000..2b1a25ef9 --- /dev/null +++ b/app/decorators/import_resources_decorator.rb @@ -0,0 +1,12 @@ +class ImportResourcesDecorator < ModelDecorator + delegate :where + + def lines_imported + where(status: :OK, resource_type: :line).count + end + + def lines_in_zipfile + where(resource_type: :line).count + end + +end diff --git a/app/decorators/referential_decorator.rb b/app/decorators/referential_decorator.rb index ccb47a654..dccf0052c 100644 --- a/app/decorators/referential_decorator.rb +++ b/app/decorators/referential_decorator.rb @@ -13,7 +13,7 @@ class ReferentialDecorator < Draper::Decorator if policy.clone? links << Link.new( content: h.t('actions.clone'), - href: h.new_referential_path(from: object.id) + href: h.new_referential_path(from: object.id, current_workbench_id: context[:current_workbench_id]) ) end if policy.archive? diff --git a/app/decorators/route_decorator.rb b/app/decorators/route_decorator.rb index 484c3db04..510c941a3 100644 --- a/app/decorators/route_decorator.rb +++ b/app/decorators/route_decorator.rb @@ -45,6 +45,18 @@ class RouteDecorator < Draper::Decorator ) ) + if h.policy(object).duplicate? + links << Link.new( + content: h.t('routes.duplicate.title'), + href: h.duplicate_referential_line_route_path( + context[:referential], + context[:line], + object + ), + method: :post + ) + end + if h.policy(object).destroy? links << Link.new( content: h.destroy_link_content, diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb index 55031d4f3..a3ee9de72 100644 --- a/app/helpers/breadcrumb_helper.rb +++ b/app/helpers/breadcrumb_helper.rb @@ -50,6 +50,8 @@ module BreadcrumbHelper compliance_check_breadcrumb action when "ComplianceCheckTask" compliance_check_task_breadcrumb action + when "ComplianceControlSets" + compliance_control_sets_breadcrumb action when "RuleParameterSet" rule_parameter_breadcrumb action when "User" @@ -239,6 +241,11 @@ module BreadcrumbHelper add_breadcrumb breadcrumb_label(@compliance_check_task), referential_compliance_check_task_path(@referential, @compliance_check_task),:title => breadcrumb_tooltip(@compliance_check_task) if action == :edit end + def compliance_control_sets_breadcrumb (action) + add_breadcrumb I18n.t("breadcrumbs.referentials"), workbenches_path + #add_breadcrumb breadcrumb_label(@workbench), workbench_path(@workbench), :title => breadcrumb_tooltip(@workbench) + end + def rule_parameter_breadcrumb (action) organisation_breadcrumb add_breadcrumb Referential.human_attribute_name("rule_parameter_sets"), organisation_path unless action == :index diff --git a/app/helpers/compliance_check_tasks_helper.rb b/app/helpers/compliance_check_tasks_helper.rb deleted file mode 100644 index 5ba8bdc46..000000000 --- a/app/helpers/compliance_check_tasks_helper.rb +++ /dev/null @@ -1,11 +0,0 @@ -module ComplianceCheckTasksHelper - - def button_link_class( compliance_check_task ) - if compliance_check_task.any_error_severity_failure? || compliance_check_task.status == "failed" - "btn-danger" - else - "btn-default" - end - end - -end diff --git a/app/helpers/compliance_checks_helper.rb b/app/helpers/compliance_checks_helper.rb deleted file mode 100644 index d7e42e187..000000000 --- a/app/helpers/compliance_checks_helper.rb +++ /dev/null @@ -1,96 +0,0 @@ -# -*- coding: utf-8 -*- -module ComplianceChecksHelper - - def fields_for_compliance_check_format(form) - begin - render :partial => compliance_check_partial_name(form), :locals => { :form => form } - rescue ActionView::MissingTemplate - "" - end - end - - def compliance_check_partial_name(form) - "fields_#{form.object.format.underscore}_compliance_check" - end - - def compliance_icon( compliance_check) - return nil unless compliance_check.compliance_check_validation_report - compliance_check.compliance_check_validation_report.tap do |cct| - if cct.failed? || cct.any_error_severity_failure? - return 'icons/link_page_alert.png' - else - return 'icons/link_page.png' - end - end - end - - def status_icon( compliance_check_result_status, compliance_check_result_severity ) - if compliance_check_result_status == "uncheck" - ("<i class='fa fa-ban status_" + compliance_check_result_status + "_" + compliance_check_result_severity + "'></i>").html_safe - elsif compliance_check_result_status == "ok" - ("<i class='fa fa-check status_" + compliance_check_result_status + "_" + compliance_check_result_severity + "'></i>").html_safe - else - ("<i class='fa fa-times status_" + compliance_check_result_status + "_" + compliance_check_result_severity + "'></i>").html_safe - end - end - - def test_definition (compliance_check_result_code) - Rails.application.config.validation_spec + I18n.locale.to_s + "/" + compliance_check_result_code +".html" - end - - def object_url (referential_id, error) - location = "/referentials/" + referential_id.to_s - object_path = error[:source].object_path - if object_path.first[:type] == "vehicle_journey" - object_path.delete_at 1 - end - - types, identifiers = object_path.reverse.map { |resource| [ resource[:type], resource[:id] ] }.transpose - - method_name = (['referential'] + types + ['path']).join('_') - identifiers.unshift referential_id - - return send method_name, *identifiers - end - - def object_labels_hash (error) - ### THE error HASH STRUCTURE - # 1. error[:source] - # 0..1 file - # 1 filename - # 0..1 line_number - # 0..1 column_number - # 0..1 objectid - # 0..1 label - # 0.. object_path - # 1 type - # 1 id - # 0.. error[:target] - # 0..1 error[:error_value] - # 0..1 error[:reference_value] - object_labels_hash = Hash.new - object_labels_hash[:source_objectid] = error[:source].objectid if error[:source].objectid.present? - object_labels_hash[:source_label] = error[:source].label if error[:source].label.present? - if error[:source].file.present? - object_labels_hash[:filename] = error[:source].file.filename - object_labels_hash[:line_number] = error[:source].file.line_number if error[:source].file.line_number.present? - object_labels_hash[:column_number] = error[:source].file.column_number if error[:source].file.column_number.present? - end - - if error[:target].present? - error[:target].each_with_index do |target, index| - object_labels_hash["target_#{index}_objectid".to_sym] = target[:objectid] if target[:objectid] - object_labels_hash["target_#{index}_label".to_sym] = target[:label] if target[:label] - end - end - if error[:error_value].present? - object_labels_hash[:error_value] = error[:error_value] - end - if error[:reference_value].present? - object_labels_hash[:reference_value] = error[:reference_value] - end - return object_labels_hash - end - - -end diff --git a/app/helpers/compliance_control_sets_helper.rb b/app/helpers/compliance_control_sets_helper.rb new file mode 100644 index 000000000..3e02e0ef7 --- /dev/null +++ b/app/helpers/compliance_control_sets_helper.rb @@ -0,0 +1,2 @@ +module ComplianceControlSetsHelper +end diff --git a/app/helpers/import_resources_helper.rb b/app/helpers/import_resources_helper.rb new file mode 100644 index 000000000..3ee96eb9b --- /dev/null +++ b/app/helpers/import_resources_helper.rb @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +module ImportResourcesHelper + + # Import statuses helper + def import_resource_status(status) + cls ='' + cls = 'success' if status == 'OK' + cls = 'warning' if status == 'WARNING' + cls = 'danger' if status == 'ERROR' + cls = 'alert' if status == 'IGNORED' + + content_tag :span, '', class: "fa fa-circle text-#{cls}" + end + +end diff --git a/app/helpers/imports_helper.rb b/app/helpers/imports_helper.rb index 5f9db3fb1..1c4549e50 100644 --- a/app/helpers/imports_helper.rb +++ b/app/helpers/imports_helper.rb @@ -1,6 +1,24 @@ # -*- coding: utf-8 -*- module ImportsHelper + # Import statuses helper + def import_status(status) + if %w[new running pending].include? status + content_tag :span, '', class: "fa fa-clock-o" + else + cls ='' + cls = 'success' if status == 'successful' + cls = 'warning' if status == 'warning' + cls = 'danger' if %w[failed aborted canceled].include? status + + content_tag :span, '', class: "fa fa-circle text-#{cls}" + end + end + + ############################## + # TO CLEAN!!! + ############################## + def fields_for_import_task_format(form) begin render :partial => import_partial_name(form), :locals => { :form => form } diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb index ac57997d1..df19113db 100644 --- a/app/helpers/newapplication_helper.rb +++ b/app/helpers/newapplication_helper.rb @@ -222,7 +222,7 @@ module NewapplicationHelper # Left part with pageicon & pagetitle & desc left = content_tag :div, '', class: 'col-lg-9 col-md-8 col-sm-7 col-xs-7' do picon = content_tag :div, '', class: 'page-icon' do - content_tag :span, '', class: "fa fa-lg fa-#{pageicon}" + content_tag :span, '', class: "sb sb-#{pageicon}" end ptitle = content_tag :div, '', class: 'page-title' do content_tag :h1, pagetitle, title: desc diff --git a/app/helpers/routes_helper.rb b/app/helpers/routes_helper.rb index a8c9a1f0c..4bffa99d4 100644 --- a/app/helpers/routes_helper.rb +++ b/app/helpers/routes_helper.rb @@ -6,7 +6,7 @@ module RoutesHelper end def fonticon_wayback(wayback) - if wayback == 'straight_forward' + if wayback == 'outbound' return '<i class="fa fa-arrow-right"></i>'.html_safe else return '<i class="fa fa-arrow-left"></i>'.html_safe diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb index b5497b600..95f53a90d 100644 --- a/app/helpers/table_builder_helper.rb +++ b/app/helpers/table_builder_helper.rb @@ -26,7 +26,10 @@ require 'table_builder_helper/url' # ), # TableBuilderHelper::Column.new( # key: :name, -# attribute: 'name' +# attribute: 'name', +# link_to: lambda do |company| +# referential_company_path(@referential, company) +# end # ), # TableBuilderHelper::Column.new( # key: :phone, @@ -42,7 +45,19 @@ require 'table_builder_helper/url' # ), # ], # links: [:show, :edit], -# cls: 'table has-search' +# cls: 'table has-search', +# overhead: [ +# { +# title: 'one', +# width: 1, +# cls: 'toto' +# }, +# { +# title: 'two <span class="test">Info</span>', +# width: 2, +# cls: 'default' +# } +# ] # ) module TableBuilderHelper # TODO: rename this after migration from `table_builder` @@ -65,19 +80,36 @@ module TableBuilderHelper links: [], # A CSS class to apply to the <table> - cls: '' + cls: '', + + # A set of content, over the th line... + overhead: [] ) content_tag :table, - thead(collection, columns, sortable, selectable, links.any?) + - tbody(collection, columns, selectable, links), + thead(collection, columns, sortable, selectable, links.any?, overhead) + + tbody(collection, columns, selectable, links, overhead), class: cls end private - def thead(collection, columns, sortable, selectable, has_links) + def thead(collection, columns, sortable, selectable, has_links, overhead) content_tag :thead do - content_tag :tr do + # Inserts overhead content if any specified + over_head = '' + + unless overhead.empty? + over_head = content_tag :tr, class: 'overhead' do + oh_cont = [] + + overhead.each do |h| + oh_cont << content_tag(:th, raw(h[:title]), colspan: h[:width], class: h[:cls]) + end + oh_cont.join.html_safe + end + end + + main_head = content_tag :tr do hcont = [] if selectable @@ -85,14 +117,58 @@ module TableBuilderHelper end columns.each do |column| - hcont << content_tag(:th, build_column_header( - column, - sortable, - collection.model, - params, - params[:sort], - params[:direction] - )) + if overhead.empty? + hcont << content_tag(:th, build_column_header( + column, + sortable, + collection.model, + params, + params[:sort], + params[:direction] + )) + + else + i = columns.index(column) + + if overhead[i].blank? + if (i > 0) && (overhead[i - 1][:width] > 1) + clsArrayH = overhead[i - 1][:cls].split + + hcont << content_tag(:th, build_column_header( + column, + sortable, + collection.model, + params, + params[:sort], + params[:direction] + ), class: td_cls(clsArrayH)) + + else + hcont << content_tag(:th, build_column_header( + column, + sortable, + collection.model, + params, + params[:sort], + params[:direction] + )) + end + + else + clsArrayH = overhead[i][:cls].split + + hcont << content_tag(:th, build_column_header( + column, + sortable, + collection.model, + params, + params[:sort], + params[:direction] + ), class: td_cls(clsArrayH)) + + end + + end end # Inserts a blank column for the gear menu @@ -102,10 +178,12 @@ module TableBuilderHelper hcont.join.html_safe end + + (over_head + main_head).html_safe end end - def tbody(collection, columns, selectable, links) + def tbody(collection, columns, selectable, links, overhead) content_tag :tbody do collection.map do |item| @@ -122,15 +200,56 @@ module TableBuilderHelper columns.each do |column| value = column.value(item) - if column_is_linkable?(column) - # Build a link to the `item` - polymorph_url = URL.polymorphic_url_parts( - item, - referential - ) - bcont << content_tag(:td, link_to(value, polymorph_url), title: 'Voir') + if column.linkable? + path = column.link_to(item) + link = link_to(value, path) + + if overhead.empty? + bcont << content_tag(:td, link, title: 'Voir') + + else + i = columns.index(column) + + if overhead[i].blank? + if (i > 0) && (overhead[i - 1][:width] > 1) + clsArrayAlt = overhead[i - 1][:cls].split + + bcont << content_tag(:td, link, title: 'Voir', class: td_cls(clsArrayAlt)) + + else + bcont << content_tag(:td, link, title: 'Voir') + end + + else + clsArray = overhead[columns.index(column)][:cls].split + + bcont << content_tag(:td, link, title: 'Voir', class: td_cls(clsArray)) + end + end + else - bcont << content_tag(:td, value) + if overhead.empty? + bcont << content_tag(:td, value) + + else + i = columns.index(column) + + if overhead[i].blank? + if (i > 0) && (overhead[i - 1][:width] > 1) + clsArrayAlt = overhead[i - 1][:cls].split + + bcont << content_tag(:td, value, class: td_cls(clsArrayAlt)) + + else + bcont << content_tag(:td, value) + end + + else + clsArray = overhead[i][:cls].split + + bcont << content_tag(:td, value, class: td_cls(clsArray)) + end + end end end @@ -148,6 +267,14 @@ module TableBuilderHelper end end + def td_cls(a) + if a.include? 'full-border' + a.slice!(a.index('full-border')) + + return a.join(' ') + end + end + def build_links(item, links) trigger = content_tag( :div, @@ -217,11 +344,6 @@ module TableBuilderHelper ) end end - - def column_is_linkable?(column) - column.attribute == 'name' || column.attribute == 'comment' - end - def gear_menu_link(link) content_tag( :li, diff --git a/app/helpers/table_builder_helper/column.rb b/app/helpers/table_builder_helper/column.rb index 800a8282e..b4c569882 100644 --- a/app/helpers/table_builder_helper/column.rb +++ b/app/helpers/table_builder_helper/column.rb @@ -2,7 +2,7 @@ module TableBuilderHelper class Column attr_reader :key, :name, :attribute, :sortable - def initialize(key: nil, name: '', attribute:, sortable: true) + def initialize(key: nil, name: '', attribute:, sortable: true, link_to: nil) if key.nil? && name.empty? raise ColumnMustHaveKeyOrNameError end @@ -11,6 +11,7 @@ module TableBuilderHelper @name = name @attribute = attribute @sortable = sortable + @link_to = link_to end def value(obj) @@ -29,6 +30,14 @@ module TableBuilderHelper I18n.t("activerecord.attributes.#{model_key}.#{@key}") end + + def linkable? + !@link_to.nil? + end + + def link_to(obj) + @link_to.call(obj) + end end diff --git a/app/helpers/table_builder_helper/url.rb b/app/helpers/table_builder_helper/url.rb index f7ba703ae..a53ac5620 100644 --- a/app/helpers/table_builder_helper/url.rb +++ b/app/helpers/table_builder_helper/url.rb @@ -3,7 +3,7 @@ module TableBuilderHelper def self.polymorphic_url_parts(item, referential) polymorph_url = [] - unless item.is_a?(Calendar) || item.is_a?(Referential) + unless item.is_a?(Calendar) || item.is_a?(Referential) || item.is_a?(ComplianceControlSet) if referential polymorph_url << referential polymorph_url << item.line if item.respond_to? :line diff --git a/app/models/api/v1/api_key.rb b/app/models/api/v1/api_key.rb index e1a7ab5a4..767e65f3a 100644 --- a/app/models/api/v1/api_key.rb +++ b/app/models/api/v1/api_key.rb @@ -3,19 +3,31 @@ module Api class ApiKey < ::ActiveRecord::Base before_create :generate_access_token belongs_to :referential, :class_name => '::Referential' - validates_presence_of :referential + belongs_to :organisation, :class_name => '::Organisation' + + validates_presence_of :organisation class << self def from(referential, name:) find_or_create_by!(name: name, referential: referential) end + + def referential_from_token(token) + array = token.split('-') + if !array.first.empty? && array.size > 1 + ::Referential.find array.first + end + end + def model_name - ActiveModel::Name.new Api::V1, self.name.demodulize + ActiveModel::Name.new self, Api::V1, self.name.demodulize end - def referential_from_token(token) + + def organisation_from_token(token) array = token.split('-') - return nil unless array.size==2 - ::Referential.find( array.first) + if !array[1].empty? && array.size > 1 + ::Organisation.find array[1] + end end end @@ -28,7 +40,7 @@ module Api private def generate_access_token begin - self.token = "#{referential_id}-#{SecureRandom.hex}" + self.token = "#{referential_id}-#{organisation_id}-#{SecureRandom.hex}" end while self.class.exists?(:token => self.token) end end diff --git a/app/models/chouette/access_point.rb b/app/models/chouette/access_point.rb index 476f13c08..4a1ae8a0e 100644 --- a/app/models/chouette/access_point.rb +++ b/app/models/chouette/access_point.rb @@ -4,6 +4,7 @@ require 'geo_ruby' class Chouette::AccessPoint < Chouette::ActiveRecord # FIXME http://jira.codehaus.org/browse/JRUBY-6358 self.primary_key = "id" + include StifReflexAttributesSupport include Geokit::Mappable include ProjectionFields @@ -23,12 +24,15 @@ class Chouette::AccessPoint < Chouette::ActiveRecord validates_numericality_of :longitude, :less_than_or_equal_to => 180, :greater_than_or_equal_to => -180, :allow_nil => true validates_format_of :coordinates, :with => %r{\A *-?(0?[0-9](\.[0-9]*)?|[0-8][0-9](\.[0-9]*)?|90(\.[0]*)?) *\, *-?(0?[0-9]?[0-9](\.[0-9]*)?|1[0-7][0-9](\.[0-9]*)?|180(\.[0]*)?) *\Z}, :allow_nil => true, :allow_blank => true - + before_save :coordinates_to_lat_lng def self.nullable_attributes [:street_name, :country_code, :comment, :long_lat_type, :zip_code, :city_name] end - before_save :coordinates_to_lat_lng + + def referential + @referential ||= Referential.where(:slug => Apartment::Tenant.current).first! + end def referential @referential ||= Referential.where(:slug => Apartment::Tenant.current).first! diff --git a/app/models/chouette/active_record.rb b/app/models/chouette/active_record.rb index 1862319af..e12f30266 100644 --- a/app/models/chouette/active_record.rb +++ b/app/models/chouette/active_record.rb @@ -2,10 +2,8 @@ require 'deep_cloneable' module Chouette class ActiveRecord < ::ActiveRecord::Base - self.abstract_class = true - - before_save :nil_if_blank + before_save :nil_if_blank, :set_data_source_ref # to be overridden to set nullable attrs when empty def self.nullable_attributes @@ -16,17 +14,22 @@ module Chouette self.class.nullable_attributes.each { |attr| self[attr] = nil if self[attr].blank? } end - def human_attribute_name(*args) self.class.human_attribute_name(*args) end + def set_data_source_ref + if self.respond_to?(:data_source_ref) + self.data_source_ref ||= 'DATASOURCEREF_EDITION_BOIV' + end + end + # TODO: Can we remove this? # class << self # alias_method :create_reflection_without_chouette_naming, :create_reflection # def create_reflection(macro, name, options, active_record) - # options = + # options = # Reflection.new(macro, name, options, active_record).options_with_default # create_reflection_without_chouette_naming(macro, name, options, active_record) diff --git a/app/models/chouette/company.rb b/app/models/chouette/company.rb index 7b96e875e..a472020e1 100644 --- a/app/models/chouette/company.rb +++ b/app/models/chouette/company.rb @@ -1,6 +1,6 @@ class Chouette::Company < Chouette::ActiveRecord include CompanyRestrictions - include DefaultNetexAttributesSupport + include StifCodifligneAttributesSupport include LineReferentialSupport has_many :lines diff --git a/app/models/chouette/group_of_line.rb b/app/models/chouette/group_of_line.rb index d954c6699..a987d6311 100644 --- a/app/models/chouette/group_of_line.rb +++ b/app/models/chouette/group_of_line.rb @@ -1,5 +1,5 @@ class Chouette::GroupOfLine < Chouette::ActiveRecord - include DefaultNetexAttributesSupport + include StifCodifligneAttributesSupport include GroupOfLineRestrictions include LineReferentialSupport diff --git a/app/models/chouette/journey_pattern.rb b/app/models/chouette/journey_pattern.rb index fa5fba26d..fa2a9c8bb 100644 --- a/app/models/chouette/journey_pattern.rb +++ b/app/models/chouette/journey_pattern.rb @@ -21,6 +21,11 @@ class Chouette::JourneyPattern < Chouette::TridentActiveRecord attr_accessor :control_checked after_update :control_route_sections, :unless => "control_checked" + + def local_id + "IBOO-#{self.referential.id}-#{self.try(:route).try(:line).try(:objectid).try(:local_id)}-#{self.id}" + end + def checksum_attributes values = self.slice(*['name', 'published_name', 'registration_number']).values values << self.stop_points.map(&:stop_area).map(&:user_objectid) diff --git a/app/models/chouette/netex_object_id.rb b/app/models/chouette/netex_object_id.rb index 07d862992..441004c1e 100644 --- a/app/models/chouette/netex_object_id.rb +++ b/app/models/chouette/netex_object_id.rb @@ -5,7 +5,7 @@ class Chouette::NetexObjectId < String end alias_method :objectid?, :valid? - @@format = /^([A-Za-z_]+):([0-9A-Za-z_]+):([A-Za-z]+):([0-9A-Za-z_-]+)$/ + @@format = /^([A-Za-z_]+):([0-9A-Za-z_]+):([A-Za-z]+):([0-9A-Za-z_-]+)$/ cattr_reader :format def parts @@ -27,7 +27,7 @@ class Chouette::NetexObjectId < String def local_id parts.try(:fourth) end - + def self.create(provider_id, system_id, object_type, local_id) new [provider_id, system_id, object_type, local_id].join(":") end diff --git a/app/models/chouette/network.rb b/app/models/chouette/network.rb index 690c39344..8df205789 100644 --- a/app/models/chouette/network.rb +++ b/app/models/chouette/network.rb @@ -1,5 +1,5 @@ class Chouette::Network < Chouette::ActiveRecord - include DefaultNetexAttributesSupport + include StifCodifligneAttributesSupport include NetworkRestrictions include LineReferentialSupport # FIXME http://jira.codehaus.org/browse/JRUBY-6358 diff --git a/app/models/chouette/object_id.rb b/app/models/chouette/object_id.rb index 4f58048e1..0b122c91b 100644 --- a/app/models/chouette/object_id.rb +++ b/app/models/chouette/object_id.rb @@ -5,7 +5,7 @@ class Chouette::ObjectId < String end alias_method :objectid?, :valid? - @@format = /^([0-9A-Za-z_]+):([A-Za-z]+):([0-9A-Za-z_-]+)$/ + @@format = /^([0-9A-Za-z_]+):([A-Za-z]+):([0-9A-Za-z_-]+)$/ cattr_reader :format def parts @@ -23,7 +23,7 @@ class Chouette::ObjectId < String def local_id parts.try(:third) end - + def self.create(system_id, object_type, local_id) new [system_id, object_type, local_id].join(":") end diff --git a/app/models/chouette/route.rb b/app/models/chouette/route.rb index 6774e8a86..0bdccb36a 100644 --- a/app/models/chouette/route.rb +++ b/app/models/chouette/route.rb @@ -6,7 +6,7 @@ class Chouette::Route < Chouette::TridentActiveRecord extend ActiveModel::Naming enumerize :direction, in: %i(straight_forward backward clockwise counter_clockwise north north_west west south_west south south_east east north_east) - enumerize :wayback, in: %i(straight_forward backward), default: :straight_forward + enumerize :wayback, in: %i(outbound inbound), default: :outbound # FIXME http://jira.codehaus.org/browse/JRUBY-6358 self.primary_key = "id" @@ -16,6 +16,7 @@ class Chouette::Route < Chouette::TridentActiveRecord end belongs_to :line + belongs_to :opposite_route, :class_name => 'Chouette::Route', :foreign_key => :opposite_route_id has_many :routing_constraint_zones has_many :journey_patterns, :dependent => :destroy @@ -30,7 +31,6 @@ class Chouette::Route < Chouette::TridentActiveRecord Chouette::Route.vehicle_journeys_timeless(proxy_association.owner.journey_patterns.pluck( :departure_stop_point_id)) end end - belongs_to :opposite_route, :class_name => 'Chouette::Route', :foreign_key => :opposite_route_id has_many :stop_points, -> { order("position") }, :dependent => :destroy do def find_by_stop_area(stop_area) stop_area_ids = Integer === stop_area ? [stop_area] : (stop_area.children_in_depth + [stop_area]).map(&:id) @@ -56,12 +56,13 @@ class Chouette::Route < Chouette::TridentActiveRecord end has_many :stop_areas, -> { order('stop_points.position ASC') }, :through => :stop_points do def between(departure, arrival) - departure, arrival = [departure, arrival].collect do |endpoint| + departure, arrival = [departure, arrival].map do |endpoint| String === endpoint ? Chouette::StopArea.find_by_objectid(endpoint) : endpoint end proxy_owner.stop_points.between(departure, arrival).includes(:stop_area).collect(&:stop_area) end end + accepts_nested_attributes_for :stop_points, :allow_destroy => :true validates_presence_of :name @@ -75,11 +76,37 @@ class Chouette::Route < Chouette::TridentActiveRecord after_commit :journey_patterns_control_route_sections + def duplicate + overrides = { + 'opposite_route_id' => nil + } + keys_for_create = attributes.keys - %w{id objectid created_at updated_at} + atts_for_create = attributes + .slice(*keys_for_create) + .merge(overrides) + new_route = self.class.create!(atts_for_create) + duplicate_stop_points(for_route: new_route) + new_route + end + + def duplicate_stop_points(for_route:) + stop_points.each(&duplicate_stop_point(for_route: for_route)) + end + def duplicate_stop_point(for_route:) + -> stop_point do + stop_point.duplicate(for_route: for_route) + end + end + + def local_id + "IBOO-#{self.referential.id}-#{self.line.objectid.local_id}-#{self.id}" + end + def geometry_presenter Chouette::Geometry::RoutePresenter.new self end - @@opposite_waybacks = { straight_forward: :backward, backward: :straight_forward} + @@opposite_waybacks = { outbound: :inbound, inbound: :outbound} def opposite_wayback @@opposite_waybacks[wayback.to_sym] end diff --git a/app/models/chouette/routing_constraint_zone.rb b/app/models/chouette/routing_constraint_zone.rb index 9931748b2..efe1b7237 100644 --- a/app/models/chouette/routing_constraint_zone.rb +++ b/app/models/chouette/routing_constraint_zone.rb @@ -8,6 +8,10 @@ class Chouette::RoutingConstraintZone < Chouette::TridentActiveRecord # validates :stop_point_ids, length: { minimum: 2, too_short: I18n.t('activerecord.errors.models.routing_constraint_zone.attributes.stop_points.not_enough_stop_points') } validate :stop_points_belong_to_route, :not_all_stop_points_selected + def local_id + "IBOO-#{self.referential.id}-#{self.route.line.objectid.local_id}-#{self.route.objectid.local_id}-#{self.id}" + end + scope :order_by_stop_points_count, ->(direction) do order("array_length(stop_point_ids, 1) #{direction}") end diff --git a/app/models/chouette/stif_netex_objectid.rb b/app/models/chouette/stif_netex_objectid.rb new file mode 100644 index 000000000..a0a91668a --- /dev/null +++ b/app/models/chouette/stif_netex_objectid.rb @@ -0,0 +1,42 @@ +class Chouette::StifNetexObjectid < String + def valid? + parts.present? + end + + @@format = /^([A-Za-z_]+):([A-Za-z]+):([0-9A-Za-z_-]+):([A-Za-z]+)$/ + cattr_reader :format + + def parts + match(format).try(:captures) + end + + def provider_id + parts.try(:first) + end + + def object_type + parts.try(:second) + end + + def local_id + parts.try(:third) + end + + def boiv_id + parts.try(:fourth) + end + + def short_id + local_id.try(:split, "-").try(:[], -1) + end + + def self.create(provider_id, object_type, local_id, boiv_id) + new [provider_id, object_type, local_id, boiv_id].join(":") + end + + def self.new(string) + string ||= "" + self === string ? string : super + end + +end diff --git a/app/models/chouette/stop_point.rb b/app/models/chouette/stop_point.rb index 8fe79dc0c..89c492b91 100644 --- a/app/models/chouette/stop_point.rb +++ b/app/models/chouette/stop_point.rb @@ -20,6 +20,11 @@ module Chouette validates_presence_of :stop_area validate :stop_area_id_validation + def stop_area_id_validation + if stop_area_id.nil? + errors.add(:stop_area_id, I18n.t("stop_areas.errors.empty")) + end + end scope :default_order, -> { order("position") } @@ -34,10 +39,12 @@ module Chouette end end - def stop_area_id_validation - if stop_area_id.nil? - errors.add(:stop_area_id, I18n.t("stop_areas.errors.empty")) - end + def duplicate(for_route:) + keys_for_create = attributes.keys - %w{id objectid created_at updated_at} + atts_for_create = attributes + .slice(*keys_for_create) + .merge('route_id' => for_route.id) + self.class.create!(atts_for_create) end def self.area_candidates diff --git a/app/models/chouette/time_table.rb b/app/models/chouette/time_table.rb index 97d2e7556..8821a5201 100644 --- a/app/models/chouette/time_table.rb +++ b/app/models/chouette/time_table.rb @@ -22,11 +22,19 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord belongs_to :created_from, class_name: 'Chouette::TimeTable' scope :overlapping, -> (date_start, date_end) do - joins(:periods).where('(period_start, period_end) OVERLAPS (?, ?)', date_start, date_end) + joins(" + LEFT JOIN time_table_periods ON time_tables.id = time_table_periods.time_table_id + LEFT JOIN time_table_dates ON time_tables.id = time_table_dates.time_table_id + ") + .where("(time_table_periods.period_start <= :end AND time_table_periods.period_end >= :start) OR (time_table_dates.date BETWEEN :start AND :end)", {start: date_start, end: date_end}) end after_save :save_shortcuts + def local_id + "IBOO-#{self.referential.id}-#{self.id}" + end + def checksum_attributes [].tap do |attrs| attrs << self.int_day_types @@ -487,7 +495,7 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord def merge!(another_tt) transaction do days = [].tap do |array| - array.push(*self.included_days_in_dates_and_periods, *another_tt.effective_days) + array.push(*self.effective_days, *another_tt.effective_days) array.uniq! end @@ -516,7 +524,7 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord def intersect!(another_tt) transaction do days = [].tap do |array| - array.push(*self.included_days_in_dates_and_periods) + array.push(*self.effective_days) array.delete_if {|day| !another_tt.effective_days.include?(day) } array.uniq! end @@ -536,7 +544,7 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord def disjoin!(another_tt) transaction do days = [].tap do |array| - array.push(*self.included_days_in_dates_and_periods) + array.push(*self.effective_days) array.delete_if {|day| another_tt.effective_days.include?(day) } array.uniq! end @@ -553,8 +561,7 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord end def duplicate - tt = self.deep_clone :include => [:periods, :dates], :except => :object_version - tt.uniq_objectid + tt = self.deep_clone :include => [:periods, :dates], :except => [:object_version, :objectid] tt.tag_list.add(*self.tag_list) unless self.tag_list.empty? tt.created_from = self tt.comment = I18n.t("activerecord.copy", :name => self.comment) diff --git a/app/models/chouette/trident_active_record.rb b/app/models/chouette/trident_active_record.rb index c1bc0172b..e8223e3d6 100644 --- a/app/models/chouette/trident_active_record.rb +++ b/app/models/chouette/trident_active_record.rb @@ -1,5 +1,5 @@ class Chouette::TridentActiveRecord < Chouette::ActiveRecord - include DefaultAttributesSupport + include StifNetexAttributesSupport self.abstract_class = true diff --git a/app/models/chouette/vehicle_journey.rb b/app/models/chouette/vehicle_journey.rb index d5ca58959..f574afc93 100644 --- a/app/models/chouette/vehicle_journey.rb +++ b/app/models/chouette/vehicle_journey.rb @@ -56,6 +56,10 @@ module Chouette end end + def local_id + "IBOO-#{self.referential.id}-#{self.route.line.objectid.local_id}-#{self.id}" + end + def checksum_attributes [].tap do |attrs| attrs << self.published_journey_name diff --git a/app/models/chouette/wayback.rb b/app/models/chouette/wayback.rb deleted file mode 100644 index b2950449d..000000000 --- a/app/models/chouette/wayback.rb +++ /dev/null @@ -1,50 +0,0 @@ -class Chouette::Wayback < ActiveSupport::StringInquirer - - def initialize(text_code, numerical_code) - super text_code.to_s - @numerical_code = numerical_code - end - - def self.new(text_code, numerical_code = nil) - if text_code and numerical_code - super - elsif self === text_code - text_code - else - if Fixnum === text_code - text_code, numerical_code = definitions.rassoc(text_code) - else - text_code, numerical_code = definitions.assoc(text_code.to_s) - end - - super text_code, numerical_code - end - end - - def to_i - @numerical_code - end - - def inspect - "#{to_s}/#{to_i}" - end - - def name - to_s - end - - @@definitions = [ - ["straight_forward", 0], - ["backward", 1] - ] - cattr_reader :definitions - - @@all = nil - def self.all - @@all ||= definitions.collect do |text_code, numerical_code| - new(text_code, numerical_code) - end - end - -end - diff --git a/app/models/compliance_check.rb b/app/models/compliance_check.rb index d3e4054a6..85cf5e37e 100644 --- a/app/models/compliance_check.rb +++ b/app/models/compliance_check.rb @@ -1,58 +1,9 @@ -class ComplianceCheck - include JobConcern - - def initialize( response ) - @datas = response - end - - def report? - links["action_report"].present? - end - - def report - Rails.cache.fetch("#{cache_key}/action_report", expires_in: cache_expiration) do - if report_path = links["action_report"] - ComplianceCheckReport.new Ievkit.get(report_path) - end - end - end - - def compliance_check_validation_report? - links["validation_report"].present? - end - - def compliance_check_validation_report - Rails.cache.fetch("#{cache_key}/validation_report", expires_in: cache_expiration) do - if report_path = links["validation_report"] - ComplianceCheckResult.new Ievkit.get(report_path) - end - end - end - - def rule_parameter_set? - links["validation_params"].present? - end - - def rule_parameter_set - Rails.cache.fetch("#{cache_key}/validation_params", expires_in: cache_expiration) do - if rule_parameter_set_path = links["validation_params"] - response = Ievkit.get(rule_parameter_set_path) - RuleParameterSet.new(name: '', compliance_check: self).tap do |rps| - rps.parameters = response.validation - end - end - end - end - - def destroy - if delete_path = links["delete"] - Ievkit.delete(delete_path) - elsif cancel_path = links["cancel"] - Ievkit.delete(cancel_path) - end - end - - def format - datas.type - end +class ComplianceCheck < ActiveRecord::Base + belongs_to :compliance_check_set + belongs_to :compliance_check_block + + enum criticity: [:info, :warning, :error] + validates :criticity, presence: true + validates :name, presence: true + validates :code, presence: true end diff --git a/app/models/compliance_check_block.rb b/app/models/compliance_check_block.rb new file mode 100644 index 000000000..035c03ed9 --- /dev/null +++ b/app/models/compliance_check_block.rb @@ -0,0 +1,3 @@ +class ComplianceCheckBlock < ActiveRecord::Base + belongs_to :compliance_check_set +end diff --git a/app/models/compliance_check_export.rb b/app/models/compliance_check_export.rb deleted file mode 100644 index 95abb3b27..000000000 --- a/app/models/compliance_check_export.rb +++ /dev/null @@ -1,56 +0,0 @@ -require 'tempfile' - -class ComplianceCheckExport - include ERB::Util - include ComplianceChecksHelper - - require 'zip' - - attr_accessor :template, :detailed_errors_template, :request - attr_reader :compliance_check - - def initialize(compliance_check, referential_id, request) - @request = request - @compliance_check = compliance_check - @referential_id = referential_id - @template = File.open('app/views/compliance_checks/summary_errors_index.csv.erb' ) { |f| f.read } - @detailed_errors_template = File.open('app/views/compliance_checks/detailed_errors_index.csv.erb' ) { |f| f.read } - end - - def export - begin - Dir.mktmpdir("#{I18n.t('compliance_check_results.file.zip_name_prefix')}_#{@referential_id}_#{@compliance_check.id}_", Dir.tmpdir) { |temp_dir| - - File.open(temp_dir + "/#{I18n.t('compliance_check_results.file.summary_errors_file_prefix')}" , "a:utf-8") do |f| - f.write("\ufeff") - f.write(render) - f.flush - end - - File.open(temp_dir + "/#{I18n.t('compliance_check_results.file.detailed_errors_file_prefix')}" , "a:utf-8") do |f| - f.write("\ufeff") - f.write(detailed_errors_render) - f.flush - end - - zip_file = Tempfile.new(["#{I18n.t('compliance_check_results.file.zip_name_prefix')}_#{@referential_id}_#{@compliance_check.id}_", ".zip"]) - - ::Zip::File.open(zip_file.path, ::Zip::File::CREATE) do |zipfile| - Dir[File.join(temp_dir, '*.csv')].each do |f| - zipfile.add(File.basename(f), f) - end - end - return zip_file - } - end - end - - def render() - ERB.new(@template).result(binding) - end - - def detailed_errors_render() - ERB.new(@detailed_errors_template).result(binding) - end - -end diff --git a/app/models/compliance_check_message.rb b/app/models/compliance_check_message.rb new file mode 100644 index 000000000..86899eb15 --- /dev/null +++ b/app/models/compliance_check_message.rb @@ -0,0 +1,4 @@ +class ComplianceCheckMessage < ActiveRecord::Base + belongs_to :compliance_check + belongs_to :compliance_check_resource +end diff --git a/app/models/compliance_check_report.rb b/app/models/compliance_check_report.rb deleted file mode 100644 index 94deb8cc9..000000000 --- a/app/models/compliance_check_report.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ComplianceCheckReport - include ReportConcern - - def initialize( response ) - @datas = response.action_report - end - -end - diff --git a/app/models/compliance_check_resource.rb b/app/models/compliance_check_resource.rb new file mode 100644 index 000000000..7826f00c3 --- /dev/null +++ b/app/models/compliance_check_resource.rb @@ -0,0 +1,5 @@ +class ComplianceCheckResource < ActiveRecord::Base + extend Enumerize + + enumerize :status, in: %w[new successful warning failed] +end diff --git a/app/models/compliance_check_result.rb b/app/models/compliance_check_result.rb deleted file mode 100644 index cd956a021..000000000 --- a/app/models/compliance_check_result.rb +++ /dev/null @@ -1,76 +0,0 @@ -class ComplianceCheckResult - extend ActiveModel::Naming - extend ActiveModel::Translation - include ActiveModel::Model - - attr_accessor :datas - - def initialize(response) - @datas = response.validation_report - end - - def tests? - datas.tests? - end - - def ok_error - all('ok', 'error') - end - - def nok_error - all('nok', 'error') - end - - def na_error - all('uncheck', 'error') - end - - def ok_warning - all('ok', 'warning') - end - - def nok_warning - all('nok', 'warning') - end - - def na_warning - all('uncheck', 'warning') - end - - def all(status, severity) - tests? ? tests.select { |test| test.result == status.downcase && test.severity == severity.downcase } : [] - end - - def tests - @tests ||= tests? ? datas.tests.map{ |test| Test.new(test) } : [] - end - - class Test - attr_reader :options - - def initialize( options ) - @options = options - end - - def test_id - options.test_id if options.test_id? - end - - def severity - options.severity.downcase if options.severity? - end - - def result - options.result.downcase if options.result? - end - - def errors - options.errors if options.errors? - end - - def error_count - options.error_count if options.error_count? - end - end - -end diff --git a/app/models/compliance_check_service.rb b/app/models/compliance_check_service.rb deleted file mode 100644 index c27f36894..000000000 --- a/app/models/compliance_check_service.rb +++ /dev/null @@ -1,23 +0,0 @@ -class ComplianceCheckService - - attr_reader :referential - - def initialize(referential) - @referential = referential - end - - # Find a validation whith this id - def find(id) - ComplianceCheck.new(Ievkit.scheduled_job(referential.slug, id, { :action => "validator" })) - end - - # Find all validations - def all - [].tap do |jobs| - Ievkit.jobs(referential.slug, { :action => "validator" }).each do |job| - jobs << ComplianceCheck.new(job) - end - end - end - -end diff --git a/app/models/compliance_check_set.rb b/app/models/compliance_check_set.rb new file mode 100644 index 000000000..7b6400a21 --- /dev/null +++ b/app/models/compliance_check_set.rb @@ -0,0 +1,10 @@ +class ComplianceCheckSet < ActiveRecord::Base + extend Enumerize + + belongs_to :referential + belongs_to :compliance_control_set + belongs_to :workbench + belongs_to :parent, polymorphic: true + + enumerize :status, in: %w[new pending successful warning failed running aborted canceled] +end diff --git a/app/models/compliance_check_task.rb b/app/models/compliance_check_task.rb deleted file mode 100644 index da0508cbf..000000000 --- a/app/models/compliance_check_task.rb +++ /dev/null @@ -1,114 +0,0 @@ -class ComplianceCheckTask - extend Enumerize - extend ActiveModel::Naming - extend ActiveModel::Translation - extend ActiveModel::Callbacks - include ActiveModel::Validations - include ActiveModel::Conversion - - enumerize :references_type, in: %w( network line company group_of_line ) - attr_accessor :rule_parameter_set_id, :referential_id, :user_id, :user_name, :name, :references_type, :reference_ids - - validates_presence_of :referential_id, :user_id, :user_name, :name - - def initialize( params = {} ) - params.each {|k,v| send("#{k}=",v)} - end - - def referential - Referential.find(referential_id) - end - - def organisation - referential.organisation - end - - def rule_parameter_set - organisation.rule_parameter_sets.find(rule_parameter_set_id) if rule_parameter_set_id.present? - end - - def save - if valid? - # Call Iev Server - begin - Ievkit.create_job( referential.slug, "validator", "", { - :file1 => params_io, - } ) - rescue Exception => exception - raise exception - end - true - else - false - end - end - - def self.references_types - self.references_type.values - end - - def params - {}.tap do |h| - h["parameters"] = validation_params ? action_params.merge(validation_params) : action_params - end - end - - def action_params - { - "validate" => { - "name" => name, - "references_type" => references_type, - "reference_ids" => reference_ids, - "user_name" => user_name, - "organisation_name" => organisation.name, - "referential_name" => referential.name, - } - - } - end - - def validation_params - { - "validation" => rule_parameter_set.parameters - } if rule_parameter_set.present? - end - - def self.data_formats - self.data_format.values - end - - def params_io - file = StringIO.new( params.to_json ) - Faraday::UploadIO.new(file, "application/json", "parameters.json") - end - - def transport_data_io - file = File.new(saved_resources_path, "r") - if file_extname == ".zip" - Faraday::UploadIO.new(file, "application/zip", original_filename ) - elsif file_extname == ".xml" - Faraday::UploadIO.new(file, "application/xml", original_filename ) - end - end - - def save_resources - FileUtils.mkdir_p root - FileUtils.cp resources.path, saved_resources_path - end - - def delete_resources - FileUtils.rm saved_resources_path if File.exists? saved_resources_path - end - - def original_filename - resources.original_filename - end - - def file_extname - File.extname(resources.original_filename) - end - - def saved_resources_path - "#{root}/#{Time.now.to_i}#{file_extname}" - end -end diff --git a/app/models/compliance_control.rb b/app/models/compliance_control.rb new file mode 100644 index 000000000..12ff4737a --- /dev/null +++ b/app/models/compliance_control.rb @@ -0,0 +1,12 @@ +class ComplianceControl < ActiveRecord::Base + belongs_to :compliance_control_set + belongs_to :compliance_control_block + + extend Enumerize + enumerize :criticity, in: %i(info warning error), scope: true, default: :info + + validates :criticity, presence: true + validates :name, presence: true + validates :code, presence: true + validates :compliance_control_set, presence: true +end diff --git a/app/models/compliance_control_block.rb b/app/models/compliance_control_block.rb new file mode 100644 index 000000000..cf5a9d72b --- /dev/null +++ b/app/models/compliance_control_block.rb @@ -0,0 +1,3 @@ +class ComplianceControlBlock < ActiveRecord::Base + belongs_to :compliance_control_set +end diff --git a/app/models/compliance_control_set.rb b/app/models/compliance_control_set.rb new file mode 100644 index 000000000..cefdfbf1f --- /dev/null +++ b/app/models/compliance_control_set.rb @@ -0,0 +1,7 @@ +class ComplianceControlSet < ActiveRecord::Base + belongs_to :organisation + has_many :compliance_controls + + validates :name, presence: true + +end diff --git a/app/models/concerns/error_format.rb b/app/models/concerns/error_format.rb new file mode 100644 index 000000000..158edb6e4 --- /dev/null +++ b/app/models/concerns/error_format.rb @@ -0,0 +1,29 @@ +# TODO: This module should be moved out of concerns to somewhere that makes +# more sense. + +module ErrorFormat extend self + + def details error_object + error_object.errors.messages.inject({}) do |hash, error| + hash.merge(partial(:detail, error_object, error).call) + end + end + + private + + def detail error_object, error + { + error.first => { + error: error.last.first, + value: error_object[error.first] + } + } + end + + def partial name, *partial_args + -> *lazy_args do + send(name, *(partial_args + lazy_args)) + end + end + +end diff --git a/app/models/concerns/line_referential_support.rb b/app/models/concerns/line_referential_support.rb index 4ad437fed..406730ddb 100644 --- a/app/models/concerns/line_referential_support.rb +++ b/app/models/concerns/line_referential_support.rb @@ -3,18 +3,10 @@ module LineReferentialSupport included do belongs_to :line_referential - # validates_presence_of :line_referential_id - alias_method :referential, :line_referential end def hub_restricted? false end - - def prefix - # FIXME #825 - "dummy" - end - end diff --git a/app/models/concerns/report_concern.rb b/app/models/concerns/report_concern.rb deleted file mode 100644 index f195f8f36..000000000 --- a/app/models/concerns/report_concern.rb +++ /dev/null @@ -1,170 +0,0 @@ -module ReportConcern - extend ActiveSupport::Concern - extend ActiveModel::Naming - extend ActiveModel::Translation - include ActiveModel::Model - - included do - attr_reader :datas - end - - module ClassMethods - end - - delegate :progression?, :progression, :zip_file, :stats, to: :datas - - def failure_code? - datas.result == "NOK" && datas.failure? - end - - def failure_code - datas.failure.code.downcase if failure_code? - end - - def percentage(a, b) - (a.to_f / b.to_f * 100).round(0) - end - - def level_progress - percentage( progression.current_step, progression.steps_count) if progression? - end - - def last_step - datas.progression.steps.last if progression? - end - - def current_step - datas.progression.steps[ progression.current_step - 1] - end - - def step_progress - percentage( current_step.realized, current_step.total ) - end - - def step_progress_name - return last_step.step if progression.current_step == progression.steps_count - - current_step.step - end - - def files - @files ||= datas.files || [] - end - - def error_files - files.select{ |file| file[:status] == "ERROR"} - end - - def ignored_files - files.select{ |file| file[:status] == "IGNORED"} - end - - def ok_files - files.select{ |file| file[:status] == "OK"} - end - - def line_items - @line_items ||= [].tap do |line_items| - datas.lines.each do |line| - line_items << LineItem.new(line) - end if datas.lines? - end - end - - def saved_lines - line_items.map(&:status).count(true) - end - - def unsaved_lines - line_items.map(&:status).count(false) - end - - def lines - stats.present? ? stats.line_count : 0 - end - - def routes - stats.present? ? stats.route_count : 0 - end - - def connection_links - stats.present? ? stats.connection_link_count : 0 - end - - def time_tables - stats.present? ? stats.time_table_count : 0 - end - - def stop_areas - stats.present? ? stats.stop_area_count : 0 - end - - def access_points - stats.present? ? stats.access_point_count : 0 - end - - def vehicle_journeys - stats.present? ? stats.vehicle_journey_count : 0 - end - - def journey_patterns - stats.present? ? stats.journey_pattern_count : 0 - end - - class LineItem - attr_reader :options - - def initialize( options ) - @options = options - end - - def name - @name ||= options.name if options.name? - end - - def stats - @stats ||= options.stats if options.stats? - end - - def status - @status ||= if options.status? - if %w{ok warning}.include? options.status.downcase - true - else - false - end - else - false - end - end - - def routes - stats ? stats.route_count : 0 - end - - def connection_links - stats ? stats.connection_link_count : 0 - end - - def time_tables - stats ? stats.time_table_count : 0 - end - - def stop_areas - stats ? stats.stop_area_count : 0 - end - - def access_points - stats ? stats.access_point_count : 0 - end - - def vehicle_journeys - stats ? stats.vehicle_journey_count : 0 - end - - def journey_patterns - stats ? stats.journey_pattern_count : 0 - end - - end -end diff --git a/app/models/concerns/stif_netex_attributes_support.rb b/app/models/concerns/stif_netex_attributes_support.rb new file mode 100644 index 000000000..795872755 --- /dev/null +++ b/app/models/concerns/stif_netex_attributes_support.rb @@ -0,0 +1,58 @@ +module StifNetexAttributesSupport + extend ActiveSupport::Concern + + included do + validates_numericality_of :object_version + validates :objectid, uniqueness: true, presence: true + validate :objectid_format_compliance + + after_save :build_objectid + before_validation :default_values, on: :create + end + + module ClassMethods + def object_id_key + model_name + end + + def model_name + ActiveModel::Name.new self, Chouette, self.name.demodulize + end + end + + def objectid_format_compliance + errors.add :objectid, I18n.t("activerecord.errors.models.trident.invalid_object_id") if !objectid.valid? + end + + def local_id + "IBOO-#{self.referential.id}-#{self.id}" + end + + def build_objectid + if objectid.include? ':__pending_id__' + self.objectid = Chouette::StifNetexObjectid.create(self.provider_id, self.model_name, self.local_id, self.boiv_id) + self.save + end + end + + def default_values + self.object_version ||= 1 + + if self.objectid.to_s.empty? + local_id = "__pending_id__#{rand(50)+ rand(50)}" + self.objectid = Chouette::StifNetexObjectid.create(self.provider_id, self.model_name, local_id, self.boiv_id) + end + end + + def objectid + Chouette::StifNetexObjectid.new read_attribute(:objectid) + end + + def provider_id + self.referential.workbench.organisation.name.parameterize + end + + def boiv_id + 'LOC' + end +end diff --git a/app/models/concerns/stop_area_referential_support.rb b/app/models/concerns/stop_area_referential_support.rb index 5a01ef57e..aa59cbd35 100644 --- a/app/models/concerns/stop_area_referential_support.rb +++ b/app/models/concerns/stop_area_referential_support.rb @@ -3,17 +3,10 @@ module StopAreaReferentialSupport included do belongs_to :stop_area_referential - # validates_presence_of :stop_area_referential_id - alias_method :referential, :stop_area_referential end def hub_restricted? false end - - def prefix - # FIXME #825 - "dummy" - end end diff --git a/app/models/data_format_enumerations.rb b/app/models/data_format_enumerations.rb index 94c39e152..787ab6cca 100644 --- a/app/models/data_format_enumerations.rb +++ b/app/models/data_format_enumerations.rb @@ -1,6 +1,6 @@ module DataFormatEnumerations extend Enumerize extend ActiveModel::Naming - - enumerize :data_format, in: %w[neptune netex gtfs hub], default: "neptune" + + enumerize :data_format, in: %w[neptune netex gtfs hub], default: "netex" end diff --git a/app/models/export_report.rb b/app/models/export_report.rb index ef54f40ea..3c0788106 100644 --- a/app/models/export_report.rb +++ b/app/models/export_report.rb @@ -1,9 +1,8 @@ class ExportReport - include ReportConcern + #include ReportConcern def initialize( response ) @datas = response.action_report end - -end +end diff --git a/app/models/generic_attribute_min_max.rb b/app/models/generic_attribute_min_max.rb new file mode 100644 index 000000000..e9a127c56 --- /dev/null +++ b/app/models/generic_attribute_min_max.rb @@ -0,0 +1,27 @@ +#module ComplianceControls + + class GenericAttributeMinMax < ComplianceControl + + + hstore_accessor :control_attributes, minimum: :integer, maximum: :integer + #attribute :minimum, type: :integer, optionnal: true + #attribute :maximum, type: :integer, optionnal: true + # #attribute :target, type: ModelAttribute + + @@default_criticity = :warning + @@default_code = "3-Generic-2" + + validate :min_max_values + def min_max_values + true + end + + after_initialize do + self.name = 'GenericAttributeMinMax' + self.code = @@default_code + self.criticity = @@default_criticity + end + + end + +#end diff --git a/app/models/import.rb b/app/models/import.rb index e97649d00..74f7ef10c 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -5,11 +5,19 @@ class Import < ActiveRecord::Base belongs_to :parent, polymorphic: true + has_many :messages, class_name: "ImportMessage", dependent: :destroy + has_many :resources, class_name: "ImportResource", dependent: :destroy + has_many :children, foreign_key: :parent_id, class_name: "Import", dependent: :destroy + + scope :where_started_at_between, ->(start_date, end_date) do + where('started_at BETWEEN ? AND ?', start_date, end_date) + end + extend Enumerize - enumerize :status, in: %i(new pending successful failed running aborted canceled) + enumerize :status, in: %i(new pending successful warning failed running aborted canceled), scope: true, default: :new validates :file, presence: true - validates_presence_of :referential, :workbench, :creator + validates_presence_of :workbench, :creator before_create :initialize_fields @@ -17,6 +25,10 @@ class Import < ActiveRecord::Base ActiveModel::Name.new Import, Import, "Import" end + def children_succeedeed + children.with_status(:successful).count + end + def self.failing_statuses symbols_with_indifferent_access(%i(failed aborted canceled)) end @@ -26,29 +38,61 @@ class Import < ActiveRecord::Base end def notify_parent - parent.child_change(self) + parent.child_change update(notified_parent_at: DateTime.now) end - def child_change(child) + def child_change return if self.class.finished_statuses.include?(status) - if self.class.failing_statuses.include?(child.status) - return update(status: 'failed') + update_status + update_referentials + end + + def update_status + status_count = children.group(:status).count + children_finished_count = children_failed_count = children_count = 0 + + status_count.each do |status, count| + if self.class.failing_statuses.include?(status) + children_failed_count += count + end + if self.class.finished_statuses.include?(status) + children_finished_count += count + end + children_count += count end - update(status: 'successful') if ready? + attributes = { + current_step: children_finished_count + } + + status = + if children_failed_count > 0 + 'failed' + elsif status_count['successful'] == children_count + 'successful' + end + + if self.class.finished_statuses.include?(status) + attributes[:ended_at] = Time.now + end + + update attributes.merge(status: status) end - def ready? - current_step == total_steps + def update_referentials + return unless self.class.finished_statuses.include?(status) + + children.each do |import| + import.referential.update(ready: true) if import.referential + end end private def initialize_fields self.token_download = SecureRandom.urlsafe_base64 - self.status = Import.status.new end def self.symbols_with_indifferent_access(array) diff --git a/app/models/import_message_export.rb b/app/models/import_message_export.rb new file mode 100644 index 000000000..88d0f27e2 --- /dev/null +++ b/app/models/import_message_export.rb @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +require "csv" +require "zip" + +class ImportMessageExport + 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"] + end + + def to_csv(options = {}) + CSV.generate(options) do |csv| + csv << column_names + import_messages.each do |import_message| + csv << [import_message.criticity, import_message.message_key, I18n.t("import_messages.compliance_check_messages.#{import_message.message_key}", import_message.message_attributes.deep_symbolize_keys) ] + end + end + 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_report.rb b/app/models/import_report.rb index 1dc556e1c..ba13f0118 100644 --- a/app/models/import_report.rb +++ b/app/models/import_report.rb @@ -1,9 +1,8 @@ -class ImportReport - include ReportConcern +class ImportReport + #include ReportConcern def initialize( response ) @datas = response.action_report end - -end +end diff --git a/app/models/import_resource.rb b/app/models/import_resource.rb index 3ddd325fd..55e752e74 100644 --- a/app/models/import_resource.rb +++ b/app/models/import_resource.rb @@ -1,28 +1,11 @@ class ImportResource < ActiveRecord::Base - include AASM belongs_to :import extend Enumerize - enumerize :status, in: %i(new pending successful failed) + enumerize :status, in: %i(OK ERROR WARNING IGNORED), scope: true - validates_presence_of :name, :type, :reference + validates_presence_of :name, :resource_type, :reference - aasm column: :status do - state :new, :initial => true - state :pending - state :successful - state :failed + has_many :messages, class_name: "ImportMessage", foreign_key: :resource_id - event :run do - transitions :from => [:new, :failed], :to => :pending - end - - event :successful do - transitions :from => [:pending, :failed], :to => :successful - end - - event :failed do - transitions :from => :pending, :to => :failed - end - end end diff --git a/app/models/journey_pattern_control/duplicates.rb b/app/models/journey_pattern_control/duplicates.rb new file mode 100644 index 000000000..78ca07e90 --- /dev/null +++ b/app/models/journey_pattern_control/duplicates.rb @@ -0,0 +1,13 @@ +module JourneyPatternControl + class Duplicates < ComplianceControl + + @@default_criticity = :warning + @@default_code = "3-JourneyPattern-1" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/netex_import.rb b/app/models/netex_import.rb index 575cef816..32939a741 100644 --- a/app/models/netex_import.rb +++ b/app/models/netex_import.rb @@ -1,15 +1,19 @@ require 'net/http' class NetexImport < Import - after_commit :launch_java_import + after_commit :launch_java_import, on: :create + validates_presence_of :parent def launch_java_import - logger.warn "Call iev get #{Rails.configuration.iev_url}/boiv_iev/referentials/importer/new?id=#{id}" - begin - Net::HTTP.get(URI("#{Rails.configuration.iev_url}/boiv_iev/referentials/importer/new?id=#{id}")) - rescue Exception => e - logger.error "IEV server error : #{e.message}" - logger.error e.backtrace.inspect + return if self.class.finished_statuses.include?(status) + + Thread.new do + begin + Net::HTTP.get(URI("#{Rails.configuration.iev_url}/boiv_iev/referentials/importer/new?id=#{id}")) + rescue Exception => e + logger.error "IEV server error : #{e.message}" + logger.error e.backtrace.inspect + end end end end diff --git a/app/models/organisation.rb b/app/models/organisation.rb index f697122aa..ba65ad375 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -4,6 +4,7 @@ class Organisation < ActiveRecord::Base has_many :users, :dependent => :destroy has_many :referentials, :dependent => :destroy has_many :rule_parameter_sets, :dependent => :destroy + has_many :compliance_control_sets, :dependent => :destroy has_many :stop_area_referential_memberships has_many :stop_area_referentials, through: :stop_area_referential_memberships @@ -13,6 +14,7 @@ class Organisation < ActiveRecord::Base has_many :workbenches has_many :calendars + has_many :api_keys, class_name: 'Api::V1::ApiKey' validates_presence_of :name validates_uniqueness_of :code diff --git a/app/models/referential.rb b/app/models/referential.rb index cb2c7b23b..af08aa868 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -1,3 +1,4 @@ +# coding: utf-8 class Referential < ActiveRecord::Base include DataFormatEnumerations @@ -10,7 +11,9 @@ class Referential < ActiveRecord::Base # validates_presence_of :lower_corner validates_uniqueness_of :slug - validates_uniqueness_of :name + + validates_presence_of :line_referential + validates_presence_of :stop_area_referential validates_format_of :slug, :with => %r{\A[a-z][0-9a-z_]+\Z} validates_format_of :prefix, :with => %r{\A[0-9a-zA-Z_]+\Z} validates_format_of :upper_corner, :with => %r{\A-?[0-9]+\.?[0-9]*\,-?[0-9]+\.?[0-9]*\Z} @@ -130,7 +133,7 @@ class Referential < ActiveRecord::Base self end - def self.new_from(from) + def self.new_from(from, functional_scope) Referential.new( name: I18n.t("activerecord.copy", :name => from.name), slug: "#{from.slug}_clone", @@ -139,9 +142,8 @@ class Referential < ActiveRecord::Base bounds: from.bounds, line_referential: from.line_referential, stop_area_referential: from.stop_area_referential, - workbench: from.workbench, created_from: from, - metadatas: from.metadatas.map { |m| ReferentialMetadata.new_from(m) } + metadatas: from.metadatas.map { |m| ReferentialMetadata.new_from(m, functional_scope) } ) end @@ -181,12 +183,10 @@ class Referential < ActiveRecord::Base projection_type || "" end - before_validation :assign_line_and_stop_area_referential, :on => :create, if: :workbench, unless: :created_from - before_validation :clone_associations, :on => :create, if: :created_from + before_validation :assign_line_and_stop_area_referential, :on => :create, if: :workbench before_validation :assign_slug, :on => :create before_validation :assign_prefix, :on => :create before_create :create_schema - after_create :clone_schema, if: :created_from before_destroy :destroy_schema @@ -204,18 +204,6 @@ class Referential < ActiveRecord::Base end end - def clone_associations - self.line_referential = created_from.line_referential - self.stop_area_referential = created_from.stop_area_referential - self.workbench = created_from.workbench - end - - def clone_metadatas - created_from.metadatas.each do |meta| - self.metadatas << ReferentialMetadata.new_from(meta) - end - end - def metadatas_period query = "select min(lower), max(upper) from (select lower(unnest(periodes)) as lower, upper(unnest(periodes)) as upper from public.referential_metadata where public.referential_metadata.referential_id = #{id}) bounds;" @@ -290,7 +278,9 @@ class Referential < ActiveRecord::Base end def create_schema - Apartment::Tenant.create slug + unless created_from + Apartment::Tenant.create slug + end end def assign_slug diff --git a/app/models/referential_metadata.rb b/app/models/referential_metadata.rb index b774072c7..393dc70d3 100644 --- a/app/models/referential_metadata.rb +++ b/app/models/referential_metadata.rb @@ -155,8 +155,10 @@ class ReferentialMetadata < ActiveRecord::Base end private :clear_periods - def self.new_from from + def self.new_from(from, functional_scope) from.dup.tap do |metadata| + metadata.referential_source_id = from.referential_id + metadata.line_ids = from.referential.lines.where(id: metadata.line_ids, objectid: functional_scope).collect(&:id) metadata.referential_id = nil end end diff --git a/app/models/route_control/duplicates.rb b/app/models/route_control/duplicates.rb new file mode 100644 index 000000000..379d7cf98 --- /dev/null +++ b/app/models/route_control/duplicates.rb @@ -0,0 +1,13 @@ +module RouteControl + class Duplicates < ComplianceControl + + @@default_criticity = :warning + @@default_code = "3-Route-4" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/route_control/minimum_length.rb b/app/models/route_control/minimum_length.rb new file mode 100644 index 000000000..14bc7064f --- /dev/null +++ b/app/models/route_control/minimum_length.rb @@ -0,0 +1,13 @@ +module RouteControl + class MinimumLength < ComplianceControl + + @@default_criticity = :error + @@default_code = "3-Route-6" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/route_control/omnibus_journey_pattern.rb b/app/models/route_control/omnibus_journey_pattern.rb new file mode 100644 index 000000000..2f09ff735 --- /dev/null +++ b/app/models/route_control/omnibus_journey_pattern.rb @@ -0,0 +1,13 @@ +module RouteControl + class OmnibusJourneyPattern < ComplianceControl + + @@default_criticity = :warning + @@default_code = "3-Route-9" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/route_control/opposite_route.rb b/app/models/route_control/opposite_route.rb new file mode 100644 index 000000000..d5f2bc59e --- /dev/null +++ b/app/models/route_control/opposite_route.rb @@ -0,0 +1,14 @@ +module RouteControl + class OppositeRoute < ComplianceControl + + @@default_criticity = :error + @@default_code = "3-Route-2" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + + end +end diff --git a/app/models/route_control/speed.rb b/app/models/route_control/speed.rb new file mode 100644 index 000000000..fb07b5c87 --- /dev/null +++ b/app/models/route_control/speed.rb @@ -0,0 +1,15 @@ +module VehicleJourneyControl + class Speed < ComplianceControl + + hstore_accessor :control_attributes, minimum: :integer, maximum: :integer + + @@default_criticity = :warning + @@default_code = "3-VehicleJourney-2" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/route_control/stop_points_in_journey_pattern.rb b/app/models/route_control/stop_points_in_journey_pattern.rb new file mode 100644 index 000000000..195257a4a --- /dev/null +++ b/app/models/route_control/stop_points_in_journey_pattern.rb @@ -0,0 +1,13 @@ +module RouteControl + class StopPointInJourneyPattern < ComplianceControl + + @@default_criticity = :error + @@default_code = "3-Route-6" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/route_control/time_table.rb b/app/models/route_control/time_table.rb new file mode 100644 index 000000000..911807ba9 --- /dev/null +++ b/app/models/route_control/time_table.rb @@ -0,0 +1,13 @@ +module VehicleJourneyControl + class TimeTable < ComplianceControl + + @@default_criticity = :error + @@default_code = "3-VehicleJourney-4" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/route_control/unactivated_stop_points.rb b/app/models/route_control/unactivated_stop_points.rb new file mode 100644 index 000000000..8ab680490 --- /dev/null +++ b/app/models/route_control/unactivated_stop_points.rb @@ -0,0 +1,13 @@ +module RouteControl + class UnactivatedStopPoint < ComplianceControl + + @@default_criticity = :warning + @@default_code = "3-Route-10" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/route_control/vehicle_journey_at_stops.rb b/app/models/route_control/vehicle_journey_at_stops.rb new file mode 100644 index 000000000..02a43fb10 --- /dev/null +++ b/app/models/route_control/vehicle_journey_at_stops.rb @@ -0,0 +1,13 @@ +module VehicleJourneyControl + class VehicleJourneyAtStops < ComplianceControl + + @@default_criticity = :error + @@default_code = "3-VehicleJourney-5" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/route_control/zdl_stop_area.rb b/app/models/route_control/zdl_stop_area.rb new file mode 100644 index 000000000..4561c9b2e --- /dev/null +++ b/app/models/route_control/zdl_stop_area.rb @@ -0,0 +1,13 @@ +module RouteControl + class ZDLStopArea < ComplianceControl + + @@default_criticity = :warning + @@default_code = "3-Route-1" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/routing_constaint_zone_control/unactivated_stop_point.rb b/app/models/routing_constaint_zone_control/unactivated_stop_point.rb new file mode 100644 index 000000000..92a1d1a58 --- /dev/null +++ b/app/models/routing_constaint_zone_control/unactivated_stop_point.rb @@ -0,0 +1,13 @@ +module RoutingConstaintZoneControl + class UnactivatedStopPoint < ComplianceControl + + @@default_criticity = :warning + @@default_code = "3-ITL-1" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/stop_area_copy.rb b/app/models/stop_area_copy.rb index 0fa56ff68..d3eb78557 100644 --- a/app/models/stop_area_copy.rb +++ b/app/models/stop_area_copy.rb @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - class StopAreaCopy include ActiveModel::Validations include ActiveModel::Conversion diff --git a/app/models/vechicle_journey_control/delta.rb b/app/models/vechicle_journey_control/delta.rb new file mode 100644 index 000000000..d4e1e6eca --- /dev/null +++ b/app/models/vechicle_journey_control/delta.rb @@ -0,0 +1,15 @@ +module VehicleJourneyControl + class Delta < ComplianceControl + + hstore_accessor :control_attributes, delta: :integer + + @@default_criticity = :warning + @@default_code = "3-VehicleJourney-3" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/vechicle_journey_control/waiting_time.rb b/app/models/vechicle_journey_control/waiting_time.rb new file mode 100644 index 000000000..a7e90b6ac --- /dev/null +++ b/app/models/vechicle_journey_control/waiting_time.rb @@ -0,0 +1,13 @@ +module VehicleJourneyControl + class WatingTime < ComplianceControl + + @@default_criticity = :warning + @@default_code = "3-VehicleJourney-1" + + after_initialize do + self.name = self.class.name + self.code = @@default_code + self.criticity = @@default_criticity + end + end +end diff --git a/app/models/vehicle_journey_import.rb b/app/models/vehicle_journey_import.rb index 855fa2abe..44a6d457e 100644 --- a/app/models/vehicle_journey_import.rb +++ b/app/models/vehicle_journey_import.rb @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -class VehicleJourneyImport +class VehicleJourneyImport include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming @@ -8,11 +8,11 @@ class VehicleJourneyImport attr_accessor :file, :route attr_accessor :created_vehicle_journey_count,:updated_vehicle_journey_count,:deleted_vehicle_journey_count attr_accessor :created_journey_pattern_count,:error_count - + validates_presence_of :file validates_presence_of :route - def initialize(attributes = {}) + def initialize(attributes = {}) attributes.each { |name, value| send("#{name}=", value) } if attributes self.created_vehicle_journey_count = 0 self.updated_vehicle_journey_count = 0 @@ -20,15 +20,15 @@ class VehicleJourneyImport self.deleted_vehicle_journey_count = 0 self.error_count = 0 end - + def persisted? false end - + def save begin - Chouette::VehicleJourney.transaction do - if imported_vehicle_journeys.map(&:valid?).all? + Chouette::VehicleJourney.transaction do + if imported_vehicle_journeys.map(&:valid?).all? imported_vehicle_journeys.each(&:save!) true else @@ -46,8 +46,8 @@ class VehicleJourneyImport errors.add :base, I18n.t("vehicle_journey_imports.errors.exception") false end - end - + end + def imported_vehicle_journeys @imported_vehicle_journeys ||= load_imported_vehicle_journeys end @@ -61,31 +61,31 @@ class VehicleJourneyImport if stop_points_used.length == 1 errors.add :base, I18n.t("vehicle_journey_imports.errors.one_stop_point_used", :column => column) - raise + raise end - + journey_pattern_founded = route.journey_patterns.select{ |jp| jp.stop_points.collect(&:id) == stop_points_used }.first - + # If no journey pattern founded, create a new one self.created_journey_pattern_count += 1 if journey_pattern_founded.nil? journey_pattern_founded ? journey_pattern_founded : route.journey_patterns.create(:stop_points => Chouette::StopPoint.find(stop_points_used) ) end - + def as_integer(v) v.blank? ? nil : v.to_i end - + def as_boolean(v) v.blank? ? nil : (v[1..1].downcase != "n") end - + def update_time_tables(vj,tm_ids) vj.time_tables.clear return unless tm_ids.present? ids = tm_ids.split(",").map(&:to_i) vj.time_tables << Chouette::TimeTable.where(:id => ids) end - + def update_footnotes(vj,ftn_ids) vj.footnotes.clear return unless ftn_ids.present? @@ -94,13 +94,13 @@ class VehicleJourneyImport end def load_imported_vehicle_journeys - + spreadsheet = open_spreadsheet(file) - + vehicle_journeys = [] - + first_column = spreadsheet.column(1) - + # fixed rows (first = 1) number_row = 2 published_journey_name_row = 3 @@ -111,7 +111,7 @@ class VehicleJourneyImport # rows in column (first = 0) first_stop_row_index = 8 - + stop_point_ids = first_column[first_stop_row_index..spreadsheet.last_row].map(&:to_i) # blank lines at end of file will produce id = 0 ; ignore them last_stop_row_index = stop_point_ids.length + 7 @@ -119,50 +119,50 @@ class VehicleJourneyImport stop_point_ids = stop_point_ids[0..-2] last_stop_row_index -= 1 end - + unless route.stop_points.collect(&:id) == stop_point_ids errors.add :base, I18n.t("vehicle_journey_imports.errors.not_same_stop_points", :route => route.id) raise - end - + end + (3..spreadsheet.last_column).each do |i| vehicle_journey_id = spreadsheet.column(i)[0] hours_by_stop_point_ids = Hash[[stop_point_ids, spreadsheet.column(i)[first_stop_row_index..last_stop_row_index]].transpose] - + journey_pattern = find_journey_pattern_schedule(i,hours_by_stop_point_ids) - + vehicle_journey = route.vehicle_journeys.where(:id => vehicle_journey_id, :route_id => route.id).first_or_initialize if journey_pattern.nil? - if vehicle_journey.id.present? + if vehicle_journey.id.present? self.deleted_vehicle_journey_count += 1 vehicle_journey.delete end next end - if vehicle_journey.id.present? + if vehicle_journey.id.present? self.updated_vehicle_journey_count += 1 else self.created_vehicle_journey_count += 1 end - + # number vehicle_journey.number = as_integer(spreadsheet.row(number_row)[i-1]) - + # published_name vehicle_journey.published_journey_name = spreadsheet.row(published_journey_name_row)[i-1] - + # flexible_service vehicle_journey.flexible_service = as_boolean(spreadsheet.row(flexible_service_row)[i-1]) - + # mobility vehicle_journey.mobility_restricted_suitability = as_boolean(spreadsheet.row(mobility_row)[i-1]) - + # time_tables update_time_tables(vehicle_journey,spreadsheet.row(time_tables_row)[i-1]) - + update_footnotes(vehicle_journey,spreadsheet.row(footnotes_row)[i-1]) - + # journey_pattern vehicle_journey.journey_pattern = journey_pattern vehicle_journey.vehicle_journey_at_stops.clear @@ -171,7 +171,7 @@ class VehicleJourneyImport hours_by_stop_point_ids.each_pair do |key, value| line += 1 if value.present? # Create a vehicle journey at stop when time is present - begin + begin # force UTC to ignore timezone effects main_time = Time.parse(value+" UTC") if main_time.present? @@ -182,14 +182,14 @@ class VehicleJourneyImport errors.add :base, I18n.t("vehicle_journey_imports.errors.invalid_vehicle_journey_at_stop", :column => i, :line => line, :time => value) raise exception end - end + end end vehicle_journeys << vehicle_journey end - + vehicle_journeys end - + def open_spreadsheet(file) case File.extname(file.original_filename) when '.csv' then Roo::CSV.new(file.path, csv_options: {col_sep: ";"}) @@ -199,5 +199,5 @@ class VehicleJourneyImport raise "Unknown file type: #{file.original_filename}" end end - + end diff --git a/app/models/workbench.rb b/app/models/workbench.rb index 4023c221b..30692e625 100644 --- a/app/models/workbench.rb +++ b/app/models/workbench.rb @@ -9,6 +9,8 @@ class Workbench < ActiveRecord::Base has_many :group_of_lines, through: :line_referential has_many :stop_areas, through: :stop_area_referential has_many :imports + has_many :workbench_imports + validates :name, presence: true validates :organisation, presence: true diff --git a/app/models/workbench_import.rb b/app/models/workbench_import.rb index 9323bd4b5..27f53a44f 100644 --- a/app/models/workbench_import.rb +++ b/app/models/workbench_import.rb @@ -1,2 +1,7 @@ class WorkbenchImport < Import + after_commit :launch_worker, :on => :create + + def launch_worker + WorkbenchImportWorker.perform_async(id) + end end diff --git a/app/policies/api_key_policy.rb b/app/policies/api_key_policy.rb new file mode 100644 index 000000000..eb7b84457 --- /dev/null +++ b/app/policies/api_key_policy.rb @@ -0,0 +1,20 @@ +class ApiKeyPolicy < ApplicationPolicy + class Scope < Scope + def resolve + scope + end + end + + def destroy? + organisation_match? && user.has_permission?('api_keys.destroy') + end + + def create? + user.has_permission?('api_keys.create') + end + + def update? + record.try(:organisation_id) == user.organisation_id && + user.has_permission?('api_keys.update') + end +end diff --git a/app/policies/compliance_control_policy.rb b/app/policies/compliance_control_policy.rb new file mode 100644 index 000000000..aeb0ab0a9 --- /dev/null +++ b/app/policies/compliance_control_policy.rb @@ -0,0 +1,19 @@ +class ComplianceControlPolicy < ApplicationPolicy + class Scope < Scope + def resolve + scope + end + end + + def destroy? + organisation_match? && user.has_permission?('compliance_controls.destroy') + end + + def create? + user.has_permission?('compliance_controls.create') + end + + def update? + organisation_match? && user.has_permission?('compliance_controls.update') + end +end diff --git a/app/policies/compliance_control_set_policy.rb b/app/policies/compliance_control_set_policy.rb new file mode 100644 index 000000000..12b829aa4 --- /dev/null +++ b/app/policies/compliance_control_set_policy.rb @@ -0,0 +1,7 @@ +class ComplianceControlSetPolicy < ApplicationPolicy + class Scope < Scope + def resolve + scope + end + end +end diff --git a/app/policies/login_policy.rb b/app/policies/login_policy.rb index 5b07b97f3..0360880bd 100644 --- a/app/policies/login_policy.rb +++ b/app/policies/login_policy.rb @@ -7,7 +7,7 @@ class LoginPolicy end def boiv? - (user.permissions || []).include?('sessions:create') + (user.permissions || []).include?('sessions.create') end end diff --git a/app/policies/route_policy.rb b/app/policies/route_policy.rb index 786b0acf4..7e9fe251a 100644 --- a/app/policies/route_policy.rb +++ b/app/policies/route_policy.rb @@ -16,4 +16,8 @@ class RoutePolicy < ApplicationPolicy def update? !archived? && organisation_match? && user.has_permission?('routes.update') end + + def duplicate? + create? + end end diff --git a/app/services/http_service.rb b/app/services/http_service.rb index ae7d0e413..d3999f293 100644 --- a/app/services/http_service.rb +++ b/app/services/http_service.rb @@ -20,26 +20,23 @@ module HTTPService extend self raise "Error on api request status : #{resp.status} => #{resp.body}" end end - # host: 'http://localhost:3000', # path: '/api/v1/netex_imports.json', # token: '13-74009c36638f587c9eafb1ce46e95585', # params: { netex_import: {referential_id: 13, workbench_id: 1}}, # upload: {file: [StringIO.new('howdy'), 'application/zip', 'greeting']}) def post_resource(host:, path:, token: nil, params: {}, upload: nil) - Faraday.new(url: host) do |c| + result = Faraday.new(url: host) do |c| c.headers['Authorization'] = "Token token=#{token.inspect}" if token c.request :multipart c.request :url_encoded c.adapter Faraday.default_adapter - - if upload - name = upload.keys.first - value, mime_type, as_name = upload.values.first - params.update( name => Faraday::UploadIO.new(value, mime_type, as_name ) ) - end - return c.post path, params end end + + # Expose this in order to make the service replaceable + def upload(*triple) + Faraday::UploadIO.new(*triple) + end end diff --git a/app/services/retry_service.rb b/app/services/retry_service.rb deleted file mode 100644 index 21b1def36..000000000 --- a/app/services/retry_service.rb +++ /dev/null @@ -1,54 +0,0 @@ -require 'result' - -class RetryService - - Retry = Class.new(RuntimeError) - - # @param@ delays: - # An array of delays that are used to retry after a sleep of the indicated - # value in case of failed exceutions. - # Once this array is exhausted the executen fails permanently - # - # @param@ rescue_from: - # During execution all the excpetions from this array +plus RetryService::Retry+ are rescued from and - # trigger just another retry after a `sleep` as indicated above. - # - # @param@ block: - # This optional code is excuted before each retry, it is passed the result of the failed attempt, thus - # an `Exception` and the number of execution already tried. - def initialize( delays: [], rescue_from: [], &blk ) - @intervals = delays - @registered_exceptions = Array(rescue_from) << Retry - @failure_callback = blk - end - - # @param@ blk: - # The code to be executed it will be retried goverened by the `delay` passed into the initializer - # as described there in case it fails with one of the predefined exceptions or `RetryService::Retry` - # - # Eventually it will return a `Result` object. - def execute &blk - result = execute_protected blk - return result if result.ok? - @intervals.each_with_index do | interval, retry_count | - sleep interval - @failure_callback.try(:call, result.value, retry_count + 1) - result = execute_protected blk - return result if result.ok? - end - result - end - - - private - - def execute_protected blk - Result.ok(blk.()) - rescue Exception => e - if @registered_exceptions.any?{ |re| e.is_a? re } - Result.error(e) - else - raise - end - end -end diff --git a/app/services/zip_service.rb b/app/services/zip_service.rb index 778bfd06d..cab301b01 100644 --- a/app/services/zip_service.rb +++ b/app/services/zip_service.rb @@ -1,55 +1,68 @@ class ZipService + # TODO: Remove me before merge https://github.com/rubyzip/rubyzip - attr_reader :current_entry, :zip_data + class Subdir < Struct.new(:name, :stream) + end + + attr_reader :current_key, :current_output, :yielder def initialize data - @zip_data = data - @current_entry = nil - end - - class << self - def convert_entries entries - -> output_stream do - entries.each do |e| - output_stream.put_next_entry e.name - output_stream.write e.get_input_stream.read - end - end - end + @zip_data = StringIO.new(data) + @current_key = nil + @current_output = nil + end - def entries input_stream - Enumerator.new do |enum| - loop{ enum << input_stream.get_next_entry } - end.lazy.take_while{ |e| e } + def subdirs + Enumerator.new do |yielder| + @yielder = yielder + Zip::File.open_buffer(@zip_data, &(method :_subdirs)) end end - def entry_groups - self.class.entries(input_stream).group_by(&method(:entry_key)) + def _subdirs zip_file + zip_file.each do | entry | + add_entry entry + end + finish_current_output end - def entry_group_streams - entry_groups.map(&method(:make_stream)).to_h + def add_entry entry + key = entry_key entry + unless key == current_key + finish_current_output + open_new_output key + end + add_to_current_output entry end - def entry_key entry - entry.name.split('/', -1)[-2] + def add_to_current_output entry + current_output.put_next_entry entry.name + write_to_current_output entry.get_input_stream end - def make_stream pair - name, entries = pair - [name, make_stream_from( entries )] + def write_to_current_output input_stream + # the condition below is true for directory entries + return if Zip::NullInputStream == input_stream + current_output.write input_stream.read end - def make_stream_from entries - Zip::OutputStream.write_buffer(&self.class.convert_entries(entries)) + def finish_current_output + if current_output + @yielder << Subdir.new( + current_key, + # Second part of the solution, yield the closed stream + current_output.close_buffer) + end end - def next_entry - @current_entry = input_stream.get_next_entry + def open_new_output entry_key + @current_key = entry_key + # First piece of the solution, use internal way to create a Zip::OutputStream + @current_output = Zip::OutputStream.new(StringIO.new(''), true, nil) end - def input_stream - @__input_stream__ ||= Zip::InputStream.open(StringIO.new(zip_data)) + def entry_key entry + # last dir name File.dirname.split("/").last + entry.name.split('/', -1)[-2] end end diff --git a/app/views/api/v1/imports/index.rabl b/app/views/api/v1/imports/index.rabl new file mode 100644 index 000000000..e8cfd101e --- /dev/null +++ b/app/views/api/v1/imports/index.rabl @@ -0,0 +1,3 @@ +collection @imports + +extends "api/v1/imports/show" diff --git a/app/views/api/v1/imports/show.rabl b/app/views/api/v1/imports/show.rabl new file mode 100644 index 000000000..180894cb8 --- /dev/null +++ b/app/views/api/v1/imports/show.rabl @@ -0,0 +1,6 @@ +object @import + +attributes :id, :name, :status +node :referential_ids do |i| + i.workbench.referentials.map(&:id) +end diff --git a/app/views/api/v1/workbenches/index.rabl b/app/views/api/v1/workbenches/index.rabl new file mode 100644 index 000000000..2f0bf5fee --- /dev/null +++ b/app/views/api/v1/workbenches/index.rabl @@ -0,0 +1,3 @@ +collection @workbenches + +extends "api/v1/workbenches/show" diff --git a/app/views/api/v1/workbenches/show.rabl b/app/views/api/v1/workbenches/show.rabl new file mode 100644 index 000000000..d43727809 --- /dev/null +++ b/app/views/api/v1/workbenches/show.rabl @@ -0,0 +1,3 @@ +object @workbench + +attributes :id, :name diff --git a/app/views/api_keys/_api_key.html.slim b/app/views/api_keys/_api_key.html.slim deleted file mode 100644 index 4cb07ef83..000000000 --- a/app/views/api_keys/_api_key.html.slim +++ /dev/null @@ -1,18 +0,0 @@ -#index_item.panel.panel-default.api_key - .panel-heading - .panel-title.clearfix - span.pull-right - = link_to edit_referential_api_key_path(@referential, api_key), class: "btn btn-default btn-sm" do - span.fa.fa-pencil - - = link_to referential_api_key_path(@referential, api_key), :method => :delete, :data => {:confirm => t('api_keys.actions.destroy_confirm')}, class: "btn btn-danger btn-sm" do - span.fa.fa-trash-o - - h5 - = link_to([@referential, api_key], class: "preview", :title => "#{Chouette::StopArea.model_name.human.capitalize} #{api_key.name}") do - span.name = truncate(api_key.name, :length => 20) - - .panel-body - p = "#{api_key.class.human_attribute_name('token')} #{truncate(api_key.token, :length => 20)}" - - p = "#{api_key.class.human_attribute_name('updated_at')} #{l(api_key.updated_at)}"
\ No newline at end of file diff --git a/app/views/api_keys/_form.html.slim b/app/views/api_keys/_form.html.slim index 74b806677..94a3ae57e 100644 --- a/app/views/api_keys/_form.html.slim +++ b/app/views/api_keys/_form.html.slim @@ -1,10 +1,9 @@ -= semantic_form_for [@referential, @api_key] do |form| - = form.inputs do - = form.input :name - - - unless @api_key.new_record? - = form.input :token, :input_html => { :readonly => true } += simple_form_for @api_key, html: {class: 'form-horizontal', id: 'api_key_form'}, wrapper: :horizontal_form do |f| + .row + .col-lg-12 + = f.input :name + - unless @api_key.new_record? + = f.input :token, :input_html => { readonly: true } - = form.actions do - = form.action :submit, as: :button - = form.action :cancel, as: :link
\ No newline at end of file + / = f.association :referential + = f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'api_key_form' diff --git a/app/views/api_keys/edit.html.slim b/app/views/api_keys/edit.html.slim index 110f0775d..9d7d1fdb7 100644 --- a/app/views/api_keys/edit.html.slim +++ b/app/views/api_keys/edit.html.slim @@ -1,3 +1,18 @@ -= title_tag t('api_keys.edit.title') +/ PageHeader += pageheader 'Clé d\'API', + t('api_keys.edit.title'), + 'Lorem ipsum dolor sit amet', + t('last_update', time: l(@api_key.updated_at, format: :short)), + '' -== render 'form'
\ No newline at end of file + / Below are secondary actions & optional content (filters, ...) + .row.mb-sm + .col-lg-12.text-right + = ( policy(@api_key).destroy? ? link_to(t('actions.destroy'), api_key_path(@api_key), :method => :delete, class: 'btn btn-default') : '' ) + +/ PageContent +.page_content + .container-fluid + .row + .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1 + == render 'form' diff --git a/app/views/api_keys/new.html.slim b/app/views/api_keys/new.html.slim index f7b1dd99b..9acb08a94 100644 --- a/app/views/api_keys/new.html.slim +++ b/app/views/api_keys/new.html.slim @@ -1,3 +1,12 @@ -= title_tag t('api_keys.new.title') +/ PageHeader += pageheader 'Clé d\'API', + t('api_keys.new.title'), + 'Lorem ipsum dolor sit amet', + '' -== render "form"
\ No newline at end of file +/ PageContent +.page_content + .container-fluid + .row + .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1 + == render 'form' diff --git a/app/views/api_keys/show.html.slim b/app/views/api_keys/show.html.slim deleted file mode 100644 index b65717408..000000000 --- a/app/views/api_keys/show.html.slim +++ /dev/null @@ -1,18 +0,0 @@ -= title_tag t('api_keys.show.title') - -.api_keys_show - .summary - p - label = "#{@api_key.class.human_attribute_name('name')} : " - = @api_key.name - - p - label = "#{@api_key.class.human_attribute_name('token')} : " - = @api_key.token - -- content_for :sidebar do - ul.actions - li = link_to t('api_keys.actions.new'), new_referential_api_key_path(@referential), class: "add" - li = link_to t('api_keys.actions.edit'), edit_referential_api_key_path(@referential, @api_key), class: "edit" - li = link_to t('api_keys.actions.destroy'), referential_api_key_path(@referential, @api_key), :method => :delete, :data => {:confirm => t('api_keys.actions.destroy_confirm')}, class: "remove" - br
\ No newline at end of file diff --git a/app/views/calendars/_filters.html.slim b/app/views/calendars/_filters.html.slim index 4c30f69dc..b5283c1e8 100644 --- a/app/views/calendars/_filters.html.slim +++ b/app/views/calendars/_filters.html.slim @@ -19,4 +19,4 @@ .actions = link_to 'Effacer', calendars_path, class: 'btn btn-link' - = f.submit 'Filtrer', id: 'filter_btn', class: 'btn btn-default' + = f.submit 'Filtrer', id: 'calendar_filter_btn', class: 'btn btn-default' diff --git a/app/views/calendars/edit.html.slim b/app/views/calendars/edit.html.slim index 6668630e8..426f27881 100644 --- a/app/views/calendars/edit.html.slim +++ b/app/views/calendars/edit.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'modele-calendrier', t('.title', calendar: @calendar.name), '', t('last_update', time: l(@calendar.updated_at, format: :short)) diff --git a/app/views/calendars/index.html.slim b/app/views/calendars/index.html.slim index e3ac16505..24ed15484 100644 --- a/app/views/calendars/index.html.slim +++ b/app/views/calendars/index.html.slim @@ -1,6 +1,6 @@ / PageHeader -- header_params = ['map-marker', +- header_params = ['modele-calendrier', t('.title'), ''] - header_params << link_to(t('actions.add'), new_calendar_path, class: 'btn btn-default') if policy(Calendar).create? @@ -13,7 +13,7 @@ .row .col-lg-12 = render 'filters' - + - if @calendars.any? .row .col-lg-12 @@ -21,13 +21,20 @@ [ \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |calendar| \ + calendar_path(calendar) \ + end \ ), \ TableBuilderHelper::Column.new( \ key: :short_name, \ attribute: 'short_name' \ ), \ TableBuilderHelper::Column.new( \ + key: :organisation, \ + attribute: Proc.new { |c| c.organisation.name } \ + ), \ + TableBuilderHelper::Column.new( \ key: :shared, \ attribute: Proc.new { |c| t("#{c.try(:shared)}") } \ ) \ @@ -36,8 +43,10 @@ cls: 'table has-filter' = new_pagination @calendars, 'pull-right' - + - unless @calendars.any? .row.mt-xs .col-lg-12 = replacement_msg t('calendars.search_no_results') + += javascript_include_tag 'filters/calendar.js' diff --git a/app/views/calendars/new.html.slim b/app/views/calendars/new.html.slim index 7faecf587..2cb6f8061 100644 --- a/app/views/calendars/new.html.slim +++ b/app/views/calendars/new.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'modele-calendrier', t('.title'), '', '' diff --git a/app/views/calendars/show.html.slim b/app/views/calendars/show.html.slim index 4ce5de57f..eda4ef97c 100644 --- a/app/views/calendars/show.html.slim +++ b/app/views/calendars/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'modele-calendrier', @calendar.name, '', t('last_update', time: l(@calendar.updated_at, format: :short)), diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim index ceea385b3..dad905c60 100644 --- a/app/views/companies/index.html.slim +++ b/app/views/companies/index.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'transporteur', t('companies.index.title'), 'Lorem ipsum dolor sit amet', '', @@ -31,7 +31,10 @@ ), \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |company| \ + line_referential_company_path(current_referential, company) \ + end \ ) \ ], links: [:show, :edit], diff --git a/app/views/companies/show.html.slim b/app/views/companies/show.html.slim index a5c7347a8..4fb437115 100644 --- a/app/views/companies/show.html.slim +++ b/app/views/companies/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'transporteur', @company.name, 'Lorem ipsum dolor sit amet', t('last_update', time: l(@company.updated_at, format: :short)) do diff --git a/app/views/compliance_check_tasks/new.html.erb b/app/views/compliance_check_tasks/new.html.erb deleted file mode 100644 index 3f43a7dd7..000000000 --- a/app/views/compliance_check_tasks/new.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -<%= title_tag t(".title") %> - -<%= semantic_form_for [@referential, @compliance_check_task], :url => referential_compliance_check_tasks_path(@referential) do |form| %> - <%= form.inputs do %> - <%= form.input :user_name, :as => :hidden, :input_html => { :value => current_user.name } %> <%= form.input :user_id, :as => :hidden, :input_html => { :value => current_user.id } %> - <%= form.input :referential_id, :as => :hidden, :input_html => { :value => @referential.id } %> - <%= form.input :name %> - <%= form.input :rule_parameter_set_id, :as => :select, - :collection => @referential.organisation.rule_parameter_sets.map { |rps| [ rps.name, rps.id ] }, :include_blank => false %> - <%= form.input :references_type, :as => :select, :include_blank => t(".all") %> - <% @compliance_check_task.class.references_types.each do |type| %> - <%= form.input :reference_ids, :as => :reference_ids, :json => references_referential_compliance_check_tasks_path(@referential, :format => :json) + "?filter=#{type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :id => "#{type}_reference_ids", :input_html => { :id => "#{type}_reference_ids" }, :wrapper_html => { :style => "display:none;", :id => "#{type}", :"data-type" => "#{type}" } %> - <% end %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button , :label => t( 'formtastic.validate' ) %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<!-- = title_tag t('.title') - -= semantic_form_for [@referential, @compliance_check_task], :url => referential_compliance_check_tasks_path(@referential) do |form| - = form.inputs do - = form.input :user_name, :as => :hidden, :input_html => { :value => current_user.name } - = form.input :user_id, :as => :hidden, :input_html => { :value => current_user.id } - = form.input :referential_id, :as => :hidden, :input_html => { :value => @referential.id } - = form.input :name - = form.input :rule_parameter_set_id, :as => :select, - :collection => @referential.organisation.rule_parameter_sets.map { |rps| [ rps.name, rps.id ] }, :include_blank => false - = form.input :references_type, :as => :select, :include_blank => t(".all") - - @compliance_check_task.class.references_types.each do |type| - - = form.input :reference_ids, as: :reference_ids, json: references_referential_compliance_check_tasks_path(@referential, format: :json) + "?filter=#{type}", hint_text: t('search_hint'), no_result_text: t('no_result_text'), searching_text: t('searching_term'), id: "#{type}_reference_ids", input_html: { :id => "#{type}_reference_ids" }, wrapper_html: { :style => "display:none;", :id => "#{type}", :"data-type" => "#{type}" } - - = form.actions do - = form.action :submit, as: :button, label: t('formtastic.validate') - = form.action :cancel, as: :link --> diff --git a/app/views/compliance_check_tasks/new.js.coffee b/app/views/compliance_check_tasks/new.js.coffee deleted file mode 100644 index ba62f53b2..000000000 --- a/app/views/compliance_check_tasks/new.js.coffee +++ /dev/null @@ -1,7 +0,0 @@ -jQuery -> - <% ComplianceCheckTask.references_types.map { |type| type_ids_model_references_type( ComplianceCheckTask, type)}.each do |rt| %> - $("textarea.<%= rt.input_class %>").tokenInput('<%= references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, :format => :json) %>', { prePopulate: $('#').data('pre'), minChars: 1, hintText: '<%= t('search_hint') %>', noResultsText: '<%= t('no_result_text') %>', searchingText: '<%= t('searching_term') %>'}); - <% end %> - - # - ComplianceCheckTask.references_types.map { |type| type_ids_model_references_type( ComplianceCheckTask, type)}.each do |rt| - # $("textarea.#{rt.input_class}").tokenInput("#{references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, format: :json)}", { prePopulate: $('#').data('pre'), minChars: 1, hintText: "#{t('search_hint')}", noResultsText: "#{t('no_result_text')}", searchingText: "#{t('searching_term')}"}); diff --git a/app/views/compliance_checks/_compliance_check.html.slim b/app/views/compliance_checks/_compliance_check.html.slim deleted file mode 100644 index 383a7ea82..000000000 --- a/app/views/compliance_checks/_compliance_check.html.slim +++ /dev/null @@ -1,17 +0,0 @@ -#index_item.panel.panel-default - .panel-heading - .panel-title.clearfix - span.pull-right - = link_to referential_compliance_check_path(@referential, compliance_check.id), :method => :delete, :data => {:confirm => t('compliance_checks.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do - span.fa.fa-trash-o - h5 - = link_to referential_compliance_check_path(@referential, compliance_check.id), class: 'preview', title: "#{ComplianceCheck.model_name.human.capitalize} #{compliance_check.name}" do - = job_status_title(compliance_check) - - .panel-body - p - = link_to( font_awesome_classic_tag("fa-external-link") + t("compliance_checks.actions.report"), report_referential_compliance_check_path(@referential, compliance_check.id)) if compliance_check.report? - .panel-footer - .history - = l compliance_check.created_at, :format => "%d/%m/%Y %H:%M" - = " | #{compliance_check.user_name}" diff --git a/app/views/compliance_checks/_compliance_check_results.html.slim b/app/views/compliance_checks/_compliance_check_results.html.slim deleted file mode 100644 index 8e86c174e..000000000 --- a/app/views/compliance_checks/_compliance_check_results.html.slim +++ /dev/null @@ -1,92 +0,0 @@ -p - form.form-inline - .form-group - label = t('shared.ie_report.search') - input#filter.form-control type="text" - - .form-group - label = ComplianceCheckResult.human_attribute_name(:severity) - select.filter-severity.form-control - option - option value="severity-error" - = t('compliance_check_result.severities.error') - option value="severity-warning" - = t('compliance_check_result.severities.warning') - - .form-group - label = ComplianceCheckResult.human_attribute_name(:status) - select.filter-status.form-control - option - option value="status-ok" - = t('compliance_check_result.statuses.ok') - option value="status-nok" - = t('compliance_check_result.statuses.nok') - option value="status-uncheck" - = t('compliance_check_result.statuses.uncheck') - - -table.table.table-hover.toggle-circle.toggle-medium data-filter="#filter" data-page-size="20" data-title-nok="#{t('compliance_check_result.statuses.nok')}" data-title-uncheck="#{t('compliance_check_result.statuses.uncheck')}" data-title-ok="#{t('compliance_check_result.statuses.ok')}" - thead - tr - th data-sort-ignore="true" - = ComplianceCheckResult.human_attribute_name(:status) - th.col-md-1 data-sort-ignore="true" - = ComplianceCheckResult.human_attribute_name(:severity) - th.col-md-3 - = ComplianceCheckResult.human_attribute_name(:rule_code) - th.col-md-2 - = t('compliance_check_results.errors') - th.col-md-6 data-toggle="true" data-sort-ignore="true" - = ComplianceCheckResult.human_attribute_name(:detail) - th data-hide="all" data-sort-ignore="true" - - tbody - - if compliance_check_validation_report - - compliance_check_validation_report.tests.each_with_index do |test, index| - tr class="#{test.result}_#{test.severity}" - td data-value="status-#{test.result}" - = status_icon( test.result, test.severity ) - td data-value="severity-#{test.severity}" - = t("compliance_check_result.severities.#{test.severity}_txt") - td data-value="#{test.result}_#{test.severity}" - = link_to test.test_id, test_definition(test.test_id), title: ComplianceCheckResult.human_attribute_name(test.test_id), target: "compliance_check" - td - = "#{test.error_count || 0} #{ComplianceCheckResult.human_attribute_name(:violation_count)}" if test.errors.present? - td - = truncate(t("activemodel.attributes.compliance_check_result.#{test.test_id}"), length: 50) - td - p - b - = t("activemodel.attributes.compliance_check_result.#{test.test_id}") - - - if test.errors.present? - - test.errors.first(10).each do |error| - dl.inline - dt - - if error["source"].present? - - if error[:source].object_path.present? - - if error[:source].label.present? - = link_to error[:source].label, object_url(@referential.id, error), target: :_blank - - else - = link_to "#{error[:source].object_path.type} (#{error[:source].object_path.id})", object_url(@referential.id, error), target: :_blank - - - if error[:source].file.present? - = error[:source].objectid if error[:source].objectid.present? - - dd = t("compliance_check_result.details.detail_#{error[:error_id]}", object_labels_hash(error)) - - - if error[:source].file.present? - p.file_error - = error[:source].file.filename - = ", li: #{error[:source].file.line_number}" if error[:source].file.line_number.present? - = ", co: #{error[:source].file.column_number}" if error[:source].file.column_number.present? - - - else - tr - td colspan="6" - = t('compliance_check_results.in_progress') - - tfoot.hide-if-no-paging - tr - td colspan="5" - ul.pagination.pagination-centered diff --git a/app/views/compliance_checks/_compliance_checks.html.slim b/app/views/compliance_checks/_compliance_checks.html.slim deleted file mode 100644 index 48db9ae94..000000000 --- a/app/views/compliance_checks/_compliance_checks.html.slim +++ /dev/null @@ -1,9 +0,0 @@ -.page_info - span.search = t('will_paginate.page_entries_info.search') - = page_entries_info @compliance_checks - -.compliance_checks.paginated_content - = paginated_content @compliance_checks, "compliance_checks/compliance_check" - -.pagination - = will_paginate @compliance_checks, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/compliance_checks/detailed_errors_index.csv.slim b/app/views/compliance_checks/detailed_errors_index.csv.slim deleted file mode 100644 index 7fe20e282..000000000 --- a/app/views/compliance_checks/detailed_errors_index.csv.slim +++ /dev/null @@ -1,37 +0,0 @@ -= I18n.t('activemodel.attributes.compliance_check_result.severity'); -= I18n.t('activemodel.attributes.compliance_check_result.rule_code'); -= I18n.t('activemodel.attributes.compliance_check_result.object'); -= I18n.t('activemodel.attributes.compliance_check_result.resource'); -= I18n.t('activemodel.attributes.compliance_check_result.title'); -= I18n.t('activemodel.attributes.compliance_check_result.detail') - -- @compliance_check.compliance_check_validation_report.tests.each do |r| - - if r.errors.present? - - r.errors.first(10).each do |error| - - case r.severity - - when "warning" - = I18n.t('compliance_check_result.severities.warning_txt') - - when "error" - = I18n.t('compliance_check_result.severities.error_txt') - - = r.test_id; - - - if error["source"].present? - = error["source"]["objectid"] if error["source"]["objectid"].present? - - - if error["source"]["object_path"].present? - = object_url(@referential_id, error) - - elsif error["source"]["file"].present? - = File.basename(error["source"]["file"]["filename"]) + " - " - = I18n.t("compliance_check_results.index.column") + ":" - = error["source"]["file"]["column_number"] + "," - = I18n.t("compliance_check_results.index.line") + ":" - = error["source"]["file"]["line_number"] - - - else - = I18n.t("activemodel.attributes.compliance_check_result.#{r.test_id}"); - = I18n.t("compliance_check_result.details.detail_#{error['error_id']}", object_labels_hash(error) ) - = "\n" - -/ <%= I18n.t("activemodel.attributes.compliance_check_result.severity") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.rule_code") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.object") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.resource") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.title") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.detail") %> -/ <% @compliance_check.compliance_check_validation_report.tests.each do |r| %><% if r.errors.present? %><% r.errors.first(10).each do |error| %><% case r.severity %><% when "warning" %><%= I18n.t "compliance_check_result.severities.warning_txt" %><% when "error" %><%= I18n.t "compliance_check_result.severities.error_txt" %><% end %>;<%= r.test_id %>;<% if error["source"].present? %><%= error["source"]["objectid"] if error["source"]["objectid"].present? %>;<% if error["source"]["object_path"].present? %><%= object_url(@referential_id, error) %><% elsif error["source"]["file"].present? %><%= File.basename(error["source"]["file"]["filename"]) +" - " %><%= I18n.t "compliance_check_results.index.column" %>:<%= error["source"]["file"]["column_number"] %>,<%= I18n.t "compliance_check_results.index.line" %>:<%= error["source"]["file"]["line_number"] %><% end %>;<% else %>;;<% end %><%= I18n.t("activemodel.attributes.compliance_check_result."+r.test_id) %>;<%= I18n.t("compliance_check_result.details.detail_#{error['error_id']}", object_labels_hash(error) )%><%= "\n" %><% end %><% end %><% end %> diff --git a/app/views/compliance_checks/index.html.slim b/app/views/compliance_checks/index.html.slim deleted file mode 100644 index 392c46663..000000000 --- a/app/views/compliance_checks/index.html.slim +++ /dev/null @@ -1,14 +0,0 @@ -= title_tag t('.title') - -.warning - = t('.warning') - -#compliance_checks - = render 'compliance_checks' - -- content_for :sidebar do - ul.actions - li - = link_to t('compliance_check_tasks.actions.new'), new_referential_compliance_check_task_path(), class: 'add' - li - = link_to t('rule_parameter_sets.actions.index'), organisation_rule_parameter_sets_path, class: 'link'
\ No newline at end of file diff --git a/app/views/compliance_checks/index.js.slim b/app/views/compliance_checks/index.js.slim deleted file mode 100644 index cfd8dc40d..000000000 --- a/app/views/compliance_checks/index.js.slim +++ /dev/null @@ -1 +0,0 @@ -| $('#compliance_checks').html("#{escape_javascript(render('compliance_checks'))}");
\ No newline at end of file diff --git a/app/views/compliance_checks/report.html.slim b/app/views/compliance_checks/report.html.slim deleted file mode 100644 index be2bb8adc..000000000 --- a/app/views/compliance_checks/report.html.slim +++ /dev/null @@ -1,41 +0,0 @@ -= title_tag job_status_title(@compliance_check) - -.compliance_check_show - .links - - if @compliance_check.class == Import - = link_to(font_awesome_classic_tag('fa-eye') + t("compliance_checks.report.action_report"), referential_import_path(@referential, @compliance_check.id)) - = link_to font_awesome_classic_tag("fa-external-link") + t("compliance_checks.rule_parameter_set"), rule_parameter_set_referential_import_path(@referential, @compliance_check.id) if @compliance_check.rule_parameter_set? - - else - = link_to(font_awesome_classic_tag('fa-eye') + t("compliance_checks.report.action_report"), referential_compliance_check_path(@referential, @compliance_check.id)) - = link_to font_awesome_classic_tag("fa-external-link") + t("compliance_checks.rule_parameter_set"), rule_parameter_set_referential_compliance_check_path(@referential, @compliance_check.id) if @compliance_check.rule_parameter_set? - - .btn-group.pull-right - button.btn.btn-default.dropdown-toggle type="button" data-toggle="dropdown" aria-expanded="false" - = t('compliance_checks.show.export') - span.caret - - ul.dropdown-menu role="menu" - li - - if @compliance_check.class == Import - = link_to t('compliance_checks.show.export_csv'), export_referential_import_path(@referential, @compliance_check.id) - - else - = link_to t("compliance_checks.show.export_csv"), export_referential_compliance_check_path(@referential, @compliance_check.id) - - .report data-refresh-interval="#{job_refresh_interval(@compliance_check)}" - = render partial: 'compliance_checks/compliance_check_results', locals: { compliance_check_validation_report: @compliance_check.compliance_check_validation_report } - -- content_for :sidebar do - - if @compliance_check.compliance_check_validation_report && @compliance_check.compliance_check_validation_report.nok_error.blank? - .row - = font_awesome_classic_tag('fa-thumbs-up fa-5x col-md-3') - p#validation_success.col-md-7 - = t('.validation_success') - - ul.actions - li - - if @compliance_check.class != Import - = link_to t('compliance_checks.actions.destroy'), referential_compliance_check_path(@referential, @compliance_check.id), method: :delete, :data => {:confirm => t('compliance_checks.actions.destroy_confirm')}, class: 'remove' - - = history_tag(@compliance_check) - #error.graph - #warning.graph
\ No newline at end of file diff --git a/app/views/compliance_checks/show.html.slim b/app/views/compliance_checks/show.html.slim deleted file mode 100644 index 8c6900981..000000000 --- a/app/views/compliance_checks/show.html.slim +++ /dev/null @@ -1,22 +0,0 @@ -.test - = title_tag job_status_title(@compliance_check) - -- if @compliance_check.report.failure_code? - .alert.alert-danger - = t("iev.failure.#{@compliance_check.report.failure_code}") - -.progress_bars - = progress_bar_tag(@compliance_check) - -.compliance_check.show - .links - = link_to font_awesome_classic_tag("fa-external-link") + t("compliance_checks.actions.report"), report_referential_compliance_check_path(@referential, @compliance_check.id) if @compliance_check.compliance_check_validation_report? - - = render partial: "shared/ie_report", locals: { job: @compliance_check, type: :validation, line_items: @line_items } - -- content_for :sidebar do - ul.actions - li - = link_to t('compliance_checks.actions.destroy'), referential_compliance_check_path(@referential, @compliance_check.id), method: :delete, data: {confirm: t('compliance_checks.actions.destroy_confirm')}, class: 'remove' - - = history_tag(@compliance_check)
\ No newline at end of file diff --git a/app/views/compliance_checks/summary_errors_index.csv.slim b/app/views/compliance_checks/summary_errors_index.csv.slim deleted file mode 100644 index 8c88d5cf6..000000000 --- a/app/views/compliance_checks/summary_errors_index.csv.slim +++ /dev/null @@ -1,34 +0,0 @@ -= I18n.t("activemodel.attributes.compliance_check_result.severity"); -= I18n.t("activemodel.attributes.compliance_check_result.status"); -= I18n.t("activemodel.attributes.compliance_check_result.rule_code"); -= I18n.t("activemodel.attributes.compliance_check_result.title"); -= I18n.t("activemodel.attributes.compliance_check_result.url"); -= I18n.t("activemodel.attributes.compliance_check_result.violation_count_txt"); -= I18n.t("activemodel.attributes.compliance_check_result.objects") - -- @compliance_check.compliance_check_validation_report.tests.each do |r| - - case r.severity - - when "warning" - = I18n.t("compliance_check_result.severities.warning_txt") - - when "error" - = I18n.t("compliance_check_result.severities.error_txt") - - = r.result; - = r.test_id; - - = I18n.t("activemodel.attributes.compliance_check_result.#{r.test_id}"); - = Rails.application.config.validation_spec + I18n.locale.to_s + "/" + r.test_id + ".html"; - - = r.error_count - - - if r.error_count > 0 - - if r.errors.present? - - r.errors.first(10).each do |error| - - if error["source"] - = error["source"]["objectid"] + " " - - else - = " " - -/ <%= I18n.t("activemodel.attributes.compliance_check_result.severity") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.status") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.rule_code") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.title") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.url") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.violation_count_txt") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.objects") %> -/ <% @compliance_check.compliance_check_validation_report.tests.each do |r| %><% case r.severity %><% when "warning" %><%= I18n.t "compliance_check_result.severities.warning_txt" %><% when "error" %><%= I18n.t "compliance_check_result.severities.error_txt" %><% end %>;<%= r.result %>;<%= r.test_id %>;<%= I18n.t("activemodel.attributes.compliance_check_result."+r.test_id) %>;<%= Rails.application.config.validation_spec + I18n.locale.to_s + "/" + r.test_id + ".html" %>;<%= r.error_count %><% if r.error_count > 0 %><% if r.errors.present? %>;<% r.errors.first(10).each do |error| %><% if error["source"] %><%= error["source"]["objectid"] + " " %><% else %><%= " " %><% end %><% end %><% end %><% end %> -/ <% end %> diff --git a/app/views/compliance_control_sets/_filters.html.slim b/app/views/compliance_control_sets/_filters.html.slim new file mode 100644 index 000000000..8da629e9c --- /dev/null +++ b/app/views/compliance_control_sets/_filters.html.slim @@ -0,0 +1,33 @@ += search_form_for @q_for_form, url: workbench_path(@workbench.id), builder: SimpleForm::FormBuilder, class: 'form form-filter' do |f| + .ffg-row + .input-group.search_bar + = f.search_field :name_cont, class: 'form-control', placeholder: t('referentials.filters.name') + span.input-group-btn + button.btn.btn-default type='submit' + span.fa.fa-search + + .ffg-row + .form-group + = f.label t('activerecord.models.line.one').upcase, required: false, class: 'control-label' + = f.input :associated_lines_id_eq, as: :select, collection: @workbench.lines.includes(:company).order(:name), input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': t('referentials.filters.line') }, label: false, label_method: :display_name, wrapper_html: { class: 'select2ed'} + + .form-group.togglable + = f.label Referential.human_attribute_name(:status), required: false, class: 'control-label' + .form-group.checkbox_list + = f.input :archived_at_not_null, label: ("<span>#{t('activerecord.attributes.referential.archived_at')}<span class='fa fa-archive'></span></span>").html_safe, as: :boolean, wrapper_html: { class: 'checkbox-wrapper' } + = f.input :archived_at_null, label: ("<span>#{t('activerecord.attributes.referential.archived_at_null')}<span class='sb sb-lg sb-preparing'></span></span>").html_safe, as: :boolean, wrapper_html: { class: 'checkbox-wrapper' } + + .form-group.togglable + = f.label t('activerecord.models.organisation.one'), required: false, class: 'control-label' + = f.input :organisation_name_eq_any, collection: Organisation.order('name').pluck(:name), as: :check_boxes, label: false, label_method: lambda{|w| ("<span>#{w}</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' } + + .form-group.togglable + = f.label Referential.human_attribute_name(:validity_period), required: false, class: 'control-label' + .filter_menu + = f.simple_fields_for :validity_period do |p| + = p.input :begin_gteq, as: :date, label: t('simple_form.from'), wrapper_html: { class: 'date smart_date filter_menu-item' }, default: @begin_range, include_blank: @begin_range ? false : true + = p.input :end_lteq, as: :date, label: t('simple_form.to'), wrapper_html: { class: 'date smart_date filter_menu-item' }, default: @end_range, include_blank: @end_range ? false : true + + .actions + = link_to t('actions.erase'), @workbench, class: 'btn btn-link' + = f.submit t('actions.filter'), class: 'btn btn-default', id: 'referential_filter_btn' diff --git a/app/views/compliance_control_sets/_form.html.slim b/app/views/compliance_control_sets/_form.html.slim new file mode 100644 index 000000000..cf144bbd9 --- /dev/null +++ b/app/views/compliance_control_sets/_form.html.slim @@ -0,0 +1,8 @@ += simple_form_for @compliance_control_set, html: { class: 'form-horizontal', id: 'compliance_control_set_form' }, wrapper: :horizontal_form do |f| + .row + .col-lg-12 + = f.input :name + + .separator + + = f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'compliance_control_set_form' diff --git a/app/views/compliance_control_sets/edit.html.slim b/app/views/compliance_control_sets/edit.html.slim new file mode 100644 index 000000000..a9b8d7253 --- /dev/null +++ b/app/views/compliance_control_sets/edit.html.slim @@ -0,0 +1,10 @@ +/ PageHeader += pageheader 'modele-calendrier', + t('compliance_control_sets.index.edit') + +/ PageContent +.page_content + .container-fluid + .row + .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1 + = render 'form' diff --git a/app/views/compliance_control_sets/index.html.slim b/app/views/compliance_control_sets/index.html.slim new file mode 100644 index 000000000..fa85c38f7 --- /dev/null +++ b/app/views/compliance_control_sets/index.html.slim @@ -0,0 +1,50 @@ +/ PageHeader +- header_params = ['jeux-de-donnees', + t('compliance_control_sets.index.title'), + ''] +- header_params << link_to(t('compliance_control_sets.actions.new'), new_compliance_control_set_path, class: 'btn btn-default') if policy(Calendar).create? += pageheader(*header_params) do + + / Below is secundary actions & optional contents (filters, ...) + .row.mb-sm + .col-lg-12.text-right + +/ PageContent +.page_content + .container-fluid + .row + .col-lg-12 + /= render 'filters' + .row + .col-lg-12 + .select_table + = table_builder_2 @compliance_control_sets, + [ \ + TableBuilderHelper::Column.new( \ + key: :name, \ + attribute: 'name', \ + link_to: lambda do |compliance_control_set| \ + compliance_control_set_path(@compliance_control_sets, compliance_control_set) \ + end \ + ), \ + TableBuilderHelper::Column.new( \ + key: :assignment, \ + attribute: 'assignment' \ + ), \ + TableBuilderHelper::Column.new( \ + key: :owner_jdc, \ + attribute: 'owner_jdc' \ + ), \ + TableBuilderHelper::Column.new( \ + key: :control_numbers, \ + attribute: 'control_numbers' \ + ), \ + TableBuilderHelper::Column.new( \ + key: :update, \ + attribute: '' \ + ) \ + ], + sortable: true, + cls: 'table has-filter has-search' + + diff --git a/app/views/compliance_control_sets/new.html.slim b/app/views/compliance_control_sets/new.html.slim new file mode 100644 index 000000000..d6be41ee8 --- /dev/null +++ b/app/views/compliance_control_sets/new.html.slim @@ -0,0 +1,11 @@ +/ PageHeader += pageheader 'modele-calendrier', + t('compliance_control_sets.index.new') + + +/ PageContent +.page_content + .container-fluid + .row + .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1 + = render 'form' diff --git a/app/views/compliance_control_sets/show.html.slim b/app/views/compliance_control_sets/show.html.slim new file mode 100644 index 000000000..b4a5b2260 --- /dev/null +++ b/app/views/compliance_control_sets/show.html.slim @@ -0,0 +1,25 @@ +/ PageHeader += pageheader 'jeux-de-donnees', + @compliance_control_set.name, + 'Lorem ipsum dolor sit amet' + + / Below is secondary actions & optional contents (filters, ...) + .row.mb-sm + .col-lg-12.text-right + - @compliance_control_set.action_links.each do |link| + - if link.is_a?(HTMLElement) + = link.to_html(class: 'btn btn-primary') + - else + = link_to link.href, + method: link.method, + data: link.data, + class: 'btn btn-primary' do + = link.content + +/ PageContent +.page_content + .container-fluid + .row + .col-lg-6.col-md-6.col-sm-12.col-xs-12 + = definition_list t('metadatas'), + ComplianceControlSet.human_attribute_name(:name) => @compliance_control_set.name
\ No newline at end of file diff --git a/app/views/compliance_controls/_form.html.slim b/app/views/compliance_controls/_form.html.slim new file mode 100644 index 000000000..1377ed12b --- /dev/null +++ b/app/views/compliance_controls/_form.html.slim @@ -0,0 +1,12 @@ += simple_form_for [@compliance_control_set, @compliance_control], html: { class: 'form-horizontal', id: 'compliance_control_form' }, wrapper: :horizontal_form do |f| + .row + .col-lg-12 + = f.input :name + = f.input :type + = f.input :code + = f.input :criticity + = f.input :comment + + .separator + + = f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'compliance_control_form' diff --git a/app/views/compliance_controls/edit.html.slim b/app/views/compliance_controls/edit.html.slim new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/compliance_controls/edit.html.slim diff --git a/app/views/compliance_controls/index.html.slim b/app/views/compliance_controls/index.html.slim new file mode 100644 index 000000000..fd1293837 --- /dev/null +++ b/app/views/compliance_controls/index.html.slim @@ -0,0 +1,44 @@ +/ PageHeader +- header_params = ['jeux-de-donnees', + t('compliance_controls.index.title'), + ''] +- header_params << link_to(t('compliance_controls.actions.new'), new_compliance_control_set_compliance_control_path(@compliance_control_set), class: 'btn btn-default') if policy(ComplianceControl).create? += pageheader(*header_params) do + + .row.mb-sm + .col-lg-12.text-right + +.page_content + .container-fluid + .row + .col-lg-12 + /= render 'filters' + .row + .col-lg-12 + .select_table + = table_builder_2 @compliance_controls, + [ \ + TableBuilderHelper::Column.new( \ + key: :code, \ + attribute: 'code' \ + ), \ + TableBuilderHelper::Column.new( \ + key: :name, \ + attribute: 'name', \ + link_to: lambda do |compliance_control| \ + compliance_control_set_compliance_control_path(@compliance_control_set, compliance_control) \ + end \ + ), \ + TableBuilderHelper::Column.new( \ + key: :criticity, \ + attribute: 'criticity' \ + ), \ + TableBuilderHelper::Column.new( \ + key: :comment, \ + attribute: 'comment' \ + ), \ + ], + sortable: true, + cls: 'table has-filter has-search' + + diff --git a/app/views/compliance_controls/new.html.slim b/app/views/compliance_controls/new.html.slim new file mode 100644 index 000000000..0651461cb --- /dev/null +++ b/app/views/compliance_controls/new.html.slim @@ -0,0 +1,9 @@ += pageheader 'compliance-control', + t('compliance_control.index.new') + + +.page_content + .container-fluid + .row + .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1 + = render 'form' diff --git a/app/views/compliance_controls/show.html.slim b/app/views/compliance_controls/show.html.slim new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/compliance_controls/show.html.slim diff --git a/app/views/import_resources/index.html.slim b/app/views/import_resources/index.html.slim new file mode 100644 index 000000000..849ed6d8d --- /dev/null +++ b/app/views/import_resources/index.html.slim @@ -0,0 +1,58 @@ +/ PageHeader += pageheader 'importer', + t('.title'), + '', + '', + '' + +/ PageContent +.page_content.import_messages + .container-fluid + .row + .col-lg-12 + = definition_list t('metadatas'),{ 'Bilan d\'import' => link_to(@import.parent.name, workbench_import_path(@import.parent.workbench, @import.parent) ), + 'Jeu de données associé' => ( @import.referential.present? ? link_to(@import.referential.name, referential_path(@import.referential)) : '-' ) } + + .row + .col-lg-12 + h1 + span.status_icon = import_status(@import.status) + span = t('.table_state', lines_imported: @import_resources.lines_imported , lines_in_zipfile: @import_resources.lines_in_zipfile ) + - if @import_resources.present? + .col-lg-12 + h2 = t('.table_title') + .col-lg-12 + = t('.table_explanation') + .col-lg-12 + = table_builder_2 @import_resources.where(resource_type: :file), + [ \ + TableBuilderHelper::Column.new( \ + key: :name, \ + attribute: 'name', \ + sortable: false, \ + ), \ + TableBuilderHelper::Column.new( \ + key: :status, \ + attribute: Proc.new { |n| import_resource_status(n.status) }, \ + sortable: false, \ + ), \ + TableBuilderHelper::Column.new( \ + name: 'Résultat des tests' , \ + attribute: Proc.new { |n| I18n.t('import_resources.index.metrics', n.metrics.deep_symbolize_keys) }, \ + sortable: false, \ + ), \ + TableBuilderHelper::Column.new( \ + name: 'Téléchargement' , \ + attribute: Proc.new { |n| '<i class="fa fa-download" aria-hidden="true"></i>'.html_safe }, \ + sortable: false, \ + link_to: lambda do |import_resource| \ + workbench_import_import_resource_import_messages_path(import_resource.import.workbench, import_resource.import, import_resource, format: 'csv' ) \ + end \ + ), \ + ], + links: [], + cls: 'table has-search' + - else + .col-lg-12 + - @import.messages.each do |message| + = I18n.t("import_messages.compliance_check_messages.#{message.message_key}") diff --git a/app/views/imports/_filters.html.slim b/app/views/imports/_filters.html.slim new file mode 100644 index 000000000..85099b99a --- /dev/null +++ b/app/views/imports/_filters.html.slim @@ -0,0 +1,23 @@ += search_form_for @q, url: workbench_imports_path(@workbench), html: { method: :get, class: 'form form-filter' } do |f| + .ffg-row + .input-group.search_bar + = f.search_field :name_or_creator_cont, class: 'form-control', placeholder: t('imports.filters.name_or_creator_cont') + span.input-group-btn + button.btn.btn-default#search_btn type='submit' + span.fa.fa-search + + .ffg-row + .form-group.togglable + = f.label Import.human_attribute_name(:status), required: false, class: 'control-label' + = f.input :status_eq_any, collection: %w(pending successful warning failed), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + import_status(l) + "</span>").html_safe}, required: false, wrapper_html: { class: "checkbox_list"} + + .form-group.togglable + = f.label Import.human_attribute_name(:started_at), required: false, class: 'control-label' + .filter_menu + = f.simple_fields_for :started_at do |p| + = p.input :begin, as: :date, label: false, wrapper_html: { class: 'date smart_date filter_menu-item' }, default: @begin_range, include_blank: @begin_range ? false : true + = p.input :end, as: :date, label: false, wrapper_html: { class: 'date smart_date filter_menu-item' }, default: @end_range, include_blank: @end_range ? false : true + + .actions + = link_to t('actions.erase'), workbench_imports_path(@workbench), class: 'btn btn-link' + = f.submit t('actions.filter'), id: 'import_filter_btn', class: 'btn btn-default' diff --git a/app/views/imports/_form.html.slim b/app/views/imports/_form.html.slim index b795e908f..0fbf578be 100644 --- a/app/views/imports/_form.html.slim +++ b/app/views/imports/_form.html.slim @@ -1,6 +1,14 @@ -= simple_form_for import, as: :import, url: workbench_imports_path(workbench) do |f| - = f.input :name - = f.input :file - = f.association :referential, collection: workbench.referentials - = f.input :type, as: :hidden - = f.button :submit += simple_form_for import, as: :import, url: workbench_imports_path(workbench), html: {class: 'form-horizontal', id: 'wb_import_form'}, wrapper: :horizontal_form do |form| + + .row + .col-lg-12 + = form.input :name + + .row + .col-lg-12 + .form-group + = form.label :file, t('activerecord.attributes.import.resources'), class: 'control-label col-sm-4 col-xs-5' + .col-sm-8.col-xs-7 + = form.input_field :file, label: false, class: 'form-control' + + = form.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'wb_import_form' diff --git a/app/views/imports/index.html.slim b/app/views/imports/index.html.slim index 2630e5973..a6da730f1 100644 --- a/app/views/imports/index.html.slim +++ b/app/views/imports/index.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'importer', t('.title'), '', '', @@ -8,6 +8,11 @@ / PageContent .page_content .container-fluid + - if params[:q].present? or @imports.any? + .row + .col-lg-12 + = render 'filters' + - if @imports.any? .row .col-lg-12 @@ -15,20 +20,23 @@ [ \ TableBuilderHelper::Column.new( \ key: :status, \ - attribute: 'status' \ + attribute: Proc.new { |n| import_status(n.status) }, \ ), \ TableBuilderHelper::Column.new( \ key: :started_at, \ - attribute: Proc.new { |imp| imp.started_at ? l(imp.started_at, format: :short) : '-' } \ + attribute: Proc.new { |n| l(n.started_at, format: :long) if n.started_at }, \ ), \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |import| \ + workbench_import_path(@workbench, import) \ + end \ ), \ - # TableBuilderHelper::Column.new( \ - # name: 'Opérateur', \ - # attribute: '' \ - # ) \ + TableBuilderHelper::Column.new( \ + key: :creator, \ + attribute: 'creator' \ + ) \ ], links: [], cls: 'table has-search' @@ -36,6 +44,8 @@ = new_pagination @imports, 'pull-right' - unless @imports.any? - .row + .row.mt-xs .col-lg-12 = replacement_msg t('imports.search_no_results') + += javascript_include_tag 'filters/import.js' diff --git a/app/views/imports/new.html.slim b/app/views/imports/new.html.slim index 55b655a85..5d5df0857 100644 --- a/app/views/imports/new.html.slim +++ b/app/views/imports/new.html.slim @@ -1,4 +1,10 @@ -= title_tag t('.title') -.row - .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-8.col-sm-offset-2 - = render 'form', import: @import, workbench: @workbench +/ PageHeader += pageheader 'importer', + t('.title') + +/ PageContent +.page_content + .container-fluid + .row + .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1 + = render 'form', import: @import, workbench: @workbench diff --git a/app/views/imports/show.html.slim b/app/views/imports/show.html.slim index b40e11ea4..5f5974d69 100644 --- a/app/views/imports/show.html.slim +++ b/app/views/imports/show.html.slim @@ -1,14 +1,68 @@ -.title.row - .col-md-8 - = title_tag job_status_title(@import) +/ PageHeader += pageheader 'importer', + @import.name, + '', + t('last_update', time: l(@import.updated_at, format: :short)) do -.import_show - .links - = link_to font_awesome_classic_tag("fa-file-#{@import.file.file.extension}-o") + t("imports.show.imported_file"), @import.file.url + / Below is secundary actions & optional contents (filters, ...) + .row + .col-lg-12.text-right.mb-sm + - @import.action_links.each do |link| + = link_to link.href, + method: link.method, + data: link.data, + class: 'btn btn-primary' do + = link.content -- content_for :sidebar do - ul.actions - li - = link_to t('imports.actions.destroy'), workbench_import_path(@workbench, @import.id), method: :delete, data: {confirm: t('imports.actions.destroy_confirm')}, class: 'remove' +/ PageContent +.page_content + .container-fluid + .row + .col-lg-6.col-md-6.col-sm-12.col-xs-12 + = definition_list t('metadatas'), { 'Récupération des données' => '-', "Nom de l'archive" => @import.try(:file_identifier)} - = history_tag(@import) + .row + .col-lg-12 + = table_builder_2 @import.children, + [ \ + TableBuilderHelper::Column.new( \ + name: 'Nom du jeu de données', \ + attribute: 'name', \ + sortable: false, \ + link_to: lambda do |import| \ + referential_path(import.referential) if import.referential.present? \ + end \ + ), \ + TableBuilderHelper::Column.new( \ + key: :status, \ + attribute: Proc.new { |n| import_status(n.status) }, \ + sortable: false, \ + link_to: lambda do |import| \ + workbench_import_import_resources_path(import.workbench_id, import) \ + end \ + ), \ + TableBuilderHelper::Column.new( \ + name: 'Contrôle STIF', \ + attribute: '', \ + sortable: false, \ + ), \ + TableBuilderHelper::Column.new( \ + name: 'Contrôle organisation', \ + attribute: '', \ + sortable: false, \ + ) \ + ], + links: [], + cls: 'table', + overhead: [ \ + {}, \ + { \ + title: "#{@import.children_succeedeed} jeu de données validé sur #{@import.children.count} présents dans l'archive", \ + width: 1, \ + cls: "#{@import.import_status_css_class} full-border" \ + }, { \ + title: 'Bilan des jeux de contrôles d\'import <span title="Lorem ipsum..." class="fa fa-lg fa-info-circle text-info"></span>', \ + width: 2, \ + cls: 'overheaded-default colspan="2"' \ + } \ + ] diff --git a/app/views/journey_patterns_collections/show.html.slim b/app/views/journey_patterns_collections/show.html.slim index eb6dfb650..bce4f28b5 100644 --- a/app/views/journey_patterns_collections/show.html.slim +++ b/app/views/journey_patterns_collections/show.html.slim @@ -1,5 +1,5 @@ / pageheader -= pageheader 'map-marker', += pageheader 'mission', "Missions de #{@route.try(:stop_points).first.try(:stop_area).name} vers #{@route.try(:stop_points).last.try(:stop_area).name}", 'Lorem ipsum dolor sit amet', '' diff --git a/app/views/layouts/navigation/_main_nav_left.html.slim b/app/views/layouts/navigation/_main_nav_left.html.slim index 8e82ac528..12139c93b 100644 --- a/app/views/layouts/navigation/_main_nav_left.html.slim +++ b/app/views/layouts/navigation/_main_nav_left.html.slim @@ -11,7 +11,7 @@ .menu-item.panel .panel-heading h4.panel-title - = link_to '#miOne', data: { toggle: 'collapse', parent: '#menu-items' }, 'aria-expanded' => 'false' do + = link_to '#miOne', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do |Offres courantes #miOne.panel-collapse.collapse @@ -26,26 +26,26 @@ .menu-item.panel .panel-heading h4.panel-title - = link_to '#miTwo', data: { toggle: 'collapse', parent: '#menu-items' }, 'aria-expanded' => 'false' do + = link_to '#miTwo', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do |Espace de travail #miTwo.panel-collapse.collapse .list-group - = link_to '#', class: "list-group-item #{params[:controller] == 'workbenches' ? 'active' : ''}" do + = link_to workbench_path(current_offer_workbench), class: "list-group-item #{params[:controller] == 'workbenches' ? 'active' : ''}" do span Jeux de données - = link_to '#', class: 'list-group-item' do + = link_to workbench_imports_path(current_offer_workbench), class: "list-group-item #{(params[:controller] == 'imports') ? 'active' : ''}" do span Import = link_to calendars_path, class: 'list-group-item' do span Modèles de calendrier = link_to '#', class: 'list-group-item' do span Rapport de contrôle - = link_to '#', class: 'list-group-item' do + = link_to compliance_control_sets_path, class: 'list-group-item' do span Jeux de contrôle .menu-item.panel .panel-heading h4.panel-title - = link_to '#miThree', data: { toggle: 'collapse', parent: '#menu-items' }, 'aria-expanded' => 'false' do + = link_to '#miThree', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do |Données #miThree.panel-collapse.collapse @@ -56,13 +56,13 @@ .list-group = link_to referential_networks_path(current_referential), class: 'list-group-item' do span = t('networks.index.title') - + = link_to referential_companies_path(current_referential), class: 'list-group-item' do span = t('companies.index.title') - + = link_to '#', class: 'list-group-item disabled' do span Tracés - + = link_to referential_time_tables_path(current_referential), class: 'list-group-item' do span = t('time_tables.index.title') @@ -74,7 +74,7 @@ .menu-item.panel .panel-heading h4.panel-title - = link_to '#miFour', data: { toggle: 'collapse', parent: '#menu-items' }, 'aria-expanded' => 'false' do + = link_to '#miFour', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do |Synchronisation #miFour.panel-collapse.collapse @@ -87,9 +87,9 @@ .menu-item.panel .panel-heading h4.panel-title - = link_to '#miFive', data: { toggle: 'collapse', parent: '#menu-items' }, 'aria-expanded' => 'false' do + = link_to '#miFive', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do |Outils - + #miFive.panel-collapse.collapse .list-group = link_to Rails.application.config.try(:portal_url), target: '_blank', class: 'list-group-item' do diff --git a/app/views/line_footnotes/edit.html.slim b/app/views/line_footnotes/edit.html.slim index fcd7a47e0..4a0fbb931 100644 --- a/app/views/line_footnotes/edit.html.slim +++ b/app/views/line_footnotes/edit.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'ligne', "Notes sur la ligne #{@line.name}", 'Lorem ipsum dolor sit amet', (@line.footnotes.any? ? t('last_update', time: l(@line.footnotes.last.updated_at, format: :short)) : '') diff --git a/app/views/line_footnotes/show.html.slim b/app/views/line_footnotes/show.html.slim index 6ad721711..8138c1383 100644 --- a/app/views/line_footnotes/show.html.slim +++ b/app/views/line_footnotes/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'ligne', "Notes sur la ligne #{@line.name}", 'Lorem ipsum dolor sit amet', '', diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim index e2381e7e9..d2527f360 100644 --- a/app/views/line_referentials/show.html.slim +++ b/app/views/line_referentials/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'synchro-ilico', t('.title'), 'Lorem ipsum dolor sit amet', t('last_update', time: l(@line_referential.updated_at, format: :short)), diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim index 630d63068..dda5afd44 100644 --- a/app/views/lines/index.html.slim +++ b/app/views/lines/index.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'ligne', t('lines.index.title'), 'Lorem ipsum dolor sit amet', '', @@ -29,7 +29,10 @@ ), \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |line| \ + line_referential_line_path(@line_referential, line) \ + end \ ), \ TableBuilderHelper::Column.new( \ key: :deactivated, \ diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim index 6f75432e1..0779a0f5a 100644 --- a/app/views/lines/show.html.slim +++ b/app/views/lines/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'ligne', @line.name, 'Lorem ipsum dolor sit amet', t('last_update', time: l(@line.updated_at, format: :short)) do diff --git a/app/views/networks/index.html.slim b/app/views/networks/index.html.slim index 4c1f9783c..235bdebda 100644 --- a/app/views/networks/index.html.slim +++ b/app/views/networks/index.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'reseau', t('networks.index.title'), 'Lorem ipsum dolor sit amet', '', @@ -31,7 +31,10 @@ ), TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |network| \ + line_referential_network_path(@line_referential, network) \ + end \ ), \ ], links: [:show], @@ -40,6 +43,6 @@ = new_pagination @networks, 'pull-right' - unless @networks.any? - .row + .row.mt-xs .col-lg-12 = replacement_msg t('networks.search_no_results') diff --git a/app/views/networks/show.html.slim b/app/views/networks/show.html.slim index 09edbad2e..d237351c4 100644 --- a/app/views/networks/show.html.slim +++ b/app/views/networks/show.html.slim @@ -1,7 +1,7 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'reseau', @network.name, - 'Lorem ipsum dolor sit amet', + '', t('last_update', time: l(@network.updated_at, format: :short)) do / Below is secundary actions & optional contents (filters, ...) diff --git a/app/views/referential_companies/index.html.slim b/app/views/referential_companies/index.html.slim index 23eea40ce..e5b7ce24a 100644 --- a/app/views/referential_companies/index.html.slim +++ b/app/views/referential_companies/index.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'transporteur', t('companies.index.title'), '', '', @@ -31,7 +31,10 @@ ), \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |company| \ + referential_company_path(@referential, company) \ + end \ ), \ TableBuilderHelper::Column.new( \ key: :phone, \ diff --git a/app/views/referential_companies/show.html.slim b/app/views/referential_companies/show.html.slim index 177ce2d69..1d71c778a 100644 --- a/app/views/referential_companies/show.html.slim +++ b/app/views/referential_companies/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'transporteur', @company.name, 'Lorem ipsum dolor sit amet', t('last_update', time: l(@company.updated_at, format: :short)) do diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim index 34c296932..6e59d83b3 100644 --- a/app/views/referential_lines/show.html.slim +++ b/app/views/referential_lines/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'ligne', @line.name, '', t('last_update', time: l(@line.updated_at, format: :short)) do @@ -46,12 +46,15 @@ [ \ TableBuilderHelper::Column.new( \ name: 'ID', \ - attribute: Proc.new { |n| n.objectid.local_id }, \ + attribute: Proc.new { |n| n.objectid.short_id }, \ sortable: false \ ), \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |route| \ + referential_line_route_path(@referential, @line, route) \ + end \ ), \ TableBuilderHelper::Column.new( \ key: :published_name, \ diff --git a/app/views/referential_networks/index.html.slim b/app/views/referential_networks/index.html.slim index c58a91321..ca67eca8b 100644 --- a/app/views/referential_networks/index.html.slim +++ b/app/views/referential_networks/index.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'reseau', t('networks.index.title'), 'Lorem ipsum dolor sit amet', '', @@ -31,7 +31,10 @@ ), TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |network| \ + referential_network_path(@referential, network) \ + end \ ) \ ], links: [:show], diff --git a/app/views/referential_networks/show.html.slim b/app/views/referential_networks/show.html.slim index b9d9d5d8b..d7095561e 100644 --- a/app/views/referential_networks/show.html.slim +++ b/app/views/referential_networks/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'reseau', @network.name, 'Lorem ipsum dolor sit amet', t('last_update', time: l(@network.updated_at, format: :short)) do diff --git a/app/views/referential_stop_areas/show.html.slim b/app/views/referential_stop_areas/show.html.slim index d594665f7..fa383c82d 100644 --- a/app/views/referential_stop_areas/show.html.slim +++ b/app/views/referential_stop_areas/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'arret', @stop_area.name, 'Lorem ipsum dolor sit amet' diff --git a/app/views/referentials/_form.html.slim b/app/views/referentials/_form.html.slim index a9e308699..6f7da84c7 100644 --- a/app/views/referentials/_form.html.slim +++ b/app/views/referentials/_form.html.slim @@ -46,7 +46,7 @@ .separator - = subform.input :lines, as: :select, collection: @referential.workbench.lines.includes(:company).order(:name), selected: subform.object.line_ids, label_method: :display_name, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': t('simple_form.labels.referential.placeholders.select_lines'), 'multiple': 'multiple', style: 'width: 100%' } + = subform.input :lines, as: :select, collection: Chouette::Line.includes(:company).order(:name).where(objectid: current_functional_scope), selected: subform.object.line_ids, label_method: :display_name, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': t('simple_form.labels.referential.placeholders.select_lines'), 'multiple': 'multiple', style: 'width: 100%' } .hidden = form.input :workbench_id, as: :hidden diff --git a/app/views/referentials/edit.html.slim b/app/views/referentials/edit.html.slim index d54b63135..1fac626e6 100644 --- a/app/views/referentials/edit.html.slim +++ b/app/views/referentials/edit.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'jeux-de-donnees', t('.title'), '', t('last_update', time: l(@referential.updated_at, format: :short)) diff --git a/app/views/referentials/new.html.slim b/app/views/referentials/new.html.slim index 55f38eb33..f4a7e4707 100644 --- a/app/views/referentials/new.html.slim +++ b/app/views/referentials/new.html.slim @@ -1,9 +1,9 @@ / PageHeader - if @referential.created_from.present? - = pageheader 'map-marker', + = pageheader 'jeux-de-donnees', t('.duplicated.title') - else - = pageheader 'map-marker', + = pageheader 'jeux-de-donnees', t('.title') / PageContent diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim index 49c152789..e1d89cba4 100644 --- a/app/views/referentials/show.html.slim +++ b/app/views/referentials/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'jeux-de-donnees', @referential.name, 'Lorem ipsum dolor sit amet', t('last_update', time: l(@referential.updated_at, format: :short)), @@ -51,7 +51,10 @@ ), \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |line| \ + referential_line_path(@referential, line) \ + end \ ), \ TableBuilderHelper::Column.new( \ key: :deactivated, \ diff --git a/app/views/routes/_form.html.slim b/app/views/routes/_form.html.slim index bee86f91e..244b427dc 100644 --- a/app/views/routes/_form.html.slim +++ b/app/views/routes/_form.html.slim @@ -7,11 +7,11 @@ .form-group.has_switch = f.label :wayback, class: 'col-sm-4 col-xs-5 control-label' - = f.input :wayback, as: :boolean, checked_value: :straight_forward, unchecked_value: :backward, label: content_tag(:span, @route.wayback_text, class: 'switch-label', data: {checkedValue: t('enumerize.route.direction.straight_forward'), uncheckedValue: t('enumerize.route.direction.backward')}), wrapper_html: { class: 'col-sm-8 col-xs-7'} + = f.input :wayback, as: :boolean, checked_value: :outbound, unchecked_value: :inbound, label: content_tag(:span, @route.wayback_text, class: 'switch-label', data: {checkedValue: t('enumerize.route.wayback.outbound'), uncheckedValue: t('enumerize.route.wayback.inbound')}), wrapper_html: { class: 'col-sm-8 col-xs-7'} - = f.input :opposite_route_id, collection: @forward, disabled: @route.wayback.straight_forward?, wrapper_html: {class: input_opposite_route_id_css(@route, 'straight_forward')} + = f.input :opposite_route_id, collection: @forward, disabled: @route.wayback.outbound?, wrapper_html: {class: input_opposite_route_id_css(@route, 'outbound')} - = f.input :opposite_route_id, collection: @backward, disabled: @route.wayback.backward?, wrapper_html: {class: input_opposite_route_id_css(@route, 'backward')} + = f.input :opposite_route_id, collection: @backward, disabled: @route.wayback.inbound?, wrapper_html: {class: input_opposite_route_id_css(@route, 'inbound')} diff --git a/app/views/routes/edit.html.slim b/app/views/routes/edit.html.slim index c854bc867..850588aef 100644 --- a/app/views/routes/edit.html.slim +++ b/app/views/routes/edit.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'itineraire', @route.name, 'Lorem ipsum dolor sit amet', t('last_update', time: l(@route.updated_at, format: :short)) diff --git a/app/views/routes/new.html.slim b/app/views/routes/new.html.slim index 102467677..a68f8ae4e 100644 --- a/app/views/routes/new.html.slim +++ b/app/views/routes/new.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'itineraire', t('routes.new.title'), '' diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim index ec9719355..e2681d215 100644 --- a/app/views/routes/show.html.slim +++ b/app/views/routes/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'itineraire', @route.name, '', t('last_update', time: l(@route.updated_at, format: :short)), @@ -21,7 +21,7 @@ .row .col-lg-6.col-md-6.col-sm-12.col-xs-12 = definition_list t('metadatas'), - { t('id_codif') => @route.try(:objectid).try(:local_id), + { t('objectid') => @route.objectid.short_id, t('activerecord.attributes.route.published_name') => (@route.published_name ? @route.published_name : '-'), @route.human_attribute_name(:wayback) => (@route.wayback ? @route.wayback_text : '-' ), @route.human_attribute_name(:opposite_route) => (@route.opposite_route ? @route.opposite_route.name : '-') } @@ -29,7 +29,7 @@ - if @route_sp.any? .col-lg-6.col-md-6.col-sm-12.col-xs-12 #route_map.map.mb-lg - + .row .col-lg-12 - if @route_sp.any? @@ -41,7 +41,10 @@ ), \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: Proc.new {|s| s.try(:stop_area).try(:name)} \ + attribute: Proc.new {|s| s.try(:stop_area).try(:name)}, \ + link_to: lambda do |stop_point| \ + referential_stop_area_path(@referential, stop_point.stop_area) \ + end \ ), \ TableBuilderHelper::Column.new( \ key: :deleted_at, \ diff --git a/app/views/routing_constraint_zones/edit.html.slim b/app/views/routing_constraint_zones/edit.html.slim index d0e0ded32..2c23344df 100644 --- a/app/views/routing_constraint_zones/edit.html.slim +++ b/app/views/routing_constraint_zones/edit.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'itl', t('.title', routing_constraint_zone: @routing_constraint_zone.name), '', t('last_update', time: l(@routing_constraint_zone.updated_at, format: :short)) diff --git a/app/views/routing_constraint_zones/index.html.slim b/app/views/routing_constraint_zones/index.html.slim index 6b3e73096..4e2534b6a 100644 --- a/app/views/routing_constraint_zones/index.html.slim +++ b/app/views/routing_constraint_zones/index.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'itl', t('routing_constraint_zones.index.title'), '', '', @@ -25,7 +25,14 @@ ), \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |routing_constraint_zone| \ + referential_line_routing_constraint_zone_path( \ + @referential, \ + @line, \ + routing_constraint_zone \ + ) \ + end \ ), \ TableBuilderHelper::Column.new( \ key: :stop_points_count, \ diff --git a/app/views/routing_constraint_zones/new.html.slim b/app/views/routing_constraint_zones/new.html.slim index 600663b18..1ed65335f 100644 --- a/app/views/routing_constraint_zones/new.html.slim +++ b/app/views/routing_constraint_zones/new.html.slim @@ -1,6 +1,6 @@ / PageHeader -= pageheader 'map-marker', - t('.title') += pageheader 'itl', + t('.title') / PageContent .page_content diff --git a/app/views/routing_constraint_zones/show.html.slim b/app/views/routing_constraint_zones/show.html.slim index 07b5ac6e6..dbd8464a0 100644 --- a/app/views/routing_constraint_zones/show.html.slim +++ b/app/views/routing_constraint_zones/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'itl', @routing_constraint_zone.name, '', t('last_update', time: l(@routing_constraint_zone.updated_at, format: :short)) do @@ -30,7 +30,10 @@ [ \ TableBuilderHelper::Column.new( \ name: "Arrêts de l'itinéraire", \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |stop_point| \ + referential_stop_area_path(@referential, stop_point.stop_area) \ + end \ ), TableBuilderHelper::Column.new( \ name: "Arrêts inclus dans l'ITL", \ diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim index 0fca15fff..dc90def50 100644 --- a/app/views/stop_area_referentials/show.html.slim +++ b/app/views/stop_area_referentials/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'synchro-icar', t('.title'), 'Lorem ipsum dolor sit amet', t('last_update', time: l(@stop_area_referential.updated_at, format: :short)), diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim index adb023633..4c95761d2 100644 --- a/app/views/stop_areas/index.html.slim +++ b/app/views/stop_areas/index.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'arret', t('stop_areas.index.title'), '', '', @@ -25,7 +25,13 @@ ), \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |stop_area| \ + referential_stop_area_path( \ + @stop_area_referential, \ + stop_area \ + ) \ + end \ ), \ TableBuilderHelper::Column.new( \ key: :registration_number, \ diff --git a/app/views/stop_areas/show.html.slim b/app/views/stop_areas/show.html.slim index 05f66a33a..dce5bdbad 100644 --- a/app/views/stop_areas/show.html.slim +++ b/app/views/stop_areas/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'arret', @stop_area.name, 'Lorem ipsum dolor sit amet' diff --git a/app/views/time_table_combinations/_form.html.slim b/app/views/time_table_combinations/_form.html.slim index b4f818828..426624ee3 100644 --- a/app/views/time_table_combinations/_form.html.slim +++ b/app/views/time_table_combinations/_form.html.slim @@ -7,7 +7,7 @@ abbr title='Champ requis' * = f.input :combined_type, as: :boolean, checked_value: 'time_table', unchecked_value: 'calendar', required: false, label: content_tag(:span, t("time_table_combinations.combined_type.#{@combination.combined_type}"), class: 'switch-label', data: { checkedValue: 'Calendriers', uncheckedValue: 'Modèles de calendriers' }), wrapper_html: { class: 'col-sm-8 col-xs-7' } - = f.input :time_table_id, as: :select, input_html: {class: 'tt_combination_target', style: "width: 100%", data: { 'select2-ajax': 'true', 'select2ed-placeholder': 'Indiquez un calendrier...', term: 'comment_or_objectid_cont', url: referential_autocomplete_time_tables_path(@referential, format: :json)}}, wrapper_html: {class: @combination.combined_type != 'time_table' ? 'hidden' : ''} + = f.input :time_table_id, as: :select, input_html: {class: 'tt_combination_target', style: "width: 100%", data: { 'select2-ajax': 'true', 'select2ed-placeholder': 'Indiquez un calendrier...', term: 'comment_or_objectid_cont_any', url: referential_autocomplete_time_tables_path(@referential, format: :json, :source_id => @combination.source_id)}}, wrapper_html: {class: @combination.combined_type != 'time_table' ? 'hidden' : ''} = f.input :calendar_id, as: :select, input_html: { class: 'tt_combination_target', style: "width: 100%", data: { 'select2-ajax': 'true', 'select2ed-placeholder': 'Indiquez un modèle de calendrier...', term: 'name_cont', url: autocomplete_calendars_path}}, wrapper_html: {class: @combination.combined_type != 'calendar' ? 'hidden' : ''} diff --git a/app/views/time_tables/edit.html.slim b/app/views/time_tables/edit.html.slim index a2dfb90f9..ed55dc4e3 100644 --- a/app/views/time_tables/edit.html.slim +++ b/app/views/time_tables/edit.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'calendrier-application', @time_table.comment, '', '' diff --git a/app/views/time_tables/index.html.slim b/app/views/time_tables/index.html.slim index 5ee854c58..b984f95c8 100644 --- a/app/views/time_tables/index.html.slim +++ b/app/views/time_tables/index.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'calendrier-application', t('time_tables.index.title'), '', ((policy(Chouette::TimeTable).create? && @referential.organisation == current_organisation) ? link_to(t('actions.add'), new_referential_time_table_path(@referential), class: 'btn btn-default') : '') @@ -18,7 +18,7 @@ [ \ TableBuilderHelper::Column.new( \ name: 'ID', \ - attribute: Proc.new { |n| n.objectid.local_id }, \ + attribute: Proc.new { |n| n.objectid.short_id}, \ sortable: false \ ), \ TableBuilderHelper::Column.new( \ @@ -27,7 +27,10 @@ ), \ TableBuilderHelper::Column.new( \ key: :comment, \ - attribute: 'comment' \ + attribute: 'comment', \ + link_to: lambda do |time_table| \ + referential_time_table_path(@referential, time_table) \ + end \ ), \ TableBuilderHelper::Column.new( \ name: "Période englobante", \ @@ -65,3 +68,5 @@ = javascript_tag do | window.I18n = #{(I18n.backend.send(:translations).to_json).html_safe}; + += javascript_include_tag 'filters/time_table.js' diff --git a/app/views/time_tables/new.html.slim b/app/views/time_tables/new.html.slim index 8d72f49b6..8a6930b9c 100644 --- a/app/views/time_tables/new.html.slim +++ b/app/views/time_tables/new.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'calendrier-application', t("time_tables.#{params[:action]}.title"), '', '' diff --git a/app/views/time_tables/show.html.slim b/app/views/time_tables/show.html.slim index 36b79cc25..021b55058 100644 --- a/app/views/time_tables/show.html.slim +++ b/app/views/time_tables/show.html.slim @@ -2,7 +2,7 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'calendrier-application', @time_table.comment, '', t('last_update', time: l(@time_table.updated_at, format: :short)), diff --git a/app/views/vehicle_journeys/index.html.slim b/app/views/vehicle_journeys/index.html.slim index 93f4e3221..4efc34eaa 100644 --- a/app/views/vehicle_journeys/index.html.slim +++ b/app/views/vehicle_journeys/index.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'horaires-des-courses', t('vehicle_journeys.index.title', route: @route.name ), 'Lorem ipsum dolor sit amet', '' do diff --git a/app/views/workbenches/index.html.slim b/app/views/workbenches/index.html.slim index ca61d439d..d35ed8121 100644 --- a/app/views/workbenches/index.html.slim +++ b/app/views/workbenches/index.html.slim @@ -1,7 +1,14 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'tableau-de-bord', t('.title', organisation: current_organisation.name) + / Below is secundary actions & optional contents (filters, ...) + .row.mb-sm + .col-lg-12.text-right + - if policy(Api::V1::ApiKey).create? + = link_to t('actions.create_api_key'), new_api_key_path, class: 'btn btn-primary' + + / PageContent .page_content .container-fluid @@ -27,6 +34,19 @@ .panel-body em.small.text-muted = t('.offers.no_content') + .panel.panel-default + .panel-heading + h3.panel-title + = t('.offers.api_keys') + span.badge.ml-xs = current_organisation.api_keys.count if current_organisation.api_keys.any? + - if current_organisation.api_keys.any? + - current_organisation.api_keys.each do |api_key| + .list-group + = policy(api_key).edit? ? link_to( "#{api_key.name} : #{api_key.token}", edit_api_key_path(api_key), class: 'list-group-item') : "#{api_key.name} : #{api_key.token}" + - else + .panel-body + em.small.text-muted = t('.offers.no_content') + .col-lg-6.col-md-6.col-sm-6.col-xs-12 .panel.panel-default .panel-heading @@ -34,15 +54,15 @@ div = t('.offers.referentials') span.badge.ml-xs = @referentials.count if @referentials.any? - + div = link_to '', workbench_path(@workbench), class: ' fa fa-chevron-right pull-right', title: t('.offers.see') - if @referentials.any? .list-group - @referentials.each_with_index do |referential, i| - = link_to referential.name, referential_path(referential), class: 'list-group-item' if i < 6 - + = link_to referential.name, referential_path(referential, workbench_id: referential.workbench_id, current_workbench_id: @workbench.id), class: 'list-group-item' if i < 6 + - else .panel-body em.small.text-muted = t('.offers.no_content') @@ -61,7 +81,7 @@ .list-group - @calendars.each_with_index do |calendar, i| = link_to calendar.name, calendar_path(calendar), class: 'list-group-item' if i < 6 - + - else .panel-body em.small.text-muted = t('.offers.no_content') diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim index 2f845ed96..fd72979ea 100644 --- a/app/views/workbenches/show.html.slim +++ b/app/views/workbenches/show.html.slim @@ -1,5 +1,5 @@ / PageHeader -= pageheader 'map-marker', += pageheader 'jeux-de-donnees', t('referentials.index.title'), '', '' do @@ -27,7 +27,10 @@ [ \ TableBuilderHelper::Column.new( \ key: :name, \ - attribute: 'name' \ + attribute: 'name', \ + link_to: lambda do |referential| \ + referential_path(referential, current_workbench_id: params[:id]) \ + end \ ), \ TableBuilderHelper::Column.new( \ key: :status, \ @@ -74,3 +77,5 @@ = javascript_tag do | window.I18n = #{(I18n.backend.send(:translations).to_json).html_safe}; + += javascript_include_tag 'filters/workbench.js' diff --git a/app/workers/workbench_import_worker.rb b/app/workers/workbench_import_worker.rb index 7f77b46dc..994493944 100644 --- a/app/workers/workbench_import_worker.rb +++ b/app/workers/workbench_import_worker.rb @@ -3,18 +3,17 @@ class WorkbenchImportWorker include Rails.application.routes.url_helpers include Configurable - RETRY_DELAYS = [3, 5, 8] - # Workers # ======= def perform(import_id) @workbench_import = WorkbenchImport.find(import_id) @response = nil - @workbench_import.update_attributes(status: 'running') + @workbench_import.update(status: 'running', started_at: Time.now) downloaded = download zip_service = ZipService.new(downloaded) upload zip_service + @workbench_import.update(ended_at: Time.now) end def download @@ -25,59 +24,50 @@ class WorkbenchImportWorker params: {token: @workbench_import.token_download}).body end - def execute_post eg_name, eg_stream + def execute_post eg_name, eg_file logger.info "HTTP POST #{export_url} (for #{complete_entry_group_name(eg_name)})" HTTPService.post_resource( host: export_host, path: export_path, - token: token(eg_name), - params: params, - upload: {file: [eg_stream, 'application/zip', eg_name]}) - end - - def log_failure reason, count - logger.warn "HTTP POST failed with #{reason}, count = #{count}, response=#{@response}" - end - - def try_again - raise RetryService::Retry - end - - def try_upload_entry_group eg_name, eg_stream - result = execute_post eg_name, eg_stream - return result if result && result.status < 400 - @response = result.body - try_again + params: params(eg_file, eg_name)) end def upload zip_service - entry_group_streams = zip_service.entry_group_streams - @workbench_import.update_attributes total_steps: entry_group_streams.size + entry_group_streams = zip_service.subdirs + @workbench_import.update total_steps: entry_group_streams.size entry_group_streams.each_with_index(&method(:upload_entry_group)) - rescue StopIteration - @workbench_import.update_attributes( current_step: entry_group_streams.size, status: 'failed' ) + rescue Exception => e + logger.error e.message + @workbench_import.update( current_step: entry_group_streams.size, status: 'failed' ) + raise end def upload_entry_group entry_pair, element_count - @workbench_import.update_attributes( current_step: element_count.succ ) - retry_service = RetryService.new( - delays: RETRY_DELAYS, - rescue_from: [HTTPService::Timeout], - &method(:log_failure)) - status = retry_service.execute(&upload_entry_group_proc(entry_pair)) - raise StopIteration unless status.ok? - end + @workbench_import.update( current_step: element_count.succ ) + # status = retry_service.execute(&upload_entry_group_proc(entry_pair)) + eg_name = entry_pair.name + eg_stream = entry_pair.stream + + FileUtils.mkdir_p(Rails.root.join('tmp', 'imports')) - def upload_entry_group_proc entry_pair - eg_name, eg_stream = entry_pair - # This should be fn.try_upload_entry_group(eg_name, eg_stream) ;( - -> do - try_upload_entry_group(eg_name, eg_stream) + eg_file = File.new(Rails.root.join('tmp', 'imports', "WorkbenchImport_#{eg_name}_#{$$}.zip"), 'wb').tap do |file| + eg_stream.rewind + file.write eg_stream.read + end + eg_file.close + eg_file = File.new(Rails.root.join('tmp', 'imports', "WorkbenchImport_#{eg_name}_#{$$}.zip")) + result = execute_post eg_name, eg_file + if result && result.status < 400 + result + else + raise StopIteration, result.body end + ensure + eg_file.close rescue nil + eg_file.unlink rescue nil end - # Queries # ======= @@ -85,10 +75,6 @@ class WorkbenchImportWorker [@workbench_import.name, entry_group_name].join("--") end - def token entry_group_name - Api::V1::ApiKey.from(@workbench_import.referential, name: complete_entry_group_name(entry_group_name)).token - end - # Constants # ========= @@ -112,7 +98,12 @@ class WorkbenchImportWorker @__import_url__ ||= File.join(import_host, import_path) end - def params - @__params__ ||= { netex_import: { referential_id: @workbench_import.referential_id, workbench_id: @workbench_import.workbench_id } } + def params file, name + { netex_import: + { parent_id: @workbench_import.id, + parent_type: @workbench_import.class.name, + workbench_id: @workbench_import.workbench_id, + name: name, + file: HTTPService.upload(file, 'application/zip', "#{name}.zip") } } end end |
