diff options
| author | Edouard Maffert | 2016-09-09 10:13:18 +0200 |
|---|---|---|
| committer | Edouard Maffert | 2016-09-09 10:13:18 +0200 |
| commit | febca10492e68c10a18f48860577bf21748bc7cd (patch) | |
| tree | e46ea4f92ae2d8b5408a4f6acbca8660dce29f5d | |
| parent | a1f01c4eb5b3f8cc587775fedc825bbfb2f100d9 (diff) | |
| parent | 4425686bdf93f9d90187244b2f336043934cc75e (diff) | |
| download | chouette-core-febca10492e68c10a18f48860577bf21748bc7cd.tar.bz2 | |
Merge branch 'master' into staging
845 files changed, 11952 insertions, 11578 deletions
@@ -37,14 +37,7 @@ gem 'spring', group: :development # API Rest gem 'sawyer', '~> 0.6.0' gem 'faraday_middleware', '~> 0.9.1' - -platforms :jruby do - gem 'activerecord-jdbcpostgresql-adapter', '~> 1.3.3' - gem 'jruby-openssl' - gem 'jruby-rack-worker' - gem 'warbler' - gem 'therubyrhino' -end +gem 'faraday', '~> 0.9.1' platforms :ruby do gem 'therubyracer', '~> 0.12' @@ -55,6 +48,11 @@ end gem 'activerecord-postgis-adapter' gem 'polylines' +# Codifligne API +gem 'codifligne', git: 'git@github.com:AF83/stif-codifline-api.git' +# Reflex API +gem 'reflex', git: 'git@github.com:AF83/stif-reflex-api.git' + # Authentication gem 'devise', '~> 3.4.0' gem 'devise_cas_authenticatable' @@ -73,6 +71,7 @@ gem 'mimemagic' gem 'language_engine', '0.0.6' gem 'calendar_helper', '0.2.5' gem 'cocoon' +gem 'slim-rails', '~> 3.1' gem 'formtastic', '2.3.1' gem 'RedCloth' gem 'simple_form', '~> 3.1.0' @@ -105,6 +104,8 @@ gem 'acts_as_tree', '~> 2.1.0', require: 'acts_as_tree' gem 'rabl' gem 'delayed_job_active_record' +gem 'whenever', github: 'af83/whenever', require: false # '~> 0.9' +gem 'rake' gem 'devise-async' gem 'apartment', '~> 1.0.0' @@ -120,26 +121,38 @@ group :development do # MetaRequest is incompatible with rgeo-activerecord # gem 'meta_request' gem 'quiet_assets', '~> 1.0' - gem 'simplecov', '~> 0.10.0' + platforms :ruby_20, :ruby_21, :ruby_22 do gem 'better_errors' gem 'binding_of_caller' end end +group :test do + gem 'cucumber-rails', require: false + gem 'simplecov', :require => false + gem 'simplecov-rcov', :require => false +end + +group :test, :development, :dev do + gem 'fabrication', '~> 2.14.1' + gem 'ffaker', '~> 2.1.0' +end + group :test, :development do gem 'awesome_print' gem 'pry-rails' gem 'rspec-rails', '~> 3.1.0' gem 'fakeweb' + gem 'webmock' gem 'capybara', '~> 2.4.0' + gem 'database_cleaner' gem 'poltergeist' gem 'launchy' gem 'factory_girl_rails', '~> 4.0' gem 'rb-inotify', require: RUBY_PLATFORM.include?('linux') && 'rb-inotify' gem 'rb-fsevent', require: RUBY_PLATFORM.include?('darwin') && 'rb-fsevent' gem 'transpec' - gem 'database_cleaner' gem 'shoulda-matchers' end @@ -151,6 +164,7 @@ end # I18n gem 'rails-i18n', '~> 4.0.0' gem 'devise-i18n' +gem 'i18n-tasks' # Rails Assets source 'http://rails-assets.org' do diff --git a/Gemfile.lock b/Gemfile.lock index ac7bb968f..a0d8ca243 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,24 @@ +GIT + remote: git://github.com/af83/whenever.git + revision: b7963381a11243affe4f35881c85be0710f434e3 + specs: + whenever (0.9.4) + chronic (>= 0.6.3) + +GIT + remote: git@github.com:AF83/stif-codifline-api.git + revision: e38210d88c447ca793b9fc3af6ec4c2a682f054c + specs: + codifligne (0.0.2) + nokogiri (~> 1.6) + +GIT + remote: git@github.com:AF83/stif-reflex-api.git + revision: f91087c65d2e2b0a80e30acb6f7a0e863a10f8b4 + specs: + reflex (0.0.1) + nokogiri (~> 1.6) + GEM remote: http://rubygems.org/ remote: http://rails-assets.org/ @@ -25,11 +46,6 @@ GEM activemodel (= 4.1.10) activesupport (= 4.1.10) arel (~> 5.0.0) - activerecord-jdbc-adapter (1.3.15) - activerecord (>= 2.2) - activerecord-jdbcpostgresql-adapter (1.3.15) - activerecord-jdbc-adapter (~> 1.3.15) - jdbc-postgres (>= 9.1) activerecord-postgis-adapter (2.2.2) activerecord (>= 4.0.0, < 4.2.0) rgeo-activerecord (~> 1.2) @@ -83,6 +99,7 @@ GEM celluloid (0.16.0) timers (~> 4.0.0) choice (0.1.7) + chronic (0.10.2) cliver (0.3.2) cocoon (1.2.6) coderay (1.1.0) @@ -93,6 +110,25 @@ GEM coffee-script-source execjs coffee-script-source (1.9.1) + crack (0.4.3) + safe_yaml (~> 1.0.0) + cucumber (2.4.0) + builder (>= 2.1.2) + cucumber-core (~> 1.5.0) + cucumber-wire (~> 0.0.1) + diff-lcs (>= 1.1.3) + gherkin (~> 4.0) + multi_json (>= 1.7.5, < 2.0) + multi_test (>= 0.1.2) + cucumber-core (1.5.0) + gherkin (~> 4.0) + cucumber-rails (1.4.4) + capybara (>= 1.1.2, < 3) + cucumber (>= 1.3.8, < 3) + mime-types (>= 1.16, < 4) + nokogiri (~> 1.5) + railties (>= 3, < 5.1) + cucumber-wire (0.0.1) daemons (1.1.9) database_cleaner (1.4.1) dbf (3.0.3) @@ -126,10 +162,15 @@ GEM docile (1.1.5) dr-ffi-proj4 (0.0.3) ffi (>= 1.0.0) + easy_translate (0.5.0) + json + thread + thread_safe enumerize (0.10.1) activesupport (>= 3.2) erubis (2.7.0) execjs (2.6.0) + fabrication (2.14.1) factory_girl (4.5.0) activesupport (>= 3.0.0) factory_girl_rails (4.5.0) @@ -140,6 +181,7 @@ GEM multipart-post (>= 1.2, < 3) faraday_middleware (0.9.1) faraday (>= 0.7.4, < 0.10) + ffaker (2.1.0) ffi (1.9.10) ffi (1.9.10-java) ffi-geos (1.1.0) @@ -162,6 +204,7 @@ GEM geokit (= 1.6.7) georuby (>= 1.9.8) rgeo (>= 0.3.20) + gherkin (4.0.0) google-analytics-rails (0.0.6) guard (2.12.4) formatador (>= 0.2.4) @@ -180,11 +223,20 @@ GEM has_scope (0.6.0) actionpack (>= 3.2, < 5) activesupport (>= 3.2, < 5) + hashdiff (0.3.0) highline (1.7.1) hike (1.2.3) hitimes (1.2.2) hitimes (1.2.2-java) i18n (0.7.0) + i18n-tasks (0.8.6) + activesupport + easy_translate (>= 0.5.0) + erubis + highline + i18n + term-ansicolor + terminal-table (>= 1.5.1) inherited_resources (1.6.0) actionpack (>= 3.2, < 5) has_scope (~> 0.6.0.rc) @@ -193,15 +245,9 @@ GEM jbuilder (2.2.11) activesupport (>= 3.0.0, < 5) multi_json (~> 1.2) - jdbc-postgres (9.4.1200) jquery-rails (3.1.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - jruby-jars (1.7.19) - jruby-openssl (0.9.7-java) - jruby-rack (1.1.18) - jruby-rack-worker (0.10.0) - jruby-rack (>= 1.1.10) json (1.8.3) json (1.8.3-java) language_engine (0.0.6) @@ -225,9 +271,10 @@ GEM method_source (0.8.2) mime-types (2.4.3) mimemagic (0.3.0) - mini_portile (0.6.2) + mini_portile2 (2.1.0) minitest (5.8.3) multi_json (1.11.2) + multi_test (0.1.2) multipart-post (2.0.0) nenv (0.2.0) net-scp (1.2.1) @@ -238,9 +285,10 @@ GEM net-ssh-gateway (1.2.0) net-ssh (>= 2.6.5) newrelic_rpm (3.11.2.286) - nokogiri (1.6.6.2) - mini_portile (~> 0.6.0) - nokogiri (1.6.6.2-java) + nokogiri (1.6.8) + mini_portile2 (~> 2.1.0) + pkg-config (~> 1.1.7) + nokogiri (1.6.8-java) notiffany (0.0.6) nenv (~> 0.1) shellany (~> 0.0) @@ -249,6 +297,7 @@ GEM parser (2.2.0.3) ast (>= 1.1, < 3.0) pg (0.18.1) + pkg-config (1.1.7) poltergeist (1.6.0) capybara (~> 2.1) cliver (~> 0.3.1) @@ -378,6 +427,7 @@ GEM rubycas-client (2.3.9) activesupport rubyzip (1.1.7) + safe_yaml (1.0.4) sass (3.2.19) sass-rails (4.0.5) railties (>= 4.0.0, < 5.0) @@ -401,12 +451,21 @@ GEM json (~> 1.8) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) + simplecov-rcov (0.2.3) + simplecov (>= 0.4.1) + slim (3.0.7) + temple (~> 0.7.6) + tilt (>= 1.3.3, < 2.1) + slim-rails (3.1.0) + actionpack (>= 3.1) + railties (>= 3.1) + slim (~> 3.0) slop (3.6.0) spoon (0.0.4) ffi spreadsheet (1.0.2) ruby-ole (>= 1.0) - spring (1.3.3) + spring (1.7.2) sprockets (2.12.3) hike (~> 1.2) multi_json (~> 1.0) @@ -421,18 +480,21 @@ GEM activerecord (>= 3.0) activesupport (>= 3.0) polyamorous (~> 1.1.0) + temple (0.7.7) + term-ansicolor (1.3.2) + tins (~> 1.0) + terminal-table (1.6.0) therubyracer (0.12.2) libv8 (~> 3.16.14.0) ref - therubyrhino (2.0.4) - therubyrhino_jar (>= 1.7.3) - therubyrhino_jar (1.7.4) thor (0.19.1) + thread (0.2.2) thread_safe (0.3.5) thread_safe (0.3.5-java) tilt (1.4.1) timers (4.0.1) hitimes + tins (1.10.2) transpec (3.1.0) activesupport (>= 3.0, < 5.0) astrolabe (~> 1.2) @@ -447,13 +509,12 @@ GEM uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) - warbler (1.4.5) - jruby-jars (>= 1.5.6, < 2.0) - jruby-rack (>= 1.1.1, < 1.3) - rake (>= 0.9.6) - rubyzip (>= 0.9, < 1.2) warden (1.2.3) rack (>= 1.0) + webmock (2.1.0) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff websocket-driver (0.5.3) websocket-extensions (>= 0.1.0) websocket-driver (0.5.3-java) @@ -472,7 +533,6 @@ PLATFORMS DEPENDENCIES RedCloth SyslogLogger - activerecord-jdbcpostgresql-adapter (~> 1.3.3) activerecord-postgis-adapter acts-as-taggable-on (>= 3) acts_as_list (~> 0.6.0) @@ -487,7 +547,9 @@ DEPENDENCIES capistrano-ext capybara (~> 2.4.0) cocoon + codifligne! coffee-rails (~> 4.0.0) + cucumber-rails daemons database_cleaner deep_cloneable (~> 2.0.0) @@ -499,9 +561,12 @@ DEPENDENCIES devise_cas_authenticatable devise_invitable enumerize (~> 0.10.0) + fabrication (~> 2.14.1) factory_girl_rails (~> 4.0) fakeweb + faraday (~> 0.9.1) faraday_middleware (~> 0.9.1) + ffaker (~> 2.1.0) font-awesome-sass (~> 4.2.0) foreigner (~> 1.7.4) formtastic (= 2.3.1) @@ -510,11 +575,10 @@ DEPENDENCIES google-analytics-rails guard guard-rspec + i18n-tasks inherited_resources jbuilder (~> 2.0) jquery-rails (~> 3.1.4) - jruby-openssl - jruby-rack-worker json language_engine (= 0.0.6) launchy @@ -543,9 +607,11 @@ DEPENDENCIES rails-assets-typeahead.js-bootstrap3.less! rails-erd rails-i18n (~> 4.0.0) + rake ransack rb-fsevent rb-inotify + reflex! rgeo (~> 0.5.2) roo rspec-rails (~> 3.1.0) @@ -555,18 +621,20 @@ DEPENDENCIES sdoc (~> 0.4.0) shoulda-matchers simple_form (~> 3.1.0) - simplecov (~> 0.10.0) + simplecov + simplecov-rcov + slim-rails (~> 3.1) spring sqlite3 squeel therubyracer (~> 0.12) - therubyrhino transpec turbolinks uglifier (~> 2.7.2) - warbler + webmock + whenever! will_paginate (~> 3.0.7) will_paginate-bootstrap (~> 1.0.1) BUNDLED WITH - 1.11.2 + 1.12.5 diff --git a/app/assets/stylesheets/application.sass.erb b/app/assets/stylesheets/application.sass.erb new file mode 100644 index 000000000..7d4b48de9 --- /dev/null +++ b/app/assets/stylesheets/application.sass.erb @@ -0,0 +1,51 @@ +// First import journal variables +$brand-primary: <%= ChouetteIhm::Application.config.company_theme %> +$navbar-default-bg: $brand-primary +$navbar-default-link-color: white +$body-bg: #eee + +// Then bootstrap itself +@import 'bootstrap-sass-official/_bootstrap-sprockets.scss' +@import 'bootstrap-sass-official' + +// Whatever application styles you have go last +// Modules and Variables +@import 'modules/search' +@import 'modules/index_item' +@import 'modules/icons' +@import 'modules/devise' +@import 'modules/progress_bars' + +// Partials +@import 'partials/base' +@import 'partials/header' +@import 'partials/footer' + +// Third-party +@import 'tagmanager/tagmanager' +@import 'font-awesome-sprockets' +@import 'font-awesome' +@import 'jquery-ui' +@import 'morrisjs' +@import 'formtastic' +@import 'eonasdan-bootstrap-datetimepicker' +@import 'footable' + +@import 'vendor/openlayers_style' +@import 'vendor/openlayers_ie6-style' +@import 'vendor/openlayers_google' +@import 'vendor/openlayers_framedCloud' +@import 'vendor/formtastic_changes' +@import 'vendor/pagination' +@import 'vendor/map_layers' +@import 'vendor/token-input' +@import 'vendor/typeahead' +@import 'vendor/bootstrap_changes' +@import 'vendor/simple_form' + +// Main css +@import 'main/*' + +// Hack to make li simple +li + list-style: none
\ No newline at end of file diff --git a/app/assets/stylesheets/application.scss.erb b/app/assets/stylesheets/application.scss.erb deleted file mode 100644 index dab6ff320..000000000 --- a/app/assets/stylesheets/application.scss.erb +++ /dev/null @@ -1,52 +0,0 @@ -// First import journal variables -$brand-primary: <%= ChouetteIhm::Application.config.company_theme %>; -$navbar-default-bg: $brand-primary; -$navbar-default-link-color: white; -$body-bg: #eee; - -// Then bootstrap itself -@import "bootstrap-sass-official/_bootstrap-sprockets.scss"; -@import "bootstrap-sass-official"; - -// Whatever application styles you have go last -// Modules and Variables -@import "modules/search"; -@import "modules/index_item"; -@import "modules/icons"; -@import "modules/devise"; -@import "modules/progress_bars"; - -// Partials -@import "partials/base"; -@import "partials/header"; -@import "partials/footer"; - -// Third-party -@import "tagmanager/tagmanager"; -@import "font-awesome-sprockets"; -@import "font-awesome"; -@import "jquery-ui"; -@import "morrisjs"; -@import "formtastic"; -@import 'eonasdan-bootstrap-datetimepicker'; -@import 'footable'; - -@import "vendor/openlayers_style"; -@import "vendor/openlayers_ie6-style"; -@import "vendor/openlayers_google"; -@import "vendor/openlayers_framedCloud"; -@import "vendor/formtastic_changes"; -@import "vendor/pagination"; -@import "vendor/map_layers"; -@import "vendor/token-input"; -@import "vendor/typeahead"; -@import "vendor/bootstrap_changes"; -@import "vendor/simple_form"; - -// Main css -@import "main/*"; - -// Hack to make li simple -li{ - list-style: none; -} diff --git a/app/assets/stylesheets/main/access_links.sass b/app/assets/stylesheets/main/access_links.sass new file mode 100644 index 000000000..65a81a2f8 --- /dev/null +++ b/app/assets/stylesheets/main/access_links.sass @@ -0,0 +1,18 @@ +// 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_links.scss b/app/assets/stylesheets/main/access_links.scss deleted file mode 100644 index 1511b06a0..000000000 --- a/app/assets/stylesheets/main/access_links.scss +++ /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.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%; - } -} - - - diff --git a/app/assets/stylesheets/main/access_points.sass b/app/assets/stylesheets/main/access_points.sass new file mode 100644 index 000000000..11e41967b --- /dev/null +++ b/app/assets/stylesheets/main/access_points.sass @@ -0,0 +1,78 @@ +// 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/access_points.scss b/app/assets/stylesheets/main/access_points.scss deleted file mode 100644 index af6a09ee7..000000000 --- a/app/assets/stylesheets/main/access_points.scss +++ /dev/null @@ -1,88 +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; - } - } -} - - diff --git a/app/assets/stylesheets/main/api_keys.scss b/app/assets/stylesheets/main/api_keys.sass index 61dff90b8..28bf171b9 100644 --- a/app/assets/stylesheets/main/api_keys.scss +++ b/app/assets/stylesheets/main/api_keys.sass @@ -3,9 +3,5 @@ // You can use Sass (SCSS) here: http://sass-lang.com/ #workspace.api_keys.show -{ - .summary p label { - font-weight: bold; - } -} - + .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 new file mode 100644 index 000000000..f24f2b212 --- /dev/null +++ b/app/assets/stylesheets/main/calendar.sass @@ -0,0 +1,98 @@ +// 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/calendar.scss b/app/assets/stylesheets/main/calendar.scss deleted file mode 100644 index b8c04b6f4..000000000 --- a/app/assets/stylesheets/main/calendar.scss +++ /dev/null @@ -1,113 +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; -} - - diff --git a/app/assets/stylesheets/main/companies.scss b/app/assets/stylesheets/main/companies.sass index 481b2ee7b..2cf1f596c 100644 --- a/app/assets/stylesheets/main/companies.scss +++ b/app/assets/stylesheets/main/companies.sass @@ -2,15 +2,8 @@ // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ -#workspace.companies.index -{ -} +// #workspace.companies.index #workspace.companies.show -{ - .summary p label { - font-weight: bold; - } -} - - + .summary p label + font-weight: bold
\ No newline at end of file diff --git a/app/assets/stylesheets/main/compliance_check_tasks.scss b/app/assets/stylesheets/main/compliance_check_tasks.sass index 64c6a2f94..78141bf22 100644 --- a/app/assets/stylesheets/main/compliance_check_tasks.scss +++ b/app/assets/stylesheets/main/compliance_check_tasks.sass @@ -1,4 +1 @@ -#workspace.compliance_check_tasks.new, #workspace.compliance_check_tasks.create -{ - -} +#workspace.compliance_check_tasks.new, #workspace.compliance_check_tasks.create
\ No newline at end of file diff --git a/app/assets/stylesheets/main/compliance_checks.sass b/app/assets/stylesheets/main/compliance_checks.sass new file mode 100644 index 000000000..451972fd5 --- /dev/null +++ b/app/assets/stylesheets/main/compliance_checks.sass @@ -0,0 +1,157 @@ +// #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/compliance_checks.scss b/app/assets/stylesheets/main/compliance_checks.scss deleted file mode 100644 index d31dfab62..000000000 --- a/app/assets/stylesheets/main/compliance_checks.scss +++ /dev/null @@ -1,173 +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; - } - dl.inline 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; - } - dl.inline 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:.5em; - -webkit-border-radius:.5em; - border-radius:.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; - } -} diff --git a/app/assets/stylesheets/main/connection_links.sass b/app/assets/stylesheets/main/connection_links.sass new file mode 100644 index 000000000..a23fbcdff --- /dev/null +++ b/app/assets/stylesheets/main/connection_links.sass @@ -0,0 +1,30 @@ +// 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/connection_links.scss b/app/assets/stylesheets/main/connection_links.scss deleted file mode 100644 index 5e5186ccf..000000000 --- a/app/assets/stylesheets/main/connection_links.scss +++ /dev/null @@ -1,41 +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%; } -} - diff --git a/app/assets/stylesheets/main/errors.sass b/app/assets/stylesheets/main/errors.sass new file mode 100644 index 000000000..ee603e459 --- /dev/null +++ b/app/assets/stylesheets/main/errors.sass @@ -0,0 +1,21 @@ +#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/errors.scss b/app/assets/stylesheets/main/errors.scss deleted file mode 100644 index b314da37a..000000000 --- a/app/assets/stylesheets/main/errors.scss +++ /dev/null @@ -1,15 +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} - -} diff --git a/app/assets/stylesheets/main/export_tasks.sass b/app/assets/stylesheets/main/export_tasks.sass new file mode 100644 index 000000000..799b5a13f --- /dev/null +++ b/app/assets/stylesheets/main/export_tasks.sass @@ -0,0 +1,10 @@ +#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/export_tasks.scss b/app/assets/stylesheets/main/export_tasks.scss deleted file mode 100644 index 5c04b8ea0..000000000 --- a/app/assets/stylesheets/main/export_tasks.scss +++ /dev/null @@ -1,13 +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; - } -} diff --git a/app/assets/stylesheets/main/exports.sass b/app/assets/stylesheets/main/exports.sass new file mode 100644 index 000000000..875dc13f5 --- /dev/null +++ b/app/assets/stylesheets/main/exports.sass @@ -0,0 +1,19 @@ +// 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/exports.scss b/app/assets/stylesheets/main/exports.scss deleted file mode 100644 index d2ee1cb86..000000000 --- a/app/assets/stylesheets/main/exports.scss +++ /dev/null @@ -1,26 +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; - } -} diff --git a/app/assets/stylesheets/main/group_of_lines.scss b/app/assets/stylesheets/main/group_of_lines.sass index 7e8b7590d..d63eeb607 100644 --- a/app/assets/stylesheets/main/group_of_lines.scss +++ b/app/assets/stylesheets/main/group_of_lines.sass @@ -2,22 +2,14 @@ // 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.index #workspace.group_of_lines.show -{ - .summary p label { - font-weight: bold; - } - .lines_detail div.page_info { - margin-top: 0px; - } + .summary p label + font-weight: bold - .lines { - margin-top: 10px; - } - -} + .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 new file mode 100644 index 000000000..87f21c3c3 --- /dev/null +++ b/app/assets/stylesheets/main/help.sass @@ -0,0 +1,121 @@ +#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/help.scss b/app/assets/stylesheets/main/help.scss deleted file mode 100644 index ebffedc92..000000000 --- a/app/assets/stylesheets/main/help.scss +++ /dev/null @@ -1,173 +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; -} - -ol li:before { - content: counter(num) '. '; - counter-increment: num; -} - -ol ol li:before { - content: counters(num, '.') ' '; -} - -em { - font-style: italic; -} - -strong { - font-weight: bold; -} - -cite { - font-style: italic; -} - -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; -} - -p.border_image img { - border-style:solid; - border-width:1px; - border-color: rgb(187,187,187); -} - - -table { - width: 100%; -} - -table td { - padding: 3px 5px; - width: 30%; -} - -dt { - font-style:italic; - margin: 5px 0; -} - -dd { - padding-left: 10px; -} - - - table.meta { - width:50%; - } - table.meta th { - border-width:1px; - border-style:solid; - border-color:black; - } - table.meta td { - border-width:1px; - border-style:solid; - border-color:black; - } - -} -#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; -} - -ol li:before { - content: counter(num) '. '; - counter-increment: num; -} - -ol ol li:before { - content: counters(num, '.') ' '; -} - -em { - font-style: italic; -} - -strong { - font-weight: bold; -} - -cite { - font-style: italic; -} - -p.attr_data { - font-style: italic; - text-decoration: underline; -} - -table { - width: 100%; -} - -table td { - padding: 3px 5px; - width: 30%; -} - -dt { - font-style:italic; - margin: 5px 0; -} - -dd { - padding-left: 10px; -} -} diff --git a/app/assets/stylesheets/main/import_tasks.sass b/app/assets/stylesheets/main/import_tasks.sass new file mode 100644 index 000000000..810582cf2 --- /dev/null +++ b/app/assets/stylesheets/main/import_tasks.sass @@ -0,0 +1,11 @@ +#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/import_tasks.scss b/app/assets/stylesheets/main/import_tasks.scss deleted file mode 100644 index 3a0d48ddf..000000000 --- a/app/assets/stylesheets/main/import_tasks.scss +++ /dev/null @@ -1,13 +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; - } -} diff --git a/app/assets/stylesheets/main/imports.sass b/app/assets/stylesheets/main/imports.sass new file mode 100644 index 000000000..af5e88218 --- /dev/null +++ b/app/assets/stylesheets/main/imports.sass @@ -0,0 +1,40 @@ +#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/imports.scss b/app/assets/stylesheets/main/imports.scss deleted file mode 100644 index 32a20d1c4..000000000 --- a/app/assets/stylesheets/main/imports.scss +++ /dev/null @@ -1,52 +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; - .fa-ban { - opacity: 0.6; - } - .fa-stack { - font-size: 0.9em; - } - margin-left: 0.3em; - } - } -} - -#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; - } -} diff --git a/app/assets/stylesheets/main/journey_patterns.sass b/app/assets/stylesheets/main/journey_patterns.sass new file mode 100644 index 000000000..07c3260d4 --- /dev/null +++ b/app/assets/stylesheets/main/journey_patterns.sass @@ -0,0 +1,49 @@ +// 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/journey_patterns.scss b/app/assets/stylesheets/main/journey_patterns.scss deleted file mode 100644 index 51547b05d..000000000 --- a/app/assets/stylesheets/main/journey_patterns.scss +++ /dev/null @@ -1,55 +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; -} diff --git a/app/assets/stylesheets/main/layout.sass b/app/assets/stylesheets/main/layout.sass new file mode 100644 index 000000000..d75c359ae --- /dev/null +++ b/app/assets/stylesheets/main/layout.sass @@ -0,0 +1,133 @@ +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/layout.scss b/app/assets/stylesheets/main/layout.scss deleted file mode 100644 index cd1cea37e..000000000 --- a/app/assets/stylesheets/main/layout.scss +++ /dev/null @@ -1,154 +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{ - - legend{ - font-size: 14px; - margin-bottom: 10px; - } - - font-size: 12px; - color: $gray-light; - } - - 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; - } - a.current { - text-decoration: none; - color: black !important; - background: url(image-path('icons/accept.png')) no-repeat; - } - a.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; - } - } - } - } -} diff --git a/app/assets/stylesheets/main/lines.sass b/app/assets/stylesheets/main/lines.sass new file mode 100644 index 000000000..b9bdfae8f --- /dev/null +++ b/app/assets/stylesheets/main/lines.sass @@ -0,0 +1,87 @@ +// 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/lines.scss b/app/assets/stylesheets/main/lines.scss deleted file mode 100644 index e114a2338..000000000 --- a/app/assets/stylesheets/main/lines.scss +++ /dev/null @@ -1,107 +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; -} diff --git a/app/assets/stylesheets/main/multiple_selection.sass b/app/assets/stylesheets/main/multiple_selection.sass new file mode 100644 index 000000000..b46dded01 --- /dev/null +++ b/app/assets/stylesheets/main/multiple_selection.sass @@ -0,0 +1,17 @@ +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/multiple_selection.scss b/app/assets/stylesheets/main/multiple_selection.scss deleted file mode 100644 index 6a5bdd54f..000000000 --- a/app/assets/stylesheets/main/multiple_selection.scss +++ /dev/null @@ -1,20 +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.scss b/app/assets/stylesheets/main/networks.sass index c8533699e..4d3717f26 100644 --- a/app/assets/stylesheets/main/networks.scss +++ b/app/assets/stylesheets/main/networks.sass @@ -2,14 +2,8 @@ // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ -#workspace.networks.index -{ -} +// #workspace.networks.index #workspace.networks.show -{ - .summary p label { - font-weight: bold; - } -} - + .summary p label + font-weight: bold
\ No newline at end of file diff --git a/app/assets/stylesheets/main/offer_workbenches.scss b/app/assets/stylesheets/main/offer_workbenches.sass index 2859c635d..2859c635d 100644 --- a/app/assets/stylesheets/main/offer_workbenches.scss +++ b/app/assets/stylesheets/main/offer_workbenches.sass diff --git a/app/assets/stylesheets/main/organisations.scss b/app/assets/stylesheets/main/organisations.sass index b3ef5b5f4..4bfee860a 100644 --- a/app/assets/stylesheets/main/organisations.scss +++ b/app/assets/stylesheets/main/organisations.sass @@ -2,7 +2,4 @@ // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ -#workspace.organisations.show -{ -} - +// #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 new file mode 100644 index 000000000..293807560 --- /dev/null +++ b/app/assets/stylesheets/main/referentials.sass @@ -0,0 +1,34 @@ +// 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/referentials.scss b/app/assets/stylesheets/main/referentials.scss deleted file mode 100644 index 8b6ae4b66..000000000 --- a/app/assets/stylesheets/main/referentials.scss +++ /dev/null @@ -1,48 +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; - } - - li.date { - - input{ - width: 125px; - font-size: 12px; - height: 25px - } - label{ - width: 35%; - } - } - } - - } -} diff --git a/app/assets/stylesheets/main/route_sections.css.scss b/app/assets/stylesheets/main/route_sections.css.scss deleted file mode 100644 index cc1c85abc..000000000 --- a/app/assets/stylesheets/main/route_sections.css.scss +++ /dev/null @@ -1,68 +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; - } -} diff --git a/app/assets/stylesheets/main/route_sections.sass b/app/assets/stylesheets/main/route_sections.sass new file mode 100644 index 000000000..fe3c98c10 --- /dev/null +++ b/app/assets/stylesheets/main/route_sections.sass @@ -0,0 +1,54 @@ +#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 new file mode 100644 index 000000000..977d2f4b3 --- /dev/null +++ b/app/assets/stylesheets/main/routes.sass @@ -0,0 +1,46 @@ +// 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/routes.scss b/app/assets/stylesheets/main/routes.scss deleted file mode 100644 index 44703c7e5..000000000 --- a/app/assets/stylesheets/main/routes.scss +++ /dev/null @@ -1,56 +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%; - } -} - diff --git a/app/assets/stylesheets/main/rule_parameter_sets.sass b/app/assets/stylesheets/main/rule_parameter_sets.sass new file mode 100644 index 000000000..ab58b7bf9 --- /dev/null +++ b/app/assets/stylesheets/main/rule_parameter_sets.sass @@ -0,0 +1,45 @@ +// 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/rule_parameter_sets.scss b/app/assets/stylesheets/main/rule_parameter_sets.scss deleted file mode 100644 index 7df394190..000000000 --- a/app/assets/stylesheets/main/rule_parameter_sets.scss +++ /dev/null @@ -1,51 +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; } - } - } -} - - diff --git a/app/assets/stylesheets/main/simple_form.sass b/app/assets/stylesheets/main/simple_form.sass new file mode 100644 index 000000000..143ea692c --- /dev/null +++ b/app/assets/stylesheets/main/simple_form.sass @@ -0,0 +1,3 @@ +#workspace + .submit + @extend .col-md-offset-3
\ No newline at end of file diff --git a/app/assets/stylesheets/main/simple_form.scss b/app/assets/stylesheets/main/simple_form.scss deleted file mode 100644 index 9282d89e0..000000000 --- a/app/assets/stylesheets/main/simple_form.scss +++ /dev/null @@ -1,7 +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 new file mode 100644 index 000000000..f8e1e148a --- /dev/null +++ b/app/assets/stylesheets/main/stop_areas.sass @@ -0,0 +1,165 @@ +// 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_areas.scss b/app/assets/stylesheets/main/stop_areas.scss deleted file mode 100644 index c0bbe8a64..000000000 --- a/app/assets/stylesheets/main/stop_areas.scss +++ /dev/null @@ -1,170 +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; - } - } -} - - diff --git a/app/assets/stylesheets/main/stop_points.sass b/app/assets/stylesheets/main/stop_points.sass new file mode 100644 index 000000000..a17814d3b --- /dev/null +++ b/app/assets/stylesheets/main/stop_points.sass @@ -0,0 +1,26 @@ +// 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/stop_points.scss b/app/assets/stylesheets/main/stop_points.scss deleted file mode 100644 index b1ba9ff50..000000000 --- a/app/assets/stylesheets/main/stop_points.scss +++ /dev/null @@ -1,35 +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; - } - - } -} - diff --git a/app/assets/stylesheets/main/subscriptions.scss b/app/assets/stylesheets/main/subscriptions.sass index 58a272cbd..0ef6aba3e 100644 --- a/app/assets/stylesheets/main/subscriptions.scss +++ b/app/assets/stylesheets/main/subscriptions.sass @@ -2,7 +2,4 @@ // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ -#workspace.subscriptions.create, #workspace.subscriptions.new -{ -} - +// #workspace.subscriptions.create, #workspace.subscriptions.new
\ 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 new file mode 100644 index 000000000..9de2c2235 --- /dev/null +++ b/app/assets/stylesheets/main/time_table_combinations.sass @@ -0,0 +1,7 @@ +#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_table_combinations.scss b/app/assets/stylesheets/main/time_table_combinations.scss deleted file mode 100644 index 70dc2e535..000000000 --- a/app/assets/stylesheets/main/time_table_combinations.scss +++ /dev/null @@ -1,14 +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 new file mode 100644 index 000000000..b24a02c27 --- /dev/null +++ b/app/assets/stylesheets/main/time_tables.sass @@ -0,0 +1,132 @@ +// 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: $brand-danger + + .validity_out_soon + color: $brand-warning + + .validity_regular + color: $brand-success + + 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 + +#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
\ No newline at end of file diff --git a/app/assets/stylesheets/main/time_tables.scss b/app/assets/stylesheets/main/time_tables.scss deleted file mode 100644 index bc1f48810..000000000 --- a/app/assets/stylesheets/main/time_tables.scss +++ /dev/null @@ -1,160 +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: $brand-danger; - } - - .validity_out_soon { - color: $brand-warning; - } - - .validity_regular { - color: $brand-success; - } - - 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; - } -} - -#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{ - .nested-fields { - margin: 5px; - - ol { - li { - display: inline; - } - } - } - - margin-left: 25%; - } - - .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; - } - .day_type ol li { - float: left; - margin: 0 O 0 0; - width: auto; - padding: 0; - } - .day_type_label { - float: left; - margin-top: 0; - width: 25%; - } - .day_type ol li label { - padding-left: 10%; - margin-top: 0; - } - - 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/timebands.scss b/app/assets/stylesheets/main/timebands.sass index e69de29bb..e69de29bb 100644 --- a/app/assets/stylesheets/main/timebands.scss +++ b/app/assets/stylesheets/main/timebands.sass diff --git a/app/assets/stylesheets/main/users.scss b/app/assets/stylesheets/main/users.sass index daaae0132..e99c60660 100644 --- a/app/assets/stylesheets/main/users.scss +++ b/app/assets/stylesheets/main/users.sass @@ -2,6 +2,4 @@ // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ -#workspace.users.edit, #workspace.lines.new -{ -} +#workspace.users.edit, #workspace.lines.new
\ No newline at end of file diff --git a/app/assets/stylesheets/main/vehicle_journey_frequencies.sass b/app/assets/stylesheets/main/vehicle_journey_frequencies.sass new file mode 100644 index 000000000..a827cc4d2 --- /dev/null +++ b/app/assets/stylesheets/main/vehicle_journey_frequencies.sass @@ -0,0 +1,155 @@ +#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_journey_frequencies.scss b/app/assets/stylesheets/main/vehicle_journey_frequencies.scss deleted file mode 100644 index d2052f790..000000000 --- a/app/assets/stylesheets/main/vehicle_journey_frequencies.scss +++ /dev/null @@ -1,158 +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 6px 20px; - } - .ce-TimeBandFormTable td { - padding: 6px 20px 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; - } -} diff --git a/app/assets/stylesheets/main/vehicle_journey_imports.sass b/app/assets/stylesheets/main/vehicle_journey_imports.sass new file mode 100644 index 000000000..c02139389 --- /dev/null +++ b/app/assets/stylesheets/main/vehicle_journey_imports.sass @@ -0,0 +1 @@ +// #workspace.vehicle_journey_imports.new
\ No newline at end of file diff --git a/app/assets/stylesheets/main/vehicle_journey_imports.scss b/app/assets/stylesheets/main/vehicle_journey_imports.scss deleted file mode 100644 index 529182443..000000000 --- a/app/assets/stylesheets/main/vehicle_journey_imports.scss +++ /dev/null @@ -1,4 +0,0 @@ -#workspace.vehicle_journey_imports.new -{ - -}
\ No newline at end of file diff --git a/app/assets/stylesheets/main/vehicle_journeys.sass b/app/assets/stylesheets/main/vehicle_journeys.sass new file mode 100644 index 000000000..ec0b25dbc --- /dev/null +++ b/app/assets/stylesheets/main/vehicle_journeys.sass @@ -0,0 +1,118 @@ +#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_journeys.scss b/app/assets/stylesheets/main/vehicle_journeys.scss deleted file mode 100644 index 6f67bc4b4..000000000 --- a/app/assets/stylesheets/main/vehicle_journeys.scss +++ /dev/null @@ -1,153 +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 { - } - } -} diff --git a/app/assets/stylesheets/main/vehicle_translation.sass b/app/assets/stylesheets/main/vehicle_translation.sass new file mode 100644 index 000000000..f1fd12e14 --- /dev/null +++ b/app/assets/stylesheets/main/vehicle_translation.sass @@ -0,0 +1,10 @@ +#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/main/vehicle_translation.scss b/app/assets/stylesheets/main/vehicle_translation.scss deleted file mode 100644 index f399d1a4a..000000000 --- a/app/assets/stylesheets/main/vehicle_translation.scss +++ /dev/null @@ -1,15 +0,0 @@ -#translate_form{ - .repeat_cloning{ - margin-top: 30px; - } - - .modal-footer{ - .actions { - padding-left: 75%; - - li { - margin: 0px 0px; - } - } - } -} diff --git a/app/assets/stylesheets/main/welcome.scss b/app/assets/stylesheets/main/welcome.sass index 77ce11a74..77ce11a74 100644 --- a/app/assets/stylesheets/main/welcome.scss +++ b/app/assets/stylesheets/main/welcome.sass diff --git a/app/assets/stylesheets/modules/devise.sass b/app/assets/stylesheets/modules/devise.sass new file mode 100644 index 000000000..a05df45ba --- /dev/null +++ b/app/assets/stylesheets/modules/devise.sass @@ -0,0 +1,65 @@ +#devise + background-color: $gray-light + + .passwords.new + input + width: initial !important + + .front_bg + background: url(image-path('welcome.jpg')) no-repeat center center + background-size: cover + + #devise_middle + min-height: 620px + padding: 30px 20px 0px 20px + + #registrations_new + .error + input + border: 1px solid #d43f3a + + span.help-block + margin-left: 5px + color: #d43f3a + font-size: 15px + + #sessions_new + .btn + font-weight: bold + + .product_summary + padding: 30px 60px 0 60px + color: white + text-shadow: 0 0 1px rgba(0,0,0,0.6) + + p + font-size: 21px + + ul > li + font-size: 21px + + .login + padding-top: 30px + + .form-group + margin-bottom: 5px + + .options + font-size: 12px + + .new_password + padding-top: 7px + + .checkbox + font-weight: normal + + input[type='checkbox'] + margin-left: 0px !important + position: relative + margin: 0px 4px 0px 0px + + .form-group + margin-bottom: 0px + + #footer + background-color: rgba(0, 0, 0, 0.8)
\ No newline at end of file diff --git a/app/assets/stylesheets/modules/devise.scss b/app/assets/stylesheets/modules/devise.scss deleted file mode 100644 index b99a016f5..000000000 --- a/app/assets/stylesheets/modules/devise.scss +++ /dev/null @@ -1,88 +0,0 @@ -#devise{ - background-color: $gray-light; - - .passwords.new{ - input{ - width: initial !important; - } - } - - .front_bg{ - background: url(image-path('welcome.jpg')) no-repeat center center; - background-size: cover; - - #devise_middle{ - min-height: 620px; - padding: 30px 20px 0px 20px; - - #registrations_new{ - - .error { - input { - border: 1px solid #d43f3a; - } - } - - span.help-block { - margin-left: 5px; - color: #d43f3a; - font-size: 15px; - } - } - - #sessions_new{ - - .btn{ - font-weight: bold; - } - - .product_summary{ - padding: 30px 60px 0 60px; - - color: white; - text-shadow: 0 0 1px rgba(0,0,0,.6); - - p{ - font-size: 21px; - } - - ul > li{ font-size: 21px; } - } - - .login{ - padding-top: 30px; - - .form-group{ - margin-bottom: 5px; - } - - .options{ - .new_password{ - padding-top: 7px; - } - - .checkbox{ - font-weight: normal; - - input[type="checkbox"]{ - margin-left: 0px !important; - position: relative; - margin: 0px 4px 0px 0px; - } - } - - .form-group{ - margin-bottom: 0px; - } - - font-size: 12px; - } - } - } - } - - #footer{ - background-color: rgba(0, 0, 0, 0.8); - } - } -} diff --git a/app/assets/stylesheets/modules/icons.sass b/app/assets/stylesheets/modules/icons.sass new file mode 100644 index 000000000..5b8dd8e56 --- /dev/null +++ b/app/assets/stylesheets/modules/icons.sass @@ -0,0 +1,90 @@ +a:before + font-family: FontAwesome + display: inline-block + padding-right: 3px + vertical-align: middle + +a.view:before + // fa-eye + content: '\f06e' + color: $brand-success + +a.add:before + // fa-plus-circle + content: '\f055' + color: $brand-success + +a.edit:before + // fa-pencil + content: '\f040' + color: $brand-warning + +a.remove:before + // fa-trash + content: '\f1f8' + color: $brand-danger + +a.export:before + // fa-upload + content: '\f093' + color: $brand-info + +a.import:before + // fa-download + content: '\f019' + color: $brand-info + +a.clone:before + // fa-copy + content: '\f0c5' + color: $brand-success + +a.link:before + // fa-external-link + content: '\f08e' + +a.select:before + // fa-select + content: '\f0a6' + color: $brand-warning + +a.calculator:before + // fa-calculator + content: '\f1ec' + color: $brand-warning + +a.parent:before + // fa-arrow-up + content: '\f062' + color: $brand-warning + +a.children:before + // fa-sitemap + content: '\f0e8' + color: $brand-warning + +a.access_link:before + // fa-exchange + content: '\f0ec' + color: $brand-warning + +a.merge:before + // fa-link + content: '\f0c1' + color: $brand-warning + +a.clock:before + // fa-clock-o + content: '\f017' + +.fa-stack + /* sizes whole .fa-stack down to make them the regular sized */ + font-size: .5em + /* makes sure regular and stacked icons vertically align */ + vertical-align: -16% + +/* Styles text for doc type. Oswald is a great condensed Google Web Font */ +.filetype-text + font-size: .7em + font-weight: 700 + font-family: 'Oswald'
\ No newline at end of file diff --git a/app/assets/stylesheets/modules/icons.scss b/app/assets/stylesheets/modules/icons.scss deleted file mode 100644 index 3c42c3bd6..000000000 --- a/app/assets/stylesheets/modules/icons.scss +++ /dev/null @@ -1,95 +0,0 @@ -a:before { - font-family: FontAwesome; - display: inline-block; - padding-right: 3px; - vertical-align: middle; -} - -a.view:before { // fa-eye - content: "\f06e"; - color: $brand-success; -} - -a.add:before { // fa-plus-circle - content: "\f055"; - color: $brand-success; - } - -a.edit:before { // fa-pencil - content: "\f040"; - color: $brand-warning; - } - -a.remove:before { // fa-trash - content: "\f1f8"; - color: $brand-danger; - } - -a.export:before { // fa-upload - content: "\f093"; - color: $brand-info; - } - -a.import:before { // fa-download - content: "\f019"; - color: $brand-info; - } - -a.clone:before { // fa-copy - content: "\f0c5"; - color: $brand-success; - } - -a.link:before { // fa-external-link - content: "\f08e"; - } - -a.select:before {// fa-select - content: "\f0a6"; - color: $brand-warning; - - } - -a.calculator:before { // fa-calculator - content: "\f1ec"; - color: $brand-warning; - } - -a.parent:before { // fa-arrow-up - content: "\f062"; - color: $brand-warning; - } - -a.children:before { // fa-sitemap - content: "\f0e8"; - color: $brand-warning; - } - -a.access_link:before { // fa-exchange - content: "\f0ec"; - color: $brand-warning; - } - -a.merge:before { // fa-link - content: "\f0c1"; - color: $brand-warning; - } - -a.clock:before { // fa-clock-o - content: "\f017"; - } - -.fa-stack { - /* sizes whole .fa-stack down to make them the regular sized */ - font-size: .5em; - /* makes sure regular and stacked icons vertically align */ - vertical-align: -16%; -} - -/* Styles text for doc type. Oswald is a great condensed -Google Web Font */ -.filetype-text { - font-size: .7em; - font-weight: 700; - font-family: 'Oswald'; -} diff --git a/app/assets/stylesheets/modules/index_item.sass b/app/assets/stylesheets/modules/index_item.sass new file mode 100644 index 000000000..1e84eac59 --- /dev/null +++ b/app/assets/stylesheets/modules/index_item.sass @@ -0,0 +1,66 @@ +#index_item + .panel-heading + @extend .clearfix + + .validity_out + color: $brand-danger + + .validity_out_soon + color: $brand-warning + + .validity_regular + color: $brand-success + + button + margin-left: 3px + + .date + font-size: 10px + color: gray + text-align: center + + .label + margin-right: 5px + + h5 + margin: 0px + padding-top: 4.5px + + span.name + .fa + margin-right: 5px + + p.format + color: $gray + margin: 3px 0px 0px 0px + + .label + font-size: 10px + + @import 'job_status_colors' + + .panel-body + p + margin: 0 0 3px + font-size: 12px + + img + margin-right: 5px + + i + color: $gray + margin-right: 5px + + span.included_day_type + font-weight: bolder + margin-right: 3px + + span.excluded_day_type + margin-right: 3px + + .panel-footer + text-align: center + + .history + color: $gray + font-size: 10px
\ No newline at end of file diff --git a/app/assets/stylesheets/modules/index_item.scss b/app/assets/stylesheets/modules/index_item.scss deleted file mode 100644 index e281854a8..000000000 --- a/app/assets/stylesheets/modules/index_item.scss +++ /dev/null @@ -1,93 +0,0 @@ -#index_item{ - - - .panel-heading{ - @extend .clearfix; - - .validity_out { - color: $brand-danger; - } - - .validity_out_soon { - color: $brand-warning; - } - - .validity_regular { - color: $brand-success; - } - - button { - margin-left:3px; - } - - .date { - font-size:10px; - color: gray; - text-align: center; - } - - .label{ - margin-right: 5px; - } - - h5{ - margin: 0px; - padding-top: 4.5px; - - span.name{ - .fa{ - margin-right: 5px; - } - } - - p.format{ - color: $gray; - margin: 3px 0px 0px 0px; - - .label{ - font-size: 10px; - } - } - - @import "job_status_colors" - } - - } - - .panel-body{ - p { - margin: 0 0 3px; - font-size: 12px; - } - - img{ - margin-right: 5px; - } - - i{ - color: $gray; - margin-right: 5px; - } - - span.included_day_type { - font-weight: bolder; - margin-right: 3px; - } - - span.excluded_day_type { - margin-right: 3px; - } - - } - - .panel-footer{ - text-align: center; - - .history{ - color: $gray; - font-size: 10px; - } - } - -} - diff --git a/app/assets/stylesheets/modules/job_status_colors.sass b/app/assets/stylesheets/modules/job_status_colors.sass new file mode 100644 index 000000000..cf197788a --- /dev/null +++ b/app/assets/stylesheets/modules/job_status_colors.sass @@ -0,0 +1,9 @@ +.terminated + color: $brand-success + +.processed + color: $brand-info + box-shadow: none + +.aborted + color: $brand-danger
\ No newline at end of file diff --git a/app/assets/stylesheets/modules/job_status_colors.scss b/app/assets/stylesheets/modules/job_status_colors.scss deleted file mode 100644 index b3ae3d72c..000000000 --- a/app/assets/stylesheets/modules/job_status_colors.scss +++ /dev/null @@ -1,4 +0,0 @@ -.terminated{ color: $brand-success; } -.processed{ color: $brand-info; box-shadow: none; } -.aborted{ color: $brand-danger; } - diff --git a/app/assets/stylesheets/modules/job_status_title.sass b/app/assets/stylesheets/modules/job_status_title.sass new file mode 100644 index 000000000..fad3bd113 --- /dev/null +++ b/app/assets/stylesheets/modules/job_status_title.sass @@ -0,0 +1,8 @@ +h2 + i + margin: 0 5px 0 0 + + p.format + margin: 5px 0 0 0 + color: $gray + font-size: 14px
\ No newline at end of file diff --git a/app/assets/stylesheets/modules/job_status_title.scss b/app/assets/stylesheets/modules/job_status_title.scss deleted file mode 100644 index 65ce53efe..000000000 --- a/app/assets/stylesheets/modules/job_status_title.scss +++ /dev/null @@ -1,9 +0,0 @@ -h2{ - i{ margin: 0 5px 0 0; } - - p.format{ - margin: 5px 0 0 0; - color: $gray; - font-size: 14px; - } -} diff --git a/app/assets/stylesheets/modules/links.sass b/app/assets/stylesheets/modules/links.sass new file mode 100644 index 000000000..b2d201cef --- /dev/null +++ b/app/assets/stylesheets/modules/links.sass @@ -0,0 +1,7 @@ +.links + @include clearfix() + margin: 0 0 20px 0 + + i + color: $gray + margin: 0 3px 0 15px
\ No newline at end of file diff --git a/app/assets/stylesheets/modules/links.scss b/app/assets/stylesheets/modules/links.scss deleted file mode 100644 index b97927988..000000000 --- a/app/assets/stylesheets/modules/links.scss +++ /dev/null @@ -1,9 +0,0 @@ -.links{ - @include clearfix(); - - margin: 0 0 20px 0; - i{ - color: $gray; - margin: 0 3px 0 15px; - } -} diff --git a/app/assets/stylesheets/modules/progress_bars.sass b/app/assets/stylesheets/modules/progress_bars.sass new file mode 100644 index 000000000..2ad1c0e81 --- /dev/null +++ b/app/assets/stylesheets/modules/progress_bars.sass @@ -0,0 +1,22 @@ +.progress_bars + width: 50% + margin-bottom: 10px + + .progress + position: relative + height: 25px + + .progress-type + position: absolute + left: 0px + font-weight: 800 + width: 30% + padding: 3px 30px 2px 10px + color: rgb(255, 255, 255) + background-color: rgba(25, 25, 25, 0.2) + + .progress-completed + position: absolute + right: 0px + font-weight: 800 + padding: 3px 10px 2px
\ No newline at end of file diff --git a/app/assets/stylesheets/modules/progress_bars.scss b/app/assets/stylesheets/modules/progress_bars.scss deleted file mode 100644 index 690a0f4ac..000000000 --- a/app/assets/stylesheets/modules/progress_bars.scss +++ /dev/null @@ -1,27 +0,0 @@ -.progress_bars{ - width: 50%; - - margin-bottom: 10px; - - .progress { - position: relative; - height: 25px; - - .progress-type { - position: absolute; - left: 0px; - font-weight: 800; - width: 30%; - padding: 3px 30px 2px 10px; - color: rgb(255, 255, 255); - background-color: rgba(25, 25, 25, 0.2); - } - - .progress-completed { - position: absolute; - right: 0px; - font-weight: 800; - padding: 3px 10px 2px; - } - } -} diff --git a/app/assets/stylesheets/modules/search.sass b/app/assets/stylesheets/modules/search.sass new file mode 100644 index 000000000..72fb9e553 --- /dev/null +++ b/app/assets/stylesheets/modules/search.sass @@ -0,0 +1,12 @@ +#search + #advanced_search + .form-control + display: inline !important + + .panel-body + div + margin-bottom: 10px + + // Fix for typeahead css to remove + span.twitter-typeahead + display: inline !important
\ No newline at end of file diff --git a/app/assets/stylesheets/modules/search.scss b/app/assets/stylesheets/modules/search.scss deleted file mode 100644 index eeb35a8a5..000000000 --- a/app/assets/stylesheets/modules/search.scss +++ /dev/null @@ -1,19 +0,0 @@ -#search{ - - #advanced_search{ - - .form-control{ - display: inline !important; - } - - .panel-body{ - div{ - margin-bottom: 10px; - } - } - } - - // Fix for typeahead css to remove - span.twitter-typeahead { display: inline !important;} - -}
\ No newline at end of file diff --git a/app/assets/stylesheets/partials/base.sass b/app/assets/stylesheets/partials/base.sass new file mode 100644 index 000000000..50a50457b --- /dev/null +++ b/app/assets/stylesheets/partials/base.sass @@ -0,0 +1,19 @@ +.formtastic.timeband + .time_select + .fragments + .fragments-group + padding-left: 0 + + legend.label + position: relative + width: auto + display: block + width: 25% + float: left + border: none + + label + position: relative + width: auto + font-size: 125% + padding: .2em .6em .3em
\ No newline at end of file diff --git a/app/assets/stylesheets/partials/base.scss b/app/assets/stylesheets/partials/base.scss deleted file mode 100644 index e4258c277..000000000 --- a/app/assets/stylesheets/partials/base.scss +++ /dev/null @@ -1,23 +0,0 @@ -.formtastic.timeband { - .time_select { - .fragments { - .fragments-group { - padding-left: 0; - } - legend.label { - position: relative; - width: auto; - display: block; - width: 25%; - float: left; - border: none; - label { - position: relative; - width: auto; - font-size: 125%; - padding: .2em .6em .3em; - } - } - } - } -} diff --git a/app/assets/stylesheets/partials/footer.sass b/app/assets/stylesheets/partials/footer.sass new file mode 100644 index 000000000..f58e1e04e --- /dev/null +++ b/app/assets/stylesheets/partials/footer.sass @@ -0,0 +1,15 @@ +#footer + padding: 20px + background-color: $gray-darker + color: $gray-light + font-size: 12px + min-height: 200px + + a + color: $gray-light + + h4 + color: $gray-lighter + + .logo > img + margin-left: 20px
\ No newline at end of file diff --git a/app/assets/stylesheets/partials/footer.scss b/app/assets/stylesheets/partials/footer.scss deleted file mode 100644 index a6b38b76d..000000000 --- a/app/assets/stylesheets/partials/footer.scss +++ /dev/null @@ -1,15 +0,0 @@ -#footer{ - padding: 20px; - background-color: $gray-darker; - color: $gray-light; - font-size: 12px; - min-height: 200px; - - a { color: $gray-light; } - - h4 { color: $gray-lighter; } - - .logo > img { - margin-left: 20px; - } -}
\ No newline at end of file diff --git a/app/assets/stylesheets/partials/header.sass b/app/assets/stylesheets/partials/header.sass new file mode 100644 index 000000000..20e46de2a --- /dev/null +++ b/app/assets/stylesheets/partials/header.sass @@ -0,0 +1,36 @@ +#header + background: $brand_primary url(image-path('header.png')) no-repeat + + .navbar-brand + padding-top: 5px + padding-bottom: 5px + line-height: 40px + + img + height: 40px + + .navbar-text + margin-top: 10px + margin-bottom: 10px + margin-left: 0px + + .brand_name + color: white + font-weight: bold + font-size: 20px + + .version + margin-left: 5px + color: white + font-size: 12px + + .gravatar + margin-right: 5px + + img + width: 25px + height: 25px + + .dropdown.languages + .dropdown-menu + min-width: 56px
\ No newline at end of file diff --git a/app/assets/stylesheets/partials/header.scss b/app/assets/stylesheets/partials/header.scss deleted file mode 100644 index 6f7b777f1..000000000 --- a/app/assets/stylesheets/partials/header.scss +++ /dev/null @@ -1,48 +0,0 @@ -#header { - - .navbar-brand{ - padding-top: 5px; - padding-bottom: 5px; - line-height: 40px; - - img { - height: 40px; - } - } - - .navbar-text{ - margin-top: 10px; - margin-bottom: 10px; - margin-left: 0px; - - .brand_name{ - color: white; - font-weight: bold; - font-size: 20px; - } - - .version - { - margin-left: 5px; - color: white; - font-size: 12px; - } - } - - background: $brand_primary url(image-path('header.png')) no-repeat; - - .gravatar { - margin-right: 5px; - img{ - width: 25px; - height: 25px; - } - } - - .dropdown.languages{ - .dropdown-menu{ - min-width: 56px; - } - } - -}
\ No newline at end of file diff --git a/app/assets/stylesheets/partials/ie_report.sass b/app/assets/stylesheets/partials/ie_report.sass new file mode 100644 index 000000000..b2a5ae948 --- /dev/null +++ b/app/assets/stylesheets/partials/ie_report.sass @@ -0,0 +1,33 @@ +.status + margin-left: 10px + +.resume + &:after + content: " " + display: block + height: 0 + clear: both + visibility: hidden + + .caption + text-align: center + font-weight: bold + + dl.inline + dd + display: inline + margin: 0 + + &:after + content: '' + display: block + + dt + display: inline-block + min-width: 180px + +.report + margin-top: 20px + + .form-group + margin-right: 20px
\ No newline at end of file diff --git a/app/assets/stylesheets/partials/ie_report.scss b/app/assets/stylesheets/partials/ie_report.scss deleted file mode 100644 index 55286d690..000000000 --- a/app/assets/stylesheets/partials/ie_report.scss +++ /dev/null @@ -1,35 +0,0 @@ -.status { - margin-left: 10px; -} -.resume { - &:after{ - content: " "; - display: block; - height: 0; - clear: both; - visibility: hidden; - } - .caption { - text-align :center; - font-weight: bold; - } - dl.inline dd { - display: inline; - margin: 0; - } - dl.inline dd:after{ - display: block; - content: ''; - } - dl.inline dt{ - display: inline-block; - min-width: 180px; - } -} - -.report { - margin-top: 20px; - .form-group { - margin-right: 20px; - } -} diff --git a/app/assets/stylesheets/vendor/bootstrap_changes.sass b/app/assets/stylesheets/vendor/bootstrap_changes.sass new file mode 100644 index 000000000..900949492 --- /dev/null +++ b/app/assets/stylesheets/vendor/bootstrap_changes.sass @@ -0,0 +1,47 @@ +.popover + li + list-style: inherit !important + + .time_table_info + color: $gray + font-size: 11px + + span.included_day_type + color: black + font-weight: bold + + // span.excluded_day_type + + span.bounding + font-size: 11px + margin-left: 5px + + .validity_out + color: $brand-danger + + .validity_out_soon + color: $brand-warning + + .validity_regular + color: $brand-success + +.popover-title + display: table + width: 100% + + > a + display: table-cell + vertical-align: top + &:first-child + padding-right: 10px + + &:last-child + width: 32px + +.popover-content + > ul + margin: 0 + padding: 0 + + > li + list-style: none !important
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/bootstrap_changes.scss b/app/assets/stylesheets/vendor/bootstrap_changes.scss deleted file mode 100644 index 6e2ccc1f6..000000000 --- a/app/assets/stylesheets/vendor/bootstrap_changes.scss +++ /dev/null @@ -1,58 +0,0 @@ -.popover{ - - li{ - list-style: inherit !important; - } - - .time_table_info{ - color: $gray; - font-size: 11px; - } - - span.included_day_type { - color: black; - font-weight: bold; - } - span.excluded_day_type { - } - - span.bounding{ - font-size: 11px; - margin-left: 5px; - } - - .validity_out { - color: $brand-danger; - } - - .validity_out_soon { - color: $brand-warning; - } - - .validity_regular { - color: $brand-success; - } -} -.popover-title { - display: table; - width: 100%; - > a { - display: table-cell; - vertical-align: top; - &:first-child { - padding-right: 10px; - } - &:last-child { - width: 32px; - } - } -} -.popover-content { - > ul { - margin: 0; - padding: 0; - > li { - list-style: none !important; - } - } -} diff --git a/app/assets/stylesheets/vendor/formtastic_changes.sass b/app/assets/stylesheets/vendor/formtastic_changes.sass new file mode 100644 index 000000000..60824f10c --- /dev/null +++ b/app/assets/stylesheets/vendor/formtastic_changes.sass @@ -0,0 +1,32 @@ +.formtastic + .label + white-space: normal + text-align: right + + .stringish input + width: auto + + fieldset.inputs + a.action + float: right + + .choices .label, .formtastic .fragments .label + width: 25% + border: 0px + + label + position: relative + font-size: 14px + + .choices legend.label label + @extend .label + font-size: 14px !important + width: 100% !important + + .token-input-list + display: inline-block + + /* Hack to remove!!!! */ + .inputs input[type='file'] + display: initial + /* Hack to remove!!!! */
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/formtastic_changes.scss b/app/assets/stylesheets/vendor/formtastic_changes.scss deleted file mode 100644 index 7eb6b10c5..000000000 --- a/app/assets/stylesheets/vendor/formtastic_changes.scss +++ /dev/null @@ -1,42 +0,0 @@ -.formtastic{ - - .label{ - white-space: normal; - text-align: right; - } - - .stringish input{ - width: auto; - } - - fieldset.inputs { - - a.action { float: right; } - } - - .choices .label, .formtastic .fragments .label { - width: 25%; - border: 0px; - - label { - position: relative; - font-size: 14px; - } - } - - .choices legend.label label{ - @extend .label; - font-size: 14px !important; - width: 100% !important; - } - - .token-input-list { - display: inline-block; - } - - /* Hack to remove!!!! */ - .inputs input[type="file"] { - display: initial; - } - /* Hack to remove!!!! */ -}
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/map_layers.sass b/app/assets/stylesheets/vendor/map_layers.sass new file mode 100644 index 000000000..76428c55d --- /dev/null +++ b/app/assets/stylesheets/vendor/map_layers.sass @@ -0,0 +1,37 @@ +p.after_map + clear: both + +#map + position: relative + float: right + width: 400px + height: 400px + border: 1px solid gray + margin-bottom: 20px !important + +.ce-MapExpandBlock + position: absolute + top: -22px + background-color: $brand-primary + border: none + height: 21px + right: -1px + color: white + padding: 2px 6px !important + +#map.ce-MapBlock-fullWidth + width: 100% !important + display: block + float: inherit + +#ce-SidebarNavBlock + position: absolute + top: 0 + right: 15px + font-size: 20px + height: 35px + line-height: 35px + padding: 0 10px + border: none + color: #fff + background-color: $brand-primary
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/map_layers.scss b/app/assets/stylesheets/vendor/map_layers.scss deleted file mode 100644 index d093e3a4e..000000000 --- a/app/assets/stylesheets/vendor/map_layers.scss +++ /dev/null @@ -1,39 +0,0 @@ -p.after_map { - clear: both; -} - -#map { - position: relative; - float: right; - width: 400px; - height: 400px; - border: 1px solid gray; - margin-bottom: 20px !important; -} -.ce-MapExpandBlock { - position: absolute; - top: -22px; - background-color: $brand-primary; - border: none; - height: 21px; - right: -1px; - color: white; - padding: 2px 6px !important; -} -#map.ce-MapBlock-fullWidth { - width: 100% !important; - display: block; - float: inherit; -} -#ce-SidebarNavBlock { - position: absolute; - top: 0; - right: 15px; - font-size: 20px; - height: 35px; - line-height: 35px; - padding: 0 10px; - border: none; - color: #fff; - background-color: $brand-primary; -} diff --git a/app/assets/stylesheets/vendor/openlayers_framedCloud.css b/app/assets/stylesheets/vendor/openlayers_framedCloud.sass index e69de29bb..e69de29bb 100644 --- a/app/assets/stylesheets/vendor/openlayers_framedCloud.css +++ b/app/assets/stylesheets/vendor/openlayers_framedCloud.sass diff --git a/app/assets/stylesheets/vendor/openlayers_google.css b/app/assets/stylesheets/vendor/openlayers_google.css deleted file mode 100644 index 3ee757c47..000000000 --- a/app/assets/stylesheets/vendor/openlayers_google.css +++ /dev/null @@ -1,17 +0,0 @@ -.olLayerGoogleCopyright { - right: 3px; - bottom: 2px; - left: auto; -} -.olLayerGoogleV3.olLayerGoogleCopyright { - bottom: 0px; - right: 0px !important; -} -.olLayerGooglePoweredBy { - left: 2px; - bottom: 2px; -} -.olLayerGoogleV3.olLayerGooglePoweredBy { - bottom: 0px !important; -} - diff --git a/app/assets/stylesheets/vendor/openlayers_google.sass b/app/assets/stylesheets/vendor/openlayers_google.sass new file mode 100644 index 000000000..723f95f35 --- /dev/null +++ b/app/assets/stylesheets/vendor/openlayers_google.sass @@ -0,0 +1,15 @@ +.olLayerGoogleCopyright + right: 3px + bottom: 2px + left: auto + +.olLayerGoogleV3.olLayerGoogleCopyright + bottom: 0px + right: 0px !important + +.olLayerGooglePoweredBy + left: 2px + bottom: 2px + +.olLayerGoogleV3.olLayerGooglePoweredBy + bottom: 0px !important
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/openlayers_ie6-style.css b/app/assets/stylesheets/vendor/openlayers_ie6-style.css deleted file mode 100644 index 61e6ece57..000000000 --- a/app/assets/stylesheets/vendor/openlayers_ie6-style.css +++ /dev/null @@ -1,10 +0,0 @@ -.olControlZoomPanel div { - background-image: url( image-path('openlayers/zoom-panel-NOALPHA.png') ); -} -.olControlPanPanel div { - background-image: url( image-path('openlayers/pan-panel-NOALPHA.png') ); -} -.olControlEditingToolbar { - width: 200px; -} - diff --git a/app/assets/stylesheets/vendor/openlayers_ie6-style.sass b/app/assets/stylesheets/vendor/openlayers_ie6-style.sass new file mode 100644 index 000000000..0c1c1e8ee --- /dev/null +++ b/app/assets/stylesheets/vendor/openlayers_ie6-style.sass @@ -0,0 +1,8 @@ +.olControlZoomPanel div + background-image: url( image-path('openlayers/zoom-panel-NOALPHA.png') ) + +.olControlPanPanel div + background-image: url( image-path('openlayers/pan-panel-NOALPHA.png') ) + +.olControlEditingToolbar + width: 200px
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/openlayers_style.sass b/app/assets/stylesheets/vendor/openlayers_style.sass new file mode 100644 index 000000000..5f4dae692 --- /dev/null +++ b/app/assets/stylesheets/vendor/openlayers_style.sass @@ -0,0 +1,396 @@ +div.olMap + z-index: 0 + padding: 0 !important + margin: 0 !important + cursor: default + +div.olMapViewport + text-align: left + +div.olLayerDiv + -moz-user-select: none + -khtml-user-select: none + +.olLayerGoogleCopyright + left: 2px + bottom: 2px + +.olLayerGoogleV3.olLayerGoogleCopyright + right: auto !important + +.olLayerGooglePoweredBy + left: 2px + bottom: 15px + +.olLayerGoogleV3.olLayerGooglePoweredBy + bottom: 15px !important + +.olControlAttribution + font-size: smaller + right: 3px + bottom: 0.5em + position: absolute + display: block + +.olControlScale + right: 3px + bottom: 3em + display: block + position: absolute + font-size: smaller + +.olControlScaleLine + display: block + position: absolute + left: 10px + bottom: 15px + font-size: xx-small + +.olControlScaleLineBottom + border: 2px solid black + border-bottom: none + margin-top: -2px + text-align: center + +.olControlScaleLineTop + border: 2px solid black + border-top: none + text-align: center + +.olControlPermalink + right: 3px + bottom: 1.5em + display: block + position: absolute + font-size: smaller + +div.olControlMousePosition + bottom: 0em + right: 3px + display: block + position: absolute + font-family: Arial + font-size: smaller + +.olControlOverviewMapContainer + position: absolute + bottom: 0 + right: 0 + +.olControlOverviewMapElement + padding: 10px 18px 10px 10px + background-color: #00008B + -moz-border-radius: 1em 0 0 0 + +.olControlOverviewMapMinimizeButton + right: 0 + bottom: 80px + cursor: pointer + +.olControlOverviewMapMaximizeButton + right: 0 + bottom: 80px + cursor: pointer + +.olControlOverviewMapExtentRectangle + overflow: hidden + background-image: url( image-path('openlayers/blank.gif') ) + cursor: move + border: 2px dotted red + +.olControlOverviewMapRectReplacement + overflow: hidden + cursor: move + background-image: url( image-path('openlayers/overview_replacement.gif') ) + background-repeat: no-repeat + background-position: center + +.olLayerGeoRSSDescription + float: left + width: 100% + overflow: auto + font-size: 1.0em + +.olLayerGeoRSSClose + float: right + color: gray + font-size: 1.2em + margin-right: 6px + font-family: sans-serif + +.olLayerGeoRSSTitle + float: left + font-size: 1.2em + +.olPopup + border-radius: 5px + box-shadow: 0 0 6px #AAA + +.olPopupContent + padding: 5px + overflow: auto + +.olControlNavigationHistory + background-image: url( image-path('openlayers/navigation_history.png') ) + background-repeat: no-repeat + width: 24px + height: 24px + +.olControlNavigationHistoryPreviousItemActive + background-position: 0 0 + +.olControlNavigationHistoryPreviousItemInactive + background-position: 0 -24px + +.olControlNavigationHistoryNextItemActive + background-position: -24px 0 + +.olControlNavigationHistoryNextItemInactive + background-position: -24px -24px + +div.olControlSaveFeaturesItemActive + background-image: url( image-path('openlayers/save_features_on.png') ) + background-repeat: no-repeat + background-position: 0 1px + +div.olControlSaveFeaturesItemInactive + background-image: url( image-path('openlayers/save_features_off.png') ) + background-repeat: no-repeat + background-position: 0 1px + +.olHandlerBoxZoomBox + border: 2px solid red + position: absolute + background-color: white + font-size: 1px + opacity: 0.5 + filter: alpha(opacity=50) + +.olHandlerBoxSelectFeature + border: 2px solid blue + position: absolute + background-color: white + opacity: 0.5 + filter: alpha(opacity=50) + font-size: 1px + +.olControlPanPanel + top: 10px + left: 5px + + div + background-image: url(/assets/openlayers/pan-panel.png) + height: 18px + width: 18px + cursor: pointer + position: absolute + + .olControlPanNorthItemInactive + top: 0 + left: 9px + background-position: 0 0 + + .olControlPanSouthItemInactive + top: 36px + left: 9px + background-position: 18px 0 + + .olControlPanWestItemInactive + position: absolute + top: 18px + left: 0 + background-position: 0 18px + + .olControlPanEastItemInactive + top: 18px + left: 18px + background-position: 18px 18px + +.olControlZoomPanel + top: 71px + left: 14px + + div + background-image: url(/assets/openlayers/zoom-panel.png) + position: absolute + height: 18px + width: 18px + cursor: pointer + + .olControlZoomInItemInactive + top: 0 + left: 0 + background-position: 0 0 + + .olControlZoomToMaxExtentItemInactive + top: 18px + left: 0 + background-position: 0 -18px + + .olControlZoomOutItemInactive + top: 36px + left: 0 + background-position: 0 18px + +/* + * When a potential text is bigger than the image it move the image + * with some headers (closes #3154) + */ +.olControlPanZoomBar div + font-size: 1px + +.olPopupCloseBox + background: url( image-path('openlayers/close.gif') ) no-repeat + cursor: pointer + +.olFramedCloudPopupContent + padding: 5px + overflow: auto + +.olControlNoSelect + -moz-user-select: none + -khtml-user-select: none + +.olImageLoadError + background-color: pink + opacity: 0.5 + filter: alpha(opacity=50) + +/** + * Cursor styles + */ + +.olCursorWait + cursor: wait + +.olDragDown + cursor: move + +.olDrawBox + cursor: crosshair + +.olControlDragFeatureOver + cursor: move + +.olControlDragFeatureActive.olControlDragFeatureOver.olDragDown + cursor: -moz-grabbing + +/** + * Layer switcher + */ +.olControlLayerSwitcher + position: absolute + top: 25px + right: 0 + width: 20em + font-family: sans-serif + font-weight: bold + margin-top: 3px + margin-left: 3px + margin-bottom: 3px + font-size: smaller + color: white + background-color: transparent + + .layersDiv + padding-top: 5px + padding-left: 10px + padding-bottom: 5px + padding-right: 75px + background-color: darkblue + width: 100% + height: 100% + + .baseLbl, .dataLbl + margin-top: 3px + margin-left: 3px + margin-bottom: 3px + + .baseLayersDiv, .dataLayersDiv + padding-left: 10px + + .maximizeDiv, .minimizeDiv + top: 5px + right: 0 + cursor: pointer + +.olBingAttribution + color: #DDD + + &.road + color: #333 + +.olGoogleAttribution + color: #333 + + &.hybrid, &.satellite + color: #eee + +span.olGoogleAttribution + a + color: #77C + + &.hybrid a, &.satellite a + color: #eee + +/** + * Editing and navigation icons. + * (using the editing_tool_bar.png sprint image) + */ +.olControlNavToolbar, +.olControlEditingToolbar + margin: 5px 5px 0 0 + + div + background-image: url( image-path('openlayers/editing_tool_bar.png') ) + background-repeat: no-repeat + margin: 0 0 5px 5px + width: 24px + height: 22px + cursor: pointer + +/* positions */ +.olControlEditingToolbar + right: 0 + top: 0 + +.olControlNavToolbar + top: 295px + left: 9px + +/* layouts */ +.olControlEditingToolbar div + float: right + +/* individual controls */ +.olControlNavToolbar .olControlNavigationItemInactive, +.olControlEditingToolbar .olControlNavigationItemInactive + background-position: -103px -1px + +.olControlNavToolbar .olControlNavigationItemActive, +.olControlEditingToolbar .olControlNavigationItemActive + background-position: -103px -24px + +.olControlNavToolbar .olControlZoomBoxItemInactive + background-position: -128px -1px + +.olControlNavToolbar .olControlZoomBoxItemActive + background-position: -128px -24px + +.olControlEditingToolbar .olControlDrawFeaturePointItemInactive + background-position: -77px -1px + +.olControlEditingToolbar .olControlDrawFeaturePointItemActive + background-position: -77px -24px + +.olControlEditingToolbar .olControlDrawFeaturePathItemInactive + background-position: -51px -1px + +.olControlEditingToolbar .olControlDrawFeaturePathItemActive + background-position: -51px -24px + +.olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive + background-position: -26px -1px + +.olControlEditingToolbar .olControlDrawFeaturePolygonItemActive + background-position: -26px -24px
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/openlayers_style.scss b/app/assets/stylesheets/vendor/openlayers_style.scss deleted file mode 100644 index 68e60da55..000000000 --- a/app/assets/stylesheets/vendor/openlayers_style.scss +++ /dev/null @@ -1,438 +0,0 @@ -div.olMap { - z-index: 0; - padding: 0 !important; - margin: 0 !important; - cursor: default; -} - -div.olMapViewport { - text-align: left; -} - -div.olLayerDiv { - -moz-user-select: none; - -khtml-user-select: none; -} - -.olLayerGoogleCopyright { - left: 2px; - bottom: 2px; -} -.olLayerGoogleV3.olLayerGoogleCopyright { - right: auto !important; -} -.olLayerGooglePoweredBy { - left: 2px; - bottom: 15px; -} -.olLayerGoogleV3.olLayerGooglePoweredBy { - bottom: 15px !important; -} -.olControlAttribution { - font-size: smaller; - right: 3px; - bottom: 0.5em; - position: absolute; - display: block; -} -.olControlScale { - right: 3px; - bottom: 3em; - display: block; - position: absolute; - font-size: smaller; -} -.olControlScaleLine { - display: block; - position: absolute; - left: 10px; - bottom: 15px; - font-size: xx-small; -} -.olControlScaleLineBottom { - border: solid 2px black; - border-bottom: none; - margin-top:-2px; - text-align: center; -} -.olControlScaleLineTop { - border: solid 2px black; - border-top: none; - text-align: center; -} - -.olControlPermalink { - right: 3px; - bottom: 1.5em; - display: block; - position: absolute; - font-size: smaller; -} - -div.olControlMousePosition { - bottom: 0em; - right: 3px; - display: block; - position: absolute; - font-family: Arial; - font-size: smaller; -} - -.olControlOverviewMapContainer { - position: absolute; - bottom: 0; - right: 0; -} - -.olControlOverviewMapElement { - padding: 10px 18px 10px 10px; - background-color: #00008B; - -moz-border-radius: 1em 0 0 0; -} - -.olControlOverviewMapMinimizeButton { - right: 0; - bottom: 80px; - cursor: pointer; -} - -.olControlOverviewMapMaximizeButton { - right: 0; - bottom: 80px; - cursor: pointer; -} - -.olControlOverviewMapExtentRectangle { - overflow: hidden; - background-image: url( image-path('openlayers/blank.gif') ); - cursor: move; - border: 2px dotted red; -} -.olControlOverviewMapRectReplacement { - overflow: hidden; - cursor: move; - background-image: url( image-path('openlayers/overview_replacement.gif') ); - background-repeat: no-repeat; - background-position: center; -} - -.olLayerGeoRSSDescription { - float:left; - width:100%; - overflow:auto; - font-size:1.0em; -} -.olLayerGeoRSSClose { - float:right; - color:gray; - font-size:1.2em; - margin-right:6px; - font-family:sans-serif; -} -.olLayerGeoRSSTitle { - float:left;font-size:1.2em; -} - -.olPopup { - border-radius: 5px; - box-shadow: 0 0 6px #AAA; -} - -.olPopupContent { - padding:5px; - overflow: auto; -} - -.olControlNavigationHistory { - background-image: url( image-path('openlayers/navigation_history.png') ); - background-repeat: no-repeat; - width: 24px; - height: 24px; - -} -.olControlNavigationHistoryPreviousItemActive { - background-position: 0 0; -} -.olControlNavigationHistoryPreviousItemInactive { - background-position: 0 -24px; -} -.olControlNavigationHistoryNextItemActive { - background-position: -24px 0; -} -.olControlNavigationHistoryNextItemInactive { - background-position: -24px -24px; -} - -div.olControlSaveFeaturesItemActive { - background-image: url( image-path('openlayers/save_features_on.png') ); - background-repeat: no-repeat; - background-position: 0 1px; -} -div.olControlSaveFeaturesItemInactive { - background-image: url( image-path('openlayers/save_features_off.png') ); - background-repeat: no-repeat; - background-position: 0 1px; -} - -.olHandlerBoxZoomBox { - border: 2px solid red; - position: absolute; - background-color: white; - opacity: 0.50; - font-size: 1px; - filter: alpha(opacity=50); -} -.olHandlerBoxSelectFeature { - border: 2px solid blue; - position: absolute; - background-color: white; - opacity: 0.50; - font-size: 1px; - filter: alpha(opacity=50); -} - -.olControlPanPanel { - top: 10px; - left: 5px; -} - -.olControlPanPanel div { - background-image: url(/assets/openlayers/pan-panel.png); - height: 18px; - width: 18px; - cursor: pointer; - position: absolute; -} - -.olControlPanPanel .olControlPanNorthItemInactive { - top: 0; - left: 9px; - background-position: 0 0; -} -.olControlPanPanel .olControlPanSouthItemInactive { - top: 36px; - left: 9px; - background-position: 18px 0; -} -.olControlPanPanel .olControlPanWestItemInactive { - position: absolute; - top: 18px; - left: 0; - background-position: 0 18px; -} -.olControlPanPanel .olControlPanEastItemInactive { - top: 18px; - left: 18px; - background-position: 18px 18px; -} - -.olControlZoomPanel { - top: 71px; - left: 14px; -} - -.olControlZoomPanel div { - background-image: url(/assets/openlayers/zoom-panel.png); - position: absolute; - height: 18px; - width: 18px; - cursor: pointer; -} - -.olControlZoomPanel .olControlZoomInItemInactive { - top: 0; - left: 0; - background-position: 0 0; -} - -.olControlZoomPanel .olControlZoomToMaxExtentItemInactive { - top: 18px; - left: 0; - background-position: 0 -18px; -} - -.olControlZoomPanel .olControlZoomOutItemInactive { - top: 36px; - left: 0; - background-position: 0 18px; -} - -/* - * When a potential text is bigger than the image it move the image - * with some headers (closes #3154) - */ -.olControlPanZoomBar div { - font-size: 1px; -} - -.olPopupCloseBox { - background: url( image-path('openlayers/close.gif') ) no-repeat; - cursor: pointer; -} - -.olFramedCloudPopupContent { - padding: 5px; - overflow: auto; -} - -.olControlNoSelect { - -moz-user-select: none; - -khtml-user-select: none; -} - -.olImageLoadError { - background-color: pink; - opacity: 0.5; - filter: alpha(opacity=50); /* IE */ -} - -/** - * Cursor styles - */ - -.olCursorWait { - cursor: wait; -} -.olDragDown { - cursor: move; -} -.olDrawBox { - cursor: crosshair; -} -.olControlDragFeatureOver { - cursor: move; -} -.olControlDragFeatureActive.olControlDragFeatureOver.olDragDown { - cursor: -moz-grabbing; -} - -/** - * Layer switcher - */ -.olControlLayerSwitcher { - position: absolute; - top: 25px; - right: 0; - width: 20em; - font-family: sans-serif; - font-weight: bold; - margin-top: 3px; - margin-left: 3px; - margin-bottom: 3px; - font-size: smaller; - color: white; - background-color: transparent; -} - -.olControlLayerSwitcher .layersDiv { - padding-top: 5px; - padding-left: 10px; - padding-bottom: 5px; - padding-right: 75px; - background-color: darkblue; - width: 100%; - height: 100%; -} - -.olControlLayerSwitcher .layersDiv .baseLbl, -.olControlLayerSwitcher .layersDiv .dataLbl { - margin-top: 3px; - margin-left: 3px; - margin-bottom: 3px; -} - -.olControlLayerSwitcher .layersDiv .baseLayersDiv, -.olControlLayerSwitcher .layersDiv .dataLayersDiv { - padding-left: 10px; -} - -.olControlLayerSwitcher .maximizeDiv, -.olControlLayerSwitcher .minimizeDiv { - top: 5px; - right: 0; - cursor: pointer; -} - -.olBingAttribution { - color: #DDD; -} -.olBingAttribution.road { - color: #333; -} - -.olGoogleAttribution.hybrid, .olGoogleAttribution.satellite { - color: #EEE; -} -.olGoogleAttribution { - color: #333; -} -span.olGoogleAttribution a { - color: #77C; -} -span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a { - color: #EEE; -} - -/** - * Editing and navigation icons. - * (using the editing_tool_bar.png sprint image) - */ -.olControlNavToolbar , -.olControlEditingToolbar { - margin: 5px 5px 0 0; -} -.olControlNavToolbar div, -.olControlEditingToolbar div { - background-image: url( image-path('openlayers/editing_tool_bar.png') ); - background-repeat: no-repeat; - margin: 0 0 5px 5px; - width: 24px; - height: 22px; - cursor: pointer -} -/* positions */ -.olControlEditingToolbar { - right: 0; - top: 0; -} -.olControlNavToolbar { - top: 295px; - left: 9px; -} -/* layouts */ -.olControlEditingToolbar div { - float: right; -} -/* individual controls */ -.olControlNavToolbar .olControlNavigationItemInactive, -.olControlEditingToolbar .olControlNavigationItemInactive { - background-position: -103px -1px; -} -.olControlNavToolbar .olControlNavigationItemActive , -.olControlEditingToolbar .olControlNavigationItemActive { - background-position: -103px -24px; -} -.olControlNavToolbar .olControlZoomBoxItemInactive { - background-position: -128px -1px; -} -.olControlNavToolbar .olControlZoomBoxItemActive { - background-position: -128px -24px; -} -.olControlEditingToolbar .olControlDrawFeaturePointItemInactive { - background-position: -77px -1px; -} -.olControlEditingToolbar .olControlDrawFeaturePointItemActive { - background-position: -77px -24px; -} -.olControlEditingToolbar .olControlDrawFeaturePathItemInactive { - background-position: -51px -1px; -} -.olControlEditingToolbar .olControlDrawFeaturePathItemActive { - background-position: -51px -24px; -} -.olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive{ - background-position: -26px -1px; -} -.olControlEditingToolbar .olControlDrawFeaturePolygonItemActive { - background-position: -26px -24px; -} diff --git a/app/assets/stylesheets/vendor/pagination.sass b/app/assets/stylesheets/vendor/pagination.sass new file mode 100644 index 000000000..f87713797 --- /dev/null +++ b/app/assets/stylesheets/vendor/pagination.sass @@ -0,0 +1,25 @@ +.pagination + margin: 10px 0 0 20px + +.page_info + margin: 20px 0 0 0 + +.page_info + margin: 20px 0 0 0 + height: 30px + line-height: 30px + color: $gray + border-bottom: 1px solid #cdc9c0 + border-top: 1px solid #cdc9c0 + + .search + margin: 0 20px 0 10px + color: $brand_primary + font-weight: bold + + b + padding: 0.1em 0.25em + +.paginated_content + .row + margin-top: 15px
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/pagination.scss b/app/assets/stylesheets/vendor/pagination.scss deleted file mode 100644 index eb994f308..000000000 --- a/app/assets/stylesheets/vendor/pagination.scss +++ /dev/null @@ -1,34 +0,0 @@ -.pagination { - margin: 10px 0 0 20px; - -} - -.page_info{ - margin: 20px 0 0 0; -} - -.page_info { - margin: 20px 0 0 0; - height: 30px; - line-height: 30px; - color: $gray; - border-bottom: solid 1px #cdc9c0; - border-top: solid 1px #cdc9c0; - - .search{ - margin: 0 20px 0 10px; - color: $brand_primary; - font-weight:bold; - } - - b { - padding: 0.1em 0.25em; - } -} - -.paginated_content{ - - .row{ - margin-top: 15px; - } -}
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/simple_form.sass b/app/assets/stylesheets/vendor/simple_form.sass new file mode 100644 index 000000000..8f01ba389 --- /dev/null +++ b/app/assets/stylesheets/vendor/simple_form.sass @@ -0,0 +1,7 @@ +.simple_form + .help-inline + color: #cc0000 + + .form-actions + @extend .col-sm-offset-3 + @extend .col-sm-9
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/simple_form.scss b/app/assets/stylesheets/vendor/simple_form.scss deleted file mode 100644 index afac930c1..000000000 --- a/app/assets/stylesheets/vendor/simple_form.scss +++ /dev/null @@ -1,11 +0,0 @@ -.simple_form{ - - .help-inline{ - color:#cc0000; - } - - .form-actions{ - @extend .col-sm-offset-3; - @extend .col-sm-9; - } -}
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/token-input.css b/app/assets/stylesheets/vendor/token-input.css deleted file mode 100644 index 64b1493e1..000000000 --- a/app/assets/stylesheets/vendor/token-input.css +++ /dev/null @@ -1,134 +0,0 @@ -/* Example tokeninput style #1: Token vertical list*/ -ul.token-input-list { - overflow: hidden; - height: auto !important; - height: 1%; - width: 400px; - border: 1px solid #999; - cursor: text; - font-size: 12px; - font-family: Verdana, sans-serif; - z-index: 1061; - margin: 0; - padding: 0; - background-color: #fff; - list-style-type: none; - clear: left; -} - -ul.token-input-list li { - list-style-type: none; -} - -ul.token-input-list li input { - border: 0; - width: 350px; - padding: 3px 8px; - background-color: white; - -webkit-appearance: caret; -} - -ul.token-input-disabled, -ul.token-input-disabled li input { - background-color: #E8E8E8; -} - -ul.token-input-disabled li.token-input-token { - background-color: #D9E3CA; -} - -ul.token-input-disabled li.token-input-token span { - color: $gray; - cursor: default; -} - -ul.token-input-disabled li.token-input-token span.token-input-delete-token{ - display: none; -} - -li.token-input-token { - overflow: hidden; - height: auto !important; - height: 1%; - margin: 3px; - padding: 3px 5px; - background-color: $gray-lighter; - color: #000; - font-weight: bold; - cursor: default; - display: block; -} - -li.token-input-token p { - float: left; - padding: 0; - margin: 0; -} - -li.token-input-token span.token-input-delete-token { - float: right; - cursor: pointer; -} - -li.token-input-selected-token { - background-color: $brand-primary; - //color: $gray; -} - -li.token-input-selected-token span { - //color: #bbb; -} - -div.token-input-dropdown { - position: absolute; - width: 400px; - background-color: #fff; - overflow: hidden; - border-left: 1px solid #ccc; - border-right: 1px solid #ccc; - border-bottom: 1px solid #ccc; - cursor: default; - font-size: 12px; - font-family: Verdana, sans-serif; - z-index: 1061; -} - -div.token-input-dropdown p { - margin: 0; - padding: 5px; - font-weight: bold; - color: #777; -} - -div.token-input-dropdown ul { - margin: 0; - padding: 0; -} - -div.token-input-dropdown ul li { - background-color: #fff; - padding: 3px; - list-style-type: none; -} - -div.token-input-dropdown ul li.token-input-dropdown-item { - background-color: #fafafa; -} - -div.token-input-dropdown ul li.token-input-dropdown-item2 { - background-color: #fff; -} - -div.token-input-dropdown ul li em { - font-weight: bold; - font-style: normal; -} - -div.token-input-dropdown ul li.token-input-selected-dropdown-item { - background-color: $gray-lighter; -} - -ul.token-input-list .info{ - font-size: 0.8em; - color: $gray; -}
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/token-input.sass b/app/assets/stylesheets/vendor/token-input.sass new file mode 100644 index 000000000..a45220365 --- /dev/null +++ b/app/assets/stylesheets/vendor/token-input.sass @@ -0,0 +1,113 @@ +/* Example tokeninput style #1: Token vertical list*/ +ul.token-input-list + overflow: hidden + height: auto !important + height: 1% + width: 400px + border: 1px solid #999 + cursor: text + font-size: 12px + font-family: Verdana, sans-serif + z-index: 1061 + margin: 0 + padding: 0 + background-color: #fff + list-style-type: none + clear: left + + li + list-style-type: none + + input + border: 0 + width: 350px + padding: 3px 8px + background-color: white + -webkit-appearance: caret + +ul.token-input-disabled, +ul.token-input-disabled li input + background-color: #E8E8E8 + +ul.token-input-disabled li.token-input-token + background-color: #D9E3CA + + span + color: $gray + cursor: default + + &.token-input-delete-token + display: none + +li.token-input-token + overflow: hidden + height: auto !important + height: 1% + margin: 3px + padding: 3px 5px + background-color: $gray-lighter + color: #000 + font-weight: bold + cursor: default + display: block + + p + float: left + padding: 0 + margin: 0 + + span.token-input-delete-token + float: right + cursor: pointer + +li.token-input-selected-token + background-color: $brand-primary + //color: $gray + + span + //color: #bbb + +div.token-input-dropdown + position: absolute + width: 400px + background-color: #fff + overflow: hidden + border-left: 1px solid #ccc + border-right: 1px solid #ccc + border-bottom: 1px solid #ccc + cursor: default + font-size: 12px + font-family: Verdana, sans-serif + z-index: 1061 + + p + margin: 0 + padding: 5px + font-weight: bold + color: #777 + + ul + margin: 0 + padding: 0 + + li + background-color: #fff + padding: 3px + list-style-type: none + + &.token-input-dropdown-item + background-color: #fafafa + + &.token-input-dropdown-item2 + background-color: #fff + + em + font-weight: bold + font-style: normal + + &.token-input-selected-dropdown-item + background-color: $gray-lighter + +ul.token-input-list .info + font-size: 0.8em + color: $gray
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/typeahead.sass b/app/assets/stylesheets/vendor/typeahead.sass new file mode 100644 index 000000000..00ecfc620 --- /dev/null +++ b/app/assets/stylesheets/vendor/typeahead.sass @@ -0,0 +1,43 @@ +.twitter-typeahead .tt-query, +.twitter-typeahead .tt-hint + margin-bottom: 0 + +.tt-dropdown-menu + min-width: 160px + margin-top: 2px + padding: 5px 0 + background-color: #fff + border: 1px solid #ccc + border: 1px solid rgba(0,0,0,.2) + *border-right-width: 2px + *border-bottom-width: 2px + -webkit-border-radius: 6px + -moz-border-radius: 6px + border-radius: 6px + -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2) + -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2) + box-shadow: 0 5px 10px rgba(0,0,0,.2) + -webkit-background-clip: padding-box + -moz-background-clip: padding + background-clip: padding-box + +.tt-suggestion + display: block + padding: 3px 20px + + &.tt-is-under-cursor + color: #fff + background-color: #0081c2 + background-image: -moz-linear-gradient(top, #0088cc, #0077b3) + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)) + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3) + background-image: -o-linear-gradient(top, #0088cc, #0077b3) + background-image: linear-gradient(to bottom, #0088cc, #0077b3) + background-repeat: repeat-x + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0) + + &.tt-is-under-cursor a + color: #fff + + p + margin: 0
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/typeahead.scss b/app/assets/stylesheets/vendor/typeahead.scss deleted file mode 100644 index 56653de9d..000000000 --- a/app/assets/stylesheets/vendor/typeahead.scss +++ /dev/null @@ -1,49 +0,0 @@ -.twitter-typeahead .tt-query, -.twitter-typeahead .tt-hint { - margin-bottom: 0; -} - -.tt-dropdown-menu { - min-width: 160px; - margin-top: 2px; - padding: 5px 0; - background-color: #fff; - border: 1px solid #ccc; - border: 1px solid rgba(0,0,0,.2); - *border-right-width: 2px; - *border-bottom-width: 2px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); - -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2); - box-shadow: 0 5px 10px rgba(0,0,0,.2); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; -} - -.tt-suggestion { - display: block; - padding: 3px 20px; -} - -.tt-suggestion.tt-is-under-cursor { - color: #fff; - background-color: #0081c2; - background-image: -moz-linear-gradient(top, #0088cc, #0077b3); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); - background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); - background-image: -o-linear-gradient(top, #0088cc, #0077b3); - background-image: linear-gradient(to bottom, #0088cc, #0077b3); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0) -} - -.tt-suggestion.tt-is-under-cursor a { - color: #fff; -} - -.tt-suggestion p { - margin: 0; -}
\ No newline at end of file diff --git a/app/controllers/line_referentials_controller.rb b/app/controllers/line_referentials_controller.rb index bcc288a2c..e28019eed 100644 --- a/app/controllers/line_referentials_controller.rb +++ b/app/controllers/line_referentials_controller.rb @@ -8,4 +8,8 @@ class LineReferentialsController < BreadcrumbController current_organisation end + def line_referential_params + params.require(:line_referential).permit(:sync_interval) + end + end diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb index 8c14de06d..71e33630d 100644 --- a/app/controllers/lines_controller.rb +++ b/app/controllers/lines_controller.rb @@ -79,7 +79,7 @@ class LinesController < BreadcrumbController end @q = line_referential.lines.search(params[:q]) - @lines ||= @q.result(:distinct => true).order(:number).paginate(:page => params[:page]).includes([:network, :company]) + @lines ||= @q.result(:distinct => true).where(deactivated: false).order(:number).paginate(:page => params[:page]).includes([:network, :company]) end alias_method :line_referential, :parent diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index 34ba37380..28a95c784 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -27,6 +27,15 @@ class ReferentialsController < BreadcrumbController end end + def archive + referential.archive! + redirect_to referential_path, notice: t('notice.referential.archived') + end + def unarchive + referential.unarchive! + redirect_to referential_path, notice: t('notice.referential.unarchived') + end + protected alias_method :referential, :resource @@ -53,7 +62,19 @@ class ReferentialsController < BreadcrumbController private def referential_params - params.require(:referential).permit( :id, :name, :slug, :prefix, :time_zone, :upper_corner, :lower_corner, :organisation_id, :projection_type, :data_format ) + params.require(:referential).permit( + :id, + :name, + :slug, + :prefix, + :time_zone, + :upper_corner, + :lower_corner, + :organisation_id, + :projection_type, + :data_format, + :archived_at + ) end -end +end
\ No newline at end of file diff --git a/app/helpers/stop_areas_helper.rb b/app/helpers/stop_areas_helper.rb index a255a2038..db8d40920 100644 --- a/app/helpers/stop_areas_helper.rb +++ b/app/helpers/stop_areas_helper.rb @@ -12,7 +12,7 @@ module StopAreasHelper end def genealogical_title - return t(".stop_areas.genealogical.genealogical_routing") if @stop_area.stop_area_type == 'itl' + return t("stop_areas.genealogical.genealogical_routing") if @stop_area.stop_area_type == 'itl' t("stop_areas.genealogical.genealogical") end diff --git a/app/models/chouette/company.rb b/app/models/chouette/company.rb index 8ddd4c37d..7b96e875e 100644 --- a/app/models/chouette/company.rb +++ b/app/models/chouette/company.rb @@ -1,5 +1,8 @@ -class Chouette::Company < Chouette::TridentActiveRecord +class Chouette::Company < Chouette::ActiveRecord include CompanyRestrictions + include DefaultNetexAttributesSupport + include LineReferentialSupport + has_many :lines validates_format_of :registration_number, :with => %r{\A[0-9A-Za-z_-]+\Z}, :allow_nil => true, :allow_blank => true diff --git a/app/models/chouette/group_of_line.rb b/app/models/chouette/group_of_line.rb index 0b91f3442..d954c6699 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 DefaultAttributesSupport + include DefaultNetexAttributesSupport include GroupOfLineRestrictions include LineReferentialSupport diff --git a/app/models/chouette/line.rb b/app/models/chouette/line.rb index 351cb0b0e..4a4115cc2 100644 --- a/app/models/chouette/line.rb +++ b/app/models/chouette/line.rb @@ -1,5 +1,5 @@ class Chouette::Line < Chouette::ActiveRecord - include DefaultAttributesSupport + include DefaultNetexAttributesSupport include LineRestrictions include LineReferentialSupport diff --git a/app/models/chouette/netex_object_id.rb b/app/models/chouette/netex_object_id.rb new file mode 100644 index 000000000..07d862992 --- /dev/null +++ b/app/models/chouette/netex_object_id.rb @@ -0,0 +1,40 @@ +class Chouette::NetexObjectId < String + + def valid? + parts.present? + end + alias_method :objectid?, :valid? + + @@format = /^([A-Za-z_]+):([0-9A-Za-z_]+):([A-Za-z]+):([0-9A-Za-z_-]+)$/ + cattr_reader :format + + def parts + match(format).try(:captures) + end + + def provider_id + parts.try(:first) + end + + def system_id + parts.try(:second) + end + + def object_type + parts.try(:third) + end + + 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 + + def self.new(string) + string ||= "" + self === string ? string : super + end + +end diff --git a/app/models/chouette/network.rb b/app/models/chouette/network.rb index c8926506c..690c39344 100644 --- a/app/models/chouette/network.rb +++ b/app/models/chouette/network.rb @@ -1,5 +1,7 @@ -class Chouette::Network < Chouette::TridentActiveRecord +class Chouette::Network < Chouette::ActiveRecord + include DefaultNetexAttributesSupport include NetworkRestrictions + include LineReferentialSupport # FIXME http://jira.codehaus.org/browse/JRUBY-6358 self.primary_key = "id" diff --git a/app/models/concerns/default_netex_attributes_support.rb b/app/models/concerns/default_netex_attributes_support.rb new file mode 100644 index 000000000..89007f2a2 --- /dev/null +++ b/app/models/concerns/default_netex_attributes_support.rb @@ -0,0 +1,81 @@ +module DefaultNetexAttributesSupport + extend ActiveSupport::Concern + + included do + before_validation :prepare_auto_columns + + validates_presence_of :objectid + validates_uniqueness_of :objectid + validates_numericality_of :object_version + validate :objectid_format_compliance + + 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 + Chouette::NetexObjectId.new read_attribute(:objectid) + end + + def prepare_auto_columns + if object_version.nil? + self.object_version = 1 + else + self.object_version += 1 + end + self.creation_time = Time.now + self.creator_id = 'chouette' + end + + def fix_uniq_objectid + base_objectid = objectid.rpartition(":").first + self.objectid = "#{base_objectid}:#{id}" + if !valid? + base_objectid="#{objectid}_" + cnt=1 + while !valid? + self.objectid = "#{base_objectid}#{cnt}" + cnt += 1 + end + end + + end + + def objectid_format_compliance + if !objectid.valid? + errors.add :objectid, I18n.t("activerecord.errors.models.trident.invalid_object_id", type: self.class.object_id_key) + end + end + + def uniq_objectid + # OPTIMIZEME + i = 0 + baseobjectid = objectid + while self.class.exists?(:objectid => objectid) + i += 1 + self.objectid = baseobjectid+"_"+i.to_s + end + end + + def default_values + self.object_version ||= 1 + end + + def timestamp_attributes_for_update #:nodoc: + [:creation_time] + end + + def timestamp_attributes_for_create #:nodoc: + [:creation_time] + end + +end diff --git a/app/models/line_referential.rb b/app/models/line_referential.rb index 9c6f324e8..85464f5af 100644 --- a/app/models/line_referential.rb +++ b/app/models/line_referential.rb @@ -5,10 +5,19 @@ class LineReferential < ActiveRecord::Base has_many :lines, class_name: 'Chouette::Line' has_many :group_of_lines, class_name: 'Chouette::GroupOfLine' + has_one :line_referential_sync + def add_member(organisation, options = {}) attributes = options.merge organisation: organisation line_referential_memberships.build attributes end validates :name, presence: true + validates :sync_interval, presence: true + # need to define precise validation rules + validates_inclusion_of :sync_interval, :in => 1..30 + + def operating_lines + lines.where(deactivated: false) + end end diff --git a/app/models/line_referential_sync.rb b/app/models/line_referential_sync.rb new file mode 100644 index 000000000..763936f3b --- /dev/null +++ b/app/models/line_referential_sync.rb @@ -0,0 +1,10 @@ +class LineReferentialSync < ActiveRecord::Base + belongs_to :line_referential + + has_many :line_sync_operations, dependent: :destroy + + def record_status status, message + line_sync_operations << LineSyncOperation.new(status: status, message: message) + line_sync_operations.first.destroy while line_sync_operations.count > 30 + end +end diff --git a/app/models/line_sync_operation.rb b/app/models/line_sync_operation.rb new file mode 100644 index 000000000..2564ae99c --- /dev/null +++ b/app/models/line_sync_operation.rb @@ -0,0 +1,3 @@ +class LineSyncOperation < ActiveRecord::Base + belongs_to :line_referential_sync +end diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 9d6e92825..fc5e2699e 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -21,4 +21,34 @@ class Organisation < ActiveRecord::Base def add_rule_parameter_set RuleParameterSet.default_for_all_modes( self).save end + + def self.portail_api_request + conf = Rails.application.config.try(:stif_portail_api) + raise 'Rails.application.config.stif_portail_api settings is not defined' unless conf + + conn = Faraday.new(:url => conf[:url]) do |c| + c.headers['Authorization'] = "Token token=\"#{conf[:key]}\"" + c.adapter Faraday.default_adapter + end + + resp = conn.get '/api/v1/organizations' + if resp.status == 200 + JSON.parse resp.body + else + raise "Error on api request status : #{resp.status} => #{resp.body}" + end + end + + def self.portail_sync + self.portail_api_request.each do |el| + Organisation.find_or_create_by(code: el['code']).tap do |org| + org.name = el['name'] + if org.changed? + org.synced_at = Time.now + org.save + puts "✓ Organisation #{org.name} has been updated" unless Rails.env.test? + end + end + end + end end diff --git a/app/models/referential.rb b/app/models/referential.rb index b41a7a434..d4bdc8374 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -207,4 +207,19 @@ class Referential < ActiveRecord::Base bounds = read_attribute(:bounds) GeoRuby::SimpleFeatures::Geometry.from_ewkt(bounds.present? ? bounds : default_bounds ).envelope end -end + + # Archive + def archived? + archived_at != nil + end + + def archive! + # self.archived = true + touch :archived_at + end + def unarchive! + # self.archived = false + update_column :archived_at, nil + end + +end
\ No newline at end of file diff --git a/app/models/user.rb b/app/models/user.rb index e00b6a35a..fa4c77d96 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,9 +5,8 @@ class User < ActiveRecord::Base @@authentication_type = "#{Rails.application.config.chouette_authentication_settings[:type]}_authenticatable".to_sym cattr_reader :authentication_type - devise :invitable, :registerable, :validatable, - :recoverable, :rememberable, :trackable, - :confirmable, :async, authentication_type + devise :invitable, :registerable, :validatable, :lockable, + :recoverable, :rememberable, :trackable, :async, authentication_type # FIXME https://github.com/nbudin/devise_cas_authenticatable/issues/53 # Work around :validatable, when database_authenticatable is diabled. @@ -30,14 +29,52 @@ class User < ActiveRecord::Base after_destroy :check_destroy_organisation def cas_extra_attributes=(extra_attributes) - extra_attributes.each do |name, value| - # case name.to_sym - # Extra attributes - # when :fullname - # self.fullname = value - # when :email - # self.email = value - # end + extra = extra_attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} + self.name = extra[:full_name] + self.email = extra[:email] + + self.organisation = Organisation.find_or_create_by(code: extra[:organisation_code]).tap do |org| + org.name = extra[:organisation_name] + org.synced_at = Time.now + end + end + + def self.portail_api_request + conf = Rails.application.config.try(:stif_portail_api) + raise 'Rails.application.config.stif_portail_api settings is not defined' unless conf + + conn = Faraday.new(:url => conf[:url]) do |c| + c.headers['Authorization'] = "Token token=\"#{conf[:key]}\"" + c.adapter Faraday.default_adapter + end + + resp = conn.get '/api/v1/users' + if resp.status == 200 + JSON.parse resp.body + else + raise "Error on api request status : #{resp.status} => #{resp.body}" + end + end + + def self.portail_sync + self.portail_api_request.each do |el| + User.find_or_create_by(username: el['username']).tap do |user| + user.name = "#{el['firstname']} #{el['lastname']}" + user.email = el['email'] + user.locked_at = el['locked_at'] + + # Set organisation + user.organisation = Organisation.find_or_create_by(code: el['organization_code']).tap do |org| + org.name = el['organization_name'] + org.synced_at = Time.now + end + + if user.changed? + user.synced_at = Time.now + user.save + puts "✓ user #{user.username} has been updated" unless Rails.env.test? + end + end end end @@ -49,5 +86,4 @@ class User < ActiveRecord::Base organisation.destroy end end - end diff --git a/app/views/access_link_pairs/_access_link_pair.html.erb b/app/views/access_link_pairs/_access_link_pair.html.erb deleted file mode 100644 index 3e0d8a4fe..000000000 --- a/app/views/access_link_pairs/_access_link_pair.html.erb +++ /dev/null @@ -1,56 +0,0 @@ -<tr> - <td> - <div class="link"> - <div class="access_point"> - <%= link_to([@referential, @stop_area, access_link_pair.access_point]) do %> - <%= image_tag "map/access_" + access_link_pair.access_point.access_point_type + ".png" %><span><%= access_link_pair.access_point.name %></span> - <% end %> - </div> - <div class="info"> - <%= t("access_types.label.#{access_link_pair.access_point.access_point_type}") %> - </div> - </div> - </td> - <td> - <% if access_link_pair.out_valid? %> - <% if access_link_pair.out_exists? %> - <%= link_to(referential_access_point_access_link_path(@referential, access_link_pair.access_point,:access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'stop_area_to_access_point'})) do %> - <%= image_tag "icons/green_left_arrow.png" %> - <% end %> - <% else %> - <%= link_to(new_referential_access_point_access_link_path(@referential, access_link_pair.access_point, :access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'stop_area_to_access_point'})) do %> - <%= image_tag "icons/gray_left_arrow.png" %> - <% end %> - <% end %> - <% else %> - <%= image_tag "icons/disabled_left_arrow.png" %> - <% end %> - </td> - <td> - <% if access_link_pair.in_valid? %> - <% if access_link_pair.in_exists? %> - <%= link_to(referential_access_point_access_link_path(@referential, access_link_pair.access_point, access_link_pair.from_access_point)) do %> - <%= image_tag "icons/green_right_arrow.png" %> - <% end %> - <% else %> - <%= link_to(new_referential_access_point_access_link_path(@referential, access_link_pair.access_point, :access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'access_point_to_stop_area'})) do %> - <%= image_tag "icons/gray_right_arrow.png" %> - <% end %> - <% end %> - <% else %> - <%= image_tag "icons/disabled_right_arrow.png" %> - <% end %> - </td> - <td> - <div class="link"> - <div class="stop_area"> - <%= link_to([@referential, access_link_pair.stop_area]) do %> - <%= image_tag "map/" + access_link_pair.stop_area.stop_area_type + ".png" %><span><%= access_link_pair.stop_area.name %></span> - <% end %> - </div> - <div class="info"> - <%= t("area_types.label.#{access_link_pair.stop_area.stop_area_type}") %> - </div> - </div> - </td> -</tr> diff --git a/app/views/access_link_pairs/_access_link_pair.html.slim b/app/views/access_link_pairs/_access_link_pair.html.slim new file mode 100644 index 000000000..05fdd3446 --- /dev/null +++ b/app/views/access_link_pairs/_access_link_pair.html.slim @@ -0,0 +1,40 @@ +tr + td + .link + .access_point + = link_to([@referential, @stop_area, access_link_pair.access_point]) do + = image_tag "map/access_#{access_link_pair.access_point.access_point_type}.png" + span = access_link_pair.access_point.name + .info + = t("access_types.label.#{access_link_pair.access_point.access_point_type}") + td + - if access_link_pair.out_valid? + - if access_link_pair.out_exists? + = link_to(referential_access_point_access_link_path(@referential, access_link_pair.access_point, :access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'stop_area_to_access_point'})) do + = image_tag "icons/green_left_arrow.png" + - else + = link_to(new_referential_access_point_access_link_path(@referential, access_link_pair.access_point, :access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'stop_area_to_access_point'})) do + = image_tag "icons/gray_left_arrow.png" + + - else + = image_tag "icons/disabled_left_arrow.png" + + td + - if access_link_pair.in_valid? + - if access_link_pair.in_exists? + = link_to(referential_access_point_access_link_path(@referential, access_link_pair.access_point, access_link_pair.from_access_point)) do + = image_tag "icons/green_right_arrow.png" + - else + = link_to(new_referential_access_point_access_link_path(@referential, access_link_pair.access_point, :access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'access_point_to_stop_area'})) do + = image_tag "icons/gray_right_arrow.png" + + - else + = image_tag "icons/disabled_right_arrow.png" + td + .link + .stop_area + = link_to([@referential, access_link_pair.stop_area]) do + = image_tag "map/#{access_link_pair.stop_area.stop_area_type}.png" + span = access_link_pair.stop_area.name + .info + = t("area_types.label.#{access_link_pair.stop_area.stop_area_type}")
\ No newline at end of file diff --git a/app/views/access_links/_form.html.erb b/app/views/access_links/_form.html.erb deleted file mode 100644 index d6c0c603e..000000000 --- a/app/views/access_links/_form.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -<%= semantic_form_for [@referential,@access_point,@access_link] do |form| %> - <%= form.inputs do %> - <%= form.input :access_point_id , :as => :hidden %> - <%= form.input :stop_area_id , :as => :hidden %> - <%= form.input :link_orientation_type , :as => :hidden%> - <%= form.input :name %> - <%= form.input :access_link_type, :as => :select, :collection => Chouette::AccessLink.access_link_types, :include_blank => true, :member_label => Proc.new { |type| t("connection_link_types.label.#{type}") } %> - <%= form.input :comment %> - <%= form.input :link_distance %> - <%= form.input :mobility_restricted_suitability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <%= form.input :stairs_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <%= form.input :lift_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <%= form.input :objectid, :required => !@access_link.new_record?, :input_html => { :title => t("formtastic.titles.access_link.objectid")} %> - <%= form.inputs :name => t('access_links.show.durations') do %> - <%= form.input :default_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :label => @access_link.human_attribute_name("default_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> - <%= form.input :frequent_traveller_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :include_seconds => true, :label => @access_link.human_attribute_name("frequent_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> - <%= form.input :occasional_traveller_duration, :as => :extended_time_picker, :size => 8, :include_seconds => true, :label => @access_link.human_attribute_name("occasional_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> - <%= form.input :mobility_restricted_traveller_duration, :as => :extended_time_picker,:size => 8, :include_seconds => true, :label => @access_link.human_attribute_name("mobility_restricted_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> - <% end %> - <% end %> - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> diff --git a/app/views/access_links/_form.html.slim b/app/views/access_links/_form.html.slim new file mode 100644 index 000000000..463cdf9e3 --- /dev/null +++ b/app/views/access_links/_form.html.slim @@ -0,0 +1,24 @@ += semantic_form_for [@referential,@access_point,@access_link] do |form| + + = form.inputs do + = form.input :access_point_id , as: :hidden + = form.input :stop_area_id , as: :hidden + = form.input :link_orientation_type , as: :hidden + = form.input :name + = form.input :access_link_type, as: :select, collection: Chouette::AccessLink.access_link_types, include_blank: true, member_label: Proc.new { |type| t("connection_link_types.label.#{type}") } + = form.input :comment + = form.input :link_distance + = form.input :mobility_restricted_suitability, as: :select, collection: [[t("true"), true], [t("false"), false]], include_blank: true + = form.input :stairs_availability, as: :select, collection: [[t("true"), true], [t("false"), false]], include_blank: true + = form.input :lift_availability, as: :select, collection: [[t("true"), true], [t("false"), false]], include_blank: true + = form.input :objectid, required: !@access_link.new_record?, input_html: { :title => t("formtastic.titles.access_link.objectid")} + + = form.inputs :name => t('access_links.show.durations') do + = form.input :default_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :label => @access_link.human_attribute_name("default_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } + = form.input :frequent_traveller_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :include_seconds => true, :label => @access_link.human_attribute_name("frequent_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } + = form.input :occasional_traveller_duration, :as => :extended_time_picker, :size => 8, :include_seconds => true, :label => @access_link.human_attribute_name("occasional_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } + = form.input :mobility_restricted_traveller_duration, :as => :extended_time_picker,:size => 8, :include_seconds => true, :label => @access_link.human_attribute_name("mobility_restricted_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/access_links/edit.html.erb b/app/views/access_links/edit.html.erb deleted file mode 100644 index c954989f1..000000000 --- a/app/views/access_links/edit.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t("access_links.edit.title_#{@orientation}", :access_point => @access_point.name, :stop_area => @stop_area.name ) %> - - -<%= render "form" %> diff --git a/app/views/access_links/edit.html.slim b/app/views/access_links/edit.html.slim new file mode 100644 index 000000000..c25f46432 --- /dev/null +++ b/app/views/access_links/edit.html.slim @@ -0,0 +1,2 @@ += title_tag t("access_links.edit.title_#{@orientation}", access_point: @access_point.name, stop_area: @stop_area.name ) += render 'form'
\ No newline at end of file diff --git a/app/views/access_links/new.html.erb b/app/views/access_links/new.html.erb deleted file mode 100644 index db9a611a5..000000000 --- a/app/views/access_links/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t("access_links.new.title_#{@orientation}", :access_point => @access_point.name, :stop_area => @stop_area.name ) %> - -<%= render "form" %> diff --git a/app/views/access_links/new.html.slim b/app/views/access_links/new.html.slim new file mode 100644 index 000000000..e99f8f9de --- /dev/null +++ b/app/views/access_links/new.html.slim @@ -0,0 +1,2 @@ += title_tag t("access_links.new.title_#{@orientation}", access_point: @access_point.name, stop_area: @stop_area.name ) += render 'form'
\ No newline at end of file diff --git a/app/views/access_links/show.html.erb b/app/views/access_links/show.html.erb deleted file mode 100644 index 54f89297e..000000000 --- a/app/views/access_links/show.html.erb +++ /dev/null @@ -1,84 +0,0 @@ -<%= title_tag t('access_links.show.title', :access_link => @access_link.name ) %> - -<div class="access_link_show"> - <%= @map.to_html %> - - <div class="summary"> - <p> - <label><%= @access_link.human_attribute_name("access_link_type") %>: </label> - <% if @access_link.access_link_type.present? %> - <%= t("connection_link_types.label.#{@access_link.access_link_type}") %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @access_link.human_attribute_name("comment") %>: </label> - <%= @access_link.comment %> - </p> - <p> - <label><%= @access_link.human_attribute_name("link_distance") %>: </label> - <%= @access_link.link_distance %> - </p> - <p> - <label><%= t('access_links.show.durations') %> </label> - </p> - <p> - <label class='duration'><%= @access_link.human_attribute_name("default_duration") %>: </label> - <% if (@access_link.default_duration.present?) %> - <%= @access_link.default_duration.strftime('%Hh %Mm %Ss') %> - <% end %> - </p> - <p> - <label class='duration'><%= @access_link.human_attribute_name("frequent_traveller_duration") %>: </label> - <% if (@access_link.frequent_traveller_duration.present?) %> - <%= @access_link.frequent_traveller_duration.strftime('%Hh %Mm %Ss') %> - <% end %> - </p> - <p> - <label class='duration'><%= @access_link.human_attribute_name("occasional_traveller_duration") %>: </label> - <% if (@access_link.occasional_traveller_duration.present?) %> - <%= @access_link.occasional_traveller_duration.strftime('%Hh %Mm %Ss') %> - <% end %> - </p> - <p> - <label class='duration'><%= @access_link.human_attribute_name("mobility_restricted_traveller_duration") %>: </label> - <% if (!@access_link.mobility_restricted_traveller_duration.nil?) %> - <%= @access_link.mobility_restricted_traveller_duration.strftime('%Hh %Mm %Ss') %> - <% end %> - </p> - <p> - <label><%= @access_link.human_attribute_name("mobility_restricted_suitability") %>: </label> - <% if (!@access_link.mobility_restricted_suitability.nil?) %> - <%= t((@access_link.mobility_restricted_suitability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @access_link.human_attribute_name("stairs_availability") %>: </label> - <% if (!@access_link.stairs_availability.nil?) %> - <%= t((@access_link.stairs_availability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @access_link.human_attribute_name("lift_availability") %>: </label> - <% if (!@access_link.lift_availability.nil?) %> - <%= t((@access_link.lift_availability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('access_links.actions.edit'), edit_referential_access_point_access_link_path(@referential, @access_link.access_point, @access_link), :class => "edit" %></li> - <li><%= link_to t('access_links.actions.destroy'), referential_access_point_access_link_path(@referential, @access_link.access_point, @access_link), :method => :delete, :data => {:confirm => t('access_links.actions.destroy_confirm')}, :class => "remove" %></li> - <br> -</ul> - <%= creation_tag(@access_link) %> -<% end %> diff --git a/app/views/access_links/show.html.slim b/app/views/access_links/show.html.slim new file mode 100644 index 000000000..a7e296dde --- /dev/null +++ b/app/views/access_links/show.html.slim @@ -0,0 +1,74 @@ += title_tag t('access_links.show.title', access_link: @access_link.name ) + +.access_link_show + = @map.to_html + + .summary + p + label = "#{@access_link.human_attribute_name('access_link_type')} : " + - if @access_link.access_link_type.present? + = t("connection_link_types.label.#{@access_link.access_link_type}") + - else + =t('unknown') + + p + label = "#{@access_link.human_attribute_name('comment')} : " + = @access_link.comment + + p + label = "#{@access_link.human_attribute_name('link_distance')} : " + = @access_link.link_distance + + p + label = t('access_links.show.durations') + + p + label.duration = "#{@access_link.human_attribute_name('default_duration')} : " + - if (@access_link.default_duration.present?) + = @access_link.default_duration.strftime('%Hh %Mm %Ss') + + p + label.duration = "#{@access_link.human_attribute_name('frequent_traveller_duration')} : " + - if @access_link.frequent_traveller_duration.present? + = @access_link.frequent_traveller_duration.strftime('%Hh %Mm %Ss') + + p + label.duration = "#{@access_link.human_attribute_name('occasional_traveller_duration')} : " + - if @access_link.occasional_traveller_duration.present? + = @access_link.occasional_traveller_duration.strftime('%Hh %Mm %Ss') + + p + label.duration = "#{@access_link.human_attribute_name('mobility_restricted_traveller_duration')} : " + - if !@access_link.mobility_restricted_traveller_duration.nil? + = @access_link.mobility_restricted_traveller_duration.strftime('%Hh %Mm %Ss') + + p + label = "#{@access_link.human_attribute_name('mobility_restricted_suitability')}: " + - if !@access_link.mobility_restricted_suitability.nil?) + = t((@access_link.mobility_restricted_suitability == true).to_s) + - else + = t('unknown') + + p + label = "#{@access_link.human_attribute_name('stairs_availability')} : " + - if !@access_link.stairs_availability.nil? + = t((@access_link.stairs_availability == true).to_s) + - else + = t('unknown') + + p + label = "#{@access_link.human_attribute_name('lift_availability')} : " + - if !@access_link.lift_availability.nil? + = t((@access_link.lift_availability == true).to_s) + - else + = t('unknown') + +- content_for :sidebar do + ul.actions + li + = link_to t('access_links.actions.edit'), edit_referential_access_point_access_link_path(@referential, @access_link.access_point, @access_link), class: 'edit' + li + = link_to t('access_links.actions.destroy'), referential_access_point_access_link_path(@referential, @access_link.access_point, @access_link), method: :delete, data: {:confirm => t('access_links.actions.destroy_confirm')}, class: 'remove' + br + + = creation_tag(@access_link)
\ No newline at end of file diff --git a/app/views/access_links/show.kml.erb b/app/views/access_links/show.kml.erb deleted file mode 100644 index 25e4351b8..000000000 --- a/app/views/access_links/show.kml.erb +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% if @access_link.geometry %> - <Placemark id="route_<%= @access_link.id %>" > - <name><%= @access_link.name %></name> - <%= @access_link.geometry.kml_representation.html_safe %> - </Placemark> - <Placemark id="<%= @access_link.access_point.id %>" > - <departure><%= @access_link.link_orientation_type == "access_point_to_stop_area" %></departure> - <%= @access_link.access_point.geometry.kml_representation.html_safe %> - </Placemark> - <Placemark id="<%= @access_link.stop_area.id %>" > - <arrival><%= @access_link.link_orientation_type == "access_point_to_stop_area" %></arrival> - <%= @access_link.stop_area.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/access_links/show.kml.slim b/app/views/access_links/show.kml.slim new file mode 100644 index 000000000..8812105b7 --- /dev/null +++ b/app/views/access_links/show.kml.slim @@ -0,0 +1,16 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - if @access_link.geometry + placemark id="route_#{@access_link.id}" + name = @access_link.name + = @access_link.geometry.kml_representation.html_safe + + placemark id="#{@access_link.access_point.id}" + departure = "#{@access_link.link_orientation_type == 'access_point_to_stop_area'}" + = @access_link.access_point.geometry.kml_representation.html_safe + + placemark id="#{@access_link.stop_area.id}" + arrival = "#{@access_link.link_orientation_type == 'access_point_to_stop_area'}" + = @access_link.stop_area.geometry.kml_representation.html_safe diff --git a/app/views/access_points/_access_point.html.erb b/app/views/access_points/_access_point.html.erb deleted file mode 100644 index 714e7dc12..000000000 --- a/app/views/access_points/_access_point.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<div id="index_item" class="panel panel-default access_point"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_stop_area_access_point_path(@referential, @stop_area, access_point), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to referential_stop_area_access_point_path(@referential, @stop_area, access_point), :method => :delete, :data => {:confirm => t('access_points.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, @stop_area, access_point], :class => "preview", :title => "#{Chouette::StopArea.model_name.human.capitalize} #{access_point.name}") do %> - <span class="name"> - <%= image_tag "map/access_" + access_point.access_point_type + ".png" %> <%= truncate(access_point.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <% unless access_point.geometry %> - <p> - <span class="warning"><%= t('.no_position') %></span> - - </p> - <% end %> - <p><%= t("access_types.label.#{access_point.access_point_type}") %></p> - </div> -</div> diff --git a/app/views/access_points/_access_point.html.slim b/app/views/access_points/_access_point.html.slim new file mode 100644 index 000000000..b10883eba --- /dev/null +++ b/app/views/access_points/_access_point.html.slim @@ -0,0 +1,20 @@ +#index_item.panel.panel-default.access_point + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_referential_stop_area_access_point_path(@referential, @stop_area, access_point), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + = link_to referential_stop_area_access_point_path(@referential, @stop_area, access_point), method: :delete, data: {:confirm => t('access_points.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + h5 + = link_to [@referential, @stop_area, access_point], class: 'preview', title: "#{Chouette::StopArea.model_name.human.capitalize} #{access_point.name}" do + span.name + = image_tag "map/access_#{access_point.access_point_type}.png" + = truncate(access_point.name, :length => 20) + + .panel-body + - unless access_point.geometry + p + span.warning = t('.no_position') + = " -" + p = t("access_types.label.#{access_point.access_point_type}")
\ No newline at end of file diff --git a/app/views/access_points/_form.html.erb b/app/views/access_points/_form.html.erb deleted file mode 100644 index 9057bb7bb..000000000 --- a/app/views/access_points/_form.html.erb +++ /dev/null @@ -1,54 +0,0 @@ -<div class="container-fluid"> - <% if @map %> - <%= @map.to_html %> - <% end %> - <%= semantic_form_for [@referential, @stop_area, @access_point] do |form| %> - <%= form.inputs do %> - <%= form.input :id, :as => :hidden %> - <%= form.input :name %> - <%= form.input :access_point_type, :as => :select, - :input_html => {:disabled => !@access_point.new_record? }, - :collection => Chouette::AccessPoint.access_point_types, - :include_blank => false, - :member_label => Proc.new { |access_point_type| t("access_types.label.#{access_point_type}") } %> - <%= form.input :street_name %> - <%= form.input :country_code %> - <%= form.input :zip_code %> - <%= form.input :city_name %> - <%= form.input :comment %> - <%= form.input :openning_time, :as => :time_picker, - :input_html => { :class => "form-control input-sm timepicker_basic"}, - :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> - <%= form.input :closing_time, :as => :time_picker, - :input_html => { :class => "form-control input-sm timepicker_basic"}, - :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> - <%= form.input :mobility_restricted_suitability,:as => :boolean %> - <%= form.input :stairs_availability,:as => :boolean %> - <%= form.input :lift_availability,:as => :boolean %> - <%= form.input :objectid, :required => !@access_point.new_record?, - :input_html => { :title => t("formtastic.titles.access_point.objectid")} %> - - <%= form.inputs :name => t('access_points.show.geographic_data') do %> - <% if ! @referential.projection_type_label.empty? %> - <div class="panel panel-default"> - <div class="panel-heading"><%= @referential.projection_type_label %></div> - <div class="panel-body"> - <%= form.input :projection_xy, :input_html => { :title => t("formtastic.titles.access_point.projection_xy")} %> - </div> - </div> - <% end %> - <div class="panel panel-default"> - <div class="panel-heading">WGS84</div> - <div class="panel-body"> - <%= form.input :coordinates, :input_html => { :title => t("formtastic.titles.access_point.coordinates")} %> - </div> - </div> - <% end %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> - <% end %> -</div> diff --git a/app/views/access_points/_form.html.slim b/app/views/access_points/_form.html.slim new file mode 100644 index 000000000..1874644d5 --- /dev/null +++ b/app/views/access_points/_form.html.slim @@ -0,0 +1,44 @@ +.container-fluid + = @map.to_html if @map + + = semantic_form_for [@referential, @stop_area, @access_point] do |form| + = form.inputs do + = form.input :id, as: :hidden + = form.input :name + = form.input :access_point_type, as: :select, + :input_html => {:disabled => !@access_point.new_record? }, + :collection => Chouette::AccessPoint.access_point_types, + include_blank: false, + :member_label => Proc.new { |access_point_type| t("access_types.label.#{access_point_type}") } + = form.input :street_name + = form.input :country_code + = form.input :zip_code + = form.input :city_name + = form.input :comment + = form.input :openning_time, as: :time_picker, + :input_html => { class: 'form-control input-sm timepicker_basic'}, + :wrapper_html => { class: 'input-append bootstrap-timepicker' } + = form.input :closing_time, as: :time_picker, + :input_html => { :class => "form-control input-sm timepicker_basic"}, + :wrapper_html => { :class => "input-append bootstrap-timepicker" } + = form.input :mobility_restricted_suitability, as: :boolean + = form.input :stairs_availability,as: :boolean + = form.input :lift_availability, as: :boolean + = form.input :objectid, :required => !@access_point.new_record?, + :input_html => { :title => t('formtastic.titles.access_point.objectid')} + + = form.inputs :name => t('access_points.show.geographic_data') do + - if !@referential.projection_type_label.empty? + .panel.panel-default + .panel-heading = @referential.projection_type_label + .panel-body + = form.input :projection_xy, :input_html => { :title => t("formtastic.titles.access_point.projection_xy")} + + .panel.panel-default + .panel-heading = "WGS84" + .panel-body + = form.input :coordinates, :input_html => { :title => t("formtastic.titles.access_point.coordinates")} + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/access_points/edit.html.erb b/app/views/access_points/edit.html.erb deleted file mode 100644 index cc5dc217f..000000000 --- a/app/views/access_points/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('access_points.edit.title', :access_point => @access_point.name ) %> - -<%= render "form" %> diff --git a/app/views/access_points/edit.html.slim b/app/views/access_points/edit.html.slim new file mode 100644 index 000000000..a19765998 --- /dev/null +++ b/app/views/access_points/edit.html.slim @@ -0,0 +1,2 @@ += title_tag t('access_points.edit.title', access_point: @access_point.name ) += render 'form'
\ No newline at end of file diff --git a/app/views/access_points/index.html.erb b/app/views/access_points/index.html.erb deleted file mode 100644 index 164169205..000000000 --- a/app/views/access_points/index.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%= title_tag t('access_points.index.title', :stop_area => @stop_area.name) %> - -<%= search_form_for @q, :url => referential_stop_area_access_points_path(@referential,@stop_area), :html => {:method => :get} do |f| %> - <%= f.label :name_or_country_code_cont, "#{t('.name_or_country_code')} :" %> - <%= f.text_field :name_or_country_code_cont %> - - <%= f.submit t('actions.search') %> <%= t("or") %> - <%= link_to t("cancel"), referential_stop_area_access_points_path(@referential,@stop_area) %> -<% end %> - -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @access_points %> -</div> -<div class="access_points paginated_content"> - <%= render :partial => "access_point", :collection => @access_points %> -</div> -<div class="pagination"> - <%= will_paginate @access_points, :container => false %> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), :class => "add" %></li> -</ul> - -<% end %> diff --git a/app/views/access_points/index.html.slim b/app/views/access_points/index.html.slim new file mode 100644 index 000000000..b48abc970 --- /dev/null +++ b/app/views/access_points/index.html.slim @@ -0,0 +1,25 @@ += title_tag t('access_points.index.title', stop_area: @stop_area.name) + += search_form_for @q, :url => referential_stop_area_access_points_path(@referential,@stop_area), :html => {:method => :get} do |f| + = f.label :name_or_country_code_cont, "#{t('.name_or_country_code')} :" + = f.text_field :name_or_country_code_cont + + = f.submit t('actions.search') + = t('or') + + = link_to t("cancel"), referential_stop_area_access_points_path(@referential,@stop_area) + +.page_info + span.search = t('will_paginate.page_entries_info.search') + = page_entries_info @access_points + +.access_points.paginated_content + = render partial: 'access_point', collection: @access_points + +.pagination + = will_paginate @access_points, container: false + +- content_for :sidebar do + ul.actions + li + = link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), class: 'add'
\ No newline at end of file diff --git a/app/views/access_points/index.kml.erb b/app/views/access_points/index.kml.erb deleted file mode 100644 index bbcf19d23..000000000 --- a/app/views/access_points/index.kml.erb +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% @access_points.where("latitude is not null and longitude is not null").each do |access_point| %> - <Placemark id="<%= access_point.id %>" > - <name><%= access_point.name %></name> - <access_point_type><%= access_pointaccess_point_type %></access_point_type> - <%= access_point.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> diff --git a/app/views/access_points/index.kml.slim b/app/views/access_points/index.kml.slim new file mode 100644 index 000000000..65dacbd17 --- /dev/null +++ b/app/views/access_points/index.kml.slim @@ -0,0 +1,9 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - @access_points.where("latitude is not null and longitude is not null").each do |access_point| + placemark id="#{access_point.id}" + name = access_point.name + access_point_type = access_pointaccess_point_type + = access_point.geometry.kml_representation.html_safe diff --git a/app/views/access_points/new.html.erb b/app/views/access_points/new.html.erb deleted file mode 100644 index 3b9c8a397..000000000 --- a/app/views/access_points/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('access_points.new.title') %> - -<%= render "form" %> diff --git a/app/views/access_points/new.html.slim b/app/views/access_points/new.html.slim new file mode 100644 index 000000000..25612564e --- /dev/null +++ b/app/views/access_points/new.html.slim @@ -0,0 +1,2 @@ += title_tag t('access_points.new.title') += render 'form'
\ No newline at end of file diff --git a/app/views/access_points/show.html.erb b/app/views/access_points/show.html.erb deleted file mode 100644 index 9f5e600e6..000000000 --- a/app/views/access_points/show.html.erb +++ /dev/null @@ -1,116 +0,0 @@ -<%= title_tag t('access_points.show.title', :access_point => @access_point.name) %> -<div class="access_point_show"> - <% if @access_point.long_lat_type != nil %> - <%= @map.to_html %> - <% end %> - <div class="summary"> - <p> - <label><%= @access_point.human_attribute_name("comment") %>: </label> - <%= @access_point.comment %> - </p> - <p> - <label><%= @access_point.human_attribute_name("street_name") %>: </label> - <%= @access_point.street_name %> - </p> - <p> - <label><%= @access_point.human_attribute_name("country_code") %>: </label> - <%= @access_point.country_code %> - </p> - <p> - <label><%= @access_point.human_attribute_name("zip_code") %>: </label> - <%= @access_point.zip_code %> - </p> - <p> - <label><%= @access_point.human_attribute_name("city_name") %>: </label> - <%= @access_point.city_name %> - </p> - <p> - <label><%= @access_point.human_attribute_name("access_point_type") %>: </label> - <%= t("access_types.label.#{@access_point.access_point_type}") %> - </p> - <p> - <label><%= @access_point.human_attribute_name("openning_time") %>: </label> - <% if (@access_point.openning_time.present?) %> - <%= @access_point.openning_time.strftime('%Hh %Mm') %> - <% end %> - </p> - <p> - <label><%= @access_point.human_attribute_name("closing_time") %>: </label> - <% if (@access_point.closing_time.present?) %> - <%= @access_point.closing_time.strftime('%Hh %Mm') %> - <% end %> - </p> - <p> - <label><%= @access_point.human_attribute_name("mobility_restricted_suitability") %>: </label> - <%= t((@access_point.mobility_restricted_suitability == true).to_s) %> - </p> - <p> - <label><%= @access_point.human_attribute_name("stairs_availability") %>: </label> - <%= t((@access_point.stairs_availability == true).to_s) %> - </p> - <p> - <label><%= @access_point.human_attribute_name("lift_availability") %>: </label> - <%= t((@access_point.lift_availability == true).to_s) %> - </p> - <p> <label><%= t('access_points.show.geographic_data') %> </label></p> - <% if @access_point.long_lat_type == nil %> - <span class='geo_data'><%= t('access_points.show.no_geographic_data') %></span> - <% else %> - <% if !@access_point.projection.nil? %> - <p> - <span class='geo_data'><%= @access_point.human_attribute_name("projection") %>: </span> - <%= @referential.projection_type_label %> - </p> - <p> - <span class='geo_data'><%= @access_point.human_attribute_name("projection_x") %>: </span> - <%= @access_point.projection_x %> - </p> - <p> - <span class='geo_data'><%= @access_point.human_attribute_name("projection_y") %>: </span> - <%= @access_point.projection_y %> - </p> - <% end %> - <% if !@access_point.long_lat_type.nil? %> - <p> - <span class='geo_data'><%= @access_point.human_attribute_name("long_lat_type") %>: </span> - <%= @access_point.long_lat_type %> - </p> - <p> - <span class='geo_data'><%= @access_point.human_attribute_name("longitude") %>: </span> - <%= @access_point.longitude %> - </p> - <p> - <span class='geo_data'><%= @access_point.human_attribute_name("latitude") %>: </span> - <%= @access_point.latitude %> - </p> - <% end %> - <% end %> - </div> -</div> - -<div> - <h3 class="access_point_generics"><%= t('.generic_access_links') %></h3> - <div class="access_link_pairs"> - <table> - <%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@generic_access_links) %> - </table> - </div> - - <h3 class="access_point_details"><%= t('.detail_access_links') %></h3> - <div class="access_link_pairs"> - <table> - <%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@detail_access_links) %> - </table> - </div> -</div> - - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), :class => "add" %></li> - <li><%= link_to t('access_points.actions.edit'), edit_referential_stop_area_access_point_path(@referential, @stop_area, @access_point), :class => "edit" %></li> - <li><%= link_to t('access_points.actions.destroy'), referential_stop_area_access_point_path(@referential, @stop_area, @access_point), :method => :delete, :data => {:confirm => t('access_points.actions.destroy_confirm')}, :class => "remove" %></li> -</ul> - <br> - <%= creation_tag(@access_point) %> -<% end %> diff --git a/app/views/access_points/show.html.slim b/app/views/access_points/show.html.slim new file mode 100644 index 000000000..7c87fa16e --- /dev/null +++ b/app/views/access_points/show.html.slim @@ -0,0 +1,105 @@ += title_tag t('access_points.show.title', access_point: @access_point.name) + +.access_point_show + = @map.to_html if @access_point.long_lat_type != nil + + .summary + p + label = "#{@access_point.human_attribute_name('comment')} : " + = @access_point.comment + + p + label = "#{@access_point.human_attribute_name('street_name')} : " + = @access_point.street_name + + p + label = "#{@access_point.human_attribute_name('country_code')} : " + = @access_point.country_code + + p + label = "#{@access_point.human_attribute_name('zip_code')} : " + = @access_point.zip_code + + p + label = "#{@access_point.human_attribute_name('city_name')} : " + = @access_point.city_name + + p + label = "#{@access_point.human_attribute_name('access_point_type')} : " + = t("access_types.label.#{@access_point.access_point_type}") + + p + label = "#{@access_point.human_attribute_name('openning_time')} : " + - if @access_point.openning_time.present? + = @access_point.openning_time.strftime('%Hh %Mm') + + p + label = "#{@access_point.human_attribute_name('closing_time')} : " + - if @access_point.closing_time.present? + = @access_point.closing_time.strftime('%Hh %Mm') + + p + label = "#{@access_point.human_attribute_name('mobility_restricted_suitability')} : " + = t((@access_point.mobility_restricted_suitability == true).to_s) + + p + label = "#{@access_point.human_attribute_name('stairs_availability')} : " + = t((@access_point.stairs_availability == true).to_s) + + p + label = "#{@access_point.human_attribute_name('lift_availability')} : " + = t((@access_point.lift_availability == true).to_s) + + p + label = t('access_points.show.geographic_data') + + - if @access_point.long_lat_type == nil + span.geo_data = t('access_points.show.no_geographic_data') + - else + - if !@access_point.projection.nil? + p + span.geo_data = "#{@access_point.human_attribute_name('projection')} : " + = @referential.projection_type_label + + p + span.geo_data = "#{@access_point.human_attribute_name('projection_x')} : " + = @access_point.projection_x + + p + span.geo_data = "#{@access_point.human_attribute_name('projection_y')} : " + = @access_point.projection_y + + - if !@access_point.long_lat_type.nil? + p + span.geo_data = "#{@access_point.human_attribute_name('long_lat_type')} : " + = @access_point.long_lat_type + + p + span.geo_data = "#{@access_point.human_attribute_name('longitude')} : " + = @access_point.longitude + + p + span.geo_data = "#{@access_point.human_attribute_name('latitude')} : " + = @access_point.latitude + +div + h3.access_point_generics = t('.generic_access_links') + div.access_link_pairs + table + = render partial: 'access_link_pairs/access_link_pair', collection: access_links_pairs(@generic_access_links) + + h3.access_point_details = t('.detail_access_links') + div.access_link_pairs + table + = render partial: 'access_link_pairs/access_link_pair', collection: access_links_pairs(@detail_access_links) + +- content_for :sidebar do + ul.actions + li + = link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), class: 'add' + li + = link_to t('access_points.actions.edit'), edit_referential_stop_area_access_point_path(@referential, @stop_area, @access_point), class: 'edit' + li + = link_to t('access_points.actions.destroy'), referential_stop_area_access_point_path(@referential, @stop_area, @access_point), :method => :delete, :data => {:confirm => t('access_points.actions.destroy_confirm')}, class: 'remove' + br + = creation_tag(@access_point) diff --git a/app/views/access_points/show.kml.erb b/app/views/access_points/show.kml.erb deleted file mode 100644 index f54e6340e..000000000 --- a/app/views/access_points/show.kml.erb +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <Placemark id="<%= @access_point.id %>" > - <name><%= @access_point.name %></name> - <access_point_type><%= @access_point.access_point_type %></access_point_type> - <%= (@access_point.position or @access_point.default_position).kml_representation.html_safe %> - </Placemark> - </Document> -</kml> diff --git a/app/views/access_points/show.kml.slim b/app/views/access_points/show.kml.slim new file mode 100644 index 000000000..6cbc7e036 --- /dev/null +++ b/app/views/access_points/show.kml.slim @@ -0,0 +1,8 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + placemark id="#{@access_point.id}" + name = @access_point.name + access_point_type = @access_point.access_point_type + = (@access_point.position or @access_point.default_position).kml_representation.html_safe diff --git a/app/views/api/kml/access_links/index.kml.erb b/app/views/api/kml/access_links/index.kml.erb deleted file mode 100644 index 871646c68..000000000 --- a/app/views/api/kml/access_links/index.kml.erb +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <name><%= h(Chouette::AccessLink.model_name.human) %></name> - <% @access_links.each do |access_link| %> - <Placemark id="<%= access_link.objectid %>" > - <name><%= h(access_link.name) %></name> - <ExtendedData> - <% [ :access_link_type, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :link_orientation].each do |prop| %> - <Data name="<%= prop.to_s %>"> - <value><%= h(access_link.send( prop)) %></value> - </Data> - <% end %> - <Data name="access_point_objectid"> - <value><%= h(access_link.access_point.objectid) %></value> - </Data> - <Data name="stop_area_objectid"> - <value><%= h(access_link.stop_area.objectid) %></value> - </Data> - </ExtendedData> - <%= access_link.geometry_presenter.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/api/kml/access_links/index.kml.slim b/app/views/api/kml/access_links/index.kml.slim new file mode 100644 index 000000000..f402a7aa4 --- /dev/null +++ b/app/views/api/kml/access_links/index.kml.slim @@ -0,0 +1,21 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + name = h(Chouette::AccessLink.model_name.human) + + - @access_links.each do |access_link| + placemark id="#{access_link.objectid}" + name = h(access_link.name) + extendeddata + - [ :access_link_type, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :link_orientation].each do |prop| + data name="#{prop.to_s}" + value = h(access_link.send( prop)) + + data name="access_point_objectid" + value = h(access_link.access_point.objectid) + + data name="stop_area_objectid" + value = h(access_link.stop_area.objectid) + + = access_link.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/api/kml/access_points/index.kml.erb b/app/views/api/kml/access_points/index.kml.erb deleted file mode 100644 index f48846f91..000000000 --- a/app/views/api/kml/access_points/index.kml.erb +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <name><%= h(Chouette::AccessPoint.model_name.human) %></name> - <name>access</name> - <% @access_points.each do |access_point| %> - <Placemark id="<%= access_point.objectid %>" > - <name><%= h(access_point.name) %></name> - <ExtendedData> - <% [ :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :openning_time, :closing_time, :access_type, :access_point_type, :mobility_restricted_suitability, :stairs_availability, :lift_availability].each do |prop| %> - <Data name="<%= prop.to_s %>"> - <value><%= h(access_point.send( prop)) %></value> - </Data> - <% end %> - <Data name="stop_area_objectid"> - <value><%= h(access_point.stop_area.objectid) %></value> - </Data> - </ExtendedData> - <%= access_point.geometry_presenter.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/api/kml/access_points/index.kml.slim b/app/views/api/kml/access_points/index.kml.slim new file mode 100644 index 000000000..4f47272e6 --- /dev/null +++ b/app/views/api/kml/access_points/index.kml.slim @@ -0,0 +1,19 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + name = h(Chouette::AccessPoint.model_name.human) + name access + + - @access_points.each do |access_point| + placemark id="#{access_point.objectid}" + name = h(access_point.name) + extendeddata + - [ :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :openning_time, :closing_time, :access_type, :access_point_type, :mobility_restricted_suitability, :stairs_availability, :lift_availability].each do |prop| + data name="#{prop.to_s}" + value = h(access_point.send( prop)) + + data name="stop_area_objectid" + value = h(access_point.stop_area.objectid) + + = access_point.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/api/kml/connection_links/index.kml.erb b/app/views/api/kml/connection_links/index.kml.erb deleted file mode 100644 index 8eb6c6ea2..000000000 --- a/app/views/api/kml/connection_links/index.kml.erb +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <name><%= h(Chouette::ConnectionLink.model_name.human) %></name> - <% @connection_links.each do |connection_link| %> - <Placemark id="<%= connection_link.objectid %>" > - <name><%= h(connection_link.name) %></name> - <ExtendedData> - <% [ :connection_link_type, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop| %> - <Data name="<%= prop.to_s %>"> - <value><%= h(connection_link.send( prop)) %></value> - </Data> - <% end %> - <Data name="departure_objectid"> - <value><%= h(connection_link.departure.objectid) %></value> - </Data> - <Data name="arrival_objectid"> - <value><%= h(connection_link.arrival.objectid) %></value> - </Data> - </ExtendedData> - <%= connection_link.geometry_presenter.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/api/kml/connection_links/index.kml.slim b/app/views/api/kml/connection_links/index.kml.slim new file mode 100644 index 000000000..b5a6e9560 --- /dev/null +++ b/app/views/api/kml/connection_links/index.kml.slim @@ -0,0 +1,21 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + name = h(Chouette::ConnectionLink.model_name.human) + + - @connection_links.each do |connection_link| + placemark id="#{connection_link.objectid}" + name = h(connection_link.name) + extendeddata + - [ :connection_link_type, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop| + data name="#{prop.to_s}" + value = h(connection_link.send( prop)) + + data name="departure_objectid" + value = h(connection_link.departure.objectid) + + data name="arrival_objectid" + value = h(connection_link.arrival.objectid) + + = connection_link.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/api/kml/journey_patterns/show.kml.erb b/app/views/api/kml/journey_patterns/show.kml.erb deleted file mode 100644 index b743a9e53..000000000 --- a/app/views/api/kml/journey_patterns/show.kml.erb +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <name><%= h(Chouette::JourneyPattern.model_name.human) %> : <%= h(@journey_pattern.name) %></name> - <ExtendedData> - <% [:objectid, :object_version, :creation_time, :creator_id, :name, :comment, :registration_number, :published_name].each do |prop| %> - <Data name="<%= prop.to_s %>"> - <value><%= h(@journey_pattern.send( prop)) %></value> - </Data> - <% end %> - <Data name="route_objectid"> - <value><%= h(@journey_pattern.route.objectid) %></value> - </Data> - </ExtendedData> - <% @journey_pattern.route.stop_points.each_with_index do |stop_point, index| %> - <% stop_area = stop_point.stop_area %> - <% if stop_area.geometry %> - <Placemark id="<%= stop_area.objectid %>" > - <name><%= h(stop_area.name) %></name> - <ExtendedData> - <% [ :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop| %> - <Data name="<%= prop.to_s %>"> - <value><%= h(stop_area.send( prop)) %></value> - </Data> - <% end %> - <% if stop_area.parent %> - <Data name="parent_objectid"> - <value><%= h(stop_area.parent.objectid) %></value> - </Data> - <% end %> - <Data name="stop"> - <value><%= @journey_pattern.stop_points.include?( stop_point) ? "true" : "false" %></value> - </Data> - </ExtendedData> - - <%= stop_area.geometry_presenter.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - <% end %> - </Document> -</kml> - diff --git a/app/views/api/kml/journey_patterns/show.kml.slim b/app/views/api/kml/journey_patterns/show.kml.slim new file mode 100644 index 000000000..f7e6dc9f4 --- /dev/null +++ b/app/views/api/kml/journey_patterns/show.kml.slim @@ -0,0 +1,31 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + name = "#{h(Chouette::JourneyPattern.model_name.human)} : #{h(@journey_pattern.name)}" + extendeddata + - [:objectid, :object_version, :creation_time, :creator_id, :name, :comment, :registration_number, :published_name].each do |prop| + data name="#{prop.to_s}" + value = h(@journey_pattern.send( prop)) + + data name="route_objectid" + value = h(@journey_pattern.route.objectid) + + - @journey_pattern.route.stop_points.each_with_index do |stop_point, index| + - stop_area = stop_point.stop_area + - if stop_area.geometry + placemark id="#{stop_area.objectid}" + name = h(stop_area.name) + extendeddata + - [ :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop| + data name="#{prop.to_s}" + value = h(stop_area.send( prop)) + + - if stop_area.parent + data name="parent_objectid" + value = h(stop_area.parent.objectid) + + data name="stop" + value = @journey_pattern.stop_points.include?( stop_point) ? "true" : "false" + + = stop_area.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/api/kml/lines/show.kml.erb b/app/views/api/kml/lines/show.kml.erb deleted file mode 100644 index ea5b4adcc..000000000 --- a/app/views/api/kml/lines/show.kml.erb +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <name><%= h(Chouette::Line.model_name.human) %> : <%= h(@line.name) %></name> - <Placemark id="<%= @line.objectid %>" > - <name><%= h(@line.name) %></name> - <ExtendedData> - <% [ :transport_mode, :objectid, :object_version, :creation_time, :creator_id, :name, :number, :published_name, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs].each do |prop| %> - <Data name="<%= prop.to_s %>"> - <value><%= h(@line.send( prop)) %></value> - </Data> - <% end %> - <Data name="company_objectid"> - <value><%= h(@line.company.objectid) %></value> - </Data> - <Data name="network_objectid"> - <value><%= h(@line.network.objectid) %></value> - </Data> - </ExtendedData> - <%= @line.geometry_presenter.geometry.kml_representation.html_safe %> - </Placemark> - </Document> -</kml> - diff --git a/app/views/api/kml/lines/show.kml.slim b/app/views/api/kml/lines/show.kml.slim new file mode 100644 index 000000000..d314b8f19 --- /dev/null +++ b/app/views/api/kml/lines/show.kml.slim @@ -0,0 +1,20 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + name = "#{h(Chouette::Line.model_name.human)} : #{h(@line.name)}" + + placemark id="#{@line.objectid}" + name = h(@line.name) + extendeddata + - [ :transport_mode, :objectid, :object_version, :creation_time, :creator_id, :name, :number, :published_name, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs].each do |prop| + data name="#{prop.to_s}" + value = h(@line.send( prop)) + + data name="company_objectid" + value = h(@line.company.objectid) + + data name="network_objectid" + value = h(@line.network.objectid) + + = @line.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/api/kml/routes/show.kml.erb b/app/views/api/kml/routes/show.kml.erb deleted file mode 100644 index 14cefabf2..000000000 --- a/app/views/api/kml/routes/show.kml.erb +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <name><%= h(Chouette::Route.model_name.human) %> : <%= h(@route.name) %></name> - <Placemark id="<%= @route.objectid %>" > - <name><%= h(@route.name) %></name> - <ExtendedData> - <% [:direction_code, :wayback_code, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :published_name, :number, :direction, :wayback].each do |prop| %> - <Data name="<%= prop.to_s %>"> - <value><%= h(@route.send( prop)) %></value> - </Data> - <% end %> - <Data name="line_objectid"> - <value><%= h(@route.line.objectid) %></value> - </Data> - </ExtendedData> - <%= @route.geometry_presenter.geometry.kml_representation.html_safe %> - </Placemark> - </Document> -</kml> - diff --git a/app/views/api/kml/routes/show.kml.slim b/app/views/api/kml/routes/show.kml.slim new file mode 100644 index 000000000..3b08d81ce --- /dev/null +++ b/app/views/api/kml/routes/show.kml.slim @@ -0,0 +1,16 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + name = "#{h(Chouette::Route.model_name.human)} : #{h(@route.name)}" + placemark id="#{@route.objectid}" + name = h(@route.name) + extendeddata + - [:direction_code, :wayback_code, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :published_name, :number, :direction, :wayback].each do |prop| + data name="#{prop.to_s}" + value = h(@route.send( prop)) + + data name="line_objectid" + value = h(@route.line.objectid) + + = @route.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/api/kml/stop_areas/index.kml.erb b/app/views/api/kml/stop_areas/index.kml.erb deleted file mode 100644 index 8056c47d6..000000000 --- a/app/views/api/kml/stop_areas/index.kml.erb +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <name><%= h( I18n.t("area_types.#{@area_type.underscore}") ) %></name> - <% @stop_areas.select { |sa| sa.latitude && sa.longitude}.each do |stop_area| %> - <Placemark id="<%= stop_area.objectid %>" > - <name><%= h(stop_area.name) %></name> - <ExtendedData> - <% [:objectid, :object_version, :creation_time, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop| %> - <Data name="<%= prop.to_s %>"> - <value><%= h(stop_area.send( prop)) %></value> - </Data> - <% end %> - <% if stop_area.parent %> - <Data name="parent_objectid"> - <value><%= h(stop_area.parent.objectid) %></value> - </Data> - <% end %> - </ExtendedData> - - <%= stop_area.geometry_presenter.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/api/kml/stop_areas/index.kml.slim b/app/views/api/kml/stop_areas/index.kml.slim new file mode 100644 index 000000000..64f7e08be --- /dev/null +++ b/app/views/api/kml/stop_areas/index.kml.slim @@ -0,0 +1,19 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + name = h( I18n.t("area_types.#{@area_type.underscore}") ) + + - @stop_areas.select { |sa| sa.latitude && sa.longitude}.each do |stop_area| + placemark id="#{stop_area.objectid}" + name = h(stop_area.name) + extendeddata + - [:objectid, :object_version, :creation_time, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop| + data name="#{prop.to_s}" + value = h(stop_area.send( prop)) + + - if stop_area.parent + data name="parent_objectid" + value = h(stop_area.parent.objectid) + + = stop_area.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/api_keys/_api_key.html.erb b/app/views/api_keys/_api_key.html.erb deleted file mode 100644 index c81953311..000000000 --- a/app/views/api_keys/_api_key.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -<div id="index_item" class="panel panel-default api_key"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_api_key_path(@referential, api_key), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= 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 class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, api_key], :class => "preview", :title => "#{Chouette::StopArea.model_name.human.capitalize} #{api_key.name}") do %> - <span class="name"> - <%= truncate(api_key.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <%= api_key.class.human_attribute_name('token') %> <%= truncate(api_key.token, :length => 20) %> - </p> - <p> - <%= api_key.class.human_attribute_name('updated_at') %> <%= l(api_key.updated_at) %> - </p> - </div> -</div> - diff --git a/app/views/api_keys/_api_key.html.slim b/app/views/api_keys/_api_key.html.slim new file mode 100644 index 000000000..4cb07ef83 --- /dev/null +++ b/app/views/api_keys/_api_key.html.slim @@ -0,0 +1,18 @@ +#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.erb b/app/views/api_keys/_form.html.erb deleted file mode 100644 index 0adff4155..000000000 --- a/app/views/api_keys/_form.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<%= 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 } %> - <% end %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - diff --git a/app/views/api_keys/_form.html.slim b/app/views/api_keys/_form.html.slim new file mode 100644 index 000000000..74b806677 --- /dev/null +++ b/app/views/api_keys/_form.html.slim @@ -0,0 +1,10 @@ += 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 } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/api_keys/edit.html.erb b/app/views/api_keys/edit.html.erb deleted file mode 100644 index 7d367421e..000000000 --- a/app/views/api_keys/edit.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('api_keys.edit.title') %> - -<%= render "form" %> - diff --git a/app/views/api_keys/edit.html.slim b/app/views/api_keys/edit.html.slim new file mode 100644 index 000000000..110f0775d --- /dev/null +++ b/app/views/api_keys/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('api_keys.edit.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/api_keys/new.html.erb b/app/views/api_keys/new.html.erb deleted file mode 100644 index 40dd1a4fe..000000000 --- a/app/views/api_keys/new.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('api_keys.new.title') %> - -<%= render "form" %> - diff --git a/app/views/api_keys/new.html.slim b/app/views/api_keys/new.html.slim new file mode 100644 index 000000000..f7b1dd99b --- /dev/null +++ b/app/views/api_keys/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('api_keys.new.title') + +== render "form"
\ No newline at end of file diff --git a/app/views/api_keys/show.html.erb b/app/views/api_keys/show.html.erb deleted file mode 100644 index 1fb5236b3..000000000 --- a/app/views/api_keys/show.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<%= title_tag t('api_keys.show.title') %> - -<div class="api_keys_show"> - - <div class="summary"> - <p> - <label><%= @api_key.class.human_attribute_name("name") %>: </label> - <%= @api_key.name %> - </p> - <p> - <label><%= @api_key.class.human_attribute_name("token") %>: </label> - <%= @api_key.token %> - </p> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('api_keys.actions.new'), new_referential_api_key_path(@referential), :class => "add" %></li> - <li><%= link_to t('api_keys.actions.edit'), edit_referential_api_key_path(@referential, @api_key), :class => "edit" %></li> - <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" %></li> - <br> -</ul> -<% end %> diff --git a/app/views/api_keys/show.html.slim b/app/views/api_keys/show.html.slim new file mode 100644 index 000000000..b65717408 --- /dev/null +++ b/app/views/api_keys/show.html.slim @@ -0,0 +1,18 @@ += 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/companies/_companies.erb b/app/views/companies/_companies.erb deleted file mode 100644 index 9464f0c1a..000000000 --- a/app/views/companies/_companies.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info( @companies ) %> -</div> -<div class="companies paginated_content"> - <%= paginated_content(@companies) %> -</div> -<div class="pagination"> - <%= will_paginate @companies, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div>
\ No newline at end of file diff --git a/app/views/companies/_companies.html.slim b/app/views/companies/_companies.html.slim new file mode 100644 index 000000000..bcd471cc7 --- /dev/null +++ b/app/views/companies/_companies.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t('will_paginate.page_entries_info.search') + = page_entries_info(@companies) + +.companies.paginated_content + = paginated_content(@companies) + +.pagination + = will_paginate @companies, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/companies/_company.erb b/app/views/companies/_company.erb deleted file mode 100644 index 534c4c7a6..000000000 --- a/app/views/companies/_company.erb +++ /dev/null @@ -1,26 +0,0 @@ -<div id="index_item" class="company panel panel-default"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_company_path(@referential, company), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to referential_company_path(@referential, company), :method => :delete, :data => {:confirm => t('companies.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, company], :class => "preview", :title => "#{Chouette::Company.model_name.human.capitalize} #{company.name}") do %> - <span class="name"> - <%= truncate(company.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <%= company.human_attribute_name('code') %> <%= company.code %> - </p> - </div> -</div> diff --git a/app/views/companies/_company.html.slim b/app/views/companies/_company.html.slim new file mode 100644 index 000000000..ca1b9f366 --- /dev/null +++ b/app/views/companies/_company.html.slim @@ -0,0 +1,16 @@ +#index_item.company.panel.panel-default + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_referential_company_path(@referential, company), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + = link_to referential_company_path(@referential, company), :method => :delete, :data => {:confirm => t('companies.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + h5 + = link_to [@referential, company], class: 'preview', title: "#{Chouette::Company.model_name.human.capitalize} #{company.name}" do + span.name + = truncate(company.name, length: 20) + .panel-body + p + = company.human_attribute_name('code') + = company.code diff --git a/app/views/companies/_form.erb b/app/views/companies/_form.erb deleted file mode 100644 index ee3f9db25..000000000 --- a/app/views/companies/_form.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%= semantic_form_for [@referential, @company] do |form| %> - <%= form.inputs do %> - <%= form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.company.name") } %> - <%= form.input :short_name %> - <%= form.input :organizational_unit %> - <%= form.input :operating_department_name %> - <%= form.input :code %> - <%= form.input :phone, :as => :phone %> - <%= form.input :fax, :as => :phone %> - <%= form.input :email, :as => :email %> - <%= form.input :time_zone, :include_blank => true %> - <%= form.input :url %> - <%= form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.company.registration_number")} %> - <%= form.input :objectid, :required => !@company.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.company.objectid")} %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> diff --git a/app/views/companies/_form.html.slim b/app/views/companies/_form.html.slim new file mode 100644 index 000000000..3f8663949 --- /dev/null +++ b/app/views/companies/_form.html.slim @@ -0,0 +1,18 @@ += semantic_form_for [@referential, @company] do |form| + = form.inputs do + = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.company.name") } + = form.input :short_name + = form.input :organizational_unit + = form.input :operating_department_name + = form.input :code + = form.input :phone, as: :phone + = form.input :fax, as: :phone + = form.input :email, as: :email + = form.input :time_zone, include_blank: true + = form.input :url + = form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.company.registration_number") } + = form.input :objectid, :required => !@company.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.company.objectid") } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/companies/edit.html.erb b/app/views/companies/edit.html.erb deleted file mode 100644 index 797509787..000000000 --- a/app/views/companies/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('companies.edit.title', :company => @company.name) %> - -<%= render "form" %> diff --git a/app/views/companies/edit.html.slim b/app/views/companies/edit.html.slim new file mode 100644 index 000000000..6c415edfb --- /dev/null +++ b/app/views/companies/edit.html.slim @@ -0,0 +1,2 @@ += title_tag t('companies.edit.title', company: @company.name) += render 'form'
\ No newline at end of file diff --git a/app/views/companies/index.html.erb b/app/views/companies/index.html.erb deleted file mode 100644 index ec6ffbeb2..000000000 --- a/app/views/companies/index.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%= title_tag t('companies.index.title') %> - -<%= search_form_for @q, :url => referential_companies_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <div class="input-group col-md-12"> - <%= f.text_field :name_cont, :placeholder => "#{t('.name')}", :class => "form-control" %> - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div><!-- /input-group --> - <!-- <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> --> - <!-- <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> --> - <!-- </a> --> - </div> -</div> -<% end %> - -<div id="companies"><%= render partial: "companies", object: @companies %></div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('companies.actions.new'), new_referential_company_path(@referential), :class => "add" %></li> - <br> -</ul> -<% end %> diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim new file mode 100644 index 000000000..711b88607 --- /dev/null +++ b/app/views/companies/index.html.slim @@ -0,0 +1,25 @@ += title_tag t('companies.index.title') + += search_form_for @q, :url => referential_companies_path(@referential), remote: true, :html => {:method => :get, class: 'form-inline', id: 'search', role: "form"} do |f| + + .panel.panel-default + .panel-heading + .input-group.col-md-12 + = f.text_field :name_cont, placeholder: t('.name'), class: 'form-control' + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + / <!-- /input-group --> + / <!-- <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> --> + / <!-- <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> --> + / <!-- </a> --> + +#companies + = render partial: 'companies', object: @companies + +- content_for :sidebar do + ul.actions + li + = link_to t('companies.actions.new'), new_referential_company_path(@referential), class: 'add' + br
\ No newline at end of file diff --git a/app/views/companies/index.js.erb b/app/views/companies/index.js.erb deleted file mode 100644 index 3afe2b9c5..000000000 --- a/app/views/companies/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#companies').html('<%= escape_javascript(render("companies")) %>');
\ No newline at end of file diff --git a/app/views/companies/index.js.slim b/app/views/companies/index.js.slim new file mode 100644 index 000000000..cfb1c719c --- /dev/null +++ b/app/views/companies/index.js.slim @@ -0,0 +1 @@ +| $('#companies').html("= escape_javascript(render('companies'))");
\ No newline at end of file diff --git a/app/views/companies/new.html.erb b/app/views/companies/new.html.erb deleted file mode 100644 index a1332ff3a..000000000 --- a/app/views/companies/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('companies.new.title') %> - -<%= render "form" %> diff --git a/app/views/companies/new.html.slim b/app/views/companies/new.html.slim new file mode 100644 index 000000000..1acb1786f --- /dev/null +++ b/app/views/companies/new.html.slim @@ -0,0 +1,2 @@ += title_tag t('companies.new.title') += render 'form'
\ No newline at end of file diff --git a/app/views/companies/show.html.erb b/app/views/companies/show.html.erb deleted file mode 100644 index 513b0364e..000000000 --- a/app/views/companies/show.html.erb +++ /dev/null @@ -1,57 +0,0 @@ -<%= title_tag t('companies.show.title', :company => @company.name) %> - -<div class="company_show"> - - <div class="summary"> - <p> - <label><%= Chouette::Company.human_attribute_name("short_name") %>: </label> - <%= @company.short_name %> - </p> - <p> - <label><%= Chouette::Company.human_attribute_name("organizational_unit") %>: </label> - <%= @company.organizational_unit %> - </p> - <p> - <label><%= Chouette::Company.human_attribute_name("operating_department_name") %>: </label> - <%= @company.operating_department_name %> - </p> - <p> - <label><%= Chouette::Company.human_attribute_name("code") %>: </label> - <%= @company.code %> - </p> - <p> - <label><%= Chouette::Company.human_attribute_name("phone") %>: </label> - <%= @company.phone %> - </p> - <p> - <label><%= Chouette::Company.human_attribute_name("fax") %>: </label> - <%= @company.fax %> - </p> - <p> - <label><%= Chouette::Company.human_attribute_name("email") %>: </label> - <%= @company.email %> - </p> - <p> - <label><%= Chouette::Company.human_attribute_name("time_zone") %>: </label> - <%= @company.time_zone %> - </p> - <p> - <label><%= Chouette::Company.human_attribute_name("url") %>: </label> - <%= @company.url %> - </p> - <p> - <label><%= Chouette::Company.human_attribute_name("registration_number") %>: </label> - <%= @company.registration_number %> - </p> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('companies.actions.new'), new_referential_company_path(@referential), :class => "add" %></li> - <li><%= link_to t('companies.actions.edit'), edit_referential_company_path(@referential, @company), :class => "edit" %></li> - <li><%= link_to t('companies.actions.destroy'), referential_company_path(@referential, @company), :method => :delete, :data => {:confirm => t('companies.actions.destroy_confirm')}, :class => "remove" %></li> - <br> -</ul> - <%= creation_tag(@company) %> -<% end %> diff --git a/app/views/companies/show.html.slim b/app/views/companies/show.html.slim new file mode 100644 index 000000000..a445dad61 --- /dev/null +++ b/app/views/companies/show.html.slim @@ -0,0 +1,55 @@ += title_tag t('companies.show.title', company: @company.name) + +.company_show + .summary + p + label = "#{Chouette::Company.human_attribute_name('short_name')} : " + = @company.short_name + + p + label = "#{Chouette::Company.human_attribute_name('organizational_unit')} : " + = @company.organizational_unit + + p + label = "#{Chouette::Company.human_attribute_name('operating_department_name')} : " + = @company.operating_department_name + + p + label = "#{Chouette::Company.human_attribute_name('code')} : " + = @company.code + + p + label = "#{Chouette::Company.human_attribute_name('phone')} : " + = @company.phone + + p + label = "#{Chouette::Company.human_attribute_name('fax')} : " + = @company.fax + + p + label = "#{Chouette::Company.human_attribute_name('email')} : " + = @company.email + + p + label = "#{Chouette::Company.human_attribute_name('time_zone')} : " + = @company.time_zone + + p + label = "#{Chouette::Company.human_attribute_name('url')} : " + = @company.url + + p + label = "#{Chouette::Company.human_attribute_name('registration_number')} : " + = @company.registration_number + +- content_for :sidebar do + ul.actions + li + = link_to t('companies.actions.new'), new_referential_company_path(@referential), class: 'add' + li + = link_to t('companies.actions.edit'), edit_referential_company_path(@referential, @company), class: 'edit' + li + = link_to t('companies.actions.destroy'), referential_company_path(@referential, @company), :method => :delete, :data => {:confirm => t('companies.actions.destroy_confirm')}, class: 'remove' + br + + = creation_tag(@company)
\ No newline at end of file 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 49e4fae19..000000000 --- a/app/views/compliance_check_tasks/new.html.erb +++ /dev/null @@ -1,20 +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 %> diff --git a/app/views/compliance_check_tasks/new.html.slim b/app/views/compliance_check_tasks/new.html.slim new file mode 100644 index 000000000..212e7f618 --- /dev/null +++ b/app/views/compliance_check_tasks/new.html.slim @@ -0,0 +1,17 @@ += 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
\ No newline at end of file diff --git a/app/views/compliance_check_tasks/new.js.coffee b/app/views/compliance_check_tasks/new.js.coffee index 32cfa851a..d7066b6f7 100644 --- a/app/views/compliance_check_tasks/new.js.coffee +++ b/app/views/compliance_check_tasks/new.js.coffee @@ -1,4 +1,7 @@ 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') %>'}); + # <% 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.erb b/app/views/compliance_checks/_compliance_check.html.erb deleted file mode 100644 index 8fc21d6ab..000000000 --- a/app/views/compliance_checks/_compliance_check.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<div id="index_item" class="panel panel-default"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="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 class="fa fa-trash-o"></span> - <% end %> - </span> - <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) %> - <% end %> - </h5> - </div> - </div> - <div class="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? %></p> - </div> - <div class="panel-footer"> - <div class="history"> - <%= l compliance_check.created_at, :format => "%d/%m/%Y %H:%M" %> | <%= compliance_check.user_name %> - </div> - </div> -</div> diff --git a/app/views/compliance_checks/_compliance_check.html.slim b/app/views/compliance_checks/_compliance_check.html.slim new file mode 100644 index 000000000..db4753563 --- /dev/null +++ b/app/views/compliance_checks/_compliance_check.html.slim @@ -0,0 +1,17 @@ +#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}"
\ No newline at end of file diff --git a/app/views/compliance_checks/_compliance_check_results.erb b/app/views/compliance_checks/_compliance_check_results.erb deleted file mode 100644 index 28d5a289e..000000000 --- a/app/views/compliance_checks/_compliance_check_results.erb +++ /dev/null @@ -1,101 +0,0 @@ -<p> -<form class="form-inline"> - <div class="form-group"> - <label><%= t("shared.ie_report.search") %></label> - <input id="filter" type="text" class="form-control"> - </div> - <div class="form-group"> - <label><%=ComplianceCheckResult.human_attribute_name(:severity)%></label> - <select class="filter-severity form-control"> - <option></option> - <option value="severity-error"><%= t("compliance_check_result.severities.error") %></option> - <option value="severity-warning"><%= t("compliance_check_result.severities.warning") %></option> - </select> - </div> - <div class="form-group"> - <label><%=ComplianceCheckResult.human_attribute_name(:status)%></label> - <select class="filter-status form-control"> - <option></option> - <option value="status-ok"><%= t("compliance_check_result.statuses.ok") %></option> - <option value="status-nok"><%= t("compliance_check_result.statuses.nok") %></option> - <option value="status-uncheck"><%= t("compliance_check_result.statuses.uncheck") %></option> - </select> - </div> -</form> -</p> -<table class="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> - <th class="col-md-1" data-sort-ignore="true"><%= ComplianceCheckResult.human_attribute_name(:severity) %></th> - <th class="col-md-3"><%= ComplianceCheckResult.human_attribute_name(:rule_code) %></th> - <th class="col-md-2"><%=t('compliance_check_results.errors') %></th> - <th class="col-md-6" data-toggle="true" data-sort-ignore="true"><%= ComplianceCheckResult.human_attribute_name(:detail) %></th> - <th data-hide="all" data-sort-ignore="true"></th> - </tr> - </thead> - <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> - <td data-value="<%="severity-#{test.severity}"%>"><%= t("compliance_check_result.severities.#{test.severity}_txt") %></td> - <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> - <td> - <%= ("#{test.error_count || 0} #{ComplianceCheckResult.human_attribute_name(:violation_count)}") if test.errors.present? %> - </td> - <td> - <%= truncate(t("activemodel.attributes.compliance_check_result.#{test.test_id}"), length: 50)%> - </td> - <td> - <p><b><%=t("activemodel.attributes.compliance_check_result.#{test.test_id}")%></b></p> - <% if test.errors.present? %> - <% test.errors.first(10).each do |error| %> - <dl class="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 %> - <% end %> - <% end %> - <% if error[:source].file.present? %> - <%= error[:source].objectid if error[:source].objectid.present? %> - <% end %> - <% end %> - </dt> - <dd><%=t("compliance_check_result.details.detail_#{error[:error_id]}", object_labels_hash(error))%></dd> - </dl> - <% if error[:source].file.present? %> - <p class="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? %> - </p> - <% end %> - <% end %> - <% end %> - </td> - </tr> - <% end %> - <% else %> - <tr> - <td colspan="6"><%= t('compliance_check_results.in_progress') %></td> - </tr> - <% end %> - </tbody> - <tfoot class="hide-if-no-paging"> - <tr> - <td colspan="5"><ul class="pagination pagination-centered"></ul></td> - </tr> - </tfoot> -</table> diff --git a/app/views/compliance_checks/_compliance_check_results.html.slim b/app/views/compliance_checks/_compliance_check_results.html.slim new file mode 100644 index 000000000..e2b8cb6f4 --- /dev/null +++ b/app/views/compliance_checks/_compliance_check_results.html.slim @@ -0,0 +1,92 @@ +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
\ No newline at end of file diff --git a/app/views/compliance_checks/_compliance_checks.html.erb b/app/views/compliance_checks/_compliance_checks.html.erb deleted file mode 100644 index e28af86fc..000000000 --- a/app/views/compliance_checks/_compliance_checks.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @compliance_checks %> -</div> -<div class="compliance_checks paginated_content"> - <%= paginated_content @compliance_checks, "compliance_checks/compliance_check" %> -</div> -<div class="pagination"> - <%= will_paginate @compliance_checks, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/compliance_checks/_compliance_checks.html.slim b/app/views/compliance_checks/_compliance_checks.html.slim new file mode 100644 index 000000000..48db9ae94 --- /dev/null +++ b/app/views/compliance_checks/_compliance_checks.html.slim @@ -0,0 +1,9 @@ +.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.erb b/app/views/compliance_checks/detailed_errors_index.csv.erb deleted file mode 100644 index 17fb6f2c3..000000000 --- a/app/views/compliance_checks/detailed_errors_index.csv.erb +++ /dev/null @@ -1,2 +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" %><% 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/detailed_errors_index.csv.slim b/app/views/compliance_checks/detailed_errors_index.csv.slim new file mode 100644 index 000000000..0b2c3f24f --- /dev/null +++ b/app/views/compliance_checks/detailed_errors_index.csv.slim @@ -0,0 +1,37 @@ += 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.erb b/app/views/compliance_checks/index.html.erb deleted file mode 100644 index 4a3470ad5..000000000 --- a/app/views/compliance_checks/index.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<%= title_tag t('.title') %> -<div class="warning"><%= t('.warning') %> </div> - -<div id="compliance_checks"><%= render 'compliance_checks' %></div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('compliance_check_tasks.actions.new'), new_referential_compliance_check_task_path(), :class => "add" %></li> - <li><%= link_to t('rule_parameter_sets.actions.index'), organisation_rule_parameter_sets_path, :class => "link" %></li> -</ul> -<% end %> diff --git a/app/views/compliance_checks/index.html.slim b/app/views/compliance_checks/index.html.slim new file mode 100644 index 000000000..392c46663 --- /dev/null +++ b/app/views/compliance_checks/index.html.slim @@ -0,0 +1,14 @@ += 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.erb b/app/views/compliance_checks/index.js.erb deleted file mode 100644 index 236a9068c..000000000 --- a/app/views/compliance_checks/index.js.erb +++ /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/index.js.slim b/app/views/compliance_checks/index.js.slim new file mode 100644 index 000000000..cfd8dc40d --- /dev/null +++ b/app/views/compliance_checks/index.js.slim @@ -0,0 +1 @@ +| $('#compliance_checks').html("#{escape_javascript(render('compliance_checks'))}");
\ No newline at end of file diff --git a/app/views/compliance_checks/report.html.erb b/app/views/compliance_checks/report.html.erb deleted file mode 100644 index 7bd0d7a92..000000000 --- a/app/views/compliance_checks/report.html.erb +++ /dev/null @@ -1,49 +0,0 @@ -<%= title_tag job_status_title(@compliance_check) %> - -<div class="compliance_check_show"> - <div class="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? %> - <% end %> - <div class="btn-group pull-right"> - <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> - <%= t("compliance_checks.show.export") %> <span class="caret"></span> - </button> - <ul class="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) %> - <% end %> - </li> - </ul> - </div> - </div> - <div class="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 } %> - </div> -</div> - -<% content_for :sidebar do %> - <% if @compliance_check.compliance_check_validation_report && @compliance_check.compliance_check_validation_report.nok_error.blank? %> - <div class="row"> - <%=font_awesome_classic_tag('fa-thumbs-up fa-5x col-md-3')%> - <p class='col-md-7' id='validation_success'><%=t('.validation_success')%></p> - </div> - <% end %> - <ul class="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" %> - <% end %> - </li> - </ul> - <%= history_tag(@compliance_check) %> - <div id="error" class="graph"></div> - <div id="warning" class="graph"></div> -<% end %> diff --git a/app/views/compliance_checks/report.html.slim b/app/views/compliance_checks/report.html.slim new file mode 100644 index 000000000..be2bb8adc --- /dev/null +++ b/app/views/compliance_checks/report.html.slim @@ -0,0 +1,41 @@ += 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.erb b/app/views/compliance_checks/show.html.erb deleted file mode 100644 index 1b656692e..000000000 --- a/app/views/compliance_checks/show.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<div class="test"> - <%= title_tag job_status_title(@compliance_check) %> -</div> -<% if @compliance_check.report.failure_code? %> -<div class="alert alert-danger"> - <%= t("iev.failure.#{@compliance_check.report.failure_code}") %> -</div> -<% end %> -<div class="progress_bars"> - <%= progress_bar_tag(@compliance_check) %> -</div> -<div class="compliance_check show"> - <div class="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? %> - </div> - <%= render(partial: "shared/ie_report", locals: { job: @compliance_check, type: :validation, line_items: @line_items } ) %> -</div> - -<% content_for :sidebar do %> - <ul class="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" %></li> - </ul> - - <%= history_tag(@compliance_check) %> - -<% end %> diff --git a/app/views/compliance_checks/show.html.slim b/app/views/compliance_checks/show.html.slim new file mode 100644 index 000000000..8c6900981 --- /dev/null +++ b/app/views/compliance_checks/show.html.slim @@ -0,0 +1,22 @@ +.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.erb b/app/views/compliance_checks/summary_errors_index.csv.erb deleted file mode 100644 index ff915f700..000000000 --- a/app/views/compliance_checks/summary_errors_index.csv.erb +++ /dev/null @@ -1,3 +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" %><% 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_checks/summary_errors_index.csv.slim b/app/views/compliance_checks/summary_errors_index.csv.slim new file mode 100644 index 000000000..bbb2c8c88 --- /dev/null +++ b/app/views/compliance_checks/summary_errors_index.csv.slim @@ -0,0 +1,34 @@ += 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/connection_links/_connection_link.erb b/app/views/connection_links/_connection_link.erb deleted file mode 100644 index 7996eb0f3..000000000 --- a/app/views/connection_links/_connection_link.erb +++ /dev/null @@ -1,40 +0,0 @@ -<div id="index_item" class="panel panel-default connection_link"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_connection_link_path(@referential, connection_link), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to referential_connection_link_path(@referential, connection_link), :method => :delete, :data => {:confirm => t('connection_links.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, connection_link], :class => "preview", :title => "#{Chouette::ConnectionLink.model_name.human.capitalize} #{connection_link.name}") do %> - <span class="name"> - <%= truncate(connection_link.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <%= t('.from') %> - <% if connection_link.departure.present? %> - <%= link_to_if connection_link.departure, truncate(connection_link.departure.name, :length => 15) , referential_stop_area_path(@referential, connection_link.departure), :title => "#{connection_link.human_attribute_name('departure')} #{connection_link.departure.name}" %> - <% else %> - <%= connection_link.human_attribute_name('undefined') %> - <% end %> - <%= t('.to') %> - <% if connection_link.arrival.present? %> - <%= link_to_if( connection_link.arrival, truncate(connection_link.arrival.name, :length => 15), referential_stop_area_path(@referential, connection_link.arrival), :title => "#{connection_link.human_attribute_name('arrival')} #{connection_link.arrival.name}" ) %> - <% else %> - <%= connection_link.human_attribute_name("undefined") %> - <% end %> - </p> - <p> - <%= connection_link.human_attribute_name('default_duration').capitalize %>: <%= connection_link.default_duration ? connection_link.default_duration.strftime('%Mm %Ss') : connection_link.human_attribute_name("undefined") %> - </p> - </div> -</div>
\ No newline at end of file diff --git a/app/views/connection_links/_connection_link.slim b/app/views/connection_links/_connection_link.slim new file mode 100644 index 000000000..cfe84cc53 --- /dev/null +++ b/app/views/connection_links/_connection_link.slim @@ -0,0 +1,34 @@ +#index_item.panel.panel-default.connection_link + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_referential_connection_link_path(@referential, connection_link), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + = link_to referential_connection_link_path(@referential, connection_link), :method => :delete, :data => {:confirm => t('connection_links.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to([@referential, connection_link], class: 'preview', title: "#{Chouette::ConnectionLink.model_name.human.capitalize} #{connection_link.name}") do + span.name + = truncate(connection_link.name, :length => 20) + + .panel-body + p + = t('.from') + + - if connection_link.departure.present? + = link_to_if connection_link.departure, truncate(connection_link.departure.name, :length => 15) , referential_stop_area_path(@referential, connection_link.departure), :title => "#{connection_link.human_attribute_name('departure')} #{connection_link.departure.name}" + - else + = connection_link.human_attribute_name('undefined') + + = t('.to') + + - if connection_link.arrival.present? + = link_to_if( connection_link.arrival, truncate(connection_link.arrival.name, :length => 15), referential_stop_area_path(@referential, connection_link.arrival), :title => "#{connection_link.human_attribute_name('arrival')} #{connection_link.arrival.name}" ) + - else + = connection_link.human_attribute_name("undefined") + p + = connection_link.human_attribute_name('default_duration').capitalize + = " : " + = connection_link.default_duration ? connection_link.default_duration.strftime('%Mm %Ss') : connection_link.human_attribute_name("undefined")
\ No newline at end of file diff --git a/app/views/connection_links/_connection_links.erb b/app/views/connection_links/_connection_links.erb deleted file mode 100644 index cfc1d45f4..000000000 --- a/app/views/connection_links/_connection_links.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @connection_links %> -</div> -<div class="connection_links paginated_content"> - <%= paginated_content(@connection_links) %> -</div> -<div class="pagination"> - <%= will_paginate @connection_links, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/connection_links/_connection_links.html.slim b/app/views/connection_links/_connection_links.html.slim new file mode 100644 index 000000000..8cf41a6c1 --- /dev/null +++ b/app/views/connection_links/_connection_links.html.slim @@ -0,0 +1,10 @@ +.page_info + span.search + = t("will_paginate.page_entries_info.search") + = page_entries_info @connection_links + +.connection_links.paginated_content + = paginated_content(@connection_links) + +.pagination + = will_paginate @connection_links, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer diff --git a/app/views/connection_links/_form.erb b/app/views/connection_links/_form.erb deleted file mode 100644 index 49ca68aef..000000000 --- a/app/views/connection_links/_form.erb +++ /dev/null @@ -1,24 +0,0 @@ -<%= semantic_form_for [@referential, @connection_link] do |form| %> - <%= form.inputs do %> - <%= form.input :name %> - <%= form.input :connection_link_type, :as => :select, :collection => Chouette::ConnectionLink.connection_link_types, :include_blank => true, :member_label => Proc.new { |type| t("connection_link_types.label.#{type}") } %> - <%= form.input :comment %> - <%= form.input :link_distance, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.connection_link.link_distance") } %> - <%= form.input :mobility_restricted_suitability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <%= form.input :stairs_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <%= form.input :lift_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - - <%= form.input :objectid, :required => !@connection_link.new_record?, :input_html => { :title => t("formtastic.titles.connection_link.objectid")} %> - <% end %> - <%= form.inputs :name => t('connection_links.show.durations') do %> - <%= form.input :default_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :label => @connection_link.human_attribute_name("default_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> - <%= form.input :frequent_traveller_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :include_seconds => true, :label => @connection_link.human_attribute_name("frequent_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> - <%= form.input :occasional_traveller_duration, :as => :extended_time_picker, :size => 8, :include_seconds => true, :label => @connection_link.human_attribute_name("occasional_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> - <%= form.input :mobility_restricted_traveller_duration, :as => :extended_time_picker,:size => 8, :include_seconds => true, :label => @connection_link.human_attribute_name("mobility_restricted_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> diff --git a/app/views/connection_links/_form.html.slim b/app/views/connection_links/_form.html.slim new file mode 100644 index 000000000..afef3bba7 --- /dev/null +++ b/app/views/connection_links/_form.html.slim @@ -0,0 +1,21 @@ += semantic_form_for [@referential, @connection_link] do |form| + = form.inputs do + = form.input :name + = form.input :connection_link_type, as: :select, :collection => Chouette::ConnectionLink.connection_link_types, :include_blank => true, :member_label => Proc.new { |type| t("connection_link_types.label.#{type}") } + = form.input :comment + = form.input :link_distance, input_html: { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.connection_link.link_distance") } + = form.input :mobility_restricted_suitability, as: :select, :collection => [[t("true"), true], [t("false"), false]], include_blank: true + = form.input :stairs_availability, as: :select, :collection => [[t("true"), true], [t("false"), false]], include_blank: true + = form.input :lift_availability, as: :select, :collection => [[t("true"), true], [t("false"), false]], include_blank: true + + = form.input :objectid, :required => !@connection_link.new_record?, :input_html => { :title => t("formtastic.titles.connection_link.objectid")} + + = form.inputs :name => t('connection_links.show.durations') do + = form.input :default_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :label => @connection_link.human_attribute_name("default_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } + = form.input :frequent_traveller_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :include_seconds => true, :label => @connection_link.human_attribute_name("frequent_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } + = form.input :occasional_traveller_duration, :as => :extended_time_picker, :size => 8, :include_seconds => true, :label => @connection_link.human_attribute_name("occasional_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } + = form.input :mobility_restricted_traveller_duration, :as => :extended_time_picker,:size => 8, :include_seconds => true, :label => @connection_link.human_attribute_name("mobility_restricted_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/connection_links/edit.html.erb b/app/views/connection_links/edit.html.erb deleted file mode 100644 index 77200420b..000000000 --- a/app/views/connection_links/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('connection_links.edit.title', :connection_link => @connection_link.name ) %> - -<%= render "form" %> diff --git a/app/views/connection_links/edit.html.slim b/app/views/connection_links/edit.html.slim new file mode 100644 index 000000000..08a6ddd36 --- /dev/null +++ b/app/views/connection_links/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('connection_links.edit.title', :connection_link => @connection_link.name ) + += render 'form'
\ No newline at end of file diff --git a/app/views/connection_links/index.html.erb b/app/views/connection_links/index.html.erb deleted file mode 100644 index 151ce2d89..000000000 --- a/app/views/connection_links/index.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%= title_tag t('connection_links.index.title') %> - -<%= search_form_for @q, :url => referential_connection_links_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <div class="input-group col-md-12"> - <%= f.text_field :name_cont, :placeholder => "#{t('.name')}", :class => "form-control" %> - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div><!-- /input-group --> - <!-- <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> --> - <!-- <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> --> - <!-- </a> --> - </div> -</div> -<% end %> - -<div id="connection_links"><%= render 'connection_links' %></div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('connection_links.actions.new'), new_referential_connection_link_path(@referential), :class => "add" %></li> -</ul> - -<% end %> diff --git a/app/views/connection_links/index.html.slim b/app/views/connection_links/index.html.slim new file mode 100644 index 000000000..d36c6a125 --- /dev/null +++ b/app/views/connection_links/index.html.slim @@ -0,0 +1,23 @@ += title_tag t('connection_links.index.title') + += search_form_for @q, :url => referential_connection_links_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| + .panel.panel-default + .panel-heading + .input-group.col-md-12 + = f.text_field :name_cont, :placeholder => "#{t('.name')}", class: 'form-control' + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + / <!-- /input-group --> + / <!-- <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> --> + / <!-- <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> --> + / <!-- </a> --> + +#connection_links + = render 'connection_links' + +- content_for :sidebar do + ul.actions + li + = link_to t('connection_links.actions.new'), new_referential_connection_link_path(@referential), class: 'add' diff --git a/app/views/connection_links/index.js.erb b/app/views/connection_links/index.js.erb deleted file mode 100644 index c01f09b97..000000000 --- a/app/views/connection_links/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#connection_links').html('<%= escape_javascript(render("connection_links")) %>');
\ No newline at end of file diff --git a/app/views/connection_links/index.js.slim b/app/views/connection_links/index.js.slim new file mode 100644 index 000000000..2be61610e --- /dev/null +++ b/app/views/connection_links/index.js.slim @@ -0,0 +1 @@ +| $('#connection_links').html("#{escape_javascript(render('connection_links'))}");
\ No newline at end of file diff --git a/app/views/connection_links/new.html.erb b/app/views/connection_links/new.html.erb deleted file mode 100644 index bd098adc0..000000000 --- a/app/views/connection_links/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('connection_links.new.title') %> - -<%= render "form" %> diff --git a/app/views/connection_links/new.html.slim b/app/views/connection_links/new.html.slim new file mode 100644 index 000000000..c4acdf622 --- /dev/null +++ b/app/views/connection_links/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('connection_links.new.title') + += render 'form'
\ No newline at end of file diff --git a/app/views/connection_links/select_areas.html.erb b/app/views/connection_links/select_areas.html.slim index b4c40c5f6..85da40eb7 100644 --- a/app/views/connection_links/select_areas.html.erb +++ b/app/views/connection_links/select_areas.html.slim @@ -1,15 +1,11 @@ -<%= title_tag t('connection_links.select_areas.title', :connection_link => @connection_link.name ) %> += title_tag t('connection_links.select_areas.title', connection_link: @connection_link.name) -<%= semantic_form_for [@referential, @connection_link] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :departure_id, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=itl_excluded", :tokenLimit => 1, :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/show', [@departure].compact, :view_path => 'app/views', :format => :json, :scope => self).render } %> - <%= form.input :arrival_id, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=itl_excluded", :tokenLimit => 1, :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/show', [@arrival].compact, :view_path => 'app/views', :format => :json, :scope => self).render } %> - <% end %> += semantic_form_for [@referential, @connection_link] do |form| + div + = form.inputs do + = form.input :departure_id, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=itl_excluded", :tokenLimit => 1, :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/show', [@departure].compact, :view_path => 'app/views', :format => :json, :scope => self).render } + = form.input :arrival_id, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=itl_excluded", :tokenLimit => 1, :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/show', [@arrival].compact, :view_path => 'app/views', :format => :json, :scope => self).render } - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/connection_links/show.html.erb b/app/views/connection_links/show.html.erb deleted file mode 100644 index e715953fc..000000000 --- a/app/views/connection_links/show.html.erb +++ /dev/null @@ -1,102 +0,0 @@ -<%= title_tag t('connection_links.show.title', :connection_link => @connection_link.name ) %> - -<div class="connection_link_show"> - <%= @map.to_html %> - - <div class="summary"> - <p> - <label><%= @connection_link.human_attribute_name(:departure) %>: </label> - <% if @connection_link.departure.present? %> - <%= link_to @connection_link.departure.name, [@referential, @connection_link.departure] %> - <% else %> - <%= @connection_link.human_attribute_name("undefined") %> - <% end %> - </p> - <p> - <label><%= @connection_link.human_attribute_name(:arrival) %>: </label> - <% if @connection_link.arrival.present? %> - <%= link_to @connection_link.arrival.name, [@referential, @connection_link.arrival] %> - <% else %> - <%= @connection_link.human_attribute_name("undefined") %> - <% end %> - </p> - <p> - <label><%= @connection_link.human_attribute_name("connection_link_type") %>: </label> - <% if @connection_link.connection_link_type.blank? %> - <%=t("unknown") %> - <% else %> - <%= t("connection_link_types.label.#{@connection_link.connection_link_type}") %> - <% end %> - </p> - <p> - <label><%= @connection_link.human_attribute_name("comment") %>: </label> - <%= @connection_link.comment %> - </p> - <p> - <label><%= @connection_link.human_attribute_name("link_distance") %>: </label> - <%= @connection_link.link_distance %> - </p> - <p> - <label><%= t('connection_links.show.durations') %> </label> - </p> - <p> - <label class='duration'><%= @connection_link.human_attribute_name("default_duration") %>: </label> - <% if (@connection_link.default_duration.present?) %> - <%= @connection_link.default_duration.strftime('%Hh %Mm %Ss') %> - <% end %> - </p> - <p> - <label class='duration'><%= @connection_link.human_attribute_name("frequent_traveller_duration") %>: </label> - <% if (@connection_link.frequent_traveller_duration.present?) %> - <%= @connection_link.frequent_traveller_duration.strftime('%Hh %Mm %Ss') %> - <% end %> - </p> - <p> - <label class='duration'><%= @connection_link.human_attribute_name("occasional_traveller_duration") %>: </label> - <% if (@connection_link.occasional_traveller_duration.present?) %> - <%= @connection_link.occasional_traveller_duration.strftime('%Hh %Mm %Ss') %> - <% end %> - </p> - <p> - <label class='duration'><%= @connection_link.human_attribute_name("mobility_restricted_traveller_duration") %>: </label> - <% if (@connection_link.mobility_restricted_traveller_duration.present?) %> - <%= @connection_link.mobility_restricted_traveller_duration.strftime('%Hh %Mm %Ss') %> - <% end %> - </p> - <p> - <label><%= @connection_link.human_attribute_name("mobility_restricted_suitability") %>: </label> - <% if (!@connection_link.mobility_restricted_suitability.nil?) %> - <%= t((@connection_link.mobility_restricted_suitability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @connection_link.human_attribute_name("stairs_availability") %>: </label> - <% if (!@connection_link.stairs_availability.nil?) %> - <%= t((@connection_link.stairs_availability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @connection_link.human_attribute_name("lift_availability") %>: </label> - <% if (!@connection_link.lift_availability.nil?) %> - <%= t((@connection_link.lift_availability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('connection_links.actions.new'), new_referential_connection_link_path(@referential), :class => "add" %></li> - <li><%= link_to t('connection_links.actions.edit'), edit_referential_connection_link_path(@referential, @connection_link), :class => "edit" %></li> - <li><%= link_to t('connection_links.actions.destroy'), referential_connection_link_path(@referential, @connection_link), :method => :delete, :data => {:confirm => t('connection_links.actions.destroy_confirm')}, :class => "remove" %></li> - <li><%= link_to t('connection_links.actions.select_areas'), select_areas_referential_connection_link_path(@referential, @connection_link), :class => "select" %></li> - <br> -</ul> - <%= creation_tag(@connection_link) %> -<% end %> diff --git a/app/views/connection_links/show.html.slim b/app/views/connection_links/show.html.slim new file mode 100644 index 000000000..263c4c154 --- /dev/null +++ b/app/views/connection_links/show.html.slim @@ -0,0 +1,92 @@ += title_tag t('connection_links.show.title', :connection_link => @connection_link.name) + +.connection_link_show + = @map.to_html + + .summary + p + label = "#{@connection_link.human_attribute_name(:departure)} : " + - if @connection_link.departure.present? + = link_to @connection_link.departure.name, [@referential, @connection_link.departure] + - else + = @connection_link.human_attribute_name("undefined") + + p + label = "#{@connection_link.human_attribute_name(:arrival)} : " + - if @connection_link.arrival.present? + = link_to @connection_link.arrival.name, [@referential, @connection_link.arrival] + - else + = @connection_link.human_attribute_name("undefined") + + p + label = "#{@connection_link.human_attribute_name('connection_link_type')} : " + - if @connection_link.connection_link_type.blank? + = t("unknown") + - else + = t("connection_link_types.label.#{@connection_link.connection_link_type}") + + p + label = "#{@connection_link.human_attribute_name('comment')} : " + = @connection_link.comment + + p + label = "#{@connection_link.human_attribute_name('link_distance')} : " + = @connection_link.link_distance + + p + label = t('connection_links.show.durations') + + p + label.duration = "#{@connection_link.human_attribute_name('default_duration')} : " + - if @connection_link.default_duration.present? + = @connection_link.default_duration.strftime('%Hh %Mm %Ss') + + p + label.duration = "#{@connection_link.human_attribute_name('frequent_traveller_duration')} : " + - if @connection_link.frequent_traveller_duration.present? + = @connection_link.frequent_traveller_duration.strftime('%Hh %Mm %Ss') + + p + label.duration = "#{@connection_link.human_attribute_name('occasional_traveller_duration')} : " + - if @connection_link.occasional_traveller_duration.present? + = @connection_link.occasional_traveller_duration.strftime('%Hh %Mm %Ss') + + p + label.duration = "#{@connection_link.human_attribute_name('mobility_restricted_traveller_duration')} : " + -if @connection_link.mobility_restricted_traveller_duration.present? + = @connection_link.mobility_restricted_traveller_duration.strftime('%Hh %Mm %Ss') + + p + label = "#{@connection_link.human_attribute_name('mobility_restricted_suitability')} : " + - if !@connection_link.mobility_restricted_suitability.nil? + = t((@connection_link.mobility_restricted_suitability == true).to_s) + - else + = t("unknown") + + p + label = "#{@connection_link.human_attribute_name('stairs_availability')} : " + - if !@connection_link.stairs_availability.nil? + = t((@connection_link.stairs_availability == true).to_s) + - else + = t("unknown") + + p + label = "#{@connection_link.human_attribute_name('lift_availability')} : " + - if !@connection_link.lift_availability.nil? + = t((@connection_link.lift_availability == true).to_s) + - else + = t("unknown") + +- content_for :sidebar do + ul.actions + li + = link_to t('connection_links.actions.new'), new_referential_connection_link_path(@referential), class: 'add' + li + = link_to t('connection_links.actions.edit'), edit_referential_connection_link_path(@referential, @connection_link), class: 'edit' + li + = link_to t('connection_links.actions.destroy'), referential_connection_link_path(@referential, @connection_link), :method => :delete, :data => {:confirm => t('connection_links.actions.destroy_confirm')}, class: 'remove' + li + = link_to t('connection_links.actions.select_areas'), select_areas_referential_connection_link_path(@referential, @connection_link), class: 'select' + br + + = creation_tag(@connection_link)
\ No newline at end of file diff --git a/app/views/connection_links/show.kml.erb b/app/views/connection_links/show.kml.erb deleted file mode 100644 index fa355d7b5..000000000 --- a/app/views/connection_links/show.kml.erb +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% if @connection_link.geometry %> - <Placemark id="route_<%= @connection_link.id %>" > - <name><%= @connection_link.name %></name> - <%= @connection_link.geometry.kml_representation.html_safe %> - </Placemark> - <Placemark id="<%= @connection_link.departure.id %>" > - <departure>true</departure> - <%= @connection_link.departure.geometry.kml_representation.html_safe %> - </Placemark> - <Placemark id="<%= @connection_link.arrival.id %>" > - <arrival>true</arrival> - <%= @connection_link.arrival.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/connection_links/show.kml.slim b/app/views/connection_links/show.kml.slim new file mode 100644 index 000000000..59169dba3 --- /dev/null +++ b/app/views/connection_links/show.kml.slim @@ -0,0 +1,16 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - if @connection_link.geometry + placemark id="route_#{@connection_link.id}" + name = @connection_link.name + = @connection_link.geometry.kml_representation.html_safe + + placemark id="#{@connection_link.departure.id}" + departure true + = @connection_link.departure.geometry.kml_representation.html_safe + + placemark id="#{@connection_link.arrival.id}" + arrival true + = @connection_link.arrival.geometry.kml_representation.html_safe diff --git a/app/views/devise/_links.erb b/app/views/devise/_links.erb deleted file mode 100644 index e2a1bf3ef..000000000 --- a/app/views/devise/_links.erb +++ /dev/null @@ -1,41 +0,0 @@ -<% content_for :sidebar do %> -<ul class="actions"> - <li> - <%- if controller_name != 'sessions' %> - <%= link_to t(".sign_in"), new_session_path(resource_name) %><br /> - <% end -%> - </li> - - <li> - <%- if devise_mapping.registerable? && controller_name != 'registrations' && Rails.application.config.accept_user_creation %> - <%= link_to t(".sign_up"), new_registration_path(resource_name) %><br /> - <% end -%> - </li> - - <li> - <%- if devise_mapping.recoverable? && controller_name != 'passwords' %> - <%= link_to t(".new_password"), new_password_path(resource_name) %><br /> - <% end -%> - </li> - - <li> - <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to t(".new_confirmation"), new_confirmation_path(resource_name) %><br /> - <% end -%> - </li> - - <li> - <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br /> - <% end -%> - </li> - - <li> - <%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br /> - <% end -%> - <% end -%> - </li> -</ul> -<% end %> diff --git a/app/views/devise/_links.html.slim b/app/views/devise/_links.html.slim new file mode 100644 index 000000000..03e2a79e2 --- /dev/null +++ b/app/views/devise/_links.html.slim @@ -0,0 +1,32 @@ +- content_for :sidebar do + ul.actions + li + - if controller_name != 'sessions' + = link_to t(".sign_in"), new_session_path(resource_name) + br + + li + - if devise_mapping.registerable? && controller_name != 'registrations' && Rails.application.config.accept_user_creation + = link_to t(".sign_up"), new_registration_path(resource_name) + br + + li + - if devise_mapping.recoverable? && controller_name != 'passwords' + = link_to t(".new_password"), new_password_path(resource_name) + br + + li + - if devise_mapping.confirmable? && controller_name != 'confirmations' + = link_to t(".new_confirmation"), new_confirmation_path(resource_name) + br + + li + - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' + = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) + br + + li + - if devise_mapping.omniauthable? + - resource_class.omniauth_providers.each do |provider| + = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) + br
\ No newline at end of file diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb deleted file mode 100644 index dae3f3023..000000000 --- a/app/views/devise/confirmations/new.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<div id="sessions_new" class="row"> - <%= render 'devise/shared/intro' %> - <div class="col-md-4 login"> - <div class="panel panel-default"> - <div class="panel-heading"><%= t('.title') %></div> - <div class="panel-body"> - <%= simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal user', method: :post } ) do |form| %> - <%= form.input :email, :label => false, input_html: { :class => "form-control" } %> - <div class="row"> - <div class="col-md-12"> - <%= form.button :submit, t('.title'), :class => "btn-primary" %> - </div> - </div> - <div class="row options"> - <div class="col-md-12 new_password"> - <%= link_to t('devise.links.sign_in'), new_session_path(resource_name) %> - </div> - </div> - <% end %> - </div> - </div> - </div> -</div> diff --git a/app/views/devise/confirmations/new.html.slim b/app/views/devise/confirmations/new.html.slim new file mode 100644 index 000000000..caaf7ae10 --- /dev/null +++ b/app/views/devise/confirmations/new.html.slim @@ -0,0 +1,17 @@ +#sessions_new.row + = render 'devise/shared/intro' + + .col-md-4.login + .panel.panel-default + .panel-heading = t('.title') + + .panel-body + = simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal user', method: :post } ) do |form| + = form.input :email, :label => false, input_html: { :class => "form-control" } + .row + .col-md-12 + = form.button :submit, t('.title'), class: 'btn-primary' + + .row.options + .col-md-12.new_password + = link_to t('devise.links.sign_in'), new_session_path(resource_name)
\ No newline at end of file diff --git a/app/views/devise/invitations/edit.html.erb b/app/views/devise/invitations/edit.html.erb deleted file mode 100644 index b8683327d..000000000 --- a/app/views/devise/invitations/edit.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<div class="col-md-offset-2 col-md-8"> - <div class="panel panel-default"> - <div class="panel-heading"><%= t "devise.invitations.edit.header" %></div> - <div class="panel-body"> - - <%= simple_form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => { :method => :put, class: "form-horizontal" } do |form| %> - <%= form.hidden_field :invitation_token %> - - <%= form.input :name %> - <%= form.input :password, :as => :password %> - <%= form.input :password_confirmation, :as => :password %> - - <div class="submit"> - <%= form.button :submit, :value => t("devise.invitations.edit.submit_button"), :class => "btn-info" %> - </div> - <% end %> - </div> - </div> -</div> diff --git a/app/views/devise/invitations/edit.html.slim b/app/views/devise/invitations/edit.html.slim new file mode 100644 index 000000000..6c9a6f436 --- /dev/null +++ b/app/views/devise/invitations/edit.html.slim @@ -0,0 +1,14 @@ +.col-md-offset-2.col-md-8 + .panel.panel-default + .panel-heading = t('devise.invitations.edit.header') + + .panel-body + = simple_form_for resource, as: resource_name, :url => invitation_path(resource_name), :html => { :method => :put, class: "form-horizontal" } do |form| + = form.hidden_field :invitation_token + + = form.input :name + = form.input :password, as: :password + = form.input :password_confirmation, as: :password + + .submit + = form.button :submit, value: t('devise.invitations.edit.submit_button'), class: 'btn-info'
\ No newline at end of file diff --git a/app/views/devise/invitations/new.html.erb b/app/views/devise/invitations/new.html.erb deleted file mode 100644 index 25c452d42..000000000 --- a/app/views/devise/invitations/new.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<h2><%= t "devise.invitations.new.header" %></h2> - -<%= simple_form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :post, class: "form-horizontal"} do |form| %> - <%= form.input :organisation_id, :as => :hidden, input_html: { :value => current_organisation.id } %> - - <% resource.class.invite_key_fields.each do |field| -%> - <%= form.input field %> - <% end -%> - - <div class="form-actions"> - <%= form.button :submit, :value => t("devise.invitations.new.submit_button"), :class => "btn-info" %> - </div> -<% end %> diff --git a/app/views/devise/invitations/new.html.slim b/app/views/devise/invitations/new.html.slim new file mode 100644 index 000000000..87bfbf750 --- /dev/null +++ b/app/views/devise/invitations/new.html.slim @@ -0,0 +1,10 @@ +h2 = t('devise.invitations.new.header') + += simple_form_for resource, as: resource_name, :url => invitation_path(resource_name), :html => {:method => :post, class: "form-horizontal"} do |form| + = form.input :organisation_id, :as => :hidden, input_html: { :value => current_organisation.id } + + - resource.class.invite_key_fields.each do |field| + = form.input field + + .form-actions + = form.button :submit, value: t('devise.invitations.new.submit_button'), class: 'btn-info'
\ No newline at end of file diff --git a/app/views/devise/mailer/confirmation_instructions.fr.html.erb b/app/views/devise/mailer/confirmation_instructions.fr.html.erb deleted file mode 100644 index a719299ff..000000000 --- a/app/views/devise/mailer/confirmation_instructions.fr.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<p>Bonjour <%= @resource.email %>!</p> - -<p>Vous pouvez confirmer votre compte email en cliquant sur le lien suivant:</p> - -<p><%= link_to 'Confirmer mon compte', confirmation_url(@resource, :confirmation_token => @token) %></p> - diff --git a/app/views/devise/mailer/confirmation_instructions.fr.html.slim b/app/views/devise/mailer/confirmation_instructions.fr.html.slim new file mode 100644 index 000000000..6bdbb5f72 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.fr.html.slim @@ -0,0 +1,5 @@ +p = "Bonjour #{@resource.email} !" + +p = "Vous pouvez confirmer votre compte email en cliquant sur le lien suivant:" + +p = link_to 'Confirmer mon compte', confirmation_url(@resource, :confirmation_token => @token)
\ No newline at end of file diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb deleted file mode 100644 index 99fd7b743..000000000 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<p>Welcome <%= @resource.email %>!</p> - -<p>You can confirm your account email through the link below:</p> - -<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %></p> diff --git a/app/views/devise/mailer/confirmation_instructions.html.slim b/app/views/devise/mailer/confirmation_instructions.html.slim new file mode 100644 index 000000000..0bf19ba19 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.slim @@ -0,0 +1,5 @@ +p = "Welcome #{@resource.email}!" + +p = "You can confirm your account email through the link below:" + +p = link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token)
\ No newline at end of file diff --git a/app/views/devise/mailer/invitation_instructions.fr.html.erb b/app/views/devise/mailer/invitation_instructions.fr.html.erb deleted file mode 100644 index a35a3ec1b..000000000 --- a/app/views/devise/mailer/invitation_instructions.fr.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<p><%= t("devise.mailer.invitation_instructions.hello", email: @resource.email) %></p> - -<p><%= t("devise.mailer.invitation_instructions.someone_invited_you", url: unauthenticated_root_url) %></p> - -<p><%= link_to t("devise.mailer.invitation_instructions.accept"), accept_invitation_url(@resource, :invitation_token => @token) %></p> - -<p><%= t("devise.mailer.invitation_instructions.ignore").html_safe %></p> diff --git a/app/views/devise/mailer/invitation_instructions.fr.html.slim b/app/views/devise/mailer/invitation_instructions.fr.html.slim new file mode 100644 index 000000000..484e0d68d --- /dev/null +++ b/app/views/devise/mailer/invitation_instructions.fr.html.slim @@ -0,0 +1,7 @@ +p = t("devise.mailer.invitation_instructions.hello", email: @resource.email) + +p = t("devise.mailer.invitation_instructions.someone_invited_you", url: unauthenticated_root_url) + +p = link_to t("devise.mailer.invitation_instructions.accept"), accept_invitation_url(@resource, :invitation_token => @token) + +p = t("devise.mailer.invitation_instructions.ignore").html_safe
\ No newline at end of file diff --git a/app/views/devise/mailer/reset_password_instructions.fr.html.erb b/app/views/devise/mailer/reset_password_instructions.fr.html.erb deleted file mode 100644 index 7074a4c70..000000000 --- a/app/views/devise/mailer/reset_password_instructions.fr.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<p>Bonjour <%= @resource.email %>!</p> - -<p>Une demande de changement de mot de passe a été reçue, vous pouvez modifier votre mot de passe en suivant le lien ci-dessous.</p> - -<p><%= link_to 'Modifier mon mot de passe', edit_password_url(@resource, :reset_password_token => @token) %></p> - -<p>Si vous ne souhaitez pas modifier votre mot de passe, ignorez ce message.</p> -<p>Votre mot de passe est conservé jusqu'à ce que vous suiviez le lien ci-dessus et que vous définissiez un nouveau mot de passe.</p> - diff --git a/app/views/devise/mailer/reset_password_instructions.fr.html.slim b/app/views/devise/mailer/reset_password_instructions.fr.html.slim new file mode 100644 index 000000000..621d06978 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.fr.html.slim @@ -0,0 +1,8 @@ +p = "Bonjour #{@resource.email} !" + +p = "Une demande de changement de mot de passe a été reçue, vous pouvez modifier votre mot de passe en suivant le lien ci-dessous." + +p = link_to 'Modifier mon mot de passe', edit_password_url(@resource, :reset_password_token => @token) + +p = "Si vous ne souhaitez pas modifier votre mot de passe, ignorez ce message." +p = "Votre mot de passe est conservé jusqu'à ce que vous suiviez le lien ci-dessus et que vous définissiez un nouveau mot de passe."
\ No newline at end of file diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb deleted file mode 100644 index 8489e53d8..000000000 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<p>Hello <%= @resource.email %>!</p> - -<p>Someone has requested a link to change your password, and you can do this through the link below.</p> - -<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %></p> - -<p>If you didn't request this, please ignore this email.</p> -<p>Your password won't change until you access the link above and create a new one.</p> diff --git a/app/views/devise/mailer/reset_password_instructions.html.slim b/app/views/devise/mailer/reset_password_instructions.html.slim new file mode 100644 index 000000000..b577fb1e3 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.slim @@ -0,0 +1,8 @@ +p = "Hello #{@resource.email}!" + +p = "Someone has requested a link to change your password, and you can do this through the link below." + +p = link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) + +p = "If you didn't request this, please ignore this email." +p = "Your password won't change until you access the link above and create a new one."
\ No newline at end of file diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb deleted file mode 100644 index 06ecbe409..000000000 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<p>Hello <%= @resource.email %>!</p> - -<p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p> - -<p>Click the link below to unlock your account:</p> - -<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) %></p> diff --git a/app/views/devise/mailer/unlock_instructions.html.slim b/app/views/devise/mailer/unlock_instructions.html.slim new file mode 100644 index 000000000..962245c88 --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.slim @@ -0,0 +1,7 @@ +p = "Hello #{@resource.email}!" + +p = "Your account has been locked due to an excessive amount of unsuccessful sign in attempts." + +p = "Click the link below to unlock your account:" + +p = link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token)
\ No newline at end of file diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb deleted file mode 100644 index 0d3d1d99d..000000000 --- a/app/views/devise/passwords/edit.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<div class="col-md-offset-2 col-md-8"> - <div class="panel panel-default"> - <div class="panel-heading"><%= t('.title') %></div> - <div class="panel-body"> - <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, class: "form-horizontal" }) do |f| %> - - <%= f.input :reset_password_token, :as => :hidden %> - <%= f.input :password, :as => :password %> - <%= f.input :password_confirmation, :as => :password %> - - <div class="form-actions"> - <%= link_to t("cancel"), unauthenticated_root_path, :class => "btn btn-default" %> - <%= f.button :submit, :value => t("devise.passwords.edit.commit"), :class => "btn-info" %> - </div> - <% end %> - </div> - </div> -</div> diff --git a/app/views/devise/passwords/edit.html.slim b/app/views/devise/passwords/edit.html.slim new file mode 100644 index 000000000..864a44499 --- /dev/null +++ b/app/views/devise/passwords/edit.html.slim @@ -0,0 +1,13 @@ +.col-md-offset-2.col-md-8 + .panel.panel-default + .panel-heading = t('.title') + .panel-body + = simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, class: "form-horizontal" }) do |f| + + = f.input :reset_password_token, as: :hidden + = f.input :password, as: :password + = f.input :password_confirmation, as: :password + + .form-actions + = link_to t("cancel"), unauthenticated_root_path, class: 'btn btn-default' + = f.button :submit, :value => t("devise.passwords.edit.commit"), class: 'btn-info'
\ No newline at end of file diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb deleted file mode 100644 index 9ca4842e6..000000000 --- a/app/views/devise/passwords/new.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<div class="col-md-offset-2 col-md-8"> - <div class="panel panel-default"> - <div class="panel-heading"><%= t('.title') %></div> - <div class="panel-body"> - <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {class: 'form-horizontal' } ) do |form| %> - <%= form.input :email, :as => :email, placeholder: 'user@domain.com' %> - - <div class="form-actions"> - <%= link_to t("cancel"), unauthenticated_root_path, :class => "btn btn-default" %> - <%= form.button :submit, :value => t("devise.passwords.new.commit"), :class => "btn-info" %> - </div> - <% end %> - </div> - </div> -</div> - - diff --git a/app/views/devise/passwords/new.html.slim b/app/views/devise/passwords/new.html.slim new file mode 100644 index 000000000..8a739ecc1 --- /dev/null +++ b/app/views/devise/passwords/new.html.slim @@ -0,0 +1,11 @@ +.col-md-offset-2.col-md-8 + .panel.panel-default + .panel-heading = t('.title') + + .panel-body + = simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {class: 'form-horizontal' } ) do |form| + = form.input :email, :as => :email, placeholder: 'user@domain.com' + + .form-actions + = link_to t("cancel"), unauthenticated_root_path, class: 'btn btn-default' + = form.button :submit, :value => t("devise.passwords.new.commit"), class: 'btn-info'
\ No newline at end of file diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb deleted file mode 100644 index dd3051098..000000000 --- a/app/views/devise/registrations/edit.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<%= title_tag t('.title') %> - -<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "form-horizontal", method: :put }) do |f| %> - <%= f.error_notification %> - - <div class="form-inputs"> - <%= f.input :email, required: true, autofocus: true %> - <%= f.input :name, required: true %> - - <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> - <p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p> - <% end %> - - <%= f.input :password, autocomplete: "off", required: false %> - <%= f.input :password_confirmation, required: false %> - <%= f.input :current_password, required: true %> - </div> - - <div class="form-actions"> - <%= f.button :submit %> - <%= link_to t("cancel"), :back %> - </div> -<% end %> diff --git a/app/views/devise/registrations/edit.html.slim b/app/views/devise/registrations/edit.html.slim new file mode 100644 index 000000000..42c84cb64 --- /dev/null +++ b/app/views/devise/registrations/edit.html.slim @@ -0,0 +1,19 @@ += title_tag t('.title') + += simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "form-horizontal", method: :put }) do |f| + = f.error_notification + + .form-inputs + = f.input :email, required: true, autofocus: true + = f.input :name, required: true + + - if devise_mapping.confirmable? && resource.pending_reconfirmation? + p = "Currently waiting confirmation for: #{resource.unconfirmed_email}." + + = f.input :password, autocomplete: "off", required: false + = f.input :password_confirmation, required: false + = f.input :current_password, required: true + + .form-actions + = f.button :submit + = link_to t('cancel'), :back
\ No newline at end of file diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb deleted file mode 100644 index 045357c22..000000000 --- a/app/views/devise/registrations/new.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<div id="registrations_new" class="col-lg-offset-4 col-lg-4"> -<%= render partial: 'devise/shared/form_registration', locals: { - organisation: (resource.organisation || Organisation.new) -} %> -</div> diff --git a/app/views/devise/registrations/new.html.slim b/app/views/devise/registrations/new.html.slim new file mode 100644 index 000000000..4dbe5b0bc --- /dev/null +++ b/app/views/devise/registrations/new.html.slim @@ -0,0 +1,4 @@ +#registrations_new.col-lg-offset-4.col-lg-4 + = render partial: 'devise/shared/form_registration', locals: { + organisation: (resource.organisation || Organisation.new) + }
\ No newline at end of file diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb deleted file mode 100644 index 4df538161..000000000 --- a/app/views/devise/sessions/new.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -<div id="sessions_new" class="row"> - <%= render 'devise/shared/intro' %> - <div class="col-md-4 login"> - <div class="panel panel-default"> - <div class="panel-body"> - <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal session_new' } ) do |form| %> - <%= form.input :email, :label => false, input_html: { :class => "form-control" } %> - <div class="row"> - <div class="col-md-6"> - <%= form.input :password, :as => :password, :label => false, input_html: { :class => "form-control" } %> - </div> - <div class="col-md-6"> - <%= form.button :submit, t("devise.sessions.new.commit"), :class => "btn-primary" %> - </div> - </div> - <div class="row options"> - <div class="col-md-6"> - <% if devise_mapping.rememberable? %> - <%= form.input :remember_me, :as => :boolean if devise_mapping.rememberable? %> - <% end %> - </div> - <div class="col-md-6 new_password"> - <%= link_to t("devise.links.new_password"), new_password_path(resource_name) %> - <!-- FIXME ref #819 --> - <%- if false %> - <% if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <br> - <%= link_to t("devise.links.new_confirmation"), new_confirmation_path(resource_name) %> - <% end %> - <% end %> - </div> - </div> - <% end %> - </div> - </div> - <!-- FIXME ref #819 --> - <%- if false %> - <%= render partial: 'devise/shared/form_registration', locals: { - organisation: (resource.organisation || Organisation.new) } %> - <% end %> - - </div> -</div> - diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim new file mode 100644 index 000000000..c69f9dc3b --- /dev/null +++ b/app/views/devise/sessions/new.html.slim @@ -0,0 +1,34 @@ +#sessions_new.row + = render 'devise/shared/intro' + + .col-md-4.login + .panel.panel-default + .panel-body + = simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal session_new' } ) do |form| + + = form.input :email, :label => false, input_html: { :class => "form-control" } + + .row + .col-md-6 + = form.input :password, :as => :password, :label => false, input_html: { :class => "form-control" } + + .col-md-6 + = form.button :submit, t("devise.sessions.new.commit"), :class => "btn-primary" + + .row.options + .col-md-6 + - if devise_mapping.rememberable? + = form.input :remember_me, :as => :boolean if devise_mapping.rememberable? + + .col-md-6.new_password + = link_to t("devise.links.new_password"), new_password_path(resource_name) + + / FIXME ref #819 + - if false + - if devise_mapping.confirmable? && controller_name != 'confirmations' + br + = link_to t("devise.links.new_confirmation"), new_confirmation_path(resource_name) + + / FIXME ref #819 + - if false + = render partial: 'devise/shared/form_registration', locals: { organisation: (resource.organisation || Organisation.new) }
\ No newline at end of file diff --git a/app/views/devise/shared/_form_registration.html.erb b/app/views/devise/shared/_form_registration.html.erb deleted file mode 100644 index 4b66121d6..000000000 --- a/app/views/devise/shared/_form_registration.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<% if Rails.application.config.accept_user_creation %> - <div class="panel panel-default"> - <div class="panel-heading"><%= t("devise.registrations.new.title") %></div> - <div class="panel-body"> - <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :wrapper => "form_without_label", html: { class: "form-horizontal registration_new" } ) do |form| %> - <%= form.simple_fields_for :organisation, organisation do |organisation| %> - <%= organisation.input :name, :label => false, input_html: { :class => "form-control" } %> - <% end %> - <%= form.input :name, :label => false, input_html: { :class => "form-control" } %> - <%= form.input :email, :label => false, input_html: { :class => "form-control" } %> - <%= form.input :password, :as => :password, :label => false, input_html: { :class => "form-control" } %> - <%= form.input :password_confirmation, :as => :password, :label => false, input_html: { :class => "form-control" } %> - <%= form.button :submit, t("devise.registrations.new.commit"), :class => "btn-info" %> - <% end %> - </div> - </div> -<% end %> diff --git a/app/views/devise/shared/_form_registration.html.slim b/app/views/devise/shared/_form_registration.html.slim new file mode 100644 index 000000000..5421ddc29 --- /dev/null +++ b/app/views/devise/shared/_form_registration.html.slim @@ -0,0 +1,13 @@ +- if Rails.application.config.accept_user_creation + .panel.panel-default + .panel-heading = t('devise.registrations.new.title') + .panel-body + = simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :wrapper => "form_without_label", html: { class: "form-horizontal registration_new" } ) do |form| + = form.simple_fields_for :organisation, organisation do |organisation| + = organisation.input :name, :label => false, input_html: { :class => "form-control" } + + = form.input :name, :label => false, input_html: { :class => "form-control" } + = form.input :email, :label => false, input_html: { :class => "form-control" } + = form.input :password, :as => :password, :label => false, input_html: { :class => "form-control" } + = form.input :password_confirmation, :as => :password, :label => false, input_html: { :class => "form-control" } + = form.button :submit, t("devise.registrations.new.commit"), :class => "btn-info"
\ No newline at end of file diff --git a/app/views/devise/shared/_intro.html.erb b/app/views/devise/shared/_intro.html.erb deleted file mode 100644 index b56559352..000000000 --- a/app/views/devise/shared/_intro.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="col-md-8 product_summary"> - <h2><%= t("devise.sessions.new.welcome") %></h2> - <p><%= t("devise.sessions.new.introduction1") %></p> - <p><%= t("devise.sessions.new.introduction2") %></p> - <ul> - <li>- <%= t("devise.sessions.new.introduction_item1") %></li> - <li>- <%= t("devise.sessions.new.introduction_item2") %></li> - </ul> -</div> diff --git a/app/views/devise/shared/_intro.html.slim b/app/views/devise/shared/_intro.html.slim new file mode 100644 index 000000000..5aafc3c6f --- /dev/null +++ b/app/views/devise/shared/_intro.html.slim @@ -0,0 +1,7 @@ +.col-md-8.product_summary + h2 = t("devise.sessions.new.welcome") + p = t("devise.sessions.new.introduction1") + p = t("devise.sessions.new.introduction2") + ul + li = "- #{t('devise.sessions.new.introduction_item1')}" + li = "- #{t('devise.sessions.new.introduction_item2')}"
\ No newline at end of file diff --git a/app/views/devise/shared/links.erb b/app/views/devise/shared/links.erb deleted file mode 100644 index 9d74c7a0e..000000000 --- a/app/views/devise/shared/links.erb +++ /dev/null @@ -1,32 +0,0 @@ -<% content_for :sidebar do %> -<ul class="actions"> - - <%- if controller_name != 'sessions' %> - <li> - <%= link_to t('devise.sessions.actions.new'), new_session_path(resource_name) %> - </li> - <% end -%> - - <li> - <%= link_to t('subscriptions.actions.new'), new_subscription_path %> - </li> - - <%- if devise_mapping.recoverable? && controller_name != 'passwords' %> - <li> - <%= link_to t('devise.passwords.actions.new'), new_password_path(resource_name) %> - </li> - <% end -%> - - <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <li> - <%= link_to t('devise.confirmations.actions.new'), new_confirmation_path(resource_name) %> - </li> - <% end -%> - - <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <li> - <%= link_to t('devise.unlocks.actions.new'), new_unlock_path(resource_name) %> - </li> - <% end -%> -</ul> -<% end %> diff --git a/app/views/devise/shared/links.html.slim b/app/views/devise/shared/links.html.slim new file mode 100644 index 000000000..4d203744f --- /dev/null +++ b/app/views/devise/shared/links.html.slim @@ -0,0 +1,21 @@ +- content_for :sidebar do + ul.actions + + - if controller_name != 'sessions' + li + = link_to t('devise.sessions.new.title'), new_session_path(resource_name) + + li + = link_to t('subscriptions.actions.new'), new_subscription_path + + - if devise_mapping.recoverable? && controller_name != 'passwords' + li + = link_to t('devise.passwords.new'), new_password_path(resource_name) + + - if devise_mapping.confirmable? && controller_name != 'confirmations' + li + = link_to t('devise.confirmations.new'), new_confirmation_path(resource_name) + + - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' + li + = link_to t('devise.unlock.new.title'), new_unlock_path(resource_name)
\ No newline at end of file diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb deleted file mode 100644 index 572fea1c6..000000000 --- a/app/views/devise/unlocks/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<h2>Resend unlock instructions</h2> - -<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> - - <p><%= f.label :email %><br /> - <%= f.text_field :email %></p> - - <p><%= f.submit "Resend unlock instructions" %></p> -<% end %> - -<%= render "links" %>
\ No newline at end of file diff --git a/app/views/devise/unlocks/new.html.slim b/app/views/devise/unlocks/new.html.slim new file mode 100644 index 000000000..93276522e --- /dev/null +++ b/app/views/devise/unlocks/new.html.slim @@ -0,0 +1,14 @@ +h2 = t('devise.unlock.new.title') + += form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| + = devise_error_messages! + + p + = f.label :email + br + = f.text_field :email + + p = f.submit t('devise.unlock.new.title') + + += render "links"
\ No newline at end of file diff --git a/app/views/errors/not_found.html.erb b/app/views/errors/not_found.html.erb deleted file mode 100644 index 8d761413f..000000000 --- a/app/views/errors/not_found.html.erb +++ /dev/null @@ -1,13 +0,0 @@ - <div class="error"> - <h2>Désolé, la page demandée n'existe pas</h2> - <a href="http://www.chouette.mobi/spip.php?rubrique38" target="_blank">N'hésitez pas à nous décrire le problème</a>, nous essaierons de le résoudre.<br/>Merci d'avance<br/> <br/> - Vous pouvez néanmoins continuer à utiliser l'application CHOUETTE<br/> - <br/> - <br/> - <br/> - <br/> - <h2>The page you were looking for doesn't exist.</h2> - You may have mistyped the address or the page may have moved. <br/> - <a href="http://www.chouette.mobi/spip.php?rubrique38" target="_blank">Please describe us what happened</a>, we'll try to come back with an answer. <br/>Thank you. <br/> <br/> - You can still continue the use the CHOUETTE application. <br/> - </div> diff --git a/app/views/errors/not_found.html.slim b/app/views/errors/not_found.html.slim new file mode 100644 index 000000000..30107d2dc --- /dev/null +++ b/app/views/errors/not_found.html.slim @@ -0,0 +1,31 @@ +.error + h2 = "Désolé, la page demandée n'existe pas" + + a href="http://www.chouette.mobi/spip.php?rubrique38" target="_blank" + = "N'hésitez pas à nous décrire le problème" + = ", nous essaierons de le résoudre." + br + = "Merci d'avance" + br + + = "Vous pouvez néanmoins continuer à utiliser l'application CHOUETTE" + br + br + br + br + br + + h2 = "The page you were looking for doesn't exist." + + = "You may have mistyped the address or the page may have moved." + br + + a href="http://www.chouette.mobi/spip.php?rubrique38" target="_blank" + = "Please describe us what happened" + = ", we'll try to come back with an answer." + br + = "Thank you." + br + br + = "You can still continue the use the CHOUETTE application." + br
\ No newline at end of file diff --git a/app/views/errors/server_error.html.erb b/app/views/errors/server_error.html.erb deleted file mode 100644 index 0a000df2e..000000000 --- a/app/views/errors/server_error.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - <div class="error"> - <h2>Désolé, une erreur est survenue</h2> - <a href="http://www.chouette.mobi/spip.php?rubrique38" target="_blank">N'hésitez pas à nous décrire le problème</a>, nous essaierons de le résoudre.<br/>Merci d'avance<br/> <br/> - Vous pouvez néanmoins continuer à utiliser l'application CHOUETTE<br/> - <br/> - <br/> - <br/> - <br/> - <h2>We're sorry, but something went wrong.</h2> - You may have mistyped the address or the page may have moved. <br/> - <a href="http://www.chouette.mobi/spip.php?rubrique38" target="_blank">Please describe us what happened</a>, we'll try to come back with an answer. <br/>Thank you. <br/> <br/> - You can still continue the use the CHOUETTE application. <br/> - </div> - diff --git a/app/views/errors/server_error.html.slim b/app/views/errors/server_error.html.slim new file mode 100644 index 000000000..3fe910196 --- /dev/null +++ b/app/views/errors/server_error.html.slim @@ -0,0 +1,33 @@ +.error + h2 = "Désolé, une erreur est survenue" + + a href="http://www.chouette.mobi/spip.php?rubrique38" target="_blank" + = "N'hésitez pas à nous décrire le problème" + = ", nous essaierons de le résoudre." + br + = "Merci d'avance" + br + br + + = "Vous pouvez néanmoins continuer à utiliser l'application CHOUETTE" + br + br + br + br + br + + h2 = "We're sorry, but something went wrong." + + = "You may have mistyped the address or the page may have moved." + br + + a href="http://www.chouette.mobi/spip.php?rubrique38" target="_blank" + = "Please describe us what happened" + = ", we'll try to come back with an answer." + br + = "Thank you." + br + br + + = "You can still continue the use the CHOUETTE application." + br
\ No newline at end of file diff --git a/app/views/export_tasks/_fields_gtfs_export.html.erb b/app/views/export_tasks/_fields_gtfs_export.html.erb deleted file mode 100644 index 7edb02bfa..000000000 --- a/app/views/export_tasks/_fields_gtfs_export.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<%= form.input :time_zone, :as => :time_zone, :input_html => { :value => @referential.time_zone ,:title => t("formtastic.titles.export_task.time_zone")} %> -<%= form.input :object_id_prefix, :input_html => { :value => @referential.prefix ,:title => t("formtastic.titles.export_task.object_id_prefix")} %> diff --git a/app/views/export_tasks/_fields_gtfs_export.html.slim b/app/views/export_tasks/_fields_gtfs_export.html.slim new file mode 100644 index 000000000..e95e86230 --- /dev/null +++ b/app/views/export_tasks/_fields_gtfs_export.html.slim @@ -0,0 +1,3 @@ += form.input :time_zone, as: :time_zone, :input_html => { :value => @referential.time_zone ,:title => t("formtastic.titles.export_task.time_zone")} + += form.input :object_id_prefix, :input_html => { :value => @referential.prefix ,:title => t("formtastic.titles.export_task.object_id_prefix")}
\ No newline at end of file diff --git a/app/views/export_tasks/_fields_hub_export.html.erb b/app/views/export_tasks/_fields_hub_export.html.slim index e69de29bb..e69de29bb 100644 --- a/app/views/export_tasks/_fields_hub_export.html.erb +++ b/app/views/export_tasks/_fields_hub_export.html.slim diff --git a/app/views/export_tasks/_fields_kml_export.html.erb b/app/views/export_tasks/_fields_kml_export.html.slim index e69de29bb..e69de29bb 100644 --- a/app/views/export_tasks/_fields_kml_export.html.erb +++ b/app/views/export_tasks/_fields_kml_export.html.slim diff --git a/app/views/export_tasks/_fields_neptune_export.html.erb b/app/views/export_tasks/_fields_neptune_export.html.erb deleted file mode 100644 index 9f331d329..000000000 --- a/app/views/export_tasks/_fields_neptune_export.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<%= form.input :projection_type, :as => :hidden, :input_html => { :value => @referential.projection_type || "" } %> -<%= form.input :extensions , :as => :boolean%> diff --git a/app/views/export_tasks/_fields_neptune_export.html.slim b/app/views/export_tasks/_fields_neptune_export.html.slim new file mode 100644 index 000000000..43749c87e --- /dev/null +++ b/app/views/export_tasks/_fields_neptune_export.html.slim @@ -0,0 +1,2 @@ += form.input :projection_type, as: :hidden, :input_html => { :value => @referential.projection_type || "" } += form.input :extensions , as: :boolean
\ No newline at end of file diff --git a/app/views/export_tasks/_fields_netex_export.html.erb b/app/views/export_tasks/_fields_netex_export.html.slim index e69de29bb..e69de29bb 100644 --- a/app/views/export_tasks/_fields_netex_export.html.erb +++ b/app/views/export_tasks/_fields_netex_export.html.slim diff --git a/app/views/export_tasks/new.html.erb b/app/views/export_tasks/new.html.erb deleted file mode 100644 index 81180bf3b..000000000 --- a/app/views/export_tasks/new.html.erb +++ /dev/null @@ -1,37 +0,0 @@ -<%= title_tag t(".title") %> -<ul class="nav nav-pills"> - <% ExportTask.data_formats.each do |format| %> - <li role="presentation"><a href="#<%= format %>" class='<%= @export_task.data_format == format ? "#{format} active" : "#{format}" %>' title='<%= t(:"enumerize.data_format_detail.#{format}")%>' data-toggle="tab"><%= t(:"enumerize.data_format.#{format}") %></a></li> - <% end %> -</ul> - -<div class="tab-content"> -<% @available_exports.each do |export_task| %> - <%= semantic_form_for [@referential, export_task], :as => :export_task, :url => referential_export_tasks_path(@referential), :namespace => export_task.data_format ,:html => { :id => "#{export_task.data_format}", :class => "tab-pane highlight"} 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 :data_format, :as => :hidden %> - <%= form.input :referential_id, :as => :hidden, :input_html => { :value => @referential.id } %> - <%= form.input :name %> - <%= form.input :references_type, as: :select, include_blank: t(".all"), collection: export_task.class.references_type.options.map { |o| o << {data:{"hidden-attributes" => export_task.class.optional_attributes(o.second).join(',') }} } %> - <% export_task.class.references_types.each do |type| %> - <%= form.input :reference_ids, :as => :reference_ids, :json => references_referential_export_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 => "#{export_task.data_format}_#{type}_reference_ids", :input_html => { :id => "#{export_task.data_format}_#{type}_reference_ids" }, :wrapper_html => { style: "display:none;", "data-type" => type.to_s } %> - <% end %> - <% end %> - - <%= form.input :start_date, :as => :date_picker, :input_html => { :title => t("formtastic.titles.export_task.start_date")} %> - <%= form.input :end_date, :as => :date_picker, :input_html => { :title => t("formtastic.titles.export_task.end_date")} %> - - <%= render partial: "fields_#{export_task.data_format}_export", :locals => { :form => form } %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button , :label => t( 'formtastic.export' ) %> - <%= form.action :cancel, :as => :link %> - <% end %> - - <% end %> -<% end %> -</div> - -<%= javascript_include_tag new_referential_export_task_path(@referential, :format => :js) %> diff --git a/app/views/export_tasks/new.html.slim b/app/views/export_tasks/new.html.slim new file mode 100644 index 000000000..5f89f5865 --- /dev/null +++ b/app/views/export_tasks/new.html.slim @@ -0,0 +1,32 @@ += title_tag t(".title") + +ul.nav.nav-pills + - ExportTask.data_formats.each do |format| + li role="presentation" + a href="##{format}" class=("#{@export_task.data_format == format ? "#{format} active" : "#{format}"}") title="#{t(:"enumerize.data_format_detail.#{format}")}" data-toggle="tab" + = t(:"enumerize.data_format.#{format}") + +.tab-content + - @available_exports.each do |export_task| + = semantic_form_for [@referential, export_task], :as => :export_task, :url => referential_export_tasks_path(@referential), :namespace => export_task.data_format ,:html => { :id => "#{export_task.data_format}", :class => "tab-pane highlight"} 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 :data_format, as: :hidden + = form.input :referential_id, as: :hidden, :input_html => { :value => @referential.id } + = form.input :name + = form.input :references_type, as: :select, include_blank: t(".all"), collection: export_task.class.references_type.options.map { |o| o << {data:{"hidden-attributes" => export_task.class.optional_attributes(o.second).join(',') }} } + + - export_task.class.references_types.each do |type| + = form.input :reference_ids, as: :reference_ids, :json => references_referential_export_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 => "#{export_task.data_format}_#{type}_reference_ids", :input_html => { :id => "#{export_task.data_format}_#{type}_reference_ids" }, :wrapper_html => { style: "display:none;", "data-type" => type.to_s } + + = form.input :start_date, as: :date_picker, :input_html => { :title => t("formtastic.titles.export_task.start_date")} + = form.input :end_date, as: :date_picker, :input_html => { :title => t("formtastic.titles.export_task.end_date")} + + = render partial: "fields_#{export_task.data_format}_export", :locals => { :form => form } + + = form.actions do + = form.action :submit, as: :button , :label => t('formtastic.export') + = form.action :cancel, as: :link + += javascript_include_tag new_referential_export_task_path(@referential, :format => :js) diff --git a/app/views/exports/_export.erb b/app/views/exports/_export.erb deleted file mode 100644 index 005ac011a..000000000 --- a/app/views/exports/_export.erb +++ /dev/null @@ -1,25 +0,0 @@ -<div id="index_item" class="panel panel-default export"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to referential_export_path(@referential, export.id), :method => :delete, :data => {:confirm => t('exports.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to( referential_export_path(@referential, export.id), :class => "preview", :title => "#{Export.model_name.human.capitalize} #{export.name}") do %> - <%= job_status_title(export) %> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p><%= link_to( font_awesome_classic_tag("fa-file-#{export.filename_extension}-o") + t("exports.show.exported_file"), exported_file_referential_export_path(@referential, export.id) ) if export.file_path %></p> - </div> - <div class="panel-footer"> - <%= export_attributes_tag(export) %> - <div class="history"> - <%= l export.created_at, :format => "%d/%m/%Y %H:%M" %> | <%= export.user_name %> - </div> - </div> -</div> diff --git a/app/views/exports/_export.html.slim b/app/views/exports/_export.html.slim new file mode 100644 index 000000000..f1f7e9753 --- /dev/null +++ b/app/views/exports/_export.html.slim @@ -0,0 +1,20 @@ +#index_item.panel.panel-default.export + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to referential_export_path(@referential, export.id), :method => :delete, :data => {:confirm => t('exports.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to( referential_export_path(@referential, export.id), :class => "preview", :title => "#{Export.model_name.human.capitalize} #{export.name}") do + = job_status_title(export) + + .panel-body + p + = link_to( font_awesome_classic_tag("fa-file-#{export.filename_extension}-o") + t("exports.show.exported_file"), exported_file_referential_export_path(@referential, export.id) ) if export.file_path + + .panel-footer + = export_attributes_tag(export) + .history + = l export.created_at, :format => "%d/%m/%Y %H:%M" + = " | #{export.user_name}"
\ No newline at end of file diff --git a/app/views/exports/_exports.html.erb b/app/views/exports/_exports.html.erb deleted file mode 100644 index 343b57cdd..000000000 --- a/app/views/exports/_exports.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @exports %> -</div> -<div class="exports paginated_content"> - <%= paginated_content @exports, "exports/export" %> -</div> -<div class="pagination"> - <%= will_paginate @exports, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/exports/_exports.html.slim b/app/views/exports/_exports.html.slim new file mode 100644 index 000000000..7a0461def --- /dev/null +++ b/app/views/exports/_exports.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t("will_paginate.page_entries_info.search") + = page_entries_info @exports + +.exports.paginated_content + = paginated_content @exports, "exports/export" + +.pagination + = will_paginate @exports, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/exports/index.html.erb b/app/views/exports/index.html.erb deleted file mode 100644 index df66225fa..000000000 --- a/app/views/exports/index.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<%= title_tag t('.title') %> -<div class="warning"><%= t('.warning') %> </div> - -<div id="exports"><%= render 'exports' %></div> - - -<% content_for :sidebar do %> - <ul class="actions"> - <li><%= link_to t('exports.actions.new'), new_referential_export_task_path(@referential), :class => "add" %></li> - </ul> -<% end %> diff --git a/app/views/exports/index.html.slim b/app/views/exports/index.html.slim new file mode 100644 index 000000000..bbcb2a5a7 --- /dev/null +++ b/app/views/exports/index.html.slim @@ -0,0 +1,10 @@ += title_tag t('.title') + +.warning = t('.warning') + +#exports = render 'exports' + +- content_for :sidebar do + ul.actions + li + = link_to t('exports.actions.new'), new_referential_export_task_path(@referential), class: 'add'
\ No newline at end of file diff --git a/app/views/exports/index.js.erb b/app/views/exports/index.js.erb deleted file mode 100644 index e9f06f09e..000000000 --- a/app/views/exports/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#exports').html('<%= escape_javascript(render("exports")) %>');
\ No newline at end of file diff --git a/app/views/exports/index.js.slim b/app/views/exports/index.js.slim new file mode 100644 index 000000000..b9a413b1b --- /dev/null +++ b/app/views/exports/index.js.slim @@ -0,0 +1 @@ +| $('#exports').html("#{escape_javascript(render('exports'))}");
\ No newline at end of file diff --git a/app/views/exports/show.html.erb b/app/views/exports/show.html.erb deleted file mode 100644 index fc7ef2c9a..000000000 --- a/app/views/exports/show.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -<div class="title row"> - <div class="col-md-8"> - <%= title_tag job_status_title(@export) %> - </div> - <div class="col-md-4"> - <%= export_attributes_tag(@export) %> - </div> -</div> -<% if @export.report.failure_code? %> -<div class="alert alert-danger"> - <%= t("iev.failure.#{@export.report.failure_code}") %> -</div> -<% end %> -<div class="progress_bars"> - <%= progress_bar_tag(@export) %> -</div> -<div class="export_show"> - <div class="links"> - <%= link_to( font_awesome_classic_tag("fa-file-#{@export.filename_extension}-o") + t("exports.show.exported_file"), exported_file_referential_export_path(@referential, @export.id) ) if @export.file_path %> - </div> - <%= render( partial: "shared/ie_report.html", locals: { job: @export, line_items: @line_items } ) %> -</div> - -<% content_for :sidebar do %> - <ul class="actions"> - <li><%= link_to t('exports.actions.destroy'), referential_export_path(@referential, @export.id), :method => :delete, :data => {:confirm => t('exports.actions.destroy_confirm')}, :class => "remove" %></li> - </ul> - - <%= history_tag(@export) %> - -<% end %> diff --git a/app/views/exports/show.html.slim b/app/views/exports/show.html.slim new file mode 100644 index 000000000..1631e0e7e --- /dev/null +++ b/app/views/exports/show.html.slim @@ -0,0 +1,26 @@ +.title.row + .col-md-8 + = title_tag job_status_title(@export) + + .col-md-4 + = export_attributes_tag(@export) + +- if @export.report.failure_code? + .alert.alert-danger + = t("iev.failure.#{@export.report.failure_code}") + +.progress_bars + = progress_bar_tag(@export) + +.export_show + .links + = link_to( font_awesome_classic_tag("fa-file-#{@export.filename_extension}-o") + t("exports.show.exported_file"), exported_file_referential_export_path(@referential, @export.id) ) if @export.file_path + + = render partial: "shared/ie_report.html", locals: { job: @export, line_items: @line_items } + +- content_for :sidebar do + ul.actions + li + = link_to t('exports.actions.destroy'), referential_export_path(@referential, @export.id), :method => :delete, :data => {:confirm => t('exports.actions.destroy_confirm')}, class: 'remove' + + = history_tag(@export)
\ No newline at end of file diff --git a/app/views/footnotes/_footnote_fields.html.erb b/app/views/footnotes/_footnote_fields.html.erb deleted file mode 100644 index 652b6d6af..000000000 --- a/app/views/footnotes/_footnote_fields.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= f.inputs :class => 'nested-fields footnote' do %> - <%= f.input :code, :wrapper_html => { :class => 'col-md-3' } %> - <%= f.input :label, :wrapper_html => { :class => 'col-md-7' } %> - <%= link_to_remove_association t('actions.destroy'), f, :class => 'col-md-2 remove' %> -<% end %> - diff --git a/app/views/footnotes/_footnote_fields.html.slim b/app/views/footnotes/_footnote_fields.html.slim new file mode 100644 index 000000000..ab006cfa9 --- /dev/null +++ b/app/views/footnotes/_footnote_fields.html.slim @@ -0,0 +1,4 @@ += f.inputs :class => 'nested-fields footnote' do + = f.input :code, :wrapper_html => { class: 'col-md-3' } + = f.input :label, :wrapper_html => { class: 'col-md-7' } + = link_to_remove_association t('actions.destroy'), f, class: 'col-md-2 remove'
\ No newline at end of file diff --git a/app/views/group_of_lines/_form.erb b/app/views/group_of_lines/_form.erb deleted file mode 100644 index d8417466a..000000000 --- a/app/views/group_of_lines/_form.erb +++ /dev/null @@ -1,31 +0,0 @@ -<%= semantic_form_for [@line_referential, @group_of_line] do |form| %> - <%= form.inputs do %> - <%= form.input :name, :input_html => { :title => I18n.t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.group_of_line.name") } %> - <%= form.input :registration_number, :input_html => { :title => I18n.t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.group_of_line.registration_number") } %> - <%= form.input :comment %> - <%= form.input :objectid, :required => !@group_of_line.new_record?, :input_html => { :title => I18n.t("formtastic.titles#{format_restriction_for_locales(@referential)}.group_of_line.objectid") } %> - <% end %> - - <%= form.inputs do %> - <%= form.input :line_tokens, :label => t('.lines'), :as => :text, :input_html => { :"data-pre" => ( @group_of_line.lines.map { |line| { :id => line.id, :name => line.name } } ).to_json } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<script> - $(function() { - $( "#group_of_line_line_tokens" ).tokenInput('<%= name_filter_referential_lines_path(@line_referential, :format => :json) %>', { - crossDomain: false, - prePopulate: $('#line_tokens').data('pre'), - minChars: 1, - preventDuplicates: true, - hintText: '<%= I18n.t('search_hint') %>', - noResultsText: '<%= I18n.t('no_result_text') %>', - searchingText: '<%= I18n.t('searching_term') %>' - }); - }); -</script> diff --git a/app/views/group_of_lines/_form.html.slim b/app/views/group_of_lines/_form.html.slim new file mode 100644 index 000000000..dc26087ea --- /dev/null +++ b/app/views/group_of_lines/_form.html.slim @@ -0,0 +1,27 @@ += semantic_form_for [@line_referential, @group_of_line] do |form| + = form.inputs do + = form.input :name, input_html: { title: I18n.t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.group_of_line.name") } + = form.input :registration_number, input_html: { title: I18n.t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.group_of_line.registration_number") } + = form.input :comment + = form.input :objectid, :required => !@group_of_line.new_record?, :input_html => { :title => I18n.t("formtastic.titles#{format_restriction_for_locales(@referential)}.group_of_line.objectid") } + + = form.inputs do + = form.input :line_tokens, label: t('.lines'), as: :text, :input_html => { :"data-pre" => ( @group_of_line.lines.map { |line| { id: line.id, name: line.name } } ).to_json } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + + +javascript: + $(function() { + $('#group_of_line_line_tokens').tokenInput("#{name_filter_referential_lines_path(@line_referential, format: :json)}", { + crossDomain: false, + prePopulate: $('#line_tokens').data('pre'), + minChars: 1, + preventDuplicates: true, + hintText: "#{I18n.t('search_hint')", + noResultsText: "#{I18n.t('no_result_text')}", + searchingText: "#{I18n.t('searching_term')}" + }); + });
\ No newline at end of file diff --git a/app/views/group_of_lines/_group_of_line.erb b/app/views/group_of_lines/_group_of_line.erb deleted file mode 100644 index c88a3835b..000000000 --- a/app/views/group_of_lines/_group_of_line.erb +++ /dev/null @@ -1,24 +0,0 @@ -<div id="index_item" class="panel panel-default"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_group_of_line_path(@line_referential, group_of_line), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end if edit %> - <%= link_to('<span class="fa fa-trash-o"></span>'.html_safe, line_referential_group_of_line_path(@line_referential, group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm") if delete %> - </span> - <h5> - <%= link_to([@line_referential, group_of_line], :class => "preview", :title => "#{Chouette::GroupOfLine.model_name.human.capitalize} #{group_of_line.name}") do %> - <span class="name"> - <%= truncate(group_of_line.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <%= group_of_line.human_attribute_name('line_count') %> <%= group_of_line.lines.count %> - </p> - </div> -</div> diff --git a/app/views/group_of_lines/_group_of_line.html.slim b/app/views/group_of_lines/_group_of_line.html.slim new file mode 100644 index 000000000..16ac4e252 --- /dev/null +++ b/app/views/group_of_lines/_group_of_line.html.slim @@ -0,0 +1,19 @@ +#index_item.panel.panel-default + .panel-heading + .panel-title.clearfix + span.pull-right + - if edit + = link_to edit_line_referential_group_of_line_path(@line_referential, group_of_line), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + = link_to('<span class="fa fa-trash-o"></span>'.html_safe, line_referential_group_of_line_path(@line_referential, group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm') if delete + + h5 + = link_to [@line_referential, group_of_line], :class => "preview", :title => "#{Chouette::GroupOfLine.model_name.human.capitalize} #{group_of_line.name}" do + span.name + = truncate(group_of_line.name, :length => 20) + + .panel-body + p + = group_of_line.human_attribute_name('line_count') + = group_of_line.lines.count
\ No newline at end of file diff --git a/app/views/group_of_lines/_group_of_lines.erb b/app/views/group_of_lines/_group_of_lines.erb deleted file mode 100644 index 212507d01..000000000 --- a/app/views/group_of_lines/_group_of_lines.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @group_of_lines %> -</div> -<div class="group_of_lines paginated_content"> - <%= paginated_content(@group_of_lines) %> -</div> -<div class="pagination"> - <%= will_paginate @group_of_lines, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/group_of_lines/_group_of_lines.html.slim b/app/views/group_of_lines/_group_of_lines.html.slim new file mode 100644 index 000000000..7e55caebe --- /dev/null +++ b/app/views/group_of_lines/_group_of_lines.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t("will_paginate.page_entries_info.search") + = page_entries_info @group_of_lines + +.group_of_lines.paginated_content + = paginated_content(@group_of_lines) + +.pagination + = will_paginate @group_of_lines, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/group_of_lines/_lines_detail.html.erb b/app/views/group_of_lines/_lines_detail.html.erb deleted file mode 100644 index a6d8c6a01..000000000 --- a/app/views/group_of_lines/_lines_detail.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<div class="lines paginated_content"> - <%= paginated_content @lines, "lines/line", :delete => false %> -</div> diff --git a/app/views/group_of_lines/_lines_detail.html.slim b/app/views/group_of_lines/_lines_detail.html.slim new file mode 100644 index 000000000..f6e9b386e --- /dev/null +++ b/app/views/group_of_lines/_lines_detail.html.slim @@ -0,0 +1,2 @@ +.lines.paginated_content + = paginated_content @lines, "lines/line", delete: false
\ No newline at end of file diff --git a/app/views/group_of_lines/edit.html.erb b/app/views/group_of_lines/edit.html.erb deleted file mode 100644 index 541e708ca..000000000 --- a/app/views/group_of_lines/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('group_of_lines.edit.title', :group_of_line => @group_of_line.name) %> - -<%= render "form" %> diff --git a/app/views/group_of_lines/edit.html.slim b/app/views/group_of_lines/edit.html.slim new file mode 100644 index 000000000..75d530b08 --- /dev/null +++ b/app/views/group_of_lines/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('group_of_lines.edit.title', :group_of_line => @group_of_line.name) + += render 'form'
\ No newline at end of file diff --git a/app/views/group_of_lines/index.html.erb b/app/views/group_of_lines/index.html.erb deleted file mode 100644 index 0f34128f4..000000000 --- a/app/views/group_of_lines/index.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%= title_tag t('group_of_lines.index.title') %> - -<%= search_form_for @q, :url => referential_group_of_lines_path(@line_referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <div class="input-group col-md-12"> - <%= f.text_field :name_cont, :placeholder => "#{t('.name')}", :class => "form-control" %> - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div><!-- /input-group --> - <!-- <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> --> - <!-- <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> --> - <!-- </a> --> - </div> -</div> -<% end %> - -<div id="group_of_lines"><%= render 'group_of_lines' %></div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), :class => "add" %></li> - <br> -</ul> -<% end %> diff --git a/app/views/group_of_lines/index.html.slim b/app/views/group_of_lines/index.html.slim new file mode 100644 index 000000000..23d8523d9 --- /dev/null +++ b/app/views/group_of_lines/index.html.slim @@ -0,0 +1,24 @@ += title_tag t('group_of_lines.index.title') + += search_form_for @q, :url => referential_group_of_lines_path(@line_referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| + .panel.panel-default + .panel-heading + .input-group.col-md-12 + = f.text_field :name_cont, :placeholder => "#{t('.name')}", class: 'form-control' + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + / <!-- /input-group --> + / <!-- <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> --> + / <!-- <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> --> + / <!-- </a> --> + +#group_of_lines + = render 'group_of_lines' + +- content_for :sidebar do + ul.actions + li + = link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), class: 'add' + br
\ No newline at end of file diff --git a/app/views/group_of_lines/index.js.erb b/app/views/group_of_lines/index.js.erb deleted file mode 100644 index fe3e96b5e..000000000 --- a/app/views/group_of_lines/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#group_of_lines').html('<%= escape_javascript(render("group_of_lines")) %>');
\ No newline at end of file diff --git a/app/views/group_of_lines/index.js.slim b/app/views/group_of_lines/index.js.slim new file mode 100644 index 000000000..c21aa99cd --- /dev/null +++ b/app/views/group_of_lines/index.js.slim @@ -0,0 +1 @@ +| $('#group_of_lines').html("#{escape_javascript(render('group_of_lines'))}");
\ No newline at end of file diff --git a/app/views/group_of_lines/new.html.erb b/app/views/group_of_lines/new.html.erb deleted file mode 100644 index a2da652af..000000000 --- a/app/views/group_of_lines/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('group_of_lines.new.title') %> - -<%= render "form" %> diff --git a/app/views/group_of_lines/new.html.slim b/app/views/group_of_lines/new.html.slim new file mode 100644 index 000000000..36b5d6b4e --- /dev/null +++ b/app/views/group_of_lines/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('group_of_lines.new.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/group_of_lines/show.html.erb b/app/views/group_of_lines/show.html.erb deleted file mode 100644 index 557d8c82b..000000000 --- a/app/views/group_of_lines/show.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -<%= title_tag t('group_of_lines.show.title', :group_of_line => @group_of_line.name )%> - -<div class="group_of_line_show"> - <%= @map.to_html %> - <div class="summary"> - <p> - <label><%= @group_of_line.human_attribute_name("registration_number") %>: </label> - <%= @group_of_line.registration_number %> - </p> - <p> - <label><%= @group_of_line.human_attribute_name("comment") %>: </label> - <%= @group_of_line.comment %> - </p> - </div> - - <p class="after_map" /> - <h3 class="group_of_line_lines"><%= t('.lines') %></h3> - <div class="lines_detail"> - <%= render :partial => "lines_detail" %> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), :class => "add" %></li> - <li><%= link_to t('group_of_lines.actions.edit'), edit_line_referential_group_of_line_path(@line_referential, @group_of_line), :class => "edit" %></li> - <li><%= link_to t('group_of_lines.actions.destroy'), line_referential_group_of_line_path(@line_referential, @group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')} , :class => "remove" %></li> - <br> -</ul> - <%= creation_tag(@group_of_line) %> -<% end %> diff --git a/app/views/group_of_lines/show.html.slim b/app/views/group_of_lines/show.html.slim new file mode 100644 index 000000000..c93f5277e --- /dev/null +++ b/app/views/group_of_lines/show.html.slim @@ -0,0 +1,31 @@ += title_tag t('group_of_lines.show.title', :group_of_line => @group_of_line.name ) + +.group_of_line_show + = @map.to_html + + .summary + p + label = "#{@group_of_line.human_attribute_name('registration_number')} : " + = @group_of_line.registration_number + + p + label = "#{@group_of_line.human_attribute_name('comment')} : " + = @group_of_line.comment + + p.after_map + + h3.group_of_line_lines = t('.lines') + .lines_detail + == render partial: "lines_detail" + +- content_for :sidebar do + ul.actions + li + = link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), class: 'add' + li + = link_to t('group_of_lines.actions.edit'), edit_line_referential_group_of_line_path(@line_referential, @group_of_line), class: 'edit' + li + = link_to t('group_of_lines.actions.destroy'), line_referential_group_of_line_path(@line_referential, @group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')} , class: 'remove' + br + + = creation_tag(@group_of_line)
\ No newline at end of file diff --git a/app/views/group_of_lines/show.js.erb b/app/views/group_of_lines/show.js.erb deleted file mode 100644 index bd8ac5a7f..000000000 --- a/app/views/group_of_lines/show.js.erb +++ /dev/null @@ -1,4 +0,0 @@ -$(function (){ - $(".lines_detail").html("<%= escape_javascript(render(:partial => "lines_detail")) %>"); -}); - diff --git a/app/views/group_of_lines/show.js.slim b/app/views/group_of_lines/show.js.slim new file mode 100644 index 000000000..786400a58 --- /dev/null +++ b/app/views/group_of_lines/show.js.slim @@ -0,0 +1 @@ +| $(function (){ $('.lines_detail').html("#{escape_javascript(render(partial: 'lines_detail'))}"); });
\ No newline at end of file diff --git a/app/views/group_of_lines/show.kml.erb b/app/views/group_of_lines/show.kml.erb deleted file mode 100644 index 6952db240..000000000 --- a/app/views/group_of_lines/show.kml.erb +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% @group_of_line.commercial_stop_areas.each do |stop_area| %> - <Placemark id="<%= stop_area.id %>" > - <name><%= stop_area.name %></name> - <stop_area_type><%= stop_area.area_type.underscore %></stop_area_type> - <stop_area_type_label><%= t("area_types.label.#{stop_area.stop_area_type}") %></stop_area_type_label> - <%= (stop_area.position or stop_area.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/group_of_lines/show.kml.slim b/app/views/group_of_lines/show.kml.slim new file mode 100644 index 000000000..094d05839 --- /dev/null +++ b/app/views/group_of_lines/show.kml.slim @@ -0,0 +1,10 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - @group_of_line.commercial_stop_areas.each do |stop_area| + placemark id="#{stop_area.id}" + name = stop_area.name + stop_area_type = stop_area.area_type.underscore + stop_area_type_label = t("area_types.label.#{stop_area.stop_area_type}") + stop_area_type_label = (stop_area.position or stop_area.default_position).kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/import_tasks/_fields_gtfs_import.html.erb b/app/views/import_tasks/_fields_gtfs_import.html.erb deleted file mode 100644 index 6c75f36da..000000000 --- a/app/views/import_tasks/_fields_gtfs_import.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<%= form.input :references_type, :as => :select, :include_blank => t("import_tasks.new.all"), :input_html => { :title => t("formtastic.titles.import_task.references_type") } %> -<%= form.input :object_id_prefix, :input_html => { :value => @referential.prefix } %> -<%= form.input :max_distance_for_commercial , :as => :number , :input_html => { :title => t("formtastic.titles.import_task.max_distance_for_commercial"), :value => 0 } %> -<%= form.input :ignore_last_word , :as => :boolean , :input_html => { :title => t("formtastic.titles.import_task.ignore_last_word"), :value => false }%> -<%= form.input :ignore_end_chars , :as => :number , :input_html => { :title => t("formtastic.titles.import_task.ignore_end_chars"), :value => 0 }%> -<%= form.input :max_distance_for_connection_link , :as => :number , :input_html => { :title => t("formtastic.titles.import_task.max_distance_for_connection_link"), :value => 0 }%> - - diff --git a/app/views/import_tasks/_fields_gtfs_import.html.slim b/app/views/import_tasks/_fields_gtfs_import.html.slim new file mode 100644 index 000000000..8c2ef8ed8 --- /dev/null +++ b/app/views/import_tasks/_fields_gtfs_import.html.slim @@ -0,0 +1,6 @@ += form.input :references_type, as: :select, :include_blank => t("import_tasks.new.all"), :input_html => { :title => t("formtastic.titles.import_task.references_type") } += form.input :object_id_prefix, :input_html => { :value => @referential.prefix } += form.input :max_distance_for_commercial , as: :number , :input_html => { :title => t("formtastic.titles.import_task.max_distance_for_commercial"), :value => 0 } += form.input :ignore_last_word , as: :boolean , :input_html => { :title => t("formtastic.titles.import_task.ignore_last_word"), :value => false } += form.input :ignore_end_chars , as: :number , :input_html => { :title => t("formtastic.titles.import_task.ignore_end_chars"), :value => 0 } += form.input :max_distance_for_connection_link , as: :number , :input_html => { :title => t("formtastic.titles.import_task.max_distance_for_connection_link"), :value => 0 }
\ No newline at end of file diff --git a/app/views/import_tasks/_fields_neptune_import.html.erb b/app/views/import_tasks/_fields_neptune_import.html.slim index e69de29bb..e69de29bb 100644 --- a/app/views/import_tasks/_fields_neptune_import.html.erb +++ b/app/views/import_tasks/_fields_neptune_import.html.slim diff --git a/app/views/import_tasks/_fields_netex_import.erb b/app/views/import_tasks/_fields_netex_import.slim index e69de29bb..e69de29bb 100644 --- a/app/views/import_tasks/_fields_netex_import.erb +++ b/app/views/import_tasks/_fields_netex_import.slim diff --git a/app/views/import_tasks/new.html.erb b/app/views/import_tasks/new.html.erb deleted file mode 100644 index 303299f73..000000000 --- a/app/views/import_tasks/new.html.erb +++ /dev/null @@ -1,40 +0,0 @@ -<%= title_tag t(".title") %> - -<ul class="nav nav-pills"> - <% ImportTask.data_formats.each do |format| %> - <li role="presentation"> - <a href="#<%= format %>" class='<%= @import_task.data_format == format ? "#{format} active" : "#{format}" %>' - title='<%= t(:"enumerize.data_format_detail.#{format}")%>' - data-toggle="tab"><%= t(:"enumerize.data_format.#{format}") %> - </a> - </li> - <% end %> -</ul> - -<div class="tab-content"> - <% @available_imports.each do |import_task| %> - <%= semantic_form_for [@referential, import_task], :as => :import_task, :url => referential_import_tasks_path(@referential), - :namespace => import_task.data_format, :html => { :id => "#{import_task.data_format}", - :class => "tab-pane highlight" } 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 :data_format, :as => :hidden %> - <%= form.input :referential_id, :as => :hidden, :input_html => { :value => @referential.id } %> - <%= form.input :name %> - <%= form.input :no_save, :as => :boolean %> - <%= form.input :rule_parameter_set_id, :as => :select, - :collection => @referential.organisation.rule_parameter_sets.map { |rps| [ rps.name, rps.id ] }, - :include_blank => true %> - <%= form.input :resources, :as => :file %> - <% end %> - <%= render partial: "fields_#{import_task.data_format}_import", :locals => { :form => form } %> - <%= form.actions do %> - <%= form.action :submit, :as => :button , :label => t( 'formtastic.import' ) %> - <%= form.action :cancel, :as => :link %> - <% end %> - <% end %> - <% end %> -</div> - -<%= javascript_include_tag new_referential_import_task_path(@referential, :format => :js) %> diff --git a/app/views/import_tasks/new.html.slim b/app/views/import_tasks/new.html.slim new file mode 100644 index 000000000..b4b77d344 --- /dev/null +++ b/app/views/import_tasks/new.html.slim @@ -0,0 +1,28 @@ += title_tag t(".title") + +ul.nav.nav-pills + - ImportTask.data_formats.each do |format| + li role="presentation" + a href="##{format}" class="#{@import_task.data_format == format ? "#{format} active" : "#{format}" }" title="#{t(:"enumerize.data_format_detail.#{format}")}" data-toggle="tab" + = t(:"enumerize.data_format.#{format}") + +.tab-content + - @available_imports.each do |import_task| + = semantic_form_for [@referential, import_task], as: :import_task, :url => referential_import_tasks_path(@referential), :namespace => import_task.data_format, :html => { :id => "#{import_task.data_format}", class: 'tab-pane highlight' } 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 :data_format, as: :hidden + = form.input :referential_id, as: :hidden, :input_html => { :value => @referential.id } + = form.input :name + = form.input :no_save, as: :boolean + = form.input :rule_parameter_set_id, as: :select, :collection => @referential.organisation.rule_parameter_sets.map { |rps| [ rps.name, rps.id ] }, :include_blank => true + = form.input :resources, as: :file + + = render partial: "fields_#{import_task.data_format}_import", :locals => { :form => form } + + = form.actions do + = form.action :submit, as: :button , :label => t( 'formtastic.import' ) + = form.action :cancel, as: :link + += javascript_include_tag new_referential_import_task_path(@referential, :format => :js)
\ No newline at end of file diff --git a/app/views/imports/_import.erb b/app/views/imports/_import.erb deleted file mode 100644 index 52ef5fc3d..000000000 --- a/app/views/imports/_import.erb +++ /dev/null @@ -1,27 +0,0 @@ -<div id="index_item" class="panel panel-default import"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to referential_import_path(@referential, import.id), :method => :delete, :data => {:confirm => t('imports.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to( referential_import_path(@referential, import.id), :class => "preview", :title => "#{ImportTask.model_name.human.capitalize} #{import.name}") do %> - <%= job_status_title(import) %> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p><%= link_to font_awesome_classic_tag("fa-file-#{import.filename_extension}-o") + t("imports.show.imported_file"), imported_file_referential_import_path(@referential, import.id) if import.file_path? %></p> - <p><%= link_to font_awesome_classic_tag("fa-external-link") + t("imports.show.compliance_check"), compliance_check_referential_import_path(@referential, import.id) if import.compliance_check? %></p> - </div> - <div class="panel-footer"> - <%= import_attributes_tag(import) %> - - <div class="history"> - <%= l(import.created_at, :format => "%d/%m/%Y %H:%M") if import.created_at %> | <%= import.user_name %> - </div> - </div> -</div> diff --git a/app/views/imports/_import.html.slim b/app/views/imports/_import.html.slim new file mode 100644 index 000000000..7d4753358 --- /dev/null +++ b/app/views/imports/_import.html.slim @@ -0,0 +1,24 @@ +#index_item.panel.panel-default.import + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to referential_import_path(@referential, import.id), method: :delete, :data => {:confirm => t('imports.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to( referential_import_path(@referential, import.id), class: 'preview', :title => "#{ImportTask.model_name.human.capitalize} #{import.name}") do + = job_status_title(import) + + .panel-body + p + = link_to font_awesome_classic_tag("fa-file-#{import.filename_extension}-o") + t("imports.show.imported_file"), imported_file_referential_import_path(@referential, import.id) if import.file_path? + + p + = link_to font_awesome_classic_tag("fa-external-link") + t("imports.show.compliance_check"), compliance_check_referential_import_path(@referential, import.id) if import.compliance_check? + + .panel-footer + = import_attributes_tag(import) + + .history + = l(import.created_at, :format => "%d/%m/%Y %H:%M") if import.created_at + = " | #{import.user_name}"
\ No newline at end of file diff --git a/app/views/imports/_imports.html.erb b/app/views/imports/_imports.html.erb deleted file mode 100644 index d4c7e0b9e..000000000 --- a/app/views/imports/_imports.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @imports %> -</div> -<div class="imports paginated_content"> - <%= paginated_content @imports, "imports/import" %> -</div> -<div class="pagination"> - <%= will_paginate @imports, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/imports/_imports.html.slim b/app/views/imports/_imports.html.slim new file mode 100644 index 000000000..3605fd10b --- /dev/null +++ b/app/views/imports/_imports.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t("will_paginate.page_entries_info.search") + = page_entries_info @imports + +.imports.paginated_content + = paginated_content @imports, "imports/import" + +.pagination + = will_paginate @imports, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/imports/index.html.erb b/app/views/imports/index.html.erb deleted file mode 100644 index 6699819b8..000000000 --- a/app/views/imports/index.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= title_tag t('.title') %> -<div class="warning"><%= t('.warning') %> </div> - -<div id="imports"><%= render 'imports' %></div> - - -<% content_for :sidebar do %> - <ul class="actions"> - <li><%= link_to t('imports.actions.new'), new_referential_import_task_path(@referential), :class => "add" %></li> - <li><%= link_to t('rule_parameter_sets.actions.index'), organisation_rule_parameter_sets_path, :class => "link" %></li> - </ul> -<% end %> diff --git a/app/views/imports/index.html.slim b/app/views/imports/index.html.slim new file mode 100644 index 000000000..b1922d005 --- /dev/null +++ b/app/views/imports/index.html.slim @@ -0,0 +1,13 @@ += title_tag t('.title') + +.warning = t('.warning') + +#imports + = render 'imports' + +- content_for :sidebar do + ul.actions + li + = link_to t('imports.actions.new'), new_referential_import_task_path(@referential), 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/imports/index.js.erb b/app/views/imports/index.js.erb deleted file mode 100644 index 1207b18ce..000000000 --- a/app/views/imports/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#imports').html('<%= escape_javascript(render("imports")) %>');
\ No newline at end of file diff --git a/app/views/imports/index.js.slim b/app/views/imports/index.js.slim new file mode 100644 index 000000000..2fac7d26c --- /dev/null +++ b/app/views/imports/index.js.slim @@ -0,0 +1 @@ +| $('#imports').html("#{escape_javascript(render("imports"))}");
\ No newline at end of file diff --git a/app/views/imports/show.html.erb b/app/views/imports/show.html.erb deleted file mode 100644 index 926445f93..000000000 --- a/app/views/imports/show.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -<div class="title row"> - <div class="col-md-8"> - <%= title_tag job_status_title(@import) %> - </div> - <div class="col-md-4"> - <%= import_attributes_tag(@import) %> - </div> -</div> -<% if @import.report.failure_code? %> -<div class="alert alert-danger"> - <%= t("iev.failure.#{@import.report.failure_code}") %> -</div> -<% end %> -<div class="progress_bars"> - <%= progress_bar_tag(@import) %> -</div> -<div class="import_show"> - <div class="links"> - <%= link_to font_awesome_classic_tag("fa-file-#{@import.filename_extension}-o") + t("imports.show.imported_file"), imported_file_referential_import_path(@referential, @import.id) if @import.file_path? %> - <%= link_to font_awesome_classic_tag("fa-external-link") + t("imports.show.compliance_check"), compliance_check_referential_import_path(@referential, @import.id) if @import.compliance_check? %> - </div> - <%= render(partial: 'shared/ie_report', locals: {job: @import, line_items: @line_items}) %> -</div> - -<% content_for :sidebar do %> - <ul class="actions"> - <li><%= link_to t('imports.actions.destroy'), referential_import_path(@referential, @import.id), method: :delete, data: {confirm: t('imports.actions.destroy_confirm')}, class: "remove" %></li> - </ul> - - <%= history_tag(@import) %> - -<% end %> diff --git a/app/views/imports/show.html.slim b/app/views/imports/show.html.slim new file mode 100644 index 000000000..5992af311 --- /dev/null +++ b/app/views/imports/show.html.slim @@ -0,0 +1,27 @@ +.title.row + .col-md-8 + = title_tag job_status_title(@import) + + .col-md-4 + = import_attributes_tag(@import) + +- if @import.report.failure_code? + .alert.alert-danger + = t("iev.failure.#{@import.report.failure_code}") + +.progress_bars + = progress_bar_tag(@import) + +.import_show + .links + = link_to font_awesome_classic_tag("fa-file-#{@import.filename_extension}-o") + t("imports.show.imported_file"), imported_file_referential_import_path(@referential, @import.id) if @import.file_path? + = link_to font_awesome_classic_tag("fa-external-link") + t("imports.show.compliance_check"), compliance_check_referential_import_path(@referential, @import.id) if @import.compliance_check? + + = render(partial: 'shared/ie_report', locals: {job: @import, line_items: @line_items}) + +- content_for :sidebar do + ul.actions + li + = link_to t('imports.actions.destroy'), referential_import_path(@referential, @import.id), method: :delete, data: {confirm: t('imports.actions.destroy_confirm')}, class: 'remove' + + = history_tag(@import)
\ No newline at end of file diff --git a/app/views/journey_patterns/_form.html.erb b/app/views/journey_patterns/_form.html.erb deleted file mode 100644 index f57556577..000000000 --- a/app/views/journey_patterns/_form.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -<%= semantic_form_for [@referential, @line, @route, @journey_pattern] do |form| %> - <%= form.inputs do %> - <%= form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.journey_pattern.name") } %> - <%= form.input :published_name %> - <%= form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.journey_pattern.registration_number") } %> - <%= form.input :comment %> - <%= form.input :stop_point_ids, :label => stop_point_ids_label(@journey_pattern), :as => :check_boxes, :collection => @route.stop_points.map { |s| [s.stop_area.name, s.id.to_s]}, :input_html => (@journey_pattern.new_record? ? { :checked => 'checked' }:{}) %> - <%= form.input :objectid, :required => !@journey_pattern.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.journey_pattern.objectid") } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - diff --git a/app/views/journey_patterns/_form.html.slim b/app/views/journey_patterns/_form.html.slim new file mode 100644 index 000000000..7b14474d9 --- /dev/null +++ b/app/views/journey_patterns/_form.html.slim @@ -0,0 +1,12 @@ += semantic_form_for [@referential, @line, @route, @journey_pattern] do |form| + = form.inputs do + = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.journey_pattern.name") } + = form.input :published_name + = form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.journey_pattern.registration_number") } + = form.input :comment + = form.input :stop_point_ids, :label => stop_point_ids_label(@journey_pattern), as: :check_boxes, :collection => @route.stop_points.map { |s| [s.stop_area.name, s.id.to_s]}, :input_html => (@journey_pattern.new_record? ? { :checked => 'checked' }:{}) + = form.input :objectid, :required => !@journey_pattern.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.journey_pattern.objectid") } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/journey_patterns/_journey_pattern.html.erb b/app/views/journey_patterns/_journey_pattern.html.erb deleted file mode 100644 index 029b3c40e..000000000 --- a/app/views/journey_patterns/_journey_pattern.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -<div id="index_item" class="panel panel-default journey_pattern"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to referential_line_route_journey_pattern_path(@referential, @line, @route, journey_pattern), :method => :delete, :data => {:confirm => t('journey_patterns.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, @line, @route, journey_pattern], :class => "preview", :title => "#{Chouette::JourneyPattern.model_name.human.capitalize} #{journey_name(journey_pattern)}") do %> - <span class="name"> - <%= truncate(journey_name(journey_pattern), :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <% unless journey_pattern.stop_points.empty? %> - <p><%= t('.from_to', :departure => journey_pattern.stop_points.first.stop_area.name, :arrival => journey_pattern.stop_points.last.stop_area.name) %></p> - <% end %> - <p><%= t('.stop_count', :count => journey_pattern.stop_points.count, :route_count => @route.stop_points.count) %> | <%= t('.vehicle_journeys_count', :count => journey_pattern.vehicle_journeys.count) %></p> - <% if journey_pattern.vehicle_journeys.count > 0 %> - <p> - <i class="fa fa-clock-o"></i> - <%= link_to t('journey_patterns.journey_pattern.vehicle_journey_at_stops'), referential_line_route_vehicle_journeys_path(@referential, @line, @route, :q => {:journey_pattern_id_eq => journey_pattern.id}), :class => "with_fa" %> - </p> - <% if exist_vehicle_journey_frequencies?(@route, journey_pattern) %> - <p> - <i class="fa fa-clock-o"></i> - <%= link_to t('vehicle_journey_frequencies.actions.index'), referential_line_route_vehicle_journey_frequencies_path(@referential, @line, @route, :q => {:journey_pattern_id_eq => journey_pattern.id}) %> - </p> - <% end %> - <% end %> - </div> -</div> diff --git a/app/views/journey_patterns/_journey_pattern.html.slim b/app/views/journey_patterns/_journey_pattern.html.slim new file mode 100644 index 000000000..c658b8267 --- /dev/null +++ b/app/views/journey_patterns/_journey_pattern.html.slim @@ -0,0 +1,31 @@ +#index_item.panel.panel-default.journey_pattern + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to referential_line_route_journey_pattern_path(@referential, @line, @route, journey_pattern), method: :delete, :data => {:confirm => t('journey_patterns.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to [@referential, @line, @route, journey_pattern], class: 'preview', :title => "#{Chouette::JourneyPattern.model_name.human.capitalize} #{journey_name(journey_pattern)}" do + span.name + = truncate(journey_name(journey_pattern), :length => 20) + + .panel-body + - unless journey_pattern.stop_points.empty? + p + = t('.from_to', :departure => journey_pattern.stop_points.first.stop_area.name, :arrival => journey_pattern.stop_points.last.stop_area.name) + + p + = t('.stop_count', :count => journey_pattern.stop_points.count, :route_count => @route.stop_points.count) + = " | " + = t('.vehicle_journeys_count', :count => journey_pattern.vehicle_journeys.count) + + - if journey_pattern.vehicle_journeys.count > 0 + p + i.fa.fa-clock-o + = link_to t('journey_patterns.journey_pattern.vehicle_journey_at_stops'), referential_line_route_vehicle_journeys_path(@referential, @line, @route, :q => {:journey_pattern_id_eq => journey_pattern.id}), class: 'with_fa' + + - if exist_vehicle_journey_frequencies?(@route, journey_pattern) + p + i.fa.fa-clock-o + = link_to t('vehicle_journey_frequencies.actions.index'), referential_line_route_vehicle_journey_frequencies_path(@referential, @line, @route, :q => {:journey_pattern_id_eq => journey_pattern.id})
\ No newline at end of file diff --git a/app/views/journey_patterns/edit.html.erb b/app/views/journey_patterns/edit.html.erb deleted file mode 100644 index 33fac2a6c..000000000 --- a/app/views/journey_patterns/edit.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('journey_patterns.edit.title', :journey_pattern => @journey_pattern.name ) %> - -<%= render "form" %> - diff --git a/app/views/journey_patterns/edit.html.slim b/app/views/journey_patterns/edit.html.slim new file mode 100644 index 000000000..5c5aed5ad --- /dev/null +++ b/app/views/journey_patterns/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('journey_patterns.edit.title', journey_pattern: @journey_pattern.name ) + += render 'form'
\ No newline at end of file diff --git a/app/views/journey_patterns/new.html.erb b/app/views/journey_patterns/new.html.erb deleted file mode 100644 index fb6ecbd64..000000000 --- a/app/views/journey_patterns/new.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('journey_patterns.new.title') %> - -<%= render "form" %> - diff --git a/app/views/journey_patterns/new.html.slim b/app/views/journey_patterns/new.html.slim new file mode 100644 index 000000000..5f626abff --- /dev/null +++ b/app/views/journey_patterns/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('journey_patterns.new.title') + += render 'form'
\ No newline at end of file diff --git a/app/views/journey_patterns/show.html.erb b/app/views/journey_patterns/show.html.erb deleted file mode 100644 index 6bd6022f7..000000000 --- a/app/views/journey_patterns/show.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -<%= title_tag t('journey_patterns.show.title', :journey_pattern => journey_name( @journey_pattern), :route => @route.name ) %> - -<div class="journey_pattern_show"> - <%= @map.to_html %> - - <div class="summary"> - <p> - <label><%= @journey_pattern.human_attribute_name(:name) %>: </label> - <%= @journey_pattern.name %> - </p> - <p> - <label><%= @journey_pattern.human_attribute_name(:published_name) %>: </label> - <%= @journey_pattern.published_name %> - </p> - <p> - <label><%= @journey_pattern.human_attribute_name(:registration_number) %>: </label> - <%= @journey_pattern.registration_number %> - </p> - <p> - <label><%= @journey_pattern.human_attribute_name(:comment) %>: </label> - <%= @journey_pattern.comment %> - </p> - </div> - -</div> - -<p class="after_map" /> -<h3 class="journey_pattern_stop_points"><%= t('.stop_points') %></h3> -<div class="stop_points paginated_content" > - <%= paginated_content @stop_points, "stop_points/stop_point" %> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('journey_patterns.actions.new'), new_referential_line_route_journey_pattern_path(@referential, @line, @route), :class => "add" %></li> - <li><%= link_to t('journey_patterns.actions.edit'), edit_referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern), :class => "edit" %></li> - <li><%= link_to t('journey_patterns.actions.destroy'), referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern), :method => :delete, :data => {:confirm => t('journey_patterns.actions.destroy_confirm')}, :class => "remove" %></li> - <li> - <%= link_to edit_referential_line_route_journey_pattern_route_sections_selector_path(@referential, @line, @route, @journey_pattern), class: "edit#{' control-shape' if @journey_pattern.control?}" do %> - <%= t('journey_patterns.actions.edit_route_sections') %> - <% if @journey_pattern.control? %><i class="fa fa-exclamation-triangle"></i><% end %> - <% end %> - </li> - <li><%= link_to t('journey_patterns.journey_pattern.vehicle_journey_at_stops'), referential_line_route_vehicle_journeys_path(@referential, @line, @route, :q => {:journey_pattern_id_eq => @journey_pattern.id}), :class => "clock" %></li> -</ul> - <%= creation_tag(@journey_pattern) %> -<% end %> diff --git a/app/views/journey_patterns/show.html.slim b/app/views/journey_patterns/show.html.slim new file mode 100644 index 000000000..0fee1a257 --- /dev/null +++ b/app/views/journey_patterns/show.html.slim @@ -0,0 +1,47 @@ += title_tag t('journey_patterns.show.title', journey_pattern: journey_name( @journey_pattern), route: @route.name ) + +.journey_pattern_show + = @map.to_html + + .summary + p + label = "#{@journey_pattern.human_attribute_name(:name)} : " + = @journey_pattern.name + + p + label = "#{@journey_pattern.human_attribute_name(:published_name)} : " + = @journey_pattern.published_name + + p + label = "#{@journey_pattern.human_attribute_name(:registration_number)} : " + = @journey_pattern.registration_number + + p + label = "#{@journey_pattern.human_attribute_name(:comment)} : " + = @journey_pattern.comment + +p.after_map + +h3.journey_pattern_stop_points = t('.stop_points') + +.stop_points.paginated_content + = paginated_content @stop_points, "stop_points/stop_point" + +- content_for :sidebar do + ul.actions + li + = link_to t('journey_patterns.actions.new'), new_referential_line_route_journey_pattern_path(@referential, @line, @route), class: 'add' + li + = link_to t('journey_patterns.actions.edit'), edit_referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern), class: 'edit' + li + = link_to t('journey_patterns.actions.destroy'), referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern), :method => :delete, :data => {:confirm => t('journey_patterns.actions.destroy_confirm')}, class: 'remove' + li + = link_to edit_referential_line_route_journey_pattern_route_sections_selector_path(@referential, @line, @route, @journey_pattern), class: "edit#{' control-shape' if @journey_pattern.control?}" do + = t('journey_patterns.actions.edit_route_sections') + - if @journey_pattern.control? + i.fa.fa-exclamation-triangle + + li + = link_to t('journey_patterns.journey_pattern.vehicle_journey_at_stops'), referential_line_route_vehicle_journeys_path(@referential, @line, @route, :q => {:journey_pattern_id_eq => @journey_pattern.id}), class: 'clock' + + = creation_tag(@journey_pattern)
\ No newline at end of file diff --git a/app/views/journey_patterns/show.kml.erb b/app/views/journey_patterns/show.kml.erb deleted file mode 100644 index 75ca50ab5..000000000 --- a/app/views/journey_patterns/show.kml.erb +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <Placemark id="route_<%= @journey_pattern.id %>" > - <name><%= @journey_pattern.name %></name> - <inactive>true</inactive> - <%= @journey_pattern.route.geometry.kml_representation.html_safe %> - </Placemark> - <% @journey_pattern.route.stop_points.each_with_index do |stop_point, index| %> - <% if stop_point.stop_area.geometry %> - <Placemark id="<%= stop_point.stop_area.id %>" > - <name><%= "#{stop_point.stop_area.name} (#{index+1})" %></name> - <stop><%= @journey_pattern.stop_points.include?( stop_point) ? "true" : "false" %></stop> - <% if stop_point.stop_area.id==@route.stop_areas.first.id %> - <departure>true</departure> - <% elsif stop_point.stop_area.id==@route.stop_areas.last.id %> - <arrival>true</arrival> - <% end %> - <iconCode><%= icon_code(stop_point, @journey_pattern)%></iconCode> - <%= stop_point.stop_area.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - <% end %> - </Document> -</kml> - diff --git a/app/views/journey_patterns/show.kml.slim b/app/views/journey_patterns/show.kml.slim new file mode 100644 index 000000000..88a137bf5 --- /dev/null +++ b/app/views/journey_patterns/show.kml.slim @@ -0,0 +1,21 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + placemark id="route_#{@journey_pattern.id}" + name = @journey_pattern.name + inactive true + = @journey_pattern.route.geometry.kml_representation.html_safe + + - @journey_pattern.route.stop_points.each_with_index do |stop_point, index| + - if stop_point.stop_area.geometry + placemark id="#{stop_point.stop_area.id}" + name = "#{stop_point.stop_area.name} (#{index+1})" + stop = @journey_pattern.stop_points.include?(stop_point) ? "true" : "false" + - if stop_point.stop_area.id == @route.stop_areas.first.id + departure true + - elsif stop_point.stop_area.id == @route.stop_areas.last.id + arrival true + + iconcode = icon_code(stop_point, @journey_pattern) + = stop_point.stop_area.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/layouts/_logos.erb b/app/views/layouts/_logos.erb deleted file mode 100644 index 0420e78a6..000000000 --- a/app/views/layouts/_logos.erb +++ /dev/null @@ -1,3 +0,0 @@ -<ul class="logos"> - <li><%= image_tag "logoMEDDE.jpg" %></li> -</ul>
\ No newline at end of file diff --git a/app/views/layouts/_logos.html.slim b/app/views/layouts/_logos.html.slim new file mode 100644 index 000000000..315e4362d --- /dev/null +++ b/app/views/layouts/_logos.html.slim @@ -0,0 +1,3 @@ +ul.logos + li + = image_tags "logoMEDDE.jpg"
\ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100644 index 78c4f4a5f..000000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -<!DOCTYPE html> -<html lang="<%= I18n.locale %>"> - <head> - <title>STIF BOIV - <%= title %></title> - <%= favicon_link_tag "logo_chouette_small.ico" %> - <%= favicon_link_tag 'logo_chouette_small.png', rel: 'apple-touch-icon', type: 'image/png' %> - <%= stylesheet_link_tag :application %> - <%= javascript_include_tag :application %> - <% if defined?( @map) %> - <script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> - <script src="http://openlayers.org/api/OpenLayers.js"></script> - <script type="text/JavaScript"> - OpenLayers.ImgPath = "<%= polymorphic_path_patch("/assets/openlayers/") %>"; - </script> - <% end %> - <%= analytics_init if Rails.env.production? %> - <%= csrf_meta_tag %> - <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> - <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> - </head> - <body> - <div id="header"> - <%= render partial: "shared/header" %> - </div> - <div id="middle" class="container"> - <div class="row"> - <div class="<%= content_for?(:sidebar) ? 'col-md-9' : 'col-md-12' %>"> - <div id="workspace" class="<%= controller_name %> <%= action_name %>"> - <%= render partial: "shared/flash_messages", flash: flash %> - <%= render partial: "shared/breadcrumb" %> - <%= yield %> - </div> - </div> - <div id="sidebar" class="<%= content_for?(:sidebar) ? 'col-md-3' : '' %>"> - <%= yield :sidebar %> - </div> - </div> - </div> - <div class="clearfix"></div> - <div id="footer"> - <%= render partial: "shared/footer" %> - </div> - </body> -</html> diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim new file mode 100644 index 000000000..fad7a3ed7 --- /dev/null +++ b/app/views/layouts/application.html.slim @@ -0,0 +1,42 @@ +doctype html +html lang=I18n.locale + head + meta charset="utf-8" + meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" + meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible" + + title = "STIF BOIV - #{title}" + + = favicon_link_tag "logo_chouette_small.ico" + = favicon_link_tag 'logo_chouette_small.png', rel: 'apple-touch-icon', type: 'image/png' + + = stylesheet_link_tag :application + = javascript_include_tag :application + + - if defined?(@map) + = javascript_include_tag "http://maps.google.com/maps/api/js?v=3.2&sensor=false" + = javascript_include_tag "http://openlayers.org/api/OpenLayers.js" + + / Todo from @jpl: check if it works... + <script type="text/JavaScript"> + OpenLayers.ImgPath = polymorphic_path_patch('/assets/openlayers/') + </script> + + = analytics_init if Rails.env.production? + = csrf_meta_tag + + body + #header + = render partial: "shared/header" + #middle.container + .row + div class=("#{content_for?(:sidebar) ? 'col-md-9' : 'col-md-12'}") + #workspace class=("#{controller_name} #{action_name}") + = render partial: "shared/flash_messages", flash: flash + = render partial: "shared/breadcrumb" + = yield + #sidebar class=("#{content_for?(:sidebar) ? 'col-md-3' : ''}") + = yield :sidebar + .clearfix + #footer + = render partial: "shared/footer" diff --git a/app/views/layouts/devise.html.erb b/app/views/layouts/devise.html.erb deleted file mode 100644 index e2def9fa3..000000000 --- a/app/views/layouts/devise.html.erb +++ /dev/null @@ -1,42 +0,0 @@ -<!DOCTYPE html> -<html lang="<%= I18n.locale %>"> - <head> - <title>Chouette V2 - <%= title %></title> - <%= favicon_link_tag "logo_chouette_small.ico" %> - <%= favicon_link_tag 'logo_chouette_small.png', rel: 'apple-touch-icon', type: 'image/png' %> - <%= stylesheet_link_tag :application %> - <%= javascript_include_tag :application %> - <% if defined?( @map) %> - <script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> - <script src="http://openlayers.org/api/OpenLayers.js"></script> - <script type="text/JavaScript"> - OpenLayers.ImgPath = "<%= polymorphic_path_patch("/assets/openlayers/") %>"; - </script> - <% end %> - <%= analytics_init if Rails.env.production? %> - <%= csrf_meta_tag %> - <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> - <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> - </head> - <body id="devise"> - <div id="header"> - <%= render partial: "shared/header" %> - </div> - <div class="front_bg"> - <div id="devise_middle" class="container"> - <div class="row"> - <div class="<%= content_for?(:sidebar) ? 'col-md-9' : 'col-md-12' %>"> - <div id="workspace" class="<%= controller_name %> <%= action_name %>"> - <%= render partial: "shared/flash_messages", flash: flash %> - <%= render partial: "shared/breadcrumb" %> - <%= yield %> - </div> - </div> - </div> - </div> - <div id="footer"> - <%= render partial: "shared/footer" %> - </div> - </div> - </body> -</html> diff --git a/app/views/layouts/devise.html.slim b/app/views/layouts/devise.html.slim new file mode 100644 index 000000000..e72748d10 --- /dev/null +++ b/app/views/layouts/devise.html.slim @@ -0,0 +1,41 @@ +doctype html +html lang=I18n.locale + head + meta charset="utf-8" + meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" + meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible" + + title = "STIF BOIV - #{title}" + + = favicon_link_tag "logo_chouette_small.ico" + = favicon_link_tag 'logo_chouette_small.png', rel: 'apple-touch-icon', type: 'image/png' + + = stylesheet_link_tag :application + = javascript_include_tag :application + + - if defined?(@map) + = javascript_include_tag "http://maps.google.com/maps/api/js?v=3.2&sensor=false" + = javascript_include_tag "http://openlayers.org/api/OpenLayers.js" + + / Todo from @jpl: check if it works... + <script type="text/JavaScript"> + OpenLayers.ImgPath = polymorphic_path_patch('/assets/openlayers/') + </script> + + = analytics_init if Rails.env.production? + = csrf_meta_tag + + body#devise + #header + = render partial: "shared/header" + + .front_bg + #devise_middle.container + .row + div class=("#{content_for?(:sidebar) ? 'col-md-9' : 'col-md-12'}") + #workspace class=("#{controller_name} #{action_name}") + = render partial: "shared/flash_messages", flash: flash + = render partial: "shared/breadcrumb" + = yield + #footer + = render partial: "shared/footer"
\ No newline at end of file diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb deleted file mode 100644 index ac00bdfea..000000000 --- a/app/views/layouts/mailer.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<html> -<head> - <title><%= message.subject %></title> - <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> -</head> - -<body style="font-family: Verdana, Helvetica, Arial, MS Trebuchet, sans-serif; font-size: 14px; width: 600px; background: #E5E5E5; padding: 15px"> - <style> - h2 { font-size: 18px; } - h3 { font-size: 14px; } - a { color: black; } - </style> - - <h1 style="background: #61970B; height: 75px; font-size: 24px; font-weight: normal; color: white; padding: 20px 0 0 30px;">Chouette</h1> - - <div style="background: white; margin-bottom: 10px; padding: 15px; -moz-box-shadow: 3px 3px 4px #bbbbbb; -webkit-box-shadow: 3px 3px 4px #BBB; box-shadow: 3px 3px 4px #BBB; border-right: 1px solid #BBB; border-bottom: 1px solid #BBB;"> - <%= yield %> - </div> - - <div style="color: #333333; text-align:center; font-size: 10px;"> - Envoyé par <%= link_to "Chouette", unauthenticated_root_url %> - </div> -</body> -</html> diff --git a/app/views/layouts/mailer.html.slim b/app/views/layouts/mailer.html.slim new file mode 100644 index 000000000..2ea993105 --- /dev/null +++ b/app/views/layouts/mailer.html.slim @@ -0,0 +1,22 @@ +doctype html +html + head + meta charset="utf-8" + title= message.subject + + body style="font-family: Verdana, Helvetica, Arial, MS Trebuchet, sans-serif; font-size: 14px; width: 600px; background: #E5E5E5; padding: 15px" + + <style> + h2 { font-size: 18px; } + h3 { font-size: 14px; } + a { color: black; } + </style> + + h1 style="background: #61970B; height: 75px; font-size: 24px; font-weight: normal; color: white; padding: 20px 0 0 30px;" + |Chouette + + div style="background: white; margin-bottom: 10px; padding: 15px; -moz-box-shadow: 3px 3px 4px #bbbbbb; -webkit-box-shadow: 3px 3px 4px #BBB; box-shadow: 3px 3px 4px #BBB; border-right: 1px solid #BBB; border-bottom: 1px solid #BBB;" + = yield + + div style="color: #333333; text-align:center; font-size: 10px;" + = "Envoyé par #{link_to 'Chouette', unauthenticated_root_url}"
\ No newline at end of file diff --git a/app/views/line_referentials/show.html.erb b/app/views/line_referentials/show.html.erb deleted file mode 100644 index 807010986..000000000 --- a/app/views/line_referentials/show.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<!-- FIXME #825 --> -<%= title_tag "Référentiel de lignes #{@line_referential.name}" %> - -<div class="summary"> - -</div> - -<div class="panel panel-default"> - <ul class="list-group" width="75%"> - <li class="list-group-item"> - <span class="badge"><%= @line_referential.group_of_lines.size %></span> - <%= link_to Referential.human_attribute_name("group_of_lines"), line_referential_group_of_lines_path(@line_referential) %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @line_referential.lines.size %></span> - <%= link_to Referential.human_attribute_name("lines"), line_referential_lines_path(@line_referential) %> - </li> - </ul> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim new file mode 100644 index 000000000..5d35d84b4 --- /dev/null +++ b/app/views/line_referentials/show.html.slim @@ -0,0 +1,31 @@ +/ FIXME #825 += title_tag "Référentiel de lignes #{@line_referential.name}" + +.summary + +.panel.panel-default + ul.list-group width="75%" + li.list-group-item + span.badge = @line_referential.group_of_lines.size + = link_to Referential.human_attribute_name("group_of_lines"), line_referential_group_of_lines_path(@line_referential) + + li.list-group-item + span.badge = @line_referential.operating_lines.size + = link_to Referential.human_attribute_name("lines"), line_referential_lines_path(@line_referential) + +- unless @line_referential.line_referential_sync.line_sync_operations.empty? + = title_tag "Historique des synchronisations" + + ul.list-group width="75%" + - @line_referential.line_referential_sync.line_sync_operations.each do |sync| + li = "#{sync.created_at.to_formatted_s(:short)} - #{sync.message}" + += semantic_form_for @line_referential, :url => line_referential_path do |form| + = form.inputs do + = form.input :sync_interval + + = form.actions do + = form.action :submit, as: :button + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb deleted file mode 100644 index c2af9d6b8..000000000 --- a/app/views/lines/_form.erb +++ /dev/null @@ -1,54 +0,0 @@ -<%= semantic_form_for [@line_referential, @line] do |form| %> - <%= form.inputs do %> - <%= form.input :network, :as => :select, :collection => Chouette::Network.all, :include_blank => false %> - <%= form.input :company, :as => :select, :collection => Chouette::Company.all, :include_blank => false%> - <%= form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.name") } %> - <%= form.input :published_name %> - <%= form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.registration_number")} %> - <%= form.input :number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.number") } %> - <%= form.input :transport_mode, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") } %> - <%= form.input :color, :as => :string %> - <%= form.input :text_color %> - <%= form.input :stable_id %> - <%= form.input :url %> - <%= form.input :mobility_restricted_suitability, :as => :select, :collection => [[@line.human_attribute_name("accessible"), true], [@line.human_attribute_name("not_accessible"), false]], :include_blank => true %> - <%= form.input :flexible_service, :as => :select, :collection => [[@line.human_attribute_name("on_demaond_fs"), true], [@line.human_attribute_name("regular_fs"), false]], :include_blank => true %> - <%= form.input :comment %> - <%= form.input :objectid, :required => !@line.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.objectid")} %> - <%= form.input :group_of_line_tokens, :label => t('.group_of_lines'), :as => :text, :input_html => { :"data-pre" => ( @line.group_of_lines.map { |group_of_line| { :id => group_of_line.id, :name => group_of_line.name } } ).to_json } %> - - <div class="footnotes_block"> - <h3><%= t("footnotes.index.title") %></h3> - <div id="footnotes"> - <%= form.semantic_fields_for :footnotes do |f| %> - <%= render "footnotes/footnote_fields", :f => f %> - <% end %> - </div> - <div class="add_footnote"> - <%= link_to_add_association t("footnotes.actions.add_footnote"), form, :footnotes , - :partial => "footnotes/footnote_fields", - :"data-association-insertion-method" => "append", - :"data-association-insertion-node" => "div#footnotes", :class => "add" %> - </div> - </div> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<script> - $(function() { - $( "#line_group_of_line_tokens" ).tokenInput('<%= name_filter_referential_group_of_lines_path(@line_referential, :format => :json) %>', { - crossDomain: false, - prePopulate: $('#group_of_line_tokens').data('pre'), - minChars: 3, - preventDuplicates: true, - hintText: '<%= t('search_hint') %>', - noResultsText: '<%= t('no_result_text') %>', - searchingText: '<%= t('searching_term') %>' - }); - }); -</script> diff --git a/app/views/lines/_form.html.slim b/app/views/lines/_form.html.slim new file mode 100644 index 000000000..113a5c46c --- /dev/null +++ b/app/views/lines/_form.html.slim @@ -0,0 +1,45 @@ += semantic_form_for [@line_referential, @line] do |form| + = form.inputs do + = form.input :network, as: :select, :collection => Chouette::Network.all, include_blank: false + = form.input :company, as: :select, :collection => Chouette::Company.all, include_blank: false + = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.name") } + = form.input :published_name + = form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.registration_number")} + = form.input :number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.number") } + = form.input :transport_mode, as: :select, :collection => Chouette::Line.transport_modes, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") } + = form.input :color, as: :string + = form.input :text_color + = form.input :stable_id + = form.input :url + = form.input :mobility_restricted_suitability, as: :select, :collection => [[@line.human_attribute_name("accessible"), true], [@line.human_attribute_name("not_accessible"), false]], :include_blank => true + = form.input :flexible_service, as: :select, :collection => [[@line.human_attribute_name("on_demaond_fs"), true], [@line.human_attribute_name("regular_fs"), false]], :include_blank => true + = form.input :comment + = form.input :objectid, :required => !@line.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.line.objectid")} + = form.input :group_of_line_tokens, :label => t('.group_of_lines'), as: :text, :input_html => { :"data-pre" => ( @line.group_of_lines.map { |group_of_line| { :id => group_of_line.id, :name => group_of_line.name } } ).to_json } + + .footnotes_block + h3 = t("footnotes.index.title") + + #footnotes + = form.semantic_fields_for :footnotes do |f| + = render "footnotes/footnote_fields", :f => f + + .add_footnote + = link_to_add_association t("footnotes.actions.add_footnote"), form, :footnotes , :partial => "footnotes/footnote_fields", :"data-association-insertion-method" => "append", :"data-association-insertion-node" => "div#footnotes", class: 'add' + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +javascript: + $(function() { + $("#line_group_of_line_tokens").tokenInput("#{name_filter_referential_group_of_lines_path(@line_referential, format: :json)}", { + crossDomain: false, + prePopulate: $('#group_of_line_tokens').data('pre'), + minChars: 3, + preventDuplicates: true, + hintText: "#{I18n.t('search_hint')}", + noResultsText: "#{I18n.t('no_result_text')}", + searchingText: "#{I18n.t('searching_term')}" + }); + });
\ No newline at end of file diff --git a/app/views/lines/_line.erb b/app/views/lines/_line.erb deleted file mode 100644 index bd3a79d0e..000000000 --- a/app/views/lines/_line.erb +++ /dev/null @@ -1,52 +0,0 @@ -<div id="index_item" class="panel panel-default line ce-LineBlock"> - <div class="panel-heading ce-LineBlock-header"> - <ul class="ce-LineBlock-header-list"> - <li> - <%= check_box_tag "ids[]", line.id, false, class: "multiple_selection", style: "display: none;" %> - <% if line.number && line.number.length <= 3 %> - <span class="label label-default line_number" style="<%= number_style(line) %>"><%= line.number %></span> - <% end %> - </li> - <li> - <%= link_to([line.line_referential, line], class: 'preview', title: "#{Chouette::Line.model_name.human.capitalize} #{line.name}") do %> - <h5 class="ce-LineBlock-header-title"><%= truncate(line.name, length: 24) %></h5> - <% end %> - </li> - <li> - <%= link_to edit_line_referential_line_path(line.line_referential, line), class: 'btn btn-default btn-sm' do %> - <span class="fa fa-pencil"></span> - <% end if edit %> - <%= link_to line_referential_line_path(line.line_referential, line), method: :delete, data: { confirm: t('lines.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do %> - <span class="fa fa-trash-o"></span> - <% end if delete %> - </li> - </ul> - </div> - <div class="panel-body"> - <p> - <% if line.network.nil? %> - <%= line.human_attribute_name('network') %> <%= t('lines.index.unset') %> - <% else %> - <!-- FIXME #825 --> - <%= line.human_attribute_name('network') %> <%#= link_to_if line.network, line.network.name, line_referential_network_path(line.line_referential, line.network), :title => "#{line.human_attribute_name('network')} #{line.network.name}" %> - <% end %> - </p> - <p> - <% if line.company.nil? %> - <%= line.human_attribute_name('company') %> <%= t('lines.index.unset') %> - <% else %> - <%= line.human_attribute_name('company') %> <%#= link_to_if( line.company, line.company.name, line_referential_company_path(line.line_referential, line.company), :title => "#{line.human_attribute_name('company')} #{line.company.name}" ) %> - <% end %> - </p> - <p> - <% if line.group_of_lines.count == 0 %> - <br><%# t('lines.form.no_group_of_line') %> - <% elsif line.group_of_lines.count == 1 %> - <%= line.human_attribute_name('group_of_line') %> - <%= link_to_if( line.group_of_lines.first, line.group_of_lines.first.name, line_referential_group_of_line_path(line.line_referential, line.group_of_lines.first), :title => "#{line.human_attribute_name('group_of_line')} #{line.group_of_lines.first.name}") %> - <% else %> - <%= t('lines.form.several_group_of_lines', :count => line.group_of_lines.count) %> - <% end %> - </p> - </div> -</div> diff --git a/app/views/lines/_line.html.slim b/app/views/lines/_line.html.slim new file mode 100644 index 000000000..eb7aecc1d --- /dev/null +++ b/app/views/lines/_line.html.slim @@ -0,0 +1,51 @@ +#index_item.panel.panel-default.line.ce-LineBlock + .panel-heading.ce-LineBlock-header + ul.ce-LineBlock-header-list + li + = check_box_tag "ids[]", line.id, false, class: "multiple_selection", style: "display: none;" + + - if (line.number && line.number.length <= 3) + span.label.label-default.line_number style="#{number_style(line)}" + = line.number + + li + = link_to([line.line_referential, line], class: 'preview', title: "#{Chouette::Line.model_name.human.capitalize} #{line.name}") do + h5.ce-LineBlock-header-title = truncate(line.name, length: 24) + + li + .btn-group + - if edit + = link_to edit_line_referential_line_path(line.line_referential, line), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + - if delete + = link_to line_referential_line_path(line.line_referential, line), method: :delete, data: { confirm: t('lines.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + .panel-body + p + - if line.network.nil? + = line.human_attribute_name('network') + = t('lines.index.unset') + - else + / FIXME #825 + = line.human_attribute_name('network') + / = link_to_if line.network, line.network.name, line_referential_network_path(line.line_referential, line.network), :title => "#{line.human_attribute_name('network')} #{line.network.name}" + + p + - if line.company.nil? + = line.human_attribute_name('company') + = t('lines.index.unset') + - else + = line.human_attribute_name('company') + / = link_to_if( line.company, line.company.name, line_referential_company_path(line.line_referential, line.company), :title => "#{line.human_attribute_name('company')} #{line.company.name}" ) + + p + - if line.group_of_lines.count == 0 + br + / = t('lines.form.no_group_of_line') + - elsif line.group_of_lines.count == 1 + = line.human_attribute_name('group_of_line') + = link_to_if( line.group_of_lines.first, line.group_of_lines.first.name, line_referential_group_of_line_path(line.line_referential, line.group_of_lines.first), :title => "#{line.human_attribute_name('group_of_line')} #{line.group_of_lines.first.name}") + - else + = t('lines.form.several_group_of_lines', :count => line.group_of_lines.count)
\ No newline at end of file diff --git a/app/views/lines/_lines.html.erb b/app/views/lines/_lines.html.erb deleted file mode 100644 index a4d9a3f0b..000000000 --- a/app/views/lines/_lines.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @lines %> -</div> -<div class="lines paginated_content"> - <%= paginated_content(@lines) %> -</div> -<div class="pagination"> - <%= will_paginate @lines, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/lines/_lines.html.slim b/app/views/lines/_lines.html.slim new file mode 100644 index 000000000..7de88c2c3 --- /dev/null +++ b/app/views/lines/_lines.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t("will_paginate.page_entries_info.search") + = page_entries_info @lines + +.lines.paginated_content + = paginated_content(@lines) + +.pagination + = will_paginate @lines, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/lines/edit.html.erb b/app/views/lines/edit.html.erb deleted file mode 100644 index d2c9880ae..000000000 --- a/app/views/lines/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('lines.edit.title', :line => @line.name ) %> - -<%= render "form" %> diff --git a/app/views/lines/edit.html.slim b/app/views/lines/edit.html.slim new file mode 100644 index 000000000..0036d023b --- /dev/null +++ b/app/views/lines/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('lines.edit.title', line: @line.name) + += render 'form'
\ No newline at end of file diff --git a/app/views/lines/index.html.erb b/app/views/lines/index.html.erb deleted file mode 100644 index 0995d0021..000000000 --- a/app/views/lines/index.html.erb +++ /dev/null @@ -1,52 +0,0 @@ -<%= title_tag t('lines.index.title') %> - -<%= search_form_for @q, :url => line_referential_lines_path(@line_referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <div class="input-group col-md-9"> - <%= f.text_field :name_or_number_cont, :placeholder => "#{t('.name_or_number')}", :class => 'form-control' %> - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div><!-- /input-group --> - <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> - <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> - </a> - </div> - - <div id="advanced_search" class="panel-collapse collapse"> - <div class="panel-body"> - <!-- FIXME #825 --> - <%#= f.select(:network_id_eq, @line_referential.networks.collect {|n| [ n.name, n.id ] }.unshift([t('.no_networks'), -1]), {include_blank: t('.all_networks')}, { :class => 'form-control' }) %> - <%#= f.select(:company_id_eq, @line_referential.companies.collect {|c| [ c.name, c.id ] }.unshift([t('.no_companies'), -1]), { include_blank: t('.all_companies')}, { :class => 'form-control' }) %> - <%#= f.select(:group_of_lines_id_eq, @line_referential.group_of_lines.collect {|c| [ c.name, c.id ] }.unshift([t('.no_group_of_lines'), -1]), {include_blank: t('.all_group_of_lines')}, { :class => 'form-control' }) %> - </div> - </div> -</div> -<% end %> - -<div id="lines"><%= render 'lines' %></div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('lines.actions.new'), new_line_referential_line_path(@line_referential), :class => "add" %></li> -</ul> - -<div id="multiple_selection_menu"> - <h4><%= t(".multi_selection") %> </h4> - <div class="disabled"> - <a class="enable" href="#"><%= t(".multi_selection_enable") %></a> - </div> - - <div class="enabled" style="display: none;"> - <a class="disable" href="#"><%= t(".multi_selection_disable") %></a> - - <ul class="actions"> - <%= link_to t(".delete_selected"), line_referential_lines_path(@line_referential), "data-multiple-method" => "delete", :class => "remove", "confirmation-text" => t("lines.actions.destroy_selection_confirm") %> - </ul> - - <a class="select_all" href="#"><%= t(".select_all") %></a> | <a class="deselect_all" href="#"><%= t(".deselect_all") %></a> - </div> -</div> - -<% end %> diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim new file mode 100644 index 000000000..5892dba36 --- /dev/null +++ b/app/views/lines/index.html.slim @@ -0,0 +1,49 @@ += title_tag t('lines.index.title') + += search_form_for @q, :url => line_referential_lines_path(@line_referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| + .panel.panel-default + .panel-heading + .input-group.col-md-9 + = f.text_field :name_or_number_cont, placeholder: "#{t('.name_or_number')}", class: 'form-control' + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + a data-toggle="collapse" data-parent="#search" href="#advanced_search" + i.fa.fa-plus + = "#{t('.advanced_search')}" + + #advanced_search.panel-collapse.collapse + .panel-body + / FIXME #825 + / = f.select(:network_id_eq, @line_referential.networks.collect {|n| [ n.name, n.id ] }.unshift([t('.no_networks'), -1]), {include_blank: t('.all_networks')}, { :class => 'form-control' }) + / = f.select(:company_id_eq, @line_referential.companies.collect {|c| [ c.name, c.id ] }.unshift([t('.no_companies'), -1]), { include_blank: t('.all_companies')}, { :class => 'form-control' }) + / = f.select(:group_of_lines_id_eq, @line_referential.group_of_lines.collect {|c| [ c.name, c.id ] }.unshift([t('.no_group_of_lines'), -1]), {include_blank: t('.all_group_of_lines')}, { :class => 'form-control' }) + +#lines + = render 'lines' + +- content_for :sidebar do + ul.actions + li + = link_to t('lines.actions.new'), new_line_referential_line_path(@line_referential), class: 'add' + + #multiple_selection_menu + h4 = t('.multi_selection') + + .disabled + a.enable href="#" + = t('.multi_selection_enable') + + .enabled style="display: none;" + a.disable href="#" + = t('.multi_selection_disable') + + ul.actions + = link_to t('.delete_selected'), line_referential_lines_path(@line_referential), "data-multiple-method" => "delete", class: 'remove', "confirmation-text" => t("lines.actions.destroy_selection_confirm") + + a.select_all href="#" + = t('.select_all') + = " | " + a.deselect_all href="#" + = t('.deselect_all')
\ No newline at end of file diff --git a/app/views/lines/index.js.erb b/app/views/lines/index.js.erb deleted file mode 100644 index 97595d5e9..000000000 --- a/app/views/lines/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#lines').html('<%= escape_javascript(render("lines")) %>');
\ No newline at end of file diff --git a/app/views/lines/index.js.slim b/app/views/lines/index.js.slim new file mode 100644 index 000000000..1e94d130c --- /dev/null +++ b/app/views/lines/index.js.slim @@ -0,0 +1 @@ +| $('#lines').html("#{escape_javascript(render('lines'))}");
\ No newline at end of file diff --git a/app/views/lines/new.html.erb b/app/views/lines/new.html.erb deleted file mode 100644 index 452ec5df2..000000000 --- a/app/views/lines/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('lines.new.title') %> - -<%= render "form" %> diff --git a/app/views/lines/new.html.slim b/app/views/lines/new.html.slim new file mode 100644 index 000000000..56da24d7c --- /dev/null +++ b/app/views/lines/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('lines.new.title') + += render 'form'
\ No newline at end of file diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb deleted file mode 100644 index 8426319b6..000000000 --- a/app/views/lines/show.html.erb +++ /dev/null @@ -1,141 +0,0 @@ -<% text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" %> -<% bg_color = @line.color.blank? ? "white" : "#"+@line.color %> - -<%= title_tag t('lines.show.title', :line => @line.name ) %> - -<div class="line_show"> - <%= @map.to_html %> - - <div class="summary"> - <% text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" %> - <% bg_color = @line.color.blank? ? "white" : "#"+@line.color %> - <% if colors?(@line) %> - <p> - <label><%= t('lines.index.color') %>: </label> - <label class="color" style='<%="#{number_style(@line)}"%>'><%= line_sticker(@line) %></label> - </p> - <% end %> - <p> - <label><%= @line.human_attribute_name(:network) %>: </label> - <% if @line.network.nil? %> - <%= t('lines.index.unset') %> - <% else %> - <!-- FIXME #825 --> - <%#= link_to @line.network.name, [@referential, @line.network] %> - <% end %> - </p> - <p> - <label><%= @line.human_attribute_name(:company) %>: </label> - <% if @line.company.nil? %> - <%= t('lines.index.unset') %> - <% else %> - <!-- FIXME #825 --> - <%#= link_to @line.company.name, [@referential, @line.company] %> - <% end %> - </p> - <p> - <label><%= @line.human_attribute_name("number") %>: </label> - <%= @line.number %> - </p> - <p> - <label><%= @line.human_attribute_name("published_name") %>: </label> - <%= @line.published_name %> - </p> - <p> - <label><%= @line.human_attribute_name("registration_number") %>: </label> - <%= @line.registration_number %> - </p> - <p> - <label><%= @line.human_attribute_name("transport_mode") %>: </label> - <%= t("transport_modes.label.#{@line.transport_mode}") %> - </p> - <p> - <label><%= @line.human_attribute_name("stable_id") %>: </label> - <%= @line.stable_id %> - </p> - - <p> - <label><%= @line.human_attribute_name("url") %>: </label> - <%= @line.url %> - </p> - - <p> - <label><%= @line.human_attribute_name("mobility_restricted_suitability") %> : </label> - <% if @line.mobility_restricted_suitability.nil? %> - <%= @line.human_attribute_name("unspecified_mrs") %> - <% elsif @line.mobility_restricted_suitability? %> - <%= @line.human_attribute_name("accessible") %> - <% else %> - <%= @line.human_attribute_name("not_accessible") %> - <% end %> - <br> <%= @line.human_attribute_name("number_of_mrs_vj") %> : <%= @line.vehicle_journeys.where("mobility_restricted_suitability = ?", true).count %> - <br> <%= @line.human_attribute_name("number_of_non_mrs_vj") %> : <%= @line.vehicle_journeys.where("mobility_restricted_suitability = ?", false).count %> - <br> <%= @line.human_attribute_name("number_of_null_mrs_vj") %> : <%= @line.vehicle_journeys.count - - (@line.vehicle_journeys.where("mobility_restricted_suitability = ?", true).count + - @line.vehicle_journeys.where("mobility_restricted_suitability = ?", false).count) %> - </p> - <p> - <label><%= @line.human_attribute_name("flexible_service") %> : </label> - <% if @line.flexible_service.nil? %> - <%= @line.human_attribute_name("unspecified_fs") %> - <% elsif @line.flexible_service? %> - <%= @line.human_attribute_name("on_demaond_fs") %> - <% else %> - <%= @line.human_attribute_name("regular_fs") %> - <% end %> - <br> <%= @line.human_attribute_name("number_of_fs_vj") %> : <%= @line.vehicle_journeys.where("flexible_service = ?", true).count %> - <br> <%= @line.human_attribute_name("number_of_non_fs_vj") %> : <%= @line.vehicle_journeys.where("flexible_service = ?", false).count %> - <br> <%= @line.human_attribute_name("number_of_null_fs_vj") %> - <% if @line.flexible_service.nil? %> - (<%= @line.human_attribute_name("default_fs_msg") %>) - <% end %> - : <%= @line.vehicle_journeys.count - - (@line.vehicle_journeys.where("flexible_service = ?", true).count + - @line.vehicle_journeys.where("flexible_service = ?", false).count) %> - </p> - <p> - <label><%= @line.human_attribute_name("footnotes") %>: </label> - <ul> - <% @line.footnotes.each do |footnote| %> - <li><%= footnote.code %> : <%= footnote.label %></li> - <% end %> - </ul> - </p> - <p> - <label><%= @line.human_attribute_name("comment") %>: </label> - <%= @line.comment %> - </p> - </div> - - <div class="row"> - <div id="mobility_restricted_suitability" class="col-md-6"></div> - <div id="flexible_service" class="col-md-6"></div> - </div> -</div> - -<p class="after_map" /> -<h3 class="routes"><%= t('.itineraries') %></h3> -<div class="routes paginated_content"> - <!-- FIXME #825 --> - <%#= paginated_content @routes, "routes/route" %> -</div> - -<% if @line.group_of_lines.any? %> - <h3 class="line_group_of_lines"><%= t('.group_of_lines') %></h3> - <div class="group_of_lines paginated_content"> - <%= paginated_content @group_of_lines, "group_of_lines/group_of_line", :delete => false %> - </div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('lines.actions.new'), new_line_referential_line_path(@line_referential), :class => "add" %></li> - <li><%= link_to t('lines.actions.edit'), edit_line_referential_line_path(@line_referential, @line), :class => "edit" %></li> - <li><%= link_to t('lines.actions.destroy'), line_referential_line_path(@line_referential, @line), :method => :delete, :data => {:confirm => t('lines.actions.destroy_confirm')}, :class => "remove" %></li> - <% if !@line.hub_restricted? || (@line.hub_restricted? && @line.routes.size < 2) %> - <!-- FIXME #825 --> - <li><%#= link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), :class => "add" %></li> - <% end %> -</ul> - <%= creation_tag(@line) %> -<% end %> diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim new file mode 100644 index 000000000..b559df842 --- /dev/null +++ b/app/views/lines/show.html.slim @@ -0,0 +1,144 @@ +- text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" +- bg_color = @line.color.blank? ? "white" : "##{@line.color}" + += title_tag t('lines.show.title', line: @line.name) + +.line_show + = @map.to_html + + .summary + - text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" + - bg_color = @line.color.blank? ? "white" : "##{@line.color}" + + - if colors?(@line) + p + label = "#{t('lines.index.color')} : " + label.color style="#{number_style(@line)}" + = line_sticker(@line) + + p + label = "#{@line.human_attribute_name(:network)} : " + + - if @line.network.nil? + = t('lines.index.unset') + - else + / FIXME #825 + / = link_to @line.network.name, [@referential, @line.network] + + p + label = "#{@line.human_attribute_name(:company)} : " + + - if @line.company.nil? + = t('lines.index.unset') + - else + / FIXME #825 + / = link_to @line.company.name, [@referential, @line.company] + + p + label = "#{@line.human_attribute_name('number')} : " + = @line.number + + p + label = "#{@line.human_attribute_name('published_name')} : " + = @line.published_name + + p + label = "#{@line.human_attribute_name('registration_number')} : " + = @line.registration_number + + p + label = "#{@line.human_attribute_name('transport_mode')} : " + = t("transport_modes.label.#{@line.transport_mode}") + + p + label = "#{@line.human_attribute_name('stable_id')} : " + = @line.stable_id + + p + label = "#{@line.human_attribute_name('url')} : " + = @line.url + + p + label = "#{@line.human_attribute_name('mobility_restricted_suitability')} : " + + - if @line.mobility_restricted_suitability.nil? + = @line.human_attribute_name("unspecified_mrs") + - elsif @line.mobility_restricted_suitability? + = @line.human_attribute_name("accessible") + - else + = @line.human_attribute_name("not_accessible") + + br + = "#{@line.human_attribute_name('number_of_mrs_vj')} : #{@line.vehicle_journeys.where('mobility_restricted_suitability = ?', true).count}" + br + = "#{@line.human_attribute_name('number_of_non_mrs_vj')} : #{@line.vehicle_journeys.where('mobility_restricted_suitability = ?', false).count}" + br + = @line.human_attribute_name("number_of_null_mrs_vj") + = " : " + = @line.vehicle_journeys.count - (@line.vehicle_journeys.where("mobility_restricted_suitability = ?", true).count + @line.vehicle_journeys.where("mobility_restricted_suitability = ?", false).count) + + p + label = "#{@line.human_attribute_name('flexible_service')} : " + + - if @line.flexible_service.nil? + = @line.human_attribute_name("unspecified_fs") + - elsif @line.flexible_service? + = @line.human_attribute_name("on_demaond_fs") + - else + = @line.human_attribute_name("regular_fs") + + br + = "#{@line.human_attribute_name('number_of_fs_vj')} : #{@line.vehicle_journeys.where('flexible_service = ?', true).count}" + br + = "#{@line.human_attribute_name('number_of_non_fs_vj')} : #{@line.vehicle_journeys.where('flexible_service = ?', false).count}" + br + = @line.human_attribute_name("number_of_null_fs_vj") + + - if @line.flexible_service.nil? + = "(#{@line.human_attribute_name('default_fs_msg')})" + + = " : " + = @line.vehicle_journeys.count - (@line.vehicle_journeys.where("flexible_service = ?", true).count + @line.vehicle_journeys.where("flexible_service = ?", false).count) + + p + label = "#{@line.human_attribute_name('footnotes')} : " + ul + - @line.footnotes.each do |footnote| + li = "#{footnote.code} : #{footnote.label}" + + p + label = "#{@line.human_attribute_name('comment')} : " + = @line.comment + + .row + #mobility_restricted_suitability.col-md-6 + #flexible_service.col-md-6 + +p.after_map + +h3.routes = t('.itineraries') + +.routes.paginated_content + / FIXME #825 + / = paginated_content @routes, "routes/route" + +- if @line.group_of_lines.any? + h3.line_group_of_lines = t('.group_of_lines') + .group_of_lines.paginated_content + = paginated_content @group_of_lines, "group_of_lines/group_of_line", delete: false + +- content_for :sidebar do + ul.actions + li + = link_to t('lines.actions.new'), new_line_referential_line_path(@line_referential), class: 'add' + li + = link_to t('lines.actions.edit'), edit_line_referential_line_path(@line_referential, @line), class: 'edit' + li + = link_to t('lines.actions.destroy'), line_referential_line_path(@line_referential, @line), method: :delete, :data => {:confirm => t('lines.actions.destroy_confirm')}, class: 'remove' + + - if !@line.hub_restricted? || (@line.hub_restricted? && @line.routes.size < 2) + / FIXME #825 + li + / = link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), class: 'add' + + = creation_tag(@line)
\ No newline at end of file diff --git a/app/views/lines/show.kml.erb b/app/views/lines/show.kml.erb deleted file mode 100644 index 8e1c82eef..000000000 --- a/app/views/lines/show.kml.erb +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% @line.commercial_stop_areas.each do |stop_area| %> - <Placemark id="<%= stop_area.id %>" > - <name><%= stop_area.name %></name> - <stop_area_type><%= stop_area.area_type.underscore %></stop_area_type> - <stop_area_type_label><%= t("area_types.label.#{stop_area.stop_area_type}") %></stop_area_type_label> - <%= (stop_area.position or stop_area.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/lines/show.kml.slim b/app/views/lines/show.kml.slim new file mode 100644 index 000000000..97f589e31 --- /dev/null +++ b/app/views/lines/show.kml.slim @@ -0,0 +1,10 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - @line.commercial_stop_areas.each do |stop_area| + placemark id="#{stop_area.id}" + name = stop_area.name + stop_area_type = stop_area.area_type.underscore + stop_area_type_label = t("area_types.label.#{stop_area.stop_area_type}") + = (stop_area.position or stop_area.default_position).kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/networks/_form.erb b/app/views/networks/_form.erb deleted file mode 100644 index 5794794fd..000000000 --- a/app/views/networks/_form.erb +++ /dev/null @@ -1,18 +0,0 @@ -<%= semantic_form_for [@referential, @network] do |form| %> - <%= form.inputs do %> - <%= form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.network.name")} %> - <%= form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.network.registration_number")} %> - <%= form.input :comment %> - <%= form.input :version_date, :as => :date_picker %> - <%= form.input :description %> - <%= form.input :source_name %> - <%= form.input :source_type_name, :as => :select, :collection => Chouette::Network.source_type_names, :include_blank => true, :member_label => Proc.new { |mode| t("source_types.label.#{mode}") } %> - <%= form.input :source_identifier %> - <%= form.input :objectid, :required => !@network.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.network.objectid")} %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> diff --git a/app/views/networks/_form.html.slim b/app/views/networks/_form.html.slim new file mode 100644 index 000000000..e7020ef68 --- /dev/null +++ b/app/views/networks/_form.html.slim @@ -0,0 +1,15 @@ += semantic_form_for [@referential, @network] do |form| + = form.inputs do + = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.network.name")} + = form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.network.registration_number")} + = form.input :comment + = form.input :version_date, as: :date_picker + = form.input :description + = form.input :source_name + = form.input :source_type_name, as: :select, :collection => Chouette::Network.source_type_names, :include_blank => true, :member_label => Proc.new { |mode| t("source_types.label.#{mode}") } + = form.input :source_identifier + = form.input :objectid, :required => !@network.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.network.objectid")} + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/networks/_network.erb b/app/views/networks/_network.erb deleted file mode 100644 index 618e39b72..000000000 --- a/app/views/networks/_network.erb +++ /dev/null @@ -1,21 +0,0 @@ -<div id="index_item" class="panel panel-default network"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_network_path(@referential, network), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to referential_network_path(@referential, network), :method => :delete, :data => {:confirm => t('networks.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, network], :class => "preview", :title => "#{Chouette::Network.model_name.human.capitalize} #{network.name}") do %> - <span class="name"> - <%= truncate(network.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> -</div> diff --git a/app/views/networks/_network.html.slim b/app/views/networks/_network.html.slim new file mode 100644 index 000000000..dc1aa6b5c --- /dev/null +++ b/app/views/networks/_network.html.slim @@ -0,0 +1,14 @@ +#index_item.panel.panel-default.network + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_referential_network_path(@referential, network), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + = link_to referential_network_path(@referential, network), method: :delete, :data => { :confirm => t('networks.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to [@referential, network], class: 'preview', title: "#{Chouette::Network.model_name.human.capitalize} #{network.name}" do + span.name + = truncate(network.name, :length => 20)
\ No newline at end of file diff --git a/app/views/networks/_networks.erb b/app/views/networks/_networks.erb deleted file mode 100644 index 9d95d63b6..000000000 --- a/app/views/networks/_networks.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @networks %> -</div> -<div class="networks paginated_content"> - <%= paginated_content(@networks) %> -</div> -<div class="pagination"> - <%= will_paginate @networks, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/networks/_networks.html.slim b/app/views/networks/_networks.html.slim new file mode 100644 index 000000000..9143e5c16 --- /dev/null +++ b/app/views/networks/_networks.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t('will_paginate.page_entries_info.search') + = page_entries_info @networks + +.networks.paginated_content + = paginated_content(@networks) + +.pagination + = will_paginate @networks, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/networks/edit.html.erb b/app/views/networks/edit.html.erb deleted file mode 100644 index b551690d6..000000000 --- a/app/views/networks/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('networks.edit.title', :network => @network.name) %> - -<%= render "form" %> diff --git a/app/views/networks/edit.html.slim b/app/views/networks/edit.html.slim new file mode 100644 index 000000000..d4e088937 --- /dev/null +++ b/app/views/networks/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('networks.edit.title', network: @network.name) + += render 'form'
\ No newline at end of file diff --git a/app/views/networks/index.html.erb b/app/views/networks/index.html.erb deleted file mode 100644 index e093a258c..000000000 --- a/app/views/networks/index.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%= title_tag t('networks.index.title') %> - -<%= search_form_for @q, :url => referential_networks_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <div class="input-group col-md-12"> - <%= f.text_field :name_cont, :placeholder => "#{t('.name')}", :class => "form-control" %> - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div><!-- /input-group --> - <!-- <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> --> - <!-- <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> --> - <!-- </a> --> - </div> -</div> -<% end %> - -<div id="networks"><%= render 'networks' %></div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('networks.actions.new'), new_referential_network_path(@referential), :class => "add" %></li> - <br> -</ul> -<% end %> diff --git a/app/views/networks/index.html.slim b/app/views/networks/index.html.slim new file mode 100644 index 000000000..f3ead931e --- /dev/null +++ b/app/views/networks/index.html.slim @@ -0,0 +1,23 @@ += title_tag t('networks.index.title') + += search_form_for @q, :url => referential_networks_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| + .panel.panel-default + .panel-heading + .input-group.col-md-12 + = f.text_field :name_cont, placeholder: "#{t('.name')}", class: 'form-control' + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + / <!-- <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> --> + / <!-- <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> --> + / <!-- </a> --> + +#networks + = render 'networks' + +- content_for :sidebar do + ul.actions + li + = link_to t('networks.actions.new'), new_referential_network_path(@referential), class: 'add' + br
\ No newline at end of file diff --git a/app/views/networks/index.js.erb b/app/views/networks/index.js.erb deleted file mode 100644 index 43d9ce10c..000000000 --- a/app/views/networks/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#networks').html('<%= escape_javascript(render("networks")) %>');
\ No newline at end of file diff --git a/app/views/networks/index.js.slim b/app/views/networks/index.js.slim new file mode 100644 index 000000000..930880dfa --- /dev/null +++ b/app/views/networks/index.js.slim @@ -0,0 +1 @@ +| $('#networks').html("#{escape_javascript(render('networks'))}");
\ No newline at end of file diff --git a/app/views/networks/new.html.erb b/app/views/networks/new.html.erb deleted file mode 100644 index 749beb197..000000000 --- a/app/views/networks/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('networks.new.title') %> - -<%= render "form" %> diff --git a/app/views/networks/new.html.slim b/app/views/networks/new.html.slim new file mode 100644 index 000000000..7071ded33 --- /dev/null +++ b/app/views/networks/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('networks.new.title') + += render 'form'
\ No newline at end of file diff --git a/app/views/networks/show.html.erb b/app/views/networks/show.html.erb deleted file mode 100644 index d61974394..000000000 --- a/app/views/networks/show.html.erb +++ /dev/null @@ -1,49 +0,0 @@ -<%= title_tag t('networks.show.title', :network => @network.name )%> - -<div class="network_show"> - <%= @map.to_html %> - <div class="summary"> - <p> - <label><%= Chouette::Network.human_attribute_name("registration_number") %>: </label> - <%= @network.registration_number %> - </p> - <p> - <label><%= Chouette::Network.human_attribute_name("comment") %>: </label> - <%= @network.comment %> - </p> - <p> - <label><%= Chouette::Network.human_attribute_name("version_date") %>: </label> - <% if @network.version_date.present? %> - <%= l @network.version_date %> - <%end%> - </p> - <p> - <label><%= Chouette::Network.human_attribute_name("description") %>: </label> - <%= @network.description %> - </p> - <p> - <label><%= Chouette::Network.human_attribute_name("source_name") %>: </label> - <%= @network.source_name %> - </p> - <p> - <label><%= Chouette::Network.human_attribute_name("source_type_name") %>: </label> - <% if @network.source_type_name.present? %> - <%= t("source_types.label.#{@network.source_type_name}") %> - <% end %> - </p> - <p> - <label><%= Chouette::Network.human_attribute_name("source_identifier") %>: </label> - <%= @network.source_identifier %> - </p> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('networks.actions.new'), new_referential_network_path(@referential), :class => "add" %></li> - <li><%= link_to t('networks.actions.edit'), edit_referential_network_path(@referential, @network), :class => "edit" %></li> - <li><%= link_to t('networks.actions.destroy'), referential_network_path(@referential, @network), :method => :delete, :data => {:confirm => t('networks.actions.destroy_confirm')}, :class => "remove" %></li> - <br> -</ul> - <%= creation_tag(@network) %> -<% end %> diff --git a/app/views/networks/show.html.slim b/app/views/networks/show.html.slim new file mode 100644 index 000000000..936f6a4a8 --- /dev/null +++ b/app/views/networks/show.html.slim @@ -0,0 +1,47 @@ += title_tag t('networks.show.title', network: @network.name) + +.network_show + = @map.to_html + + .summary + p + label = "#{Chouette::Network.human_attribute_name('registration_number')} : " + = @network.registration_number + + p + label = "#{Chouette::Network.human_attribute_name('comment')} : " + = @network.comment + + p + label = "#{Chouette::Network.human_attribute_name('version_date')} : " + - if @network.version_date.present? + = l @network.version_date + + p + label = "#{Chouette::Network.human_attribute_name('description')} : " + = @network.description + + p + label = "#{Chouette::Network.human_attribute_name('source_name')} : " + = @network.source_name + + p + label = "#{Chouette::Network.human_attribute_name('source_type_name')} : " + - if @network.source_type_name.present? + = t("source_types.label.#{@network.source_type_name}") + + p + label = "#{Chouette::Network.human_attribute_name('source_identifier')} : " + = @network.source_identifier + +- content_for :sidebar do + ul.actions + li + = link_to t('networks.actions.new'), new_referential_network_path(@referential), class: 'add' + li + = link_to t('networks.actions.edit'), edit_referential_network_path(@referential, @network), class: 'edit' + li + = link_to t('networks.actions.destroy'), referential_network_path(@referential, @network), method: :delete, data: { :confirm => t('networks.actions.destroy_confirm')}, class: 'remove' + br + + = creation_tag(@network)
\ No newline at end of file diff --git a/app/views/networks/show.kml.erb b/app/views/networks/show.kml.erb deleted file mode 100644 index 34d4598fe..000000000 --- a/app/views/networks/show.kml.erb +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% @network.commercial_stop_areas.each do |stop_area| %> - <Placemark id="<%= stop_area.id %>" > - <name><%= stop_area.name %></name> - <stop_area_type><%= stop_area.area_type.underscore %></stop_area_type> - <stop_area_type_label><%= t("area_types.label.#{stop_area.stop_area_type}") %></stop_area_type_label> - <%= (stop_area.position or stop_area.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/networks/show.kml.slim b/app/views/networks/show.kml.slim new file mode 100644 index 000000000..5fd79cd47 --- /dev/null +++ b/app/views/networks/show.kml.slim @@ -0,0 +1,10 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - @network.commercial_stop_areas.each do |stop_area| + placemark id="#{stop_area.id}" + name = stop_area.name + stop_area_type = stop_area.area_type.underscore + stop_area_type_label = t("area_types.label.#{stop_area.stop_area_type}") + = (stop_area.position or stop_area.default_position).kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/offer_workbenches/_referential.erb b/app/views/offer_workbenches/_referential.erb deleted file mode 100644 index ea1a1f899..000000000 --- a/app/views/offer_workbenches/_referential.erb +++ /dev/null @@ -1,36 +0,0 @@ -<div id="index_item" class="panel panel-default referential"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_path(referential), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to referential_path(referential), :method => :delete, :data => {:confirm => t('referentials.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, referential], :class => "preview", :title => "#{Referential.model_name.human.capitalize} #{referential.name}") do %> - <span class="name"> - <%= truncate(referential.name, :length => 30) %> - </span> - <% end %> - </h5> - </div> - </div> - <div id="referential_<%= referential.id %>" class="panel-body"> - <p> - <%= referential.human_attribute_name('lines') %>: <span class="lines_count"></span> - </p> - <p> - <%= referential.human_attribute_name('networks') %>: <span class="networks_count"></span> - </p> - <p> - <%= referential.human_attribute_name('vehicle_journeys') %>: <span class="vehicle_journeys_count"></span> - </p> - <p> - <%= referential.human_attribute_name('time_tables') %>: <span class="time_tables_count"></span> - </p> - </div> -</div> -<%= javascript_include_tag referential_path(referential,:format => :js) %> diff --git a/app/views/offer_workbenches/_referential.html.slim b/app/views/offer_workbenches/_referential.html.slim new file mode 100644 index 000000000..cc1964f30 --- /dev/null +++ b/app/views/offer_workbenches/_referential.html.slim @@ -0,0 +1,34 @@ +#index_item.panel.panel-default.referential + .panel-heading + .panel-title.clearfix + span.pull-right + .btn-group + = link_to edit_referential_path(referential), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + = link_to referential_path(referential), method: :delete, :data => {:confirm => t('referentials.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to [@referential, referential], class: 'preview', title: "#{Referential.model_name.human.capitalize} #{referential.name}" do + span.name + = truncate(referential.name, :length => 30) + + div.panel-body id="referential_#{referential.id}" + p + = "#{referential.human_attribute_name('lines')} : " + span.lines_count + + p + = "#{referential.human_attribute_name('networks')} : " + span.networks_count + + p + = "#{referential.human_attribute_name('vehicle_journeys')} : " + span.vehicle_journeys_count + + p + = "#{referential.human_attribute_name('time_tables')} : " + span.time_tables_count + += javascript_include_tag referential_path(referential, format: :js)
\ No newline at end of file diff --git a/app/views/offer_workbenches/show.html.erb b/app/views/offer_workbenches/show.html.erb deleted file mode 100644 index 43335a68f..000000000 --- a/app/views/offer_workbenches/show.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= title_tag "#{@offer_workbench.name} - Tableau de bord" %> - -<div class="referentials paginated_content"> - <h4>Liste des jeux de données</h3> - <%= paginated_content @offer_workbench.referentials %> -</div> diff --git a/app/views/offer_workbenches/show.html.slim b/app/views/offer_workbenches/show.html.slim new file mode 100644 index 000000000..bed9205ba --- /dev/null +++ b/app/views/offer_workbenches/show.html.slim @@ -0,0 +1,5 @@ += title_tag "#{@offer_workbench.name} - Tableau de bord" + +.referentials.paginated_content + h4 Liste des jeux de données + = paginated_content @offer_workbench.referentials
\ No newline at end of file diff --git a/app/views/organisations/edit.html.erb b/app/views/organisations/edit.html.erb deleted file mode 100644 index cd1dacc7b..000000000 --- a/app/views/organisations/edit.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<%= title_tag t(".title") %> - -<%= semantic_form_for @organisation, :url => organisation_path do |form| %> - <%= form.inputs do %> - <%= form.input :name %> - <%= form.input :data_format, :label => true, :include_blank => false %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - diff --git a/app/views/organisations/edit.html.slim b/app/views/organisations/edit.html.slim new file mode 100644 index 000000000..a78d59f3d --- /dev/null +++ b/app/views/organisations/edit.html.slim @@ -0,0 +1,10 @@ += title_tag t('.title') + += semantic_form_for @organisation, :url => organisation_path do |form| + = form.inputs do + = form.input :name + = form.input :data_format, :label => true, :include_blank => false + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/organisations/show.html.erb b/app/views/organisations/show.html.erb deleted file mode 100644 index 3994228fd..000000000 --- a/app/views/organisations/show.html.erb +++ /dev/null @@ -1,59 +0,0 @@ -<%= title_tag @organisation.name %> - -<div class="summary"> - <p> -<label><%= Organisation.human_attribute_name("data_format_restrictions_by_default") %>: </label> -<%= @organisation.data_format %> - </p> -</div> - -<div class="panel-group" id="accordion"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#accordion" href="#users"> - <%= t('.users') %> - </a> - </h4> - </div> - <div id="users" class="panel-collapse collapse"> - <div class="panel-body"> - <div class="users paginated_content"> - <%= paginated_content(@organisation.users, "users/user") %> - </div> - </div> - </div> - </div> -</div> - - -<div class="panel-group" id="accordion"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#accordion" href="#rule_parameter_sets"> - <%= t('.rule_parameter_sets') %> - </a> - </h4> - </div> - <div id="rule_parameter_sets" class="panel-collapse collapse"> - <div class="panel-body"> - <div class="rule_parameter_sets paginated_content"> - <%= paginated_content(@organisation.rule_parameter_sets, "rule_parameter_sets/rule_parameter_set") %> - </div> - </div> - </div> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> -<!-- FIXME ref #819 --> -<% if false %> - <li><%= link_to t('organisations.actions.edit'), edit_organisation_path, :class => "edit" %></li> - <li><%= link_to t('users.actions.new'), new_organisation_user_path, :class => "add" %></li> -<% end %> - <li><%= link_to t('rule_parameter_sets.actions.new'), new_organisation_rule_parameter_set_path, :class => "add" %></li> -</ul> -<% end %> - diff --git a/app/views/organisations/show.html.slim b/app/views/organisations/show.html.slim new file mode 100644 index 000000000..b9259150a --- /dev/null +++ b/app/views/organisations/show.html.slim @@ -0,0 +1,42 @@ += title_tag @organisation.name + +.summary + p + label = "#{Organisation.human_attribute_name('data_format_restrictions_by_default')} : " + = @organisation.data_format + +#accordion.panel-group + .panel.panel-default + .panel-heading + h4.panel-title + a data-toggle="collapse" data-parent="#accordion" href="#users" + = t('.users') + + #users.panel-collapse.collapse + .panel-body + .users.paginated_content + = paginated_content(@organisation.users, "users/user") + +#accordion.panel-group + .panel.panel-default + .panel-heading + h4.panel-title + a data-toggle="collapse" data-parent="#accordion" href="#rule_parameter_sets" + = t('.rule_parameter_sets') + + #rule_parameter_sets.panel-collapse.collapse + .panel-body + .rule_parameter_sets.paginated_content + = paginated_content(@organisation.rule_parameter_sets, "rule_parameter_sets/rule_parameter_set") + +- content_for :sidebar do + ul.actions + / FIXME ref #819 + - if false + li + = link_to t('organisations.actions.edit'), edit_organisation_path, class: 'edit' + li + = link_to t('users.actions.new'), new_organisation_user_path, class: 'add' + + li + = link_to t('rule_parameter_sets.actions.new'), new_organisation_rule_parameter_set_path, class: 'add'
\ No newline at end of file diff --git a/app/views/referential_lines/_form.erb b/app/views/referential_lines/_form.erb deleted file mode 100644 index 442434d3b..000000000 --- a/app/views/referential_lines/_form.erb +++ /dev/null @@ -1,54 +0,0 @@ -<%= semantic_form_for [@referential, @line] do |form| %> - <%= form.inputs do %> - <%= form.input :network, :as => :select, :collection => Chouette::Network.all, :include_blank => false %> - <%= form.input :company, :as => :select, :collection => Chouette::Company.all, :include_blank => false%> - <%= form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.name") } %> - <%= form.input :published_name %> - <%= form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.registration_number")} %> - <%= form.input :number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.number") } %> - <%= form.input :transport_mode, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") } %> - <%= form.input :color, :as => :string %> - <%= form.input :text_color %> - <%= form.input :stable_id %> - <%= form.input :url %> - <%= form.input :mobility_restricted_suitability, :as => :select, :collection => [[@line.human_attribute_name("accessible"), true], [@line.human_attribute_name("not_accessible"), false]], :include_blank => true %> - <%= form.input :flexible_service, :as => :select, :collection => [[@line.human_attribute_name("on_demaond_fs"), true], [@line.human_attribute_name("regular_fs"), false]], :include_blank => true %> - <%= form.input :comment %> - <%= form.input :objectid, :required => !@line.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.objectid")} %> - <%= form.input :group_of_line_tokens, :label => t('.group_of_lines'), :as => :text, :input_html => { :"data-pre" => ( @line.group_of_lines.map { |group_of_line| { :id => group_of_line.id, :name => group_of_line.name } } ).to_json } %> - - <div class="footnotes_block"> - <h3><%= t("footnotes.index.title") %></h3> - <div id="footnotes"> - <%= form.semantic_fields_for :footnotes do |f| %> - <%= render "footnotes/footnote_fields", :f => f %> - <% end %> - </div> - <div class="add_footnote"> - <%= link_to_add_association t("footnotes.actions.add_footnote"), form, :footnotes , - :partial => "footnotes/footnote_fields", - :"data-association-insertion-method" => "append", - :"data-association-insertion-node" => "div#footnotes", :class => "add" %> - </div> - </div> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<script> - $(function() { - $( "#line_group_of_line_tokens" ).tokenInput('<%= name_filter_referential_group_of_lines_path(@referential, :format => :json) %>', { - crossDomain: false, - prePopulate: $('#group_of_line_tokens').data('pre'), - minChars: 3, - preventDuplicates: true, - hintText: '<%= t('search_hint') %>', - noResultsText: '<%= t('no_result_text') %>', - searchingText: '<%= t('searching_term') %>' - }); - }); -</script> diff --git a/app/views/referential_lines/_form.html.slim b/app/views/referential_lines/_form.html.slim new file mode 100644 index 000000000..f4e49b3a3 --- /dev/null +++ b/app/views/referential_lines/_form.html.slim @@ -0,0 +1,45 @@ += semantic_form_for [@referential, @line] do |form| + = form.inputs do + = form.input :network, as: :select, :collection => Chouette::Network.all, :include_blank => false + = form.input :company, as: :select, :collection => Chouette::Company.all, :include_blank => false + = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.name") } + = form.input :published_name + = form.input :registration_number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.registration_number") } + = form.input :number, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.number") } + = form.input :transport_mode, as: :select, :collection => Chouette::Line.transport_modes, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") } + = form.input :color, as: :string + = form.input :text_color + = form.input :stable_id + = form.input :url + = form.input :mobility_restricted_suitability, as: :select, :collection => [[@line.human_attribute_name("accessible"), true], [@line.human_attribute_name("not_accessible"), false]], :include_blank => true + = form.input :flexible_service, as: :select, :collection => [[@line.human_attribute_name("on_demaond_fs"), true], [@line.human_attribute_name("regular_fs"), false]], :include_blank => true + = form.input :comment + = form.input :objectid, :required => !@line.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.line.objectid") } + = form.input :group_of_line_tokens, :label => t('.group_of_lines'), as: :text, :input_html => { :"data-pre" => ( @line.group_of_lines.map { |group_of_line| { :id => group_of_line.id, :name => group_of_line.name } } ).to_json } + + .footnotes_block + h3 = t("footnotes.index.title") + + #footnotes + = form.semantic_fields_for :footnotes do |f| + = render "footnotes/footnote_fields", f: f + + .add_footnote + = link_to_add_association t("footnotes.actions.add_footnote"), form, :footnotes , :partial => "footnotes/footnote_fields", :"data-association-insertion-method" => "append", :"data-association-insertion-node" => "div#footnotes", class: 'add' + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +javascript: + $(function() { + $("#line_group_of_line_tokens").tokenInput("#{name_filter_referential_group_of_lines_path(@referential, format: :json)}", { + crossDomain: false, + prePopulate: $('#group_of_line_tokens').data('pre'), + minChars: 3, + preventDuplicates: true, + hintText: "#{I18n.t('search_hint')}", + noResultsText: "#{I18n.t('no_result_text')}", + searchingText: "#{I18n.t('searching_term')}" + }); + });
\ No newline at end of file diff --git a/app/views/referential_lines/_line.erb b/app/views/referential_lines/_line.erb deleted file mode 100644 index 512f6ae7b..000000000 --- a/app/views/referential_lines/_line.erb +++ /dev/null @@ -1,51 +0,0 @@ -<div id="index_item" class="panel panel-default line ce-LineBlock"> - <div class="panel-heading ce-LineBlock-header"> - <ul class="ce-LineBlock-header-list"> - <li> - <%= check_box_tag "ids[]", line.id, false, class: "multiple_selection", style: "display: none;" %> - <% if line.number && line.number.length <= 3 %> - <span class="label label-default line_number" style="<%= number_style(line) %>"><%= line.number %></span> - <% end %> - </li> - <li> - <%= link_to([@referential, line], class: 'preview', title: "#{Chouette::Line.model_name.human.capitalize} #{line.name}") do %> - <h5 class="ce-LineBlock-header-title"><%= truncate(line.name, length: 24) %></h5> - <% end %> - </li> - <li> - <%= link_to edit_referential_line_path(@referential, line), class: 'btn btn-default btn-sm' do %> - <span class="fa fa-pencil"></span> - <% end if edit %> - <%= link_to referential_line_path(@referential, line), method: :delete, data: { confirm: t('lines.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do %> - <span class="fa fa-trash-o"></span> - <% end if delete %> - </li> - </ul> - </div> - <div class="panel-body"> - <p> - <% if line.network.nil? %> - <%= line.human_attribute_name('network') %> <%= t('lines.index.unset') %> - <% else %> - <%= line.human_attribute_name('network') %> <%= link_to_if line.network, line.network.name, referential_network_path(@referential, line.network), :title => "#{line.human_attribute_name('network')} #{line.network.name}" %> - <% end %> - </p> - <p> - <% if line.company.nil? %> - <%= line.human_attribute_name('company') %> <%= t('lines.index.unset') %> - <% else %> - <%= line.human_attribute_name('company') %> <%= link_to_if( line.company, line.company.name, referential_company_path(@referential, line.company), :title => "#{line.human_attribute_name('company')} #{line.company.name}" ) %> - <% end %> - </p> - <p> - <% if line.group_of_lines.count == 0 %> - <br><%# t('lines.form.no_group_of_line') %> - <% elsif line.group_of_lines.count == 1 %> - <%= line.human_attribute_name('group_of_line') %> - <%= link_to_if( line.group_of_lines.first, line.group_of_lines.first.name, referential_group_of_line_path(@referential, line.group_of_lines.first), :title => "#{line.human_attribute_name('group_of_line')} #{line.group_of_lines.first.name}") %> - <% else %> - <%= t('lines.form.several_group_of_lines', :count => line.group_of_lines.count) %> - <% end %> - </p> - </div> -</div> diff --git a/app/views/referential_lines/_line.html.slim b/app/views/referential_lines/_line.html.slim new file mode 100644 index 000000000..0dffb50aa --- /dev/null +++ b/app/views/referential_lines/_line.html.slim @@ -0,0 +1,49 @@ +#index_item.panel.panel-default.line.ce-LineBlock + .panel-heading.ce-LineBlock-header + ul.ce-LineBlock-header-list + li + = check_box_tag "ids[]", line.id, false, class: "multiple_selection", style: "display: none;" + + - if line.number && line.number.length <= 3 + span.label.label-default.line_number style="#{number_style(line)}" + = line.number + + li + = link_to([@referential, line], class: 'preview', title: "#{Chouette::Line.model_name.human.capitalize} #{line.name}") do + h5.ce-LineBlock-header-title = truncate(line.name, length: 24) + + li + - if edit + = link_to edit_referential_line_path(@referential, line), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + - if delete + = link_to referential_line_path(@referential, line), method: :delete, data: { confirm: t('lines.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + .panel-body + p + - if line.network.nil? + = line.human_attribute_name('network') + = t('lines.index.unset') + - else + = line.human_attribute_name('network') + = link_to_if line.network, line.network.name, referential_network_path(@referential, line.network), :title => "#{line.human_attribute_name('network')} #{line.network.name}" + + p + - if line.company.nil? + = line.human_attribute_name('company') + = t('lines.index.unset') + - else + = line.human_attribute_name('company') + = link_to_if( line.company, line.company.name, referential_company_path(@referential, line.company), :title => "#{line.human_attribute_name('company')} #{line.company.name}" ) + + p + - if line.group_of_lines.count == 0 + br + / = t('lines.form.no_group_of_line') + - elsif line.group_of_lines.count == 1 + = line.human_attribute_name('group_of_line') + = link_to_if( line.group_of_lines.first, line.group_of_lines.first.name, referential_group_of_line_path(@referential, line.group_of_lines.first), :title => "#{line.human_attribute_name('group_of_line')} #{line.group_of_lines.first.name}") + - else + = t('lines.form.several_group_of_lines', :count => line.group_of_lines.count)
\ No newline at end of file diff --git a/app/views/referential_lines/_lines.html.erb b/app/views/referential_lines/_lines.html.erb deleted file mode 100644 index a4d9a3f0b..000000000 --- a/app/views/referential_lines/_lines.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @lines %> -</div> -<div class="lines paginated_content"> - <%= paginated_content(@lines) %> -</div> -<div class="pagination"> - <%= will_paginate @lines, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/referential_lines/_lines.html.slim b/app/views/referential_lines/_lines.html.slim new file mode 100644 index 000000000..fc89a8939 --- /dev/null +++ b/app/views/referential_lines/_lines.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t('will_paginate.page_entries_info.search') + = page_entries_info @lines + +.lines.paginated_content + = paginated_content(@lines) + +.pagination + = will_paginate @lines, container: false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/referential_lines/edit.html.erb b/app/views/referential_lines/edit.html.erb deleted file mode 100644 index d2c9880ae..000000000 --- a/app/views/referential_lines/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('lines.edit.title', :line => @line.name ) %> - -<%= render "form" %> diff --git a/app/views/referential_lines/edit.html.slim b/app/views/referential_lines/edit.html.slim new file mode 100644 index 000000000..0036d023b --- /dev/null +++ b/app/views/referential_lines/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('lines.edit.title', line: @line.name) + += render 'form'
\ No newline at end of file diff --git a/app/views/referential_lines/index.html.erb b/app/views/referential_lines/index.html.erb deleted file mode 100644 index e0c601572..000000000 --- a/app/views/referential_lines/index.html.erb +++ /dev/null @@ -1,51 +0,0 @@ -<%= title_tag t('lines.index.title') %> - -<%= search_form_for @q, :url => referential_lines_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <div class="input-group col-md-9"> - <%= f.text_field :name_or_number_cont, :placeholder => "#{t('.name_or_number')}", :class => 'form-control' %> - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div><!-- /input-group --> - <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> - <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> - </a> - </div> - - <div id="advanced_search" class="panel-collapse collapse"> - <div class="panel-body"> - <%= f.select(:network_id_eq, @referential.networks.collect {|n| [ n.name, n.id ] }.unshift([t('.no_networks'), -1]), {include_blank: t('.all_networks')}, { :class => 'form-control' }) %> - <%= f.select(:company_id_eq, @referential.companies.collect {|c| [ c.name, c.id ] }.unshift([t('.no_companies'), -1]), { include_blank: t('.all_companies')}, { :class => 'form-control' }) %> - <%= f.select(:group_of_lines_id_eq, @referential.group_of_lines.collect {|c| [ c.name, c.id ] }.unshift([t('.no_group_of_lines'), -1]), {include_blank: t('.all_group_of_lines')}, { :class => 'form-control' }) %> - </div> - </div> -</div> -<% end %> - -<div id="lines"><%= render 'lines' %></div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('lines.actions.new'), new_referential_line_path(@referential), :class => "add" %></li> -</ul> - -<div id="multiple_selection_menu"> - <h4><%= t(".multi_selection") %> </h4> - <div class="disabled"> - <a class="enable" href="#"><%= t(".multi_selection_enable") %></a> - </div> - - <div class="enabled" style="display: none;"> - <a class="disable" href="#"><%= t(".multi_selection_disable") %></a> - - <ul class="actions"> - <%= link_to t(".delete_selected"), referential_lines_path(@referential), "data-multiple-method" => "delete", :class => "remove", "confirmation-text" => t("lines.actions.destroy_selection_confirm") %> - </ul> - - <a class="select_all" href="#"><%= t(".select_all") %></a> | <a class="deselect_all" href="#"><%= t(".deselect_all") %></a> - </div> -</div> - -<% end %> diff --git a/app/views/referential_lines/index.html.slim b/app/views/referential_lines/index.html.slim new file mode 100644 index 000000000..4922cde85 --- /dev/null +++ b/app/views/referential_lines/index.html.slim @@ -0,0 +1,48 @@ += title_tag t('lines.index.title') + += search_form_for @q, :url => referential_lines_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| + .panel.panel-default + .panel-heading + .input-group.col-md-9 + = f.text_field :name_or_number_cont, :placeholder => "#{t('.name_or_number')}", :class => 'form-control' + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + a data-toggle="collapse" data-parent="#search" href="#advanced_search" + i.fa.fa-plus + = "#{t('.advanced_search')}" + + #advanced_search.panel-collapse.collapse + .panel-body + = f.select(:network_id_eq, @referential.networks.collect {|n| [ n.name, n.id ] }.unshift([t('.no_networks'), -1]), {include_blank: t('.all_networks')}, { :class => 'form-control' }) + = f.select(:company_id_eq, @referential.companies.collect {|c| [ c.name, c.id ] }.unshift([t('.no_companies'), -1]), { include_blank: t('.all_companies')}, { :class => 'form-control' }) + = f.select(:group_of_lines_id_eq, @referential.group_of_lines.collect {|c| [ c.name, c.id ] }.unshift([t('.no_group_of_lines'), -1]), {include_blank: t('.all_group_of_lines')}, { :class => 'form-control' }) + +#lines + = render 'lines' + +- content_for :sidebar do + ul.actions + li + = link_to t('lines.actions.new'), new_referential_line_path(@referential), class: 'add' + + #multiple_selection_menu + h4> = t(".multi_selection") + + .disabled + a.enable href="#" + = t(".multi_selection_enable") + + .enabled style="display: none;" + a.disable href="#" + = t(".multi_selection_disable") + + ul.actions + = link_to t(".delete_selected"), referential_lines_path(@referential), "data-multiple-method" => "delete", :class => "remove", "confirmation-text" => t("lines.actions.destroy_selection_confirm") + + a.select_all href="#" + = t(".select_all") + = " | " + a.deselect_all href="#" + = t(".deselect_all")
\ No newline at end of file diff --git a/app/views/referential_lines/index.js.erb b/app/views/referential_lines/index.js.erb deleted file mode 100644 index 97595d5e9..000000000 --- a/app/views/referential_lines/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#lines').html('<%= escape_javascript(render("lines")) %>');
\ No newline at end of file diff --git a/app/views/referential_lines/index.js.slim b/app/views/referential_lines/index.js.slim new file mode 100644 index 000000000..0165fb077 --- /dev/null +++ b/app/views/referential_lines/index.js.slim @@ -0,0 +1 @@ +| $('#lines').html("#{escape_javascript(render('lines'))}");
\ No newline at end of file diff --git a/app/views/referential_lines/new.html.erb b/app/views/referential_lines/new.html.erb deleted file mode 100644 index 452ec5df2..000000000 --- a/app/views/referential_lines/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('lines.new.title') %> - -<%= render "form" %> diff --git a/app/views/referential_lines/new.html.slim b/app/views/referential_lines/new.html.slim new file mode 100644 index 000000000..56da24d7c --- /dev/null +++ b/app/views/referential_lines/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('lines.new.title') + += render 'form'
\ No newline at end of file diff --git a/app/views/referential_lines/show.html.erb b/app/views/referential_lines/show.html.erb deleted file mode 100644 index b1248c275..000000000 --- a/app/views/referential_lines/show.html.erb +++ /dev/null @@ -1,137 +0,0 @@ -<% text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" %> -<% bg_color = @line.color.blank? ? "white" : "#"+@line.color %> - -<%= title_tag t('lines.show.title', :line => @line.name ) %> - -<div class="line_show"> - <%= @map.to_html %> - - <div class="summary"> - <% text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" %> - <% bg_color = @line.color.blank? ? "white" : "#"+@line.color %> - <% if colors?(@line) %> - <p> - <label><%= t('lines.index.color') %>: </label> - <label class="color" style='<%="#{number_style(@line)}"%>'><%= line_sticker(@line) %></label> - </p> - <% end %> - <p> - <label><%= @line.human_attribute_name(:network) %>: </label> - <% if @line.network.nil? %> - <%= t('lines.index.unset') %> - <% else %> - <%= link_to @line.network.name, [@referential, @line.network] %> - <% end %> - </p> - <p> - <label><%= @line.human_attribute_name(:company) %>: </label> - <% if @line.company.nil? %> - <%= t('lines.index.unset') %> - <% else %> - <%= link_to @line.company.name, [@referential, @line.company] %> - <% end %> - </p> - <p> - <label><%= @line.human_attribute_name("number") %>: </label> - <%= @line.number %> - </p> - <p> - <label><%= @line.human_attribute_name("published_name") %>: </label> - <%= @line.published_name %> - </p> - <p> - <label><%= @line.human_attribute_name("registration_number") %>: </label> - <%= @line.registration_number %> - </p> - <p> - <label><%= @line.human_attribute_name("transport_mode") %>: </label> - <%= t("transport_modes.label.#{@line.transport_mode}") %> - </p> - <p> - <label><%= @line.human_attribute_name("stable_id") %>: </label> - <%= @line.stable_id %> - </p> - - <p> - <label><%= @line.human_attribute_name("url") %>: </label> - <%= @line.url %> - </p> - - <p> - <label><%= @line.human_attribute_name("mobility_restricted_suitability") %> : </label> - <% if @line.mobility_restricted_suitability.nil? %> - <%= @line.human_attribute_name("unspecified_mrs") %> - <% elsif @line.mobility_restricted_suitability? %> - <%= @line.human_attribute_name("accessible") %> - <% else %> - <%= @line.human_attribute_name("not_accessible") %> - <% end %> - <br> <%= @line.human_attribute_name("number_of_mrs_vj") %> : <%= @line.vehicle_journeys.where("mobility_restricted_suitability = ?", true).count %> - <br> <%= @line.human_attribute_name("number_of_non_mrs_vj") %> : <%= @line.vehicle_journeys.where("mobility_restricted_suitability = ?", false).count %> - <br> <%= @line.human_attribute_name("number_of_null_mrs_vj") %> : <%= @line.vehicle_journeys.count - - (@line.vehicle_journeys.where("mobility_restricted_suitability = ?", true).count + - @line.vehicle_journeys.where("mobility_restricted_suitability = ?", false).count) %> - </p> - <p> - <label><%= @line.human_attribute_name("flexible_service") %> : </label> - <% if @line.flexible_service.nil? %> - <%= @line.human_attribute_name("unspecified_fs") %> - <% elsif @line.flexible_service? %> - <%= @line.human_attribute_name("on_demaond_fs") %> - <% else %> - <%= @line.human_attribute_name("regular_fs") %> - <% end %> - <br> <%= @line.human_attribute_name("number_of_fs_vj") %> : <%= @line.vehicle_journeys.where("flexible_service = ?", true).count %> - <br> <%= @line.human_attribute_name("number_of_non_fs_vj") %> : <%= @line.vehicle_journeys.where("flexible_service = ?", false).count %> - <br> <%= @line.human_attribute_name("number_of_null_fs_vj") %> - <% if @line.flexible_service.nil? %> - (<%= @line.human_attribute_name("default_fs_msg") %>) - <% end %> - : <%= @line.vehicle_journeys.count - - (@line.vehicle_journeys.where("flexible_service = ?", true).count + - @line.vehicle_journeys.where("flexible_service = ?", false).count) %> - </p> - <p> - <label><%= @line.human_attribute_name("footnotes") %>: </label> - <ul> - <% @line.footnotes.each do |footnote| %> - <li><%= footnote.code %> : <%= footnote.label %></li> - <% end %> - </ul> - </p> - <p> - <label><%= @line.human_attribute_name("comment") %>: </label> - <%= @line.comment %> - </p> - </div> - - <div class="row"> - <div id="mobility_restricted_suitability" class="col-md-6"></div> - <div id="flexible_service" class="col-md-6"></div> - </div> -</div> - -<p class="after_map" /> -<h3 class="routes"><%= t('.itineraries') %></h3> -<div class="routes paginated_content"> - <%= paginated_content @routes, "routes/route" %> -</div> - -<% if @line.group_of_lines.any? %> - <h3 class="line_group_of_lines"><%= t('.group_of_lines') %></h3> - <div class="group_of_lines paginated_content"> - <%= paginated_content @group_of_lines, "group_of_lines/group_of_line", :delete => false %> - </div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('lines.actions.new'), new_referential_line_path(@referential), :class => "add" %></li> - <li><%= link_to t('lines.actions.edit'), edit_referential_line_path(@referential, @line), :class => "edit" %></li> - <li><%= link_to t('lines.actions.destroy'), referential_line_path(@referential, @line), :method => :delete, :data => {:confirm => t('lines.actions.destroy_confirm')}, :class => "remove" %></li> - <% if !@line.hub_restricted? || (@line.hub_restricted? && @line.routes.size < 2) %> - <li><%= link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), :class => "add" %></li> - <% end %> -</ul> - <%= creation_tag(@line) %> -<% end %> diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim new file mode 100644 index 000000000..ae8314a14 --- /dev/null +++ b/app/views/referential_lines/show.html.slim @@ -0,0 +1,135 @@ +- text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" +- bg_color = @line.color.blank? ? "white" : "##{@line.color}" + += title_tag t('lines.show.title', line: @line.name) + +.line_show + = @map.to_html + + .summary + - text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" + - bg_color = @line.color.blank? ? "white" : "##{@line.color}" + + - if colors?(@line) + p + label = "#{t('lines.index.color')} : " + label.color style="#{number_style(@line)}" + = line_sticker(@line) + + p + label = "#{@line.human_attribute_name(:network)} : " + - if @line.network.nil? + = t('lines.index.unset') + - else + = link_to @line.network.name, [@referential, @line.network] + + p + label = "#{@line.human_attribute_name(:company)} : " + - if @line.company.nil? + = t('lines.index.unset') + - else + = link_to @line.company.name, [@referential, @line.company] + + p + label = "#{@line.human_attribute_name('number')} : " + = @line.number + + p + label = "#{@line.human_attribute_name('published_name')} : " + = @line.published_name + + p + label = "#{@line.human_attribute_name('registration_number')} : " + = @line.registration_number + + p + label = "#{@line.human_attribute_name('transport_mode')} : " + = t("transport_modes.label.#{@line.transport_mode}") + + p + label = "#{@line.human_attribute_name('stable_id')} : " + = @line.stable_id + + p + label = "#{@line.human_attribute_name('url')} : " + = @line.url + + p + label = "#{@line.human_attribute_name('mobility_restricted_suitability')} : " + + - if @line.mobility_restricted_suitability.nil? + = @line.human_attribute_name("unspecified_mrs") + - elsif @line.mobility_restricted_suitability? + = @line.human_attribute_name("accessible") + - else + = @line.human_attribute_name("not_accessible") + + br + = "#{@line.human_attribute_name('number_of_mrs_vj')} : #{@line.vehicle_journeys.where('mobility_restricted_suitability = ?', true).count}" + br + = "#{@line.human_attribute_name('number_of_non_mrs_vj')} : #{@line.vehicle_journeys.where('mobility_restricted_suitability = ?', false).count}" + br + = "#{@line.human_attribute_name('number_of_null_mrs_vj')} : " + = @line.vehicle_journeys.count - (@line.vehicle_journeys.where("mobility_restricted_suitability = ?", true).count + @line.vehicle_journeys.where("mobility_restricted_suitability = ?", false).count) + + p + label = "#{@line.human_attribute_name('flexible_service')} : " + + - if @line.flexible_service.nil? + = @line.human_attribute_name("unspecified_fs") + - elsif @line.flexible_service? + = @line.human_attribute_name("on_demaond_fs") + - else + = @line.human_attribute_name("regular_fs") + + br + = "#{@line.human_attribute_name('number_of_fs_vj')} : #{@line.vehicle_journeys.where('flexible_service = ?', true).count}" + br + = "#{@line.human_attribute_name('number_of_non_fs_vj')} : #{@line.vehicle_journeys.where('flexible_service = ?', false).count}" + br + = @line.human_attribute_name("number_of_null_fs_vj") + + - if @line.flexible_service.nil? + = "(#{@line.human_attribute_name('default_fs_msg')})" + + = ": #{@line.vehicle_journeys.count - (@line.vehicle_journeys.where('flexible_service = ?', true).count + @line.vehicle_journeys.where('flexible_service = ?', false).count)}" + + p + label = "#{@line.human_attribute_name('footnotes')} : " + ul + - @line.footnotes.each do |footnote| + li = "#{footnote.code} : #{footnote.label}" + + p + label = "#{@line.human_attribute_name('comment')} : " + = @line.comment + + .row + #mobility_restricted_suitability.col-md-6 + #flexible_service.col-md-6 + +p.after_map +h3.routes = t('.itineraries') + +.routes.paginated_content + = paginated_content @routes, "routes/route" + +- if @line.group_of_lines.any? + h3.line_group_of_lines = t('.group_of_lines') + .group_of_lines.paginated_content + = paginated_content @group_of_lines, "group_of_lines/group_of_line", :delete => false + +- content_for :sidebar do + ul.actions + li + = link_to t('lines.actions.new'), new_referential_line_path(@referential), class: 'add' + li + = link_to t('lines.actions.edit'), edit_referential_line_path(@referential, @line), class: 'edit' + li + = link_to t('lines.actions.destroy'), referential_line_path(@referential, @line), method: :delete, :data => {:confirm => t('lines.actions.destroy_confirm')}, class: 'remove' + + - if !@line.hub_restricted? || (@line.hub_restricted? && @line.routes.size < 2) + li + = link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), class: 'add' + + = creation_tag(@line)
\ No newline at end of file diff --git a/app/views/referential_lines/show.kml.erb b/app/views/referential_lines/show.kml.erb deleted file mode 100644 index 8e1c82eef..000000000 --- a/app/views/referential_lines/show.kml.erb +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% @line.commercial_stop_areas.each do |stop_area| %> - <Placemark id="<%= stop_area.id %>" > - <name><%= stop_area.name %></name> - <stop_area_type><%= stop_area.area_type.underscore %></stop_area_type> - <stop_area_type_label><%= t("area_types.label.#{stop_area.stop_area_type}") %></stop_area_type_label> - <%= (stop_area.position or stop_area.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/referential_lines/show.kml.slim b/app/views/referential_lines/show.kml.slim new file mode 100644 index 000000000..97f589e31 --- /dev/null +++ b/app/views/referential_lines/show.kml.slim @@ -0,0 +1,10 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - @line.commercial_stop_areas.each do |stop_area| + placemark id="#{stop_area.id}" + name = stop_area.name + stop_area_type = stop_area.area_type.underscore + stop_area_type_label = t("area_types.label.#{stop_area.stop_area_type}") + = (stop_area.position or stop_area.default_position).kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/referential_stop_areas/_form.html.erb b/app/views/referential_stop_areas/_form.html.erb deleted file mode 100644 index d4fcf25e3..000000000 --- a/app/views/referential_stop_areas/_form.html.erb +++ /dev/null @@ -1,160 +0,0 @@ -<%= semantic_form_for [@referential, @stop_area] do |form| %> - <div class="row"> - <div class="container-fluid"> - <% if !manage_itl && @map %> - <%= @map.to_html %> - <% end %> - <%= form.inputs do %> - <%= form.input :id, :as => :hidden %> - <%= form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")} %> - <%= form.input :stop_area_type, :as => :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %> - <div class="location_info"> - <h3><%= t("stop_areas.stop_area.localisation") %></h3> - <div id="prefetch"> - <label><%= t('.geolocalize') %></label> - <input class="typeahead form-control input-lg" maxlength="255" type="text" placeholder="<%= t('.address') %>" /> - </div> - <% unless @stop_area.projection.blank? or @stop_area.projection_type_label.empty? %> - <%= form.input :projection_xy, :label => t("projection_xy", :projection => @referential.projection_type_label), :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.projection_xy")} %> - <% end %> - <%= form.input :coordinates, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.coordinates")} %> - <%= form.input :street_name %> - <%= form.input :country_code, required: format_restriction_for_locales(@referential) == '.hub' %> - <%= form.input :zip_code, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.zip_code")} %> - <%= form.input :city_name, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.city_name")} %> - </div> - <% end %> - </div> - </div> - <div class="stop_areas.stop_area.general_info"> - <h3><%= t("stop_area.general") %></h3> - <%= form.inputs do %> - <%= form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.objectid")} %> - <%= form.input :registration_number, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.registration_number")} %> - <%= form.input :fare_code, :as => :number %> - <%= form.input :nearest_topic_name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.nearest_topic_name")} %> - <%= form.input :comment, :as => :text, :input_html => { :rows => 5, :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.comment") } %> - <%= form.input :time_zone, :include_blank => true %> - <%= form.input :url %> - <% end %> - </div> - <div class="pmr_info"> - <h3><%= t("stop_areas.stop_area.accessibility") %></h3> - <%= form.inputs do %> - <% if !manage_itl %> - <%= form.input :mobility_restricted_suitability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <%= form.input :stairs_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <%= form.input :lift_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <% end %> - <% end %> - </div> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<script> - $(document).ready(function() { - var address_display = function( address ) { - var name = ""; - if ( address.house_number) { - name += address.house_number+" "; - } - name += address.road+", "; - if ( address.suburb) { - name += address.suburb+", "; - } - if ( address.postcode) { - name += address.postcode+" "; - } - if ( address.city) { - name += address.city; - } else if ( address.village) { - name += address.village; - } else if ( address.town) { - name += address.town; - } else if ( address.county ) { - name += address.county; - } else if ( address.country ) { - name += address.country; - } - - - return name; - }; - var filtering = function(list) { - // update map view - removeAddress(); - - var selection = $.grep( list, function(item) { - return (item.type == "house" || item.type == "residential" || - item.type == "tertiary" || item.type == "primary" || - item.type == "secondary") && item.address.road ; - }); - return $.map( selection, function( d) { - var city = ""; - if ( d.address.city) { - city = d.address.city; - } else if ( d.address.town) { - city = d.address.town; - } else if ( d.address.village) { - city = d.address.village; - } - return { postcode: d.address.postcode, - road: d.address.road, - lon: d.lon, lat: d.lat, - suburb: d.address.suburb, - city: city, - postcode: d.address.postcode, - the_key: address_display( d.address)}; - }); - }; - - var addressesEngine = new Bloodhound({ - datumTokenizer: function(d) { - return Bloodhound.tokenizers.whitespace(d.id+" : "+d.road); - }, - queryTokenizer: function(d) { - return Bloodhound.tokenizers.whitespace(d.id+" :: "+d.road); - }, - limit: 10, - remote: { - url: 'http://nominatim.openstreetmap.org/search?q=%QUERY&format=json&addressdetails=1&bounded=1&viewbox='+ - // FIXME #821 - '<%#= @referential.viewbox_left_top_right_bottom %>', - filter: filtering, - } - }); - - // kicks off the loading/processing of `local` and `prefetch` - var promise = addressesEngine.initialize(); - - // passing in `null` for the `options` arguments will result in the default - // options being used - $('#prefetch .typeahead').typeahead( - { - hint: true, - highlight: true, - minLength: 1 - }, - { - name: 'addresses', - displayKey: 'the_key', - source: addressesEngine.ttAdapter(), - } - ); - - $('.typeahead').on('typeahead:selected', function($e, datum) { - // update map view - addAddress( datum.lon, datum.lat, datum.road); - // update form fields - <% if @stop_area.new_record? %> - $('input[name="stop_area[street_name]"]').val(datum.road); - $('input[name="stop_area[zip_code]"]').val(datum.postcode); - $('input[name="stop_area[city_name]"]').val(datum.city); - <% end %> - }) - }); -</script> diff --git a/app/views/referential_stop_areas/_form.html.slim b/app/views/referential_stop_areas/_form.html.slim new file mode 100644 index 000000000..5a27abcb5 --- /dev/null +++ b/app/views/referential_stop_areas/_form.html.slim @@ -0,0 +1,152 @@ += semantic_form_for [@referential, @stop_area] do |form| + .row + .container-fluid + - if !manage_itl && @map + = @map.to_html + + = form.inputs do + = form.input :id, as: :hidden + = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")} + = form.input :stop_area_type, as: :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } + + .location_info + h3 = t("stop_areas.stop_area.localisation") + #prefetch + label = t('.geolocalize') + input.typeahead.form-control.input-lg maxlength="255" type="text" placeholder="#{t('.address')}" + + - unless @stop_area.projection.blank? or @stop_area.projection_type_label.empty? + = form.input :projection_xy, :label => t("activerecord.attributes.stop_area.projection_xy", :projection => @referential.projection_type_label), :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.projection_xy")} + + = form.input :coordinates, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.coordinates")} + = form.input :street_name + = form.input :country_code, required: format_restriction_for_locales(@referential) == '.hub' + = form.input :zip_code, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.zip_code")} + = form.input :city_name, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.city_name")} + + .stop_areas.stop_area.general_info + h3 = t("stop_areas.stop_area.general") + + = form.inputs do + = form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.objectid")} + = form.input :registration_number, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.registration_number")} + = form.input :fare_code, as: :number + = form.input :nearest_topic_name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.nearest_topic_name")} + = form.input :comment, as: :text, :input_html => { :rows => 5, :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.comment") } + = form.input :time_zone, :include_blank => true + = form.input :url + + .pmr_info + h3 = t("stop_areas.stop_area.accessibility") + = form.inputs do + - if !manage_itl + = form.input :mobility_restricted_suitability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true + = form.input :stairs_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true + = form.input :lift_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +javascript: + $(document).ready(function() { + var address_display = function( address ) { + var name = ""; + if ( address.house_number) { + name += address.house_number+" "; + } + name += address.road+", "; + if ( address.suburb) { + name += address.suburb+", "; + } + if ( address.postcode) { + name += address.postcode+" "; + } + if ( address.city) { + name += address.city; + } else if ( address.village) { + name += address.village; + } else if ( address.town) { + name += address.town; + } else if ( address.county ) { + name += address.county; + } else if ( address.country ) { + name += address.country; + } + + + return name; + }; + var filtering = function(list) { + // update map view + removeAddress(); + + var selection = $.grep( list, function(item) { + return (item.type == "house" || item.type == "residential" || + item.type == "tertiary" || item.type == "primary" || + item.type == "secondary") && item.address.road ; + }); + return $.map( selection, function( d) { + var city = ""; + if ( d.address.city) { + city = d.address.city; + } else if ( d.address.town) { + city = d.address.town; + } else if ( d.address.village) { + city = d.address.village; + } + return { postcode: d.address.postcode, + road: d.address.road, + lon: d.lon, lat: d.lat, + suburb: d.address.suburb, + city: city, + postcode: d.address.postcode, + the_key: address_display( d.address)}; + }); + }; + + var addressesEngine = new Bloodhound({ + datumTokenizer: function(d) { + return Bloodhound.tokenizers.whitespace(d.id+" : "+d.road); + }, + queryTokenizer: function(d) { + return Bloodhound.tokenizers.whitespace(d.id+" :: "+d.road); + }, + limit: 10, + remote: { + url: 'http://nominatim.openstreetmap.org/search?q=%QUERY&format=json&addressdetails=1&bounded=1&viewbox='+ + // FIXME #821 + // <%#= @referential.viewbox_left_top_right_bottom %>', + filter: filtering, + } + }); + + // kicks off the loading/processing of `local` and `prefetch` + var promise = addressesEngine.initialize(); + + // passing in `null` for the `options` arguments will result in the default + // options being used + $('#prefetch .typeahead').typeahead( + { + hint: true, + highlight: true, + minLength: 1 + }, + { + name: 'addresses', + displayKey: 'the_key', + source: addressesEngine.ttAdapter(), + } + ); + + $('.typeahead').on('typeahead:selected', function($e, datum) { + // update map view + addAddress( datum.lon, datum.lat, datum.road); + // update form fields + - if @stop_area.new_record? + $('input[name="stop_area[street_name]"]').val(datum.road); + $('input[name="stop_area[zip_code]"]').val(datum.postcode); + $('input[name="stop_area[city_name]"]').val(datum.city); + + }) + });
\ No newline at end of file diff --git a/app/views/referential_stop_areas/_genealogical.html.erb b/app/views/referential_stop_areas/_genealogical.html.erb deleted file mode 100644 index a76b972e2..000000000 --- a/app/views/referential_stop_areas/_genealogical.html.erb +++ /dev/null @@ -1,66 +0,0 @@ - <h3><%= genealogical_title %></h3> - - <% if @stop_area.parent.present? %> - <div class="parent"> - <%= link_to([@referential, @stop_area.parent], :title => t("area_types.label.#{ @stop_area.parent.stop_area_type}") + " #{ @stop_area.parent.name}") do %> - <%= image_tag "map/" + @stop_area.parent.stop_area_type + ".png" %><span><%= @stop_area.parent.name %></span> - <% end %> - </div> - <div class="link"><%= image_tag "icons/link.png"%></div> - <% elsif @stop_area.routing_lines.present? %> - <div class="lines"> - <% @stop_area.routing_lines.each do |line| %> - <div class="line"> - <%= link_to([@referential, line]) do %> - <span><%= line.name %></span> - <% end %> - </div> - <% end %> - </div> - <div class="link"><%= image_tag "icons/link.png"%></div> - <% else %> - <div class="no_parent"> </div> - <% end %> - - <div class="target"> - <%= image_tag "map/" + @stop_area.stop_area_type + ".png"%><span><%= @stop_area.name %></span> - </div> - - <% if @stop_area.children.present? %> - <div class="link"><%= image_tag "icons/link.png"%></div> - <div class="children"> - <% @stop_area.children.each do |child| %> - <div class="child"> - <%= link_to([@referential, child], :title => t("area_types.label.#{ child.stop_area_type}") + " #{ child.name}") do %> - <%= image_tag "map/" + child.stop_area_type + ".png" %><span><%= child.name %></span> - <% end %> - </div> - <% end %> - </div> - <% elsif @stop_area.routing_stops.present? %> - <div class="link"><%= image_tag "icons/link.png"%></div> - <div class="children"> - <% @stop_area.routing_stops.each do |stop| %> - <div class="child"> - <%= link_to([@referential, stop], :title => t("area_types.label.#{ stop.stop_area_type}") + " #{ stop.name}") do %> - <%= image_tag "map/" + stop.stop_area_type + ".png" %><span><%= "#{stop.name} #{' [' + stop.registration_number + ']' if stop.registration_number.present? }" %></span> - <% end %> - </div> - <% end %> - </div> - <% elsif @stop_area.routes.present? %> - <div class="link"><%= image_tag "icons/link.png"%></div> - <div class="children"> - <% @stop_area.routes.each do |route| %> - <div class="child"> - <%= link_to([@referential, route.line ]) do %> - <span><%= route.line.number %></span> - <% end %> - - <%= link_to([@referential, route.line , route]) do %> - <span><%= route.name %></span> - <% end %> - </div> - <% end %> - </div> - <% end %> diff --git a/app/views/referential_stop_areas/_genealogical.html.slim b/app/views/referential_stop_areas/_genealogical.html.slim new file mode 100644 index 000000000..a44884c92 --- /dev/null +++ b/app/views/referential_stop_areas/_genealogical.html.slim @@ -0,0 +1,54 @@ +h3 = genealogical_title + +- if @stop_area.parent.present? + .parent + = link_to([@referential, @stop_area.parent], :title => t("area_types.label.#{@stop_area.parent.stop_area_type}") + "#{@stop_area.parent.name}") do + = image_tag "map/" + @stop_area.parent.stop_area_type + ".png" + = @stop_area.parent.name + + .link + = image_tag "icons/link.png" + +- elsif @stop_area.routing_lines.present? + .lines + - @stop_area.routing_lines.each do |line| + .line + = link_to([@referential, line]) do + span> = line.name + + .link = image_tag "icons/link.png" +- else + .no_parent = + +.target + = image_tag "map/" + @stop_area.stop_area_type + ".png" + span = @stop_area.name + +- if @stop_area.children.present? + .link = image_tag "icons/link.png" + .children + - @stop_area.children.each do |child| + .child + = link_to([@referential, child], :title => t("area_types.label.#{ child.stop_area_type}") + " #{ child.name}") do + = image_tag "map/" + child.stop_area_type + ".png" + span = child.name + +- elsif @stop_area.routing_stops.present? + .link = image_tag "icons/link.png" + .children + - @stop_area.routing_stops.each do |stop| + .child + = link_to([@referential, stop], :title => t("area_types.label.#{ stop.stop_area_type}") + " #{ stop.name}") do + = image_tag "map/" + stop.stop_area_type + ".png" + span = "#{stop.name} #{' [' + stop.registration_number + ']' if stop.registration_number.present? }" + +- elsif @stop_area.routes.present? + <div class="link"><%= image_tag "icons/link.png"%></div> + .children + - @stop_area.routes.each do |route| + .child + = link_to([@referential, route.line ]) do + span = route.line.number + + = link_to([@referential, route.line , route]) do + span = route.name
\ No newline at end of file diff --git a/app/views/referential_stop_areas/_stop_area.html.erb b/app/views/referential_stop_areas/_stop_area.html.erb deleted file mode 100644 index 2d2118aed..000000000 --- a/app/views/referential_stop_areas/_stop_area.html.erb +++ /dev/null @@ -1,53 +0,0 @@ -<div id="index_item" class="panel panel-default stop_area"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_stop_area_path(@referential, stop_area), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to referential_stop_area_path(@referential, stop_area), :method => :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, stop_area], :class => "preview", :title => t("area_types.label.#{stop_area.stop_area_type}") + " #{stop_area.name}") do %> - <span class="name"> - <%= image_tag "map/" + stop_area.stop_area_type + ".png" %> <%= truncate(stop_area.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <% unless stop_area.area_type == 'ITL' || stop_area.geometry %> - <span class="warning"><%= t('.no_position') %></span> - <% end %> - </p> - <p> - <%= stop_area.human_attribute_name('registration_number') %> : <%= stop_area.registration_number.present? ? stop_area.registration_number : t(".no_object") %> - </p> - <p> - <%= t('.address') %> : <%= (stop_area.zip_code.present? || stop_area.city_name.present?) ? "#{stop_area.zip_code} #{stop_area.city_name}" : t(".no_object") %> - </p> - <p> - <% if stop_area.area_type == 'ITL' %> - <%= t('.lines') %> : <% if stop_area.routing_lines.blank? %> - <%= t(".no_object") %> - <% else %> - <% stop_area.routing_lines.each do |line| %> - <span class="label label-default line"><%= line.number %></span> - <% end %> - <% end %> - <% else %> - <%= t('.lines') %> : <% if stop_area.lines.blank? %> - <%= t(".no_object") %> - <% else %> - <% stop_area.lines.each do |line| %> - <span class="label label-default line"><%= line.number || truncate( line.name, :length => 4 ) %></span> - <% end %> - <% end %> - <% end %> - </p> - </div> -</div> diff --git a/app/views/referential_stop_areas/_stop_area.html.slim b/app/views/referential_stop_areas/_stop_area.html.slim new file mode 100644 index 000000000..f94bd319e --- /dev/null +++ b/app/views/referential_stop_areas/_stop_area.html.slim @@ -0,0 +1,44 @@ +#index_item.panel.panel-default.stop_area + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_referential_stop_area_path(@referential, stop_area), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + = link_to referential_stop_area_path(@referential, stop_area), method: :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to([@referential, stop_area], class: "preview", :title => t("area_types.label.#{stop_area.stop_area_type}") + " #{stop_area.name}") do + span.name + = image_tag "map/" + stop_area.stop_area_type + ".png" + = truncate(stop_area.name, :length => 20) + + .panel-body + p + - unless stop_area.area_type == 'ITL' || stop_area.geometry + span.warning = t('.no_position') + + p + = "#{stop_area.human_attribute_name('registration_number')} : #{stop_area.registration_number.present? ? stop_area.registration_number : t('.no_object')}" + + p + = "#{t('.address')} : " + = "#{(stop_area.zip_code.present? || stop_area.city_name.present?) ? "#{stop_area.zip_code} #{stop_area.city_name}" : t('.no_object')}" + + p + - if stop_area.area_type == 'ITL' + = "#{t('.lines')} : " + - if stop_area.routing_lines.blank? + = t(".no_object") + - else + - stop_area.routing_lines.each do |line| + span.label.label-default.line = line.number + + - else + = "#{t('.lines')} : " + - if stop_area.lines.blank? + = t(".no_object") + - else + - stop_area.lines.each do |line| + span.label.label-default.line = line.number || truncate( line.name, length: 4 )
\ No newline at end of file diff --git a/app/views/referential_stop_areas/_stop_areas.html.erb b/app/views/referential_stop_areas/_stop_areas.html.erb deleted file mode 100644 index 9c7a82d6d..000000000 --- a/app/views/referential_stop_areas/_stop_areas.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @stop_areas %> -</div> -<div class="stop_areas paginated_content"> - <%= paginated_content(@stop_areas) %> -</div> -<div class="pagination"> - <%= will_paginate @stop_areas, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/referential_stop_areas/_stop_areas.html.slim b/app/views/referential_stop_areas/_stop_areas.html.slim new file mode 100644 index 000000000..e05bab1bc --- /dev/null +++ b/app/views/referential_stop_areas/_stop_areas.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t("will_paginate.page_entries_info.search") + = page_entries_info @stop_areas + +.stop_areas.paginated_content + = paginated_content(@stop_areas) + +.pagination + = will_paginate @stop_areas, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/referential_stop_areas/access_links.html.erb b/app/views/referential_stop_areas/access_links.html.erb deleted file mode 100644 index 3cea2fbdd..000000000 --- a/app/views/referential_stop_areas/access_links.html.erb +++ /dev/null @@ -1,46 +0,0 @@ -<%= title_tag t('stop_areas.access_links.title', :stop_area => @stop_area.name ) %> - -<div class="stop_area_show"> - -<div class="panel-group" id="generic"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#generic" href="#generic_access_links"> - <%= t('.generic_access_links') %> - </a> - </h4> - </div> - <div id="generic_access_links" class="panel-collapse collapse in"> - <div class="panel-body"> - <div class="access_link_pairs"> - <table> - <%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@generic_access_links) %> - </table> - </div> - </div> - </div> - </div> -</div> - -<div class="panel-group" id="detail"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#detail" href="#detail_access_links"> - <%= t('.detail_access_links') %> - </a> - </h4> - </div> - <div id="detail_access_links" class="panel-collapse collapse"> - <div class="panel-body"> - <div class="access_link_pairs"> - <table> - <%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@detail_access_links) %> - </table> - </div> - </div> - </div> - </div> -</div> - diff --git a/app/views/referential_stop_areas/access_links.html.slim b/app/views/referential_stop_areas/access_links.html.slim new file mode 100644 index 000000000..128d1b4b9 --- /dev/null +++ b/app/views/referential_stop_areas/access_links.html.slim @@ -0,0 +1,28 @@ += title_tag t('stop_areas.access_links.title', stop_area: @stop_area.name ) + +.stop_area_show + #generic.panel-group + .panel.panel-default + .panel-heading + h4.panel-title + a data-toggle="collapse" data-parent="#generic" href="#generic_access_links" + = t('.generic_access_links') + + #generic_access_links.panel-collapse.collapse.in + .panel-body + .access_link_pairs + table + = render partial: 'access_link_pairs/access_link_pair', collection: access_links_pairs(@generic_access_links) + + #detail.panel-group + .panel.panel-default + .panel-heading + h4.panel-title + a data-toggle="collapse" data-parent="#detail" href="#detail_access_links + = t('.detail_access_links') + + #detail_access_links.panel-collapse.collapse + .panel-body + .access_link_pairs + table + = render partial: 'access_link_pairs/access_link_pair', collection: access_links_pairs(@detail_access_links)
\ No newline at end of file diff --git a/app/views/referential_stop_areas/add_children.html.erb b/app/views/referential_stop_areas/add_children.html.erb deleted file mode 100644 index 4d30ba674..000000000 --- a/app/views/referential_stop_areas/add_children.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= title_tag t('stop_areas.add_children.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :children_ids, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?relation=children&target_type=#{@stop_area.area_type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @children, :view_path => 'app/views', :format => :json, :scope => self ).render } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/referential_stop_areas/add_children.html.slim b/app/views/referential_stop_areas/add_children.html.slim new file mode 100644 index 000000000..50b6ae5a5 --- /dev/null +++ b/app/views/referential_stop_areas/add_children.html.slim @@ -0,0 +1,13 @@ += title_tag t('stop_areas.add_children.title', stop_area: @stop_area.name) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :children_ids, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?relation=children&target_type=#{@stop_area.area_type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @children, :view_path => 'app/views', :format => :json, :scope => self ).render } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/referential_stop_areas/add_routing_lines.html.erb b/app/views/referential_stop_areas/add_routing_lines.html.erb deleted file mode 100644 index 84d03f8b2..000000000 --- a/app/views/referential_stop_areas/add_routing_lines.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -<%= title_tag t('stop_areas.add_routing_lines.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :routing_line_ids, :as => :text, :input_html => { :"data-pre" => ( @lines.map { |line| { :id => line.id.to_s, :name => "#{line.number} - #{line.name}" } } ).to_json } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<script> - $(function() { - $( "#stop_area_routing_line_ids" ).tokenInput('<%= referential_stop_area_stop_area_routing_lines_path(@referential, @stop_area, :format => :json) %>', { - crossDomain: false, - prePopulate: $('#stop_area_routing_line_id').data('pre'), - minChars: 1, - hintText: '<%= t('search_hint') %>', - noResultsText: '<%= t('no_result_text') %>', - searchingText: '<%= t('searching_term') %>' - }); - }); -</script> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/referential_stop_areas/add_routing_lines.html.slim b/app/views/referential_stop_areas/add_routing_lines.html.slim new file mode 100644 index 000000000..667d58254 --- /dev/null +++ b/app/views/referential_stop_areas/add_routing_lines.html.slim @@ -0,0 +1,25 @@ += title_tag t('stop_areas.add_routing_lines.title', stop_area: @stop_area.name) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :routing_line_ids, as: :text, :input_html => { :"data-pre" => ( @lines.map { |line| { :id => line.id.to_s, :name => "#{line.number} - #{line.name}" } } ).to_json } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +javascript: + $(function() { + $("#stop_area_routing_line_ids").tokenInput("#{referential_stop_area_stop_area_routing_lines_path(@referential, @stop_area, format: :json)}", { + crossDomain: false, + prePopulate: $('#stop_area_routing_line_id').data('pre'), + minChars: 1, + hintText: "#{t('search_hint')}", + noResultsText: "#{t('no_result_text')}", + searchingText: "#{t('searching_term')}" + }); + }); + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/referential_stop_areas/add_routing_stops.html.erb b/app/views/referential_stop_areas/add_routing_stops.html.erb deleted file mode 100644 index 310e2f8b0..000000000 --- a/app/views/referential_stop_areas/add_routing_stops.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= title_tag t('stop_areas.add_routing_stops.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :routing_stop_ids, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=itl_excluded", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @stop_area.routing_stops, :view_path => 'app/views', :format => :json, :scope => self).render } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/referential_stop_areas/add_routing_stops.html.slim b/app/views/referential_stop_areas/add_routing_stops.html.slim new file mode 100644 index 000000000..4cd1acc0a --- /dev/null +++ b/app/views/referential_stop_areas/add_routing_stops.html.slim @@ -0,0 +1,13 @@ += title_tag t('stop_areas.add_routing_stops.title', :stop_area => @stop_area.name ) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :routing_stop_ids, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=itl_excluded", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @stop_area.routing_stops, :view_path => 'app/views', :format => :json, :scope => self).render } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/referential_stop_areas/edit.html.erb b/app/views/referential_stop_areas/edit.html.erb deleted file mode 100644 index 10d937050..000000000 --- a/app/views/referential_stop_areas/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('stop_areas.edit.title', :stop_area => @stop_area.name ) %> - -<%= render "form" %> diff --git a/app/views/referential_stop_areas/edit.html.slim b/app/views/referential_stop_areas/edit.html.slim new file mode 100644 index 000000000..a999ab715 --- /dev/null +++ b/app/views/referential_stop_areas/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('stop_areas.edit.title', stop_area: @stop_area.name) + += render 'form'
\ No newline at end of file diff --git a/app/views/referential_stop_areas/index.html.erb b/app/views/referential_stop_areas/index.html.erb deleted file mode 100644 index 17f36d562..000000000 --- a/app/views/referential_stop_areas/index.html.erb +++ /dev/null @@ -1,38 +0,0 @@ -<%= title_tag t('stop_areas.index.title') %> - -<div id="country_codes"> - <%= @country_codes.to_json %> -</div> - -<%= search_form_for @q, :url => referential_stop_areas_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <div class="input-group col-md-9"> - <%= f.text_field :name_cont, :placeholder => "#{t('.name')}", :class => 'form-control' %> - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div><!-- /input-group --> - <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> - <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> - </a> - </div> - - <div id="advanced_search" class="panel-collapse collapse"> - <div class="panel-body"> - <%= f.text_field :zip_code_cont, :placeholder => "#{t('.zip_code')}", :class => 'form-control typeahead' %> - <%= f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { :include_blank => "#{t('.area_type')}" }, { :class => 'form-control' }) %> - </div> - </div> -</div> -<% end %> - -<div id="stop_areas"><%= render 'stop_areas' %></div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('stop_areas.actions.new'), new_referential_stop_area_path(@referential), :class => "add" %></li> - <li><%#= link_to t('stop_areas.actions.default_geometry'), default_geometry_referential_stop_areas_path(@referential), :method => :put, :class => "calculator" %></li> -</ul> - -<% end %> diff --git a/app/views/referential_stop_areas/index.html.slim b/app/views/referential_stop_areas/index.html.slim new file mode 100644 index 000000000..85bd15d20 --- /dev/null +++ b/app/views/referential_stop_areas/index.html.slim @@ -0,0 +1,32 @@ += title_tag t('stop_areas.index.title') + +#country_codes + = @country_codes.to_json + += search_form_for @q, :url => referential_stop_areas_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| + .panel.panel-default + .panel-heading + .input-group.col-md-9 + = f.text_field :name_cont, :placeholder => "#{t('.name')}", class: 'form-control' + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + a data-toggle="collapse" data-parent="#search" href="#advanced_search" + i.fa.fa-plus + = "#{t('.advanced_search')}" + + #advanced_search.panel-collapse.collapse + .panel-body + = f.text_field :zip_code_cont, :placeholder => "#{t('.zip_code')}", class: 'form-control typeahead' + = f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { :include_blank => "#{t('.area_type')}" }, { :class => 'form-control' }) + +#stop_areas + = render 'stop_areas' + +- content_for :sidebar do + ul.actions + li + = link_to t('stop_areas.actions.new'), new_referential_stop_area_path(@referential), class: 'add' + li + / = link_to t('stop_areas.actions.default_geometry'), default_geometry_referential_stop_areas_path(@referential), :method => :put, :class => "calculator"
\ No newline at end of file diff --git a/app/views/referential_stop_areas/index.js.erb b/app/views/referential_stop_areas/index.js.erb deleted file mode 100644 index 1621823cc..000000000 --- a/app/views/referential_stop_areas/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#stop_areas').html('<%= escape_javascript(render("stop_areas")) %>');
\ No newline at end of file diff --git a/app/views/referential_stop_areas/index.js.slim b/app/views/referential_stop_areas/index.js.slim new file mode 100644 index 000000000..322feb105 --- /dev/null +++ b/app/views/referential_stop_areas/index.js.slim @@ -0,0 +1 @@ +| $('#stop_areas').html("#{escape_javascript(render('stop_areas'))}");
\ No newline at end of file diff --git a/app/views/referential_stop_areas/index.kml.erb b/app/views/referential_stop_areas/index.kml.erb deleted file mode 100644 index f43f130b6..000000000 --- a/app/views/referential_stop_areas/index.kml.erb +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% @stop_areas.where("latitude is not null and longitude is not null").each do |stop_area| %> - <Placemark id="<%= stop_area.id %>" > - <name><%= stop_area.name %></name> - <stop_area_type><%= stop_area.stop_area_type %></stop_area_type> - <stop_area_type_label><%= t("area_types.label.#{stop_area.stop_area_type}") %></stop_area_type_label> - <%= stop_area.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> diff --git a/app/views/referential_stop_areas/index.kml.slim b/app/views/referential_stop_areas/index.kml.slim new file mode 100644 index 000000000..00d257f93 --- /dev/null +++ b/app/views/referential_stop_areas/index.kml.slim @@ -0,0 +1,10 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - @stop_areas.where("latitude is not null and longitude is not null").each do |stop_area| + placemark id="#{stop_area.id}" + name = stop_area.name + stop_area_type = stop_area.stop_area_type + stop_area_type_label = t("area_types.label.#{stop_area.stop_area_type}") + = stop_area.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/referential_stop_areas/new.html.erb b/app/views/referential_stop_areas/new.html.erb deleted file mode 100644 index 9fcf4390e..000000000 --- a/app/views/referential_stop_areas/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('stop_areas.new.title') %> - -<%= render "form" %> diff --git a/app/views/referential_stop_areas/new.html.slim b/app/views/referential_stop_areas/new.html.slim new file mode 100644 index 000000000..54fd59422 --- /dev/null +++ b/app/views/referential_stop_areas/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('stop_areas.new.title') + += render 'form'
\ No newline at end of file diff --git a/app/views/referential_stop_areas/select_parent.html.erb b/app/views/referential_stop_areas/select_parent.html.erb deleted file mode 100644 index 3f550d370..000000000 --- a/app/views/referential_stop_areas/select_parent.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= title_tag t('stop_areas.select_parent.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :parent_id, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?relation=parent&target_type=#{@stop_area.area_type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'), :searching_text => t('searching_term'), :tokenLimit => 1, :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', [@parent].compact, :view_path => 'app/views', :format => :json, :scope => self ).render } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/referential_stop_areas/select_parent.html.slim b/app/views/referential_stop_areas/select_parent.html.slim new file mode 100644 index 000000000..4a72f5c1d --- /dev/null +++ b/app/views/referential_stop_areas/select_parent.html.slim @@ -0,0 +1,13 @@ += title_tag t('stop_areas.select_parent.title', stop_area: @stop_area.name ) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :parent_id, as: :search_stop_area, json: referential_autocomplete_stop_areas_path(@referential, format: :json)+"?relation=parent&target_type=#{@stop_area.area_type}", hint_text: t('search_hint'), :no_result_text => t('no_result_text'), :searching_text => t('searching_term'), :tokenLimit => 1, :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', [@parent].compact, :view_path => 'app/views', format: :json, :scope => self ).render } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/referential_stop_areas/show.html.erb b/app/views/referential_stop_areas/show.html.erb deleted file mode 100644 index 7083abd10..000000000 --- a/app/views/referential_stop_areas/show.html.erb +++ /dev/null @@ -1,176 +0,0 @@ -<%= title_tag t('stop_areas.show.title', :stop_area => @stop_area.name ) %> - -<div class="stop_area_show"> - <% if show_map? %> - <%= @map.to_html %> - <% end %> - <div class="summary"> - <p> - <label><%= @stop_area.human_attribute_name("comment") %>: </label> - <%= @stop_area.comment %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("nearest_topic_name") %>: </label> - <%= @stop_area.nearest_topic_name %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("street_name") %>: </label> - <%= @stop_area.street_name %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("country_code") %>: </label> - <%= @stop_area.country_code %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("zip_code") %>: </label> - <%= @stop_area.zip_code %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("city_name") %>: </label> - <%= @stop_area.city_name %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("fare_code") %>: </label> - <%= @stop_area.fare_code %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("time_zone") %>: </label> - <%= @stop_area.time_zone %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("url") %>: </label> - <%= @stop_area.url %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("registration_number") %>: </label> - <%= @stop_area.registration_number %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("stop_area_type") %>: </label> - <%= t("area_types.label.#{@stop_area.stop_area_type}") %> - <i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="<%= t('.not_editable') %>"></i> - </p> - <% if !manage_itl %> - <p> - <label><%= @stop_area.human_attribute_name("mobility_restricted_suitability") %>: </label> - <% if (!@stop_area.mobility_restricted_suitability.nil?) %> - <%= t((@stop_area.mobility_restricted_suitability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("stairs_availability") %>: </label> - <% if (!@stop_area.stairs_availability.nil?) %> - <%= t((@stop_area.stairs_availability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("lift_availability") %>: </label> - <% if (!@stop_area.lift_availability.nil?) %> - <%= t((@stop_area.lift_availability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> <label><%= t('stop_areas.show.geographic_data') %> </label></p> - <% if @stop_area.long_lat_type == nil %> - <span class='geo_data'><%= t('stop_areas.show.no_geographic_data') %></span> - <% else %> - <% if !@stop_area.projection.nil? %> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("projection") %>: </span> - <%= @referential.projection_type_label %> - </p> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("projection_x") %>: </span> - <%= @stop_area.projection_x %> - </p> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("projection_y") %>: </span> - <%= @stop_area.projection_y %> - </p> - <% end %> - <% if !@stop_area.long_lat_type.nil? %> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("long_lat_type") %>: </span> - <%= @stop_area.long_lat_type %> - </p> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("longitude") %>: </span> - <%= @stop_area.longitude %> - </p> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("latitude") %>: </span> - <%= @stop_area.latitude %> - </p> - <% end %> - <% end %> - <% end %> - </div> -</div> -<p class="after_map" /> - -<div class="genealogical clearfix"> - <%= render "stop_areas/genealogical" %> -</div> - -<% if manage_access_points %> -<div> - <h3><%= t('.access_points') %></h3> - - <div class="access_points paginated_content"> - <%= paginated_content @access_points, "access_points/access_point" %> - </div> -</div> -<% end %> - -<% content_for :sidebar do %> - <table> - <tr><td> - <ul class="actions"> - <li><%= link_to t('stop_areas.actions.new'), new_referential_stop_area_path(@referential), :class => "add" %></li> - <li><%= link_to t('stop_areas.actions.edit'), edit_referential_stop_area_path(@referential, @stop_area), :class => "edit" %></li> - <li><%= link_to t('stop_areas.actions.destroy'), referential_stop_area_path(@referential, @stop_area), :method => :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, :class => "remove" %></li> - </ul> - </td></tr> - <% if manage_itl %> - <tr><td> - <h4><%= t(".itl_managment") %></h4> - <ul class="actions"> - <li><%= link_to t('stop_areas.actions.add_routing_lines'), add_routing_lines_referential_stop_area_path(@referential, @stop_area), :class => "add_routing_lines" %></li> - <li><%= link_to t('stop_areas.actions.add_routing_stops'), add_routing_stops_referential_stop_area_path(@referential, @stop_area), :class => "add_routing_stops" %></li> - </ul> - </td></tr> - <% else %> - <tr><td> - <h4><%= t(".stop_managment") %></h4> - <ul class="actions"> - <li><%= link_to t('stop_areas.actions.select_parent'), select_parent_referential_stop_area_path(@referential, @stop_area), :class => "parent" %></li> - <% if @stop_area.parent == nil %> - <li><%= link_to t('stop_areas.actions.clone_as_parent'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, :hierarchy => "parent"), :class => "clone" %></li> - <% end %> - <% if manage_children %> - <li><%= link_to t('stop_areas.actions.add_children'), add_children_referential_stop_area_path(@referential, @stop_area), :class => "children" %></li> - <li><%= link_to t('stop_areas.actions.clone_as_child'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, :hierarchy => "child"), :class => "clone" %></li> - <% end %> - </ul> - </td></tr> - - <% if manage_access_points %> - <tr><td> - <h4><%= t(".access_managment") %></h4> - <ul class="actions"> - <li><%= link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), :class => "add" %></li> - <li><%= link_to t('stop_areas.actions.manage_access_links'), access_links_referential_stop_area_path(@referential,@stop_area), :class => "access_link" %></li> - </ul> - </td></tr> - <% end %> - - <% end %> - </table> - <br> - <%= creation_tag(@stop_area) %> -<% end %> diff --git a/app/views/referential_stop_areas/show.html.slim b/app/views/referential_stop_areas/show.html.slim new file mode 100644 index 000000000..2224728e9 --- /dev/null +++ b/app/views/referential_stop_areas/show.html.slim @@ -0,0 +1,172 @@ += title_tag t('stop_areas.show.title', stop_area: @stop_area.name) + +.stop_area_show + = @map.to_html if show_map? + + .summary + p + label = "#{@stop_area.human_attribute_name('comment')} : " + = @stop_area.comment + + p + label = "#{@stop_area.human_attribute_name('nearest_topic_name')} : " + = @stop_area.nearest_topic_name + + p + label = "#{@stop_area.human_attribute_name('street_name')} : " + = @stop_area.street_name + + p + label = "#{@stop_area.human_attribute_name('country_code')} : " + = @stop_area.country_code + + p + label = "#{@stop_area.human_attribute_name('zip_code')} : " + = @stop_area.zip_code + + p + label = "#{@stop_area.human_attribute_name('city_name')} : " + = @stop_area.city_name + + p + label = "#{@stop_area.human_attribute_name('fare_code')} : " + = @stop_area.fare_code + + p + label = "#{@stop_area.human_attribute_name('time_zone')} : " + = @stop_area.time_zone + + p + label = "#{@stop_area.human_attribute_name('url')} : " + = @stop_area.url + + p + label = "#{@stop_area.human_attribute_name('registration_number')} : " + = @stop_area.registration_number + + p + label = "#{@stop_area.human_attribute_name('stop_area_type')} : " + = t("area_types.label.#{@stop_area.stop_area_type}") + + i.fa.fa-info-circle data-toggle="tooltip" data-placement="right" title="#{t('.not_editable')}" + + - if !manage_itl + p + label = "#{@stop_area.human_attribute_name('mobility_restricted_suitability')} : " + + - if !@stop_area.mobility_restricted_suitability.nil? + = t((@stop_area.mobility_restricted_suitability == true).to_s) + - else + = t('unknown') + + p + label = "#{@stop_area.human_attribute_name('stairs_availability')} : " + + - if !@stop_area.stairs_availability.nil? + = t((@stop_area.stairs_availability == true).to_s) + - else + = t('unknown') + + p + label = "#{@stop_area.human_attribute_name('lift_availability')} : " + - if !@stop_area.lift_availability.nil? + = t((@stop_area.lift_availability == true).to_s) + - else + = t('unknown') + + p + label = t('stop_areas.show.geographic_data') + + - if @stop_area.long_lat_type == nil + span.geo_data = t('stop_areas.show.no_geographic_data') + - else + - if !@stop_area.projection.nil? + p + span.geo_data = "#{@stop_area.human_attribute_name('projection')} : " + = @referential.projection_type_label + + p + span.geo_data = "#{@stop_area.human_attribute_name('projection_x')} : " + = @stop_area.projection_x + + p + span.geo_data = "#{@stop_area.human_attribute_name('projection_y')} : " + = @stop_area.projection_y + + - if !@stop_area.long_lat_type.nil? + p + span.geo_data = "#{@stop_area.human_attribute_name('long_lat_type')} : " + = @stop_area.long_lat_type + + p + span.geo_data = "#{@stop_area.human_attribute_name('longitude')} : " + = @stop_area.longitude + + p + span.geo_data = "#{@stop_area.human_attribute_name('latitude')} : " + = @stop_area.latitude + +p.after_map + +.genealogical.clearfix + = render "stop_areas/genealogical" + +- if manage_access_points + div + h3 = t('.access_points') + .access_points.paginated_content + = paginated_content @access_points, "access_points/access_point" + +- content_for :sidebar do + table + tr + td + ul.actions + li + = link_to t('stop_areas.actions.new'), new_referential_stop_area_path(@referential), class: 'add' + li + = link_to t('stop_areas.actions.edit'), edit_referential_stop_area_path(@referential, @stop_area), class: 'edit' + li + = link_to t('stop_areas.actions.destroy'), referential_stop_area_path(@referential, @stop_area), method: :delete, data: { :confirm => t('stop_areas.actions.destroy_confirm') }, class: 'remove' + + - if manage_itl + tr + td + h4 = t('.itl_managment') + ul.actions + li + = link_to t('stop_areas.actions.add_routing_lines'), add_routing_lines_referential_stop_area_path(@referential, @stop_area), class: 'add_routing_lines' + li + = link_to t('stop_areas.actions.add_routing_stops'), add_routing_stops_referential_stop_area_path(@referential, @stop_area), class: 'add_routing_stops' + + - else + tr + td + h4 = t('.stop_managment') + ul.actions + li + = link_to t('stop_areas.actions.select_parent'), select_parent_referential_stop_area_path(@referential, @stop_area), class: 'parent' + + - if @stop_area.parent == nil + li + = link_to t('stop_areas.actions.clone_as_parent'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, hierarchy: 'parent'), class: 'clone' + + - if manage_children + li + = link_to t('stop_areas.actions.add_children'), add_children_referential_stop_area_path(@referential, @stop_area), class: 'children' + li + = link_to t('stop_areas.actions.clone_as_child'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, hierarchy: 'child'), class: 'clone' + + - if manage_access_points + tr + td + h4 = t(".access_managment") + ul.actions + li + = link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), class: 'add' + li + = link_to t('stop_areas.actions.manage_access_links'), access_links_referential_stop_area_path(@referential,@stop_area), class: 'access_link' + + br + + = creation_tag(@stop_area)
\ No newline at end of file diff --git a/app/views/referential_stop_areas/show.kml.erb b/app/views/referential_stop_areas/show.kml.erb deleted file mode 100644 index 39a764bd6..000000000 --- a/app/views/referential_stop_areas/show.kml.erb +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% if !params["children"].nil? %> - <% @stop_area.children.each do |child| %> - <Placemark id="<%= child.id %>" > - <name><%= child.name %></name> - <stop_area_type><%= child.stop_area_type %></stop_area_type> - <%= (child.position or child.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - <% elsif !params["routing"].nil? %> - <% @stop_area.routing_stops.each do |child| %> - <Placemark id="<%= child.id %>" > - <name><%= child.name %></name> - <stop_area_type><%= child.stop_area_type %></stop_area_type> - <%= (child.position or child.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - <% else %> - <Placemark id="<%= @stop_area.id %>" > - <name><%= @stop_area.name %></name> - <stop_area_type><%= @stop_area.stop_area_type %></stop_area_type> - <%= (@stop_area.position or @stop_area.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> diff --git a/app/views/referential_stop_areas/show.kml.slim b/app/views/referential_stop_areas/show.kml.slim new file mode 100644 index 000000000..4327436ed --- /dev/null +++ b/app/views/referential_stop_areas/show.kml.slim @@ -0,0 +1,22 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - if !params["children"].nil? + - @stop_area.children.each do |child| + placemark id="#{child.id}" + name = child.name + stop_area_type = child.stop_area_type + = (child.position or child.default_position).kml_representation.html_safe + + - elsif !params["routing"].nil? + - @stop_area.routing_stops.each do |child| + placemark id="#{child.id}" + name = child.name + stop_area_type = child.stop_area_type + = (child.position or child.default_position).kml_representation.html_safe + - else + placemark id="#{@stop_area.id}" + name = @stop_area.name + stop_area_type = @stop_area.stop_area_type + = (@stop_area.position or @stop_area.default_position).kml_representation.html_safe diff --git a/app/views/referentials/_clean.html.erb b/app/views/referentials/_clean.html.erb deleted file mode 100644 index 995b7644d..000000000 --- a/app/views/referentials/_clean.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - <div id="clean_up" > - <%= semantic_form_for [@referential, CleanUp.new] do |form| %> - <%= form.inputs do %> - <%= form.input :expected_date, :as => :date_picker , :wrapper_html => { :class => 'date', :title => t('titles.clean_up.expected_date') } %> - <%= form.input :keep_lines, :as => :boolean %> - <%= form.input :keep_stops, :as => :boolean %> - <%= form.input :keep_companies, :as => :boolean %> - <%= form.input :keep_networks, :as => :boolean %> - <%= form.input :keep_group_of_lines, :as => :boolean %> - <% end %> - <%= form.actions do %> - <%= form.action :submit, :as => :button, :label => t('clean_ups.actions.clean_up') , :button_html => {:data => {:confirm => t('clean_ups.actions.confirm') }}%> - <% end %> - <% end %> - </div> diff --git a/app/views/referentials/_clean.html.slim b/app/views/referentials/_clean.html.slim new file mode 100644 index 000000000..8e09c14cb --- /dev/null +++ b/app/views/referentials/_clean.html.slim @@ -0,0 +1,12 @@ +#clean_up + = semantic_form_for [@referential, CleanUp.new] do |form| + = form.inputs do + = form.input :expected_date, as: :date_picker, :wrapper_html => { class: 'date', title: t('titles.clean_up.expected_date') } + = form.input :keep_lines, as: :boolean + = form.input :keep_stops, as: :boolean + = form.input :keep_companies, as: :boolean + = form.input :keep_networks, as: :boolean + = form.input :keep_group_of_lines, as: :boolean + + = form.actions do + = form.action :submit, as: :button, label: t('clean_ups.actions.clean_up') , :button_html => { data: { confirm: t('clean_ups.actions.confirm') } }
\ No newline at end of file diff --git a/app/views/referentials/_counts.html.erb b/app/views/referentials/_counts.html.erb deleted file mode 100644 index ebe91aebf..000000000 --- a/app/views/referentials/_counts.html.erb +++ /dev/null @@ -1,67 +0,0 @@ -<div class="panel panel-default"> - <!-- Default panel contents --> - <div class="panel-heading"><%= t(".objects") %></div> - - <ul class="list-group" width="75%"> - <li class="list-group-item"> - <span class="badge"><%= @referential.networks.size %></span> - <%= Referential.human_attribute_name("networks") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.companies.size %></span> - <%= Referential.human_attribute_name("companies") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.group_of_lines.size %></span> - <%= Referential.human_attribute_name("group_of_lines") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.lines.size %></span> - <%= Referential.human_attribute_name("lines") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.vehicle_journeys.size %></span> - <%= Referential.human_attribute_name("vehicle_journeys") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.time_tables.size %></span> - <%= Referential.human_attribute_name("time_tables") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.connection_links.size %></span> - <%= Referential.human_attribute_name("connection_links") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.route_sections.size %></span> - <%= Referential.human_attribute_name("route_sections") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.stop_areas.size %></span> - <%= Referential.human_attribute_name("stop_areas") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.stop_areas.where("area_type = ?","BoardingPosition").size %></span> - <%= image_tag "map/boarding_position.png"%><%= Referential.human_attribute_name("boarding_positions") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.stop_areas.where("area_type = ?","Quay").size %></span> - <%= image_tag "map/quay.png"%><%= Referential.human_attribute_name("quays") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.stop_areas.where("area_type = ?","CommercialStopPoint").size %></span> - <%= image_tag "map/commercial_stop_point.png"%><%= Referential.human_attribute_name("commercial_stops") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.stop_areas.where("area_type = ?","StopPlace").size %></span> - <%= image_tag "map/stop_place.png"%><%= Referential.human_attribute_name("stop_places") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.stop_areas.where("area_type = ?","ITL").size %></span> - <%= image_tag "map/itl.png"%><%= Referential.human_attribute_name("itls") %> - </li> - <li class="list-group-item"> - <span class="badge"><%= @referential.access_points.size %></span> - <%= image_tag "map/access_in_out.png"%><%= Referential.human_attribute_name("access_points") %> - </li> - </ul> -</div> diff --git a/app/views/referentials/_counts.html.slim b/app/views/referentials/_counts.html.slim new file mode 100644 index 000000000..fc3ad251e --- /dev/null +++ b/app/views/referentials/_counts.html.slim @@ -0,0 +1,70 @@ +.panel.panel-default + / Default panel contents + .panel-heading = t(".objects") + + ul.list-group width="75%" + li.list-group-item + span.badge = @referential.networks.size + = Referential.human_attribute_name('networks') + + li.list-group-item + span.badge = @referential.companies.size + = Referential.human_attribute_name('companies') + + li.list-group-item + span.badge = @referential.group_of_lines.size + = Referential.human_attribute_name('group_of_lines') + + li.list-group-item + span.badge = @referential.lines.size + = Referential.human_attribute_name('lines') + + li.list-group-item + span.badge = @referential.vehicle_journeys.size + = Referential.human_attribute_name('vehicle_journeys') + + li.list-group-item + span.badge = @referential.time_tables.size + = Referential.human_attribute_name('time_tables') + + li.list-group-item + span.badge = @referential.connection_links.size + = Referential.human_attribute_name('connection_links') + + li.list-group-item + span.badge = @referential.route_sections.size + = Referential.human_attribute_name('route_sections') + + li.list-group-item + span.badge = @referential.stop_areas.size + = Referential.human_attribute_name('stop_areas') + + li.list-group-item + span.badge = @referential.stop_areas.where("area_type = ?","BoardingPosition").size + = image_tag "map/boarding_position.png" + = Referential.human_attribute_name("boarding_positions") + + li.list-group-item + span.badge = @referential.stop_areas.where("area_type = ?","Quay").size + = image_tag "map/quay.png" + = Referential.human_attribute_name("quays") + + li.list-group-item + span.badge = @referential.stop_areas.where("area_type = ?","CommercialStopPoint").size + = image_tag "map/commercial_stop_point.png" + = Referential.human_attribute_name("commercial_stops") + + li.list-group-item + span.badge = @referential.stop_areas.where("area_type = ?","StopPlace").size + = image_tag "map/stop_place.png" + = Referential.human_attribute_name("stop_places") + + li.list-group-item + span.badge = @referential.stop_areas.where("area_type = ?","ITL").size + = image_tag "map/itl.png" + = Referential.human_attribute_name("itls") + + li.list-group-item + span.badge = @referential.access_points.size + = image_tag "map/access_in_out.png" + = Referential.human_attribute_name("access_points")
\ No newline at end of file diff --git a/app/views/referentials/_form.erb b/app/views/referentials/_form.erb deleted file mode 100644 index f2963e46e..000000000 --- a/app/views/referentials/_form.erb +++ /dev/null @@ -1,24 +0,0 @@ -<%= semantic_form_for @referential, :class => "form-horizontal" do |form| %> - <%= form.inputs do %> - <%= form.input :name %> - <% if @referential.new_record? %> - <%= form.input :slug, :input_html => { :title => t("formtastic.titles.referential.slug")}%> - <% else %> - <li class="input"> - <label class="label" ><%= @referential.human_attribute_name("slug") %></label> - <%= @referential.slug %> - </li> - <% end %> - <%= form.input :prefix, :input_html => { :title => t("formtastic.titles.referential.prefix")} %> - <%= form.input :projection_type, :as => :select, :collection => Referential.available_srids %> - <%= form.input :time_zone %> - <%= form.input :upper_corner, :input_html => { :title => t("formtastic.titles.referential.upper_corner")} %> - <%= form.input :lower_corner, :input_html => { :title => t("formtastic.titles.referential.lower_corner")} %> - <%= form.input :data_format, :label => true, :include_blank => false %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> diff --git a/app/views/referentials/_form.html.slim b/app/views/referentials/_form.html.slim new file mode 100644 index 000000000..985fee4b4 --- /dev/null +++ b/app/views/referentials/_form.html.slim @@ -0,0 +1,21 @@ += semantic_form_for @referential, class: 'form-horizontal' do |form| + = form.inputs do + = form.input :name + + - if @referential.new_record? + = form.input :slug, :input_html => { title: t("formtastic.titles.referential.slug") } + - else + li.input + label.label = @referential.human_attribute_name('slug') + = @referential.slug + + = form.input :prefix, input_html: { title: t("formtastic.titles.referential.prefix") } + = form.input :projection_type, as: :select, :collection => Referential.available_srids + = form.input :time_zone + = form.input :upper_corner, input_html: { title: t("formtastic.titles.referential.upper_corner") } + = form.input :lower_corner, input_html: { title: t("formtastic.titles.referential.lower_corner") } + = form.input :data_format, label: true, include_blank: false + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/referentials/_line.erb b/app/views/referentials/_line.erb deleted file mode 100644 index 04cb65708..000000000 --- a/app/views/referentials/_line.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= div_for(referential) do %> - <%= link_to referential.name, referential %> - <div class="info"> - - </div> -<% end %> diff --git a/app/views/referentials/_line.html.slim b/app/views/referentials/_line.html.slim new file mode 100644 index 000000000..5ddf017f2 --- /dev/null +++ b/app/views/referentials/_line.html.slim @@ -0,0 +1,5 @@ += div_for(referential) do + + = link_to referential.name, referential + + .info
\ No newline at end of file diff --git a/app/views/referentials/_referential.erb b/app/views/referentials/_referential.erb deleted file mode 100644 index ea1a1f899..000000000 --- a/app/views/referentials/_referential.erb +++ /dev/null @@ -1,36 +0,0 @@ -<div id="index_item" class="panel panel-default referential"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_path(referential), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to referential_path(referential), :method => :delete, :data => {:confirm => t('referentials.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, referential], :class => "preview", :title => "#{Referential.model_name.human.capitalize} #{referential.name}") do %> - <span class="name"> - <%= truncate(referential.name, :length => 30) %> - </span> - <% end %> - </h5> - </div> - </div> - <div id="referential_<%= referential.id %>" class="panel-body"> - <p> - <%= referential.human_attribute_name('lines') %>: <span class="lines_count"></span> - </p> - <p> - <%= referential.human_attribute_name('networks') %>: <span class="networks_count"></span> - </p> - <p> - <%= referential.human_attribute_name('vehicle_journeys') %>: <span class="vehicle_journeys_count"></span> - </p> - <p> - <%= referential.human_attribute_name('time_tables') %>: <span class="time_tables_count"></span> - </p> - </div> -</div> -<%= javascript_include_tag referential_path(referential,:format => :js) %> diff --git a/app/views/referentials/_referential.html.slim b/app/views/referentials/_referential.html.slim new file mode 100644 index 000000000..6304211b5 --- /dev/null +++ b/app/views/referentials/_referential.html.slim @@ -0,0 +1,33 @@ +#index_item.panel.panel-default.referential + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_referential_path(referential), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + = link_to referential_path(referential), method: :delete, data: { confirm: t('referentials.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to [@referential, referential], class: 'preview', title: "#{Referential.model_name.human.capitalize} #{referential.name}" do + span.name + = truncate(referential.name, :length => 30) + + .panel-body id="referential_#{referential.id}" + p + = "#{referential.human_attribute_name('lines')} : " + span.lines_count + + p + = "#{referential.human_attribute_name('networks')} : " + span.networks_count + + p + = "#{referential.human_attribute_name('vehicle_journeys')} : " + span.vehicle_journeys_count + + p + = "#{referential.human_attribute_name('time_tables')} : " + span.time_tables_count + += javascript_include_tag referential_path(referential, format: :js)
\ No newline at end of file diff --git a/app/views/referentials/_validity_out.html.erb b/app/views/referentials/_validity_out.html.erb deleted file mode 100644 index 1ee930577..000000000 --- a/app/views/referentials/_validity_out.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<div class="panel panel-default"> - <!-- Default panel contents --> - <div class="panel-heading"><%= t('.validity_out_time_tables') %>: <%= tm_cnt = @referential.time_tables.validity_out_from_on?(Date.today).size %></div> - <ul class="list-group"> - <% if tm_cnt > 0 %> - <% @referential.time_tables.validity_out_from_on?(Date.today,5).each do |tm| %> - <li class="list-group-item"><%= link_to tm.comment, referential_time_table_path(@referential, tm) %></li> - <% end %> - <% if tm_cnt > 5 %> - <li class="list-group-item">...</li> - <% end %> - <% end %> - </ul> -</div> - -<div class="panel panel-default"> - <!-- Default panel contents --> - <div class="panel-heading"><%= t('.validity_out_soon_time_tables', :count => "7") %>: <%= tm_cnt = @referential.time_tables.validity_out_between?(Date.today,Date.today+7).size %></div> - <ul class="list-group"> - <% if tm_cnt > 0 %> - <% @referential.time_tables.validity_out_between?(Date.today,Date.today+7,5).each do |tm| %> - <li class="list-group-item"><%= link_to tm.comment, referential_time_table_path(@referential, tm) %></li> - <% end %> - <% if tm_cnt > 5 %> - <li class="list-group-item">...</li> - <% end %> - <% end %> - </ul> -</div> diff --git a/app/views/referentials/_validity_out.html.slim b/app/views/referentials/_validity_out.html.slim new file mode 100644 index 000000000..a7920ce01 --- /dev/null +++ b/app/views/referentials/_validity_out.html.slim @@ -0,0 +1,27 @@ +.panel.panel-default + / Default panel contents + .panel-heading + = "#{t('.validity_out_time_tables')} : " + = (tm_cnt = @referential.time_tables.validity_out_from_on?(Date.today).size) + + ul.list-group + - if tm_cnt > 0 + - @referential.time_tables.validity_out_from_on?(Date.today, 5).each do |tm| + li.list-group-item = link_to tm.comment, referential_time_table_path(@referential, tm) + + - if tm_cnt > 5 + li.list-group-item ... + +.panel.panel-default + / Default panel contents + .panel-heading + = "#{t('.validity_out_soon_time_tables', count: '7')} : " + = (tm_cnt = @referential.time_tables.validity_out_between?(Date.today,Date.today+7).size) + + ul.list-group + - if tm_cnt > 0 + - @referential.time_tables.validity_out_between?(Date.today,Date.today+7,5).each do |tm| + li.list-group-item = link_to tm.comment, referential_time_table_path(@referential, tm) + + - if tm_cnt > 5 + li.list-group-item ...
\ No newline at end of file diff --git a/app/views/referentials/edit.html.erb b/app/views/referentials/edit.html.erb deleted file mode 100644 index e6027b4b5..000000000 --- a/app/views/referentials/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t(".title") %> - -<%= render "form" %> diff --git a/app/views/referentials/edit.html.slim b/app/views/referentials/edit.html.slim new file mode 100644 index 000000000..cc5637bb6 --- /dev/null +++ b/app/views/referentials/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/referentials/index.html.erb b/app/views/referentials/index.html.erb deleted file mode 100644 index 1368fc248..000000000 --- a/app/views/referentials/index.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -<!-- FIXME #827 --> -<% current_organisation.offer_workbenches.each do |workbench| %> - <h2><%= link_to workbench.name, workbench %></h2> - <p><%= workbench.referentials.count %> jeu(x) de données à l'heure actuelle</p> -<% end %> - -<!-- FIXME #823 --> -<% if false %> - <%= title_tag Referential.model_name.human(:count => 2) %> - <div class="referentials paginated_content"> - <%= paginated_content @referentials %> - </div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> - <!-- FIXME #823 --> - <% if false %> - <li><%= link_to t('referentials.actions.new'), new_referential_path, :class => "add" %></li> - <% end %> -</ul> -<ul> - <!-- FIXME #820 --> - <!-- Don't blame me. See #820 --> - <li><%= link_to 'Données Reflex', stop_area_referential_path(1) %></li> - - <!-- FIXME #824 --> - <!-- Don't blame me. See #824 --> - <li><%= link_to 'Données CodifLigne', line_referential_path(1) %></li> -</ul> -<% end %> diff --git a/app/views/referentials/index.html.slim b/app/views/referentials/index.html.slim new file mode 100644 index 000000000..d9c5376a1 --- /dev/null +++ b/app/views/referentials/index.html.slim @@ -0,0 +1,25 @@ +/ FIXME #827 +- current_organisation.offer_workbenches.each do |workbench| + h2 = link_to workbench.name, workbench + p = "#{workbench.referentials.count} jeu(x) de données à l'heure actuelle" + +/ FIXME #823 +- if false + = title_tag Referential.model_name.human(count: 2) + .referentials.paginated_content + = paginated_content @referentials + +- content_for :sidebar do + ul.actions + / FIXME #823 + - if false + li = link_to t('referentials.actions.new'), new_referential_path, class: 'add' + + ul + / FIXME #820 + / Don't blame me. See #820 + li = link_to 'Données Reflex', stop_area_referential_path(1) + + / FIXME #824 + / Don't blame me. See #824 + li = link_to 'Données CodifLigne', line_referential_path(1)
\ No newline at end of file diff --git a/app/views/referentials/new.html.erb b/app/views/referentials/new.html.erb deleted file mode 100644 index e6027b4b5..000000000 --- a/app/views/referentials/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t(".title") %> - -<%= render "form" %> diff --git a/app/views/referentials/new.html.slim b/app/views/referentials/new.html.slim new file mode 100644 index 000000000..cc5637bb6 --- /dev/null +++ b/app/views/referentials/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/referentials/show.html.erb b/app/views/referentials/show.html.erb deleted file mode 100644 index f04721f8d..000000000 --- a/app/views/referentials/show.html.erb +++ /dev/null @@ -1,67 +0,0 @@ -<%= title_tag @referential.name %> - -<div class="summary"> - <p> - <label><%= Referential.human_attribute_name("slug") %>: </label> - <%= @referential.slug %> - </p> - <p> - <label><%= Referential.human_attribute_name("prefix") %>: </label> - <%= @referential.prefix %> - </p> - <p> - <label><%= Referential.human_attribute_name("projection_type") %>: </label> - <% if ! @referential.projection_type_label.empty? %> - <%= @referential.projection_type_label %> (epsg:<%= @referential.projection_type %>) - <% end %> - </p> - <p> - <label><%= Referential.human_attribute_name("time_zone").capitalize %>: </label> - <%= @referential.time_zone %> - </p> - <p> - <label><%= Referential.human_attribute_name("data_format_restrictions") %>: </label> - <%= @referential.data_format %> - </p> - <p> - <label><%= Referential.human_attribute_name("validity_period") %>: </label> - <% if Chouette::TimeTable.start_validity_period.nil? %> - <%= Referential.human_attribute_name("no_validity_period") %> - <% else %> - <%= Referential.human_attribute_name("start_validity_period") %> - <%= l Chouette::TimeTable.start_validity_period %> - <%= Referential.human_attribute_name("end_validity_period") %> - <%= l Chouette::TimeTable.end_validity_period %> - <% end %> - </p> - - <table width="100%"> - <tr> - <td valign="top" width="50%"> - <%= render "counts" %> - </td> - <td valign="top" > - <%= render "validity_out" %> - </td> - </tr> - </table> - - <% if @referential.api_keys.present? %> - <h3 class="api_keys"><%= t('.api_keys') %></h3> - <div class="api_keys paginated_content"> - <%= paginated_content(@referential.api_keys, "api_keys/api_key") %> - </div> - <% end %> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('referentials.actions.edit'), edit_referential_path(@referential), :class => "edit" %></li> - <li><%= link_to t('referentials.actions.destroy'), referential_path(@referential), :method => :delete, :data => {:confirm => t('referentials.actions.destroy_confirm')}, :class => "remove" %></li> - <li><%= link_to t('api_keys.actions.new'), new_referential_api_key_path(@referential), :class => "add" %></li> - <br> -</ul> - -<h4><%= t('.clean_up') %></h4> -<%= render "clean" %> -<% end %> diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim new file mode 100644 index 000000000..d5fed0344 --- /dev/null +++ b/app/views/referentials/show.html.slim @@ -0,0 +1,73 @@ +h2 + = @referential.name + em.small = " (archivé)" if @referential.archived? + +.summary + p + label = "#{Referential.human_attribute_name('slug')} : " + = @referential.slug + + p + label = "#{Referential.human_attribute_name('prefix')} : " + = @referential.prefix + + p + label = "#{Referential.human_attribute_name('projection_type')} : " + - if !@referential.projection_type_label.empty? + = "#{@referential.projection_type_label} (epsg:#{@referential.projection_type})" + + p + label = "#{Referential.human_attribute_name('time_zone').capitalize} : " + = @referential.time_zone + + p + label = "#{Referential.human_attribute_name('data_format_restrictions')} : " + = @referential.data_format + + p + label = "#{Referential.human_attribute_name('validity_period')} : " + - if Chouette::TimeTable.start_validity_period.nil? + = Referential.human_attribute_name("no_validity_period") + - else + = Referential.human_attribute_name("start_validity_period") + = l Chouette::TimeTable.start_validity_period + = Referential.human_attribute_name("end_validity_period") + = l Chouette::TimeTable.end_validity_period + + table width="100%" + tr + td valign="top" width="50%" + == render 'counts' + + td valign="top" + == render 'validity_out' + + - if @referential.api_keys.present? + h3.api_keys = t('.api_keys') + + .api_keys.paginated_content + = paginated_content(@referential.api_keys, "api_keys/api_key") + +- content_for :sidebar do + ul.actions + li = link_to t('referentials.actions.edit'), edit_referential_path(@referential), class: 'edit' + + li + - if @referential.archived? + = link_to unarchive_referential_path(@referential), method: :put do + span.fa-stack + span.fa.fa-archive.fa-stack-1x + span.fa.fa-ban.fa-stack-2x + = " Désarchiver cet espace de données" + - else + = link_to archive_referential_path(@referential), method: :put do + span.fa.fa-archive + = " Archiver cet espace de données" + + li = link_to t('referentials.actions.destroy'), referential_path(@referential), method: :delete, data: {:confirm => t('referentials.actions.destroy_confirm')}, class: "remove" + li = link_to t('api_keys.actions.new'), new_referential_api_key_path(@referential), class: 'add' + br + + h4 = t('.clean_up') + + == render 'clean'
\ No newline at end of file diff --git a/app/views/referentials/show.js.erb b/app/views/referentials/show.js.erb deleted file mode 100644 index 05b623b93..000000000 --- a/app/views/referentials/show.js.erb +++ /dev/null @@ -1,25 +0,0 @@ -$(function (){ - var ref, update_infos, update_referential_details, _i, _len, _ref, _results; - - update_infos = function(json) { - var info, update_info; - info = $('#referential_' + json.referential_id); - console.log(info) - update_info = function(key, value) { - if (key.match(/_count$/)) { - return $(info.find('.' + key)[0]).text(value); - } - }; - return $.each(json, update_info); - }; - - update_referential_details = function() { - return $.getJSON("<%= referential_path(@referential, :format => :json) %>", update_infos); - }; - - _results = []; - _results.push(update_referential_details()); - - return _results; -}); - diff --git a/app/views/referentials/show.js.slim b/app/views/referentials/show.js.slim new file mode 100644 index 000000000..f1d01ce6c --- /dev/null +++ b/app/views/referentials/show.js.slim @@ -0,0 +1,20 @@ +| $(function() { +| var ref, update_infos, update_referential_details, _i, _len, _ref, _results; +| update_infos = function(json) { +| var info, update_info; +| info = $('#referential_' + json.referential_id); +| console.log(info) +| update_info = function(key, value) { +| if (key.match(/_count$/)) { +| return $(info.find('.' + key)[0]).text(value); +| } +| }; +| return $.each(json, update_info); +| }; +| update_referential_details = function() { +| return $.getJSON("#{referential_path(@referential, format: :json)}", update_infos); +| }; +| _results = []; +| _results.push(update_referential_details()); +| return _results; +| });
\ No newline at end of file diff --git a/app/views/route_sections/_form.html.erb b/app/views/route_sections/_form.html.erb deleted file mode 100644 index 28a1dd47a..000000000 --- a/app/views/route_sections/_form.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<%= semantic_form_for [@referential, @route_section] do |form| %> - <%= form.inputs do %> - <% if @route_section.new_record? %> - <%= form.input :departure, as: :select, collection: @stop_areas, include_blank: false %> - <%= form.input :arrival, as: :select, collection: @stop_areas, include_blank: false %> - <% else %> - <li class="input optional"> - <label class="label"><%= @route_section.human_attribute_name("departure") %></label> - <%= @route_section.departure.name %> - </li> - <li class="input optional"> - <label class="label"><%= @route_section.human_attribute_name("arrival") %></label> - <%= @route_section.arrival.name %> - </li> - <%= form.input :editable_geometry, as: :hidden %> - <% end %> - - <%= form.input :no_processing, label: t('.no_processing'), as: :select, collection: { t('.standard_processor') => false, t('.no_processor') => true }, include_blank: false %> - <% end %> - <%= form.actions do %> - <%= form.action :submit, :as => :button, label: t('.submit') %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> diff --git a/app/views/route_sections/_form.html.slim b/app/views/route_sections/_form.html.slim new file mode 100644 index 000000000..51e4fdcf6 --- /dev/null +++ b/app/views/route_sections/_form.html.slim @@ -0,0 +1,21 @@ += semantic_form_for [@referential, @route_section] do |form| + = form.inputs do + - if @route_section.new_record? + = form.input :departure, as: :select, collection: @stop_areas, include_blank: false + = form.input :arrival, as: :select, collection: @stop_areas, include_blank: false + - else + li.input.optional + label.label = @route_section.human_attribute_name('departure') + = @route_section.departure.name + + li.input.optional + label.label = @route_section.human_attribute_name('arrival') + = @route_section.arrival.name + + = form.input :editable_geometry, as: :hidden + + = form.input :no_processing, label: t('.no_processing'), as: :select, collection: { t('.standard_processor') => false, t('.no_processor') => true }, include_blank: false + + = form.actions do + = form.action :submit, as: :button, label: t('.submit') + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/route_sections/edit.html.erb b/app/views/route_sections/edit.html.erb deleted file mode 100644 index 1e8133344..000000000 --- a/app/views/route_sections/edit.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('route_sections.edit.title') %> - -<%= @map.to_html if @map %> -<%= render "form" %> diff --git a/app/views/route_sections/edit.html.slim b/app/views/route_sections/edit.html.slim new file mode 100644 index 000000000..15944fd75 --- /dev/null +++ b/app/views/route_sections/edit.html.slim @@ -0,0 +1,4 @@ += title_tag t('route_sections.edit.title') + += @map.to_html if @map +== render 'form'
\ No newline at end of file diff --git a/app/views/route_sections/index.html.erb b/app/views/route_sections/index.html.erb deleted file mode 100644 index 763ea360e..000000000 --- a/app/views/route_sections/index.html.erb +++ /dev/null @@ -1,58 +0,0 @@ -<%= title_tag t('.title') %> - -<%= form_for search, url: referential_route_sections_path(@referential), method: :get, class: "form-inline" do |form| %> - <div class="panel panel-default"> - <div class="panel-heading"> - <div class="col-md-6"> - <%= form.text_field :departure_name, class: 'form-control', placeholder: Chouette::RouteSection.human_attribute_name(:departure) %> - </div> - - <div class="input-group col-md-6"> - <%= form.text_field :arrival_name, class: 'form-control', placeholder: Chouette::RouteSection.human_attribute_name(:arrival) %> - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div> - </div> - - <div class="panel-body"> - <div class="col-md-4"> - <%= form.select :line_id, @referential.lines.order(:name).pluck(:name, :id), { include_blank: t('.all_lines')}, class: 'form-control' %> - </div> - </div> - </div> -<% end %> - -<table class="table table-hover table-striped"> - <thead> - <tr> - <th><%= Chouette::RouteSection.human_attribute_name :departure %></th> - <th><%= Chouette::RouteSection.human_attribute_name :arrival %></th> - <th class="distance"><%= Chouette::RouteSection.human_attribute_name :distance %></th> - <th class="points"><%= Chouette::RouteSection.human_attribute_name :points %></th> - <th class="points"><%= Chouette::RouteSection.human_attribute_name :quantity %></th> - <th class="actions"></th> - </tr> - </thead> - <tbody> - <% @route_sections.each do |route_section| %> - <tr> - <td><%= route_section.departure.name %> <%= link_to content_tag(:i, "", class: "fa fa-external-link"), referential_stop_area_path(@referential, route_section.departure) %></td> - <td><%= route_section.arrival.name %> <%= link_to content_tag(:i, "", class: "fa fa-external-link"), referential_stop_area_path(@referential, route_section.arrival) %></td> - <td class="distance"><%= route_section.distance.to_i if route_section.distance %></td> - <td class="points"><%= route_section.via_count if route_section.via_count > 0 %></td> - <td class="journey_patterns"><%= route_section.journey_pattern_sections.count(:journey_pattern_id, distinct: true) %></td> - <td class="actions"> - <%= link_to t('.actions.show'), referential_route_section_path(@referential, route_section), class: "view" %> - <%= link_to t('.actions.edit'), edit_referential_route_section_path(@referential, route_section), class: "edit" %> - <%= link_to t('.actions.destroy'), referential_route_section_path(@referential, route_section), method: :delete, data: { confirm: t('route_sections.actions.destroy_confirm') }, class: "remove" %> - </td> - </tr> - <% end %> - </tbody> - -</table> - -<div class="pagination"> - <%= will_paginate @route_sections, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/route_sections/index.html.slim b/app/views/route_sections/index.html.slim new file mode 100644 index 000000000..2d36be67a --- /dev/null +++ b/app/views/route_sections/index.html.slim @@ -0,0 +1,48 @@ += title_tag t('.title') + += form_for search, url: referential_route_sections_path(@referential), method: :get, class: 'form-inline' do |form| + .panel.panel-default + .panel-heading + .col-md-6 + = form.text_field :departure_name, class: 'form-control', placeholder: Chouette::RouteSection.human_attribute_name(:departure) + + .input-group.col-md-6 + = form.text_field :arrival_name, class: 'form-control', placeholder: Chouette::RouteSection.human_attribute_name(:arrival) + + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + .panel-body + .col-md-4 + = form.select :line_id, @referential.lines.order(:name).pluck(:name, :id), { include_blank: t('.all_lines')}, class: 'form-control' + +table.table.table-hover.table-striped + thead + tr + th = Chouette::RouteSection.human_attribute_name :departure + th = Chouette::RouteSection.human_attribute_name :arrival + th.distance = Chouette::RouteSection.human_attribute_name :distance + th.points = Chouette::RouteSection.human_attribute_name :points + th.points = Chouette::RouteSection.human_attribute_name :quantity + th.actions + + tbody + - @route_sections.each do |route_section| + tr + td + = route_section.departure.name + = link_to content_tag(:i, "", class: "fa fa-external-link"), referential_stop_area_path(@referential, route_section.departure) + td + = route_section.arrival.name + = link_to content_tag(:i, "", class: "fa fa-external-link"), referential_stop_area_path(@referential, route_section.arrival) + td.distance = route_section.distance.to_i if route_section.distance + td.points = route_section.via_count if route_section.via_count > 0 + td.journey_patterns = route_section.journey_pattern_sections.count(:journey_pattern_id, distinct: true) + td.actions + = link_to t('.actions.show'), referential_route_section_path(@referential, route_section), class: 'view' + = link_to t('.actions.edit'), edit_referential_route_section_path(@referential, route_section), class: 'edit' + = link_to t('.actions.destroy'), referential_route_section_path(@referential, route_section), method: :delete, data: { confirm: t('route_sections.actions.destroy_confirm') }, class: 'remove' + +.pagination + = will_paginate @route_sections, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/route_sections/new.html.erb b/app/views/route_sections/new.html.erb deleted file mode 100644 index 1ff3c74d0..000000000 --- a/app/views/route_sections/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('route_sections.new.title') %> - -<%= render "form" %> diff --git a/app/views/route_sections/new.html.slim b/app/views/route_sections/new.html.slim new file mode 100644 index 000000000..a41db0254 --- /dev/null +++ b/app/views/route_sections/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('route_sections.new.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/route_sections/show.html.erb b/app/views/route_sections/show.html.erb deleted file mode 100644 index 61c7c8149..000000000 --- a/app/views/route_sections/show.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -<%= title_tag t('.title') %> - -<div class="route_section"> - <%= @map.to_html %> - - <div class="summary"> - <p> - <label><%= @route_section.human_attribute_name("departure") %>: </label> - <%= @route_section.departure.name %> - </p> - <p> - <label><%= @route_section.human_attribute_name("arrival") %>: </label> - <%= @route_section.arrival.name %> - </p> - <p> - <label><%= @route_section.human_attribute_name("distance") %>: </label> - <%= "#{@route_section.distance.round}m" if @route_section.distance %> - </p> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('route_sections.actions.edit'), edit_referential_route_section_path(@referential, @route_section), :class => "edit" %></li> - <li><%= link_to t('route_sections.actions.destroy'), referential_route_section_path(@referential, @route_section), :method => :delete, :data => {:confirm => t('route_sections.actions.destroy_confirm')}, :class => "remove" %></li> -</ul> - <%= creation_tag(@route_section) %> -<% end %> diff --git a/app/views/route_sections/show.html.slim b/app/views/route_sections/show.html.slim new file mode 100644 index 000000000..f02f7de80 --- /dev/null +++ b/app/views/route_sections/show.html.slim @@ -0,0 +1,26 @@ += title_tag t('.title') + +.route_section + = @map.to_html + + .summary + p + label = "#{@route_section.human_attribute_name('departure')} : " + = @route_section.departure.name + + p + label = "#{@route_section.human_attribute_name('arrival')} : " + = @route_section.arrival.name + + p + label = "#{@route_section.human_attribute_name('distance')} : " + = "#{@route_section.distance.round}m" if @route_section.distance + +- content_for :sidebar do + ul.actions + li + = link_to t('route_sections.actions.edit'), edit_referential_route_section_path(@referential, @route_section), class: 'edit' + li + = link_to t('route_sections.actions.destroy'), referential_route_section_path(@referential, @route_section), :method => :delete, :data => {:confirm => t('route_sections.actions.destroy_confirm')}, class: 'remove' + + = creation_tag(@route_section)
\ No newline at end of file diff --git a/app/views/route_sections/show.kml.erb b/app/views/route_sections/show.kml.erb deleted file mode 100644 index 0d41f0fdb..000000000 --- a/app/views/route_sections/show.kml.erb +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <Placemark id="route-section-<%= @route_section.id %>"> - <%= @route_section.geometry(params[:mode]).kml_representation.html_safe %> - </Placemark> - </Document> -</kml> diff --git a/app/views/route_sections/show.kml.slim b/app/views/route_sections/show.kml.slim new file mode 100644 index 000000000..9dbb4957b --- /dev/null +++ b/app/views/route_sections/show.kml.slim @@ -0,0 +1,6 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + placemark id="route-section-#{@route_section.id}" + = @route_section.geometry(params[:mode]).kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/route_sections_selectors/_selection.js.erb b/app/views/route_sections_selectors/_selection.js.erb deleted file mode 100644 index 70d03cf75..000000000 --- a/app/views/route_sections_selectors/_selection.js.erb +++ /dev/null @@ -1,28 +0,0 @@ -<div> - <span class="departure"> - <label><%= @route_section.human_attribute_name("departure") %>:</label> - <%= link_to @route_section.departure.name, referential_stop_area_path(@referential, @route_section.departure) %> - </span> - - <span class="arrival"> - <label><%= @route_section.human_attribute_name("arrival") %>:</label> - <%= link_to @route_section.arrival.name, referential_stop_area_path(@referential, @route_section.arrival) %> - </span> - - <span class="distance"> - <label><%= @route_section.human_attribute_name("distance") %>:</label> - <%= "#{@route_section.distance.to_i} m" if @route_section.distance > 0 %> - </span> - - <% if @route_section.via_count > 0 %> - <span class="via_count"> - <label><%= @route_section.human_attribute_name("via_count") %>:</label> - <%= @route_section.via_count if @route_section.via_count > 0 %> - </span> - <% end %> - - <span class="actions"> - <%= link_to_edit_route_section @route_section %> - <%= link_to_create_route_section @route_section.departure, @route_section.arrival %> - </span> -</div> diff --git a/app/views/route_sections_selectors/_selection.js.slim b/app/views/route_sections_selectors/_selection.js.slim new file mode 100644 index 000000000..6b5489171 --- /dev/null +++ b/app/views/route_sections_selectors/_selection.js.slim @@ -0,0 +1,21 @@ +div + span.departure + label = "#{@route_section.human_attribute_name('departure')} : " + = link_to @route_section.departure.name, referential_stop_area_path(@referential, @route_section.departure) + + span.arrival + label = "#{@route_section.human_attribute_name('arrival')} : " + = link_to @route_section.arrival.name, referential_stop_area_path(@referential, @route_section.arrival) + + span.distance + label = "#{@route_section.human_attribute_name('distance')} : " + = "#{@route_section.distance.to_i} m" if @route_section.distance > 0 + + - if @route_section.via_count > 0 + span.via_count + label = "#{@route_section.human_attribute_name('via_count')} : " + = @route_section.via_count if @route_section.via_count > 0 + + span.actions + = link_to_edit_route_section @route_section + = link_to_create_route_section @route_section.departure, @route_section.arrival
\ No newline at end of file diff --git a/app/views/route_sections_selectors/edit.html.erb b/app/views/route_sections_selectors/edit.html.erb deleted file mode 100644 index a60b8b95b..000000000 --- a/app/views/route_sections_selectors/edit.html.erb +++ /dev/null @@ -1,48 +0,0 @@ -<%= title_tag t('.title', journey_pattern: journey_name(@journey_pattern)) %> - -<div class = "large-map"> - <%= @map.to_html(no_fullscreen: true) %> -</div> - -<%= semantic_form_for resource, url: referential_line_route_journey_pattern_route_sections_selector_path(@referential, @line, @route, @journey_pattern), method: :put do |form| %> - -<h3><%= t('.selection.title') %></h3> - -<div id="map-selection" style="display: none"> - <div> - </div> -</div> - -<div id="empty-map-selection"> - <%= t('.no_selection') %> -</div> - -<h3><%= t('.form.title') %></h3> - -<table class="table table-hover table-striped"> - <tbody> - <%= form.fields_for :sections do |section_form| %> - <tr> - <td><%= link_to section_form.object.departure.name, referential_stop_area_path(@referential, section_form.object.departure) %></td> - <td class="route_section"> - <% if section_form.object.candidates.present? %> - <%= section_form.input :route_section_id, as: :select, label: false, collection: section_form.object.candidates, include_blank: t('.no_selection') %> - <% else %> - <%= t('.no_candidate') %> - <% end %> - </td> - <td class="action"> - <%= link_to_edit_route_section section_form.object.route_section %> - <%= link_to_create_route_section section_form.object.departure, section_form.object.arrival %> - </td> - </tr> - <% end %> - </tbody> -</table> - -<%= form.actions do %> - <%= form.action :submit, as: :button, label: t('.submit') %> - <%= form.action :cancel, as: :link, url: referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern) %> -<% end %> - -<% end %> diff --git a/app/views/route_sections_selectors/edit.html.slim b/app/views/route_sections_selectors/edit.html.slim new file mode 100644 index 000000000..9dcee8af3 --- /dev/null +++ b/app/views/route_sections_selectors/edit.html.slim @@ -0,0 +1,34 @@ += title_tag t('.title', journey_pattern: journey_name(@journey_pattern)) + +.large-map + = @map.to_html(no_fullscreen: true) + += semantic_form_for resource, url: referential_line_route_journey_pattern_route_sections_selector_path(@referential, @line, @route, @journey_pattern), method: :put do |form| + h3 = t('.selection.title') + + #map-selection style="display: none;" + div + + #empty-map-selection + = t('.no_selection') + + h3 = t('.form.title') + + table.table.table-hover.table-striped + tbody + = form.fields_for :sections do |section_form| + tr + td = link_to section_form.object.departure.name, referential_stop_area_path(@referential, section_form.object.departure) + td.route_section + - if section_form.object.candidates.present? + = section_form.input :route_section_id, as: :select, label: false, collection: section_form.object.candidates, include_blank: t('.no_selection') + - else + = t('.no_candidate') + + td.action + = link_to_edit_route_section section_form.object.route_section + = link_to_create_route_section section_form.object.departure, section_form.object.arrival + + = form.actions do + = form.action :submit, as: :button, label: t('.submit') + = form.action :cancel, as: :link, url: referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern)
\ No newline at end of file diff --git a/app/views/routes/_form.html.erb b/app/views/routes/_form.html.erb deleted file mode 100644 index d642efe88..000000000 --- a/app/views/routes/_form.html.erb +++ /dev/null @@ -1,101 +0,0 @@ -<%= semantic_form_for [@referential, @line, @route] do |form| %> - <%= form.inputs do %> - <%= form.input :name %> - <%= form.input :published_name %> - <%= form.input :number %> - <%= form.input :comment %> - <%= form.input :opposite_route, :as => :select, :collection => @line.routes.select { |r| r.id != @route.id } %> - <%= form.input :direction_code, :as => :select, :collection => Chouette::Route.directions, :include_blank => false, :member_label => Proc.new { |mode| t("directions.label.#{mode}") } %> - <%= form.input :wayback_code, :as => :select, :collection => Chouette::Route.waybacks, :include_blank => false, :member_label => Proc.new { |mode| t("waybacks.label.#{mode}") } %> - <%= form.input :objectid, :required => !@route.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.route.objectid")} %> - <% end %> - <div id="stop_points"> - <%= form.semantic_fields_for :stop_points, :include_id => false do |p| %> - <%= render "stop_point_fields", :f => p %> - <% end %> - <div class="links"> - <%= link_to_add_association t("routes.actions.add_stop_point"), form, :stop_points, :class => 'add_stop_point add' %> - <br/> - <%= link_to t('routes.actions.new_stop_point'), new_referential_stop_area_path(@referential), {:class => "add", :target => "_blank"} %> - </div> - </div> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> -<script> - -$(document).ready( function() { - var stop_point_ids = []; - - var order_position = function() { - $('#stop_points input[type="hidden"][id$="position"]').each(function(index) { - $(this).val(index); - }); - }; - - var write_stop_point_ids = function(){ - $('#stop_points input[type="hidden"][class~="stop_point_id"]').each(function(index,element) { - // soit le parent a la classe added_stop_point - if ( $(element).hasClass("added_stop_point") ){ - $(this).attr("value", ""); - } else { - $(this).attr("value", stop_point_ids.shift()); - } - }); - } - - var empty_stop_point_ids = function() { - stop_point_ids = $.map($('#stop_points input[type="hidden"][class="stop_point_id"]'), function(element, index) { - return $(element).val(); - }); - // console.log( "before-remove"); - // console.log( stop_point_ids); - }; - - $('#stop_points').sortable({ - axis: 'y', - dropOnEmpty: false, - handle: '.handle', - cursor: 'crosshair', - items: '.stop_point', - opacity: 0.4, - scroll: true, - start: function( event, ui ) { - empty_stop_point_ids(); - }, - update: function( event, ui ) { - write_stop_point_ids(); - order_position(); - } - }); - - $('#stop_points').bind("cocoon:after-insert", function(event, insertedItem) { - - var new_stop_count = $('div.nested-fields.stop_point').size(); - var cocoonId = insertedItem.find("input.new_stop_point").attr("id").match( /route_stop_points_attributes_(\d+)_stop_area_id/)[1]; - insertedItem.find('input').each( function(index,e){ - var old = $(e).attr("name"); - if (old!=undefined) { - $(e).attr("name", old.replace( cocoonId, new_stop_count - 1)); - } - }); - - //console.log( "cocoonId="+cocoonId+", new_stop_count="+new_stop_count); - order_position(); - }); - - $('#stop_points').on("cocoon:before-remove", empty_stop_point_ids); - - $('#stop_points').on("cocoon:after-remove", function() { - write_stop_point_ids(); - order_position(); - }); -}); - - - - -</script> diff --git a/app/views/routes/_form.html.slim b/app/views/routes/_form.html.slim new file mode 100644 index 000000000..329862955 --- /dev/null +++ b/app/views/routes/_form.html.slim @@ -0,0 +1,91 @@ += semantic_form_for [@referential, @line, @route] do |form| + = form.inputs do + = form.input :name + = form.input :published_name + = form.input :number + = form.input :comment + = form.input :opposite_route, as: :select, :collection => @line.routes.select { |r| r.id != @route.id } + = form.input :direction_code, as: :select, :collection => Chouette::Route.directions, :include_blank => false, :member_label => Proc.new { |mode| t("directions.label.#{mode}") } + = form.input :wayback_code, as: :select, :collection => Chouette::Route.waybacks, :include_blank => false, :member_label => Proc.new { |mode| t("waybacks.label.#{mode}") } + = form.input :objectid, :required => !@route.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.route.objectid")} + + #stop_points + = form.semantic_fields_for :stop_points, :include_id => false do |p| + == render "stop_point_fields", f: p + + .links + = link_to_add_association t("routes.actions.add_stop_point"), form, :stop_points, class: 'add_stop_point add' + br + = link_to t('routes.actions.new_stop_point'), new_referential_stop_area_path(@referential), { class: 'add', target: '_blank' } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +javascript: + $(document).ready(function() { + var stop_point_ids = []; + + var order_position = function() { + $('#stop_points input[type="hidden"][id$="position"]').each(function(index) { + $(this).val(index); + }); + }; + + var write_stop_point_ids = function(){ + $('#stop_points input[type="hidden"][class~="stop_point_id"]').each(function(index,element) { + // soit le parent a la classe added_stop_point + if ( $(element).hasClass("added_stop_point") ){ + $(this).attr("value", ""); + } else { + $(this).attr("value", stop_point_ids.shift()); + } + }); + } + + var empty_stop_point_ids = function() { + stop_point_ids = $.map($('#stop_points input[type="hidden"][class="stop_point_id"]'), function(element, index) { + return $(element).val(); + }); + // console.log( "before-remove"); + // console.log( stop_point_ids); + }; + + $('#stop_points').sortable({ + axis: 'y', + dropOnEmpty: false, + handle: '.handle', + cursor: 'crosshair', + items: '.stop_point', + opacity: 0.4, + scroll: true, + start: function( event, ui ) { + empty_stop_point_ids(); + }, + update: function( event, ui ) { + write_stop_point_ids(); + order_position(); + } + }); + + $('#stop_points').bind("cocoon:after-insert", function(event, insertedItem) { + var new_stop_count = $('div.nested-fields.stop_point').size(); + var cocoonId = insertedItem.find("input.new_stop_point").attr("id").match( /route_stop_points_attributes_(\d+)_stop_area_id/)[1]; + insertedItem.find('input').each( function(index,e){ + var old = $(e).attr("name"); + if (old!=undefined) { + $(e).attr("name", old.replace( cocoonId, new_stop_count - 1)); + } + }); + + //console.log( "cocoonId="+cocoonId+", new_stop_count="+new_stop_count); + order_position(); + }); + + $('#stop_points').on("cocoon:before-remove", empty_stop_point_ids); + + $('#stop_points').on("cocoon:after-remove", function() { + write_stop_point_ids(); + order_position(); + }); + });
\ No newline at end of file diff --git a/app/views/routes/_route.html.erb b/app/views/routes/_route.html.erb deleted file mode 100644 index d428d5b38..000000000 --- a/app/views/routes/_route.html.erb +++ /dev/null @@ -1,54 +0,0 @@ -<div id="index_item" class="panel panel-default route"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_line_route_path(@referential, @line, route), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to referential_line_route_path(@referential, @line, route), :method => :delete, :data => {:confirm => t('routes.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, @line, route], :class => "preview", :title => "#{Chouette::Route.model_name.human.capitalize} #{route.name}") do %> - <span class="name"> - <% if ( route.wayback_code ) %> - <%= fonticon_wayback(route.wayback) %> - <% end %> - <%= truncate(route.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <% if route.journey_patterns.size > 0 %> - <i class="fa fa-clock-o"></i> - <%= link_to t("vehicle_journeys.actions.index"), referential_line_route_vehicle_journeys_path(@referential, @line, route) %> - <% else %> - <%= t('.no_journey_pattern')%> - <% end%> - </p> - <% if exist_vehicle_journey_frequencies?(route) %> - <p> - <i class="fa fa-clock-o"></i> - <%= link_to t("vehicle_journey_frequencies.actions.index"), referential_line_route_vehicle_journey_frequencies_path(@referential, @line, route) %> - </p> - <% end %> - <p> - <% if route.opposite_route %> - <%= fonticon_wayback(route.opposite_route.wayback) %><%= link_to truncate(route.opposite_route.name, :length => 30), referential_line_route_path( @referential, @line, route.opposite_route) %> - <% else %> - <%= t('.no_opposite') %> - <% end %> - </p> - <p> - <% if ! route.direction.blank? %> - <%= route.human_attribute_name('direction_code') %> : <%= t('directions.label.'+route.direction_code) %> - <% else %> - <br> - <% end %> - </p> - </div> -</div> diff --git a/app/views/routes/_route.html.slim b/app/views/routes/_route.html.slim new file mode 100644 index 000000000..fd740fa9b --- /dev/null +++ b/app/views/routes/_route.html.slim @@ -0,0 +1,43 @@ +#index_item.panel.panel-default.route + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_referential_line_route_path(@referential, @line, route), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + = link_to referential_line_route_path(@referential, @line, route), method: :delete, :data => {:confirm => t('routes.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to [@referential, @line, route], class: 'preview', title: "#{Chouette::Route.model_name.human.capitalize} #{route.name}" do + span.name + - if route.wayback_code + = fonticon_wayback(route.wayback) + + = truncate(route.name, length: 20) + + .panel-body + p + - if route.journey_patterns.size > 0 + i.fa.fa-clock-o + = link_to t("vehicle_journeys.actions.index"), referential_line_route_vehicle_journeys_path(@referential, @line, route) + - else + = t('.no_journey_pattern') + + - if exist_vehicle_journey_frequencies?(route) + p + i.fa.fa-clock-o + = link_to t("vehicle_journey_frequencies.actions.index"), referential_line_route_vehicle_journey_frequencies_path(@referential, @line, route) + + p + - if route.opposite_route + = fonticon_wayback(route.opposite_route.wayback) + = link_to truncate(route.opposite_route.name, :length => 30), referential_line_route_path( @referential, @line, route.opposite_route) + - else + = t('.no_opposite') + + p + - if !route.direction.blank? + = "#{route.human_attribute_name('direction_code')} : #{t('directions.label.'+route.direction_code)}" + - else + br
\ No newline at end of file diff --git a/app/views/routes/_stop_point_fields.html.erb b/app/views/routes/_stop_point_fields.html.erb deleted file mode 100644 index 73ac69152..000000000 --- a/app/views/routes/_stop_point_fields.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<div class="nested-fields stop_point row"> - <%= f.inputs do %> - <div class="col-md-1 resize"> - <%= link_to_remove_association "<i class='fa fa-trash-o'></i>".html_safe, f %> - <span class="handle" alt="<%= t('stop_points.index.move') %>" title="<%= t('stop_points.index.move') %>" ><i class='fa fa-arrows'></i></span> - </div> - <div class="col-md-11"> - <% if f.object.stop_area.nil? || f.object.new_record? %> - <%= f.input :id, :as => :hidden, :input_html => { :class => "stop_point_id added_stop_point", :value => "" } %> - <%= f.input :position, :as => :hidden, :input_html => { :class => "position" } %> - <%= f.input :stop_area_id, :label => false, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=physical", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :tokenLimit => 1, :input_html => { :class => "new_stop_point stop_area_id", :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', [f.object.stop_area].compact, :view_path => 'app/views', :format => :json, :scope => self ).render } %> - <% else %> - <%= f.input :id, :as => :hidden, :input_html => { :class => "stop_point_id" } %> - <%= f.input :position, :as => :hidden, :input_html => { :class => "position" } %> - <%= f.input :stop_area_id, :label => false, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=physical", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :tokenLimit => 1, :input_html => { :class => "stop_area_id", :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', [f.object.stop_area].compact, :view_path => 'app/views', :format => :json, :scope => self ).render } %> - <% end %> - </div> - <% end %> -</div> diff --git a/app/views/routes/_stop_point_fields.html.slim b/app/views/routes/_stop_point_fields.html.slim new file mode 100644 index 000000000..814e882c2 --- /dev/null +++ b/app/views/routes/_stop_point_fields.html.slim @@ -0,0 +1,16 @@ +.nested-fields.stop_point.row + = f.inputs do + .col-md-1.resize + = link_to_remove_association "<i class='fa fa-trash-o'></i>".html_safe, f + span.handle alt="#{t('stop_points.index.move')}" title="#{t('stop_points.index.move')}" > + i.fa.fa-arrows + + .col-md-11 + - if f.object.stop_area.nil? || f.object.new_record? + = f.input :id, as: :hidden, :input_html => { :class => "stop_point_id added_stop_point", :value => "" } + = f.input :position, as: :hidden, :input_html => { :class => "position" } + = f.input :stop_area_id, :label => false, as: :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=physical", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :tokenLimit => 1, :input_html => { :class => "new_stop_point stop_area_id", :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', [f.object.stop_area].compact, :view_path => 'app/views', :format => :json, :scope => self ).render } + - else + = f.input :id, as: :hidden, :input_html => { class: 'stop_point_id' } + = f.input :position, as: :hidden, :input_html => { class: 'position' } + = f.input :stop_area_id, label: false, as: :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=physical", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :tokenLimit => 1, :input_html => { :class => "stop_area_id", :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', [f.object.stop_area].compact, :view_path => 'app/views', :format => :json, :scope => self ).render }
\ No newline at end of file diff --git a/app/views/routes/edit.html.erb b/app/views/routes/edit.html.erb deleted file mode 100644 index dcfa0e8da..000000000 --- a/app/views/routes/edit.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('routes.edit.title', :route => @route.name ) %> - -<%= render "form" %> - diff --git a/app/views/routes/edit.html.slim b/app/views/routes/edit.html.slim new file mode 100644 index 000000000..7e2c1f982 --- /dev/null +++ b/app/views/routes/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('routes.edit.title', route: @route.name ) + +== render 'form'
\ No newline at end of file diff --git a/app/views/routes/edit_boarding_alighting.html.erb b/app/views/routes/edit_boarding_alighting.html.erb deleted file mode 100644 index 1b46cda5a..000000000 --- a/app/views/routes/edit_boarding_alighting.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<%= title_tag t('routes.edit_boarding_alighting.title', :route => @route.name ) %> - -<%= simple_form_for ["save_boarding_alighting", @referential, @line, @route], :method => :PUT do |form| %> -<table class="table table-hover"> - <thead> - <th><%= t(".stop_area_name") %></th> - <th><%= t(".for_boarding") %></th> - <th><%= t(".for_alighting") %></th> - </thead> - <tbody> - <%= form.simple_fields_for :stop_points do |stop_points_form| %> - <tr> - <td> - <%= explicit_name(stop_points_form.object.stop_area) %> - </td> - <td><%= stop_points_form.input :for_boarding, :label => false, include_blank: t("simple_form.include_blanks.defaults.for_boarding") %></td> - <td><%= stop_points_form.input :for_alighting, :label => false, include_blank: t("simple_form.include_blanks.defaults.for_alighting") %></td> - </tr> - <% end %> - </tbody> -</table> - - <div class="submit"> - <%= form.button :submit, :class => "" %> - <%= link_to t("cancel"), referential_line_route_path(@referential, @line, @route) %> - </div> -<% end %> diff --git a/app/views/routes/edit_boarding_alighting.html.slim b/app/views/routes/edit_boarding_alighting.html.slim new file mode 100644 index 000000000..f4de4b9e6 --- /dev/null +++ b/app/views/routes/edit_boarding_alighting.html.slim @@ -0,0 +1,19 @@ += title_tag t('routes.edit_boarding_alighting.title', :route => @route.name ) + += simple_form_for ["save_boarding_alighting", @referential, @line, @route], :method => :PUT do |form| + table.table.table-hover + thead + th = t(".stop_area_name") + th = t(".for_boarding") + th = t(".for_alighting") + + tbody + = form.simple_fields_for :stop_points do |stop_points_form| + tr + td = explicit_name(stop_points_form.object.stop_area) + td = stop_points_form.input :for_boarding, label: false, include_blank: t("simple_form.include_blanks.defaults.for_boarding") + td = stop_points_form.input :for_alighting, label: false, include_blank: t("simple_form.include_blanks.defaults.for_alighting") + + .submit + = form.button :submit, class: '' + = link_to t("cancel"), referential_line_route_path(@referential, @line, @route)
\ No newline at end of file diff --git a/app/views/routes/new.html.erb b/app/views/routes/new.html.erb deleted file mode 100644 index a144fcdee..000000000 --- a/app/views/routes/new.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('routes.new.title') %> - -<%= render "form" %> - diff --git a/app/views/routes/new.html.slim b/app/views/routes/new.html.slim new file mode 100644 index 000000000..e91ebf362 --- /dev/null +++ b/app/views/routes/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('routes.new.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/routes/show.html.erb b/app/views/routes/show.html.erb deleted file mode 100644 index d8c8e2498..000000000 --- a/app/views/routes/show.html.erb +++ /dev/null @@ -1,118 +0,0 @@ -<%= title_tag t('routes.show.title', :route => @route.name, :line => @route.line.name ) %> - -<div class="route_show"> - <%= @map.to_html %> - - <div class="summary"> - <p> - <label><%= @route.human_attribute_name(:name) %>: </label> - <%= @route.name %> - </p> - <p> - <label><%= @route.human_attribute_name(:published_name) %>: </label> - <%= @route.published_name %> - </p> - <p> - <label><%= @route.human_attribute_name(:number) %>: </label> - <%= @route.number %> - </p> - <p> - <label><%= @route.human_attribute_name(:comment) %>: </label> - <%= @route.comment %> - </p> - <p> - <label><%= @route.human_attribute_name(:direction_code) %>: </label> - <% if @route.direction_code %> - <%= t("directions.label.#{@route.direction_code}").capitalize %> - <% else %> - <%= t(".undefined") %> - <% end %> - </p> - <p> - <label><%= @route.human_attribute_name(:wayback_code) %>: </label> - <% if @route.wayback_code %> - <%= t("waybacks.label.#{@route.wayback_code}").capitalize %> - <% else %> - <%= t(".undefined") %> - <% end %> - </p> - <p> - <label><%= @route.human_attribute_name(:opposite_route) %>: </label> - <% if @route.opposite_route %> - <%= link_to @route.opposite_route.name, [@referential, @line, @route.opposite_route] %> - <% else %> - <%= t(".no_opposite_route") %> - <% end %> - </p> - </div> - -</div> - -<p class="after_map" /> - -<div class="panel-group" id="accordion"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#accordion" href="#stop_points"> - <%= t('.stop_points') %> - </a> - </h4> - </div> - <div id="stop_points" class="panel-collapse collapse"> - <div class="panel-body"> - <div class="stop_points paginated_content"> - <%= paginated_content( @route.stop_points, "stop_points/stop_point") %> - </div> - </div> - </div> - </div> -</div> - -<div class="panel-group" id="accordion"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#accordion" href="#journey_patterns"> - <%= t('.journey_patterns') %> - </a> - </h4> - </div> - <div id="journey_patterns" class="panel-collapse collapse"> - <div class="panel-body"> - <div class="journey_patterns paginated_content"> - <%= paginated_content( @route.journey_patterns, "journey_patterns/journey_pattern") %> - </div> - </div> - </div> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), :class => "add" %></li> - <li><%= link_to t('routes.actions.edit'), edit_referential_line_route_path(@referential, @line, @route), :class => "edit" %></li> - <li><%= link_to t('routes.actions.destroy'), referential_line_route_path(@referential, @line, @route), :method => :delete, :data => {:confirm => t('routes.actions.destroy_confirm')}, :class => "remove" %></li> -</ul> -<ul class="actions"> - <% if @route.stop_points.size >= 2 %> - <li><%= link_to t('journey_patterns.actions.new'), new_referential_line_route_journey_pattern_path(@referential, @line, @route), :class => "add" %></li> - <% end %> - <% if @route.stop_points.present? %> - <li><%= link_to t('routes.actions.edit_boarding_alighting'), edit_boarding_alighting_referential_line_route_path(@referential, @line, @route), :class => "edit" %></li> - <% end %> - <% if @route.journey_patterns.size > 0 %> - <li> - <%= link_to t('vehicle_journeys.actions.index'), [@referential, @line, @route, :vehicle_journeys], :class => "clock" %> - </li> - <% end %> -</ul> - -<ul class="actions"> - <li><%= link_to t('vehicle_journey_imports.new.title'), new_referential_line_route_vehicle_journey_import_path( @referential, @line, @route ), :class => "import" %></li> - <li><%= link_to t('vehicle_journey_exports.new.title'), referential_line_route_vehicle_journey_exports_path(@referential, @line, @route, :format => :zip), :class => "export" %></li> -</ul> - -<%= creation_tag(@route) %> -<% end %> - diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim new file mode 100644 index 000000000..a4e1aa90f --- /dev/null +++ b/app/views/routes/show.html.slim @@ -0,0 +1,90 @@ += title_tag t('routes.show.title', route: @route.name, line: @route.line.name ) + +.route_show + = @map.to_html + + .summary + p + label = "#{@route.human_attribute_name(:name)} : " + = @route.name + + p + label = "#{@route.human_attribute_name(:published_name)} : " + = @route.published_name + + p + label = "#{@route.human_attribute_name(:number)} : " + = @route.number + + p + label = "#{@route.human_attribute_name(:comment)} : " + = @route.comment + + p + label = "#{@route.human_attribute_name(:direction_code)} : " + - if @route.direction_code + = t("directions.label.#{@route.direction_code}").capitalize + - else + = t(".undefined") + + p + label = "#{@route.human_attribute_name(:wayback_code)} : " + - if @route.wayback_code + = t("waybacks.label.#{@route.wayback_code}").capitalize + - else + = t(".undefined") + + p + label = "#{@route.human_attribute_name(:opposite_route)} : " + - if @route.opposite_route + = link_to @route.opposite_route.name, [@referential, @line, @route.opposite_route] + - else + = t(".no_opposite_route") + +p.after_map + +#accordion.panel-group + .panel.panel-default + .panel-heading + h4.panel-title + a data-toggle="collapse" data-parent="#accordion" href="#stop_points" + = t('.stop_points') + + #stop_points.panel-collapse.collapse + .panel-body + .stop_points.paginated_content + = paginated_content(@route.stop_points, "stop_points/stop_point") + +#accordion.panel-group + .panel.panel-default + .panel-heading + h4.panel-title + a data-toggle="collapse" data-parent="#accordion" href="#journey_patterns" + = t('.journey_patterns') + + #journey_patterns.panel-collapse.collapse + .panel-body + .journey_patterns.paginated_content + = paginated_content( @route.journey_patterns, "journey_patterns/journey_pattern") + +- content_for :sidebar do + ul.actions + li = link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), class: 'add' + li = link_to t('routes.actions.edit'), edit_referential_line_route_path(@referential, @line, @route), class: 'edit' + li = link_to t('routes.actions.destroy'), referential_line_route_path(@referential, @line, @route), method: :delete, :data => {:confirm => t('routes.actions.destroy_confirm')}, class: 'remove' + + ul.actions + - if @route.stop_points.size >= 2 + li = link_to t('journey_patterns.actions.new'), new_referential_line_route_journey_pattern_path(@referential, @line, @route), class: 'add' + + - if @route.stop_points.present? + li = link_to t('routes.actions.edit_boarding_alighting'), edit_boarding_alighting_referential_line_route_path(@referential, @line, @route), class: 'edit' + + - if @route.journey_patterns.size > 0 + li = link_to t('vehicle_journeys.actions.index'), [@referential, @line, @route, :vehicle_journeys], class: 'clock' + + ul.actions + li = link_to t('vehicle_journey_imports.new.title'), new_referential_line_route_vehicle_journey_import_path( @referential, @line, @route ), class: 'import' + li = link_to t('vehicle_journey_exports.new.title'), referential_line_route_vehicle_journey_exports_path(@referential, @line, @route, format: :zip), class: 'export' + + = creation_tag(@route)
\ No newline at end of file diff --git a/app/views/routes/show.kml.erb b/app/views/routes/show.kml.erb deleted file mode 100644 index e6ef8b81d..000000000 --- a/app/views/routes/show.kml.erb +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <Placemark id="route_<%= @route.id %>" > - <name><%= @route.name %></name> - <inactive>true</inactive> - <%= @route.geometry.kml_representation.html_safe %> - </Placemark> - <% @route.stop_areas.where("latitude is not null and longitude is not null").each_with_index do |stop_area, index| %> - <Placemark id="<%= stop_area.id %>" > - <name><%= "#{stop_area.name} (#{index+1})" %></name> - <stop_area_type_label><%= t("area_types.label.#{stop_area.stop_area_type}") %></stop_area_type_label> - <% if stop_area.id==@route.stop_areas.first.id %> - <departure>true</departure> - <% elsif stop_area.id==@route.stop_areas.last.id %> - <arrival>true</arrival> - <% end %> - <%= stop_area.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> - diff --git a/app/views/routes/show.kml.slim b/app/views/routes/show.kml.slim new file mode 100644 index 000000000..b597e2b66 --- /dev/null +++ b/app/views/routes/show.kml.slim @@ -0,0 +1,20 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + placemark id="route_#{@route.id}" + name = @route.name + inactive true + = @route.geometry.kml_representation.html_safe + + - @route.stop_areas.where("latitude is not null and longitude is not null").each_with_index do |stop_area, index| + placemark id="#{stop_area.id}" + name = "#{stop_area.name} (#{index+1})" + stop_area_type_label = t("area_types.label.#{stop_area.stop_area_type}") + + - if stop_area.id==@route.stop_areas.first.id + departure true + - elsif stop_area.id==@route.stop_areas.last.id + arrival true + + = stop_area.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/rule_parameter_sets/_column_fields.html.erb b/app/views/rule_parameter_sets/_column_fields.html.erb deleted file mode 100644 index 0a9c70f96..000000000 --- a/app/views/rule_parameter_sets/_column_fields.html.erb +++ /dev/null @@ -1,11 +0,0 @@ - <td></td> - <td><%= t("activerecord.attributes.#{object_name}.#{column}") %></td> - <% suffix = "column_#{column}_object_#{object_name}"%> - <td> <%= f.check_box "unique_#{suffix}".to_sym, :class => "special" %></td> - <% if RuleParameterSet.validable_column_type(object_name, column) == :string %> - <td><%= f.select "pattern_#{suffix}".to_sym, options_for_select([[t("rule_parameter_sets.labels.free_char"), "0"], [t("rule_parameter_sets.labels.num_char"), "1"], [t("rule_parameter_sets.labels.alpha_char"), "2"], [t("rule_parameter_sets.labels.upper_char"), "3"], [t("rule_parameter_sets.labels.lower_char"), "4"]]) %></td> - <% else %> - <td><%= t "rule_parameter_sets.labels.num_char" %></td> - <% end %> - <td><%= f.number_field "min_size_#{suffix}".to_sym, :class => "special" %></td> - <td><%= f.number_field "max_size_#{suffix}".to_sym, :class => "special" %></td> diff --git a/app/views/rule_parameter_sets/_column_fields.html.slim b/app/views/rule_parameter_sets/_column_fields.html.slim new file mode 100644 index 000000000..176318765 --- /dev/null +++ b/app/views/rule_parameter_sets/_column_fields.html.slim @@ -0,0 +1,13 @@ +td +td = t("activerecord.attributes.#{object_name}.#{column}") +- suffix = "column_#{column}_object_#{object_name}" +td = f.check_box "unique_#{suffix}".to_sym, class: 'special' + +- if RuleParameterSet.validable_column_type(object_name, column) == :string + td + = f.select "pattern_#{suffix}".to_sym, options_for_select([[t("rule_parameter_sets.labels.free_char"), "0"], [t("rule_parameter_sets.labels.num_char"), "1"], [t("rule_parameter_sets.labels.alpha_char"), "2"], [t("rule_parameter_sets.labels.upper_char"), "3"], [t("rule_parameter_sets.labels.lower_char"), "4"]]) +- else + td = t('rule_parameter_sets.labels.num_char') + +td = f.number_field "min_size_#{suffix}".to_sym, class: 'special' +td = f.number_field "max_size_#{suffix}".to_sym, class: 'special' diff --git a/app/views/rule_parameter_sets/_form.html.erb b/app/views/rule_parameter_sets/_form.html.erb deleted file mode 100644 index 95316a42f..000000000 --- a/app/views/rule_parameter_sets/_form.html.erb +++ /dev/null @@ -1,84 +0,0 @@ -<%= semantic_form_for [ :organisation, @rule_parameter_set] do |form| %> - <%= form.inputs do %> - <%= form.input :name %> - <%= form.input :inter_stop_area_distance_min, :as => :number %> - <%= form.input :parent_stop_area_distance_max, :as => :number %> - <%= form.input :stop_areas_area %> - <%= form.input :inter_access_point_distance_min, :as => :number %> - <%= form.input :inter_connection_link_distance_max, :as => :number %> - <%= form.input :walk_default_speed_max, :as => :number %> - <%= form.input :walk_occasional_traveller_speed_max, :as => :number %> - <%= form.input :walk_frequent_traveller_speed_max, :as => :number %> - <%= form.input :walk_mobility_restricted_traveller_speed_max, :as => :number %> - - <%= form.input :inter_access_link_distance_max, :as => :number %> - <%= form.input :inter_stop_duration_max, :as => :number %> - <%= form.input :facility_stop_area_distance_max, :as => :number %> - - <%= form.input :check_lines_in_groups, :as => :boolean %> - <%= form.input :check_line_routes, :as => :boolean %> - <%= form.input :check_stop_parent, :as => :boolean %> - <%= form.input :check_connection_link_on_physical, :as => :boolean %> - <%= form.input :check_allowed_transport_modes, :as => :boolean %> - - <table class="table table-striped table-condensed"> - <thead> - <tr> - <th><%= t("transport_modes.name") %></th> - <% RuleParameterSet.mode_attribute_prefixes.each do |prefix| %> - <% if prefix == "allowed_transport" %> - <% hidden = (@rule_parameter_set.check_allowed_transport_modes == "1") ? "" : 'display:none;'%> - <th class="allowed" style="<%= hidden %>" ><%= RuleParameterSet.human_attribute_name(prefix) %></th> - <% else %> - <th><%= RuleParameterSet.human_attribute_name(prefix) %></th> - <% end %> - <% end %> - </tr> - </thead> - <tbody> - <% Chouette::Line.transport_modes.map(&:to_s).each do |mode| %> - <tr> - <%= render :partial => "mode_fields", :locals => { :f => form, :mode => mode} %> - </tr> - <% end %> - </tbody> - </table> - - <%= t("rule_parameter_sets.labels.columns_restrictions") %> - <table class="table table-bordered table-condensed"> - <% RuleParameterSet.validable_object_names.each do |object_name| %> - <thead> - <tr> - <th><%= form.check_box "check_#{object_name}".to_sym, :class => "special" %> <%= t("activerecord.models.#{object_name}.one") %></th> - <th><%= RuleParameterSet.human_attribute_name("attribute") %></th> - <th><%= RuleParameterSet.human_attribute_name("unique") %></th> - <th><%= RuleParameterSet.human_attribute_name("string_type") %></th> - <th><%= RuleParameterSet.human_attribute_name("min_size") %></th> - <th><%= RuleParameterSet.human_attribute_name("max_size") %></th> - </tr> - </thead> - <tbody> - <% RuleParameterSet.validable_columns[object_name].each do |col| %> - <tr class="<%= "columns_for_#{object_name.pluralize}" %>"> - <%= render :partial => "column_fields", :locals => { :f => form, :object_name => object_name, :column => col} %> - </tr> - <% end %> - </tbody> - <% end %> - </table> - - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<script> - $(function() { - $( "#rule_parameter_set_check_allowed_transport_modes").change( function(){ - $(".allowed").toggle(); - }); - }); -</script> diff --git a/app/views/rule_parameter_sets/_form.html.slim b/app/views/rule_parameter_sets/_form.html.slim new file mode 100644 index 000000000..74ad9ae3b --- /dev/null +++ b/app/views/rule_parameter_sets/_form.html.slim @@ -0,0 +1,72 @@ += semantic_form_for [ :organisation, @rule_parameter_set] do |form| + = form.inputs do + = form.input :name + = form.input :inter_stop_area_distance_min, as: :number + = form.input :parent_stop_area_distance_max, as: :number + = form.input :stop_areas_area + = form.input :inter_access_point_distance_min, as: :number + = form.input :inter_connection_link_distance_max, as: :number + = form.input :walk_default_speed_max, as: :number + = form.input :walk_occasional_traveller_speed_max, as: :number + = form.input :walk_frequent_traveller_speed_max, as: :number + = form.input :walk_mobility_restricted_traveller_speed_max, as: :number + + = form.input :inter_access_link_distance_max, as: :number + = form.input :inter_stop_duration_max, as: :number + = form.input :facility_stop_area_distance_max, as: :number + + = form.input :check_lines_in_groups, as: :boolean + = form.input :check_line_routes, as: :boolean + = form.input :check_stop_parent, as: :boolean + = form.input :check_connection_link_on_physical, as: :boolean + = form.input :check_allowed_transport_modes, as: :boolean + + table.table.table-striped.table-condensed + thead + tr + th = t("transport_modes.name") + + - RuleParameterSet.mode_attribute_prefixes.each do |prefix| + - if prefix == "allowed_transport" + - hidden = (@rule_parameter_set.check_allowed_transport_modes == "1") ? "" : 'display:none;' + th.allowed style="#{hidden}" + = RuleParameterSet.human_attribute_name(prefix) + - else + th = RuleParameterSet.human_attribute_name(prefix) + + tbody + - Chouette::Line.transport_modes.map(&:to_s).each do |mode| + tr + == render partial: "mode_fields", :locals => { f: form, mode: mode } + + = t("rule_parameter_sets.labels.columns_restrictions") + + table.table.table-bordered.table-condensed + - RuleParameterSet.validable_object_names.each do |object_name| + thead + tr + th + = form.check_box "check_#{object_name}".to_sym, class: 'special' + = t("activerecord.models.#{object_name}.one") + + th = RuleParameterSet.human_attribute_name("attribute") + th = RuleParameterSet.human_attribute_name("unique") + th = RuleParameterSet.human_attribute_name("string_type") + th = RuleParameterSet.human_attribute_name("min_size") + th = RuleParameterSet.human_attribute_name("max_size") + + tbody + - RuleParameterSet.validable_columns[object_name].each do |col| + tr class="columns_for_#{object_name.pluralize}" + == render partial: "column_fields", :locals => { f: form, object_name: object_name, column: col } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +javascript: + $(function() { + $( "#rule_parameter_set_check_allowed_transport_modes").change( function() { + $(".allowed").toggle(); + }); + });
\ No newline at end of file diff --git a/app/views/rule_parameter_sets/_mode_fields.html.erb b/app/views/rule_parameter_sets/_mode_fields.html.erb deleted file mode 100644 index a305c4d0a..000000000 --- a/app/views/rule_parameter_sets/_mode_fields.html.erb +++ /dev/null @@ -1,12 +0,0 @@ - <td><%= t("transport_modes.label.#{mode}") %></td> - <% RuleParameterSet.mode_attribute_prefixes.each do |prefix| %> - <% if prefix == "allowed_transport" %> - <% hidden = (@rule_parameter_set.check_allowed_transport_modes == "1") ? "" : 'display: none;'%> - <td class="allowed" style="<%= hidden %>" > - <%= f.check_box "#{prefix}_mode_#{mode}".to_sym, :class => "special" %> - <% else%> - <td> - <%= f.number_field "#{prefix}_mode_#{mode}".to_sym, :class => "special" %> - <% end %> - </td> - <% end %> diff --git a/app/views/rule_parameter_sets/_mode_fields.html.slim b/app/views/rule_parameter_sets/_mode_fields.html.slim new file mode 100644 index 000000000..848e065f3 --- /dev/null +++ b/app/views/rule_parameter_sets/_mode_fields.html.slim @@ -0,0 +1,9 @@ +td = t("transport_modes.label.#{mode}") + +- RuleParameterSet.mode_attribute_prefixes.each do |prefix| + - if prefix == "allowed_transport" + - hidden = (@rule_parameter_set.check_allowed_transport_modes == "1") ? "" : 'display: none;' + td.allowed style="#{hidden}" + = f.check_box "#{prefix}_mode_#{mode}".to_sym, class: 'special' + - else + td = f.number_field "#{prefix}_mode_#{mode}".to_sym, class: 'special'
\ No newline at end of file diff --git a/app/views/rule_parameter_sets/_mode_selection.html.erb b/app/views/rule_parameter_sets/_mode_selection.html.erb deleted file mode 100644 index 56d1c05bb..000000000 --- a/app/views/rule_parameter_sets/_mode_selection.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<select class="undescribed_modes"> - <% Chouette::TransportMode.all.map { |m| m.name.downcase}.each do |mode| %> - <option value='<%= mode %>'><%= t("transport_modes.label.#{mode}") %></option> - <% end %> -</select> - diff --git a/app/views/rule_parameter_sets/_mode_selection.html.slim b/app/views/rule_parameter_sets/_mode_selection.html.slim new file mode 100644 index 000000000..a2a8a16e5 --- /dev/null +++ b/app/views/rule_parameter_sets/_mode_selection.html.slim @@ -0,0 +1,4 @@ +select.undescribed_modes + - Chouette::TransportMode.all.map { |m| m.name.downcase}.each do |mode| + option value="#{mode}" + = t("transport_modes.label.#{mode}")
\ No newline at end of file diff --git a/app/views/rule_parameter_sets/_rule_parameter_set.html.erb b/app/views/rule_parameter_sets/_rule_parameter_set.html.erb deleted file mode 100644 index 257b8e145..000000000 --- a/app/views/rule_parameter_sets/_rule_parameter_set.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<div id="index_item" class="panel panel-default rule_parameter_set"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_organisation_rule_parameter_set_path( rule_parameter_set), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <% if rule_parameter_set.organisation.rule_parameter_sets.size > 1 %> - <%= link_to organisation_rule_parameter_set_path( rule_parameter_set), :method => :delete, :data => {:confirm => t('rule_parameter_sets.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - <% end %> - </span> - <h5> - <%= link_to( organisation_rule_parameter_set_path( rule_parameter_set), :class => "preview", :title => "#{RuleParameterSet.model_name.human.capitalize} #{rule_parameter_set.name}") do %> - <span class="name"> - <%= truncate(rule_parameter_set.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> -</div> diff --git a/app/views/rule_parameter_sets/_rule_parameter_set.html.slim b/app/views/rule_parameter_sets/_rule_parameter_set.html.slim new file mode 100644 index 000000000..5603d2b80 --- /dev/null +++ b/app/views/rule_parameter_sets/_rule_parameter_set.html.slim @@ -0,0 +1,14 @@ +#index_item.panel.panel-default.rule_parameter_set + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_organisation_rule_parameter_set_path( rule_parameter_set), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + - if rule_parameter_set.organisation.rule_parameter_sets.size > 1 + = link_to organisation_rule_parameter_set_path( rule_parameter_set), method: :delete, data: { confirm: t('rule_parameter_sets.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to( organisation_rule_parameter_set_path( rule_parameter_set), class: 'preview', title: "#{RuleParameterSet.model_name.human.capitalize} #{rule_parameter_set.name}") do + span.name = truncate(rule_parameter_set.name, length: 20)
\ No newline at end of file diff --git a/app/views/rule_parameter_sets/_transport_mode_parameter_set_fields.html.erb b/app/views/rule_parameter_sets/_transport_mode_parameter_set_fields.html.erb deleted file mode 100644 index 3d2bcd3d2..000000000 --- a/app/views/rule_parameter_sets/_transport_mode_parameter_set_fields.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<%= f.inputs :class => 'transport_mode_parameter_sets nested-fields' do %> - <%= f.input :transport_mode, :as => :select, :collection => Chouette::TransportMode.all, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") }, :label => "transport_mode", :wrapper_html => { :class => 'fl1' } %> - <%= f.input :inter_stop_area_distance_min, :as => :number, :label => "inter_stop_area_distance_min", :wrapper_html => { :class => 'fl1' } %> - <%= f.input :inter_stop_area_distance_max, :as => :number, :label => "inter_stop_area_distance_max", :wrapper_html => { :class => 'fl2' } %> - <%= f.input :speed_min, :as => :number, :label => "speed_min", :wrapper_html => { :class => 'fl2' } %> - <%= f.input :speed_max, :as => :number, :label => "speed_max", :wrapper_html => { :class => 'fl2' } %> - <%= f.input :inter_stop_duration_variation_max, :as => :number, :label => "inter_stop_duration_variation_max", :wrapper_html => { :class => 'fl2' } %> - <%= link_to_remove_association t('actions.destroy'), f %> -<% end %> - diff --git a/app/views/rule_parameter_sets/_transport_mode_parameter_set_fields.html.slim b/app/views/rule_parameter_sets/_transport_mode_parameter_set_fields.html.slim new file mode 100644 index 000000000..a60c966e2 --- /dev/null +++ b/app/views/rule_parameter_sets/_transport_mode_parameter_set_fields.html.slim @@ -0,0 +1,9 @@ += f.inputs class: 'transport_mode_parameter_sets nested-fields' do + = f.input :transport_mode, as: :select, :collection => Chouette::TransportMode.all, include_blank: false, member_label: Proc.new { |mode| t("transport_modes.label.#{mode}") }, label: "transport_mode", wrapper_html: { class: 'fl1' } + = f.input :inter_stop_area_distance_min, as: :number, label: "inter_stop_area_distance_min", wrapper_html: { class: 'fl1' } + = f.input :inter_stop_area_distance_max, as: :number, label: "inter_stop_area_distance_max", wrapper_html: { class: 'fl2' } + = f.input :speed_min, as: :number, label: "speed_min", wrapper_html: { class: 'fl2' } + = f.input :speed_max, as: :number, label: "speed_max", wrapper_html: { class: 'fl2' } + = f.input :inter_stop_duration_variation_max, as: :number, label: "inter_stop_duration_variation_max", wrapper_html: { class: 'fl2' } + + = link_to_remove_association t('actions.destroy'), f
\ No newline at end of file diff --git a/app/views/rule_parameter_sets/edit.html.erb b/app/views/rule_parameter_sets/edit.html.erb deleted file mode 100644 index eb2ca466f..000000000 --- a/app/views/rule_parameter_sets/edit.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('rule_parameter_sets.edit.title', :rule_parameter_set => @rule_parameter_set.name ) %> - -<%= render "form" %> - diff --git a/app/views/rule_parameter_sets/edit.html.slim b/app/views/rule_parameter_sets/edit.html.slim new file mode 100644 index 000000000..b49b02cf6 --- /dev/null +++ b/app/views/rule_parameter_sets/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('rule_parameter_sets.edit.title', rule_parameter_set: @rule_parameter_set.name ) + +== render 'form'
\ No newline at end of file diff --git a/app/views/rule_parameter_sets/index.html.erb b/app/views/rule_parameter_sets/index.html.erb deleted file mode 100644 index 0d091829a..000000000 --- a/app/views/rule_parameter_sets/index.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<%= title_tag t('rule_parameter_sets.index.title') %> - -<%= paginated_content(@rule_parameter_sets) %> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('rule_parameter_sets.actions.new'), new_organisation_rule_parameter_set_path, :class => "add" %></li> -</ul> -<% end %> diff --git a/app/views/rule_parameter_sets/index.html.slim b/app/views/rule_parameter_sets/index.html.slim new file mode 100644 index 000000000..6be57d68e --- /dev/null +++ b/app/views/rule_parameter_sets/index.html.slim @@ -0,0 +1,7 @@ += title_tag t('rule_parameter_sets.index.title') + += paginated_content(@rule_parameter_sets) + +- content_for :sidebar do + ul.actions + li = link_to t('rule_parameter_sets.actions.new'), new_organisation_rule_parameter_set_path, class: 'add'
\ No newline at end of file diff --git a/app/views/rule_parameter_sets/mode.js.erb b/app/views/rule_parameter_sets/mode.js.erb deleted file mode 100644 index 22b70830e..000000000 --- a/app/views/rule_parameter_sets/mode.js.erb +++ /dev/null @@ -1,13 +0,0 @@ -if ( $('#specific_parameters_<%= @mode %>').length == 0) { - <% form_content = "" %> - <% semantic_form_for [@referential, @rule_parameter_set] do |form| %> - <% form_content += render(:partial => 'mode_fields', :locals => { :mode => @mode, :f => form }) %> - <% end %> - $('#added_mode_parameter_set').before('<%= escape_javascript( form_content).html_safe %>'); -} -else { - $('#_destroy_mode_<%= @mode %>').attr( "value", false); - $('#specific_parameters_<%= @mode %>').toggle(); -} - - diff --git a/app/views/rule_parameter_sets/mode.js.slim b/app/views/rule_parameter_sets/mode.js.slim new file mode 100644 index 000000000..392446a7c --- /dev/null +++ b/app/views/rule_parameter_sets/mode.js.slim @@ -0,0 +1,9 @@ +| if ( $("#specific_parameters_#{@mode}").length == 0 ) { +| - form_content = "" +| - semantic_form_for [@referential, @rule_parameter_set] do |form| +| - form_content += render(partial: 'mode_fields', locals: { mode: @mode, f: form }) +| $('#added_mode_parameter_set').before("#{escape_javascript(form_content).html_safe}"); +| } else { +| $("#_destroy_mode_#{@mode}").attr( "value", false); +| $("#specific_parameters_#{@mode}").toggle(); +| }
\ No newline at end of file diff --git a/app/views/rule_parameter_sets/new.html.erb b/app/views/rule_parameter_sets/new.html.erb deleted file mode 100644 index 228a2da7a..000000000 --- a/app/views/rule_parameter_sets/new.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('rule_parameter_sets.new.title') %> - -<%= render "form" %> - diff --git a/app/views/rule_parameter_sets/new.html.slim b/app/views/rule_parameter_sets/new.html.slim new file mode 100644 index 000000000..c4e4c5b4d --- /dev/null +++ b/app/views/rule_parameter_sets/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('rule_parameter_sets.new.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/rule_parameter_sets/show.html.erb b/app/views/rule_parameter_sets/show.html.erb deleted file mode 100644 index 626fb295c..000000000 --- a/app/views/rule_parameter_sets/show.html.erb +++ /dev/null @@ -1,174 +0,0 @@ -<%= title_tag t('rule_parameter_sets.show.title', :rule_parameter_set => @rule_parameter_set.name ) %> - -<div class="rule_parameter_set_show"> - - <div class="summary"> - <p> - <label><%= RuleParameterSet.human_attribute_name("stop_areas_area") %>: </label> - <%= @rule_parameter_set.stop_areas_area %> - </p> - <div class="attributes_group" > - <span class="title"><%= t(".min_distance") %></span> - <div class="columns"> - <div class="two_columns"> - <label><%= t(".inter_stop_area_distance_min") %> : </label> - <span class="value"><%= @rule_parameter_set.inter_stop_area_distance_min %></span> - </div> - <div class="two_columns"> - <label><%= t(".inter_access_point_distance_min") %> : </label> - <span class="value"><%= @rule_parameter_set.inter_access_point_distance_min %></span> - </div> - </div> - </div> - <div class="attributes_group" > - <span class="title"><%= t(".max_distance") %></span> - <div class="columns"> - <div class="two_columns"> - <label><%= t(".parent_stop_area_distance_max") %>: </label> - <span class="value"><%= @rule_parameter_set.parent_stop_area_distance_max %></span> - </div> - <div class="two_columns"> - <label><%= t(".inter_connection_link_distance_max") %>: </label> - <span class="value"><%= @rule_parameter_set.inter_connection_link_distance_max %></span> - </div> - </div> - <div class="columns"> - <div class="two_columns"> - <label><%= t(".inter_access_link_distance_max") %>: </label> - <span class="value"><%= @rule_parameter_set.inter_access_link_distance_max %></span> - </div> - <div class="two_columns"> - <label><%= t(".facility_stop_area_distance_max") %>: </label> - <span class="value"><%= @rule_parameter_set.facility_stop_area_distance_max %></span> - </div> - </div> - </div> - <div class="attributes_group" > - <span class="title"><%= t(".walk_speed") %></span> - <div class="columns"> - <div class="four_columns"> - <label><%= t(".walk_default_speed_max") %>: </label> - <span class="value"><%= @rule_parameter_set.walk_default_speed_max %></span> - </div> - <div class="four_columns"> - <label><%= t(".walk_occasional_traveller_speed_max") %>: </label> - <span class="value"><%= @rule_parameter_set.walk_occasional_traveller_speed_max %></span> - </div> - <div class="four_columns"> - <label><%= t(".walk_frequent_traveller_speed_max") %>: </label> - <span class="value"><%= @rule_parameter_set.walk_frequent_traveller_speed_max %></span> - </div> - <div class="four_columns"> - <label><%= t(".walk_mobility_restricted_traveller_speed_max") %>: </label> - <span class="value"><%= @rule_parameter_set.walk_mobility_restricted_traveller_speed_max %></span> - </div> - </div> - </div> - <p> - <label><%= t(".inter_stop_duration_max") %>: </label> - <%= @rule_parameter_set.inter_stop_duration_max %> - </p> - - <p> - <label><%= RuleParameterSet.human_attribute_name("check_lines_in_groups") %>: </label> - <%= boolean_value(@rule_parameter_set.check_lines_in_groups)%> - </p> - - <p> - <label><%= RuleParameterSet.human_attribute_name("check_line_routes") %>: </label> - <%= boolean_value(@rule_parameter_set.check_line_routes) %> - </p> - - <p> - <label><%= RuleParameterSet.human_attribute_name("check_stop_parent") %>: </label> - <%= boolean_value(@rule_parameter_set.check_stop_parent) %> - </p> - - <p> - <label><%= RuleParameterSet.human_attribute_name("check_connection_link_on_physical") %>: </label> - <%= boolean_value(@rule_parameter_set.check_connection_link_on_physical) %> - </p> - - </p> - <label><%= RuleParameterSet.human_attribute_name("check_allowed_transport_modes") %>: </label> - <%= boolean_value(@rule_parameter_set.check_allowed_transport_modes) %> - </p> - - -<div class="rule_parameter_by_mode"> - <label><%= t(".rule_parameter_by_mode") %> - <%= t(".modes_allowed") if @rule_parameter_set.check_allowed_transport_modes == "1" %> - </label> - <table class="table table-striped table-condensed"> - <tr> - <th><%= t("transport_modes.name") %></th> - <% RuleParameterSet.mode_attribute_prefixes.each do |prefix| %> - <% unless prefix == "allowed_transport" %> - <th><%= RuleParameterSet.human_attribute_name(prefix) %></th> - <% end %> - <% end %> - </tr> - - <% Chouette::Line.transport_modes.map(&:to_s).each do |mode| %> - <% if @rule_parameter_set.allowed(mode) %> - <tr> - <td><%= t("transport_modes.label.#{mode}") %></td> - <% RuleParameterSet.mode_attribute_prefixes.each do |prefix| %> - - <% unless prefix == "allowed_transport" %> - <td><%= @rule_parameter_set.send "#{prefix}_mode_#{mode}" %></td> - <% end %> - <% end %> - </tr> - <% end %> - <% end %> - </table> - </div> - <div class="rule_parameter_by_object"> - <label><%= t("rule_parameter_sets.labels.columns_restrictions") %> </label> - <table class="table table-bordered table-condensed"> - <% RuleParameterSet.validable_object_names.each do |object_name| %> - <% if @rule_parameter_set.selected(object_name) %> - <thead> - <tr> - <th> <%= t("activerecord.models.#{object_name}.one") %></th> - <th><%= RuleParameterSet.human_attribute_name("attribute") %></th> - <th><%= RuleParameterSet.human_attribute_name("unique") %></th> - <th><%= RuleParameterSet.human_attribute_name("string_type") %></th> - <th><%= RuleParameterSet.human_attribute_name("min_size") %></th> - <th><%= RuleParameterSet.human_attribute_name("max_size") %></th> - </tr> - </thead> - <tbody> - <% RuleParameterSet.validable_columns[object_name].each do |col| %> - <% if @rule_parameter_set.selected_column(object_name,col)%> - <tr> - <td></td> - <td><%= t("activerecord.attributes.#{object_name}.#{col}") %></td> - <% suffix = "column_#{col}_object_#{object_name}"%> - <td><%= unique(@rule_parameter_set.send "unique_#{suffix}".to_sym) %></td> - <td><%= pattern(@rule_parameter_set.send "pattern_#{suffix}".to_sym) %></td> - <td><%= @rule_parameter_set.send "min_size_#{suffix}".to_sym %></td> - <td><%= @rule_parameter_set.send "max_size_#{suffix}".to_sym %></td> - </tr> - <% end %> - <% end %> - </tbody> - <% end %> - <% end %> - </table> - </div> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('rule_parameter_sets.actions.new'), new_organisation_rule_parameter_set_path, :class => "add" %></li> - <% if @rule_parameter_set.persisted? %> - <li><%= link_to t('rule_parameter_sets.actions.edit'), edit_organisation_rule_parameter_set_path( @rule_parameter_set), :class => "edit" %></li> - <% if current_organisation.rule_parameter_sets.size > 1 %> - <li><%= link_to t('rule_parameter_sets.actions.destroy'), organisation_rule_parameter_set_path( @rule_parameter_set), :method => :delete, :data => {:confirm => t('rule_parameter_sets.actions.destroy_confirm')}, :class => "remove" %></li> - <% end %> - <% end %> -</ul> -<% end %> diff --git a/app/views/rule_parameter_sets/show.html.slim b/app/views/rule_parameter_sets/show.html.slim new file mode 100644 index 000000000..2d54f4572 --- /dev/null +++ b/app/views/rule_parameter_sets/show.html.slim @@ -0,0 +1,143 @@ += title_tag t('rule_parameter_sets.show.title', :rule_parameter_set => @rule_parameter_set.name ) + +.rule_parameter_set_show + .summary + p + label = "#{RuleParameterSet.human_attribute_name('stop_areas_area')} : " + = @rule_parameter_set.stop_areas_area + + .attributes_group + span.title = t(".min_distance") + + .columns + .two_columns + label = "#{t('.inter_stop_area_distance_min')} : " + span.value = @rule_parameter_set.inter_stop_area_distance_min + + .two_columns + label = "#{t('.inter_access_point_distance_min')} : " + span.value = @rule_parameter_set.inter_access_point_distance_min + + .attributes_group + span.title = t(".max_distance") + + .columns + .two_columns + label = "#{t('.parent_stop_area_distance_max')} : " + span.value = @rule_parameter_set.parent_stop_area_distance_max + + .two_columns + label = "#{t('.inter_connection_link_distance_max')} : " + span.value = @rule_parameter_set.inter_connecion_link_distance_max + + .columns + .two_columns + label = "#{t('.inter_access_link_distance_max')} : " + span.value = @rule_parameter_set.inter_access_link_distance_max + + .two_columns + label = "#{t('.facility_stop_area_distance_max')} : " + span.value = @rule_parameter_set.facility_stop_area_distance_max + + .attributes_group + span.title = t(".walk_speed") + + .columns + .four_columns + label = "#{t('.walk_default_speed_max')} : " + span.value = @rule_parameter_set.walk_default_speed_max + + .four_columns + label = "#{t('.walk_occasional_traveller_speed_max')} : " + span.value = @rule_parameter_set.walk_occasional_traveller_speed_max + + .four_columns + label = "#{t('.walk_frequent_traveller_speed_max')} : " + span.value = @rule_parameter_set.walk_frequent_traveller_speed_max + + .four_columns + label = "#{t('.walk_mobility_restricted_traveller_speed_max')} : " + span.value = @rule_parameter_set.walk_mobility_restricted_traveller_speed_max + + p + label = "#{t('.inter_stop_duration_max')} :" + = @rule_parameter_set.inter_stop_duration_max + + p + label = "#{RuleParameterSet.human_attribute_name('check_lines_in_groups')} : " + = boolean_value(@rule_parameter_set.check_lines_in_groups) + + p + label = "#{RuleParameterSet.human_attribute_name('check_line_routes')} : " + = boolean_value(@rule_parameter_set.check_line_routes) + + p + label = "#{RuleParameterSet.human_attribute_name('check_stop_parent')} : " + = boolean_value(@rule_parameter_set.check_stop_parent) + + p + label = "#{RuleParameterSet.human_attribute_name('check_connection_link_on_physical')} : " + = boolean_value(@rule_parameter_set.check_connection_link_on_physical) + + p + label = "#{RuleParameterSet.human_attribute_name('check_allowed_transport_modes')} : " + = boolean_value(@rule_parameter_set.check_allowed_transport_modes) + + .rule_parameter_by_mode + label + = t(".rule_parameter_by_mode") + = t(".modes_allowed") if @rule_parameter_set.check_allowed_transport_modes == "1" + + table.table.table-striped.table-condensed + tr + th = t("transport_modes.name") + + - RuleParameterSet.mode_attribute_prefixes.each do |prefix| + - unless prefix == "allowed_transport" + th = RuleParameterSet.human_attribute_name(prefix) + + - Chouette::Line.transport_modes.map(&:to_s).each do |mode| + - if @rule_parameter_set.allowed(mode) + tr + td = t("transport_modes.label.#{mode}") + + - RuleParameterSet.mode_attribute_prefixes.each do |prefix| + - unless prefix == "allowed_transport" + td = @rule_parameter_set.send "#{prefix}_mode_#{mode}" + + .rule_parameter_by_object + label = t("rule_parameter_sets.labels.columns_restrictions") + + table.table.table-bordered.table-condensed + - RuleParameterSet.validable_object_names.each do |object_name| + - if @rule_parameter_set.selected(object_name) + thead + tr + th = t("activerecord.models.#{object_name}.one") + th = RuleParameterSet.human_attribute_name("attribute") + th = RuleParameterSet.human_attribute_name("unique") + th = RuleParameterSet.human_attribute_name("string_type") + th = RuleParameterSet.human_attribute_name("min_size") + th = RuleParameterSet.human_attribute_name("max_size") + + tbody + - RuleParameterSet.validable_columns[object_name].each do |col| + - if @rule_parameter_set.selected_column(object_name,col) + tr + td + td = t("activerecord.attributes.#{object_name}.#{col}") + - suffix = "column_#{col}_object_#{object_name}" + td = unique(@rule_parameter_set.send "unique_#{suffix}".to_sym) + td = pattern(@rule_parameter_set.send "pattern_#{suffix}".to_sym) + td = @rule_parameter_set.send "min_size_#{suffix}".to_sym + td = @rule_parameter_set.send "max_size_#{suffix}".to_sym + +- content_for :sidebar do + ul.actions + li = link_to t('rule_parameter_sets.actions.new'), new_organisation_rule_parameter_set_path, class: 'add' + + - if @rule_parameter_set.persisted? + li = link_to t('rule_parameter_sets.actions.edit'), edit_organisation_rule_parameter_set_path( @rule_parameter_set), class: 'edit' + + - if current_organisation.rule_parameter_sets.size > 1 + li = link_to t('rule_parameter_sets.actions.destroy'), organisation_rule_parameter_set_path( @rule_parameter_set), method: :delete, data: { confirm: t('rule_parameter_sets.actions.destroy_confirm') }, class: 'remove'
\ No newline at end of file diff --git a/app/views/shared/_breadcrumb.erb b/app/views/shared/_breadcrumb.erb deleted file mode 100644 index 728d445ae..000000000 --- a/app/views/shared/_breadcrumb.erb +++ /dev/null @@ -1,3 +0,0 @@ -<% if @breadcrumbs.present? %> - <%= render_breadcrumbs builder: BootstrapBreadcrumbsBuilder, :tag => :li, :separator => "" %> -<% end %> diff --git a/app/views/shared/_breadcrumb.html.slim b/app/views/shared/_breadcrumb.html.slim new file mode 100644 index 000000000..f668db52b --- /dev/null +++ b/app/views/shared/_breadcrumb.html.slim @@ -0,0 +1,2 @@ +- if @breadcrumbs.present? + = render_breadcrumbs builder: BootstrapBreadcrumbsBuilder, tag: :li, separator: ""
\ No newline at end of file diff --git a/app/views/shared/_flash_messages.erb b/app/views/shared/_flash_messages.erb deleted file mode 100644 index 871a92397..000000000 --- a/app/views/shared/_flash_messages.erb +++ /dev/null @@ -1,6 +0,0 @@ -<% flash.each do |type, message| %> - <div class="alert <%= bootstrap_class_for(type) %> fade in" role="alert"> - <button class="close" data-dismiss="alert">×</button> - <%= flash_message_for type, message %> - </div> -<% end %> diff --git a/app/views/shared/_flash_messages.html.slim b/app/views/shared/_flash_messages.html.slim new file mode 100644 index 000000000..eac1377b3 --- /dev/null +++ b/app/views/shared/_flash_messages.html.slim @@ -0,0 +1,6 @@ +- flash.each do |type, message| + div class="alert #{bootstrap_class_for(type)} fade in" role="alert" + button.close data-dismiss="alert" + |x + + = flash_message_for type, message
\ No newline at end of file diff --git a/app/views/shared/_footer.erb b/app/views/shared/_footer.erb deleted file mode 100644 index e65a45f3f..000000000 --- a/app/views/shared/_footer.erb +++ /dev/null @@ -1,20 +0,0 @@ -<div class="container"> - <div class="row"> - <div class="col-md-3 logo"> - <%= image_tag "#{ChouetteIhm::Application.config.company_name.downcase}.png" %> - </div> - <div class="col-md-3"> - <ul> - <li><h4><%= t("layouts.footer.support.title") %></h4></li> - <li> - <% if ChouetteIhm::Application.config.company_contact.include?("@") %> - <%= mail_to "#{ChouetteIhm::Application.config.company_contact}", t("layouts.footer.contact.mail") %> - <% else %> - <%= link_to t("layouts.footer.contact.mail"), "#{ChouetteIhm::Application.config.company_contact}", :target => "_blank" %> - <% end %> - </li> - <li><%= link_to t("layouts.footer.support.help"), help_path, :target => "chouette_help" %></li> - </ul> - </div> - </div> -</div> diff --git a/app/views/shared/_footer.html.slim b/app/views/shared/_footer.html.slim new file mode 100644 index 000000000..1fcf144a4 --- /dev/null +++ b/app/views/shared/_footer.html.slim @@ -0,0 +1,18 @@ +.container + .row + .col-md-3.logo + = image_tag "#{ChouetteIhm::Application.config.company_name.downcase}.png" + + .col-md-3 + ul + li + h4 = t("layouts.footer.support.title") + + li + - if ChouetteIhm::Application.config.company_contact.include?("@") + = mail_to "#{ChouetteIhm::Application.config.company_contact}", t("layouts.footer.contact.mail") + - else + = link_to t("layouts.footer.contact.mail"), "#{ChouetteIhm::Application.config.company_contact}", target: "_blank" + + li + = link_to t("layouts.footer.support.help"), help_path, target: "chouette_help"
\ No newline at end of file diff --git a/app/views/shared/_form_messages.html.erb b/app/views/shared/_form_messages.html.erb deleted file mode 100644 index 6eca2e69f..000000000 --- a/app/views/shared/_form_messages.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<% if errors.any? %> - <% errors.full_messages.each do |message| %> - <div class="alert alert-danger" role="alert"> - <%= message %> - </div> - <% end %> -<% end %> diff --git a/app/views/shared/_form_messages.html.slim b/app/views/shared/_form_messages.html.slim new file mode 100644 index 000000000..13d61f16e --- /dev/null +++ b/app/views/shared/_form_messages.html.slim @@ -0,0 +1,4 @@ +- if errors.any? + - errors.full_messages.each do |message| + div.alert.alert-danger role="alert" + = message
\ No newline at end of file diff --git a/app/views/shared/_header.erb b/app/views/shared/_header.erb deleted file mode 100644 index d06941817..000000000 --- a/app/views/shared/_header.erb +++ /dev/null @@ -1,115 +0,0 @@ -<nav class="navbar navbar-default navbar-fixed-top" role="navigation"> - <div class="container"> - <!-- Brand and toggle get grouped for better mobile display --> - <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> - <span class="sr-only">Toggle navigation</span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar version"><%= APP_VERSION %></span> - </button> - <%= link_to referentials_path, :class =>"navbar-brand" do %> - <%#= image_tag("logo_chouette.png") %> - <% end %> - <p class="navbar-text"><span class="brand_name">STIF BOIV</span><span class="version"><%= APP_VERSION %></span></p> - </div> - <!-- Collect the nav links, forms, and other content for toggling --> - <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> - <ul class="nav navbar-nav"> - <% if selected_referential? %> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown" title="<%= @referential.name %>"><%= truncate @referential.name, :length => 15 %><b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><%= link_to t("layouts.navbar.return_to_referentials"), referentials_path %></li> - <li class="divider"></li> - <li role="presentation" class="dropdown-header"><%= t("layouts.navbar.select_referential") %></li> - <% current_organisation.referentials.each do |referential| %> - <li> - <%= link_to referential.name, referential_path(referential) %> - </li> - <% end %> - </ul> - </li> - <li class="dropdown datas"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= t("layouts.navbar.referential_datas") %><b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><%= link_to t("layouts.navbar.return_to_dashboard"), referential_path(@referential) %></li> - <li class="divider"></li> - <li role="presentation" class="dropdown-header"><%= t("layouts.navbar.select_referential_datas") %></li> - <li><%= link_to referential_networks_path(@referential) do %> - <span class="badge pull-right"><%= @referential.networks.size %></span><%= Referential.human_attribute_name("networks") %> - <% end %> - </li> - <li><%= link_to referential_companies_path(@referential) do %> - <span class="badge pull-right"><%= @referential.companies.size %></span><%= Referential.human_attribute_name("companies") %> - <% end %> - </li> - <li><%= link_to referential_group_of_lines_path(@referential) do %> - <span class="badge pull-right"><%= @referential.group_of_lines.size %></span><%= Referential.human_attribute_name("group_of_lines") %> - <% end %> - </li> - <li><%= link_to referential_lines_path(@referential) do %> - <span class="badge pull-right"><%= @referential.lines.size %></span><%= Referential.human_attribute_name("lines") %> - <% end %> - </li> - <li><%= link_to referential_stop_areas_path(@referential) do %> - <span class="badge pull-right"><%= @referential.stop_areas.size %></span><%= Referential.human_attribute_name("stop_areas") %> - <% end %> - </li> - <li><%= link_to referential_connection_links_path(@referential) do %> - <span class="badge pull-right"><%= @referential.connection_links.size %></span><%= Referential.human_attribute_name("connection_links") %> - <% end %> - </li> - <li><%= link_to referential_time_tables_path(@referential) do %> - <span class="badge pull-right"><%= @referential.time_tables.size %></span><%= Referential.human_attribute_name("time_tables") %> - <% end %> - </li> - <li><%= link_to referential_route_sections_path(@referential) do %> - <span class="badge pull-right"><%= @referential.route_sections.size %></span><%= Referential.human_attribute_name("route_sections") %> - <% end %> - </li> - <li><%= link_to referential_timebands_path(@referential) do %> - <span class="badge pull-right"><%= @referential.timebands.size %></span><%= Referential.human_attribute_name("timebands") %> - <% end %> - </li> - </ul> - </li> - <li><%= link_to Referential.human_attribute_name("imports"), referential_imports_path(@referential) %></li> - <li><%= link_to Referential.human_attribute_name("exports"), referential_exports_path(@referential) %></li> - <li><%= link_to Referential.human_attribute_name("compliance_checks"), referential_compliance_checks_path(@referential) %></li> - <% end %> - </ul> - <ul class="nav navbar-nav navbar-right"> - <%- if false %> - <li class="dropdown languages"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown"> - <%= image_tag("language_engine/#{selected_language}_flag.png", { :'data-locale' => "#{selected_language}" } ) %><b class='caret'></b> - </a> - <ul class="dropdown-menu"> - <li><%= link_to_language :fr, { :class => language_class( :fr ) } %></li> - <li><%= link_to_language :en, { :class => language_class( :en ) } %></li> - </ul> - </li> - <% end %> - <li><%= link_to t('layouts.help'), help_path, :class =>("current" if help_page?), :target => "chouette_help" %></li> - <% if user_signed_in? %> - <li class="dropdown"> - <a href="#" class="dropdown-toggle user_admin" data-toggle="dropdown"><span class="gravatar"><%= user_gravatar_image_tag(current_user, 16) %></span><%= truncate(current_user.name, :length => 20) %> <b class="caret"></b></a> - <ul class="dropdown-menu"> - - <!-- FIXME ref #819 --> - <%- if false %> - <li><%= link_to t('layouts.user.profile'), edit_user_registration_path %></li> - <% end %> - - <li><%= link_to t('layouts.user.sign_out'), destroy_user_session_path, :method => :delete %></li> - <li class="divider"></li> - <li><%= tab_link_to Organisation.model_name.human, organisation_path %></li> - </ul> - </li> - <% end %> - </ul> - </div><!-- /.navbar-collapse --> - </div><!-- /.container-fluid --> -</nav> diff --git a/app/views/shared/_header.html.slim b/app/views/shared/_header.html.slim new file mode 100644 index 000000000..27b0139c2 --- /dev/null +++ b/app/views/shared/_header.html.slim @@ -0,0 +1,131 @@ +nav.navbar.navbar-default.navbar-fixed-top role="navigation" + .container + / Brand and toggle get grouped for better mobile display + .navbar-header + button.navbar-toggle type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" + span.sr-only Toggle navigation + span.icon-bar + span.icon-bar + span.icon-bar + span.icon-bar.version = APP_VERSION + + = link_to referentials_path, class: 'navbar-brand' do + / = image_tag("logo_chouette.png") + + p.navbar-text + span.brand_name = "STIF BOIV" + span.version = APP_VERSION + + / Collect the nav links, forms, and other content for toggling + #bs-example-navbar-collapse-1.collapse.navbar-collapse + ul.nav.navbar-nav + - if selected_referential? + li.dropdown + a.dropdown-toggle href="#" data-toggle="dropdown" title="#{@referential.name}" + = truncate @referential.name, length: 15 + span.caret + + ul.dropdown-menu + li + = link_to t("layouts.navbar.return_to_referentials"), referentials_path + li.divider + li.dropdown-header role="presentation" + = t("layouts.navbar.select_referential") + - current_organisation.referentials.each do |referential| + li + = link_to referential.name, referential_path(referential) + li.dropdown.datas + a.dropdown-toggle href="#" data-toggle="dropdown" + = t("layouts.navbar.referential_datas") + span.caret + + ul.dropdown-menu + li + = link_to t("layouts.navbar.return_to_dashboard"), referential_path(@referential) + li.divider + li.dropdown-header role="presentation" + = t("layouts.navbar.select_referential_datas") + + li + = link_to referential_networks_path(@referential) do + span.badge.pull-right = @referential.networks.size + = Referential.human_attribute_name("networks") + + li + = link_to referential_companies_path(@referential) do + span.badge.pull-right = @referential.companies.size + = Referential.human_attribute_name("companies") + + li + = link_to referential_group_of_lines_path(@referential) do + span.badge.pull-right = @referential.group_of_lines.size + = Referential.human_attribute_name("group_of_lines") + + li + = link_to referential_lines_path(@referential) do + span.badge.pull-right = @referential.lines.size + = Referential.human_attribute_name("lines") + + li + = link_to referential_stop_areas_path(@referential) do + span.badge.pull-right = @referential.stop_areas.size + = Referential.human_attribute_name("stop_areas") + + li + = link_to referential_connection_links_path(@referential) do + span.badge.pull-right = @referential.connection_links.size + = Referential.human_attribute_name("connection_links") + + li + = link_to referential_time_tables_path(@referential) do + span.badge.pull-right = @referential.time_tables.size + = Referential.human_attribute_name("time_tables") + + li + = link_to referential_route_sections_path(@referential) do + span.badge.pull-right = @referential.route_sections.size + = Referential.human_attribute_name("route_sections") + + li + = link_to referential_timebands_path(@referential) do + span.badge.pull-right = @referential.timebands.size + = Referential.human_attribute_name("timebands") + + li + = link_to Referential.human_attribute_name("imports"), referential_imports_path(@referential) + li + = link_to Referential.human_attribute_name("exports"), referential_exports_path(@referential) + li + = link_to Referential.human_attribute_name("compliance_checks"), referential_compliance_checks_path(@referential) + + ul.nav.navbar-nav.navbar-right + - if false + li.dropdown.languages + a.dropdown-toggle href="#" data-toggle="dropdown" + = image_tag("language_engine/#{selected_language}_flag.png", { :'data-locale' => "#{selected_language}" } ) + span.caret + + ul.dropdown-menu + li + = link_to_language :fr, { :class => language_class( :fr ) } + li + = link_to_language :en, { :class => language_class( :en ) } + + li + = link_to t('layouts.help'), help_path, :class =>("current" if help_page?), :target => "chouette_help" + + - if user_signed_in? + li.dropdown + a.dropdown-toggle.user_admin href="#" data-toggle="dropdown" + span.gravatar = user_gravatar_image_tag(current_user, 16) + = truncate(current_user.name, length: 20) + span.caret + ul.dropdown-menu + / FIXME ref #819 + - if false + li = link_to t('layouts.user.profile'), edit_user_registration_path + + li = link_to t('layouts.user.sign_out'), destroy_user_session_path, method: :delete + li.divider + li + = tab_link_to Organisation.model_name.human, organisation_path
\ No newline at end of file diff --git a/app/views/shared/_ie_report.html.erb b/app/views/shared/_ie_report.html.erb deleted file mode 100644 index 11a49879b..000000000 --- a/app/views/shared/_ie_report.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<div class="resume"> - <% if job.respond_to?(:file_path) %> - <ul class="nav nav-tabs" role="tablist"> - <li role="presentation" class="active"> - <a href="#ie_tab_line" class="ie_tab_line" aria-controls="ie_tab_line" role="tab" data-toggle="tab"> - <%=t('.tab.line')%> - </a> - </li> - <li role="presentation"> - <a href="#ie_tab_file" class="ie_tab_file" aria-controls="ie_tab_file" role="tab" data-toggle="tab"> - <%=t('.tab.file')%> - </a> - </li> - </ul> - - <div class="tab-content"> - <div role="tabpanel" class="tab-pane active" id="ie_tab_line"> - <%= render partial: 'shared/ie_report_line', locals: { job: job, line_items: line_items, type: (defined?(type) ? type : :default) } %> - </div> - <div role="tabpanel" class="tab-pane" id="ie_tab_file"> - <%= render partial: 'shared/ie_report_file', locals: { job: job } %> - </div> - </div> - <% else %> - <%= render partial: 'shared/ie_report_line', locals: { job: job, line_items: line_items, type: (defined?(type) ? type : :default) } %> - <% end %> -</div> diff --git a/app/views/shared/_ie_report.html.slim b/app/views/shared/_ie_report.html.slim new file mode 100644 index 000000000..9c197ea58 --- /dev/null +++ b/app/views/shared/_ie_report.html.slim @@ -0,0 +1,16 @@ +.resume + - if job.respond_to?(:file_path) + ul.nav.nav-tabs role="tablist" + li.active role="presentation" + a.ie_tab_line aria-controls="ie_tab_line" data-toggle="tab" href="#ie_tab_line" role="tab" + = t('.tab.line') + li role="presentation" + a.ie_tab_file aria-controls="ie_tab_file" data-toggle="tab" href="#ie_tab_file" role="tab" + = t('.tab.file') + .tab-content + #ie_tab_line.tab-pane.active role="tabpanel" + = render partial: 'shared/ie_report_line', locals: { job: job, line_items: line_items, type: (defined?(type) ? type : :default) } + #ie_tab_file.tab-pane role="tabpanel" + = render partial: 'shared/ie_report_file', locals: { job: job } + - else + = render partial: 'shared/ie_report_line', locals: { job: job, line_items: line_items, type: (defined?(type) ? type : :default) }
\ No newline at end of file diff --git a/app/views/shared/_ie_report_file.html.erb b/app/views/shared/_ie_report_file.html.erb deleted file mode 100644 index fdd97f128..000000000 --- a/app/views/shared/_ie_report_file.html.erb +++ /dev/null @@ -1,45 +0,0 @@ -<p class="lead"> -<p class="caption"><%= t(".title_default", {:job => job.class.model_name.human, :extension => job.filename_extension} ) %></p> -</p> -<div class="report results" data-refresh-interval="<%= job_refresh_interval(job) %>"> - <p> - <form class="form-inline"> - <div class="form-group"> - <label><%= t("shared.ie_report.search") %></label> - <input id="filter-file" type="text" class="form-control"> - </div> - <div class="form-group"> - <label><%= t(".table.state") %></label> - <select class="filter-file-status form-control"> - <option></option> - <option value="ok"><%=t(".table.ok")%></option> - <option value="error"><%=t(".table.error")%></option> - <option value="ignored"><%=t(".table.ignored")%></option> - </select> - </div> - </form> - </p> - <table id="table-file" class="table table-hover table-striped data-table" data-filter="#filter-file" data-page-size="20"> - <thead> - <tr> - <th class="state"><%= t(".table.state") %></th> - <th class="name"><%= t(".table.name") %></th> - <th class="error"><%= t(".table.error") %></th> - </tr> - </thead> - <tbody> - <% job.report.files.each do |file| %> - <tr class="<%= file.status == 'ERROR' ? 'danger' : nil %>"> - <td data-value="<%= file.status.downcase %>"><%= t(".table.#{file.status.downcase}") %></td> - <td><%= file.name %></td> - <td><%= file.errors.map{|e| "#{e.code} : #{e.description}"}.join(' | ') if file.errors.present? %></td> - </tr> - <% end %> - </tbody> - <tfoot> - <tr> - <td colspan="5"><ul class="pagination pagination-centered"></ul></td> - </tr> - </tfoot> - </table> -</div> diff --git a/app/views/shared/_ie_report_file.html.slim b/app/views/shared/_ie_report_file.html.slim new file mode 100644 index 000000000..b0cd0b427 --- /dev/null +++ b/app/views/shared/_ie_report_file.html.slim @@ -0,0 +1,34 @@ +p.lead + p.caption = t('.title_default', job=job.class.model_name.human extension=job.filename_extension ) + +.report.results data-refresh-interval="#{job_refresh_interval(job)}" + p + form.form-inline + .form-group + label= t('shared.ie_report.search') + input#filter-file.form-control type="text" + .form-group + label= t('.table.state') + select.filter-file-status.form-control + option + option value="ok" = t('.table.ok') + option value="error" = t('.table.error') + option value="ignored" = t('.table.ignored') + + table#table-file.table.table-hover.table-striped.data-table data-filter="#filter-file" data-page-size="20" + thead + tr + th.state = t('.table.state') + th.name = t('.table.name') + th.error = t('.table.error') + tbody + - job.report.files.each do |file| + tr class=("#{file.status == 'ERROR' ? 'danger' : nil}") + td data-value="#{file.status.downcase}" + = t(".table.#{file.status.downcase}") + td = file.name + td = file.errors.map |e| "#{e.code} : #{e.description}" .join(' | ') if file.errors.present? + tfoot + tr + td colspan="5" + ul.pagination.pagination-centered
\ No newline at end of file diff --git a/app/views/shared/_ie_report_line.html.erb b/app/views/shared/_ie_report_line.html.erb deleted file mode 100644 index 2f5332e5b..000000000 --- a/app/views/shared/_ie_report_line.html.erb +++ /dev/null @@ -1,71 +0,0 @@ -<p class='lead'> - <dl class="inline"> - <dt><%=t('.read_lines') %> :</dt> - <dd><%= job.report.lines %></dd> - <dt><%=t('.saved_lines') %> :</dt> - <dd><%= job.report.saved_lines %></dd> - <dt><%=t('.unsaved_lines') %> :</dt> - <dd><%= job.report.unsaved_lines %></dd> - </dl> -</p> -<div class="report" data-refresh-interval="<%= job_refresh_interval(job) %>"> - <p> - <form class="form-inline"> - <div class="form-group"> - <label><%= t("shared.ie_report.search") %></label> - <input id="filter-line" type="text" class="form-control"> - </div> - <div class="form-group"> - <label><%= t(".table.line.state") %></label> - <select class="filter-line-status form-control"> - <option></option> - <option value="true"><%=t(".state.#{type}.valid") %></option> - <option value="false"><%=t(".state.#{type}.invalid") %></option> - </select> - </div> - </form> - </p> - <table class="table table-hover table-striped data-table toggle-circle toggle-medium" data-filter="#filter-line" id="table-line" data-page-size="20"<% if line_items.respond_to?(:total_pages) %> data-no-pagination="true"<% end %>> - <thead> - <tr> - <th><%= t(".table.line.state") %></th> - <th><%= t(".table.line.lines") %></th> - <th data-toggle="true" data-sort-ignore="true"><%= t(".table.line.details") %></th> - <th data-hide="all"><%= t(".table.line.routes") %></th> - <th data-hide="all"><%= t(".table.line.connection_links") %></th> - <th data-hide="all"><%= t(".table.line.time_tables") %></th> - <th data-hide="all"><%= t(".table.line.stop_areas") %></th> - <th data-hide="all"><%= t(".table.line.access_points") %></th> - <th data-hide="all"><%= t(".table.line.vehicle_journeys") %></th> - <th data-hide="all"><%= t(".table.line.journey_patterns") %></th> - </tr> - </thead> - <tbody> - <% line_items.each_with_index do |line_item, index| %> - <tr> - <td data-value="<%=line_item.status%>"><%= line_item.status ? font_awesome_classic_tag("fa-check") : font_awesome_classic_tag("fa-times") %></td> - <td><%= line_item.name %></td> - <td></td> - <td><%= line_item.routes %></td> - <td><%= line_item.connection_links %></td> - <td><%= line_item.time_tables %></td> - <td><%= line_item.stop_areas %></td> - <td><%= line_item.access_points %></td> - <td><%= line_item.vehicle_journeys %></td> - <td><%= line_item.journey_patterns %></td> - </tr> - <% end %> - </tbody> - <tfoot> - <tr> - <td colspan="10"> - <% if line_items.respond_to?(:total_pages) %> - <%= will_paginate line_items, renderer: BootstrapPagination::Rails %> - <% else %> - <ul class="pagination pagination-centered hide-if-no-paging"></ul> - <% end %> - </td> - </tr> - </tfoot> - </table> -</div> diff --git a/app/views/shared/_ie_report_line.html.slim b/app/views/shared/_ie_report_line.html.slim new file mode 100644 index 000000000..c2a24f1e4 --- /dev/null +++ b/app/views/shared/_ie_report_line.html.slim @@ -0,0 +1,61 @@ +p.lead + dl.inline + dt = "#{t('.read_lines')} :" + dd = job.report.lines + dt = "#{t('.saved_lines')} :" + dd = job.report.saved_lines + dt = "#{t('.unsaved_lines')} :" + dd = job.report.unsaved_lines + +.report data-refresh-interval="#{job_refresh_interval(job)}" + p + form.form-inline + .form-group + label = t('shared.ie_report.search') + input#filter-line.form-control type="text" + + .form-group + label= t('.table.line.state') + select.filter-line-status.form-control + option + option value="true" = t(".state.#{type}.valid") + option value="false" = t(".state.#{type}.invalid") + + table#table-line.table.table-hover.table-striped.data-table.toggle-circle.toggle-medium data-filter="#filter-line" data-page-size="20" data-no-pagination=('true' if line_items.respond_to?(:total_pages) ) + thead + tr + th = t('.table.line.state') + th = t('.table.line.lines') + th data-sort-ignore="true" data-toggle="true" + = t('.table.line.details') + th data-hide="all" = t('.table.line.routes') + th data-hide="all" = t('.table.line.connection_links') + th data-hide="all" = t('.table.line.time_tables') + th data-hide="all" = t('.table.line.stop_areas') + th data-hide="all" = t('.table.line.access_points') + th data-hide="all" = t('.table.line.vehicle_journeys') + th data-hide="all" = t('.table.line.journey_patterns') + + tbody + - line_items.each_with_index do |line_item, index| + tr + td data-value="#{line_item.status}" + = line_item.status ? font_awesome_classic_tag(fa-check) : font_awesome_classic_tag(fa-times) + + td = line_item.name + td + td = line_item.routes + td = line_item.connection_links + td = line_item.time_tables + td = line_item.stop_areas + td = line_item.access_points + td = line_item.vehicle_journeys + td = line_item.journey_patterns + + tfoot + tr + td colspan="10" + - if line_items.respond_to?(:total_pages) + = will_paginate line_items, renderer: BootstrapPagination::Rails + - else + ul.pagination.pagination-centered.hide-if-no-paging
\ No newline at end of file diff --git a/app/views/stop_area_copies/new.html.erb b/app/views/stop_area_copies/new.html.erb deleted file mode 100644 index 5edc005cc..000000000 --- a/app/views/stop_area_copies/new.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<%= title_tag t("stop_area_copies.new.title."+@stop_area_copy.hierarchy) %> - -<%= semantic_form_for [@referential, @stop_area, @stop_area_copy] do |form| %> - <br> - <%= form.inputs do %> - <%= form.input :source_id, :as => :hidden %> - <%= form.input :hierarchy, :as => :hidden %> - <% if @stop_area_copy.hierarchy == "child"%> - <% if @stop_area.area_type.underscore == "stop_place"%> - <%= form.input :area_type, :as => :select, :collection => ["stop_place","commercial_stop_point"], :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %> - <% else%> - <%= form.input :area_type, :as => :select, :collection => ["boarding_position","quay"], :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %> - <% end %> - <% else %> - <%= form.input :area_type, :as => :select, :collection => [@stop_area_copy.area_type], :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %> - <% end %> - <% end %> - <%= form.actions do %> - <%= form.action :submit, :as => :button , :label => t( 'formtastic.duplicate' ) %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> diff --git a/app/views/stop_area_copies/new.html.slim b/app/views/stop_area_copies/new.html.slim new file mode 100644 index 000000000..a4c0c8bde --- /dev/null +++ b/app/views/stop_area_copies/new.html.slim @@ -0,0 +1,20 @@ += title_tag t("stop_area_copies.new.title."+@stop_area_copy.hierarchy) + += semantic_form_for [@referential, @stop_area, @stop_area_copy] do |form| + br + = form.inputs do + = form.input :source_id, as: :hidden + = form.input :hierarchy, as: :hidden + + - if @stop_area_copy.hierarchy == "child" + - if @stop_area.area_type.underscore == "stop_place" + = form.input :area_type, as: :select, :collection => ["stop_place","commercial_stop_point"], :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } + - else + = form.input :area_type, as: :select, :collection => ["boarding_position","quay"], :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } + + - else + = form.input :area_type, as: :select, :collection => [@stop_area_copy.area_type], :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } + + = form.actions do + = form.action :submit, as: :button , label: t('formtastic.duplicate') + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/stop_area_referentials/show.html.erb b/app/views/stop_area_referentials/show.html.erb deleted file mode 100644 index aa198bcce..000000000 --- a/app/views/stop_area_referentials/show.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<!-- FIXME #820 --> -<%= title_tag "Référentiel d'arrêts #{@stop_area_referential.name}" %> - -<div class="summary"> -</div> - -<div class="panel panel-default"> - <ul class="list-group" width="75%"> - <li class="list-group-item"> - <span class="badge"><%= @stop_area_referential.stop_areas.size %></span> - <%= link_to Referential.human_attribute_name("stop_areas"), stop_area_referential_stop_areas_path(@stop_area_referential) %> - </li> - </ul> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim new file mode 100644 index 000000000..658004dcc --- /dev/null +++ b/app/views/stop_area_referentials/show.html.slim @@ -0,0 +1,13 @@ +/ FIXME #820 += title_tag "Référentiel d'arrêts #{@stop_area_referential.name}" + +.summary + +.panel.panel-default + ul.list-group width="75%" + li.list-group-item + span.badge = @stop_area_referential.stop_areas.size + = link_to Referential.human_attribute_name("stop_areas"), stop_area_referential_stop_areas_path(@stop_area_referential) + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb deleted file mode 100644 index b0152297d..000000000 --- a/app/views/stop_areas/_form.html.erb +++ /dev/null @@ -1,160 +0,0 @@ -<%= semantic_form_for [@stop_area_referential, @stop_area] do |form| %> - <div class="row"> - <div class="container-fluid"> - <% if !manage_itl && @map %> - <%= @map.to_html %> - <% end %> - <%= form.inputs do %> - <%= form.input :id, :as => :hidden %> - <%= form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")} %> - <%= form.input :stop_area_type, :as => :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %> - <div class="location_info"> - <h3><%= t("stop_areas.stop_area.localisation") %></h3> - <div id="prefetch"> - <label><%= t('.geolocalize') %></label> - <input class="typeahead form-control input-lg" maxlength="255" type="text" placeholder="<%= t('.address') %>" /> - </div> - <% unless @stop_area.projection.blank? or @stop_area.projection_type_label.empty? %> - <%= form.input :projection_xy, :label => t("projection_xy", :projection => @referential.projection_type_label), :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.projection_xy")} %> - <% end %> - <%= form.input :coordinates, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.coordinates")} %> - <%= form.input :street_name %> - <%= form.input :country_code, required: format_restriction_for_locales(@referential) == '.hub' %> - <%= form.input :zip_code, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.zip_code")} %> - <%= form.input :city_name, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.city_name")} %> - </div> - <% end %> - </div> - </div> - <div class="stop_areas.stop_area.general_info"> - <h3><%= t("stop_area.general") %></h3> - <%= form.inputs do %> - <%= form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.objectid")} %> - <%= form.input :registration_number, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.registration_number")} %> - <%= form.input :fare_code, :as => :number %> - <%= form.input :nearest_topic_name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.nearest_topic_name")} %> - <%= form.input :comment, :as => :text, :input_html => { :rows => 5, :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.comment") } %> - <%= form.input :time_zone, :include_blank => true %> - <%= form.input :url %> - <% end %> - </div> - <div class="pmr_info"> - <h3><%= t("stop_areas.stop_area.accessibility") %></h3> - <%= form.inputs do %> - <% if !manage_itl %> - <%= form.input :mobility_restricted_suitability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <%= form.input :stairs_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <%= form.input :lift_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %> - <% end %> - <% end %> - </div> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<script> - $(document).ready(function() { - var address_display = function( address ) { - var name = ""; - if ( address.house_number) { - name += address.house_number+" "; - } - name += address.road+", "; - if ( address.suburb) { - name += address.suburb+", "; - } - if ( address.postcode) { - name += address.postcode+" "; - } - if ( address.city) { - name += address.city; - } else if ( address.village) { - name += address.village; - } else if ( address.town) { - name += address.town; - } else if ( address.county ) { - name += address.county; - } else if ( address.country ) { - name += address.country; - } - - - return name; - }; - var filtering = function(list) { - // update map view - removeAddress(); - - var selection = $.grep( list, function(item) { - return (item.type == "house" || item.type == "residential" || - item.type == "tertiary" || item.type == "primary" || - item.type == "secondary") && item.address.road ; - }); - return $.map( selection, function( d) { - var city = ""; - if ( d.address.city) { - city = d.address.city; - } else if ( d.address.town) { - city = d.address.town; - } else if ( d.address.village) { - city = d.address.village; - } - return { postcode: d.address.postcode, - road: d.address.road, - lon: d.lon, lat: d.lat, - suburb: d.address.suburb, - city: city, - postcode: d.address.postcode, - the_key: address_display( d.address)}; - }); - }; - - var addressesEngine = new Bloodhound({ - datumTokenizer: function(d) { - return Bloodhound.tokenizers.whitespace(d.id+" : "+d.road); - }, - queryTokenizer: function(d) { - return Bloodhound.tokenizers.whitespace(d.id+" :: "+d.road); - }, - limit: 10, - remote: { - url: 'http://nominatim.openstreetmap.org/search?q=%QUERY&format=json&addressdetails=1&bounded=1&viewbox='+ - // FIXME #821 - '<%#= @stop_area_referential.viewbox_left_top_right_bottom %>', - filter: filtering, - } - }); - - // kicks off the loading/processing of `local` and `prefetch` - var promise = addressesEngine.initialize(); - - // passing in `null` for the `options` arguments will result in the default - // options being used - $('#prefetch .typeahead').typeahead( - { - hint: true, - highlight: true, - minLength: 1 - }, - { - name: 'addresses', - displayKey: 'the_key', - source: addressesEngine.ttAdapter(), - } - ); - - $('.typeahead').on('typeahead:selected', function($e, datum) { - // update map view - addAddress( datum.lon, datum.lat, datum.road); - // update form fields - <% if @stop_area.new_record? %> - $('input[name="stop_area[street_name]"]').val(datum.road); - $('input[name="stop_area[zip_code]"]').val(datum.postcode); - $('input[name="stop_area[city_name]"]').val(datum.city); - <% end %> - }) - }); -</script> diff --git a/app/views/stop_areas/_form.html.slim b/app/views/stop_areas/_form.html.slim new file mode 100644 index 000000000..355f4dc83 --- /dev/null +++ b/app/views/stop_areas/_form.html.slim @@ -0,0 +1,153 @@ += semantic_form_for [@stop_area_referential, @stop_area] do |form| + .row + .container-fluid + - if !manage_itl && @map + = @map.to_html + + = form.inputs do + = form.input :id, as: :hidden + = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")} + = form.input :stop_area_type, as: :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } + + .location_info + h3 = t("stop_areas.stop_area.localisation") + + #prefetch + label = t('.geolocalize') + input.typeahead.form-control.input-lg maxlength="255" type="text" placeholder="#{t('.address')}" + + - unless @stop_area.projection.blank? or @stop_area.projection_type_label.empty? + = form.input :projection_xy, :label => t("activerecord.attributes.stop_area.projection_xy", :projection => @referential.projection_type_label), :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.projection_xy")} + + = form.input :coordinates, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.coordinates")} + = form.input :street_name + = form.input :country_code, required: format_restriction_for_locales(@referential) == '.hub' + = form.input :zip_code, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.zip_code")} + = form.input :city_name, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.city_name")} + + .stop_areas.stop_area.general_info + h3 = t("stop_areas.stop_area.general") + + = form.inputs do + = form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.objectid")} + = form.input :registration_number, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.registration_number")} + = form.input :fare_code, as: :number + = form.input :nearest_topic_name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.nearest_topic_name")} + = form.input :comment, as: :text, :input_html => { :rows => 5, :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.comment") } + = form.input :time_zone, :include_blank => true + = form.input :url + + .pmr_info + h3 = t("stop_areas.stop_area.accessibility") + = form.inputs do + - if !manage_itl + = form.input :mobility_restricted_suitability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true + = form.input :stairs_availability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true + = form.input :lift_availability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +javascript: + $(document).ready(function() { + var address_display = function( address ) { + var name = ""; + if ( address.house_number) { + name += address.house_number+" "; + } + name += address.road+", "; + if ( address.suburb) { + name += address.suburb+", "; + } + if ( address.postcode) { + name += address.postcode+" "; + } + if ( address.city) { + name += address.city; + } else if ( address.village) { + name += address.village; + } else if ( address.town) { + name += address.town; + } else if ( address.county ) { + name += address.county; + } else if ( address.country ) { + name += address.country; + } + + + return name; + }; + var filtering = function(list) { + // update map view + removeAddress(); + + var selection = $.grep( list, function(item) { + return (item.type == "house" || item.type == "residential" || + item.type == "tertiary" || item.type == "primary" || + item.type == "secondary") && item.address.road ; + }); + return $.map( selection, function( d) { + var city = ""; + if ( d.address.city) { + city = d.address.city; + } else if ( d.address.town) { + city = d.address.town; + } else if ( d.address.village) { + city = d.address.village; + } + return { postcode: d.address.postcode, + road: d.address.road, + lon: d.lon, lat: d.lat, + suburb: d.address.suburb, + city: city, + postcode: d.address.postcode, + the_key: address_display( d.address)}; + }); + }; + + var addressesEngine = new Bloodhound({ + datumTokenizer: function(d) { + return Bloodhound.tokenizers.whitespace(d.id+" : "+d.road); + }, + queryTokenizer: function(d) { + return Bloodhound.tokenizers.whitespace(d.id+" :: "+d.road); + }, + limit: 10, + remote: { + url: 'http://nominatim.openstreetmap.org/search?q=%QUERY&format=json&addressdetails=1&bounded=1&viewbox='+ + // FIXME #821 + //= @stop_area_referential.viewbox_left_top_right_bottom + filter: filtering, + } + }); + + // kicks off the loading/processing of `local` and `prefetch` + var promise = addressesEngine.initialize(); + + // passing in `null` for the `options` arguments will result in the default + // options being used + $('#prefetch .typeahead').typeahead( + { + hint: true, + highlight: true, + minLength: 1 + }, + { + name: 'addresses', + displayKey: 'the_key', + source: addressesEngine.ttAdapter(), + } + ); + + $('.typeahead').on('typeahead:selected', function($e, datum) { + // update map view + addAddress( datum.lon, datum.lat, datum.road); + // update form fields + <% if @stop_area.new_record? %> + $('input[name="stop_area[street_name]"]').val(datum.road); + $('input[name="stop_area[zip_code]"]').val(datum.postcode); + $('input[name="stop_area[city_name]"]').val(datum.city); + <% end %> + }) + });
\ No newline at end of file diff --git a/app/views/stop_areas/_genealogical.html.erb b/app/views/stop_areas/_genealogical.html.erb deleted file mode 100644 index a76b972e2..000000000 --- a/app/views/stop_areas/_genealogical.html.erb +++ /dev/null @@ -1,66 +0,0 @@ - <h3><%= genealogical_title %></h3> - - <% if @stop_area.parent.present? %> - <div class="parent"> - <%= link_to([@referential, @stop_area.parent], :title => t("area_types.label.#{ @stop_area.parent.stop_area_type}") + " #{ @stop_area.parent.name}") do %> - <%= image_tag "map/" + @stop_area.parent.stop_area_type + ".png" %><span><%= @stop_area.parent.name %></span> - <% end %> - </div> - <div class="link"><%= image_tag "icons/link.png"%></div> - <% elsif @stop_area.routing_lines.present? %> - <div class="lines"> - <% @stop_area.routing_lines.each do |line| %> - <div class="line"> - <%= link_to([@referential, line]) do %> - <span><%= line.name %></span> - <% end %> - </div> - <% end %> - </div> - <div class="link"><%= image_tag "icons/link.png"%></div> - <% else %> - <div class="no_parent"> </div> - <% end %> - - <div class="target"> - <%= image_tag "map/" + @stop_area.stop_area_type + ".png"%><span><%= @stop_area.name %></span> - </div> - - <% if @stop_area.children.present? %> - <div class="link"><%= image_tag "icons/link.png"%></div> - <div class="children"> - <% @stop_area.children.each do |child| %> - <div class="child"> - <%= link_to([@referential, child], :title => t("area_types.label.#{ child.stop_area_type}") + " #{ child.name}") do %> - <%= image_tag "map/" + child.stop_area_type + ".png" %><span><%= child.name %></span> - <% end %> - </div> - <% end %> - </div> - <% elsif @stop_area.routing_stops.present? %> - <div class="link"><%= image_tag "icons/link.png"%></div> - <div class="children"> - <% @stop_area.routing_stops.each do |stop| %> - <div class="child"> - <%= link_to([@referential, stop], :title => t("area_types.label.#{ stop.stop_area_type}") + " #{ stop.name}") do %> - <%= image_tag "map/" + stop.stop_area_type + ".png" %><span><%= "#{stop.name} #{' [' + stop.registration_number + ']' if stop.registration_number.present? }" %></span> - <% end %> - </div> - <% end %> - </div> - <% elsif @stop_area.routes.present? %> - <div class="link"><%= image_tag "icons/link.png"%></div> - <div class="children"> - <% @stop_area.routes.each do |route| %> - <div class="child"> - <%= link_to([@referential, route.line ]) do %> - <span><%= route.line.number %></span> - <% end %> - - <%= link_to([@referential, route.line , route]) do %> - <span><%= route.name %></span> - <% end %> - </div> - <% end %> - </div> - <% end %> diff --git a/app/views/stop_areas/_genealogical.html.slim b/app/views/stop_areas/_genealogical.html.slim new file mode 100644 index 000000000..c70106a17 --- /dev/null +++ b/app/views/stop_areas/_genealogical.html.slim @@ -0,0 +1,54 @@ +h3 = genealogical_title + +- if @stop_area.parent.present? + .parent + = link_to([@referential, @stop_area.parent], title: t("area_types.label.#{ @stop_area.parent.stop_area_type}") + " #{ @stop_area.parent.name}") do + = image_tag "map/" + @stop_area.parent.stop_area_type + ".png" + span = @stop_area.parent.name + + .link = image_tag "icons/link.png" + +- elsif @stop_area.routing_lines.present? + .lines + - @stop_area.routing_lines.each do |line| + .line + = link_to([@referential, line]) do + span = line.name + + .link = image_tag "icons/link.png" + +- else + .no_parent + +.target + = image_tag "map/" + @stop_area.stop_area_type + ".png" + span = @stop_area.name + +- if @stop_area.children.present? + .link = image_tag "icons/link.png" + .children + - @stop_area.children.each do |child| + .child + = link_to([@referential, child], :title => t("area_types.label.#{ child.stop_area_type}") + " #{ child.name}") do + = image_tag "map/" + child.stop_area_type + ".png" + span = child.name + +- elsif @stop_area.routing_stops.present? + .link = image_tag "icons/link.png" + .children + - @stop_area.routing_stops.each do |stop| + .child + = link_to([@referential, stop], :title => t("area_types.label.#{ stop.stop_area_type}") + " #{ stop.name}") do + = image_tag "map/" + stop.stop_area_type + ".png" + span = "#{stop.name} #{' [' + stop.registration_number + ']' if stop.registration_number.present? }" + +- elsif @stop_area.routes.present? + .link = image_tag "icons/link.png" + .children + - @stop_area.routes.each do |route| + .child + = link_to([@referential, route.line ]) do + span = route.line.number + + = link_to([@referential, route.line , route]) do + span = route.name
\ No newline at end of file diff --git a/app/views/stop_areas/_stop_area.html.erb b/app/views/stop_areas/_stop_area.html.erb deleted file mode 100644 index 4a6a632a5..000000000 --- a/app/views/stop_areas/_stop_area.html.erb +++ /dev/null @@ -1,53 +0,0 @@ -<div id="index_item" class="panel panel-default stop_area"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_stop_area_referential_stop_area_path(@stop_area_referential, stop_area), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to stop_area_referential_stop_area_path(@stop_area_referential, stop_area), :method => :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@stop_area_referential, stop_area], :class => "preview", :title => t("area_types.label.#{stop_area.stop_area_type}") + " #{stop_area.name}") do %> - <span class="name"> - <%= image_tag "map/" + stop_area.stop_area_type + ".png" %> <%= truncate(stop_area.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <% unless stop_area.area_type == 'ITL' || stop_area.geometry %> - <span class="warning"><%= t('.no_position') %></span> - <% end %> - </p> - <p> - <%= stop_area.human_attribute_name('registration_number') %> : <%= stop_area.registration_number.present? ? stop_area.registration_number : t(".no_object") %> - </p> - <p> - <%= t('.address') %> : <%= (stop_area.zip_code.present? || stop_area.city_name.present?) ? "#{stop_area.zip_code} #{stop_area.city_name}" : t(".no_object") %> - </p> - <p> - <% if stop_area.area_type == 'ITL' %> - <%= t('.lines') %> : <% if stop_area.routing_lines.blank? %> - <%= t(".no_object") %> - <% else %> - <% stop_area.routing_lines.each do |line| %> - <span class="label label-default line"><%= line.number %></span> - <% end %> - <% end %> - <% else %> - <%= t('.lines') %> : <% if stop_area.lines.blank? %> - <%= t(".no_object") %> - <% else %> - <% stop_area.lines.each do |line| %> - <span class="label label-default line"><%= line.number || truncate( line.name, :length => 4 ) %></span> - <% end %> - <% end %> - <% end %> - </p> - </div> -</div> diff --git a/app/views/stop_areas/_stop_area.html.slim b/app/views/stop_areas/_stop_area.html.slim new file mode 100644 index 000000000..0265e554a --- /dev/null +++ b/app/views/stop_areas/_stop_area.html.slim @@ -0,0 +1,45 @@ +#index_item.panel.panel-default.stop_area + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_stop_area_referential_stop_area_path(@stop_area_referential, stop_area), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + = link_to stop_area_referential_stop_area_path(@stop_area_referential, stop_area), method: :delete, :data => { :confirm => t('stop_areas.actions.destroy_confirm') }, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to([@stop_area_referential, stop_area], class: 'preview', :title => t("area_types.label.#{stop_area.stop_area_type}") + " #{stop_area.name}") do + span.name + = image_tag "map/" + stop_area.stop_area_type + ".png" + = truncate(stop_area.name, :length => 20) + + .panel-body + p + - unless stop_area.area_type == 'ITL' || stop_area.geometry + span.warning = t('.no_position') + + p + = "#{stop_area.human_attribute_name('registration_number')} : " + = stop_area.registration_number.present? ? stop_area.registration_number : t(".no_object") + + p + = "#{t('.address')} : " + = (stop_area.zip_code.present? || stop_area.city_name.present?) ? "#{stop_area.zip_code} #{stop_area.city_name}" : t(".no_object") + + p + - if stop_area.area_type == 'ITL' + = "#{t('.lines')} : " + - if stop_area.routing_lines.blank? + = t(".no_object") + - else + - stop_area.routing_lines.each do |line| + span.label.label-default.line = line.number + + - else + = "#{t('.lines')} : " + - if stop_area.lines.blank? + = t(".no_object") + - else + - stop_area.lines.each do |line| + span.label.label-default.line = line.number || truncate( line.name, length: 4 )
\ No newline at end of file diff --git a/app/views/stop_areas/_stop_areas.html.erb b/app/views/stop_areas/_stop_areas.html.erb deleted file mode 100644 index 9c7a82d6d..000000000 --- a/app/views/stop_areas/_stop_areas.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @stop_areas %> -</div> -<div class="stop_areas paginated_content"> - <%= paginated_content(@stop_areas) %> -</div> -<div class="pagination"> - <%= will_paginate @stop_areas, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/stop_areas/_stop_areas.html.slim b/app/views/stop_areas/_stop_areas.html.slim new file mode 100644 index 000000000..e05bab1bc --- /dev/null +++ b/app/views/stop_areas/_stop_areas.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t("will_paginate.page_entries_info.search") + = page_entries_info @stop_areas + +.stop_areas.paginated_content + = paginated_content(@stop_areas) + +.pagination + = will_paginate @stop_areas, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/stop_areas/access_links.html.erb b/app/views/stop_areas/access_links.html.erb deleted file mode 100644 index 3cea2fbdd..000000000 --- a/app/views/stop_areas/access_links.html.erb +++ /dev/null @@ -1,46 +0,0 @@ -<%= title_tag t('stop_areas.access_links.title', :stop_area => @stop_area.name ) %> - -<div class="stop_area_show"> - -<div class="panel-group" id="generic"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#generic" href="#generic_access_links"> - <%= t('.generic_access_links') %> - </a> - </h4> - </div> - <div id="generic_access_links" class="panel-collapse collapse in"> - <div class="panel-body"> - <div class="access_link_pairs"> - <table> - <%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@generic_access_links) %> - </table> - </div> - </div> - </div> - </div> -</div> - -<div class="panel-group" id="detail"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#detail" href="#detail_access_links"> - <%= t('.detail_access_links') %> - </a> - </h4> - </div> - <div id="detail_access_links" class="panel-collapse collapse"> - <div class="panel-body"> - <div class="access_link_pairs"> - <table> - <%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@detail_access_links) %> - </table> - </div> - </div> - </div> - </div> -</div> - diff --git a/app/views/stop_areas/access_links.html.slim b/app/views/stop_areas/access_links.html.slim new file mode 100644 index 000000000..f51400f71 --- /dev/null +++ b/app/views/stop_areas/access_links.html.slim @@ -0,0 +1,28 @@ += title_tag t('stop_areas.access_links.title', stop_area: @stop_area.name ) + +.stop_area_show + #generic.panel-group + .panel.panel-default + .panel-heading + h4.panel-title + a data-toggle="collapse" data-parent="#generic" href="#generic_access_links" + = t('.generic_access_links') + + #generic_access_links.panel-collapse.collapse.in + .panel-body + .access_link_pairs + table + == render partial: 'access_link_pairs/access_link_pair', collection: access_links_pairs(@generic_access_links) + + #detail.panel-group + .panel.panel-default + .panel-heading + h4.panel-title + a data-toggle="collapse" data-parent="#detail" href="#detail_access_links" + = t('.detail_access_links') + + #detail_access_links.panel-collapse.collapse + .panel-body + .access_link_pairs + table + == render partial: 'access_link_pairs/access_link_pair', collection: access_links_pairs(@detail_access_links)
\ No newline at end of file diff --git a/app/views/stop_areas/add_children.html.erb b/app/views/stop_areas/add_children.html.erb deleted file mode 100644 index 4d30ba674..000000000 --- a/app/views/stop_areas/add_children.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= title_tag t('stop_areas.add_children.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :children_ids, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?relation=children&target_type=#{@stop_area.area_type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @children, :view_path => 'app/views', :format => :json, :scope => self ).render } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/stop_areas/add_children.html.slim b/app/views/stop_areas/add_children.html.slim new file mode 100644 index 000000000..cd7727b82 --- /dev/null +++ b/app/views/stop_areas/add_children.html.slim @@ -0,0 +1,13 @@ += title_tag t('stop_areas.add_children.title', stop_area: @stop_area.name ) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :children_ids, as: :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?relation=children&target_type=#{@stop_area.area_type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @children, :view_path => 'app/views', format: :json, :scope => self ).render } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/stop_areas/add_routing_lines.html.erb b/app/views/stop_areas/add_routing_lines.html.erb deleted file mode 100644 index 84d03f8b2..000000000 --- a/app/views/stop_areas/add_routing_lines.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -<%= title_tag t('stop_areas.add_routing_lines.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :routing_line_ids, :as => :text, :input_html => { :"data-pre" => ( @lines.map { |line| { :id => line.id.to_s, :name => "#{line.number} - #{line.name}" } } ).to_json } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<script> - $(function() { - $( "#stop_area_routing_line_ids" ).tokenInput('<%= referential_stop_area_stop_area_routing_lines_path(@referential, @stop_area, :format => :json) %>', { - crossDomain: false, - prePopulate: $('#stop_area_routing_line_id').data('pre'), - minChars: 1, - hintText: '<%= t('search_hint') %>', - noResultsText: '<%= t('no_result_text') %>', - searchingText: '<%= t('searching_term') %>' - }); - }); -</script> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/stop_areas/add_routing_lines.html.slim b/app/views/stop_areas/add_routing_lines.html.slim new file mode 100644 index 000000000..2ed11750f --- /dev/null +++ b/app/views/stop_areas/add_routing_lines.html.slim @@ -0,0 +1,25 @@ += title_tag t('stop_areas.add_routing_lines.title', stop_area: @stop_area.name ) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :routing_line_ids, as: :text, input_html: { :"data-pre" => ( @lines.map { |line| { id: line.id.to_s, name: "#{line.number} - #{line.name}" } } ).to_json } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +javascript: + $(function() { + $( "#stop_area_routing_line_ids" ).tokenInput("#{referential_stop_area_stop_area_routing_lines_path(@referential, @stop_area, format: :json)}", { + crossDomain: false, + prePopulate: $('#stop_area_routing_line_id').data('pre'), + minChars: 1, + hintText: "#{I18n.t('search_hint')}", + noResultsText: "#{I18n.t('no_result_text')}", + searchingText: "#{I18n.t('searching_term')}" + }); + }); + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/stop_areas/add_routing_stops.html.erb b/app/views/stop_areas/add_routing_stops.html.erb deleted file mode 100644 index 310e2f8b0..000000000 --- a/app/views/stop_areas/add_routing_stops.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= title_tag t('stop_areas.add_routing_stops.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :routing_stop_ids, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=itl_excluded", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @stop_area.routing_stops, :view_path => 'app/views', :format => :json, :scope => self).render } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/stop_areas/add_routing_stops.html.slim b/app/views/stop_areas/add_routing_stops.html.slim new file mode 100644 index 000000000..349fe6550 --- /dev/null +++ b/app/views/stop_areas/add_routing_stops.html.slim @@ -0,0 +1,13 @@ += title_tag t('stop_areas.add_routing_stops.title', stop_area: @stop_area.name ) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :routing_stop_ids, as: :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=itl_excluded", hint_text: t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), input_html: { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @stop_area.routing_stops, :view_path => 'app/views', format: :json, :scope => self).render } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/stop_areas/edit.html.erb b/app/views/stop_areas/edit.html.erb deleted file mode 100644 index 10d937050..000000000 --- a/app/views/stop_areas/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('stop_areas.edit.title', :stop_area => @stop_area.name ) %> - -<%= render "form" %> diff --git a/app/views/stop_areas/edit.html.slim b/app/views/stop_areas/edit.html.slim new file mode 100644 index 000000000..170b6bd20 --- /dev/null +++ b/app/views/stop_areas/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('stop_areas.edit.title', stop_area: @stop_area.name ) + +== render 'form'
\ No newline at end of file diff --git a/app/views/stop_areas/index.html.erb b/app/views/stop_areas/index.html.erb deleted file mode 100644 index 9f6f04599..000000000 --- a/app/views/stop_areas/index.html.erb +++ /dev/null @@ -1,38 +0,0 @@ -<%= title_tag t('stop_areas.index.title') %> - -<div id="country_codes"> - <%= @country_codes.to_json %> -</div> - -<%= search_form_for @q, :url => stop_area_referential_stop_areas_path(@stop_area_referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <div class="input-group col-md-9"> - <%= f.text_field :name_cont, :placeholder => "#{t('.name')}", :class => 'form-control' %> - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div><!-- /input-group --> - <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> - <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> - </a> - </div> - - <div id="advanced_search" class="panel-collapse collapse"> - <div class="panel-body"> - <%= f.text_field :zip_code_cont, :placeholder => "#{t('.zip_code')}", :class => 'form-control typeahead' %> - <%= f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { :include_blank => "#{t('.area_type')}" }, { :class => 'form-control' }) %> - </div> - </div> -</div> -<% end %> - -<div id="stop_areas"><%= render 'stop_areas' %></div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('stop_areas.actions.new'), new_stop_area_referential_stop_area_path(@stop_area_referential), :class => "add" %></li> - <li><%#= link_to t('stop_areas.actions.default_geometry'), default_geometry_referential_stop_areas_path(@stop_area_referential), :method => :put, :class => "calculator" %></li> -</ul> - -<% end %> diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim new file mode 100644 index 000000000..6a01bdcb3 --- /dev/null +++ b/app/views/stop_areas/index.html.slim @@ -0,0 +1,32 @@ += title_tag t('stop_areas.index.title') + +#country_codes + = @country_codes.to_json + += search_form_for @q, url: stop_area_referential_stop_areas_path(@stop_area_referential), remote: true, html: { method: :get, class: "form-inline", id: "search", role: "form"} do |f| + .panel.panel-default + .panel-heading + .input-group.col-md-9 + = f.text_field :name_cont, placeholder: "#{t('.name')}", class: 'form-control' + + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + a data-toggle="collapse" data-parent="#search" href="#advanced_search" + i.fa.fa-plus + = "#{t('.advanced_search')}" + + #advanced_search.panel-collapse.collapse + .panel-body + = f.text_field :zip_code_cont, placeholder: "#{t('.zip_code')}", class: 'form-control typeahead' + = f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { :include_blank => "#{t('.area_type')}" }, { :class => 'form-control' }) + +#stop_areas + == render 'stop_areas' + +- content_for :sidebar do + ul.actions + li = link_to t('stop_areas.actions.new'), new_stop_area_referential_stop_area_path(@stop_area_referential), class: 'add' + li + / = link_to t('stop_areas.actions.default_geometry'), default_geometry_referential_stop_areas_path(@stop_area_referential), :method => :put, :class => "calculator"
\ No newline at end of file diff --git a/app/views/stop_areas/index.js.erb b/app/views/stop_areas/index.js.erb deleted file mode 100644 index 1621823cc..000000000 --- a/app/views/stop_areas/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#stop_areas').html('<%= escape_javascript(render("stop_areas")) %>');
\ No newline at end of file diff --git a/app/views/stop_areas/index.js.slim b/app/views/stop_areas/index.js.slim new file mode 100644 index 000000000..322feb105 --- /dev/null +++ b/app/views/stop_areas/index.js.slim @@ -0,0 +1 @@ +| $('#stop_areas').html("#{escape_javascript(render('stop_areas'))}");
\ No newline at end of file diff --git a/app/views/stop_areas/index.kml.erb b/app/views/stop_areas/index.kml.erb deleted file mode 100644 index f43f130b6..000000000 --- a/app/views/stop_areas/index.kml.erb +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% @stop_areas.where("latitude is not null and longitude is not null").each do |stop_area| %> - <Placemark id="<%= stop_area.id %>" > - <name><%= stop_area.name %></name> - <stop_area_type><%= stop_area.stop_area_type %></stop_area_type> - <stop_area_type_label><%= t("area_types.label.#{stop_area.stop_area_type}") %></stop_area_type_label> - <%= stop_area.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> diff --git a/app/views/stop_areas/index.kml.slim b/app/views/stop_areas/index.kml.slim new file mode 100644 index 000000000..d067c7e9f --- /dev/null +++ b/app/views/stop_areas/index.kml.slim @@ -0,0 +1,10 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + documentd + - @stop_areas.where("latitude is not null and longitude is not null").each do |stop_area| + placemark id="#{stop_area.id}" + name = stop_area.name + stop_area_type = stop_area.stop_area_type + stop_area_type_label = t("area_types.label.#{stop_area.stop_area_type}") + = stop_area.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/stop_areas/new.html.erb b/app/views/stop_areas/new.html.erb deleted file mode 100644 index 9fcf4390e..000000000 --- a/app/views/stop_areas/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('stop_areas.new.title') %> - -<%= render "form" %> diff --git a/app/views/stop_areas/new.html.slim b/app/views/stop_areas/new.html.slim new file mode 100644 index 000000000..bdbd97571 --- /dev/null +++ b/app/views/stop_areas/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('stop_areas.new.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/stop_areas/select_parent.html.erb b/app/views/stop_areas/select_parent.html.erb deleted file mode 100644 index 3f550d370..000000000 --- a/app/views/stop_areas/select_parent.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= title_tag t('stop_areas.select_parent.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :parent_id, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?relation=parent&target_type=#{@stop_area.area_type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'), :searching_text => t('searching_term'), :tokenLimit => 1, :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', [@parent].compact, :view_path => 'app/views', :format => :json, :scope => self ).render } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/stop_areas/select_parent.html.slim b/app/views/stop_areas/select_parent.html.slim new file mode 100644 index 000000000..1289eafef --- /dev/null +++ b/app/views/stop_areas/select_parent.html.slim @@ -0,0 +1,13 @@ += title_tag t('stop_areas.select_parent.title', stop_area: @stop_area.name ) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :parent_id, as: :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?relation=parent&target_type=#{@stop_area.area_type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'), :searching_text => t('searching_term'), :tokenLimit => 1, :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', [@parent].compact, :view_path => 'app/views', format: :json, scope: self ).render } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/stop_areas/show.html.erb b/app/views/stop_areas/show.html.erb deleted file mode 100644 index bcc7435f3..000000000 --- a/app/views/stop_areas/show.html.erb +++ /dev/null @@ -1,177 +0,0 @@ -<%= title_tag t('stop_areas.show.title', :stop_area => @stop_area.name ) %> - -<div class="stop_area_show"> - <% if show_map? %> - <%= @map.to_html %> - <% end %> - <div class="summary"> - <p> - <label><%= @stop_area.human_attribute_name("comment") %>: </label> - <%= @stop_area.comment %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("nearest_topic_name") %>: </label> - <%= @stop_area.nearest_topic_name %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("street_name") %>: </label> - <%= @stop_area.street_name %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("country_code") %>: </label> - <%= @stop_area.country_code %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("zip_code") %>: </label> - <%= @stop_area.zip_code %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("city_name") %>: </label> - <%= @stop_area.city_name %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("fare_code") %>: </label> - <%= @stop_area.fare_code %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("time_zone") %>: </label> - <%= @stop_area.time_zone %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("url") %>: </label> - <%= @stop_area.url %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("registration_number") %>: </label> - <%= @stop_area.registration_number %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("stop_area_type") %>: </label> - <%= t("area_types.label.#{@stop_area.stop_area_type}") %> - <i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="<%= t('.not_editable') %>"></i> - </p> - <% if !manage_itl %> - <p> - <label><%= @stop_area.human_attribute_name("mobility_restricted_suitability") %>: </label> - <% if (!@stop_area.mobility_restricted_suitability.nil?) %> - <%= t((@stop_area.mobility_restricted_suitability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("stairs_availability") %>: </label> - <% if (!@stop_area.stairs_availability.nil?) %> - <%= t((@stop_area.stairs_availability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("lift_availability") %>: </label> - <% if (!@stop_area.lift_availability.nil?) %> - <%= t((@stop_area.lift_availability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> <label><%= t('stop_areas.show.geographic_data') %> </label></p> - <% if @stop_area.long_lat_type == nil %> - <span class='geo_data'><%= t('stop_areas.show.no_geographic_data') %></span> - <% else %> - <% if !@stop_area.projection.nil? %> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("projection") %>: </span> - <%= @stop_area_referential.projection_type_label %> - </p> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("projection_x") %>: </span> - <%= @stop_area.projection_x %> - </p> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("projection_y") %>: </span> - <%= @stop_area.projection_y %> - </p> - <% end %> - <% if !@stop_area.long_lat_type.nil? %> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("long_lat_type") %>: </span> - <%= @stop_area.long_lat_type %> - </p> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("longitude") %>: </span> - <%= @stop_area.longitude %> - </p> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("latitude") %>: </span> - <%= @stop_area.latitude %> - </p> - <% end %> - <% end %> - <% end %> - </div> -</div> -<p class="after_map" /> - -<div class="genealogical clearfix"> - <%= render "stop_areas/genealogical" %> -</div> - -<% if manage_access_points %> -<div> - <h3><%= t('.access_points') %></h3> - - <div class="access_points paginated_content"> - <!-- FIXME #821 --> - <%= paginated_content @access_points, "access_points/access_point" %> - </div> -</div> -<% end %> - -<% content_for :sidebar do %> - <table> - <tr><td> - <ul class="actions"> - <li><%= link_to t('stop_areas.actions.new'), new_stop_area_referential_stop_area_path(@stop_area_referential), :class => "add" %></li> - <li><%= link_to t('stop_areas.actions.edit'), edit_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), :class => "edit" %></li> - <li><%= link_to t('stop_areas.actions.destroy'), stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), :method => :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, :class => "remove" %></li> - </ul> - </td></tr> - <% if manage_itl %> - <tr><td> - <h4><%= t(".itl_managment") %></h4> - <ul class="actions"> - <li><%= link_to t('stop_areas.actions.add_routing_lines'), add_routing_lines_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), :class => "add_routing_lines" %></li> - <li><%= link_to t('stop_areas.actions.add_routing_stops'), add_routing_stops_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), :class => "add_routing_stops" %></li> - </ul> - </td></tr> - <% else %> - <tr><td> - <h4><%= t(".stop_managment") %></h4> - <ul class="actions"> - <li><%#= link_to t('stop_areas.actions.select_parent'), select_parent_referential_stop_area_path(@referential, @stop_area), :class => "parent" %></li> - <% if @stop_area.parent == nil %> - <li><%#= link_to t('stop_areas.actions.clone_as_parent'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, :hierarchy => "parent"), :class => "clone" %></li> - <% end %> - <% if manage_children %> - <li><%#= link_to t('stop_areas.actions.add_children'), add_children_referential_stop_area_path(@referential, @stop_area), :class => "children" %></li> - <li><%#= link_to t('stop_areas.actions.clone_as_child'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, :hierarchy => "child"), :class => "clone" %></li> - <% end %> - </ul> - </td></tr> - - <% if manage_access_points %> - <tr><td> - <h4><%= t(".access_managment") %></h4> - <ul class="actions"> - <li><%#= link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), :class => "add" %></li> - <li><%#= link_to t('stop_areas.actions.manage_access_links'), access_links_referential_stop_area_path(@referential,@stop_area), :class => "access_link" %></li> - </ul> - </td></tr> - <% end %> - - <% end %> - </table> - <br> - <%= creation_tag(@stop_area) %> -<% end %> diff --git a/app/views/stop_areas/show.html.slim b/app/views/stop_areas/show.html.slim new file mode 100644 index 000000000..249e29a57 --- /dev/null +++ b/app/views/stop_areas/show.html.slim @@ -0,0 +1,165 @@ += title_tag t('stop_areas.show.title', stop_area: @stop_area.name) + +.stop_area_show + = @map.to_html if show_map? + + .summary + p + label = "#{@stop_area.human_attribute_name('comment')} : " + = @stop_area.comment + + p + label = "#{@stop_area.human_attribute_name('nearest_topic_name')} : " + = @stop_area.nearest_topic_name + + p + label = "#{@stop_area.human_attribute_name('street_name')} : " + = @stop_area.street_name + + p + label = "#{@stop_area.human_attribute_name('country_code')} : " + = @stop_area.country_code + + p + label = "#{@stop_area.human_attribute_name('zip_code')} : " + = @stop_area.zip_code + + p + label = "#{@stop_area.human_attribute_name('city_name')} : " + = @stop_area.city_name + + p + label = "#{@stop_area.human_attribute_name('fare_code')} : " + = @stop_area.fare_code + + p + label = "#{@stop_area.human_attribute_name('time_zone')} : " + = @stop_area.time_zone + + p + label = "#{@stop_area.human_attribute_name('url')} : " + = @stop_area.url + + p + label = "#{@stop_area.human_attribute_name('registration_number')} : " + = @stop_area.registration_number + + p + label = "#{@stop_area.human_attribute_name('stop_area_type')} : " + = t("area_types.label.#{@stop_area.stop_area_type}") + i.fa.fa-info-circle data-toggle="tooltip" data-placement="right" title="#{t('.not_editable')}" + + - if !manage_itl + p + label = "#{@stop_area.human_attribute_name('mobility_restricted_suitability')} : " + - if !@stop_area.mobility_restricted_suitability.nil? + = t((@stop_area.mobility_restricted_suitability == true).to_s) + - else + = t("unknown") + + p + label = "#{@stop_area.human_attribute_name('stairs_availability')} : " + - if !@stop_area.stairs_availability.nil? + = t((@stop_area.stairs_availability == true).to_s) + - else + = t("unknown") + + p + label = "#{@stop_area.human_attribute_name('lift_availability')} : " + - if !@stop_area.lift_availability.nil? + = t((@stop_area.lift_availability == true).to_s) + - else + = t("unknown") + + p + label = t('stop_areas.show.geographic_data') + + - if @stop_area.long_lat_type == nil + span.geo_data = t('stop_areas.show.no_geographic_data') + - else + - if !@stop_area.projection.nil? + p + span.geo_data = "#{@stop_area.human_attribute_name('projection')} : " + = @stop_area_referential.projection_type_label + + p + span.geo_data = "#{@stop_area.human_attribute_name('projection_x')} : " + = @stop_area.projection_x + + p + span.geo_data = "#{@stop_area.human_attribute_name('projection_y')} : " + = @stop_area.projection_y + + - if !@stop_area.long_lat_type.nil? + p + span.geo_data = "#{@stop_area.human_attribute_name('long_lat_type')} : " + = @stop_area.long_lat_type + + p + span.geo_data = "#{@stop_area.human_attribute_name('longitude')} : " + = @stop_area.longitude + + p + span.geo_data = "#{@stop_area.human_attribute_name('latitude')} : " + = @stop_area.latitude + +p.after_map + +.genealogical.clearfix + == render 'stop_areas/genealogical' + +- if manage_access_points + div + h3 = t('.access_points') + + .access_points.paginated_content + / FIXME #821 + = paginated_content @access_points, "access_points/access_point" + +- content_for :sidebar do + table + tr + td + ul.actions + li = link_to t('stop_areas.actions.new'), new_stop_area_referential_stop_area_path(@stop_area_referential), class: 'add' + li = link_to t('stop_areas.actions.edit'), edit_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'edit' + li = link_to t('stop_areas.actions.destroy'), stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), method: :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, class: 'remove' + + - if manage_itl + tr + td + h4 = t(".itl_managment") + ul.actions + li = link_to t('stop_areas.actions.add_routing_lines'), add_routing_lines_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'add_routing_lines' + li = link_to t('stop_areas.actions.add_routing_stops'), add_routing_stops_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'add_routing_stops' + + - else + tr + td + h4 = t(".stop_managment") + ul.actions + li + / = link_to t('stop_areas.actions.select_parent'), select_parent_referential_stop_area_path(@referential, @stop_area), :class => "parent" + - if @stop_area.parent == nil + li + / = link_to t('stop_areas.actions.clone_as_parent'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, :hierarchy => "parent"), :class => "clone" + + - if manage_children + li + / = link_to t('stop_areas.actions.add_children'), add_children_referential_stop_area_path(@referential, @stop_area), :class => "children" + li + / = link_to t('stop_areas.actions.clone_as_child'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, :hierarchy => "child"), :class => "clone" + + - if manage_access_points + tr + td + h4 = t(".access_managment") + ul.actions + li + / = link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), :class => "add" + li + / = link_to t('stop_areas.actions.manage_access_links'), access_links_referential_stop_area_path(@referential,@stop_area), :class => "access_link" + + br + + = creation_tag(@stop_area)
\ No newline at end of file diff --git a/app/views/stop_areas/show.kml.erb b/app/views/stop_areas/show.kml.erb deleted file mode 100644 index 39a764bd6..000000000 --- a/app/views/stop_areas/show.kml.erb +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% if !params["children"].nil? %> - <% @stop_area.children.each do |child| %> - <Placemark id="<%= child.id %>" > - <name><%= child.name %></name> - <stop_area_type><%= child.stop_area_type %></stop_area_type> - <%= (child.position or child.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - <% elsif !params["routing"].nil? %> - <% @stop_area.routing_stops.each do |child| %> - <Placemark id="<%= child.id %>" > - <name><%= child.name %></name> - <stop_area_type><%= child.stop_area_type %></stop_area_type> - <%= (child.position or child.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - <% else %> - <Placemark id="<%= @stop_area.id %>" > - <name><%= @stop_area.name %></name> - <stop_area_type><%= @stop_area.stop_area_type %></stop_area_type> - <%= (@stop_area.position or @stop_area.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> diff --git a/app/views/stop_areas/show.kml.slim b/app/views/stop_areas/show.kml.slim new file mode 100644 index 000000000..7b1399dc5 --- /dev/null +++ b/app/views/stop_areas/show.kml.slim @@ -0,0 +1,23 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - if !params["children"].nil? + - @stop_area.children.each do |child| + placemark id="#{child.id}" + name = child.name + stop_area_type = child.stop_area_type + = (child.position or child.default_position).kml_representation.html_safe + + - elsif !params["routing"].nil? + - @stop_area.routing_stops.each do |child| + placemark id="#{child.id}" + name = child.name + stop_area_type = child.stop_area_type + = (child.position or child.default_position).kml_representation.html_safe + + - else + placemark id="#{@stop_area.id}" + name = @stop_area.name + stop_area_type = @stop_area.stop_area_type + = (@stop_area.position or @stop_area.default_position).kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/stop_points/_stop_point.html.erb b/app/views/stop_points/_stop_point.html.erb deleted file mode 100644 index 3e0163a62..000000000 --- a/app/views/stop_points/_stop_point.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -<div id="index_item" class="panel panel-default stop_point"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <h5> - <%= link_to([@referential, stop_point.stop_area], :class => "preview", :title => "#{Chouette::StopArea.model_name.human.capitalize} #{stop_point.stop_area.name}") do %> - <span class="name"> - <span class="label label-primary"><%= stop_point.position + 1 %></span><%= image_tag "map/" + stop_point.stop_area.stop_area_type + ".png" %> <%= truncate(stop_point.stop_area.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <% unless stop_point.stop_area.geometry %> - <span class="warning"><%= t('.no_position') %></span> - - <% end %> - </p> - <p> - <%= stop_point.stop_area.human_attribute_name('registration_number') %> : <%= stop_point.stop_area.registration_number.present? ? stop_point.stop_area.registration_number : t(".no_object") %> - </p> - <p> - <%= t('.address') %> : <%= (stop_point.stop_area.zip_code.present? || stop_point.stop_area.city_name.present?) ? "#{stop_point.stop_area.zip_code} #{stop_point.stop_area.city_name}" : t(".no_object") %> - </p> - <p> - <%= t('.lines') %> <% if stop_point.stop_area.lines.blank? %> - <%= t(".no_object") %> - <% else %> - <% stop_point.stop_area.lines.each do |line| %> - <span class="label label-default line"><%= line.number || truncate( line.name, :length => 4 ) %></span> - <% end %> - <% end %> - </p> - </div> -</div> - diff --git a/app/views/stop_points/_stop_point.html.slim b/app/views/stop_points/_stop_point.html.slim new file mode 100644 index 000000000..ca86e339a --- /dev/null +++ b/app/views/stop_points/_stop_point.html.slim @@ -0,0 +1,30 @@ +#index_item.panel.panel-default.stop_point + .panel-heading + .panel-title.clearfix + h5 + = link_to [@referential, stop_point.stop_area], class: "preview", title: "#{Chouette::StopArea.model_name.human.capitalize} #{stop_point.stop_area.name}" do + span.name + span.label.label-primary = stop_point.position + 1 + = image_tag "map/" + stop_point.stop_area.stop_area_type + ".png" + = truncate(stop_point.stop_area.name, length: 20) + + .panel-body + p + - unless stop_point.stop_area.geometry + span.warning = t('.no_position') + + p + = "#{stop_point.stop_area.human_attribute_name('registration_number')} : " + = stop_point.stop_area.registration_number.present? ? stop_point.stop_area.registration_number : t(".no_object") + + p + = "#{t('.address')} : " + = (stop_point.stop_area.zip_code.present? || stop_point.stop_area.city_name.present?) ? "#{stop_point.stop_area.zip_code} #{stop_point.stop_area.city_name}" : t(".no_object") + + p + = t('.lines') + - if stop_point.stop_area.lines.blank? + = t(".no_object") + - else + - stop_point.stop_area.lines.each do |line| + span.label.label-default.line = line.number || truncate( line.name, length: 4 )
\ No newline at end of file diff --git a/app/views/time_table_combinations/_combine.html.erb b/app/views/time_table_combinations/_combine.html.erb deleted file mode 100644 index 27b5f056f..000000000 --- a/app/views/time_table_combinations/_combine.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<div id="modal_combine" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> - <h4 class="modal-title" id="myModalLabel"><%= t('time_tables.show.combine_form') %></h4> - </div> - <%= render "time_table_combinations/combine_form" %> - </div> - </div> - -</div> diff --git a/app/views/time_table_combinations/_combine.html.slim b/app/views/time_table_combinations/_combine.html.slim new file mode 100644 index 000000000..a2e9a9c6e --- /dev/null +++ b/app/views/time_table_combinations/_combine.html.slim @@ -0,0 +1,12 @@ +#modal_combine.modal.fade tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" + .modal-dialog + .modal-content + .modal-header + button.close type="button" data-dismiss="modal" + span aria-hidden="true" × + span.sr-only Close + + h4.modal-title id="myModalLabel" + = t('time_tables.show.combine_form') + + == render "time_table_combinations/combine_form"
\ No newline at end of file diff --git a/app/views/time_table_combinations/_combine_form.html.erb b/app/views/time_table_combinations/_combine_form.html.erb deleted file mode 100644 index dd9cd9b92..000000000 --- a/app/views/time_table_combinations/_combine_form.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<%= semantic_form_for [@referential, @time_table, @time_table_combination], :remote => true do |form| %> - <div class="modal-body"> - <%= render "shared/flash_messages" %> - <%= form.inputs do %> - <%= form.input :operation, :as => :radio, :collection => Hash[TimeTableCombination.operations.map {|b| [t( b, :scope => "time_table_combinations.operations"),b]}] %> - <%= form.input :combined_id, :label => t('.time_tables'), :as => :search_time_table, :json => referential_autocomplete_time_tables_path(@referential, :format => :json), :hint_text => t('search_hint'), :no_result_text => t('no_result_text'), :searching_text => t('searching_term'), :tokenLimit => 1 %> - <% end %> - </div> - <div class="modal-footer"> - <%= form.actions do %> - <%= form.action :submit, :as => :button , :label => t('time_tables.show.combine') %> - <% end %> - </div> -<% end %> diff --git a/app/views/time_table_combinations/_combine_form.html.slim b/app/views/time_table_combinations/_combine_form.html.slim new file mode 100644 index 000000000..2367cd4af --- /dev/null +++ b/app/views/time_table_combinations/_combine_form.html.slim @@ -0,0 +1,11 @@ += semantic_form_for [@referential, @time_table, @time_table_combination], :remote => true do |form| + .modal-body + == render "shared/flash_messages" + + = form.inputs do + = form.input :operation, as: :radio, :collection => Hash[TimeTableCombination.operations.map {|b| [t( b, :scope => "time_table_combinations.operations"),b]}] + = form.input :combined_id, :label => t('.time_tables'), as: :search_time_table, :json => referential_autocomplete_time_tables_path(@referential, :format => :json), :hint_text => t('search_hint'), :no_result_text => t('no_result_text'), :searching_text => t('searching_term'), :tokenLimit => 1 + + .modal-footer + = form.actions do + = form.action :submit, as: :button , :label => t('time_tables.show.combine')
\ No newline at end of file diff --git a/app/views/time_table_combinations/create_failure.js.erb b/app/views/time_table_combinations/create_failure.js.erb deleted file mode 100644 index 65cc241c5..000000000 --- a/app/views/time_table_combinations/create_failure.js.erb +++ /dev/null @@ -1,5 +0,0 @@ - -var combine_form_partial = '<%= j render "time_table_combinations/combine_form" %> '; - -$('#new_time_table_combination').replaceWith(combine_form_partial); - diff --git a/app/views/time_table_combinations/create_failure.js.slim b/app/views/time_table_combinations/create_failure.js.slim new file mode 100644 index 000000000..c5b544483 --- /dev/null +++ b/app/views/time_table_combinations/create_failure.js.slim @@ -0,0 +1,3 @@ +| var combine_form_partial = "#{j render 'time_table_combinations/combine_form'}"; + +| $('#new_time_table_combination').replaceWith(combine_form_partial);
\ No newline at end of file diff --git a/app/views/time_table_combinations/create_success.js.erb b/app/views/time_table_combinations/create_success.js.erb deleted file mode 100644 index 79ab543d9..000000000 --- a/app/views/time_table_combinations/create_success.js.erb +++ /dev/null @@ -1,8 +0,0 @@ - -var combine_form_partial = '<%= j render "time_table_combinations/combine_form" %> '; - -$('#new_time_table_combination').replaceWith(combine_form_partial); - -var time_table_partial = '<%= j render "time_tables/show_time_table" %> '; -$('#time_table_show').replaceWith(time_table_partial); - diff --git a/app/views/time_table_combinations/create_success.js.slim b/app/views/time_table_combinations/create_success.js.slim new file mode 100644 index 000000000..f18eea4bc --- /dev/null +++ b/app/views/time_table_combinations/create_success.js.slim @@ -0,0 +1,6 @@ +| var combine_form_partial = "#{j render 'time_table_combinations/combine_form'}"; + +| $('#new_time_table_combination').replaceWith(combine_form_partial); + +| var time_table_partial = "#{j render 'time_tables/show_time_table'}"; +| $('#time_table_show').replaceWith(time_table_partial);
\ No newline at end of file diff --git a/app/views/time_table_combinations/new.js.erb b/app/views/time_table_combinations/new.js.erb deleted file mode 100644 index ea98d9aaf..000000000 --- a/app/views/time_table_combinations/new.js.erb +++ /dev/null @@ -1,4 +0,0 @@ -var combine_form_partial = '<%= j render "time_table_combinations/combine_form" %> '; -$('#new_time_table_combination').replaceWith(combine_form_partial); - - diff --git a/app/views/time_table_combinations/new.js.slim b/app/views/time_table_combinations/new.js.slim new file mode 100644 index 000000000..749ec04f6 --- /dev/null +++ b/app/views/time_table_combinations/new.js.slim @@ -0,0 +1,2 @@ +| var combine_form_partial = "#{j render 'time_table_combinations/combine_form'}"; +| $('#new_time_table_combination').replaceWith(combine_form_partial);
\ No newline at end of file diff --git a/app/views/time_tables/_date_fields.erb b/app/views/time_tables/_date_fields.erb deleted file mode 100644 index 2702e8e52..000000000 --- a/app/views/time_tables/_date_fields.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= f.inputs :class => 'nested-fields date' do %> - <%= f.label @time_table.human_attribute_name("date"), :class => 'col-md-1' %> - <%= f.input :date, :as => :date_picker, :label => false, :input_html => { :class => 'form-control col-md-3' }%> - <%= f.input :in_out, :as => :hidden, :input_html => {:value => true} %> - <%= link_to_remove_association t('actions.destroy'), f, :class => "col-md-3" %> -<% end %> diff --git a/app/views/time_tables/_date_fields.html.slim b/app/views/time_tables/_date_fields.html.slim new file mode 100644 index 000000000..f17fcaa2c --- /dev/null +++ b/app/views/time_tables/_date_fields.html.slim @@ -0,0 +1,5 @@ += f.inputs class: 'nested-fields date' do + = f.label @time_table.human_attribute_name("date"), class: 'col-md-1' + = f.input :date, as: :date_picker, :label => false, :input_html => { class: 'form-control col-md-3' } + = f.input :in_out, as: :hidden, :input_html => {:value => true} + = link_to_remove_association t('actions.destroy'), f, class: "col-md-3"
\ No newline at end of file diff --git a/app/views/time_tables/_dates.html.erb b/app/views/time_tables/_dates.html.erb deleted file mode 100644 index c6af6ee8c..000000000 --- a/app/views/time_tables/_dates.html.erb +++ /dev/null @@ -1,7 +0,0 @@ - <ul class='dates'> - <% @time_table.dates.where("in_out = true").to_a.each do |tmd| %> - <li class="<%= (tmd.position%2==0) ? 'odd' : 'even' %>"><%= l tmd.date %> - </li> - <% end %> - </ul> - diff --git a/app/views/time_tables/_dates.html.slim b/app/views/time_tables/_dates.html.slim new file mode 100644 index 000000000..0e625b9e5 --- /dev/null +++ b/app/views/time_tables/_dates.html.slim @@ -0,0 +1,4 @@ +ul.dates + - @time_table.dates.where("in_out = true").to_a.each do |tmd| + li class="#{(tmd.position%2==0) ? 'odd' : 'even'}" + = l tmd.date
\ No newline at end of file diff --git a/app/views/time_tables/_excluded_date_fields.erb b/app/views/time_tables/_excluded_date_fields.erb deleted file mode 100644 index 2302cb711..000000000 --- a/app/views/time_tables/_excluded_date_fields.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= f.inputs :class => 'nested-fields date' do %> - <%= f.label @time_table.human_attribute_name("date"), :class => 'col-md-1' %> - <%= f.input :date, :as => :date_picker, :label => false, :input_html => { :class => 'form-control col-md-3' } %> - <%= f.input :in_out, :as => :hidden, :input_html => {:value => false} %> - <%= link_to_remove_association t('actions.destroy'), f, :class => "col-md-3" %> -<% end %> diff --git a/app/views/time_tables/_excluded_date_fields.html.slim b/app/views/time_tables/_excluded_date_fields.html.slim new file mode 100644 index 000000000..294d103fc --- /dev/null +++ b/app/views/time_tables/_excluded_date_fields.html.slim @@ -0,0 +1,5 @@ += f.inputs class: 'nested-fields date' do + = f.label @time_table.human_attribute_name("date"), class: 'col-md-1' + = f.input :date, as: :date_picker, :label => false, :input_html => { class: 'form-control col-md-3' } + = f.input :in_out, as: :hidden, :input_html => {:value => false} + = link_to_remove_association t('actions.destroy'), f, class: "col-md-3"
\ No newline at end of file diff --git a/app/views/time_tables/_excluded_dates.html.erb b/app/views/time_tables/_excluded_dates.html.erb deleted file mode 100644 index 8097c618f..000000000 --- a/app/views/time_tables/_excluded_dates.html.erb +++ /dev/null @@ -1,7 +0,0 @@ - <ul class='dates'> - <% @time_table.dates.where("in_out = false").to_a.each do |tmd| %> - <li class="<%= (tmd.position%2==0) ? 'odd' : 'even' %>"><%= l tmd.date %> - </li> - <% end %> - </ul> - diff --git a/app/views/time_tables/_excluded_dates.html.slim b/app/views/time_tables/_excluded_dates.html.slim new file mode 100644 index 000000000..31b9e35f0 --- /dev/null +++ b/app/views/time_tables/_excluded_dates.html.slim @@ -0,0 +1,4 @@ +ul.dates + - @time_table.dates.where("in_out = false").to_a.each do |tmd| + li class="#{(tmd.position%2==0) ? 'odd' : 'even'}" + = l tmd.date
\ No newline at end of file diff --git a/app/views/time_tables/_form.erb b/app/views/time_tables/_form.erb deleted file mode 100644 index 8cd614fa6..000000000 --- a/app/views/time_tables/_form.erb +++ /dev/null @@ -1,91 +0,0 @@ -<%= semantic_form_for [@referential, @time_table] do |form| %> - <%= form.inputs do %> - <%= form.input :comment, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.time_table.comment")} %> - <%= form.input :version %> - <%= form.input :tag_search, :as => :tags, :input_html => { :id => "tag_search",:placeholder => t("formtastic.placeholders.time_table.tag_search") } %> - <%= form.input :tag_list, :as => :hidden, :input_html => { :id => "tag_list" } %> - - <%= form.input :objectid, :required => !@time_table.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.time_table.objectid")} %> - <% end %> - - <h3 class="time_table_periods"><%= @time_table.human_attribute_name("periods") %></h3> - <div id="periods_content"> - <%= form.inputs :class => 'day_type' do %> - <label class="day_type_label"><%= @time_table.human_attribute_name("day_types") %></label> - <%= form.input :monday, :as => :boolean, :class => "others" %> - <%= form.input :tuesday, :as => :boolean %> - <%= form.input :wednesday, :as => :boolean %> - <%= form.input :thursday, :as => :boolean %> - <%= form.input :friday, :as => :boolean %> - <%= form.input :saturday, :as => :boolean %> - <%= form.input :sunday, :as => :boolean %> - <% end %> - <div id="periods"> - <%= form.semantic_fields_for :periods do |p| %> - <%= render "period_fields", :f => p %> - <% end %> - </div> - <%= link_to_add_association t("time_tables.actions.add_period"), form, :periods , - :"data-association-insertion-method" => "append", - :"data-association-insertion-node" => "div#periods"%> - </div> - - <h3 class="time_table_dates"><%= @time_table.human_attribute_name("dates") %></h3> - <div id="dates_content"> - <div id="dates"> - <%= form.semantic_fields_for :dates, @time_table.dates.to_a.select {|d| d.in_out == true} do |p| %> - <%= render "date_fields", :f => p %> - <% end %> - </div> - <%= link_to_add_association t("time_tables.actions.add_date"), form, :dates , - :"data-association-insertion-method" => "append", - :"partial" => "date_fields", - :"data-association-insertion-node" => "div#dates" %> - </div> - - <h3 class="time_table_dates"><%= @time_table.human_attribute_name("excluded_dates") %></h3> - <div id="excluded_dates_content"> - <div id="excluded_dates"> - <%= form.semantic_fields_for :dates, @time_table.dates.to_a.select {|d| d.in_out == false} do |p| %> - <%= render "excluded_date_fields", :f => p %> - <% end %> - </div> - <%= link_to_add_association t("time_tables.actions.add_excluded_date"), form, :dates , - :"data-association-insertion-method" => "append", - :"partial" => "excluded_date_fields", - :"data-association-insertion-node" => "div#excluded_dates" %> - </div> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<%= javascript_tag "var items = #{ @time_table.tag_list.to_a };" %> - -<script> - $("#tag_search").tagsManager( - { - prefilled: items, - output: '#tag_list', - tagsContainer: '#tagsContainer' - }); - - var time_tables_tag_list = new Bloodhound({ - datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), - queryTokenizer: Bloodhound.tokenizers.whitespace, - remote: '<%= tags_referential_time_tables_path(@referential, :format => 'json') %>?tag=%QUERY', - }); - - time_tables_tag_list.initialize(); - - $("#tag_search").typeahead(null, { - name: 'time_tables_tag_list', - displayKey: 'name', - source: time_tables_tag_list.ttAdapter() - }); - -</script> - - diff --git a/app/views/time_tables/_form.html.slim b/app/views/time_tables/_form.html.slim new file mode 100644 index 000000000..7194ce363 --- /dev/null +++ b/app/views/time_tables/_form.html.slim @@ -0,0 +1,71 @@ += semantic_form_for [@referential, @time_table] do |form| + = form.inputs do + = form.input :comment, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.time_table.comment")} + = form.input :version + = form.input :tag_search, as: :tags, :input_html => { :id => "tag_search",:placeholder => t("formtastic.placeholders.time_table.tag_search") } + = form.input :tag_list, as: :hidden, :input_html => { :id => "tag_list" } + = form.input :objectid, :required => !@time_table.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.time_table.objectid")} + + h3.time_table_periods = @time_table.human_attribute_name("periods") + + #periods_content + = form.inputs class: 'day_type' do + label.day_type_label = @time_table.human_attribute_name("day_types") + = form.input :monday, as: :boolean, class: "others" + = form.input :tuesday, as: :boolean + = form.input :wednesday, as: :boolean + = form.input :thursday, as: :boolean + = form.input :friday, as: :boolean + = form.input :saturday, as: :boolean + = form.input :sunday, as: :boolean + + #periods + = form.semantic_fields_for :periods do |p| + == render "period_fields", :f => p + + = link_to_add_association t("time_tables.actions.add_period"), form, :periods , :"data-association-insertion-method" => "append", :"data-association-insertion-node" => "div#periods" + + h3.time_table_dates = @time_table.human_attribute_name("dates") + + #dates_content + #dates + = form.semantic_fields_for :dates, @time_table.dates.to_a.select {|d| d.in_out == true} do |p| + == render "date_fields", :f => p + + = link_to_add_association t("time_tables.actions.add_date"), form, :dates, :"data-association-insertion-method" => "append", :"partial" => "date_fields", :"data-association-insertion-node" => "div#dates" + + h3.time_table_dates = @time_table.human_attribute_name("excluded_dates") + + #excluded_dates_content + #excluded_dates + = form.semantic_fields_for :dates, @time_table.dates.to_a.select {|d| d.in_out == false} do |p| + == render "excluded_date_fields", :f => p + + = link_to_add_association t("time_tables.actions.add_excluded_date"), form, :dates, :"data-association-insertion-method" => "append", :"partial" => "excluded_date_fields", :"data-association-insertion-node" => "div#excluded_dates" + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + += javascript_tag "var items = #{ @time_table.tag_list.to_a };" + +javascript: + $("#tag_search").tagsManager({ + prefilled: items, + output: '#tag_list', + tagsContainer: '#tagsContainer' + }); + + var time_tables_tag_list = new Bloodhound({ + datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), + queryTokenizer: Bloodhound.tokenizers.whitespace, + remote: "#{tags_referential_time_tables_path(@referential, format: 'json')}?tag=%QUERY", + }); + + time_tables_tag_list.initialize(); + + $("#tag_search").typeahead(null, { + name: 'time_tables_tag_list', + displayKey: 'name', + source: time_tables_tag_list.ttAdapter() + });
\ No newline at end of file diff --git a/app/views/time_tables/_period_fields.erb b/app/views/time_tables/_period_fields.erb deleted file mode 100644 index 0094008f1..000000000 --- a/app/views/time_tables/_period_fields.erb +++ /dev/null @@ -1,7 +0,0 @@ -<%= f.inputs :class => 'nested-fields period' do %> - <%= f.label @time_table.human_attribute_name("period_start"), :class => "col-md-1" %> - <%= f.input :period_start, :as => :date_picker, :label => false, :input_html => { :class => 'form-control col-md-3' }%> - <%= f.label @time_table.human_attribute_name("period_end"), :class => "col-md-1" %> - <%= f.input :period_end, :as => :date_picker, :label => false, :input_html => { :class => 'form-control col-md-3' }%> - <%= link_to_remove_association t('actions.destroy'), f, :class => "col-md-2" %> -<% end %> diff --git a/app/views/time_tables/_period_fields.html.slim b/app/views/time_tables/_period_fields.html.slim new file mode 100644 index 000000000..cefa68df5 --- /dev/null +++ b/app/views/time_tables/_period_fields.html.slim @@ -0,0 +1,8 @@ += f.inputs class: 'nested-fields period' do + = f.label @time_table.human_attribute_name("period_start"), class: "col-md-1" + = f.input :period_start, as: :date_picker, :label => false, :input_html => { class: 'form-control col-md-3' } + + = f.label @time_table.human_attribute_name("period_end"), class: "col-md-1" + = f.input :period_end, as: :date_picker, :label => false, :input_html => { class: 'form-control col-md-3' } + + = link_to_remove_association t('actions.destroy'), f, class: "col-md-2"
\ No newline at end of file diff --git a/app/views/time_tables/_periods.html.erb b/app/views/time_tables/_periods.html.erb deleted file mode 100644 index 1f0aea057..000000000 --- a/app/views/time_tables/_periods.html.erb +++ /dev/null @@ -1,7 +0,0 @@ - <ul class='periods'> - <% @time_table.periods.each do |tmp| %> - <li class='period'><%= t('time_tables.show.from')%> <%= l tmp.period_start %> <%= t('time_tables.show.to')%> <%= l tmp.period_end %> - </li> - <% end %> - </ul> - diff --git a/app/views/time_tables/_periods.html.slim b/app/views/time_tables/_periods.html.slim new file mode 100644 index 000000000..e3c6d5f39 --- /dev/null +++ b/app/views/time_tables/_periods.html.slim @@ -0,0 +1,5 @@ +ul.periods + - @time_table.periods.each do |tmp| + li.period + = "#{('time_tables.show.from')} #{l tmp.period_start}" + = "#{t('time_tables.show.to')} #{l tmp.period_end}"
\ No newline at end of file diff --git a/app/views/time_tables/_properties_show.html.erb b/app/views/time_tables/_properties_show.html.erb deleted file mode 100644 index bc2f88ddf..000000000 --- a/app/views/time_tables/_properties_show.html.erb +++ /dev/null @@ -1,127 +0,0 @@ -<div class="time_table_show"> - - <div class="resume"> - <div class="validity <%= time_table_state_code(@time_table) %>"></div> - <label> - <% if @time_table.bounding_dates.empty? %> - <%= t(".resume_empty") %> - <% else %> - <%= t(".resume", :start_date => l(@time_table.bounding_dates.min), - :end_date => l(@time_table.bounding_dates.max)) %> - <% end %> - </label> - </div> - <div class="summary"> - <p> - <label><%= @time_table.human_attribute_name("version") %>: </label> - <%= @time_table.version %> - </p> - <p> - <label><%= @time_table.human_attribute_name("tag_list") %>: </label> - <%= @time_table.tag_list %> - </p> - <p> - <label><%= @time_table.human_attribute_name("day_types") %>: </label> - <% if @time_table.int_day_types & 508 == 0 %> - <label><%= @time_table.human_attribute_name("none") %></label> - <% else %> - <% if @time_table.monday %> - <span class='day_type'> <%= @time_table.human_attribute_name("monday") %> </span> - <% end %> - - <% if @time_table.tuesday %> - <span class='day_type'> <%= @time_table.human_attribute_name("tuesday") %> </span> - <% end %> - - <% if @time_table.wednesday %> - <span class='day_type'> <%= @time_table.human_attribute_name("wednesday") %> </span> - <% end %> - - <% if @time_table.thursday %> - <span class='day_type'> <%= @time_table.human_attribute_name("thursday") %> </span> - <% end %> - - <% if @time_table.friday %> - <span class='day_type'> <%= @time_table.human_attribute_name("friday") %> </span> - <% end %> - - <% if @time_table.saturday %> - <span class='day_type'> <%= @time_table.human_attribute_name("saturday") %> </span> - <% end %> - - <% if @time_table.sunday %> - <span class='day_type'> <%= @time_table.human_attribute_name("sunday") %> </span> - <% end %> - <% end %> - </p> - - <h3 class="time_table_calendars"> - <a class="calendars"><%= @time_table.human_attribute_name("calendars") %> - <%= image_tag("icons/plus.png" , :class => "switcher", :style => "display: none;") %> - <%= image_tag("icons/minus.png" , :class => "switcher" ) %> - </a> - - </h3> - <div class="calendars content"> - <div class="year_choice"> - <span class="previous"> <%= link_to("<", referential_time_table_path(@referential, @time_table, :year => (@year - 1)) ) %> </span> - <span class="year"> <%= "#{@year}" %> </span> - <span class="next"> <%= link_to(">", referential_time_table_path(@referential, @time_table, :year => (@year + 1)) ) %> </span> - </div> - <div class="calendar_helper"> - <%= cal = "" - (1..12).each do |month| - cal << calendar(:year => @year, :month => month, :first_day_of_week => 1) do |d| - if @time_table.excluded_date?(d) - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "excluded_date"}] - elsif @time_table.include_in_overlap_dates?(d) - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "overlap_date"}] - elsif @time_table.include_in_dates?(d) - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "selected_date"}] - elsif @time_table.include_in_periods?(d) - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "selected_period"}] - end - end - end - cal.html_safe - %> - </div> - </div> - - - </div> - <h3 class="time_table_periods"> - <a class="periods"><%= @time_table.human_attribute_name("periods") %> - <%= image_tag("icons/plus.png" , :class => "switcher", :style => "display: none;") %> - <%= image_tag("icons/minus.png" , :class => "switcher" ) %> - </a> - - </h3> - <div class="periods content"> - <%= render "time_tables/periods" %> - </div> - - <h3 class="time_table_dates"> - <a class="dates"><%= @time_table.human_attribute_name("dates") %> - <%= image_tag("icons/plus.png" , :class => "switcher", :style => "display: none;") %> - <%= image_tag("icons/minus.png" , :class => "switcher" ) %> - </a> - </h3> - - <div class="dates content"> - <%= render "time_tables/dates" %> - </div> - - <h3 class="time_table_dates"> - <a class="excluded_dates"><%= @time_table.human_attribute_name("excluded_dates") %> - <%= image_tag("icons/plus.png" , :class => "switcher", :style => "display: none;") %> - <%= image_tag("icons/minus.png" , :class => "switcher" ) %> - </a> - </h3> - - <div class="excluded_dates content"> - <%= render "time_tables/excluded_dates" %> - </div> - -</div> - diff --git a/app/views/time_tables/_properties_show.html.slim b/app/views/time_tables/_properties_show.html.slim new file mode 100644 index 000000000..43313afc1 --- /dev/null +++ b/app/views/time_tables/_properties_show.html.slim @@ -0,0 +1,99 @@ +.time_table_show + .resume + div class="validity #{time_table_state_code(@time_table)}" + + label + - if @time_table.bounding_dates.empty? + = t(".resume_empty") + - else + = t(".resume", :start_date => l(@time_table.bounding_dates.min), :end_date => l(@time_table.bounding_dates.max)) + + .summary + p + label = "#{@time_table.human_attribute_name('version')} : " + = @time_table.version + + p + label = "#{@time_table.human_attribute_name('tag_list')} : " + = @time_table.tag_list + + p + label = "#{@time_table.human_attribute_name('day_types')} : " + + - if @time_table.int_day_types & 508 == 0 + label = @time_table.human_attribute_name("none") + - else + - if @time_table.monday + span.day_type = " #{@time_table.human_attribute_name('monday')} " + + - if @time_table.tuesday + span.day_type = " #{@time_table.human_attribute_name('tuesday')} " + + - if @time_table.wednesday + span.day_type = " #{@time_table.human_attribute_name('wednesday')} " + + - if @time_table.thursday + span.day_type = " #{@time_table.human_attribute_name('thursday')} " + + - if @time_table.friday + span.day_type = " #{@time_table.human_attribute_name('friday')} " + + - if @time_table.saturday + span.day_type = " #{@time_table.human_attribute_name('saturday')} " + + - if @time_table.sunday + span.day_type = " #{@time_table.human_attribute_name('sunday')} " + + h3.time_table_calendars + a.calendars + = @time_table.human_attribute_name("calendars") + = image_tag("icons/plus.png" , class: "switcher", :style => "display: none;") + = image_tag("icons/minus.png" , class: "switcher" ) + + .calendars.content + .year_choice + span.previous = link_to("<", referential_time_table_path(@referential, @time_table, :year => (@year - 1)) ) + span.year = "#{@year}" + span.next = link_to(">", referential_time_table_path(@referential, @time_table, :year => (@year + 1)) ) + + .calendar_helper + - cal = "" + - (1..12).each do |month| + - cal << calendar(year: @year, month: month, first_day_of_week: 1) do |d| + - if @time_table.excluded_date?(d) + - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {class: "excluded_date"}] + - elsif @time_table.include_in_overlap_dates?(d) + - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {class: "overlap_date"}] + - elsif @time_table.include_in_dates?(d) + - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {class: "selected_date"}] + - elsif @time_table.include_in_periods?(d) + - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {class: "selected_period"}] + + = cal.html_safe + + h3.time_table_periods + a.periods + = @time_table.human_attribute_name("periods") + = image_tag("icons/plus.png" , class: "switcher", :style => "display: none;") + = image_tag("icons/minus.png" , class: "switcher" ) + + .periods.content + == render "time_tables/periods" + + h3.time_table_dates + a.dates + = @time_table.human_attribute_name("dates") + = image_tag("icons/plus.png" , class: "switcher", :style => "display: none;") + = image_tag("icons/minus.png" , class: "switcher" ) + + .dates.content + == render "time_tables/dates" + + h3.time_table_dates + a.excluded_dates + = @time_table.human_attribute_name("excluded_dates") + = image_tag("icons/plus.png", class: "switcher", :style => "display: none;") + = image_tag("icons/minus.png", class: "switcher" ) + + .excluded_dates.content + == render "time_tables/excluded_dates"
\ No newline at end of file diff --git a/app/views/time_tables/_show_time_table.html.erb b/app/views/time_tables/_show_time_table.html.erb deleted file mode 100644 index c48b93470..000000000 --- a/app/views/time_tables/_show_time_table.html.erb +++ /dev/null @@ -1,101 +0,0 @@ -<div class="time_table_show" id="time_table_show"> - <p> - <span class="state-code <%= @time_table.presenter.time_table_state_code %>"><i class="fa fa-certificate"></i></span> - <label> - <% if @time_table.bounding_dates.empty? %> - <%= t(".resume_empty") %> - <% else %> - <%= t(".resume", :start_date => l(@time_table.bounding_dates.min), :end_date => l(@time_table.bounding_dates.max)) %> - <% end %> - </label> - </p> - <p> - <label><%= @time_table.human_attribute_name("tag_list") %>: </label> - <%= @time_table.tag_list %> - </p> - <ul id="tabs" class="nav nav-tabs" data-tabs="tabs"> - <li class="active"><a href="#time_tables" data-toggle="tab"><%= @time_table.human_attribute_name("calendars") %></a></li> - <li><a href="#time_tables_datas" data-toggle="tab"><%= @time_table.human_attribute_name("calendar_details") %></a></li> - </ul> - <div id="my-tab-content" class="tab-content"> - <div class="tab-pane active" id="time_tables"> - <div class="well legend"> - <span class="title"><%= t(".legend") %></span> - <span class="label excluded_date">X</span><%= t(".excluded_date") %> - <span class="label overlaped_date">X</span><%= t(".overlap_date") %> - <span class="label selected_date">X</span><%= t(".selected_date") %> - <span class="label selected_period">X</span><%= t(".selected_period") %> - </div> - <div id="calendars"> - <div class="year_choice"> - <span class="previous"> <%= link_to("<", referential_time_table_path(@referential, @time_table, :year => (@year - 1)) ) %> </span> - <span class="year"> <%= "#{@year}" %> </span> - <span class="next"> <%= link_to(">", referential_time_table_path(@referential, @time_table, :year => (@year + 1)) ) %> </span> - </div> - <div class="calendar_helper"> - <%= cal = "" - (1..12).each do |month| - cal << calendar(:year => @year, :month => month, :first_day_of_week => 1) do |d| - if @time_table.excluded_date?(d) - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "day excluded_date"}] - elsif @time_table.include_in_overlap_dates?(d) - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "day overlaped_date"}] - elsif @time_table.include_in_dates?(d) - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "day selected_date"}] - elsif @time_table.include_in_periods?(d) - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "day selected_period"}] - end - end - end - cal.html_safe - %> - </div> - </div> - </div> - <div class="tab-pane" id="time_tables_datas"> - <div class="summary"> - <p> - <label><%= @time_table.human_attribute_name("version") %>: </label> - <%= @time_table.version %> - </p> - <p> - <label><%= @time_table.human_attribute_name("day_types") %>: </label> - <% if @time_table.int_day_types & 508 == 0 %> - <label><%= @time_table.human_attribute_name("none") %></label> - <% else %> - <% %w(monday tuesday wednesday thursday friday saturday sunday).each do |day_type| %> - <span class="<%= @time_table.send( day_type) ? "included_day_type" : "excluded_day_type" %>"> - <%= @time_table.human_attribute_name(day_type) %> - </span> - <% end %> - <% end %> - </p> - - </div> - - <% if @time_table.periods.present? %> - <h3 class="time_table_periods"><%= @time_table.human_attribute_name("periods") %></h3> - <div class="periods content"> - <%= render "time_tables/periods" %> - </div> - <% end %> - - <% if @time_table.dates.where("in_out = true").present? %> - <h3 class="time_table_dates"><%= @time_table.human_attribute_name("dates") %></h3> - <div class="dates content"> - <%= render "time_tables/dates" %> - </div> - <% end %> - - <% if @time_table.dates.where("in_out = false").present? %> - <h3 class="time_table_dates"><%= @time_table.human_attribute_name("excluded_dates") %></h3> - <div class="excluded_dates content"> - <%= render "time_tables/excluded_dates" %> - </div> - <% end %> - - </div> - </div> - -</div> - diff --git a/app/views/time_tables/_show_time_table.html.slim b/app/views/time_tables/_show_time_table.html.slim new file mode 100644 index 000000000..ccdc4187f --- /dev/null +++ b/app/views/time_tables/_show_time_table.html.slim @@ -0,0 +1,87 @@ +#time_table_show.time_table_show + p + span class="state-code #{@time_table.presenter.time_table_state_code}" + i.fa.fa-certificate + + label + - if @time_table.bounding_dates.empty? + = t(".resume_empty") + - else + = t(".resume", :start_date => l(@time_table.bounding_dates.min), :end_date => l(@time_table.bounding_dates.max)) + + p + label = "#{@time_table.human_attribute_name('tag_list')} : " + = @time_table.tag_list + + ul.nav.nav-tabs id="tabs" data-tabs="tabs" + li.active + a href="#time_tables" data-toggle="tab" + = @time_table.human_attribute_name("calendars") + + li + a href="#time_tables_datas" data-toggle="tab" + = @time_table.human_attribute_name("calendar_details") + + #my-tab-content.tab-content + #time_tables.tab-pane.active + .well.legend + span.title = t(".legend") + span.label.excluded_date X + = t(".excluded_date") + span.label.overlaped_date X + = t(".overlap_date") + span.label.selected_date X + = t(".selected_date") + span.label.selected_period X + = t(".selected_period") + + #calendars + .year_choice + span.previous = link_to("<", referential_time_table_path(@referential, @time_table, year: (@year - 1)) ) + span.year = "#{@year}" + span.next = link_to(">", referential_time_table_path(@referential, @time_table, year: (@year + 1)) ) + + .calendar_helper + - cal = "" + - (1..12).each do |month| + - cal << calendar(year: @year, month: month, first_day_of_week: 1) do |d| + - if @time_table.excluded_date?(d) + - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {class: "day excluded_date"}] + - elsif @time_table.include_in_overlap_dates?(d) + - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {class: "day overlaped_date"}] + - elsif @time_table.include_in_dates?(d) + - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {class: "day selected_date"}] + - elsif @time_table.include_in_periods?(d) + - [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {class: "day selected_period"}] + + = cal.html_safe + + #time_tables_datas.tab-pane + .summary + p + label = "#{@time_table.human_attribute_name('version')} : " + = @time_table.version + + p + label = "#{@time_table.human_attribute_name('day_types')} : " + - if @time_table.int_day_types & 508 == 0 + label = "#{@time_table.human_attribute_name('none')} : " + - else + - %w(monday tuesday wednesday thursday friday saturday sunday).each do |day_type| + span class="#{@time_table.send(day_type) ? 'included_day_type' :'excluded_day_type'}" + = @time_table.human_attribute_name(day_type) + + - if @time_table.periods.present? + h3.time_table_periods = @time_table.human_attribute_name("periods") + .periods.content + == render 'time_tables/periods' + + - if @time_table.dates.where("in_out = true").present? + h3.time_table_dates = @time_table.human_attribute_name("dates") + .dates.content + == render "time_tables/dates" + + - if @time_table.dates.where("in_out = false").present? + h3.time_table_dates = @time_table.human_attribute_name("excluded_dates") + .excluded_dates.content + == render "time_tables/excluded_dates"
\ No newline at end of file diff --git a/app/views/time_tables/_time_table.html.erb b/app/views/time_tables/_time_table.html.erb deleted file mode 100644 index 7f48a9365..000000000 --- a/app/views/time_tables/_time_table.html.erb +++ /dev/null @@ -1,35 +0,0 @@ -<div id="index_item" class="panel panel-default time_table"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_time_table_path(@referential, time_table), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to('<span class="fa fa-trash-o"></span>'.html_safe, referential_time_table_path(@referential, time_table), :method => :delete, :data => {:confirm => t('time_tables.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm") if delete %> - </span> - <h5> - <%= link_to([@referential, time_table], :class => "preview", :title => "#{Chouette::TimeTable.model_name.human.capitalize} #{time_table.comment}") do %> - <span class="state-code <%= time_table.presenter.time_table_state_code %>"><i class="fa fa-certificate"></i></span> - <span class="name"> - <%= truncate(time_table.comment, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <%= time_table.presenter.time_tables_shortest_info %> - <% unless time_table.periods.empty? %> - <div> - <% %w(monday tuesday wednesday thursday friday saturday sunday).each do |day_type| %> - <span class="<%= time_table.send( day_type) ? "included_day_type" : "excluded_day_type" %>"> - <%= time_table.human_attribute_name(day_type).first(2) %> - </span> - <% end %> - </div> - <% end %> - <% unless time_table.tags.empty? %> - <div><%= time_table.presenter.tag_list_shortened %></div> - <% end %> - </div> -</div> diff --git a/app/views/time_tables/_time_table.html.slim b/app/views/time_tables/_time_table.html.slim new file mode 100644 index 000000000..1e418054e --- /dev/null +++ b/app/views/time_tables/_time_table.html.slim @@ -0,0 +1,30 @@ +#index_item.panel.panel-default.time_table + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_referential_time_table_path(@referential, time_table), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + - if delete + = link_to '<span class="fa fa-trash-o"></span>'.html_safe, referential_time_table_path(@referential, time_table), :method => :delete, :data => {:confirm => t('time_tables.actions.destroy_confirm')}, class: "btn btn-danger btn-sm" + + h5 + = link_to([@referential, time_table], class: "preview", :title => "#{Chouette::TimeTable.model_name.human.capitalize} #{time_table.comment}") do + span.state-code + = time_table.presenter.time_table_state_code + i.fa.fa-certificate + + span.name = truncate(time_table.comment, length: 20) + + .panel-body + = time_table.presenter.time_tables_shortest_info + + - unless time_table.periods.empty? + div + - %w(monday tuesday wednesday thursday friday saturday sunday).each do |day_type| + span class="#{time_table.send(day_type) ? 'included_day_type' : 'excluded_day_type'}" + = time_table.human_attribute_name(day_type).first(2) + + - unless time_table.tags.empty? + div + = time_table.presenter.tag_list_shortened
\ No newline at end of file diff --git a/app/views/time_tables/_time_tables.html.erb b/app/views/time_tables/_time_tables.html.erb deleted file mode 100644 index 4458f653d..000000000 --- a/app/views/time_tables/_time_tables.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @time_tables %> -</div> -<div class="time_tables paginated_content"> - <%= paginated_content(@time_tables) %> -</div> -<div class="pagination"> - <%= will_paginate @time_tables, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/time_tables/_time_tables.html.slim b/app/views/time_tables/_time_tables.html.slim new file mode 100644 index 000000000..182523cfd --- /dev/null +++ b/app/views/time_tables/_time_tables.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t("will_paginate.page_entries_info.search") + = page_entries_info @time_tables + +.time_tables.paginated_content + = paginated_content(@time_tables) + +.pagination + = will_paginate @time_tables, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/time_tables/edit.html.erb b/app/views/time_tables/edit.html.erb deleted file mode 100644 index ac3beaeaa..000000000 --- a/app/views/time_tables/edit.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('time_tables.edit.title', :time_table => @time_table.comment) %> - -<%= render "form" %> - diff --git a/app/views/time_tables/edit.html.slim b/app/views/time_tables/edit.html.slim new file mode 100644 index 000000000..1746b48c7 --- /dev/null +++ b/app/views/time_tables/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('time_tables.edit.title', :time_table => @time_table.comment) + +== render 'form'
\ No newline at end of file diff --git a/app/views/time_tables/index.html.erb b/app/views/time_tables/index.html.erb deleted file mode 100644 index 2163dfa94..000000000 --- a/app/views/time_tables/index.html.erb +++ /dev/null @@ -1,42 +0,0 @@ -<%= title_tag t('time_tables.index.title') %> - -<%= search_form_for @q, :url => referential_time_tables_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <div class="input-group col-md-9"> - <%= f.text_field :comment_cont, :placeholder => "#{t('.comment')}", :class => 'form-control' %> - - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div><!-- /input-group --> - <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> - <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> - </a> - </div> - - <div id="advanced_search" class="panel-collapse collapse"> - <div class="panel-body"> - <div> - <label><%= "#{t('.from')}" %></label> - <%= f.text_field :start_date_gteq, :placeholder => "#{t('.start_date')}", :class => 'form-control date_picker', :type => "date" %> - <label><%= "#{t('.to')}" %></label> - <%= f.text_field :end_date_lteq, :placeholder => "#{t('.end_date')}", :class => 'form-control date_picker', :type => "date" %> - </div> - <div> - <%= f.text_field :tag_search, :placeholder => "#{t('.tag_search')}", :class => 'form-control' %> - </div> - </div> - </div> -</div> -<% end %> - -<div id="time_tables"><%= render 'time_tables' %></div> - - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('time_tables.actions.new'), new_referential_time_table_path(@referential), :class => "add" %></li> - <br> -</ul> -<% end %> diff --git a/app/views/time_tables/index.html.slim b/app/views/time_tables/index.html.slim new file mode 100644 index 000000000..3a9d1c4ad --- /dev/null +++ b/app/views/time_tables/index.html.slim @@ -0,0 +1,35 @@ += title_tag t('time_tables.index.title') + += search_form_for @q, :url => referential_time_tables_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| + .panel.panel-default + .panel-heading + .input-group.col-md-9 + = f.text_field :comment_cont, :placeholder => "#{t('.comment')}", class: 'form-control' + + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + a data-toggle="collapse" data-parent="#search" href="#advanced_search" + i.fa.fa-plus + = "#{t('.advanced_search')}" + + #advanced_search.panel-collapse.collapse + .panel-body + div + label = "#{t('.from')}" + = f.text_field :start_date_gteq, :placeholder => "#{t('.start_date')}", class: 'form-control date_picker', :type => "date" + + label = "#{t('.to')}" + = f.text_field :end_date_lteq, :placeholder => "#{t('.end_date')}", class: 'form-control date_picker', :type => "date" + + div + = f.text_field :tag_search, :placeholder => "#{t('.tag_search')}", class: 'form-control' + +#time_tables + == render 'time_tables' + +- content_for :sidebar do + ul.actions + li = link_to t('time_tables.actions.new'), new_referential_time_table_path(@referential), class: "add" + br
\ No newline at end of file diff --git a/app/views/time_tables/index.js.erb b/app/views/time_tables/index.js.erb deleted file mode 100644 index 3b37cde65..000000000 --- a/app/views/time_tables/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#time_tables').html('<%= escape_javascript(render("time_tables")) %>');
\ No newline at end of file diff --git a/app/views/time_tables/index.js.slim b/app/views/time_tables/index.js.slim new file mode 100644 index 000000000..bc9585c4b --- /dev/null +++ b/app/views/time_tables/index.js.slim @@ -0,0 +1 @@ +| $('#time_tables').html("#{escape_javascript(render('time_tables'))}");
\ No newline at end of file diff --git a/app/views/time_tables/new.html.erb b/app/views/time_tables/new.html.erb deleted file mode 100644 index 90b9876e2..000000000 --- a/app/views/time_tables/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('time_tables.new.title') %> - -<%= render "form" %> diff --git a/app/views/time_tables/new.html.slim b/app/views/time_tables/new.html.slim new file mode 100644 index 000000000..bc15f7032 --- /dev/null +++ b/app/views/time_tables/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('time_tables.new.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/time_tables/show.html.erb b/app/views/time_tables/show.html.erb deleted file mode 100644 index 6b2233a55..000000000 --- a/app/views/time_tables/show.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -<% require 'calendar_helper' %> - -<%= title_tag t('time_tables.show.title', :time_table => @time_table.comment )%> - -<%= render "time_table_combinations/combine" %> - -<%= render "show_time_table" %> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('time_tables.actions.new'), new_referential_time_table_path(@referential), :class => "add" %></li> - <li><%= link_to t('time_tables.actions.edit'), edit_referential_time_table_path(@referential, @time_table), :class => "edit" %></li> - <li><%= link_to t('time_tables.actions.destroy'), referential_time_table_path(@referential, @time_table), :method => :delete, :data => {:confirm => t('time_tables.actions.destroy_confirm')}, :class => "remove" %></li> - <li><%= link_to t('time_tables.actions.duplicate'), duplicate_referential_time_table_path(@referential, @time_table), :class => "clone" %></li> - <li><%= link_to t('time_tables.actions.combine'), new_referential_time_table_time_table_combination_path(@referential, @time_table), {:remote => true, 'data-toggle' => "modal", 'data-target' => '#modal_combine', :class => "merge"} %></li> -</ul> - - - <%= creation_tag(@time_table) %> -<% end %> diff --git a/app/views/time_tables/show.html.slim b/app/views/time_tables/show.html.slim new file mode 100644 index 000000000..7eaf24a77 --- /dev/null +++ b/app/views/time_tables/show.html.slim @@ -0,0 +1,22 @@ +- require 'calendar_helper' + += title_tag t('time_tables.show.title', :time_table => @time_table.comment ) + +== render 'time_table_combinations/combine' + +== render 'show_time_table' + +- content_for :sidebar do + ul.actions + li + = link_to t('time_tables.actions.new'), new_referential_time_table_path(@referential), class: 'add' + li + = link_to t('time_tables.actions.edit'), edit_referential_time_table_path(@referential, @time_table), class: "edit" + li + = link_to t('time_tables.actions.destroy'), referential_time_table_path(@referential, @time_table), :method => :delete, :data => {:confirm => t('time_tables.actions.destroy_confirm')}, class: "remove" + li + = link_to t('time_tables.actions.duplicate'), duplicate_referential_time_table_path(@referential, @time_table), class: "clone" + li + = link_to t('time_tables.actions.combine'), new_referential_time_table_time_table_combination_path(@referential, @time_table), {:remote => true, 'data-toggle' => "modal", 'data-target' => '#modal_combine', class: "merge"} + + = creation_tag(@time_table)
\ No newline at end of file diff --git a/app/views/timebands/_form.html.erb b/app/views/timebands/_form.html.erb deleted file mode 100644 index bfa32212e..000000000 --- a/app/views/timebands/_form.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= semantic_form_for [@referential, @timeband] do |form| %> - <%= form.inputs do %> - <%= form.input :name %> - <%= form.input :start_time %> - <%= form.input :end_time %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> diff --git a/app/views/timebands/_form.html.slim b/app/views/timebands/_form.html.slim new file mode 100644 index 000000000..433d777dc --- /dev/null +++ b/app/views/timebands/_form.html.slim @@ -0,0 +1,9 @@ += semantic_form_for [@referential, @timeband] do |form| + = form.inputs do + = form.input :name + = form.input :start_time + = form.input :end_time + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/timebands/_sidebar.html.erb b/app/views/timebands/_sidebar.html.erb deleted file mode 100644 index 8ffa16dca..000000000 --- a/app/views/timebands/_sidebar.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% content_for :sidebar do %> - <ul class="actions"> - <li><%= link_to t('timebands.actions.new'), new_referential_timeband_path(@referential), :class => "add" %></li> - <% if @timeband %> - <li><%= link_to t('timebands.actions.edit'), edit_referential_timeband_path(@referential, @timeband), :class => "edit" %></li> - <li><%= link_to t('timebands.actions.destroy'), referential_timeband_path(@referential, @timeband), :method => :delete, :data => {:confirm => t('timebands.actions.destroy_confirm')}, :class => "remove" %></li> - <% end %> - </ul> -<% end %> - - diff --git a/app/views/timebands/_sidebar.html.slim b/app/views/timebands/_sidebar.html.slim new file mode 100644 index 000000000..07dcebdad --- /dev/null +++ b/app/views/timebands/_sidebar.html.slim @@ -0,0 +1,9 @@ +- content_for :sidebar do + ul.actions + li = link_to t('timebands.actions.new'), new_referential_timeband_path(@referential), class: "add" + + - if @timeband + li + = link_to t('timebands.actions.edit'), edit_referential_timeband_path(@referential, @timeband), class: "edit" + li + = link_to t('timebands.actions.destroy'), referential_timeband_path(@referential, @timeband), :method => :delete, :data => {:confirm => t('timebands.actions.destroy_confirm')}, class: "remove"
\ No newline at end of file diff --git a/app/views/timebands/edit.html.erb b/app/views/timebands/edit.html.erb deleted file mode 100644 index bc2c73ace..000000000 --- a/app/views/timebands/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('timebands.edit.title', timeband: @timeband.name) %> - -<%= render "form" %> diff --git a/app/views/timebands/edit.html.slim b/app/views/timebands/edit.html.slim new file mode 100644 index 000000000..af62ae8db --- /dev/null +++ b/app/views/timebands/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('timebands.edit.title', timeband: @timeband.name) + += render 'form'
\ No newline at end of file diff --git a/app/views/timebands/index.html.erb b/app/views/timebands/index.html.erb deleted file mode 100644 index 54be52675..000000000 --- a/app/views/timebands/index.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<%= title_tag t('timebands.index.title') %> - -<% if @timebands.any? %> - <table class="table table-striped table-condensed"> - <thead> - <tr> - <th><%= t('activerecord.attributes.timeband.name') %></th> - <th><%= t('activerecord.attributes.timeband.start_time') %></th> - <th><%= t('activerecord.attributes.timeband.end_time') %></th> - <th></th> - </tr> - </thead> - <tbody> - <% @timebands.each do |timeband| %> - <tr> - <td><%= link_to timeband.name, referential_timeband_path(@referential, timeband) %></td> - <td><%= l(timeband.start_time, format: :hour) %></td> - <td><%= l(timeband.end_time, format: :hour) %></td> - <td> - <%= link_to '', edit_referential_timeband_path(@referential, timeband), :class => "edit" %> - <%= link_to '', referential_timeband_path(@referential, timeband), :method => :delete, :data => {:confirm => t('timebands.actions.destroy_confirm')}, :class => "remove" %> - </td> - </tr> - <% end %> - </tbody> - </table> -<% end %> - -<%= render 'sidebar' %> diff --git a/app/views/timebands/index.html.slim b/app/views/timebands/index.html.slim new file mode 100644 index 000000000..c81c0a670 --- /dev/null +++ b/app/views/timebands/index.html.slim @@ -0,0 +1,22 @@ += title_tag t('timebands.index.title') + +- if @timebands.any? + table.table.table-striped.table-condensed + thead + tr + th = t('activerecord.attributes.timeband.name') + th = t('activerecord.attributes.timeband.start_time') + th = t('activerecord.attributes.timeband.end_time') + th + + tbody + - @timebands.each do |timeband| + tr + td = link_to timeband.name, referential_timeband_path(@referential, timeband) + td = l(timeband.start_time, format: :hour) + td = l(timeband.end_time, format: :hour) + td + = link_to '', edit_referential_timeband_path(@referential, timeband), class: "edit" + = link_to '', referential_timeband_path(@referential, timeband), :method => :delete, :data => {:confirm => t('timebands.actions.destroy_confirm')}, class: "remove" + +== render 'sidebar' diff --git a/app/views/timebands/new.html.erb b/app/views/timebands/new.html.erb deleted file mode 100644 index c016325d0..000000000 --- a/app/views/timebands/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('timebands.new.title') %> - -<%= render "form" %> diff --git a/app/views/timebands/new.html.slim b/app/views/timebands/new.html.slim new file mode 100644 index 000000000..90aa1bd2e --- /dev/null +++ b/app/views/timebands/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('timebands.new.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/timebands/show.html.erb b/app/views/timebands/show.html.erb deleted file mode 100644 index 1a6171712..000000000 --- a/app/views/timebands/show.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= title_tag t( 'timebands.show.title', timeband: @timeband.name )%> - -<div class="summary"> - <p> - <label><%= @timeband.name %>: </label> - <%= l(@timeband.start_time, format: :hour) %> - - - <%= l(@timeband.end_time, format: :hour) %> - </p> -</div> - -<%= render 'sidebar' %> diff --git a/app/views/timebands/show.html.slim b/app/views/timebands/show.html.slim new file mode 100644 index 000000000..100457226 --- /dev/null +++ b/app/views/timebands/show.html.slim @@ -0,0 +1,8 @@ += title_tag t( 'timebands.show.title', timeband: @timeband.name ) + +.summary + p + label = "#{@timeband.name} : " + = "#{l(@timeband.start_time, format: :hour)} - #{l(@timeband.end_time, format: :hour)}" + +== render 'sidebar'
\ No newline at end of file diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb deleted file mode 100644 index ed9d3d0ad..000000000 --- a/app/views/users/_form.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<%= simple_form_for [:organisation, @user], html: {class: 'form-horizontal' } do |form| %> - <%= form.input :name %> - <%= form.input :email %> - - - <div class="form-actions"> - <%= form.button :submit, :as => :button %> - <%= link_to t("cancel"), organisation_path %> - </div> -<% end %> diff --git a/app/views/users/_form.html.slim b/app/views/users/_form.html.slim new file mode 100644 index 000000000..d88910ad4 --- /dev/null +++ b/app/views/users/_form.html.slim @@ -0,0 +1,7 @@ += simple_form_for [:organisation, @user], html: {class: 'form-horizontal' } do |form| + = form.input :name + = form.input :email + + .form-actions + = form.button :submit, as: :button + = link_to t("cancel"), organisation_path
\ No newline at end of file diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb deleted file mode 100644 index 7cd0cc17c..000000000 --- a/app/views/users/_user.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<div id="index_item" class="panel panel-default user"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <!-- FIXME ref #819 --> - <% if false %> - <% if user == current_user %> - <%= link_to( edit_user_registration_path(user), :class => "btn btn-default btn-sm" ) do %> - <span class="fa fa-pencil"></span> - <% end %> - <% end %> - <%= link_to organisation_user_path(user), :method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - <% end %> - </span> - <h5> - <%= link_to( organisation_user_path(user), :class => "preview", :title => "#{User.model_name.human.capitalize} #{user.email}") do %> - <%= user_gravatar_image_tag(user, 20) %> - <span class="name"> - <%= truncate(user.name, :length => 15) %> - </span> - <% end %> - </h5> - </div> - </div> -</div> diff --git a/app/views/users/_user.html.slim b/app/views/users/_user.html.slim new file mode 100644 index 000000000..bcd568f6f --- /dev/null +++ b/app/views/users/_user.html.slim @@ -0,0 +1,17 @@ +#index_item.panel.panel-default.user + .panel-heading + .panel-title.clearfix + span.pull-right + / FIXME ref #819 + - if false + - if user == current_user + = link_to edit_user_registration_path(user), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + = link_to organisation_user_path(user), :method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to( organisation_user_path(user), class: 'preview', title: "#{User.model_name.human.capitalize} #{user.email}") do + = user_gravatar_image_tag(user, 20) + span.name = truncate(user.name, :length => 15)
\ No newline at end of file diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb deleted file mode 100644 index 98986b4d6..000000000 --- a/app/views/users/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('.title') %> - -<%= render "form" %> diff --git a/app/views/users/new.html.slim b/app/views/users/new.html.slim new file mode 100644 index 000000000..cc5637bb6 --- /dev/null +++ b/app/views/users/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb deleted file mode 100644 index 6e1c3d089..000000000 --- a/app/views/users/show.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<%= title_tag @user.email %> - -<div class="user"> -<p> -<label><%= User.human_attribute_name("name") %>: </label> -<%= @user.name %> -</p> -<p> -<label><%= User.human_attribute_name("email") %>: </label> -<%= @user.email %> -</p> -</div> - -<!-- FIXME ref #819 --> -<% if false %> - <% content_for(:sidebar) do %> - <ul class="actions"> - <li><%= link_to( t('users.actions.edit'), edit_user_registration_path, :class => "edit") if @user == current_user %></li> - <li><%= link_to t('users.actions.destroy'), organisation_user_path(@user),:method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, :class => "remove" %></li> - </ul> - <% end %> -<% end %> diff --git a/app/views/users/show.html.slim b/app/views/users/show.html.slim new file mode 100644 index 000000000..f884ae94e --- /dev/null +++ b/app/views/users/show.html.slim @@ -0,0 +1,19 @@ += title_tag @user.email + +.user + p + label = "#{User.human_attribute_name('name')} : " + = @user.name + + p + label = "#{User.human_attribute_name('email')} : " + = @user.email + +/ FIXME ref #819 +- if false + - content_for(:sidebar) do + ul.actions + li + = link_to( t('users.actions.edit'), edit_user_registration_path, class: "edit") if @user == current_user + li + = link_to t('users.actions.destroy'), organisation_user_path(@user), method: :delete, data: {:confirm => t('users.actions.destroy_confirm')}, class: "remove"
\ No newline at end of file diff --git a/app/views/vehicle_journey_exports/index.xls.erb b/app/views/vehicle_journey_exports/index.xls.erb deleted file mode 100644 index b6fea2b73..000000000 --- a/app/views/vehicle_journey_exports/index.xls.erb +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0"?> -<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" - xmlns:o="urn:schemas-microsoft-com:office:office" - xmlns:x="urn:schemas-microsoft-com:office:excel" - xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" - xmlns:html="http://www.w3.org/TR/REC-html40"> - <Worksheet ss:Name="Sheet1"> - <Table> - <Row> - <% @column_names.each do |column_name| %> - <Cell><Data ss:Type="String"><%= column_name %></Data></Cell> - <% end %> - </Row> - <% vehicle_journey_at_stops_matrix = (@vehicle_journeys.collect{ |vj| vj.vehicle_journey_at_stops.collect(&:departure_time).collect{|time| time.strftime("%H:%M")} }).transpose %> - <% @route.stop_points.each_with_index do |stop_point, index| %> - <Row> - <Cell><Data ss:Type="Number"><%= stop_point.id %></Data></Cell> - <Cell><Data ss:Type="String"><%= stop_point.stop_area.name %></Data></Cell> - <% vehicle_journey_at_stops_matrix[index].each do |vehicle_journey_at_stop| %> - <Cell><Data ss:Type="String"><%= vehicle_journey_at_stop %></Data></Cell> - <% end %> - </Row> - <% end %> - </Table> - </Worksheet> -</Workbook> diff --git a/app/views/vehicle_journey_exports/index.xls.slim b/app/views/vehicle_journey_exports/index.xls.slim new file mode 100644 index 000000000..2b0bc51b9 --- /dev/null +++ b/app/views/vehicle_journey_exports/index.xls.slim @@ -0,0 +1,18 @@ +doctype XML +workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" + worksheet ss:name="Sheet1" + table + row + - @column_names.each do |column_name| + cell + data ss:type="String" = column_name + - vehicle_journey_at_stops_matrix = (@vehicle_journeys.collect{ |vj| vj.vehicle_journey_at_stops.collect(&:departure_time).collect{|time| time.strftime("%H:%M")} }).transpose + - @route.stop_points.each_with_index do |stop_point, index| + row + cell + data ss:type="Number" = stop_point.id + cell + data ss:type="String" = stop_point.stop_area.name + - vehicle_journey_at_stops_matrix[index].each do |vehicle_journey_at_stop| + cell + data ss:type="String" = vehicle_journey_at_stop diff --git a/app/views/vehicle_journey_frequencies/_form_footer.html.erb b/app/views/vehicle_journey_frequencies/_form_footer.html.erb deleted file mode 100644 index d38f8af0e..000000000 --- a/app/views/vehicle_journey_frequencies/_form_footer.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<% if vehicle_journey.new_record? %> - <%= javascript_include_tag new_referential_line_route_vehicle_journey_frequency_path( - @referential, - @line, - @route, - format: :js) %> -<% else %> - <%= javascript_include_tag edit_referential_line_route_vehicle_journey_frequency_path( - @referential, - @line, - @route, - vehicle_journey, - format: :js) %> -<% end %> diff --git a/app/views/vehicle_journey_frequencies/_form_footer.html.slim b/app/views/vehicle_journey_frequencies/_form_footer.html.slim new file mode 100644 index 000000000..922e867a8 --- /dev/null +++ b/app/views/vehicle_journey_frequencies/_form_footer.html.slim @@ -0,0 +1,4 @@ +- if vehicle_journey.new_record? + = javascript_include_tag new_referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route, format: :js) +- else + = javascript_include_tag edit_referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route, vehicle_journey, format: :js)
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/_form_vehicle_journey_at_stops.html.erb b/app/views/vehicle_journey_frequencies/_form_vehicle_journey_at_stops.html.erb deleted file mode 100644 index e002f746e..000000000 --- a/app/views/vehicle_journey_frequencies/_form_vehicle_journey_at_stops.html.erb +++ /dev/null @@ -1,60 +0,0 @@ -<li class="input"> - <%= form.label vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids), class: 'label' %> - <table class="table-striped ce-TimeBandFormTable"> - <thead> - <tr> - <th> - <%= t('vehicle_journeys.form.stop_title') %> - </th> - <th></th> - <th> - <%= t('vehicle_journeys.form.arrival') %> - </th> - <th> - <%= t('vehicle_journeys.form.departure') %> - </th> - </tr> - </thead> - <tbody class="journey_pattern_dependent_list"> - <%= render partial: 'vehicle_journey_at_stop_fields', - collection: vehicle_journey.vehicle_journey_at_stops, as: :vehicle_journey_at_stop, - locals: { vehicle_journey_at_stops_size: vehicle_journey.vehicle_journey_at_stops.size } %> - </tbody> - <tfoot> - <tr> - <td></td> - <td></td> - <td> - <%= button_tag 'data-ce-action' => 'to_departures', class: 'ce-hide btn btn-primary' do %> - <%= t('vehicle_journeys.form.to_departures').html_safe %> - <i class="fa fa-angle-double-right"></i> - <% end %> - <td> - <%= button_tag 'data-ce-action' => 'to_arrivals', class: 'ce-hide btn btn-primary' do %> - <i class="fa fa-angle-double-left"></i> - <%= t('vehicle_journeys.form.to_arrivals').html_safe %> - <% end %> - </td> - </tr> - </tfoot> - </table> -</li> - -<li class="input"> - <%= form.label vehicle_journey.human_attribute_name(:journey_frequency_ids), class: 'label' %> - <ul class="ce-FrequencyFormFields"> - <li><%= t('activerecord.attributes.journey_frequency.timeband') %></li> - <li><%= t('activerecord.attributes.journey_frequency.first_departure_time') %></li> - <li><%= t('activerecord.attributes.journey_frequency.last_departure_time') %></li> - <li><%= t('activerecord.attributes.journey_frequency.scheduled_headway_interval') %></li> - <li></li> - <li></li> - </ul> - <% i = 0 %> - <%= form.semantic_fields_for :journey_frequencies do |journey_frequency| %> - <%= render 'journey_frequency_fields', f: journey_frequency, no_destroy: ((i += 1) == 1 ? true : false) %> - <% end %> - <div class="actions-add-fields"> - <%= link_to_add_association t('journey_frequencies.form.add_line'), form, :journey_frequencies, class: 'btn btn-primary' %> - </div> -</li> diff --git a/app/views/vehicle_journey_frequencies/_form_vehicle_journey_at_stops.html.slim b/app/views/vehicle_journey_frequencies/_form_vehicle_journey_at_stops.html.slim new file mode 100644 index 000000000..45b37dee9 --- /dev/null +++ b/app/views/vehicle_journey_frequencies/_form_vehicle_journey_at_stops.html.slim @@ -0,0 +1,44 @@ +li.input + = form.label vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids), class: 'label' + + table.table-striped.ce-TimeBandFormTable + thead + tr + th = t('vehicle_journeys.form.stop_title') + th + th = t('vehicle_journeys.form.arrival') + th = t('vehicle_journeys.form.departure') + + tbody.journey_pattern_dependent_list + == render partial: 'vehicle_journey_at_stop_fields', collection: vehicle_journey.vehicle_journey_at_stops, as: :vehicle_journey_at_stop, locals: { vehicle_journey_at_stops_size: vehicle_journey.vehicle_journey_at_stops.size } + + tfoot + tr + td + td + td + = button_tag 'data-ce-action' => 'to_departures', class: 'ce-hide btn btn-primary' do + = t('vehicle_journeys.form.to_departures').html_safe + i.fa.fa-angle-double-right + td + = button_tag 'data-ce-action' => 'to_arrivals', class: 'ce-hide btn btn-primary' do + i.fa.fa-angle-double-left + = t('vehicle_journeys.form.to_arrivals').html_safe + +li.input + = form.label vehicle_journey.human_attribute_name(:journey_frequency_ids), class: 'label' + + ul.ce-FrequencyFormFields + li = t('activerecord.attributes.journey_frequency.timeband') + li = t('activerecord.attributes.journey_frequency.first_departure_time') + li = t('activerecord.attributes.journey_frequency.last_departure_time') + li = t('activerecord.attributes.journey_frequency.scheduled_headway_interval') + li + li + + - i = 0 + = form.semantic_fields_for :journey_frequencies do |journey_frequency| + == render 'journey_frequency_fields', f: journey_frequency, no_destroy: ((i += 1) == 1 ? true : false) + + .actions-add-fields + = link_to_add_association t('journey_frequencies.form.add_line'), form, :journey_frequencies, class: 'btn btn-primary'
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/_journey_frequency_fields.html.erb b/app/views/vehicle_journey_frequencies/_journey_frequency_fields.html.erb deleted file mode 100644 index 221bf2f67..000000000 --- a/app/views/vehicle_journey_frequencies/_journey_frequency_fields.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% no_destroy = false unless local_assigns[:no_destroy] %> -<div class="nested-fields"> - <ul class="ce-FrequencyFormFields"> - <%= f.input :timeband_id, as: :search_timeband, json: referential_autocomplete_timebands_path(@referential, format: :json), - hint_text: t('search_hint'), no_result_text: t('no_result_text'), searching_text: t('searching_term'), label: false, - input_html: { :"data-pre" => Rabl::Renderer.new( 'autocomplete_timebands/index', - Chouette::Timeband.where(id: f.object.timeband_id), view_path: 'app/views', - format: :json, scope: :self ).render } %> - <%= f.input :first_departure_time, label: false %> - <%= f.input :last_departure_time, label: false %> - <%= f.input :scheduled_headway_interval, label: false %> - <%= f.input :exact_time, label: t('activerecord.attributes.journey_frequency.exact_time') %> - <li> - <label class="label"></label> - <% unless no_destroy %> - <%= link_to_remove_association f do %> - <i class="fa fa-trash"></i> - <% end %> - <% end %> - </li> - </ul> -</div> diff --git a/app/views/vehicle_journey_frequencies/_journey_frequency_fields.html.slim b/app/views/vehicle_journey_frequencies/_journey_frequency_fields.html.slim new file mode 100644 index 000000000..c649abd9b --- /dev/null +++ b/app/views/vehicle_journey_frequencies/_journey_frequency_fields.html.slim @@ -0,0 +1,16 @@ +- no_destroy = false unless local_assigns[:no_destroy] + +.nested-fields + ul.ce-FrequencyFormFields + = f.input :timeband_id, as: :search_timeband, json: referential_autocomplete_timebands_path(@referential, format: :json), hint_text: t('search_hint'), no_result_text: t('no_result_text'), searching_text: t('searching_term'), label: false, input_html: { :"data-pre" => Rabl::Renderer.new( 'autocomplete_timebands/index', Chouette::Timeband.where(id: f.object.timeband_id), view_path: 'app/views', format: :json, scope: :self ).render } + = f.input :first_departure_time, label: false + = f.input :last_departure_time, label: false + = f.input :scheduled_headway_interval, label: false + = f.input :exact_time, label: t('activerecord.attributes.journey_frequency.exact_time') + + li + label.label + + - unless no_destroy + = link_to_remove_association f do + i.fa.fa-trash
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/_show_journey_frequencies.html.erb b/app/views/vehicle_journey_frequencies/_show_journey_frequencies.html.erb deleted file mode 100644 index 328c702f9..000000000 --- a/app/views/vehicle_journey_frequencies/_show_journey_frequencies.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -<h3><%= t('vehicle_journeys.show.journey_frequencies') %></h3> -<div class="journey_frequencies content"> - <table class="table table-hover table-striped"> - <thead> - <tr> - <th><%= t('activerecord.attributes.journey_frequency.timeband') %></th> - <th><%= t('activerecord.attributes.journey_frequency.first_departure_time') %></th> - <th><%= t('activerecord.attributes.journey_frequency.last_departure_time') %></th> - <th><%= t('activerecord.attributes.journey_frequency.scheduled_headway_interval') %></th> - <th><%= t('activerecord.attributes.journey_frequency.exact_time') %></th> - </tr> - <thead> - <tbody> - <% @vehicle_journey_frequency.journey_frequencies.each do |journey_frequency| %> - <tr class="<%= cycle :odd, :even %>"> - <td> - <%= link_to journey_frequency.timeband.fullname, - referential_timeband_path(@referential, journey_frequency.timeband) if journey_frequency.timeband %> - </td> - <td><%= l(journey_frequency.first_departure_time, format: :hour) %></td> - <td><%= l(journey_frequency.last_departure_time, format: :hour) %></td> - <td><%= l(journey_frequency.scheduled_headway_interval, format: :hour) %></td> - <td><%= '<i class="fa fa-check"></i>'.html_safe if journey_frequency.exact_time %></td> - </tr> - <% end %> - </tbody> - </table> -</div> diff --git a/app/views/vehicle_journey_frequencies/_show_journey_frequencies.html.slim b/app/views/vehicle_journey_frequencies/_show_journey_frequencies.html.slim new file mode 100644 index 000000000..4510f26f0 --- /dev/null +++ b/app/views/vehicle_journey_frequencies/_show_journey_frequencies.html.slim @@ -0,0 +1,21 @@ +h3 = t('vehicle_journeys.show.journey_frequencies') + +.journey_frequencies.content + table.table.table-hover.table-striped + thead + tr + th = t('activerecord.attributes.journey_frequency.timeband') + th = t('activerecord.attributes.journey_frequency.first_departure_time') + th = t('activerecord.attributes.journey_frequency.last_departure_time') + th = t('activerecord.attributes.journey_frequency.scheduled_headway_interval') + th = t('activerecord.attributes.journey_frequency.exact_time') + + tbody + - @vehicle_journey_frequency.journey_frequencies.each do |journey_frequency| + tr class="#{cycle :odd, :even}"" + td + = link_to journey_frequency.timeband.fullname, referential_timeband_path(@referential, journey_frequency.timeband) if journey_frequency.timeband + td = l(journey_frequency.first_departure_time, format: :hour) + td = l(journey_frequency.last_departure_time, format: :hour) + td = l(journey_frequency.scheduled_headway_interval, format: :hour) + td = '<i class="fa fa-check"></i>'.html_safe if journey_frequency.exact_time
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/_show_sidebar.html.erb b/app/views/vehicle_journey_frequencies/_show_sidebar.html.erb deleted file mode 100644 index a63dd0a6b..000000000 --- a/app/views/vehicle_journey_frequencies/_show_sidebar.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<% content_for :sidebar do %> - <ul class="actions"> - <li> - <%= link_to t('vehicle_journeys.actions.new'), - new_referential_line_route_vehicle_journey_path(@referential, @line, @route), class: "add" %> - </li> - <li> - <%= link_to t('vehicle_journeys.actions.new_frequency'), - new_referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route), class: "add" %> - </li> - <li> - <%= link_to t('vehicle_journeys.actions.edit_frequency'), - edit_referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route, @vehicle_journey_frequency), - class: "edit" %> - </li> - <li> - <%= link_to t('vehicle_journeys.actions.destroy'), - referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route, @vehicle_journey_frequency), - method: :delete, data: { confirm: t('vehicle_journeys.actions.destroy_confirm') }, class: "remove" %> - </li> - </ul> - <%= creation_tag(@vehicle_journey_frequency) %> -<% end %> diff --git a/app/views/vehicle_journey_frequencies/_show_sidebar.html.slim b/app/views/vehicle_journey_frequencies/_show_sidebar.html.slim new file mode 100644 index 000000000..61695ef86 --- /dev/null +++ b/app/views/vehicle_journey_frequencies/_show_sidebar.html.slim @@ -0,0 +1,15 @@ +- content_for :sidebar do + ul.actions + li + = link_to t('vehicle_journeys.actions.new'), new_referential_line_route_vehicle_journey_path(@referential, @line, @route), class: "add" + + li + = link_to t('vehicle_journeys.actions.new_frequency'), new_referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route), class: "add" + + li + = link_to t('vehicle_journeys.actions.edit_frequency'), edit_referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route, @vehicle_journey_frequency), class: "edit" + + li + = link_to t('vehicle_journeys.actions.destroy'), referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route, @vehicle_journey_frequency), method: :delete, data: { confirm: t('vehicle_journeys.actions.destroy_confirm') }, class: "remove" + + = creation_tag(@vehicle_journey_frequency)
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/_show_vehicle_journey_at_stops.html.erb b/app/views/vehicle_journey_frequencies/_show_vehicle_journey_at_stops.html.erb deleted file mode 100644 index 0a91a8af3..000000000 --- a/app/views/vehicle_journey_frequencies/_show_vehicle_journey_at_stops.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<div class="vehicle_journey_at_stops content"> - <table class="table-striped ce-TimeBandFormTable"> - <thead> - <tr> - <th class="stop title" ><%= t('vehicle_journeys.show.stop_title') %></th> - <th></th> - <th class="hour title"><%= t('vehicle_journeys.show.arrival') %></th> - <th class="hour title"><%= t('vehicle_journeys.show.departure') %></th> - </tr> - <thead> - <tbody> - <% @vehicle_journey_frequency.vehicle_journey_at_stops.each do |vjas| %> - <tr class="<%= cycle :odd, :even %>"> - <td><%= link_to vjas.stop_point.stop_area.name, [@referential, vjas.stop_point.stop_area] %></td> - <td class="ce-TimeBandFormTable-circleLine"> - <span class="ce-TimeBandFormTable-circle"></span> - <span class="ce-TimeBandFormTable-line"></span> - </td> - <td class="hour <%= 'missing' if vjas.arrival_time.nil? %>"> - <%= l(vjas.arrival_time, format: :hour) if vjas.arrival_time %> - </td> - <td class="hour <%= 'missing' if vjas.departure_time.nil? %>"> - <%= l(vjas.departure_time, format: :hour) if vjas.departure_time %> - </td> - </tr> - <% end %> - </tbody> - </table> -</div> diff --git a/app/views/vehicle_journey_frequencies/_show_vehicle_journey_at_stops.html.slim b/app/views/vehicle_journey_frequencies/_show_vehicle_journey_at_stops.html.slim new file mode 100644 index 000000000..24517309c --- /dev/null +++ b/app/views/vehicle_journey_frequencies/_show_vehicle_journey_at_stops.html.slim @@ -0,0 +1,22 @@ +.vehicle_journey_at_stops.content + table.table-striped.ce-TimeBandFormTable + thead + tr + th.stop.title = t('vehicle_journeys.show.stop_title') + th + th.hour.title = t('vehicle_journeys.show.arrival') + th.hour.title = t('vehicle_journeys.show.departure') + + tbody + - @vehicle_journey_frequency.vehicle_journey_at_stops.each do |vjas| + tr class="#{cycle :odd, :even}" + td = link_to vjas.stop_point.stop_area.name, [@referential, vjas.stop_point.stop_area] + td.ce-TimeBandFormTable-circleLine + span.ce-TimeBandFormTable-circle + span.ce-TimeBandFormTable-line + + td class="hour #{'missing' if vjas.arrival_time.nil?}" + = l(vjas.arrival_time, format: :hour) if vjas.arrival_time + + td class="hour #{'missing' if vjas.departure_time.nil?}" + = l(vjas.departure_time, format: :hour) if vjas.departure_time
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/_vehicle_journey_at_stop_fields.html.erb b/app/views/vehicle_journey_frequencies/_vehicle_journey_at_stop_fields.html.erb deleted file mode 100644 index 5a4ed7382..000000000 --- a/app/views/vehicle_journey_frequencies/_vehicle_journey_at_stop_fields.html.erb +++ /dev/null @@ -1,52 +0,0 @@ -<% - vjas = vehicle_journey_at_stop - tab_counter_arrival = 2 * vehicle_journey_at_stop_counter + 100 - tab_counter_departure = (vehicle_journey_at_stops_size * 2) + 2 * vehicle_journey_at_stop_counter + 100 -%> -<tr class="time input optional <%= 'no_stop' if vjas._destroy %> <%= cycle :odd, :even %>" > - <td> - <%= { - id: vjas.id, - _destroy: (vjas._destroy ? 1 : 0), - stop_point_id: vjas.stop_point_id, - :'departure_time(3i)' => 1, - :'departure_time(2i)' => 1, - :'departure_time(1i)' => 1, - :'arrival_time(3i)' => 1, - :'arrival_time(2i)' => 1, - :'arrival_time(1i)' => 2000 - }.map{ |k, v| - "<input name=\"vehicle_journey_frequency[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][#{k}]\" - type=\"hidden\" value=\"#{v}\">" }.join("\n").html_safe %> - - <%= vjas.stop_point.stop_area.name %> - </td> - <td class="ce-TimeBandFormTable-circleLine"> - <span class="ce-TimeBandFormTable-circle"></span> - <span class="ce-TimeBandFormTable-line"></span> - </td> - <td class="arrival_time <%= 'missing' unless vjas.arrival_time %> <%= 'invalid_position' if vjas.errors[:arrival_time].present? %>"> - <%= select_hour(vjas.arrival_time ? vjas.arrival_time.hour : 0, - { - prefix: 'vehicle_journey_frequency', - field_name: "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(4i)]" - }, class: 'hour', tabindex: tab_counter_arrival + 1) %> - <%= select_minute(vjas.arrival_time ? vjas.arrival_time.min : 0, - { - prefix: 'vehicle_journey_frequency', - field_name: "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(5i)]" - }, class: 'minute', tabindex: tab_counter_arrival + 2) %> - </td> - <td class="departure_time <%= 'missing' unless vjas.departure_time %> <%= 'invalid_position' if vjas.errors[:departure_time].present? %>"> - <%= select_hour(vjas.departure_time ? vjas.departure_time.hour : 0, - { - prefix: 'vehicle_journey_frequency', - field_name: "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][departure_time(4i)]" - }, class: 'hour', tabindex: tab_counter_departure + 1) %> - <%= select_minute(vjas.departure_time ? vjas.departure_time.min : 0, - { - prefix: 'vehicle_journey_frequency', - field_name: "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][departure_time(5i)]" - }, class: 'minute', tabindex: tab_counter_departure + 2) %> - </td> -</tr> diff --git a/app/views/vehicle_journey_frequencies/_vehicle_journey_at_stop_fields.html.slim b/app/views/vehicle_journey_frequencies/_vehicle_journey_at_stop_fields.html.slim new file mode 100644 index 000000000..6352cebdf --- /dev/null +++ b/app/views/vehicle_journey_frequencies/_vehicle_journey_at_stop_fields.html.slim @@ -0,0 +1,23 @@ +- vjas = vehicle_journey_at_stop +- tab_counter_arrival = 2 * vehicle_journey_at_stop_counter + 100 +- tab_counter_departure = (vehicle_journey_at_stops_size * 2) + 2 * vehicle_journey_at_stop_counter + 100 + +tr class="time input optional #{'no_stop' if vjas._destroy} #{cycle :odd, :even}" + td + = {id: vjas.id, _destroy: (vjas._destroy ? 1 : 0), stop_point_id: vjas.stop_point_id, :'departure_time(3i)' => 1, :'departure_time(2i)' => 1, :'departure_time(1i)' => 1, :'arrival_time(3i)' => 1, :'arrival_time(2i)' => 1, :'arrival_time(1i)' => 2000}.map{ |k, v| "<input name=\"vehicle_journey_frequency[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][#{k}]\" type=\"hidden\" value=\"#{v}\">" }.join("\n").html_safe + + = vjas.stop_point.stop_area.name + + td.ce-TimeBandFormTable-circleLine + span.ce-TimeBandFormTable-circle + span.ce-TimeBandFormTable-line + + td class="arrival_time #{'missing' unless vjas.arrival_time} #{'invalid_position' if vjas.errors[:arrival_time].present?}" + = select_hour(vjas.arrival_time ? vjas.arrival_time.hour : 0, { prefix: 'vehicle_journey_frequency', field_name: "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(4i)]" }, class: 'hour', tabindex: tab_counter_arrival + 1) + + = select_minute(vjas.arrival_time ? vjas.arrival_time.min : 0, { prefix: 'vehicle_journey_frequency', field_name: "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(5i)]" }, class: 'minute', tabindex: tab_counter_arrival + 2) + + td class="departure_time #{'missing' unless vjas.departure_time} #{'invalid_position' if vjas.errors[:departure_time].present?}" + = select_hour(vjas.departure_time ? vjas.departure_time.hour : 0, { prefix: 'vehicle_journey_frequency', field_name: "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][departure_time(4i)]" }, class: 'hour', tabindex: tab_counter_departure + 1) + + = select_minute(vjas.departure_time ? vjas.departure_time.min : 0, { prefix: 'vehicle_journey_frequency', field_name: "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][departure_time(5i)]" }, class: 'minute', tabindex: tab_counter_departure + 2)
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/_vehicle_journeys_matrix.html.erb b/app/views/vehicle_journey_frequencies/_vehicle_journeys_matrix.html.erb deleted file mode 100644 index c023f9cfb..000000000 --- a/app/views/vehicle_journey_frequencies/_vehicle_journeys_matrix.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<ul class="ce-VehicleJourneyFrequenciesMatrix"> -<% @vehicle_journeys.each do |vj| %> - <li> - <ul> - <% vj.journey_frequencies.each do |jf| %> - <% left, width = journey_frequency_percent(jf) %> - <li style="left:<%= left %>%;width:<%= width %>%" - data-style="primary" data-container="body" rel="popover" data-toggle="popover" - data-title='<%= link_to(vehicle_title(vj, jf), [@referential, @line, @route, vj] ) %> - <%= link_to('<span class="fa fa-pencil"></span>'.html_safe, - send("edit_referential_line_route_vehicle_journey#{'_frequency' if vj.frequency?}_path", @referential, @line, @route, vj), - :class => "btn btn-default btn-sm" ) %>' - data-placement= "top" - data-content='<%= render 'vehicle_journeys/show_popover', { vehicle_journey: vj } %>'> - <span class="ce-VehicleJourneyFrequenciesMatrix-firstDepartureTime"><%= l(jf.first_departure_time, format: :hour) %></span> - <span class="ce-VehicleJourneyFrequenciesMatrix-lastDepartureTime"><%= l(jf.last_departure_time, format: :hour) %></span> - </li> - <% end %> - </ul> - </li> -<% end %> -</ul> diff --git a/app/views/vehicle_journey_frequencies/_vehicle_journeys_matrix.html.slim b/app/views/vehicle_journey_frequencies/_vehicle_journeys_matrix.html.slim new file mode 100644 index 000000000..be6e76e08 --- /dev/null +++ b/app/views/vehicle_journey_frequencies/_vehicle_journeys_matrix.html.slim @@ -0,0 +1,11 @@ +ul.ce-VehicleJourneyFrequenciesMatrix + - @vehicle_journeys.each do |vj| + li + ul + - vj.journey_frequencies.each do |jf| + - left, width = journey_frequency_percent(jf) + + li style="left:#{left};width:#{width};" data-style="primary" data-container="body" rel="popover" data-toggle="popover" data-title="#{link_to(vehicle_title(vj, jf), [@referential, @line, @route, vj] )} #{link_to('<span class="fa fa-pencil"></span>'.html_safe, send("edit_referential_line_route_vehicle_journey#{'_frequency' if vj.frequency?}_path", @referential, @line, @route, vj), class: "btn btn-default btn-sm" )}" data-placement= "top" data-content="#{render 'vehicle_journeys/show_popover', { vehicle_journey: vj }}" + + span.ce-VehicleJourneyFrequenciesMatrix-firstDepartureTime = l(jf.first_departure_time, format: :hour) + span.ce-VehicleJourneyFrequenciesMatrix-lastDepartureTime = l(jf.last_departure_time, format: :hour)
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/edit.html.erb b/app/views/vehicle_journey_frequencies/edit.html.erb deleted file mode 100644 index 1bc1e6d88..000000000 --- a/app/views/vehicle_journey_frequencies/edit.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<%= title_tag edit_vehicle_title(@vehicle_journey_frequency) %> - -<%= render 'vehicle_journeys/form', vehicle_journey: @vehicle_journey_frequency, - form_url: referential_line_route_vehicle_journey_frequency_path(@referential, - @line, - @route, - id: @vehicle_journey_frequency) %> diff --git a/app/views/vehicle_journey_frequencies/edit.html.slim b/app/views/vehicle_journey_frequencies/edit.html.slim new file mode 100644 index 000000000..af5f1d88e --- /dev/null +++ b/app/views/vehicle_journey_frequencies/edit.html.slim @@ -0,0 +1,3 @@ += title_tag edit_vehicle_title(@vehicle_journey_frequency) + +== render 'vehicle_journeys/form', vehicle_journey: @vehicle_journey_frequency, form_url: referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route, id: @vehicle_journey_frequency)
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/edit.js.erb b/app/views/vehicle_journey_frequencies/edit.js.erb deleted file mode 100644 index f5aaf8ad7..000000000 --- a/app/views/vehicle_journey_frequencies/edit.js.erb +++ /dev/null @@ -1,10 +0,0 @@ -$(document).ready(function() { - $("#vehicle_journey_frequency_journey_pattern_id").change( - function(){ - var url = "<%= select_journey_pattern_referential_line_route_vehicle_journey_path( @referential, @line, @route, @vehicle_journey_frequency)%>?journey_pattern_id="+ - $("#vehicle_journey_frequency_journey_pattern_input select option:selected").attr("value"); - url += "&journey_category=frequency"; - $.get(url); - } - ); -}); diff --git a/app/views/vehicle_journey_frequencies/edit.js.slim b/app/views/vehicle_journey_frequencies/edit.js.slim new file mode 100644 index 000000000..de74b80c7 --- /dev/null +++ b/app/views/vehicle_journey_frequencies/edit.js.slim @@ -0,0 +1,10 @@ +| $(document).ready(function() { +| $("#vehicle_journey_frequency_journey_pattern_id").change( +| function(){ +| var url = "#{select_journey_pattern_referential_line_route_vehicle_journey_path( @referential, @line, @route, @vehicle_journey_frequency)}?journey_pattern_id="+ +| $("#vehicle_journey_frequency_journey_pattern_input select option:selected").attr("value"); +| url += "&journey_category=frequency"; +| $.get(url); +| } +| ); +| });
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/new.html.erb b/app/views/vehicle_journey_frequencies/new.html.erb deleted file mode 100644 index 677605276..000000000 --- a/app/views/vehicle_journey_frequencies/new.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= title_tag t('vehicle_journeys.new.title_frequency') %> - -<%= render 'vehicle_journeys/form', vehicle_journey: @vehicle_journey_frequency, - form_url: referential_line_route_vehicle_journey_frequencies_path(@referential, - @line, - @route) %> diff --git a/app/views/vehicle_journey_frequencies/new.html.slim b/app/views/vehicle_journey_frequencies/new.html.slim new file mode 100644 index 000000000..86a9d144c --- /dev/null +++ b/app/views/vehicle_journey_frequencies/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('vehicle_journeys.new.title_frequency') + +== render 'vehicle_journeys/form', vehicle_journey: @vehicle_journey_frequency, form_url: referential_line_route_vehicle_journey_frequencies_path(@referential, @line, @route)
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/new.js.erb b/app/views/vehicle_journey_frequencies/new.js.erb deleted file mode 100644 index b5fc75aef..000000000 --- a/app/views/vehicle_journey_frequencies/new.js.erb +++ /dev/null @@ -1,13 +0,0 @@ -$(document).ready(function() { - $("#vehicle_journey_frequency_journey_pattern_id").change( - function(){ - var vehicle_journey_journey_pattern_id = $("#vehicle_journey_frequency_journey_pattern_input select option:selected").attr("value"); - if (vehicle_journey_journey_pattern_id > 0) { - var url = "<%= referential_line_route_journey_patterns_path(@referential.id,@line.id,@route.id) %>"; - url = url + "/" + vehicle_journey_journey_pattern_id + - "/new_vehicle_journey?journey_category=frequency"; - $.get(url); - } - } - ); -}); diff --git a/app/views/vehicle_journey_frequencies/new.js.slim b/app/views/vehicle_journey_frequencies/new.js.slim new file mode 100644 index 000000000..f4d742f72 --- /dev/null +++ b/app/views/vehicle_journey_frequencies/new.js.slim @@ -0,0 +1,13 @@ +| $(document).ready(function() { +| $("#vehicle_journey_frequency_journey_pattern_id").change( +| function(){ +| var vehicle_journey_journey_pattern_id = $("#vehicle_journey_frequency_journey_pattern_input select option:selected").attr("value"); +| if (vehicle_journey_journey_pattern_id > 0) { +| var url = "#{referential_line_route_journey_patterns_path(@referential.id,@line.id,@route.id)}"; +| url = url + "/" + vehicle_journey_journey_pattern_id + +| "/new_vehicle_journey?journey_category=frequency"; +| $.get(url); +| } +| } +| ); +| });
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/select_journey_pattern.js.erb b/app/views/vehicle_journey_frequencies/select_journey_pattern.js.erb deleted file mode 100644 index 8fe20ed37..000000000 --- a/app/views/vehicle_journey_frequencies/select_journey_pattern.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -$('.journey_pattern_dependent_list').html('<%= escape_javascript( - render(partial: 'vehicle_journey_frequencies/vehicle_journey_at_stop_fields', - collection: @vehicle_journey.vehicle_journey_at_stops, - as: :vehicle_journey_at_stop, - locals: { vehicle_journey_at_stops_size: @vehicle_journey.vehicle_journey_at_stops.size })).html_safe %>'); diff --git a/app/views/vehicle_journey_frequencies/select_journey_pattern.js.slim b/app/views/vehicle_journey_frequencies/select_journey_pattern.js.slim new file mode 100644 index 000000000..205fee59e --- /dev/null +++ b/app/views/vehicle_journey_frequencies/select_journey_pattern.js.slim @@ -0,0 +1 @@ +| $('.journey_pattern_dependent_list').html("#{escape_javascript(render(partial: 'vehicle_journey_frequencies/vehicle_journey_at_stop_fields', collection: @vehicle_journey.vehicle_journey_at_stops, as: :vehicle_journey_at_stop, locals: { vehicle_journey_at_stops_size: @vehicle_journey.vehicle_journey_at_stops.size })).html_safe}");
\ No newline at end of file diff --git a/app/views/vehicle_journey_frequencies/show.html.erb b/app/views/vehicle_journey_frequencies/show.html.erb deleted file mode 100644 index 7939ae319..000000000 --- a/app/views/vehicle_journey_frequencies/show.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= render 'vehicle_journeys/show_details', vehicle_journey: @vehicle_journey_frequency %> -<%= render 'show_journey_frequencies' %> -<%= render 'show_sidebar' %> diff --git a/app/views/vehicle_journey_frequencies/show.html.slim b/app/views/vehicle_journey_frequencies/show.html.slim new file mode 100644 index 000000000..9701dbba9 --- /dev/null +++ b/app/views/vehicle_journey_frequencies/show.html.slim @@ -0,0 +1,3 @@ +== render 'vehicle_journeys/show_details', vehicle_journey: @vehicle_journey_frequency +== render 'show_journey_frequencies' +== render 'show_sidebar' diff --git a/app/views/vehicle_journey_imports/new.html.erb b/app/views/vehicle_journey_imports/new.html.erb deleted file mode 100644 index 7a0e0ac96..000000000 --- a/app/views/vehicle_journey_imports/new.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<%= title_tag t('vehicle_journey_imports.new.title') %> - -<div class="main_actions"> -</div> - -<%= semantic_form_for [@referential, @line, @route, @vehicle_journey_import] do |form| %> - <%= form.inputs do %> - <%= form.input :file, :as => :file, :input_html => { :title => "#{t('.tooltip.file')}", :'data-placement' => "right", :'data-toggle' => "tooltip", :'data-trigger' =>"hover" } %> - <% end %> - <%= form.actions do %> - <%= form.action :submit, :as => :button , :label => t( 'formtastic.import' ) %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> diff --git a/app/views/vehicle_journey_imports/new.html.slim b/app/views/vehicle_journey_imports/new.html.slim new file mode 100644 index 000000000..6220de273 --- /dev/null +++ b/app/views/vehicle_journey_imports/new.html.slim @@ -0,0 +1,11 @@ += title_tag t('vehicle_journey_imports.new.title') + +.main_actions + += semantic_form_for [@referential, @line, @route, @vehicle_journey_import] do |form| + = form.inputs do + = form.input :file, as: :file, input_html: { title: "#{t('.tooltip.file')}", 'data-placement': "right", 'data-toggle': "tooltip", 'data-trigger': "hover" } + + = form.actions do + = form.action :submit, as: :button , label: t('formtastic.import') + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_form.html.erb b/app/views/vehicle_journeys/_form.html.erb deleted file mode 100644 index 71f653b5c..000000000 --- a/app/views/vehicle_journeys/_form.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<%= semantic_form_for vehicle_journey, url: form_url do |form| %> - <%= render 'shared/form_messages', { errors: vehicle_journey.errors } %> - <%= form.inputs do %> - <%= form.input :journey_pattern, :as => :select, :collection => @route.journey_patterns, :member_label => Proc.new { |jp| journey_name(jp) } %> - <%= form.input :number %> - <%= form.input :published_journey_name %> - <%= form.input :published_journey_identifier %> - <%= form.input :comment %> - <%= form.input :transport_mode_name, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => true, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") } %> - <%= form.input :mobility_restricted_suitability, :as => :select, :collection => [[vehicle_journey.human_attribute_name("accessible"), true], [vehicle_journey.human_attribute_name("not_accessible"), false]], :include_blank => true %> - <%= form.input :flexible_service, :as => :select, :collection => [[vehicle_journey.human_attribute_name("on_demand_fs"), true], [vehicle_journey.human_attribute_name("regular_fs"), false]], :include_blank => true %> - <%= form.input :status_value %> - <%= form.input :facility %> - <%= form.input :vehicle_type_identifier%> - <%= form.input :objectid, :required => !vehicle_journey.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.vehicle_journey.objectid")} %> - <%= form.input :time_table_tokens, :label => t('.time_tables'), :as => :search_time_table, :json => referential_autocomplete_time_tables_path(@referential, :format => :json), :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new( 'autocomplete_time_tables/index', vehicle_journey.time_tables, :view_path => 'app/views', :format => :json, :scope => :self ).render } %> - <%= form.input :footnote_ids, :as => :check_boxes, :collection => @line.footnotes.map { |f| [ "#{f.code}: #{f.label}", f.id.to_s]} %> - - <%= render 'form_vehicle_journey_at_stops', vehicle_journey: vehicle_journey, form: form %> - - <% end %> - - <%= form.actions do %> - <%= form.action :submit, as: :button, label: t(".submit_#{vehicle_journey.journey_category}#{'_edit' unless form.object.new_record?}"), button_html: { class: 'btn btn-primary' } %> - <%= form.action :cancel, as: :link %> - <% end %> -<% end %> - -<%= render 'form_footer', vehicle_journey: vehicle_journey %> diff --git a/app/views/vehicle_journeys/_form.html.slim b/app/views/vehicle_journeys/_form.html.slim new file mode 100644 index 000000000..bc26e1ac5 --- /dev/null +++ b/app/views/vehicle_journeys/_form.html.slim @@ -0,0 +1,26 @@ += semantic_form_for vehicle_journey, url: form_url do |form| + == render 'shared/form_messages', { errors: vehicle_journey.errors } + + = form.inputs do + = form.input :journey_pattern, as: :select, :collection => @route.journey_patterns, :member_label => Proc.new { |jp| journey_name(jp) } + = form.input :number + = form.input :published_journey_name + = form.input :published_journey_identifier + = form.input :comment + = form.input :transport_mode_name, as: :select, :collection => Chouette::Line.transport_modes, :include_blank => true, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") } + = form.input :mobility_restricted_suitability, as: :select, :collection => [[vehicle_journey.human_attribute_name("accessible"), true], [vehicle_journey.human_attribute_name("not_accessible"), false]], :include_blank => true + = form.input :flexible_service, as: :select, :collection => [[vehicle_journey.human_attribute_name("on_demand_fs"), true], [vehicle_journey.human_attribute_name("regular_fs"), false]], :include_blank => true + = form.input :status_value + = form.input :facility + = form.input :vehicle_type_identifier + = form.input :objectid, :required => !vehicle_journey.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.vehicle_journey.objectid")} + = form.input :time_table_tokens, :label => t('.time_tables'), as: :search_time_table, :json => referential_autocomplete_time_tables_path(@referential, :format => :json), :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new( 'autocomplete_time_tables/index', vehicle_journey.time_tables, :view_path => 'app/views', :format => :json, :scope => :self ).render } + = form.input :footnote_ids, as: :check_boxes, :collection => @line.footnotes.map { |f| [ "#{f.code}: #{f.label}", f.id.to_s]} + + == render 'form_vehicle_journey_at_stops', vehicle_journey: vehicle_journey, form: form + + = form.actions do + = form.action :submit, as: :button, label: t(".submit_#{vehicle_journey.journey_category}#{'_edit' unless form.object.new_record?}"), button_html: { class: 'btn btn-primary' } + = form.action :cancel, as: :link + +== render 'form_footer', vehicle_journey: vehicle_journey
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_form_footer.html.erb b/app/views/vehicle_journeys/_form_footer.html.erb deleted file mode 100644 index c4c51b2b3..000000000 --- a/app/views/vehicle_journeys/_form_footer.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% if vehicle_journey.new_record? %> - <%= javascript_include_tag new_referential_line_route_vehicle_journey_path(@referential, @line, @route, :format => :js) %> -<% else %> - <%= javascript_include_tag edit_referential_line_route_vehicle_journey_path(@referential, @line, @route, vehicle_journey, :format => :js) %> -<% end %> diff --git a/app/views/vehicle_journeys/_form_footer.html.slim b/app/views/vehicle_journeys/_form_footer.html.slim new file mode 100644 index 000000000..d6f62fefe --- /dev/null +++ b/app/views/vehicle_journeys/_form_footer.html.slim @@ -0,0 +1,4 @@ +- if vehicle_journey.new_record? + = javascript_include_tag new_referential_line_route_vehicle_journey_path(@referential, @line, @route, format: :js) +- else + = javascript_include_tag edit_referential_line_route_vehicle_journey_path(@referential, @line, @route, vehicle_journey, format: :js)
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_form_vehicle_journey_at_stops.html.erb b/app/views/vehicle_journeys/_form_vehicle_journey_at_stops.html.erb deleted file mode 100644 index 7e9bc1b38..000000000 --- a/app/views/vehicle_journeys/_form_vehicle_journey_at_stops.html.erb +++ /dev/null @@ -1,49 +0,0 @@ -<li class="input"> - <%= form.label vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids), :class => "label" %> -</li> -<% unless vehicle_journey.vehicle_journey_at_stops.empty? || vehicle_journey.vehicle_journey_at_stops.any? { |vjas| vjas.departure_time.nil? } %> - <div class="vehicle_journey_at_stops"> - <div class="well"> - <span class="title"><%= t('vehicle_journeys.form.slide_title') %></span> - <div> - <span><%= t('vehicle_journeys.form.set') %></span> - <%= select_tag '', options_for_select( [ [t('vehicle_journeys.form.slide_departure'), "departure"], [t('vehicle_journeys.form.slide_arrival'), "arrival"] ] ), :class => "departure_or_arrival" %> - <span><%= t('vehicle_journeys.form.to') %></span> - <%= select_hour(vehicle_journey.vehicle_journey_at_stops.first.departure_time.hour) %> - <%= select_minute(vehicle_journey.vehicle_journey_at_stops.first.departure_time.min) %> - <a class="slide btn btn-default"><%= t('vehicle_journeys.form.slide') %></a> - </div> - </div> - </div> -<% end %> - -<table class="table table-hover table-striped"> - <thead> - <tr> - <th class="hour title"><%= t('vehicle_journeys.form.arrival') %></th> - <th class="stop title"><%= t('vehicle_journeys.form.stop_title') %></th> - <th class="hour title"><%= t('vehicle_journeys.form.departure') %></th> - </tr> - </thead> - <tfoot> - <tr> - <td class="title"> - <%= button_tag 'data-ce-action' => 'to_departures', class: 'ce-hide btn btn-primary' do %> - <%= t('vehicle_journeys.form.to_departures').html_safe %> - <i class="fa fa-angle-double-right"></i> - <% end %> - <td class="title"></td> - <td class="title"> - <%= button_tag 'data-ce-action' => 'to_arrivals', class: 'ce-hide btn btn-primary' do %> - <i class="fa fa-angle-double-left"></i> - <%= t('vehicle_journeys.form.to_arrivals').html_safe %> - <% end %> - </td> - </tr> - </tfoot> - <tbody class="journey_pattern_dependent_list"> - <%= render :partial => "vehicle_journeys/vehicle_journey_at_stop_fields", - :collection => vehicle_journey.vehicle_journey_at_stops, :as => :vehicle_journey_at_stop, - :locals => { :vehicle_journey_at_stops_size => vehicle_journey.vehicle_journey_at_stops.size } %> - </tbody> -</table> diff --git a/app/views/vehicle_journeys/_form_vehicle_journey_at_stops.html.slim b/app/views/vehicle_journeys/_form_vehicle_journey_at_stops.html.slim new file mode 100644 index 000000000..3ca636db8 --- /dev/null +++ b/app/views/vehicle_journeys/_form_vehicle_journey_at_stops.html.slim @@ -0,0 +1,39 @@ +li.input + = form.label vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids), class: "label" + +- unless vehicle_journey.vehicle_journey_at_stops.empty? || vehicle_journey.vehicle_journey_at_stops.any? { |vjas| vjas.departure_time.nil? } + .vehicle_journey_at_stops + .well + span.title = t('vehicle_journeys.form.slide_title') + div + span = t('vehicle_journeys.form.set') + = select_tag '', options_for_select( [ [t('vehicle_journeys.form.slide_departure'), "departure"], [t('vehicle_journeys.form.slide_arrival'), "arrival"] ] ), class: "departure_or_arrival" + + span = t('vehicle_journeys.form.to') + = select_hour(vehicle_journey.vehicle_journey_at_stops.first.departure_time.hour) + = select_minute(vehicle_journey.vehicle_journey_at_stops.first.departure_time.min) + + a.slide.btn.btn-default = t('vehicle_journeys.form.slide') + +table.table.table-hover.table-striped + thead + tr + th.hour.title = t('vehicle_journeys.form.arrival') + th.stop.title = t('vehicle_journeys.form.stop_title') + th.hour.title = t('vehicle_journeys.form.departure') + + tfoot + tr + td.title + = button_tag 'data-ce-action' => 'to_departures', class: 'ce-hide btn btn-primary' do + = t('vehicle_journeys.form.to_departures').html_safe + i.fa.fa-angle-double-right + + td.title + td.title + = button_tag 'data-ce-action' => 'to_arrivals', class: 'ce-hide btn btn-primary' do + i.fa.fa-angle-double-left + = t('vehicle_journeys.form.to_arrivals').html_safe + + tbody.journey_pattern_dependent_list + == render partial: "vehicle_journeys/vehicle_journey_at_stop_fields", collection: vehicle_journey.vehicle_journey_at_stops, as: :vehicle_journey_at_stop, locals: { :vehicle_journey_at_stops_size => vehicle_journey.vehicle_journey_at_stops.size }
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_route_popover.html.erb b/app/views/vehicle_journeys/_route_popover.html.erb deleted file mode 100644 index 7a8ad5730..000000000 --- a/app/views/vehicle_journeys/_route_popover.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<ul> -<% (selected_route.line.routes.limit(10).reject{ |route| route == selected_route}).each do |route| %> - <li><%= link_to (route.name ? route.name.truncate(30) : '-' ), [@referential, route.line, route, controller_name] %></li> -<% end %> -</ul> diff --git a/app/views/vehicle_journeys/_route_popover.html.slim b/app/views/vehicle_journeys/_route_popover.html.slim new file mode 100644 index 000000000..068ea673e --- /dev/null +++ b/app/views/vehicle_journeys/_route_popover.html.slim @@ -0,0 +1,3 @@ +ul + - (selected_route.line.routes.limit(10).reject{ |route| route == selected_route}).each do |route| + li = link_to (route.name ? route.name.truncate(30) : '-' ), [@referential, route.line, route, controller_name]
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_show_details.html.erb b/app/views/vehicle_journeys/_show_details.html.erb deleted file mode 100644 index fccf3d210..000000000 --- a/app/views/vehicle_journeys/_show_details.html.erb +++ /dev/null @@ -1,87 +0,0 @@ -<%= title_tag vehicle_title(vehicle_journey) %> - -<div id="modal_translation" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> - <h4 class="modal-title" id="myModalLabel"><%= t('vehicle_journeys.show.translation_form') %></h4> - <div id="translate_form"></div> - </div> - </div> - </div> -</div> - -<div class="vehicle_journey"> - <div class="summary"> - <p> - <label><%= vehicle_journey.human_attribute_name(:journey_pattern) %>: </label> - <%= link_to journey_name(vehicle_journey.journey_pattern), [@referential, @line, @route, vehicle_journey.journey_pattern] %> - </p> - <p> - <label><%= vehicle_journey.human_attribute_name("number") %>: </label> - <%= vehicle_journey.number %> - </p> - <p> - <label><%= vehicle_journey.human_attribute_name("published_journey_name") %>: </label> - <%= vehicle_journey.published_journey_name %> - </p> - <p> - <label><%= vehicle_journey.human_attribute_name("published_journey_identifier") %>: </label> - <%= vehicle_journey.published_journey_identifier %> - </p> - - <p> - <label><%= vehicle_journey.human_attribute_name("mobility_restricted_suitability") %>: </label> - <% if vehicle_journey.mobility_restricted_suitability.nil? %> - <%= vehicle_journey.human_attribute_name("unspecified_mrs") %> - <% elsif vehicle_journey.mobility_restricted_suitability? %> - <%= vehicle_journey.human_attribute_name("accessible") %> - <% else %> - <%= vehicle_journey.human_attribute_name("not_accessible") %> - <% end %> - </p> - <p> - <label><%= vehicle_journey.human_attribute_name("flexible_service") %>: </label> - <% if vehicle_journey.flexible_service.nil? %> - <%= vehicle_journey.human_attribute_name("unspecified_fs") %> - <% elsif vehicle_journey.flexible_service? %> - <%= vehicle_journey.human_attribute_name("on_demand_fs") %> - <% else %> - <%= vehicle_journey.human_attribute_name("regular_fs") %> - <% end %> - </p> - - <p> - <label><%= vehicle_journey.human_attribute_name("comment") %>: </label> - <%= vehicle_journey.comment %> - </p> - <p> - <label><%= vehicle_journey.human_attribute_name("status_value") %>: </label> - <%= vehicle_journey.status_value %> - </p> - <p> - <label><%= vehicle_journey.human_attribute_name("facility") %>: </label> - <%= vehicle_journey.facility %> - </p> - <p> - <label><%= vehicle_journey.human_attribute_name("vehicle_type_identifier") %>: </label> - <%= vehicle_journey.vehicle_type_identifier %> - </p> - <p> - <label><%= vehicle_journey.human_attribute_name("footnote_ids") %>: </label> - <ul> - <% vehicle_journey.footnotes.each do |footnote| %> - <li><%= footnote.code %> : <%= footnote.label %></li> - <% end %> - </ul> - </p> - </div> -</div> -<h3><%= vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids) %></h3> -<%= render 'show_vehicle_journey_at_stops' %> - -<h3><%= t('vehicle_journeys.show.time_tables') %></h3> -<div class="time_tables paginated_content"> - <%= paginated_content vehicle_journey.time_tables, "time_tables/time_table", :delete => false %> -</div> diff --git a/app/views/vehicle_journeys/_show_details.html.slim b/app/views/vehicle_journeys/_show_details.html.slim new file mode 100644 index 000000000..d9e4110c9 --- /dev/null +++ b/app/views/vehicle_journeys/_show_details.html.slim @@ -0,0 +1,82 @@ += title_tag vehicle_title(vehicle_journey) + +#modal_translation.modal.fade tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" + .modal-dialog + .modal-content + .modal-header + button.close type="button" data-dismiss="modal" + span aria-hidden="true" × + span.sr-only Close + + h4.modal-title id="myModalLabel" + = t('vehicle_journeys.show.translation_form') + + #translate_form + +.vehicle_journey + .summary + p + label = "#{vehicle_journey.human_attribute_name(:journey_pattern)} : " + = link_to journey_name(vehicle_journey.journey_pattern), [@referential, @line, @route, vehicle_journey.journey_pattern] + + p + label = "#{vehicle_journey.human_attribute_name('number')} : " + = vehicle_journey.number + + p + label = "#{vehicle_journey.human_attribute_name('published_journey_name')} : " + = vehicle_journey.published_journey_name + + p + label = "#{vehicle_journey.human_attribute_name('published_journey_identifier')} : " + = vehicle_journey.published_journey_identifier + + p + label = "#{vehicle_journey.human_attribute_name('mobility_restricted_suitability')} : " + - if vehicle_journey.mobility_restricted_suitability.nil? + = vehicle_journey.human_attribute_name("unspecified_mrs") + - elsif vehicle_journey.mobility_restricted_suitability? + = vehicle_journey.human_attribute_name("accessible") + - else + = vehicle_journey.human_attribute_name("not_accessible") + + p + label = "#{vehicle_journey.human_attribute_name('flexible_service')} : " + - if vehicle_journey.flexible_service.nil? + = vehicle_journey.human_attribute_name("unspecified_fs") + - elsif vehicle_journey.flexible_service? + = vehicle_journey.human_attribute_name("on_demand_fs") + - else + = vehicle_journey.human_attribute_name("regular_fs") + + p + label = "#{vehicle_journey.human_attribute_name('comment')} : " + = vehicle_journey.comment + + p + label = "#{vehicle_journey.human_attribute_name('status_value')} : " + = vehicle_journey.status_value + + p + label = "#{vehicle_journey.human_attribute_name('facility')} : " + = vehicle_journey.facility + + p + label = "#{vehicle_journey.human_attribute_name('vehicle_type_identifier')} : " + = vehicle_journey.vehicle_type_identifier + + p + label = "#{vehicle_journey.human_attribute_name('footnote_ids')} : " + + ul + - vehicle_journey.footnotes.each do |footnote| + li = "#{footnote.code} : #{footnote.label}" + +h3 = vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids) + +== render 'show_vehicle_journey_at_stops' + +h3 = t('vehicle_journeys.show.time_tables') + +.time_tables.paginated_content + = paginated_content vehicle_journey.time_tables, "time_tables/time_table", :delete => false
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_show_popover.html.erb b/app/views/vehicle_journeys/_show_popover.html.erb deleted file mode 100644 index 40a44e805..000000000 --- a/app/views/vehicle_journeys/_show_popover.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<p> - <%= Chouette::JourneyPattern.model_name.human %> : <%= link_to journey_name( vehicle_journey.journey_pattern ), [@referential, @line, @route, vehicle_journey.journey_pattern] %> -</p> -<p> - <%= vehicle_journey.time_tables.size %> <%= Chouette::TimeTable.model_name.human.pluralize %> <small><%= vehicle_journey.presenter.time_tables_shortest_info %></small> : - <ul> - <% vehicle_journey.time_tables.limit(4).each do |time_table| %> - <li> - <%= link_to [@referential, time_table] do %> - <span class="state-code <%= time_table.presenter.time_table_state_code %>"><i class="fa fa-certificate"></i></span> <%= time_table.comment %> - <% end %> - <% if time_table.tag_list.present? %> - <br> - <span class="time_table_info"><%= truncate(time_table.tag_list.to_s, :length => 35) %></span> - <% end %> - <br> - <% %w(monday tuesday wednesday thursday friday saturday sunday).each do |day_type| %> - <span class="<%= time_table.send( day_type) ? "included_day_type" : "excluded_day_type"%> time_table_info"> - <%= time_table.human_attribute_name(day_type).first(2) %> - </span> - <% end %> - <span class="bounding"><%= time_table.presenter.time_table_bounding %></span> - </li> - <% end %> - </ul> -</p> diff --git a/app/views/vehicle_journeys/_show_popover.html.slim b/app/views/vehicle_journeys/_show_popover.html.slim new file mode 100644 index 000000000..bf36915e8 --- /dev/null +++ b/app/views/vehicle_journeys/_show_popover.html.slim @@ -0,0 +1,25 @@ +p + = "#{Chouette::JourneyPattern.model_name.human} : #{link_to journey_name( vehicle_journey.journey_pattern ), [@referential, @line, @route, vehicle_journey.journey_pattern]}" + +p + = "#{vehicle_journey.time_tables.size} #{Chouette::TimeTable.model_name.human.pluralize}" + small = "#{vehicle_journey.presenter.time_tables_shortest_info} : " + + ul + - vehicle_journey.time_tables.limit(4).each do |time_table| + li + = link_to [@referential, time_table] do + span class="state-code #{time_table.presenter.time_table_state_code}" + i.fa.fa-certificate + = time_table.comment + + - if time_table.tag_list.present? + br + span.time_table_info = truncate(time_table.tag_list.to_s, :length => 35) + + br + - %w(monday tuesday wednesday thursday friday saturday sunday).each do |day_type| + span class="#{time_table.send( day_type) ? 'included_day_type' : 'excluded_day_type'} time_table_info" + = time_table.human_attribute_name(day_type).first(2) + + span.bounding = time_table.presenter.time_table_bounding
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_show_sidebar.html.erb b/app/views/vehicle_journeys/_show_sidebar.html.erb deleted file mode 100644 index 5ab7d449a..000000000 --- a/app/views/vehicle_journeys/_show_sidebar.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% content_for :sidebar do %> - <ul class="actions"> - <li><%= link_to t('vehicle_journeys.actions.new'), new_referential_line_route_vehicle_journey_path(@referential, @line, @route), :class => "add" %></li> - <li><%= link_to t('vehicle_journeys.actions.new_frequency'), new_referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route), :class => "add" %></li> - <li><%= link_to t('vehicle_journeys.actions.edit'), edit_referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :class => "edit" %></li> - <li><%= link_to t('vehicle_journeys.actions.destroy'), referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :method => :delete, :data => {:confirm => t('vehicle_journeys.actions.destroy_confirm')}, :class => "remove" %></li> - <% unless @vehicle_journey.vehicle_journey_at_stops.empty? %> - <li> - <i class="fa fa-cubes fa-fw" style="color:#D98F3B;"></i> - <%= link_to t('vehicle_journeys.show.translation_form'), new_referential_line_route_vehicle_journey_vehicle_translation_path(@referential, @line, @route, @vehicle_journey), {:remote => true, 'data-toggle' => "modal", 'data-target' => '#modal_translation', :class => "with_fa" } %> - </li> - <% end %> - </ul> - <%= creation_tag(@vehicle_journey) %> -<% end %> diff --git a/app/views/vehicle_journeys/_show_sidebar.html.slim b/app/views/vehicle_journeys/_show_sidebar.html.slim new file mode 100644 index 000000000..8117dd23b --- /dev/null +++ b/app/views/vehicle_journeys/_show_sidebar.html.slim @@ -0,0 +1,13 @@ +- content_for :sidebar do + ul.actions + li = link_to t('vehicle_journeys.actions.new'), new_referential_line_route_vehicle_journey_path(@referential, @line, @route), class: "add" + li = link_to t('vehicle_journeys.actions.new_frequency'), new_referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route), class: "add" + li = link_to t('vehicle_journeys.actions.edit'), edit_referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), class: "edit" + li = link_to t('vehicle_journeys.actions.destroy'), referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :method => :delete, :data => {:confirm => t('vehicle_journeys.actions.destroy_confirm')}, class: "remove" + + - unless @vehicle_journey.vehicle_journey_at_stops.empty? + li + i.fa.fa-cubes.fa-fw style="color:#D98F3B;" + = link_to t('vehicle_journeys.show.translation_form'), new_referential_line_route_vehicle_journey_vehicle_translation_path(@referential, @line, @route, @vehicle_journey), {:remote => true, 'data-toggle' => "modal", 'data-target' => '#modal_translation', class: "with_fa" } + + = creation_tag(@vehicle_journey)
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_show_vehicle_journey_at_stops.html.erb b/app/views/vehicle_journeys/_show_vehicle_journey_at_stops.html.erb deleted file mode 100644 index cb4a95263..000000000 --- a/app/views/vehicle_journeys/_show_vehicle_journey_at_stops.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -<div class="vehicle_journey_at_stops content"> - <table class="table table-hover table-striped"> - <thead> - <tr> - <th class="hour title"><%= t('vehicle_journeys.show.arrival') %></th> - <th class="stop title" ><%= t('vehicle_journeys.show.stop_title') %></th> - <th class="hour title"><%= t('vehicle_journeys.show.departure') %></th> - </tr> - <thead> - <tbody> - <% @vehicle_journey.vehicle_journey_at_stops.each_with_index do |vjas, index| %> - <tr class="<%= index%2==0 ? "odd" : "even" %>"> - <td class="hour <%= vjas.arrival_time.nil? ? "missing" : "" %>"><%= vjas.arrival_time ? l( vjas.arrival_time, :format => :hour) : "" %></td> - <td><%= link_to vjas.stop_point.stop_area.name, [@referential, vjas.stop_point.stop_area] %></td> - <td class="hour <%= vjas.departure_time.nil? ? "missing" : "" %>"><%= vjas.departure_time ? l( vjas.departure_time, :format => :hour) : "" %></td> - </tr> - <% end %> - </tbody> - </table> -</div> diff --git a/app/views/vehicle_journeys/_show_vehicle_journey_at_stops.html.slim b/app/views/vehicle_journeys/_show_vehicle_journey_at_stops.html.slim new file mode 100644 index 000000000..245227054 --- /dev/null +++ b/app/views/vehicle_journeys/_show_vehicle_journey_at_stops.html.slim @@ -0,0 +1,17 @@ +.vehicle_journey_at_stops.content + table.table.table-hover.table-striped + thead + tr + th.hour.title = t('vehicle_journeys.show.arrival') + th.stop.title = t('vehicle_journeys.show.stop_title') + th.hour.title = t('vehicle_journeys.show.departure') + + tbody + - @vehicle_journey.vehicle_journey_at_stops.each_with_index do |vjas, index| + tr class="#{index%2==0 ? 'odd' : 'even'}" + td class="hour #{vjas.arrival_time.nil? ? 'missing' : '' }" + = vjas.arrival_time ? l( vjas.arrival_time, :format => :hour) : "" + + td = link_to vjas.stop_point.stop_area.name, [@referential, vjas.stop_point.stop_area] + td class="hour #{vjas.departure_time.nil? ? 'missing' : '' }" + = vjas.departure_time ? l( vjas.departure_time, :format => :hour) : ""
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_sidebar.html.erb b/app/views/vehicle_journeys/_sidebar.html.erb deleted file mode 100644 index 11260cd7b..000000000 --- a/app/views/vehicle_journeys/_sidebar.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<ul class="actions"> - <li><%= link_to t('vehicle_journeys.actions.new'), new_referential_line_route_vehicle_journey_path(@referential, @line, @route), :class => "add" %></li> - <li><%= link_to t('vehicle_journeys.actions.new_frequency'), new_referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route), :class => "add" %></li> - <li><%= link_to t('vehicle_journey_imports.new.title'), new_referential_line_route_vehicle_journey_import_path( @referential, @line, @route ), :class => "import" %></li> - <li><%= link_to t('vehicle_journey_exports.new.title'), referential_line_route_vehicle_journey_exports_path(@referential, @line, @route, :format => :zip), :class => "export" %></li> -</ul> - diff --git a/app/views/vehicle_journeys/_sidebar.html.slim b/app/views/vehicle_journeys/_sidebar.html.slim new file mode 100644 index 000000000..8d9627ba0 --- /dev/null +++ b/app/views/vehicle_journeys/_sidebar.html.slim @@ -0,0 +1,9 @@ +ul.actions + li + = link_to t('vehicle_journeys.actions.new'), new_referential_line_route_vehicle_journey_path(@referential, @line, @route), class: "add" + li + = link_to t('vehicle_journeys.actions.new_frequency'), new_referential_line_route_vehicle_journey_frequency_path(@referential, @line, @route), class: "add" + li + = link_to t('vehicle_journey_imports.new.title'), new_referential_line_route_vehicle_journey_import_path( @referential, @line, @route ), class: "import" + li + = link_to t('vehicle_journey_exports.new.title'), referential_line_route_vehicle_journey_exports_path(@referential, @line, @route, :format => :zip), class: "export"
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb b/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb deleted file mode 100644 index fbd4e733a..000000000 --- a/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<% vjas = vehicle_journey_at_stop - tab_counter_arrival = 2 * vehicle_journey_at_stop_counter + 100 - tab_counter_departure = (vehicle_journey_at_stops_size * 2) + 2 * vehicle_journey_at_stop_counter + 100 - %> -<tr class="time input optional <%= vjas._destroy ? "no_stop" : "" %> <%= (vehicle_journey_at_stop_counter%2==0) ? "odd" : "even" %>" > - <td class="arrival_time <%= vjas.arrival_time.nil? ? "missing" : "" %> <%= vjas.errors[:arrival_time].blank? ? "" : "invalid_position" %>"> - <%= select_hour(vjas.arrival_time ? vjas.arrival_time.hour : 0, { :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(4i)]"}, :class => "hour", :tabindex => tab_counter_arrival + 1 ) %> - <%= select_minute(vjas.arrival_time ? vjas.arrival_time.min : 0, { :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(5i)]"}, :class => "minute", :tabindex => tab_counter_arrival + 2) %> - </td> - <td> - <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][id]" %> type="hidden" value="<%= vjas.id %>"> - <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][_destroy]" %> type="hidden" value="<%= vjas._destroy ? "1" : "0" %>"> - <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][stop_point_id]" %> type="hidden" value="<%= vjas.stop_point_id %>"> - <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][departure_time(3i)]" %> type="hidden" value="1"> - <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][departure_time(2i)]" %> type="hidden" value="1"> - <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][departure_time(1i)]" %> type="hidden" value="2000"> - <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][arrival_time(3i)]" %> type="hidden" value="1"> - <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][arrival_time(2i)]" %> type="hidden" value="1"> - <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][arrival_time(1i)]" %> type="hidden" value="2000"> - <label for=<%= "vehicle_journey_vehicle_journey_at_stops_attributes_#{vehicle_journey_at_stop_counter}_departure_time_5i" %>><%= vjas.stop_point.stop_area.name %></label> - </td> - <td class="departure_time <%= vjas.departure_time.nil? ? "missing" : "" %> <%= vjas.errors[:departure_time].blank? ? "" : "invalid_position" %>"> - <%= select_hour(vjas.departure_time ? vjas.departure_time.hour : 0, { :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][departure_time(4i)]"}, :class => "hour", :tabindex => tab_counter_departure + 1 ) %> - <%= select_minute(vjas.departure_time ? vjas.departure_time.min : 0, { :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][departure_time(5i)]"}, :class => "minute", :tabindex => tab_counter_departure + 2) %> - </td> -</tr> - diff --git a/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.slim b/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.slim new file mode 100644 index 000000000..59401728a --- /dev/null +++ b/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.slim @@ -0,0 +1,26 @@ +- vjas = vehicle_journey_at_stop +- tab_counter_arrival = 2 * vehicle_journey_at_stop_counter + 100 +- tab_counter_departure = (vehicle_journey_at_stops_size * 2) + 2 * vehicle_journey_at_stop_counter + 100 + +tr class="time input optional #{vjas._destroy ? 'no_stop' : ''} #{(vehicle_journey_at_stop_counter%2==0) ? 'odd' : 'even'}" + td class="arrival_time #{vjas.arrival_time.nil? ? 'missing' : ''}" #{vjas.errors[:arrival_time].blank? ? '' : 'invalid_position'}" + = select_hour(vjas.arrival_time ? vjas.arrival_time.hour : 0, { :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(4i)]"}, class: "hour", :tabindex => tab_counter_arrival + 1 ) + = select_minute(vjas.arrival_time ? vjas.arrival_time.min : 0, { :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(5i)]"}, class: "minute", :tabindex => tab_counter_arrival + 2) + + td + input name="vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][id]" type="hidden" value="#{vjas.id}" + input name="vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][_destroy]" type="hidden" value="#{vjas._destroy ? '1' : '0' }" + input name="vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][stop_point_id]" type="hidden" value="#{vjas.stop_point_id}" + input name="vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][departure_time(3i)]" type="hidden" value="1" + input name="vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][departure_time(2i)]" type="hidden" value="1" + input name="vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][departure_time(1i)]" type="hidden" value="2000" + input name="vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][arrival_time(3i)]" type="hidden" value="1" + input name="vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][arrival_time(2i)]" type="hidden" value="1" + input name="vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][arrival_time(1i)]" type="hidden" value="2000" + + label for="vehicle_journey_vehicle_journey_at_stops_attributes_#{vehicle_journey_at_stop_counter}_departure_time_5i" + = vjas.stop_point.stop_area.name + + td class="departure_time #{vjas.departure_time.nil? ? 'missing' : ''} #{vjas.errors[:departure_time].blank? ? '' : 'invalid_position'}" + = select_hour(vjas.departure_time ? vjas.departure_time.hour : 0, { :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][departure_time(4i)]"}, :class => "hour", :tabindex => tab_counter_departure + 1 ) + = select_minute(vjas.departure_time ? vjas.departure_time.min : 0, { :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][departure_time(5i)]"}, :class => "minute", :tabindex => tab_counter_departure + 2)
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_vehicle_journeys.html.erb b/app/views/vehicle_journeys/_vehicle_journeys.html.erb deleted file mode 100644 index c321b960b..000000000 --- a/app/views/vehicle_journeys/_vehicle_journeys.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<div class="page_info"> - <span class="search"><%= t("will_paginate.page_entries_info.search") %></span> - <%= page_entries_info @vehicle_journeys %> - <span class="pull-right"> - <% if controller_name == 'vehicle_journey_frequencies' && exist_vehicle_journeys?(@route) %> - <i class="fa fa-clock-o"></i> - <%= link_to t("vehicle_journeys.actions.show"), referential_line_route_vehicle_journeys_path(@referential, @line, @route) %> - <% elsif controller_name == 'vehicle_journeys' && exist_vehicle_journey_frequencies?(@route) %> - <i class="fa fa-clock-o"></i> - <%= link_to t("vehicle_journey_frequencies.actions.show"), referential_line_route_vehicle_journey_frequencies_path(@referential, @line, @route) %> - <% end %> - </span> -</div> -<div class="pagination"> - <%= will_paginate @vehicle_journeys, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> -<div class="vehicle_journeys paginated_content"> - <%= render 'vehicle_journeys_matrix' %> -</div> -<div class="pagination"> - <%= will_paginate @vehicle_journeys, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/vehicle_journeys/_vehicle_journeys.html.slim b/app/views/vehicle_journeys/_vehicle_journeys.html.slim new file mode 100644 index 000000000..3a8fdd730 --- /dev/null +++ b/app/views/vehicle_journeys/_vehicle_journeys.html.slim @@ -0,0 +1,21 @@ +.page_info + span.search = t("will_paginate.page_entries_info.search") + + = page_entries_info @vehicle_journeys + + span.pull-right + - if controller_name == 'vehicle_journey_frequencies' && exist_vehicle_journeys?(@route) + i.fa.fa-clock-o + = link_to t("vehicle_journeys.actions.show"), referential_line_route_vehicle_journeys_path(@referential, @line, @route) + - elsif controller_name == 'vehicle_journeys' && exist_vehicle_journey_frequencies?(@route) + i.fa.fa-clock-o + = link_to t("vehicle_journey_frequencies.actions.show"), referential_line_route_vehicle_journey_frequencies_path(@referential, @line, @route) + +.pagination + = will_paginate @vehicle_journeys, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer + +.vehicle_journeys.paginated_content + == render 'vehicle_journeys_matrix' + +.pagination + = will_paginate @vehicle_journeys, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/vehicle_journeys/_vehicle_journeys_matrix.html.erb b/app/views/vehicle_journeys/_vehicle_journeys_matrix.html.erb deleted file mode 100644 index 3254430cd..000000000 --- a/app/views/vehicle_journeys/_vehicle_journeys_matrix.html.erb +++ /dev/null @@ -1,40 +0,0 @@ -<table class="table table-hover table-striped"> - <thead> - <tr> - <th class="title"> - <button data-style="primary" data-container="body" rel="popover" data-toggle="popover" title='<%= t(".line_routes") %>' - data-placement="top" data-content='<%= render( partial: "route_popover", :locals => { :selected_route => @route }) %>' - class="route_popover btn btn-default btn-sm"> - <i class='fa fa-search'></i> - <%= Chouette::Route.model_name.human.capitalize %> - </button> - </th> - <% @vehicle_journeys.each do |vj| %> - <th class="vehicle_journey"> - <button data-style="primary" data-container="body" rel="popover" data-toggle="popover" - data-title='<%= link_to(vehicle_title(vj), [@referential, @line, @route, vj] ) %> - <%= link_to('<span class="fa fa-pencil"></span>'.html_safe, - send("edit_referential_line_route_vehicle_journey#{'_frequency' if vj.frequency?}_path", @referential, @line, @route, vj), - :class => "btn btn-default btn-sm" ) %>' - data-placement= "top" - data-content='<%= render( partial: "show_popover", :locals => { :vehicle_journey => vj }) %>' - class="vehicle_journey_popover btn btn-default btn-sm"> - <i class='fa fa-search'></i> - </button> - </th> - <% end %> - </tr> - </thead> - <tbody> - <% @route.stop_points.each_with_index do |sp, index| %> - <tr class="<%= cycle('odd', 'even') %>"> - <td class="stop_area"><%= sp.stop_area.name %></td> - <% @vehicle_journeys.each do |vj| %> - <td class="hours <%= missing_time_check(@matrix["#{vj.id}-#{sp.id}"]) %><%= ' ce-VehicleJourneyBlock-frequency' if vj.frequency? %>"> - <%= (@matrix["#{vj.id}-#{sp.id}"] && @matrix["#{vj.id}-#{sp.id}"].departure_time) ? l( @matrix["#{vj.id}-#{sp.id}"].departure_time, :format => :hour) : "--" %> - </td> - <% end %> - </tr> - <% end %> - </tbody> -</table> diff --git a/app/views/vehicle_journeys/_vehicle_journeys_matrix.html.slim b/app/views/vehicle_journeys/_vehicle_journeys_matrix.html.slim new file mode 100644 index 000000000..e842d836f --- /dev/null +++ b/app/views/vehicle_journeys/_vehicle_journeys_matrix.html.slim @@ -0,0 +1,21 @@ +table.table.table-hover.table-striped + thead + tr + th.title + button data-style="primary" data-container="body" rel="popover" data-toggle="popover" title="#{t('.line_routes')}" data-placement="top" data-content="#{render( partial: 'route_popover', :locals => { :selected_route => @route })}" class="route_popover btn btn-default btn-sm" + i.fa.fa-search + = Chouette::Route.model_name.human.capitalize + + - @vehicle_journeys.each do |vj| + th.vehicle_journey + button data-style="primary" data-container="body" rel="popover" data-toggle="popover" data-title="#{link_to(vehicle_title(vj), [@referential, @line, @route, vj] )} #{link_to('<span class="fa fa-pencil"></span>'.html_safe, send("edit_referential_line_route_vehicle_journey#{'_frequency' if vj.frequency?}_path", @referential, @line, @route, vj), :class => "btn btn-default btn-sm" )}" data-placement= "top" data-content="#{render( partial: "show_popover", :locals => { :vehicle_journey => vj })}" class="vehicle_journey_popover btn btn-default btn-sm" + i.fa.fa-search + + tbody + - @route.stop_points.each_with_index do |sp, index| + tr class="#{cycle('odd', 'even')}" + td.stop_area = sp.stop_area.name + + - @vehicle_journeys.each do |vj| + td class="hours #{missing_time_check(@matrix['#{vj.id}-#{sp.id}'])}#{'ce-VehicleJourneyBlock-frequency' if vj.frequency?}" + = (@matrix["#{vj.id}-#{sp.id}"] && @matrix["#{vj.id}-#{sp.id}"].departure_time) ? l( @matrix["#{vj.id}-#{sp.id}"].departure_time, :format => :hour) : "--"
\ No newline at end of file diff --git a/app/views/vehicle_journeys/edit.html.erb b/app/views/vehicle_journeys/edit.html.erb deleted file mode 100644 index 0d3a2db96..000000000 --- a/app/views/vehicle_journeys/edit.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<%= title_tag edit_vehicle_title(@vehicle_journey) %> - -<%= render 'form', vehicle_journey: @vehicle_journey, form_url: referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey) %> - - diff --git a/app/views/vehicle_journeys/edit.html.slim b/app/views/vehicle_journeys/edit.html.slim new file mode 100644 index 000000000..8b3dbcf51 --- /dev/null +++ b/app/views/vehicle_journeys/edit.html.slim @@ -0,0 +1,3 @@ += title_tag edit_vehicle_title(@vehicle_journey) + +== render 'form', vehicle_journey: @vehicle_journey, form_url: referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey)
\ No newline at end of file diff --git a/app/views/vehicle_journeys/edit.js.erb b/app/views/vehicle_journeys/edit.js.erb deleted file mode 100644 index b16d9d343..000000000 --- a/app/views/vehicle_journeys/edit.js.erb +++ /dev/null @@ -1,9 +0,0 @@ -$(document).ready(function() { - $("#vehicle_journey_journey_pattern_id").change( - function(){ - var url = "<%= select_journey_pattern_referential_line_route_vehicle_journey_path( @referential, @line, @route, @vehicle_journey)%>?journey_pattern_id="+ - $("#vehicle_journey_journey_pattern_input select option:selected").attr("value"); - $.get(url); - } - ) -}); diff --git a/app/views/vehicle_journeys/edit.js.slim b/app/views/vehicle_journeys/edit.js.slim new file mode 100644 index 000000000..9556d8474 --- /dev/null +++ b/app/views/vehicle_journeys/edit.js.slim @@ -0,0 +1,9 @@ +| $(document).ready(function() { +| $("#vehicle_journey_journey_pattern_id").change( +| function(){ +| var url = "#{select_journey_pattern_referential_line_route_vehicle_journey_path( @referential, @line, @route, @vehicle_journey)}?journey_pattern_id="+ +| $("#vehicle_journey_journey_pattern_input select option:selected").attr("value"); +| $.get(url); +| } +| ) +| }); diff --git a/app/views/vehicle_journeys/index.html.erb b/app/views/vehicle_journeys/index.html.erb deleted file mode 100644 index 3fd123c79..000000000 --- a/app/views/vehicle_journeys/index.html.erb +++ /dev/null @@ -1,99 +0,0 @@ -<%= title_tag t('vehicle_journeys.index.title', :route => @route.name ) %> - -<%= search_form_for @q, :url => referential_line_route_vehicle_journeys_path(@referential,@line,@route), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <%= f.label :journey_pattern_id_eq, "Missions" %> - <%= f.text_field(:journey_pattern_id_eq, :class => "form-control") %> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - <a data-toggle="collapse" data-parent="#search" href="#advanced_search" class="advanced_search"> - <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> - </a> - </div> - - <div id="advanced_search" class="panel-collapse collapse"> - <div class="panel-body"> - <div> - <%= f.label :time_tables_id_not_eq, "Sans calendrier" %> - <%= f.check_box :time_tables_id_not_eq %> - - <span class="time_tables_id_eq"> - <%= f.label :time_tables_id_eq, "Sélectionner calendriers" %> - <%= f.text_field :time_tables_id_eq, :input_html => { :"data-pre" => [].to_json} %> - </span> - </div> - <% if controller_name != 'vehicle_journey_frequencies' %> - <div> - <%= f.label :vehicle_journey_at_stops_departure_time_not_eq, "Sans horaire" %> - <%= f.check_box :vehicle_journey_at_stops_departure_time_not_eq %> - - <span class="vehicle_journey_at_stops_departure_time_gt"> - <input name=<%= "q[vehicle_journey_at_stops_departure_time_gt(3i)]" %> type="hidden" value="1"> - <input name=<%= "q[vehicle_journey_at_stops_departure_time_gt(2i)]" %> type="hidden" value="1"> - <input name=<%= "q[vehicle_journey_at_stops_departure_time_gt(1i)]" %> type="hidden" value="2000"> - <%= f.label :vehicle_journey_at_stops_departure_time_gt, t('.time_range') %> - <%= select_hour(@q.send( "vehicle_journey_at_stops_departure_time_gt") ? @q.send( "vehicle_journey_at_stops_departure_time_gt").hour : 0, - :prefix => "q", :field_name => "vehicle_journey_at_stops_departure_time_gt(4i)") %> - <%= select_minute(@q.send( "vehicle_journey_at_stops_departure_time_gt") ? @q.send( "vehicle_journey_at_stops_departure_time_gt").min : 0, - :prefix => "q", :field_name => "vehicle_journey_at_stops_departure_time_gt(5i)") %> - </span> - </div> - <% end %> - </div> - </div> -</div> -<% end %> -<div id="vehicle_journeys" ><%= render "vehicle_journeys" %></div> - -<% content_for :sidebar do %> - <%= render "sidebar" %> -<% end %> -<script> - $(function() { - var time_tables_url = function(){ - return '<%= referential_autocomplete_time_tables_path(@referential, :format => :json) %>?route_id=<%= @route.id %>'; - }; - var time_table_formatter = function(item){ - var day_types = ''; - if ( item.day_types.length >0 ){ - day_types = '<span class=\"day_types\">' + item.day_types + '</span>' ; - } - var tags = ''; - if ( item.tags.length >0 ){ - tags = '<div class=\"info\">' + item.tags + '</div>' ; - } - return '<li><div class=\"comment\">' + item.comment + - '</div><div class=\"info\">' + item.time_table_bounding + ' ' + day_types + '</div>' + - tags + '</li>'; - }; - $( "#q_time_tables_id_eq" ).tokenInput( time_tables_url, { - crossDomain: false, - prePopulate: $('#q_time_tables_id_eq').data('pre'), - minChars: 2, - propertyToSearch: 'comment', - hintText: '<%= t('search_hint') %>', - noResultsText: '<%= t('no_result_text') %>', - searchingText: '<%= t('searching_term') %>', - resultsFormatter: time_table_formatter, - tokenFormatter: time_table_formatter - }); - $( "#q_journey_pattern_id_eq" ).tokenInput( '<%= referential_line_route_journey_patterns_path(@referential, @line, @route, :format => :json) %>', { - crossDomain: false, - prePopulate: $('#q_journey_pattern_id_eq').data('pre'), - minChars: 1, - queryParam: 'q[name_cont]', - propertyToSearch: 'name', - hintText: '<%= t('search_hint') %>', - noResultsText: '<%= t('no_result_text') %>', - searchingText: '<%= t('searching_term') %>', - resultsFormatter: function(item){ return '<li><div class=\"name\">' + item.name + ', (' + item.id + ') </div></li>' }, - }); - $( 'input[name="q[time_tables_id_not_eq]"]').change( function(){ - $('span.time_tables_id_eq').toggle( $(this).filter(":checked").val()==undefined); - }); - $( 'input[name="q[vehicle_journey_at_stops_departure_time_not_eq]"]').change( function(){ - $('span.vehicle_journey_at_stops_departure_time_gt').toggle( $(this).filter(":checked").val()==undefined); - }); - - }); -</script> diff --git a/app/views/vehicle_journeys/index.html.slim b/app/views/vehicle_journeys/index.html.slim new file mode 100644 index 000000000..e59f2ca1b --- /dev/null +++ b/app/views/vehicle_journeys/index.html.slim @@ -0,0 +1,93 @@ += title_tag t('vehicle_journeys.index.title', route: @route.name ) + += search_form_for @q, :url => referential_line_route_vehicle_journeys_path(@referential,@line,@route), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| + .panel.panel-default + .panel-heading + = f.label :journey_pattern_id_eq, "Missions" + = f.text_field(:journey_pattern_id_eq, class: "form-control") + + button.btn.btn-default type="submit" + i.fa.fa-search + + a.advanced_search data-toggle="collapse" data-parent="#search" href="#advanced_search" + i.fa.fa-plus + = "#{t('.advanced_search')}" + + #advanced_search.panel-collapse.collapse + .panel-body + div + = f.label :time_tables_id_not_eq, "Sans calendrier" + = f.check_box :time_tables_id_not_eq + + span.time_tables_id_eq + = f.label :time_tables_id_eq, "Sélectionner calendriers" + = f.text_field :time_tables_id_eq, :input_html => { :"data-pre" => [].to_json} + + - if controller_name != 'vehicle_journey_frequencies' + div + = f.label :vehicle_journey_at_stops_departure_time_not_eq, "Sans horaire" + = f.check_box :vehicle_journey_at_stops_departure_time_not_eq + + span.vehicle_journey_at_stops_departure_time_gt + input name="#{q[vehicle_journey_at_stops_departure_time_gt(3i)]}" type="hidden" value="1" + input name="#{q[vehicle_journey_at_stops_departure_time_gt(2i)]}" type="hidden" value="1" + input name="#{q[vehicle_journey_at_stops_departure_time_gt(1i)]}" type="hidden" value="2000" + + = f.label :vehicle_journey_at_stops_departure_time_gt, t('.time_range') + = select_hour(@q.send( "vehicle_journey_at_stops_departure_time_gt") ? @q.send( "vehicle_journey_at_stops_departure_time_gt").hour : 0, :prefix => "q", :field_name => "vehicle_journey_at_stops_departure_time_gt(4i)") + = select_minute(@q.send( "vehicle_journey_at_stops_departure_time_gt") ? @q.send( "vehicle_journey_at_stops_departure_time_gt").min : 0, :prefix => "q", :field_name => "vehicle_journey_at_stops_departure_time_gt(5i)") + +#vehicle_journeys + == render "vehicle_journeys" + +- content_for :sidebar do + == render "sidebar" + +javascript: + $(function() { + var time_tables_url = function(){ + return "#{referential_autocomplete_time_tables_path(@referential, :format => :json)}?route_id=#{@route.id}"; + }; + + var time_table_formatter = function(item){ + var day_types = ''; + if ( item.day_types.length >0 ){ + day_types = '<span class=\"day_types\">' + item.day_types + '</span>' ; + } + var tags = ''; + if ( item.tags.length >0 ){ + tags = '<div class=\"info\">' + item.tags + '</div>' ; + } + return '<li><div class=\"comment\">' + item.comment + + '</div><div class=\"info\">' + item.time_table_bounding + ' ' + day_types + '</div>' + + tags + '</li>'; + }; + $( "#q_time_tables_id_eq" ).tokenInput( time_tables_url, { + crossDomain: false, + prePopulate: $('#q_time_tables_id_eq').data('pre'), + minChars: 2, + propertyToSearch: 'comment', + hintText: "#{t('search_hint')}", + noResultsText: "#{t('no_result_text')}", + searchingText: "#{t('searching_term')}", + resultsFormatter: time_table_formatter, + tokenFormatter: time_table_formatter + }); + $( "#q_journey_pattern_id_eq" ).tokenInput("#{referential_line_route_journey_patterns_path(@referential, @line, @route, :format => :json)}", { + crossDomain: false, + prePopulate: $('#q_journey_pattern_id_eq').data('pre'), + minChars: 1, + queryParam: 'q[name_cont]', + propertyToSearch: 'name', + hintText: "#{t('search_hint')}", + noResultsText: "#{t('no_result_text')}", + searchingText: "#{t('searching_term')}", + resultsFormatter: function(item){ return '<li><div class=\"name\">' + item.name + ', (' + item.id + ') </div></li>' }, + }); + $( 'input[name="q[time_tables_id_not_eq]"]').change( function(){ + $('span.time_tables_id_eq').toggle( $(this).filter(":checked").val()==undefined); + }); + $( 'input[name="q[vehicle_journey_at_stops_departure_time_not_eq]"]').change( function(){ + $('span.vehicle_journey_at_stops_departure_time_gt').toggle( $(this).filter(":checked").val()==undefined); + }); + });
\ No newline at end of file diff --git a/app/views/vehicle_journeys/index.js.erb b/app/views/vehicle_journeys/index.js.erb deleted file mode 100644 index 72b57c8fb..000000000 --- a/app/views/vehicle_journeys/index.js.erb +++ /dev/null @@ -1,2 +0,0 @@ -$('#vehicle_journeys').html('<%= escape_javascript(render("vehicle_journeys")) %>'); - diff --git a/app/views/vehicle_journeys/index.js.slim b/app/views/vehicle_journeys/index.js.slim new file mode 100644 index 000000000..bc4c1f780 --- /dev/null +++ b/app/views/vehicle_journeys/index.js.slim @@ -0,0 +1 @@ +| $('#vehicle_journeys').html("#{escape_javascript(render('vehicle_journeys'))}");
\ No newline at end of file diff --git a/app/views/vehicle_journeys/new.html.erb b/app/views/vehicle_journeys/new.html.erb deleted file mode 100644 index d2e9d7c4c..000000000 --- a/app/views/vehicle_journeys/new.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('vehicle_journeys.new.title') %> - -<%= render 'form', { vehicle_journey: @vehicle_journey, form_url: referential_line_route_vehicle_journeys_path(@referential, @line, @route, @vehicle_journey) } %> - diff --git a/app/views/vehicle_journeys/new.html.slim b/app/views/vehicle_journeys/new.html.slim new file mode 100644 index 000000000..6c13aa7a1 --- /dev/null +++ b/app/views/vehicle_journeys/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('vehicle_journeys.new.title') + +== render 'form', { vehicle_journey: @vehicle_journey, form_url: referential_line_route_vehicle_journeys_path(@referential, @line, @route, @vehicle_journey) }
\ No newline at end of file diff --git a/app/views/vehicle_journeys/new.js.erb b/app/views/vehicle_journeys/new.js.slim index 160e7a34b..df9d48e7e 100644 --- a/app/views/vehicle_journeys/new.js.erb +++ b/app/views/vehicle_journeys/new.js.slim @@ -3,7 +3,7 @@ $(document).ready(function() { function(){ var vehicle_journey_journey_pattern_id = $("#vehicle_journey_journey_pattern_input select option:selected").attr("value"); if (vehicle_journey_journey_pattern_id > 0) { - var url = "<%= referential_line_route_journey_patterns_path(@referential.id,@line.id,@route.id) %>"; + var url = "#{referential_line_route_journey_patterns_path(@referential.id,@line.id,@route.id)}"; url = url + "/" + vehicle_journey_journey_pattern_id + "/new_vehicle_journey"; $.get(url); diff --git a/app/views/vehicle_journeys/select_journey_pattern.js.erb b/app/views/vehicle_journeys/select_journey_pattern.js.erb deleted file mode 100644 index 6a32c7b9d..000000000 --- a/app/views/vehicle_journeys/select_journey_pattern.js.erb +++ /dev/null @@ -1,7 +0,0 @@ -$('.journey_pattern_dependent_list').html('<%= escape_javascript( - render(:partial => 'vehicle_journeys/vehicle_journey_at_stop_fields', - :collection => @vehicle_journey.vehicle_journey_at_stops, - :as => :vehicle_journey_at_stop, - :locals => { :vehicle_journey_at_stops_size => @vehicle_journey.vehicle_journey_at_stops.size })).html_safe %>'); - - diff --git a/app/views/vehicle_journeys/select_journey_pattern.js.slim b/app/views/vehicle_journeys/select_journey_pattern.js.slim new file mode 100644 index 000000000..b42748cf7 --- /dev/null +++ b/app/views/vehicle_journeys/select_journey_pattern.js.slim @@ -0,0 +1 @@ +| $('.journey_pattern_dependent_list').html("#{escape_javascript(render(partial: 'vehicle_journeys/vehicle_journey_at_stop_fields', collection: @vehicle_journey.vehicle_journey_at_stops, as: :vehicle_journey_at_stop, locals: { :vehicle_journey_at_stops_size => @vehicle_journey.vehicle_journey_at_stops.size })).html_safe}");
\ No newline at end of file diff --git a/app/views/vehicle_journeys/show.html.erb b/app/views/vehicle_journeys/show.html.erb deleted file mode 100644 index 4bf814bbe..000000000 --- a/app/views/vehicle_journeys/show.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<%= render 'show_details', vehicle_journey: @vehicle_journey %> -<%= render 'show_sidebar' %> diff --git a/app/views/vehicle_journeys/show.html.slim b/app/views/vehicle_journeys/show.html.slim new file mode 100644 index 000000000..8ff4b188d --- /dev/null +++ b/app/views/vehicle_journeys/show.html.slim @@ -0,0 +1,2 @@ +== render 'show_details', vehicle_journey: @vehicle_journey +== render 'show_sidebar'
\ No newline at end of file diff --git a/app/views/vehicle_translations/_translate_form.html.erb b/app/views/vehicle_translations/_translate_form.html.erb deleted file mode 100644 index 0ca6a6b84..000000000 --- a/app/views/vehicle_translations/_translate_form.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<%= render "shared/flash_messages" %> -<%= semantic_form_for [@referential, @line, @route, @vehicle_journey, @vehicle_translation], remote: true do |form| %> - <div class="modal-body"> - <%= form.inputs do %> - <%= form.input :departure_or_arrival, as: :select, label: t('.set'), collection: [ [ t('.first_stop_departure_time', stop_name: @vehicle_translation.first_stop_name), "departure"], [t('.first_stop_arrival_time', stop_name: @vehicle_translation.first_stop_name), "arrival"] ], include_blank: false, required: true %> - <%= form.input :first_stop_time, - as: :time_picker, label: t( ".to"), - input_html: { class: "form-control input-sm timepicker_basic"}, wrapper_html: { class: "input-append bootstrap-timepicker" } %> - - <div class="repeat_cloning"> - <h4> - <%= t('.multiple_cloning_form') %> - </h4> - <%= form.input :duration, as: :number %> - <%= form.input :count, as: :number %> - </div> - <% end %> - </div> - <div class="modal-footer"> - <%= form.actions do %> - <%= form.action :submit, as: :button, label: t('formtastic.clone') %> - <% end %> - </div> -<% end %> diff --git a/app/views/vehicle_translations/_translate_form.html.slim b/app/views/vehicle_translations/_translate_form.html.slim new file mode 100644 index 000000000..4534fceb5 --- /dev/null +++ b/app/views/vehicle_translations/_translate_form.html.slim @@ -0,0 +1,17 @@ +== render "shared/flash_messages" + += semantic_form_for [@referential, @line, @route, @vehicle_journey, @vehicle_translation], remote: true do |form| + .modal-body + = form.inputs do + = form.input :departure_or_arrival, as: :select, label: t('.set'), collection: [ [ t('.first_stop_departure_time', stop_name: @vehicle_translation.first_stop_name), "departure"], [t('.first_stop_arrival_time', stop_name: @vehicle_translation.first_stop_name), "arrival"] ], include_blank: false, required: true + = form.input :first_stop_time, as: :time_picker, label: t( ".to"), input_html: { class: "form-control input-sm timepicker_basic"}, wrapper_html: { class: "input-append bootstrap-timepicker" } + + .repeat_cloning + h4 = t('.multiple_cloning_form') + + = form.input :duration, as: :number + = form.input :count, as: :number + + .modal-footer + = form.actions do + = form.action :submit, as: :button, label: t('formtastic.clone')
\ No newline at end of file diff --git a/app/views/vehicle_translations/new.js.erb b/app/views/vehicle_translations/new.js.erb deleted file mode 100644 index 0c7869fb6..000000000 --- a/app/views/vehicle_translations/new.js.erb +++ /dev/null @@ -1,4 +0,0 @@ -var modal_translation_content = '<%= escape_javascript( render "vehicle_translations/translate_form") %> '; -$('#translate_form').html(modal_translation_content); - - diff --git a/app/views/vehicle_translations/new.js.slim b/app/views/vehicle_translations/new.js.slim new file mode 100644 index 000000000..ff5ae577d --- /dev/null +++ b/app/views/vehicle_translations/new.js.slim @@ -0,0 +1,2 @@ +| var modal_translation_content = "#{escape_javascript(render 'vehicle_translations/translate_form')}"; +| $('#translate_form').html(modal_translation_content);
\ No newline at end of file diff --git a/config/cucumber.yml b/config/cucumber.yml new file mode 100644 index 000000000..836931b61 --- /dev/null +++ b/config/cucumber.yml @@ -0,0 +1,13 @@ +<% +rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" +rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" + +if ENV['JOB_NAME'] + ci_opts = "--format json --out cucumber.json --format html --out cucumber.html" +end + +std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{ci_opts} --strict --tags ~@wip" +%> +default: <%= std_opts %> features +wip: --tags @wip:3 --wip features +rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip diff --git a/config/database.yml b/config/database.yml index 81951d183..2a3ddf5d0 100644 --- a/config/database.yml +++ b/config/database.yml @@ -10,15 +10,18 @@ default: &default development: <<: *default - database: chouette_dev + database: chouette2 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. -test: +test: &test <<: *default database: chouette_test production: <<: *default database: chouette2 + +cucumber: + <<: *test diff --git a/config/deploy.rb b/config/deploy.rb index ce41e5971..f8a7ebdef 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -21,6 +21,15 @@ set :copy_exclude, [ '.git' ] ssh_options[:forward_agent] = true require "bundler/capistrano" +require 'whenever/capistrano' + +# Whenever +set :whenever_variables, ->{ "'environment=#{fetch :whenever_environment}&bundle_command=bin/bundle exec&additionnal_path=/var/lib/gems/2.2.0/bin'" } # invoke bin/bundle to use 'correct' ruby environment + +set :whenever_command, "sudo /usr/local/sbin/whenever-sudo" # use sudo to change www-data crontab +set :whenever_user, "www-data" # use www-data crontab + +set :whenever_output, "2>&1 | logger -t stif-boiv/cron" namespace :deploy do task :start do ; end @@ -37,7 +46,7 @@ namespace :deploy do end task :bundle_link do - run "ln -fs #{bundle_cmd} #{release_path}/script/bundle" + run "ln -fs #{bundle_cmd} #{release_path}/bin/bundle" end after "bundle:install", "deploy:bundle_link" diff --git a/config/environment.rb b/config/environment.rb index 3bc3051d1..000bf1c03 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,3 +1,4 @@ +# coding: utf-8 # Load the Rails application. require File.expand_path('../application', __FILE__) @@ -5,4 +6,4 @@ require File.expand_path('../application', __FILE__) Rails.application.initialize! # Fix version -APP_VERSION = 'Iteration 4' +APP_VERSION = 'Itération 5' diff --git a/config/environments/development.rb b/config/environments/development.rb index a197dd366..12dafdc73 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -56,13 +56,21 @@ Rails.application.configure do config.company_contact = "http://www.chouette.mobi/club-utilisateurs/contact-support/" config.accept_user_creation = false - config.chouette_authentication_settings = { - type: "database" - } + # Reflex api url + config.reflex_api_url = "https://reflex.stif.info/ws/reflex/V1/service=getData" + # config.chouette_authentication_settings = { - # type: "cas", - # cas_server: "http://stif-portail-dev.af83.priv/sessions" + # type: "database" # } + config.chouette_authentication_settings = { + type: "cas", + cas_server: "http://stif-portail-dev.af83.priv/sessions" + } + config.stif_portail_api = + { + key: "Ohphie1Voo6the5hohpi", + url: "http://stif-portail-dev.af83.priv" + } # file to data for demo config.demo_data = "tmp/demo.zip" diff --git a/config/environments/test.rb b/config/environments/test.rb index 9db6ad9f3..512afab4f 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -46,8 +46,18 @@ Rails.application.configure do config.company_contact = "http://www.chouette.mobi/club-utilisateurs/contact-support/" config.accept_user_creation = true + # config.chouette_authentication_settings = { + # type: "database" + # } config.chouette_authentication_settings = { - type: "database" + type: "cas", + cas_server: "http://stif-portail-dev.af83.priv/sessions" + } + + config.stif_portail_api = + { + key: "411e6b8d259bc9900c0caf9db6072013", + url: "http://localhost:3000" } # file to data for demo diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml new file mode 100644 index 000000000..c9477e19a --- /dev/null +++ b/config/i18n-tasks.yml @@ -0,0 +1,105 @@ +# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks + +# The "main" locale. +base_locale: en +## All available locales are inferred from the data by default. Alternatively, specify them explicitly: +# locales: [es, fr] +## Reporting locale, default: en. Available: en, ru. +# internal_locale: en + +# Read and write translations. +data: + ## Translations are read from the file system. Supported format: YAML, JSON. + ## Provide a custom adapter: + # adapter: I18n::Tasks::Data::FileSystem + + # Locale files or `File.find` patterns where translations are read from: + read: + ## Default: + - config/locales/%{locale}.yml + ## More files: + - config/locales/*.%{locale}.yml + - config/locales/**/*.%{locale}.yml + ## Another gem (replace %#= with %=): + # - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml" + + # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom: + # `i18n-tasks normalize -p` will force move the keys according to these rules + write: + ## For example, write devise and simple form keys to their respective files: + - ['{devise}.*', 'config/locales/devise.%{locale}.yml'] + - ['{simple_form}.*', 'config/locales/simple_form.%{locale}.yml'] + ## Catch-all default: + - config/locales/%{locale}.yml + + ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class. + # router: convervative_router + + yaml: + write: + # do not wrap lines at 80 characters + line_width: -1 + + ## Pretty-print JSON: + # json: + # write: + # indent: ' ' + # space: ' ' + # object_nl: "\n" + # array_nl: "\n" + +# Find translate calls +search: + ## Paths or `File.find` patterns to search in: + # paths: + # - app/ + + ## Root directories for relative keys resolution. + # relative_roots: + # - app/controllers + # - app/helpers + # - app/mailers + # - app/presenters + # - app/views + + ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting: + ## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json) + exclude: + - app/assets/images + - app/assets/fonts + + ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`: + ## If specified, this settings takes priority over `exclude`, but `exclude` still applies. + # include: ["*.rb", "*.html.slim"] + + ## Default scanner finds t() and I18n.t() calls. + # scanner: I18n::Tasks::Scanners::PatternWithScopeScanner + +## Google Translate +# translation: +# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate +# api_key: "AbC-dEf5" + +## Do not consider these keys missing: +# ignore_missing: +# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}' +# - '{devise,simple_form}.*' + +## Consider these keys used: +# ignore_unused: +# - 'activerecord.attributes.*' +# - '{devise,kaminari,will_paginate}.*' +# - 'simple_form.{yes,no}' +# - 'simple_form.{placeholders,hints,labels}.*' +# - 'simple_form.{error_notification,required}.:' + +## Exclude these keys from the `i18n-tasks eq-base' report: +# ignore_eq_base: +# all: +# - common.ok +# fr,es: +# - common.brand + +## Ignore these keys completely: +# ignore: +# - kaminari.* diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 734e96c33..057d4b215 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -303,7 +303,7 @@ Devise.setup do |config| # By default, devise_cas_authenticatable will create users. If you would rather # require user records to already exist locally before they can authenticate via # CAS, uncomment the following line. - config.cas_create_user = false + # config.cas_create_user = false # You can enable Single Sign Out, which by default is disabled. # config.cas_enable_single_sign_out = true diff --git a/config/initializers/reflex.rb b/config/initializers/reflex.rb new file mode 100644 index 000000000..ab3f9cfb8 --- /dev/null +++ b/config/initializers/reflex.rb @@ -0,0 +1,3 @@ +if Rails.application.config.try(:reflex_api_url) + Reflex::API.base_url = Rails.application.config.reflex_api_url +end diff --git a/config/locales/access_links.en.yml b/config/locales/access_links.en.yml index 048261fc1..a90085588 100644 --- a/config/locales/access_links.en.yml +++ b/config/locales/access_links.en.yml @@ -38,7 +38,7 @@ en: objectid: "Neptune identifier" object_version: "Version" creation_time: "Created on" - creatorid: "Created by " + creator_id: "Created by " formtastic: titles: access_link: diff --git a/config/locales/access_points.en.yml b/config/locales/access_points.en.yml index f304c7621..997d84a34 100644 --- a/config/locales/access_points.en.yml +++ b/config/locales/access_points.en.yml @@ -51,7 +51,7 @@ en: objectid: "Neptune identifier" object_version: "Version" creation_time: "Created on" - creatorid: "Created by" + creator_id: "Created by" coordinates: "Coordinates (lat,lng)" zip_code: "Zip code" city_name: "City" diff --git a/config/locales/companies.en.yml b/config/locales/companies.en.yml index 14f389bf0..760ef91e4 100644 --- a/config/locales/companies.en.yml +++ b/config/locales/companies.en.yml @@ -14,6 +14,7 @@ en: index: title: "Companies" name: "Search by name" + advanced_search: "Advanced search" activerecord: models: company: diff --git a/config/locales/companies.fr.yml b/config/locales/companies.fr.yml index ccb425f1d..b3b437220 100644 --- a/config/locales/companies.fr.yml +++ b/config/locales/companies.fr.yml @@ -14,6 +14,7 @@ fr: index: title: "Transporteurs" name: "Recherche par nom" + advanced_search: "Recherche avancée" activerecord: models: company: diff --git a/config/locales/compliance_check_results.en.yml b/config/locales/compliance_check_results.en.yml index dcc0f4598..7a71f83f0 100644 --- a/config/locales/compliance_check_results.en.yml +++ b/config/locales/compliance_check_results.en.yml @@ -318,6 +318,7 @@ en: 2-NEPTUNE-Timetable-1: "Utilité des calendriers." 2-NEPTUNE-Timetable-2: "Utilité des calendriers." 2-NEPTUNE-Timetable-2: "Validité des dates de début et de fin des périodes des calendriers" + 2-NEPTUNE-Timetable-3: "Validité des dates de début et de fin des périodes des calendriers" 2-NEPTUNE-VehicleJourney-1: "Existence de la séquence d'arrêt <ChouetteRoute> référencée par la course <VehicleJourney>." 2-NEPTUNE-VehicleJourney-2: "Existence de la mission <JourneyPattern> référencée par la course <VehicleJourney>." 2-NEPTUNE-VehicleJourney-3: "Existence de la ligne <Line> référencée par la course <VehicleJourney>." @@ -413,6 +414,8 @@ en: 3-Route-8: "Vérification de l'utilisation des arrêts par les missions" 3-Route-9: "Vérification de l’existence d’une mission passant par tous les arrêts de la séquence" 3-JourneyPattern-1: "Vérification de double définition de missions" + 3-JourneyPattern-2: "Vérification de l’existence d’une mission passant par tous les arrêts de la séquence" + 3-JourneyPattern-3: "Vérification de double définition de missions" 3-VehicleJourney-1: "Vérification de la chronologie des horaires de passage à un arrêt" 3-VehicleJourney-2: "Vérification de la vitesse de transfert entre deux arrêts" 3-VehicleJourney-3: "Vérification de la cohérence des courses successives desservant deux mêmes arrêts" diff --git a/config/locales/compliance_check_results.fr.yml b/config/locales/compliance_check_results.fr.yml index c630e3e83..19f436582 100644 --- a/config/locales/compliance_check_results.fr.yml +++ b/config/locales/compliance_check_results.fr.yml @@ -426,6 +426,7 @@ fr: 4-GroupOfLine-1: "Vérification de contraintes sur les attributs des groupes de lignes" 4-StopArea-1: "Vérification de contraintes sur les attributs des arrêts" 4-StopArea-2: "Vérification de l'existance d'un arrêt commercial pour les arrêts physiques" + 4-StopArea-3: "Vérification de la cohérence entre les noms de communes et leur code INSEE" 4-AccessPoint-1: "Vérification de contraintes sur les attributs des accès" 4-AccessLink-1: "Vérification de contraintes sur les attributs des liens d'accès" 4-ConnectionLink-1: "Vérification de contraintes sur les attributs des correspondances" diff --git a/config/locales/compliance_check_tasks.en.yml b/config/locales/compliance_check_tasks.en.yml index 3b303c1f3..61e56473c 100644 --- a/config/locales/compliance_check_tasks.en.yml +++ b/config/locales/compliance_check_tasks.en.yml @@ -13,4 +13,5 @@ en: name: "Compliance check name" references_type: "Subset" reference_ids: "Subset ids" - object_id_prefix: "Neptune Id prefix"
\ No newline at end of file + object_id_prefix: "Neptune Id prefix" + rule_parameter_set_id: "Jeu de paramètres pour validation"
\ No newline at end of file diff --git a/config/locales/compliance_check_tasks.fr.yml b/config/locales/compliance_check_tasks.fr.yml index 43707574e..d6cc88b1e 100644 --- a/config/locales/compliance_check_tasks.fr.yml +++ b/config/locales/compliance_check_tasks.fr.yml @@ -13,4 +13,5 @@ fr: name: "Nom de la validation" references_type: "Sous ensemble" reference_ids: "Identifiants du sous ensemble" + object_id_prefix: "Préfixe Neptune Id" rule_parameter_set_id: "Jeu de paramètres pour validation" diff --git a/config/locales/compliance_checks.en.yml b/config/locales/compliance_checks.en.yml index 85e146c40..c9bac8bc3 100644 --- a/config/locales/compliance_checks.en.yml +++ b/config/locales/compliance_checks.en.yml @@ -8,6 +8,8 @@ en: show: title: "Neptune Validation" summary: "Rapport de conformité à la norme NEPTUNE" + details: "Details" + parameters: "Tests parameters" completed: "[ Completed ]" failed: "[ Failed ]" pending: "[ In the treatment queue ]" @@ -16,6 +18,7 @@ en: export_csv: "CSV format" report: validation_success: "Validation successfully passed." + action_report: "Action report" actions: destroy_confirm: "Do you confirm to destroy this validation ?" destroy: "Destroy this validation" @@ -33,10 +36,32 @@ en: terminated: "Completed" canceled: "Canceled" aborted: "Failed" + uncheck_count: + zero: "no unappliable" + one: "one unappliable" + other: "%{count} unappliables" + ok_count: + zero: "No successful test" + one: "One successful test" + other: "%{count} successful tests" + warning_count: + zero: "no warning" + one: "one warning" + other: "%{count} warnings" + error_count: + zero: "no error" + one: "one error" + other: "%{count} errors" + fatal_count: + zero: "no fatal error" + one: "one fatal error" + other: "%{count} fatal errors" + import: "Import" + rule_parameter_set: "Rule parameter set" file_validation_log_messages: messages: undefined: "%{key} undefined" - TooMuchDetails: ( %{0} erreurs / warnings supplémentaires ) + TooMuchDetails: ( %{0} errors / suppl. warnings ) ONE: "Catégorie 1 : Syntaxe" severities: uncheck: "Unchecked" @@ -48,12 +73,12 @@ en: rule_parameter_set: "Rule Parameter Set" activemodel: models: - file_validation: + compliance_check: zero: "Validation" one: "Validation" other: "Validation" attributes: - file_validation: + compliance_check: created_at: "Executed at" references_type: "Associated Data Type" reference_ids: "Associated Data" @@ -62,7 +87,7 @@ en: status: "Status" file_name: "Tested data" projection_reference: "Système de projection de référence" - file_validation_log_message: + compliance_check_log_message: created_at: "Date" position: "N." full_message: "Message" diff --git a/config/locales/compliance_checks.fr.yml b/config/locales/compliance_checks.fr.yml index 85255d6f1..14ae7e943 100644 --- a/config/locales/compliance_checks.fr.yml +++ b/config/locales/compliance_checks.fr.yml @@ -62,12 +62,15 @@ fr: messages: undefined: "%{key} non défini" TooMuchDetails: "( %{0} erreurs / warnings supplémentaires )" + ONE: "Catégorie 1 : Syntaxe" severities: uncheck: "Non testé" ok: "Ok" warning: "Alerte" error: "Erreur" fatal: "Fatal" + import: "Import Report" + rule_parameter_set: "Rule Parameter Set" activemodel: models: compliance_check: @@ -83,6 +86,7 @@ fr: resources: "Fichier à valider" status: "Status" file_name: "Jeu de données" + projection_reference: "Système de projection de référence" compliance_check_log_message: created_at: "Date" position: "N." diff --git a/config/locales/connection_links.en.yml b/config/locales/connection_links.en.yml index 914ce0de5..ceb53cf0f 100644 --- a/config/locales/connection_links.en.yml +++ b/config/locales/connection_links.en.yml @@ -19,6 +19,7 @@ en: index: title: "Connection links" name: "Search by name" + advanced_search: "Advanced search" departure: "Start of link" arrival: "End of link" selection: "Selection" diff --git a/config/locales/connection_links.fr.yml b/config/locales/connection_links.fr.yml index 07569a89e..76f1a9b7b 100644 --- a/config/locales/connection_links.fr.yml +++ b/config/locales/connection_links.fr.yml @@ -18,6 +18,7 @@ fr: to: "vers" index: name: "Recherche par nom" + advanced_search: "Recherche avancée" title: "Correspondances" departure: "Arrêt de départ" arrival: "Arrêt d'arrivée" diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 25a5bbeba..af6feed2c 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -35,6 +35,9 @@ validating conformance of data wrt Neptune (French standard NFP 99 506)." new_password: New password new_password_confirmation: New password confirmation commit: Update password + unlock: + new: + title: "Resend unlock instructions" links: sign_in: "Sign in" sign_up: "Sign up" diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml index b909eeaef..81371ba4c 100644 --- a/config/locales/devise.fr.yml +++ b/config/locales/devise.fr.yml @@ -36,6 +36,9 @@ norme Neptune (NFP 99 506)" new_password: Nouveau mot de passe new_password_confirmation: Confirmation du nouveau mot de passe commit: Changer de mot de passe + unlock: + new: + title: "Renvoyer les instructions de déblocage du compte" links: sign_in: "Se connecter" sign_up: "S'inscrire" diff --git a/config/locales/group_of_lines.en.yml b/config/locales/group_of_lines.en.yml index 00c1e1373..757ed51cf 100644 --- a/config/locales/group_of_lines.en.yml +++ b/config/locales/group_of_lines.en.yml @@ -15,6 +15,7 @@ en: index: title: "Group of Lines" name: "Search by name" + advanced_search: 'Advanced search' form: lines: "Associated lines" activerecord: diff --git a/config/locales/group_of_lines.fr.yml b/config/locales/group_of_lines.fr.yml index 653862fd4..b9b7b8bd2 100644 --- a/config/locales/group_of_lines.fr.yml +++ b/config/locales/group_of_lines.fr.yml @@ -15,6 +15,7 @@ fr: index: title: "Groupes de lignes" name: "Recherche par nom" + advanced_search: 'Recherche avancée' form: lines: "Lignes associées" activerecord: diff --git a/config/locales/journey_patterns.en.yml b/config/locales/journey_patterns.en.yml index 379d184b6..856dd6d15 100644 --- a/config/locales/journey_patterns.en.yml +++ b/config/locales/journey_patterns.en.yml @@ -10,6 +10,7 @@ en: edit: "Edit this journey pattern" destroy: "Remove this journey pattern" destroy_confirm: A"re you sure you want destroy this journey pattern ?" + edit_route_sections: "Update route sections" new: title: "Add a new journey pattern" edit: diff --git a/config/locales/journey_patterns.fr.yml b/config/locales/journey_patterns.fr.yml index bdf220ab0..78860514a 100644 --- a/config/locales/journey_patterns.fr.yml +++ b/config/locales/journey_patterns.fr.yml @@ -10,6 +10,7 @@ fr: edit: "Modifier cette mission" destroy: "Supprimer cette mission" destroy_confirm: "Etes vous sûr de vouloir détruire cette mission ?" + edit_route_sections: "Modifier les sections de parcours" new: title: "Ajouter une mission" edit: diff --git a/config/locales/journey_patterns.yml b/config/locales/journey_patterns.yml deleted file mode 100644 index 3e2ddec99..000000000 --- a/config/locales/journey_patterns.yml +++ /dev/null @@ -1,137 +0,0 @@ -en: - journey_patterns: - journey_pattern: - from_to: "From '%{departure}' to '%{arrival}'" - stop_count: "%{count}/%{route_count} stops" - vehicle_journeys_count: "Vehicle journeys: %{count}" - vehicle_journey_at_stops: "Vehicle journey at stops" - actions: - new: "Add a new journey_pattern" - edit: "Edit this journey pattern" - destroy: "Remove this journey pattern" - destroy_confirm: "Are you sure you want destroy this journey pattern ?" - edit_route_sections: "Edit Shape" - new: - title: "Add a new journey pattern" - edit: - title: "Update journey pattern %{journey_pattern}" - show: - title: "Journey Pattern %{journey_pattern}" - stop_points: "Stop point on journey pattern list" - index: - title: "Journey Patterns" - form: - warning: "Be careful, selection is also applied to the %{count} vehicle journeys associated to this journey pattern" - activerecord: - models: - journey_pattern: - zero: "journey pattern" - one: "journey pattern" - other: "journey patterns" - attributes: - journey_pattern: - route: "Route" - name: "Name" - published_name: "Published name" - comment: "Comments" - registration_number: "Registration number" - stop_point_ids: "Route's stop selection" - objectid: "Neptune identifier" - object_version: "Version" - creation_time: "Created on" - creator_id: "Created by" - formtastic: - titles: - journey_pattern: - name: "Only alphanumerical or underscore characters." - registration_number: "Positif integer." - objectid: "[prefix]:JourneyPattern:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character" - neptune: - journey_pattern: - name: "Only alphanumerical or underscore characters." - registration_number: "Positif integer." - objectid: "[prefix]:JourneyPattern:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character" - netex: - journey_pattern: - name: "Only alphanumerical or underscore characters." - registration_number: "Positif integer." - objectid: "[prefix]:JourneyPattern:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character" - gtfs: - journey_pattern: - name: "Only alphanumerical or underscore characters." - registration_number: "Positif integer." - objectid: "[prefix]:JourneyPattern:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character" - hub: - journey_pattern: - name: "Only alphanumerical or underscore characters. Maximum length = 75." - registration_number: "Positif integer, unique key, of no more than 8 digits." - objectid: "[prefix]:JourneyPattern:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character. Maximum length of the unique key = 30." - -fr: - journey_patterns: - journey_pattern: - from_to: "De '%{departure}' à '%{arrival}'" - stop_count: "%{count}/%{route_count} arrêts" - vehicle_journeys_count: "Courses: %{count}" - vehicle_journey_at_stops: "Horaires des courses" - actions: - new: "Ajouter une mission" - edit: "Modifier cette mission" - destroy: "Supprimer cette mission" - destroy_confirm: "Etes vous sûr de vouloir détruire cette mission ?" - edit_route_sections: "Modifier le tracé" - new: - title: "Ajouter une mission" - edit: - title: "Modifier la mission %{journey_pattern}" - show: - title: "Mission %{journey_pattern}" - stop_points: "Liste des arrêts de la mission" - index: - title: "Missions" - form: - warning: "Attention, la sélection s'applique aussi aux %{count} courses de la mission" - activerecord: - models: - journey_pattern: - zero: "mission" - one: "mission" - other: "missions" - attributes: - journey_pattern: - route: "Séquence d'arrêts" - name: "Nom" - published_name: "Nom public" - comment: "Commentaire" - registration_number: "Numéro d'enregistrement" - stop_point_ids: "Sélection des arrêts desservis" - objectid: "Identifiant Neptune" - object_version: "Version" - creation_time: "Créé le" - creator_id: "Créé par" - formtastic: - titles: - journey_pattern: - name: "Caractères autorisés : alphanumériques et 'souligné'." - registration_number: "Entier positif." - objectid: "[prefixe]:JourneyPattern:[clé_unique] caractères autorisés : alphanumériques et 'souligné' pour le préfixe, la clé unique accepte en plus le 'moins'" - neptune: - journey_pattern: - name: "Caractères autorisés : alphanumériques et 'souligné'." - registration_number: "Entier positif." - objectid: "[prefixe]:JourneyPattern:[clé_unique] caractères autorisés : alphanumériques et 'souligné' pour le préfixe, la clé unique accepte en plus le 'moins'" - netex: - journey_pattern: - name: "Caractères autorisés : alphanumériques et 'souligné'." - registration_number: "Entier positif." - objectid: "[prefixe]:JourneyPattern:[clé_unique] caractères autorisés : alphanumériques et 'souligné' pour le préfixe, la clé unique accepte en plus le 'moins'" - gtfs: - journey_pattern: - name: "Caractères autorisés : alphanumériques et 'souligné'." - registration_number: "Entier positif." - objectid: "[prefixe]:JourneyPattern:[clé_unique] caractères autorisés : alphanumériques et 'souligné' pour le préfixe, la clé unique accepte en plus le 'moins'" - hub: - journey_pattern: - name: "Caractères autorisés : alphanumériques et 'souligné'. Longueur maximale = 75." - registration_number: "Entier positif, clé unique, d'un maximum de 8 chiffres." - objectid: "[prefixe]:JourneyPattern:[clé_unique] caractères autorisés : alphanumériques et 'souligné' pour le préfixe, la clé unique accepte en plus le 'moins'. Longueur maximale de la clé unique = 30." diff --git a/config/locales/layouts.en.yml b/config/locales/layouts.en.yml index aa9985a53..debff05e5 100644 --- a/config/locales/layouts.en.yml +++ b/config/locales/layouts.en.yml @@ -39,3 +39,15 @@ en: mail: "Contact us" newsletter: "Newsletter" forum: "Forum" + true: "yes" + false: "no" + or: "or" + back: "Back" + today: "Today" + yesterday: "Yestersday" + edit_periods: "Edit periods" + delete_periods: "Delete periods" + attributes: + author: "Edited by" + created_at: "Created at" + updated_at: "Updated at"
\ No newline at end of file diff --git a/config/locales/line_referentials.en.yml b/config/locales/line_referentials.en.yml new file mode 100644 index 000000000..ad4cfa45c --- /dev/null +++ b/config/locales/line_referentials.en.yml @@ -0,0 +1,8 @@ +en: + synchronization: + message: "Synchronization successful in %{time} seconds with %{imported} objects from Codifligne. %{deleted} objects were deleted." + failure: "Synchronization interrupted after %{time} seconds." + activerecord: + attributes: + line_referential: + sync_interval: "Synchronisation frequency"
\ No newline at end of file diff --git a/config/locales/line_referentials.fr.yml b/config/locales/line_referentials.fr.yml new file mode 100644 index 000000000..6378087d7 --- /dev/null +++ b/config/locales/line_referentials.fr.yml @@ -0,0 +1,9 @@ +fr: + synchronization: + message: + success: "Synchronisation réussie après %{time} secondes avec %{imported} éléments importés de Codifligne. %{deleted} éléments ont été supprimés." + failure: "Synchronisation interrompue après %{time} secondes." + activerecord: + attributes: + line_referential: + sync_interval: "Fréquence de synchronisation"
\ No newline at end of file diff --git a/config/locales/lines_en.yml b/config/locales/lines.en.yml index 21994bc23..d03b5eadc 100644 --- a/config/locales/lines_en.yml +++ b/config/locales/lines.en.yml @@ -8,9 +8,9 @@ en: destroy_selection_confirm: "Are you sure you want destroy those lines?" import: "Import lines" export_kml: "Export KML line" - export__kml_all: "Export KML lines" + export_kml_all: "Export KML lines" export_hub: "Export HUB line" - export__hub_all: "Export HUB lines" + export_hub_all: "Export HUB lines" new: title: "Add a new line" edit: diff --git a/config/locales/lines_fr.yml b/config/locales/lines.fr.yml index 5729800c7..4b871d4ad 100644 --- a/config/locales/lines_fr.yml +++ b/config/locales/lines.fr.yml @@ -20,8 +20,8 @@ fr: itineraries: "Liste des séquences d'arrêts de la ligne" group_of_lines: "Groupes de lignes" index: - name_or_number: "Recherche par nom ou indice" title: "Lignes" + name_or_number: "Recherche par nom ou indice" no_networks: "Aucun réseaux" no_companies: "Aucun transporteurs" no_group_of_lines: "Aucun groupes de ligne" diff --git a/config/locales/networks.en.yml b/config/locales/networks.en.yml index ccb4dd791..0a5555b43 100644 --- a/config/locales/networks.en.yml +++ b/config/locales/networks.en.yml @@ -14,6 +14,7 @@ en: index: title: "Networks" name: "Search by name" + advanced_search: "Advanced search" activerecord: models: network: diff --git a/config/locales/networks.fr.yml b/config/locales/networks.fr.yml index d8572326e..1abd6e1c0 100644 --- a/config/locales/networks.fr.yml +++ b/config/locales/networks.fr.yml @@ -14,6 +14,7 @@ fr: index: title: "Réseaux" name: "Recherche par nom" + advanced_search: "Recherche avancée" activerecord: models: network: diff --git a/config/locales/referentials.en.yml b/config/locales/referentials.en.yml index 4064db841..3691a8227 100644 --- a/config/locales/referentials.en.yml +++ b/config/locales/referentials.en.yml @@ -57,6 +57,7 @@ en: access_points: "Access Points" time_tables: "Time tables" connection_links: "Connection links" + route_sections: "Route sections" quays: "quays" boarding_positions: "boarding positions" commercial_stops: "commercial stops" @@ -76,3 +77,8 @@ en: prefix: "only alphanumerical or underscore characters" upper_corner: "latitude,longitude in WGS84 referential, dot for decimal separator" lower_corner: "latitude,longitude in WGS84 referential, dot for decimal separator" + + notice: + referential: + archived: "The data space has been successfully archived" + unarchived: "The data space has been successfully unarchived"
\ No newline at end of file diff --git a/config/locales/referentials.fr.yml b/config/locales/referentials.fr.yml index d8b72d3e3..cada9c3a0 100644 --- a/config/locales/referentials.fr.yml +++ b/config/locales/referentials.fr.yml @@ -77,3 +77,8 @@ fr: prefix: "caractères autorisés : alphanumériques et 'souligné'" upper_corner: "latitude,longitude dans le référentiel WGS84, le séparateur de décimales est 'point'" lower_corner: "latitude,longitude dans le référentiel WGS84, le séparateur de décimales est 'point'" + + notice: + referential: + archived: "L'espace de données a été correctement archivé" + unarchived: "L'espace de données a été correctement désarchivé" diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml index 140c5b296..a556916bf 100644 --- a/config/locales/stop_areas.en.yml +++ b/config/locales/stop_areas.en.yml @@ -66,9 +66,9 @@ en: title: "Manage parent of stop area %{stop_area}" add_children: title: "Manage children of stop area %{stop_area}" - add_lines: + add_routing_lines: title: "Manage lines of routing constraint %{stop_area}" - add_stops: + add_routing_stops: title: "Manage stop areas of routing constraint %{stop_area}" activerecord: models: @@ -80,6 +80,7 @@ en: stop_area: name: "Name" registration_number: "Registration number" + published_name: "Published name" comment: "Comments" stop_area_type: "Area type" nearest_topic_name: "Nearest point of interest" @@ -101,7 +102,7 @@ en: objectid: "Neptune identifier" object_version: "Version" creation_time: "Created on" - creatorid: "Created by" + creator_id: "Created by" children_ids: "Children" routing_stop_ids: "Attached stops" routing_line_ids: "Attached lines" diff --git a/config/locales/subscriptions.en.yml b/config/locales/subscriptions.en.yml index 95f7bd160..56a3eddeb 100644 --- a/config/locales/subscriptions.en.yml +++ b/config/locales/subscriptions.en.yml @@ -7,6 +7,8 @@ en: actions: new: "Create an account" activemodel: + models: + subscription: "account" attributes: subscription: organisation_name: "Organisation" diff --git a/config/locales/time_tables.en.yml b/config/locales/time_tables.en.yml index b25439a1b..72a934421 100644 --- a/config/locales/time_tables.en.yml +++ b/config/locales/time_tables.en.yml @@ -41,12 +41,17 @@ en: overlap_date: "Overlap date" selected_date: "Date directly included" selected_period: "Date included in period" + properties_show: + resume: "From %{start_date} to %{end_date}" + resume_empty: "Empty timetable" index: - title: "Timetables" comment: "Search by name" tag_search: "Tags : hollidays,public holliday" - from: "From : " - to: " to : " + from: "From: " + to: " to: " + start_date: "mm/jj/aaaa" + end_date: "mm/jj/aaaa" + title: "timetables" selection: "Selection" selection_all: "All" advanced_search: "Advanced Search" @@ -74,6 +79,7 @@ en: creation_time: "Created on" creator_id: "Created by " calendars: "Calendar view" + calendar_details: "Calendar details" dates: "Peculiar dates" date: "On" excluded_dates: "Excluded dates" @@ -81,6 +87,7 @@ en: period_start: "From" period_end: "to" tag_search: "Tags" + tag_list: "Tags" formtastic: titles: time_table: diff --git a/config/locales/time_tables.fr.yml b/config/locales/time_tables.fr.yml index b1c9998dc..d2d693c93 100644 --- a/config/locales/time_tables.fr.yml +++ b/config/locales/time_tables.fr.yml @@ -41,6 +41,9 @@ fr: overlap_date: "Date en doublon" selected_date: "Date incluse directement" selected_period: "Date incluse par période" + properties_show: + resume: "Validité comprise du %{start_date} au %{end_date}" + resume_empty: "Calendrier vide" index: comment: "Recherche par nom" tag_search: "Tags : vacances,jour fériés" diff --git a/config/locales/validation_reports.en.yml b/config/locales/validation_reports.en.yml index 5dd8d23ef..3eb4f1b2c 100644 --- a/config/locales/validation_reports.en.yml +++ b/config/locales/validation_reports.en.yml @@ -302,6 +302,8 @@ en: 3-Route-8: "Vérification de l'utilisation des arrêts par les missions" 3-Route-9: "Vérification de l’existence d’une mission passant par tous les arrêts de la séquence" 3-JourneyPattern-1: "Vérification de double définition de missions" + 3-JourneyPattern-2: "Vérification de l’existence d’une mission passant par tous les arrêts de la séquence" + 3-JourneyPattern-3: "Vérification de double définition de missions" 3-VehicleJourney-1: "Vérification de la chronologie des horaires de passage à un arrêt" 3-VehicleJourney-2: "Vérification de la vitesse de transfert entre deux arrêts" 3-VehicleJourney-3: "Vérification de la cohérence des courses successives desservant deux mêmes arrêts" diff --git a/config/locales/validation_reports.fr.yml b/config/locales/validation_reports.fr.yml index 8b1757c3a..5929f7144 100644 --- a/config/locales/validation_reports.fr.yml +++ b/config/locales/validation_reports.fr.yml @@ -315,6 +315,7 @@ fr: 4-GroupOfLine-1: "Vérification de contraintes sur les attributs des groupes de lignes" 4-StopArea-1: "Vérification de contraintes sur les attributs des arrêts" 4-StopArea-2: "Vérification de l'existance d'un arrêt commercial pour les arrêts physiques" + 4-StopArea-3: "Vérification de la cohérence entre les noms de communes et leur code INSEE" 4-AccessPoint-1: "Vérification de contraintes sur les attributs des accès" 4-AccessLink-1: "Vérification de contraintes sur les attributs des liens d'accès" 4-ConnectionLink-1: "Vérification de contraintes sur les attributs des correspondances" diff --git a/config/locales/validation_tasks.en.yml b/config/locales/validation_tasks.en.yml index 9c3e6d719..1b142e992 100644 --- a/config/locales/validation_tasks.en.yml +++ b/config/locales/validation_tasks.en.yml @@ -39,6 +39,20 @@ en: access_points_stats: "Access Points" vehicle_journeys_stats: "Vehicle Journeys" journey_patterns_stats: "Journey Patterns" + table: + line: + name: "Name" + save: "Save" + routes: "Routes" + connection_links: "Connection links" + time_tables: "Time tables" + stop_areas: "Stop areas" + access_points: "Access points" + vehicle_journeys: "Vehicle journeys" + journey_patterns: "Journey patterns" + not_saved: "Not saved" + saved: "Saved" + save_error: "Save error" statuses: created: "Pending ..." scheduled: "Processing ..." diff --git a/config/locales/validations.en.yml b/config/locales/validations.en.yml index 939056d39..5bac62ff3 100644 --- a/config/locales/validations.en.yml +++ b/config/locales/validations.en.yml @@ -18,6 +18,8 @@ en: validated_file: "Validated file" title: "Neptune Validation" summary: "Rapport de conformité à la norme NEPTUNE" + details: "Details" + parameters: "Tests parameters" completed: "[ Completed ]" failed: "[ Failed ]" pending: "[ In the treatment queue ]" @@ -42,6 +44,20 @@ en: access_points_stats: "Access Points" vehicle_journeys_stats: "Vehicle Journeys" journey_patterns_stats: "Journey Patterns" + table: + line: + name: "Name" + save: "Save" + routes: "Routes" + connection_links: "Connection links" + time_tables: "Time tables" + stop_areas: "Stop areas" + access_points: "Acces points" + vehicle_journeys: "Vehicle journeys" + journey_patterns: "Journey patterns" + not_saved: "Not saved" + saved: "Saved" + save_error: "Save error" statuses: created: "Pending ..." scheduled: "Processing ..." diff --git a/config/locales/vehicle_journeys.en.yml b/config/locales/vehicle_journeys.en.yml index 4f5f763b4..0687c32aa 100644 --- a/config/locales/vehicle_journeys.en.yml +++ b/config/locales/vehicle_journeys.en.yml @@ -96,7 +96,7 @@ en: published_journey_name: "Published Name" published_journey_identifier: "Published Identifier" facility: "Facility" - vehicletypeidentifier: "Vehicle Type Identifier" + vehicle_type_identifier: "Vehicle Type Identifier" time_table_ids: "Calendar list" vehicle_journey_at_stop_ids: "Time list" journey_frequency_ids: "Timeband" diff --git a/config/routes.rb b/config/routes.rb index e530ebaa1..af466f640 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,8 +10,15 @@ ChouetteIhm::Application.routes.draw do authenticated :user do root :to => 'referentials#index', as: :authenticated_root end + unauthenticated :user do - root :to => 'devise/cas_sessions#new', as: :unauthenticated_root + target = 'devise/sessions#new' + + if Rails.application.config.chouette_authentication_settings[:type] == "cas" + target = 'devise/cas_sessions#new' + end + + root :to => target, as: :unauthenticated_root end end @@ -48,7 +55,7 @@ ChouetteIhm::Application.routes.draw do resources :stop_areas end - resources :line_referentials, :only => [:show] do + resources :line_referentials, :only => [:show, :update] do resources :lines resources :group_of_lines end @@ -65,6 +72,12 @@ ChouetteIhm::Application.routes.draw do end end + # Archive/unarchive + member do + put :archive + put :unarchive + end + resources :networks match 'lines' => 'lines#destroy_all', :via => :delete @@ -193,4 +206,4 @@ ChouetteIhm::Application.routes.draw do get '/422', :to => 'errors#server_error' get '/500', :to => 'errors#server_error' -end +end
\ No newline at end of file diff --git a/config/schedule.rb b/config/schedule.rb new file mode 100644 index 000000000..83c4d7388 --- /dev/null +++ b/config/schedule.rb @@ -0,0 +1,40 @@ +# Use this file to easily define all of your cron jobs. +# +# It's helpful, but not entirely necessary to understand cron before proceeding. +# http://en.wikipedia.org/wiki/Cron + +# Example: +# +# set :output, "/path/to/my/cron_log.log" +# +# every 2.hours do +# command "/usr/bin/some_great_command" +# runner "MyModel.some_method" +# rake "some:great:rake:task" +# end +# +# every 4.days do +# runner "AnotherModel.prune_old_records" +# end + +# Learn more: http://github.com/javan/whenever + +set :additionnal_path, '' +unless additionnal_path.empty? + env :PATH, "#{additionnal_path}:#{ENV['PATH']}" +end +set :NEW_RELIC_LOG, 'stdout' + +set :job_template, "/bin/bash -c ':job'" + +every :hour do + rake "organisations:sync" + rake "users:sync" +end + +every :day, :at => '3:00am' do + rake "reflex:sync" +end +every :day, :at => '4:00 am' do + rake "codifligne:sync" +end diff --git a/config/warble.rb b/config/warble.rb deleted file mode 100644 index 9574700d5..000000000 --- a/config/warble.rb +++ /dev/null @@ -1,155 +0,0 @@ -# Disable Rake-environment-task framework detection by uncommenting/setting to false -# Warbler.framework_detection = false - -# Warbler web application assembly configuration file -Warbler::Config.new do |config| - # Features: additional options controlling how the jar is built. - # Currently the following features are supported: - # - gemjar: package the gem repository in a jar file in WEB-INF/lib - # - executable: embed a web server and make the war executable - # - compiled: compile .rb files to .class files - # config.features = %w(gemjar) - - # Application directories to be included in the webapp. - config.dirs = %w(app config lib vendor db) - - # Additional files/directories to include, above those in config.dirs - #config.includes = FileList["db"] - - # Additional files/directories to exclude - # config.excludes = FileList["lib/tasks/*"] - - # Additional Java .jar files to include. Note that if .jar files are placed - # in lib (and not otherwise excluded) then they need not be mentioned here. - # JRuby and JRuby-Rack are pre-loaded in this list. Be sure to include your - # own versions if you directly set the value - # config.java_libs += FileList["lib/java/*.jar"] - - # Loose Java classes and miscellaneous files to be included. - # config.java_classes = FileList["target/classes/**.*"] - - # One or more pathmaps defining how the java classes should be copied into - # the archive. The example pathmap below accompanies the java_classes - # configuration above. See http://rake.rubyforge.org/classes/String.html#M000017 - # for details of how to specify a pathmap. - # config.pathmaps.java_classes << "%{target/classes/,}p" - - # Bundler support is built-in. If Warbler finds a Gemfile in the - # project directory, it will be used to collect the gems to bundle - # in your application. If you wish to explicitly disable this - # functionality, uncomment here. - # config.bundler = false - - # An array of Bundler groups to avoid including in the war file. - # Defaults to ["development", "test"]. - config.bundle_without = %w{development test assets} - - # Other gems to be included. If you don't use Bundler or a gemspec - # file, you need to tell Warbler which gems your application needs - # so that they can be packaged in the archive. - # For Rails applications, the Rails gems are included by default - # unless the vendor/rails directory is present. - # config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"] - # config.gems << "tzinfo" - - # Uncomment this if you don't want to package rails gem. - #config.gems -= ["rails"] - - # The most recent versions of gems are used. - # You can specify versions of gems by using a hash assignment: - # config.gems["rails"] = "2.3.10" - - # You can also use regexps or Gem::Dependency objects for flexibility or - # finer-grained control. - # config.gems << /^merb-/ - # config.gems << Gem::Dependency.new("merb-core", "= 0.9.3") - - # Include gem dependencies not mentioned specifically. Default is - # true, uncomment to turn off. - # config.gem_dependencies = false - - # Array of regular expressions matching relative paths in gems to be - # excluded from the war. Defaults to empty, but you can set it like - # below, which excludes test files. - # config.gem_excludes = [/^(test|spec)\//] - - # Pathmaps for controlling how application files are copied into the archive - # config.pathmaps.application = ["WEB-INF/%p"] - - # Name of the archive (without the extension). Defaults to the basename - # of the project directory. - config.jar_name = "chouette2" - - # Name of the MANIFEST.MF template for the war file. Defaults to a simple - # MANIFEST.MF that contains the version of Warbler used to create the war file. - # config.manifest_file = "config/MANIFEST.MF" - - # When using the 'compiled' feature and specified, only these Ruby - # files will be compiled. Default is to compile all \.rb files in - # the application. - # config.compiled_ruby_files = FileList['app/**/*.rb'] - - # === War files only below here === - - # Path to the pre-bundled gem directory inside the war file. Default - # is 'WEB-INF/gems'. Specify path if gems are already bundled - # before running Warbler. This also sets 'gem.path' inside web.xml. - # config.gem_path = "WEB-INF/vendor/bundler_gems" - - # Files for WEB-INF directory (next to web.xml). This contains - # web.xml by default. If there is an .erb-File it will be processed - # with webxml-config. You may want to exclude this file via - # config.excludes. - # config.webinf_files += FileList["jboss-web.xml"] - - # Files to be included in the root of the webapp. Note that files in public - # will have the leading 'public/' part of the path stripped during staging. - # config.public_html = FileList["public/**/*", "doc/**/*"] - - # Pathmaps for controlling how public HTML files are copied into the .war - # config.pathmaps.public_html = ["%{public/,}p"] - - # Value of RAILS_ENV for the webapp -- default as shown below - # config.webxml.rails.env = ENV['RAILS_ENV'] || 'production' - - # Application booter to use, one of :rack, :rails, or :merb (autodetected by default) - # config.webxml.booter = :rails - - # Set JRuby to run in 1.9 mode. - # config.webxml.jruby.compat.version = "1.9" - - # When using the :rack booter, "Rackup" script to use. - # - For 'rackup.path', the value points to the location of the rackup - # script in the web archive file. You need to make sure this file - # gets included in the war, possibly by adding it to config.includes - # or config.webinf_files above. - # - For 'rackup', the rackup script you provide as an inline string - # is simply embedded in web.xml. - # The script is evaluated in a Rack::Builder to load the application. - # Examples: - # config.webxml.rackup.path = 'WEB-INF/hello.ru' - # config.webxml.rackup = %{require './lib/demo'; run Rack::Adapter::Camping.new(Demo)} - # config.webxml.rackup = require 'cgi' && CGI::escapeHTML(File.read("config.ru")) - - # Control the pool of Rails runtimes. Leaving unspecified means - # the pool will grow as needed to service requests. It is recommended - # that you fix these values when running a production server! - config.webxml.jruby.min.runtimes = 2 - config.webxml.jruby.max.runtimes = 4 - - config.webxml.jruby.worker.script = <<EOF -Rails.logger.info "start Delayed::JRubyWorker" -begin -require 'delayed/jruby_worker' -Delayed::JRubyWorker.new(:quiet => false).start -rescue => e - Rails.logger.fatal(e) - raise e -end -EOF - - # JNDI data source name - # config.webxml.jndi = 'jdbc/rails' - - config.init_contents << "config/war_init.rb" -end diff --git a/db/migrate/20160623083902_add_sync_interval_to_line_referentials.rb b/db/migrate/20160623083902_add_sync_interval_to_line_referentials.rb new file mode 100644 index 000000000..2bde737cb --- /dev/null +++ b/db/migrate/20160623083902_add_sync_interval_to_line_referentials.rb @@ -0,0 +1,5 @@ +class AddSyncIntervalToLineReferentials < ActiveRecord::Migration + def change + add_column :line_referentials, :sync_interval, :int, :default => 1 + end +end diff --git a/db/migrate/20160627124327_create_line_referential_syncs.rb b/db/migrate/20160627124327_create_line_referential_syncs.rb new file mode 100644 index 000000000..b1383f6c6 --- /dev/null +++ b/db/migrate/20160627124327_create_line_referential_syncs.rb @@ -0,0 +1,9 @@ +class CreateLineReferentialSyncs < ActiveRecord::Migration + def change + create_table :line_referential_syncs do |t| + t.references :line_referential, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20160627124541_create_line_sync_operations.rb b/db/migrate/20160627124541_create_line_sync_operations.rb new file mode 100644 index 000000000..ec32cf4ac --- /dev/null +++ b/db/migrate/20160627124541_create_line_sync_operations.rb @@ -0,0 +1,10 @@ +class CreateLineSyncOperations < ActiveRecord::Migration + def change + create_table :line_sync_operations do |t| + t.string :status + t.references :line_referential_sync, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20160727092547_add_deactivated_to_lines.rb b/db/migrate/20160727092547_add_deactivated_to_lines.rb new file mode 100644 index 000000000..e2d323a87 --- /dev/null +++ b/db/migrate/20160727092547_add_deactivated_to_lines.rb @@ -0,0 +1,5 @@ +class AddDeactivatedToLines < ActiveRecord::Migration + def change + add_column :lines, :deactivated, :boolean, default: false + end +end diff --git a/db/migrate/20160727132836_add_line_referential_ref_to_companies.rb b/db/migrate/20160727132836_add_line_referential_ref_to_companies.rb new file mode 100644 index 000000000..e5d7bfa05 --- /dev/null +++ b/db/migrate/20160727132836_add_line_referential_ref_to_companies.rb @@ -0,0 +1,5 @@ +class AddLineReferentialRefToCompanies < ActiveRecord::Migration + def change + add_reference :companies, :line_referential, index: true + end +end diff --git a/db/migrate/20160803140910_add_code_to_organisations.rb b/db/migrate/20160803140910_add_code_to_organisations.rb new file mode 100644 index 000000000..ba5d38213 --- /dev/null +++ b/db/migrate/20160803140910_add_code_to_organisations.rb @@ -0,0 +1,5 @@ +class AddCodeToOrganisations < ActiveRecord::Migration + def change + add_column :organisations, :code, :string + end +end diff --git a/db/migrate/20160804123044_add_synced_at_to_users.rb b/db/migrate/20160804123044_add_synced_at_to_users.rb new file mode 100644 index 000000000..4a13e304a --- /dev/null +++ b/db/migrate/20160804123044_add_synced_at_to_users.rb @@ -0,0 +1,5 @@ +class AddSyncedAtToUsers < ActiveRecord::Migration + def change + add_column :users, :synced_at, :datetime + end +end diff --git a/db/migrate/20160804134627_add_synced_at_to_organisations.rb b/db/migrate/20160804134627_add_synced_at_to_organisations.rb new file mode 100644 index 000000000..990006d61 --- /dev/null +++ b/db/migrate/20160804134627_add_synced_at_to_organisations.rb @@ -0,0 +1,5 @@ +class AddSyncedAtToOrganisations < ActiveRecord::Migration + def change + add_column :organisations, :synced_at, :datetime + end +end diff --git a/db/migrate/20160810132012_add_import_xml_to_lines.rb b/db/migrate/20160810132012_add_import_xml_to_lines.rb new file mode 100644 index 000000000..848d4b1fc --- /dev/null +++ b/db/migrate/20160810132012_add_import_xml_to_lines.rb @@ -0,0 +1,5 @@ +class AddImportXmlToLines < ActiveRecord::Migration + def change + add_column :lines, :import_xml, :text + end +end diff --git a/db/migrate/20160810132453_add_import_xml_to_companies.rb b/db/migrate/20160810132453_add_import_xml_to_companies.rb new file mode 100644 index 000000000..bca08ec18 --- /dev/null +++ b/db/migrate/20160810132453_add_import_xml_to_companies.rb @@ -0,0 +1,5 @@ +class AddImportXmlToCompanies < ActiveRecord::Migration + def change + add_column :companies, :import_xml, :text + end +end diff --git a/db/migrate/20160810132521_add_import_xml_to_networks.rb b/db/migrate/20160810132521_add_import_xml_to_networks.rb new file mode 100644 index 000000000..2f8d2ef6e --- /dev/null +++ b/db/migrate/20160810132521_add_import_xml_to_networks.rb @@ -0,0 +1,5 @@ +class AddImportXmlToNetworks < ActiveRecord::Migration + def change + add_column :networks, :import_xml, :text + end +end diff --git a/db/migrate/20160810132530_add_import_xml_to_group_of_lines.rb b/db/migrate/20160810132530_add_import_xml_to_group_of_lines.rb new file mode 100644 index 000000000..c10fae062 --- /dev/null +++ b/db/migrate/20160810132530_add_import_xml_to_group_of_lines.rb @@ -0,0 +1,5 @@ +class AddImportXmlToGroupOfLines < ActiveRecord::Migration + def change + add_column :group_of_lines, :import_xml, :text + end +end diff --git a/db/migrate/20160818090010_add_message_to_line_sync_operation.rb b/db/migrate/20160818090010_add_message_to_line_sync_operation.rb new file mode 100644 index 000000000..37b3e5af6 --- /dev/null +++ b/db/migrate/20160818090010_add_message_to_line_sync_operation.rb @@ -0,0 +1,5 @@ +class AddMessageToLineSyncOperation < ActiveRecord::Migration + def change + add_column :line_sync_operations, :message, :string + end +end diff --git a/db/migrate/20160831094427_add_archived_at_to_referentials.rb b/db/migrate/20160831094427_add_archived_at_to_referentials.rb new file mode 100644 index 000000000..be6b01c5a --- /dev/null +++ b/db/migrate/20160831094427_add_archived_at_to_referentials.rb @@ -0,0 +1,5 @@ +class AddArchivedAtToReferentials < ActiveRecord::Migration + def change + add_column :referentials, :archived_at, :datetime + end +end diff --git a/db/migrate/20160902082958_add_status_to_stop_area.rb b/db/migrate/20160902082958_add_status_to_stop_area.rb new file mode 100644 index 000000000..d05d9449e --- /dev/null +++ b/db/migrate/20160902082958_add_status_to_stop_area.rb @@ -0,0 +1,5 @@ +class AddStatusToStopArea < ActiveRecord::Migration + def change + add_column :stop_areas, :status, :string + end +end diff --git a/db/migrate/20160902083036_add_import_xml_to_stop_area.rb b/db/migrate/20160902083036_add_import_xml_to_stop_area.rb new file mode 100644 index 000000000..26ba99665 --- /dev/null +++ b/db/migrate/20160902083036_add_import_xml_to_stop_area.rb @@ -0,0 +1,5 @@ +class AddImportXmlToStopArea < ActiveRecord::Migration + def change + add_column :stop_areas, :import_xml, :text + end +end diff --git a/db/migrate/20160902084601_add_import_xml_to_access_points.rb b/db/migrate/20160902084601_add_import_xml_to_access_points.rb new file mode 100644 index 000000000..fd75cd783 --- /dev/null +++ b/db/migrate/20160902084601_add_import_xml_to_access_points.rb @@ -0,0 +1,5 @@ +class AddImportXmlToAccessPoints < ActiveRecord::Migration + def change + add_column :access_points, :import_xml, :text + end +end diff --git a/db/migrate/20160902093127_add_deleted_at_to_stop_areas.rb b/db/migrate/20160902093127_add_deleted_at_to_stop_areas.rb new file mode 100644 index 000000000..036d6a20f --- /dev/null +++ b/db/migrate/20160902093127_add_deleted_at_to_stop_areas.rb @@ -0,0 +1,5 @@ +class AddDeletedAtToStopAreas < ActiveRecord::Migration + def change + add_column :stop_areas, :deleted_at, :datetime + end +end diff --git a/db/migrate/20160905094930_add_line_referntial_to_networks.rb b/db/migrate/20160905094930_add_line_referntial_to_networks.rb new file mode 100644 index 000000000..b58f69043 --- /dev/null +++ b/db/migrate/20160905094930_add_line_referntial_to_networks.rb @@ -0,0 +1,5 @@ +class AddLineReferntialToNetworks < ActiveRecord::Migration + def change + add_reference :networks, :line_referential, index: true + end +end diff --git a/db/schema.rb b/db/schema.rb index ad816bc7a..a5b18db68 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160515163540) do +ActiveRecord::Schema.define(version: 20160905094930) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -63,6 +63,7 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.integer "stop_area_id", limit: 8 t.string "zip_code" t.string "city_name" + t.text "import_xml" end add_index "access_points", ["objectid"], :name => "access_points_objectid_key", :unique => true @@ -91,8 +92,11 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.string "registration_number" t.string "url" t.string "time_zone" + t.integer "line_referential_id" + t.text "import_xml" end + add_index "companies", ["line_referential_id"], :name => "index_companies_on_line_referential_id" add_index "companies", ["objectid"], :name => "companies_objectid_key", :unique => true add_index "companies", ["registration_number"], :name => "companies_registration_number_key" @@ -201,6 +205,7 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.string "comment" t.string "registration_number" t.integer "line_referential_id" + t.text "import_xml" end add_index "group_of_lines", ["line_referential_id"], :name => "index_group_of_lines_on_line_referential_id" @@ -211,18 +216,6 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.integer "line_id", limit: 8 end - create_table "jobs", force: true do |t| - t.string "action" - t.datetime "created" - t.string "filename" - t.text "parameters" - t.string "referential" - t.datetime "started" - t.string "status" - t.string "type" - t.datetime "updated" - end - create_table "journey_frequencies", force: true do |t| t.integer "vehicle_journey_id", limit: 8 t.time "scheduled_headway_interval", null: false @@ -251,7 +244,7 @@ ActiveRecord::Schema.define(version: 20160515163540) do create_table "journey_patterns", force: true do |t| t.integer "route_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", null: false t.integer "object_version" t.datetime "creation_time" t.string "creator_id" @@ -261,12 +254,10 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.string "published_name" t.integer "departure_stop_point_id", limit: 8 t.integer "arrival_stop_point_id", limit: 8 - t.integer "route_section_ids", default: [], array: true - t.integer "section_status", default: 0, null: false + t.integer "section_status", default: 0, null: false end add_index "journey_patterns", ["objectid"], :name => "journey_patterns_objectid_key", :unique => true - add_index "journey_patterns", ["route_section_ids"], :name => "index_journey_patterns_on_route_section_ids" create_table "journey_patterns_stop_points", id: false, force: true do |t| t.integer "journey_pattern_id", limit: 8 @@ -281,16 +272,35 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.boolean "owner" end + create_table "line_referential_syncs", force: true do |t| + t.integer "line_referential_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "line_referential_syncs", ["line_referential_id"], :name => "index_line_referential_syncs_on_line_referential_id" + create_table "line_referentials", force: true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" + t.integer "sync_interval", default: 1 + end + + create_table "line_sync_operations", force: true do |t| + t.string "status" + t.integer "line_referential_sync_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "message" end + add_index "line_sync_operations", ["line_referential_sync_id"], :name => "index_line_sync_operations_on_line_referential_sync_id" + create_table "lines", force: true do |t| t.integer "network_id", limit: 8 t.integer "company_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", null: false t.integer "object_version" t.datetime "creation_time" t.string "creator_id" @@ -308,18 +318,14 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.string "text_color", limit: 6 t.string "stable_id" t.integer "line_referential_id" + t.boolean "deactivated", default: false + t.text "import_xml" end add_index "lines", ["line_referential_id"], :name => "index_lines_on_line_referential_id" add_index "lines", ["objectid"], :name => "lines_objectid_key", :unique => true add_index "lines", ["registration_number"], :name => "lines_registration_number_key" - create_table "links", id: false, force: true do |t| - t.integer "job_id", limit: 8, null: false - t.string "rel" - t.string "type" - end - create_table "networks", force: true do |t| t.string "objectid", null: false t.integer "object_version" @@ -333,8 +339,11 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.string "source_type" t.string "source_identifier" t.string "comment" + t.text "import_xml" + t.integer "line_referential_id" end + add_index "networks", ["line_referential_id"], :name => "index_networks_on_line_referential_id" add_index "networks", ["objectid"], :name => "networks_objectid_key", :unique => true add_index "networks", ["registration_number"], :name => "networks_registration_number_key" @@ -352,6 +361,8 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.datetime "created_at" t.datetime "updated_at" t.string "data_format", default: "neptune" + t.string "code" + t.datetime "synced_at" end create_table "pt_links", force: true do |t| @@ -386,19 +397,20 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.integer "line_referential_id" t.integer "stop_area_referential_id" t.integer "offer_workbench_id" + t.datetime "archived_at" end create_table "route_sections", force: true do |t| - t.integer "departure_id" - t.integer "arrival_id" + t.integer "departure_id", limit: 8 + t.integer "arrival_id", limit: 8 t.string "objectid", null: false t.integer "object_version" t.datetime "creation_time" t.string "creator_id" - t.spatial "input_geometry", limit: {:srid=>4326, :type=>"line_string"} - t.spatial "processed_geometry", limit: {:srid=>4326, :type=>"line_string"} t.float "distance" t.boolean "no_processing" + t.spatial "input_geometry", limit: {:srid=>4326, :type=>"line_string"} + t.spatial "processed_geometry", limit: {:srid=>4326, :type=>"line_string"} end create_table "routes", force: true do |t| @@ -469,6 +481,9 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.string "url" t.string "time_zone" t.integer "stop_area_referential_id" + t.string "status" + t.text "import_xml" + t.datetime "deleted_at" end add_index "stop_areas", ["objectid"], :name => "stop_areas_objectid_key", :unique => true @@ -597,6 +612,7 @@ ActiveRecord::Schema.define(version: 20160515163540) do t.string "invited_by_type" t.datetime "invitation_created_at" t.string "username" + t.datetime "synced_at" end add_index "users", ["email"], :name => "index_users_on_email", :unique => true @@ -643,12 +659,44 @@ ActiveRecord::Schema.define(version: 20160515163540) do add_index "vehicle_journeys", ["route_id"], :name => "index_vehicle_journeys_on_route_id" Foreigner.load + add_foreign_key "access_links", "access_points", name: "aclk_acpt_fkey", dependent: :delete + + add_foreign_key "group_of_lines_lines", "group_of_lines", name: "groupofline_group_fkey", dependent: :delete + add_foreign_key "journey_frequencies", "timebands", name: "journey_frequencies_timeband_id_fk", dependent: :nullify add_foreign_key "journey_frequencies", "vehicle_journeys", name: "journey_frequencies_vehicle_journey_id_fk", dependent: :nullify add_foreign_key "journey_pattern_sections", "journey_patterns", name: "journey_pattern_sections_journey_pattern_id_fk", dependent: :delete add_foreign_key "journey_pattern_sections", "route_sections", name: "journey_pattern_sections_route_section_id_fk", dependent: :delete - add_foreign_key "links", "jobs", name: "fk_n5ypxycc1stckgkm6ust2l6on" + add_foreign_key "journey_patterns", "routes", name: "jp_route_fkey", dependent: :delete + add_foreign_key "journey_patterns", "stop_points", name: "arrival_point_fkey", column: "arrival_stop_point_id", dependent: :nullify + add_foreign_key "journey_patterns", "stop_points", name: "departure_point_fkey", column: "departure_stop_point_id", dependent: :nullify + + add_foreign_key "journey_patterns_stop_points", "journey_patterns", name: "jpsp_jp_fkey", dependent: :delete + add_foreign_key "journey_patterns_stop_points", "stop_points", name: "jpsp_stoppoint_fkey", dependent: :delete + + add_foreign_key "routes", "routes", name: "route_opposite_route_fkey", column: "opposite_route_id", dependent: :nullify + + add_foreign_key "stop_areas", "stop_areas", name: "area_parent_fkey", column: "parent_id", dependent: :nullify + + add_foreign_key "stop_areas_stop_areas", "stop_areas", name: "stoparea_child_fkey", column: "child_id", dependent: :delete + add_foreign_key "stop_areas_stop_areas", "stop_areas", name: "stoparea_parent_fkey", column: "parent_id", dependent: :delete + + add_foreign_key "stop_points", "routes", name: "stoppoint_route_fkey", dependent: :delete + + add_foreign_key "time_table_dates", "time_tables", name: "tm_date_fkey", dependent: :delete + + add_foreign_key "time_table_periods", "time_tables", name: "tm_period_fkey", dependent: :delete + + add_foreign_key "time_tables_vehicle_journeys", "time_tables", name: "vjtm_tm_fkey", dependent: :delete + add_foreign_key "time_tables_vehicle_journeys", "vehicle_journeys", name: "vjtm_vj_fkey", dependent: :delete + + add_foreign_key "vehicle_journey_at_stops", "stop_points", name: "vjas_sp_fkey", dependent: :delete + add_foreign_key "vehicle_journey_at_stops", "vehicle_journeys", name: "vjas_vj_fkey", dependent: :delete + + add_foreign_key "vehicle_journeys", "companies", name: "vj_company_fkey", dependent: :nullify + add_foreign_key "vehicle_journeys", "journey_patterns", name: "vj_jp_fkey", dependent: :delete + add_foreign_key "vehicle_journeys", "routes", name: "vj_route_fkey", dependent: :delete end diff --git a/db/seeds.rb b/db/seeds.rb index bbd555700..a975b07f8 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -7,13 +7,14 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Emanuel', :city => cities.first) -stif = Organisation.find_or_create_by(name: "STIF") +stif = Organisation.find_or_create_by!(name: "STIF") do |org| + org.code = 'STIF' +end stif.users.find_or_create_by!(username: "admin") do |user| user.email = 'stif-boiv@af83.com' user.password = "secret" user.name = "STIF Administrateur" - user.skip_confirmation! end OfferWorkbench.find_or_create_by(name: "Gestion de l'offre", organisation: stif) @@ -24,7 +25,6 @@ operator.users.find_or_create_by!(username: "transporteur") do |user| user.email = 'stif-boiv+transporteur@af83.com' user.password = "secret" user.name = "Martin Lejeune" - user.skip_confirmation! end stop_area_referential = StopAreaReferential.find_or_create_by(name: "Reflex") do |referential| @@ -41,10 +41,16 @@ line_referential = LineReferential.find_or_create_by(name: "CodifLigne") do |ref referential.add_member operator end +LineReferentialSync.find_or_create_by(line_referential: line_referential) + 10.times do |n| - line_referential.lines.find_or_create_by name: "Test #{n}" + line_referential.lines.find_or_create_by name: "Test #{n}" do |l| + l.objectid = "Chouette:Dummy:Line:00" + n.to_s + end end + + offer_workbench = OfferWorkbench.find_or_create_by(name: "Gestion de l'offre", organisation: operator) [["parissudest201604", "Paris Sud-Est Avril 2016"], diff --git a/features/authentification.feature b/features/authentification.feature new file mode 100644 index 000000000..330959178 --- /dev/null +++ b/features/authentification.feature @@ -0,0 +1,9 @@ +# language: fr +Fonctionnalité: Authentification + + Contexte: Utilisateur enregistré + Etant donné un compte confirmé pour "john@stif-boiv.info" avec un nom d'utilisateur "john" + + Scénario: Un utilisateur non connecté ne doit pas pouvoir accéder à l'application + Etant donné que je suis déconnecté + # Alors je ne dois pas pouvoir visiter la page "d'accueil"
\ No newline at end of file diff --git a/features/step_definitions/.gitkeep b/features/step_definitions/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/features/step_definitions/.gitkeep diff --git a/features/step_definitions/authentification_steps.rb b/features/step_definitions/authentification_steps.rb new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/features/step_definitions/authentification_steps.rb diff --git a/features/step_definitions/general_steps.rb b/features/step_definitions/general_steps.rb new file mode 100644 index 000000000..cb3a6a69c --- /dev/null +++ b/features/step_definitions/general_steps.rb @@ -0,0 +1,10 @@ +# language: fr + +##### Alors ##### +Alors(/^je ne dois pas pouvoir visiter la page (.+)$/) do |name| + case name + when "d'accueil" + visit root_path + end + expect(page.status_code).to eq(403) +end
\ No newline at end of file diff --git a/features/step_definitions/users_steps.rb b/features/step_definitions/users_steps.rb new file mode 100644 index 000000000..b84ec1fa5 --- /dev/null +++ b/features/step_definitions/users_steps.rb @@ -0,0 +1,16 @@ +# language: fr + +##### Utility methods ##### +def create_user email, password, username + Fabricate.build(:user, email: email, username: username, password: password).save +end + +##### Etant donné ##### +Etantdonné(/^un compte confirmé pour "([^\"]+)"(?: avec un nom d'utilisateur "(.+)")?$/) do |email, username| + username ||= email.split("@").first + create_user email, 'password', username +end + +Etantdonnéque(/^je suis déconnecté$/) do + # visit destroy_user_session_path +end
\ No newline at end of file diff --git a/features/support/env.rb b/features/support/env.rb new file mode 100644 index 000000000..64ddf6108 --- /dev/null +++ b/features/support/env.rb @@ -0,0 +1,58 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + +require 'cucumber/rails' + +# Capybara defaults to CSS3 selectors rather than XPath. +# If you'd prefer to use XPath, just uncomment this line and adjust any +# selectors in your step definitions to use the XPath syntax. +# Capybara.default_selector = :xpath + +# By default, any exception happening in your Rails application will bubble up +# to Cucumber so that your scenario will fail. This is a different from how +# your application behaves in the production environment, where an error page will +# be rendered instead. +# +# Sometimes we want to override this default behaviour and allow Rails to rescue +# exceptions and display an error page (just like when the app is running in production). +# Typical scenarios where you want to do this is when you test your error pages. +# There are two ways to allow Rails to rescue exceptions: +# +# 1) Tag your scenario (or feature) with @allow-rescue +# +# 2) Set the value below to true. Beware that doing this globally is not +# recommended as it will mask a lot of errors for you! +# +ActionController::Base.allow_rescue = false + +# Remove/comment out the lines below if your app doesn't have a database. +# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead. +begin + DatabaseCleaner.strategy = :transaction +rescue NameError + raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it." +end + +# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios. +# See the DatabaseCleaner documentation for details. Example: +# +# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do +# # { :except => [:widgets] } may not do what you expect here +# # as Cucumber::Rails::Database.javascript_strategy overrides +# # this setting. +# DatabaseCleaner.strategy = :truncation +# end +# +# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do +# DatabaseCleaner.strategy = :transaction +# end +# + +# Possible values are :truncation and :transaction +# The :transaction strategy is faster, but might give you threading problems. +# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature +Cucumber::Rails::Database.javascript_strategy = :truncation + diff --git a/lib/stif/codif_line_synchronization.rb b/lib/stif/codif_line_synchronization.rb new file mode 100644 index 000000000..01ad29afc --- /dev/null +++ b/lib/stif/codif_line_synchronization.rb @@ -0,0 +1,177 @@ +module Stif + module CodifLineSynchronization + class << self + # Don't check last synchronizations if force_sync + def synchronize force_sync = false + # Check last synchronization and synchronization interval + date = DateTime.now.to_date - LineReferential.first.sync_interval.days + last_sync = LineReferential.first.line_referential_sync.line_sync_operations.where(status: :ok).last.try(:created_at) + return if last_sync.present? && last_sync.to_date > date && !force_sync + + start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) + # TODO Check exceptions and status messages + begin + # Fetch Codifline data + client = Codifligne::API.new + operators = client.operators + lines = client.lines + networks = client.networks + groups_of_lines = client.groups_of_lines + + Rails.logger.info "Codifligne:sync - Codifligne request processed in #{elapsed_time_since start_time} seconds" + + # Create or update Companies + stime = Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) + operators.map { |o| create_or_update_company(o) } + log_create_or_update "Companies", operators.count, stime + + # Create or update Lines + stime = Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) + lines.map { |l| create_or_update_line(l) } + log_create_or_update "Lines", lines.count, stime + + # Create or update Networks + stime = Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) + networks.map { |n| create_or_update_network(n) } + log_create_or_update "Networks", networks.count, stime + + # Create or update Group of lines + stime = Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) + groups_of_lines.map { |g| create_or_update_group_of_lines(g) } + log_create_or_update "Group of lines", groups_of_lines.count, stime + + # Delete deprecated Group of lines + deleted_gr = delete_deprecated(groups_of_lines, Chouette::GroupOfLine) + log_deleted "Group of lines", deleted_gr unless deleted_gr == 0 + + # Delete deprecated Networks + deleted_ne = delete_deprecated(networks, Chouette::Network) + log_deleted "Networks", deleted_ne unless deleted_ne == 0 + + # Delete deprecated Lines + deleted_li = delete_deprecated_lines(lines) + log_deleted "Lines", deleted_li unless deleted_li == 0 + + # Delete deprecated Operators + deleted_op = delete_deprecated(operators, Chouette::Company) + log_deleted "Operators", deleted_op unless deleted_op == 0 + + # Building log message + total_codifligne_elements = operators.count + lines.count + networks.count + groups_of_lines.count + total_deleted = deleted_op + deleted_li + deleted_ne + deleted_gr + total_time = elapsed_time_since start_time + + LineReferential.first.line_referential_sync.record_status :ok, I18n.t('synchronization.message.success', time: total_time, imported: total_codifligne_elements, deleted: total_deleted) + rescue Exception => e + total_time = elapsed_time_since start_time + + Rails.logger.error "Codifligne:sync - Error: #{e}, ended after #{total_time} seconds" + LineReferential.first.line_referential_sync.record_status :ko, I18n.t('synchronization.message.failure', time: total_time) + end + end + + def create_or_update_company(api_operator) + params = { + name: api_operator.name, + objectid: api_operator.stif_id, + import_xml: api_operator.xml + } + save_or_update(params, Chouette::Company) + end + + def create_or_update_line(api_line) + params = { + name: api_line.name, + objectid: api_line.stif_id, + number: api_line.short_name, + deactivated: (api_line.status == "inactive" ? true : false), + import_xml: api_line.xml + } + + # Find Company + # TODO Check behavior when operator_codes count is 0 or > 1 + if api_line.operator_codes.any? + company_id = "STIF:CODIFLIGNE:Operator:" + api_line.operator_codes.first + params[:company] = Chouette::Company.find_by(objectid: company_id) + end + + save_or_update(params, Chouette::Line) + end + + def create_or_update_network(api_network) + params = { + name: api_network.name, + objectid: api_network.stif_id, + import_xml: api_network.xml + } + + # Find Lines + params[:lines] = [] + api_network.line_codes.each do |line| + line_id = "STIF:CODIFLIGNE:Line:" + line + params[:lines] << Chouette::Line.find_by(objectid: line_id) + end + + save_or_update(params, Chouette::Network) + end + + def create_or_update_group_of_lines(api_group_of_lines) + params = { + name: api_group_of_lines.name, + objectid: api_group_of_lines.stif_id, + import_xml: api_group_of_lines.xml + } + + # Find Lines + params[:lines] = [] + api_group_of_lines.line_codes.each do |line| + line_id = "STIF:CODIFLIGNE:Line:" + line + # TODO : handle when lines doesn't exist + chouette_line = Chouette::Line.find_by(objectid: line_id) + params[:lines] << chouette_line if chouette_line.present? + end + + save_or_update(params, Chouette::GroupOfLine) + end + + def delete_deprecated(objects, klass) + ids = objects.map{ |o| o.stif_id }.to_a + deprecated = klass.where.not(objectid: ids) + deprecated.destroy_all.length + end + + def delete_deprecated_lines(lines) + ids = lines.map{ |l| l.stif_id }.to_a + deprecated = Chouette::Line.where.not(objectid: ids).where(deactivated: false) + deprecated.update_all deactivated: true + end + + def save_or_update(params, klass) + params[:line_referential] = LineReferential.first + object = klass.where(objectid: params[:objectid]).first + if object + object.assign_attributes(params) + object.save if object.changed? + else + object = klass.new(params) + object.save if object.valid? + end + object + end + + def elapsed_time_since start_time = 0 + Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) - start_time + end + + def log_create_or_update name, count, start_time + time = elapsed_time_since start_time + Rails.logger.info "Codifligne:sync - #{count} #{name} retrieved" + Rails.logger.info "Codifligne:sync - Create or update #{name} done in #{time} seconds" + end + + def log_deleted name, count + Rails.logger.info "Codifligne:sync - #{count} #{name} deleted" + end + end + end +end
\ No newline at end of file diff --git a/lib/stif/reflex_synchronization.rb b/lib/stif/reflex_synchronization.rb new file mode 100644 index 000000000..55fe3d404 --- /dev/null +++ b/lib/stif/reflex_synchronization.rb @@ -0,0 +1,116 @@ +module Stif + module ReflexSynchronization + class << self + def defaut_referential + StopAreaReferential.find_by(name: "Reflex") + end + + # Todo remove dummy objectid + def find_by_object_id objectid + Chouette::StopArea.find_by(objectid: "dummy:StopArea:#{objectid.tr(':', '')}") + end + + def synchronize + start = Time.now + client = Reflex::API.new + processed = [] + + ['getOR', 'getOP'].each do |method| + results = client.process method + Rails.logger.info "Reflex:sync - Process #{method} done in #{Time.now - start} seconds" + results.each do |type, entries| + Rails.logger.info "Reflex:sync - #{entries.count} #{type} retrieved" + end + + # Create or update stop_area for every quay, stop_place + stop_areas = results[:Quay].merge(results[:StopPlace]) + start = Time.now + stop_areas.each do |id, entry| + processed << self.create_or_update_stop_area(entry).objectid + end + Rails.logger.info "Reflex:sync - Create or update StopArea done in #{Time.now - start} seconds" + + # Walk through every entry and set parent stop_area + start = Time.now + stop_areas.each do |id, entry| + self.stop_area_set_parent entry + end + Rails.logger.info "Reflex:sync - StopArea set parent done in #{Time.now - start} seconds" + end + # Purge deleted stop_area + self.set_deleted_stop_area processed.uniq + end + + def set_deleted_stop_area processed + Rails.logger.info "Reflex:sync - StopArea start deleted_stop_area" + start = Time.now + deleted = Chouette::StopArea.where(deleted_at: nil).pluck(:objectid).uniq - processed + deleted.each_slice(50) do |object_ids| + Chouette::StopArea.where(objectid: object_ids).update_all(deleted_at: Time.now) + end + Rails.logger.info "Reflex:sync - StopArea #{deleted.size} stop_area deleted since last sync" + Rails.logger.info "Reflex:sync - StopArea purge deleted in #{Time.now - start} seconds" + end + + def stop_area_set_parent entry + return false unless entry.try(:parent_site_ref) || entry.try(:quays) + stop = self.find_by_object_id entry.id + return false unless stop + + if entry.try(:parent_site_ref) + stop.parent = self.find_by_object_id entry.parent_site_ref + stop.save if stop.changed + end + + if entry.try(:quays) + entry.quays.each do |quay| + children = self.find_by_object_id(quay[:ref]) + next unless children + children.parent = stop + children.save if children.changed? + end + end + end + + def create_or_update_access_point entry, stop_area + access = Chouette::AccessPoint.find_or_create_by(objectid: "dummy:AccessPoint:#{entry.id.tr(':', '')}") + entry.version = entry.version.to_i + 1 if access.persisted? + access.stop_area = stop_area + { + :name => :name, + :access_type => :area_type, + :object_version => :version, + :zip_code => :postal_code, + :city_name => :city, + :import_xml => :xml + }.each do |k, v| access[k] = entry.try(v) end + access.save if access.changed? + end + + def create_or_update_stop_area entry + stop = Chouette::StopArea.find_or_create_by(objectid: "dummy:StopArea:#{entry.id.tr(':', '')}") + # Hack, on save object_version will be incremented by 1 + entry.version = entry.version.to_i + 1 if stop.persisted? + stop.deleted_at = nil + stop.stop_area_referential = self.defaut_referential + { + :name => :name, + :creation_time => :created, + :area_type => :area_type, + :object_version => :version, + :zip_code => :postal_code, + :city_name => :city, + :import_xml => :xml + }.each do |k, v| stop[k] = entry.try(v) end + stop.save if stop.changed? + # Create AccessPoint from StopPlaceEntrance + if entry.try(:entrances) + entry.entrances.each do |entrance| + self.create_or_update_access_point entrance, stop + end + end + stop + end + end + end +end diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index beb3b19d1..7fca878b6 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -33,4 +33,4 @@ namespace :ci do end desc "Run continuous integration tasks (spec, ...)" -task :ci => ["ci:setup", "spec", "ci:deploy", "ci:clean"] +task :ci => ["ci:setup", "spec", "cucumber", "ci:deploy", "ci:clean"] diff --git a/lib/tasks/codifligne.rake b/lib/tasks/codifligne.rake new file mode 100644 index 000000000..8b7a4f669 --- /dev/null +++ b/lib/tasks/codifligne.rake @@ -0,0 +1,6 @@ +namespace :codifligne do + desc "Sync lines, companies, networks, and group of lines from codifligne" + task sync: :environment do + Stif::CodifLineSynchronization.synchronize + end +end diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake new file mode 100644 index 000000000..23d9b3eb4 --- /dev/null +++ b/lib/tasks/cucumber.rake @@ -0,0 +1,76 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + + +unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks + +vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first +$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? + +begin + require 'cucumber/rake/task' + + namespace :cucumber do + Cucumber::Rake::Task.new({:ok => 'test:prepare'}, 'Run features that should pass') do |t| + t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. + t.fork = true # You may get faster startup if you set this to false + t.profile = 'default' + end + + Cucumber::Rake::Task.new({:wip => 'test:prepare'}, 'Run features that are being worked on') do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.profile = 'wip' + end + + Cucumber::Rake::Task.new({:rerun => 'test:prepare'}, 'Record failing features and run only them if any exist') do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.profile = 'rerun' + end + + desc 'Run all features' + task :all => [:ok, :wip] + + task :statsetup do + require 'rails/code_statistics' + ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features') + ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features') + end + + task :annotations_setup do + Rails.application.configure do + if config.respond_to?(:annotations) + config.annotations.directories << 'features' + config.annotations.register_extensions('feature') { |tag| /#\s*(#{tag}):?\s*(.*)$/ } + end + end + end + end + desc 'Alias for cucumber:ok' + task :cucumber => 'cucumber:ok' + + task :default => :cucumber + + task :features => :cucumber do + STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" + end + + # In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon. + task 'test:prepare' do + end + + task :stats => 'cucumber:statsetup' + + task :notes => 'cucumber:annotations_setup' +rescue LoadError + desc 'cucumber rake task not available (cucumber not installed)' + task :cucumber do + abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' + end +end + +end diff --git a/lib/tasks/demo.rake b/lib/tasks/demo.rake index fbafa96c1..d7e8c59f1 100644 --- a/lib/tasks/demo.rake +++ b/lib/tasks/demo.rake @@ -10,14 +10,13 @@ namespace :demo do organisation = Organisation.create!(:name => "DemoChouette") user = organisation.users.create( :name => "Demo", :email => "demo@chouette.mobi", :password => "chouette", :password_confirmation =>"chouette") - user.confirm! referential = organisation.referentials.create( :name => "Tatrobus", :slug => "tatrobus", :prefix => "TAT") #resource = Rack::Test::UploadedFile.new( Rails.application.config.demo_data, 'application/zip', false) #import_instance = ImportTask.new( :resources => resource, :referential_id => referential.id, :user_name => user.name, :no_save => false, :user_id => user.id, :name => "initialize demo", :data_format => "neptune") #import_instance.save - - File.open("/tmp/parameters_demo.json", "w") { |file| + + File.open("/tmp/parameters_demo.json", "w") { |file| file.write('{ "parameters" : { "neptune-import": { @@ -30,10 +29,10 @@ namespace :demo do } } }') } - + cmd = 'curl -F "file=@'+Rails.application.config.demo_data+';filename=tatrobus.zip" -F "file=@/tmp/parameters_demo.json;filename=parameters.json" http://localhost:8180/chouette_iev/referentials/tatrobus/importer/neptune' system(cmd) - + puts "Restore demo environment complete" end end diff --git a/lib/tasks/organisations.rake b/lib/tasks/organisations.rake new file mode 100644 index 000000000..1b21d7119 --- /dev/null +++ b/lib/tasks/organisations.rake @@ -0,0 +1,6 @@ +namespace :organisations do + desc "Sync organisations from stif portail" + task sync: :environment do + Organisation.portail_sync + end +end diff --git a/lib/tasks/reflex.rake b/lib/tasks/reflex.rake new file mode 100644 index 000000000..0020f1b60 --- /dev/null +++ b/lib/tasks/reflex.rake @@ -0,0 +1,8 @@ +namespace :reflex do + desc "Sync data from Reflex api" + task sync: :environment do + start = Time.now + Stif::ReflexSynchronization.synchronize + Rails.logger.debug "Reflex:sync done in #{Time.now - start} seconds !" + end +end diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake new file mode 100644 index 000000000..c045639c1 --- /dev/null +++ b/lib/tasks/users.rake @@ -0,0 +1,6 @@ +namespace :users do + desc "Sync users from stif portail" + task sync: :environment do + User.portail_sync + end +end diff --git a/lib/tasks/warbler.rake b/lib/tasks/warbler.rake deleted file mode 100644 index e69457583..000000000 --- a/lib/tasks/warbler.rake +++ /dev/null @@ -1,12 +0,0 @@ -begin - require 'warbler' - Warbler::Task.new - - task "war:setup" do - ENV['RAILS_RELATIVE_URL_ROOT'] ||= "/chouette2" - end - - task :war => ["war:setup", "assets:precompile"] -rescue LoadError => e - puts "Failed to load Warbler. Make sure it's installed." -end diff --git a/script/cucumber b/script/cucumber new file mode 100755 index 000000000..7fa5c9208 --- /dev/null +++ b/script/cucumber @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby + +vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first +if vendored_cucumber_bin + load File.expand_path(vendored_cucumber_bin) +else + require 'rubygems' unless ENV['NO_RUBYGEMS'] + require 'cucumber' + load Cucumber::BINARY +end diff --git a/spec/fabricators/user_fabricator.rb b/spec/fabricators/user_fabricator.rb new file mode 100644 index 000000000..04c1c6279 --- /dev/null +++ b/spec/fabricators/user_fabricator.rb @@ -0,0 +1,8 @@ +Fabricator :user do + email { sequence(:email) { |i| "user#{i}@example.com" } } + name { sequence(:name) { |i| "fname#{i}" } } + + password { 'password' } + + username { "#{FFaker::Name.first_name.parameterize}.#{FFaker::Name.last_name.parameterize}" } +end
\ No newline at end of file diff --git a/spec/factories/chouette_2_factories.rb b/spec/factories/chouette_2_factories.rb index 6234f6540..b88b0d773 100644 --- a/spec/factories/chouette_2_factories.rb +++ b/spec/factories/chouette_2_factories.rb @@ -2,6 +2,7 @@ FactoryGirl.define do factory :organisation do sequence(:name) { |n| "Organisation #{n}" } + sequence(:code) { |n| "000#{n}" } end factory :referential do diff --git a/spec/factories/chouette_companies.rb b/spec/factories/chouette_companies.rb index c0e46fe42..35ce34257 100644 --- a/spec/factories/chouette_companies.rb +++ b/spec/factories/chouette_companies.rb @@ -2,8 +2,10 @@ FactoryGirl.define do factory :company, :class => Chouette::Company do sequence(:name) { |n| "Company #{n}" } - sequence(:objectid) { |n| "test:Company:#{n}" } + sequence(:objectid) { |n| "chouette:test:Company:#{n}" } sequence(:registration_number) { |n| "test-#{n}" } + + association :line_referential, :factory => :line_referential end end diff --git a/spec/factories/chouette_group_of_lines.rb b/spec/factories/chouette_group_of_lines.rb index 75fef2ce9..75739d6d3 100644 --- a/spec/factories/chouette_group_of_lines.rb +++ b/spec/factories/chouette_group_of_lines.rb @@ -2,7 +2,7 @@ FactoryGirl.define do factory :group_of_line, :class => Chouette::GroupOfLine do sequence(:name) { |n| "Group Of Line #{n}" } - sequence(:objectid) { |n| "test:GroupOfLine:#{n}" } + sequence(:objectid) { |n| "chouette:test:GroupOfLine:#{n}" } sequence(:registration_number) { |n| "#{n}" } association :line_referential diff --git a/spec/factories/chouette_lines.rb b/spec/factories/chouette_lines.rb index 0a720da48..da79f8c98 100644 --- a/spec/factories/chouette_lines.rb +++ b/spec/factories/chouette_lines.rb @@ -2,7 +2,7 @@ FactoryGirl.define do factory :line, :class => Chouette::Line do sequence(:name) { |n| "Line #{n}" } - sequence(:objectid) { |n| "test:Line:#{n}" } + sequence(:objectid) { |n| "chouette:test:Line:#{n}" } sequence(:transport_mode_name) { |n| "Bus" } association :network, :factory => :network diff --git a/spec/factories/chouette_networks.rb b/spec/factories/chouette_networks.rb index 8f9bfea51..f9cc4b5d6 100644 --- a/spec/factories/chouette_networks.rb +++ b/spec/factories/chouette_networks.rb @@ -2,7 +2,7 @@ FactoryGirl.define do factory :network, :class => Chouette::Network do sequence(:name) { |n| "Network #{n}" } - sequence(:objectid) { |n| "test:GroupOfLine:#{n}" } + sequence(:objectid) { |n| "chouette:test:GroupOfLine:#{n}" } sequence(:registration_number) { |n| "test-#{n}" } end diff --git a/spec/factories/line_referential_syncs.rb b/spec/factories/line_referential_syncs.rb new file mode 100644 index 000000000..86b1a2182 --- /dev/null +++ b/spec/factories/line_referential_syncs.rb @@ -0,0 +1,16 @@ +FactoryGirl.define do + factory :line_referential_sync do + line_referential nil + + factory :line_referential_sync_with_record do + transient do + line_sync_operations_count rand(1..30) + end + + after(:create) do |line_referential_sync, evaluator| + create_list(:line_sync_operation, evaluator.line_sync_operations_count, line_referential_sync: line_referential_sync) + end + + end + end +end diff --git a/spec/factories/line_referentials.rb b/spec/factories/line_referentials.rb index cfce1399f..47d0727c5 100644 --- a/spec/factories/line_referentials.rb +++ b/spec/factories/line_referentials.rb @@ -1,5 +1,6 @@ FactoryGirl.define do factory :line_referential do sequence(:name) { |n| "Line Referential #{n}" } + association :line_referential_sync, :factory => :line_referential_sync end end diff --git a/spec/factories/line_sync_operations.rb b/spec/factories/line_sync_operations.rb new file mode 100644 index 000000000..3d353bb3b --- /dev/null +++ b/spec/factories/line_sync_operations.rb @@ -0,0 +1,6 @@ +FactoryGirl.define do + factory :line_sync_operation do + status ["OK","KO"].sample + line_referential_sync nil + end +end diff --git a/spec/features/companies_spec.rb b/spec/features/companies_spec.rb index 3628d04f0..c85f6f2cd 100644 --- a/spec/features/companies_spec.rb +++ b/spec/features/companies_spec.rb @@ -31,7 +31,7 @@ describe "Companies", :type => :feature do click_link "Ajouter un transporteur" fill_in "company_name", :with => "Company 1" fill_in "Numéro d'enregistrement", :with => "test-1" - fill_in "Identifiant Neptune", :with => "test:Company:1" + fill_in "Identifiant Neptune", :with => "chouette:test:Company:1" click_button("Créer transporteur") expect(page).to have_content("Company 1") end diff --git a/spec/features/group_of_lines_spec.rb b/spec/features/group_of_lines_spec.rb index 202f9f1c4..f6de06c8b 100644 --- a/spec/features/group_of_lines_spec.rb +++ b/spec/features/group_of_lines_spec.rb @@ -44,7 +44,7 @@ describe "Group of lines", :type => :feature do click_link I18n.t('group_of_lines.actions.new') fill_in "group_of_line[name]", :with => "Group of lines 1" fill_in "group_of_line[registration_number]", :with => "1" - fill_in "group_of_line[objectid]", :with => "test:GroupOfLine:999" + fill_in "group_of_line[objectid]", :with => "chouette:test:GroupOfLine:999" click_button(I18n.t('formtastic.create',model: I18n.t('activerecord.models.group_of_line.one'))) expect(page).to have_content("Group of lines 1") end diff --git a/spec/features/lines_spec.rb b/spec/features/lines_spec.rb index 91185c22e..67303e05b 100644 --- a/spec/features/lines_spec.rb +++ b/spec/features/lines_spec.rb @@ -41,7 +41,7 @@ describe "Lines", :type => :feature do click_link "Ajouter une ligne" fill_in "line_name", :with => "Line 1" fill_in "Numéro d'enregistrement", :with => "1" - fill_in "Identifiant Neptune", :with => "test:Line:999" + fill_in "Identifiant Neptune", :with => "chouette:test:Line:999" click_button("Créer ligne") expect(page).to have_content("Line 1") end diff --git a/spec/features/networks_spec.rb b/spec/features/networks_spec.rb index c2433f04e..b68dda558 100644 --- a/spec/features/networks_spec.rb +++ b/spec/features/networks_spec.rb @@ -16,39 +16,39 @@ describe "Networks", :type => :feature do end - describe "show" do + describe "show" do it "display network" do - allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) + # allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) visit referential_networks_path(referential) click_link "#{networks.first.name}" expect(page).to have_content(networks.first.name) end - it "display map" do - allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) - visit referential_networks_path(referential) - click_link "#{networks.first.name}" - expect(page).to have_selector("#map.network") - end + # it "display map" do + # # allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) + # visit referential_networks_path(referential) + # click_link "#{networks.first.name}" + # expect(page).to have_selector("#map.network") + # end end - describe "new" do + describe "new" do it "creates network and return to show" do - allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) + # allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) visit referential_networks_path(referential) click_link "Ajouter un réseau" fill_in "network_name", :with => "Network 1" fill_in "Numéro d'enregistrement", :with => "test-1" - fill_in "Identifiant Neptune", :with => "test:GroupOfLine:1" + fill_in "Identifiant Neptune", :with => "chouette:test:GroupOfLine:1" click_button("Créer réseau") expect(page).to have_content("Network 1") end end - describe "edit and return to show" do + describe "edit and return to show" do it "edit network" do - allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) + # allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) visit referential_network_path(referential, subject) click_link "Modifier ce réseau" fill_in "network_name", :with => "Network Modified" @@ -58,7 +58,7 @@ describe "Networks", :type => :feature do end end - # describe "delete", :js => true do + # describe "delete", :js => true do # it "delete network and return to the list" do # subject.stub(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) # visit referential_network_path(referential, subject) diff --git a/spec/features/users/user_edit_spec.rb b/spec/features/users/user_edit_spec.rb index c7c742416..23a58ecae 100644 --- a/spec/features/users/user_edit_spec.rb +++ b/spec/features/users/user_edit_spec.rb @@ -36,9 +36,7 @@ feature 'User edit', :devise do # Then I see my own 'edit profile' page scenario "user cannot cannot edit another user's profile", :me do me = FactoryGirl.create(:user) - me.confirm! other = FactoryGirl.create(:user, email: 'other@example.com') - other.confirm! login_as(me, :scope => :user) visit edit_user_registration_path(other) expect(page).to have_content 'Votre Profil' diff --git a/spec/features/users/user_index_spec.rb b/spec/features/users/user_index_spec.rb index 2f6ec4426..2a9199da3 100644 --- a/spec/features/users/user_index_spec.rb +++ b/spec/features/users/user_index_spec.rb @@ -19,7 +19,6 @@ feature 'User index page', :devise do # Then I see my own email address scenario 'user sees own email address' do user = create(:user) - user.confirm! login_as(user, scope: :user) visit organisation_path expect(page).to have_content user.name.truncate(15) diff --git a/spec/features/users/user_show_spec.rb b/spec/features/users/user_show_spec.rb index 4a56e3255..d840d752c 100644 --- a/spec/features/users/user_show_spec.rb +++ b/spec/features/users/user_show_spec.rb @@ -19,7 +19,6 @@ feature 'User profile page', :devise do # Then I see my own email address scenario 'user sees own profile' do user = FactoryGirl.create(:user) - user.confirm! login_as(user, :scope => :user) visit organisation_user_path(user) # FIXME ref #819 @@ -33,9 +32,7 @@ feature 'User profile page', :devise do # Then I see an 'access denied' message scenario "user cannot see another user's profile" do me = FactoryGirl.create(:user) - me.confirm! other = FactoryGirl.create(:user, email: 'other@example.com', :organisation => me.organisation) - other.confirm! login_as(me, :scope => :user) Capybara.current_session.driver.header 'Referer', authenticated_root_path visit organisation_user_path(other) diff --git a/spec/fixtures/organizations.json b/spec/fixtures/organizations.json new file mode 100644 index 000000000..b70f99520 --- /dev/null +++ b/spec/fixtures/organizations.json @@ -0,0 +1,98 @@ +[{ + "id": 1, + "name": "STIF", + "code": "STIF", + "created_at": "2016-05-17T15:33:45.951Z", + "updated_at": "2016-05-17T15:33:45.951Z", + "organization_users": { + "users_count": 9 + }, + "suborganizations": { + "suborganizations_count": 4, + "suborganizations": [{ + "id": 6, + "name": "ALBATRANS", + "code": "ALBATRANS" + }, { + "id": 5, + "name": "OPTILE", + "code": "OPTILE" + }, { + "id": 2, + "name": "RATP", + "code": "RATP" + }, { + "id": 3, + "name": "SNCF", + "code": "SNCF" + }] + } +}, { + "id": 3, + "name": "SNCF", + "code": "SNCF", + "created_at": "2016-05-17T16:04:27.047Z", + "updated_at": "2016-05-17T16:04:27.047Z", + "organization_users": { + "users_count": 2 + }, + "suborganizations": { + "suborganizations_count": 0, + "suborganizations": [] + }, + "organization_parent": { + "parent_id": 1, + "parent_name": "STIF" + } +}, { + "id": 5, + "name": "OPTILE", + "code": "OPTILE", + "created_at": "2016-05-17T16:04:27.655Z", + "updated_at": "2016-05-17T16:04:27.655Z", + "organization_users": { + "users_count": 0 + }, + "suborganizations": { + "suborganizations_count": 0, + "suborganizations": [] + }, + "organization_parent": { + "parent_id": 1, + "parent_name": "STIF" + } +}, { + "id": 6, + "name": "ALBATRANS", + "code": "ALBATRANS", + "created_at": "2016-05-17T16:04:27.955Z", + "updated_at": "2016-05-17T16:04:27.955Z", + "organization_users": { + "users_count": 0 + }, + "suborganizations": { + "suborganizations_count": 0, + "suborganizations": [] + }, + "organization_parent": { + "parent_id": 1, + "parent_name": "STIF" + } +}, { + "id": 2, + "name": "RATP", + "code": "RATP", + "created_at": "2016-05-17T16:04:26.646Z", + "updated_at": "2016-05-31T10:06:39.349Z", + "organization_users": { + "users_count": 8 + }, + "suborganizations": { + "suborganizations_count": 0, + "suborganizations": [] + }, + "organization_parent": { + "parent_id": 1, + "parent_name": "STIF" + } +}] diff --git a/spec/fixtures/reflex.xml b/spec/fixtures/reflex.xml new file mode 100755 index 000000000..1a7f37728 --- /dev/null +++ b/spec/fixtures/reflex.xml @@ -0,0 +1,222 @@ +<?xml version="1.0" encoding="UTF-8"?> +<PublicationDelivery xsi:schemaLocation="http://www.netex.org.uk/netex localPathToXSDFileIfNecessary/NeTEx_publication.xsd" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:acsb="http://www.ifopt.org.uk/acsb" xmlns:ifopt="http://www.ifopt.org.uk/ifopt" xmlns:netex="http://www.netex.org.uk/netex" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <PublicationTimestamp>2016-08-11T06:00:46.0Z</PublicationTimestamp> + <ParticipantRef>SYS001</ParticipantRef> + <dataObjects> + <CompositeFrame version="1" created="2016-08-11T06:00:46.0Z" id="STIF-REFLEX:CompositeFrame:NETEX_STIF"> + <frames> + <GeneralFrame version="001" id="STIF-REFLEX:TypeOfFrame:NETEX_COMMUN"> + <Name>Frame NETEX_COMMUN</Name> + <Description>Frame NETEX_COMMUN</Description> + <members modificationSet="all"> + <GeneralGroupOfEntities version="657750" created="2015-04-21T10:04:37.0Z" changed="2015-04-21T10:04:37.0Z" id="FR:91479:GDL:415731:STIF"> + <Name>Aéroport d'Orly</Name> + <PurposeOfGroupingRef version="any" ref="NETEX_ARRET_STIF:PurposeOfGrouping:groupOfStopPlace"/> + <members> + <StopPlaceRef ref="FR:91479:LDA:63284:STIF">version=63284</StopPlaceRef> + <StopPlaceRef ref="FR:91479:LDA:63278:STIF">version=63278</StopPlaceRef> + </members> + </GeneralGroupOfEntities> + <GeneralGroupOfEntities version="657753" created="2015-04-21T10:04:57.0Z" changed="2015-04-21T10:04:57.0Z" id="FR:77282:GDL:415732:STIF"> + <Name>Aéroport Roissy Charles de Gaulle</Name> + <PurposeOfGroupingRef version="any" ref="NETEX_ARRET_STIF:PurposeOfGrouping:groupOfStopPlace"/> + <members> + <StopPlaceRef ref="FR:77282:LDA:69212:STIF">version=69212</StopPlaceRef> + <StopPlaceRef ref="FR:93073:LDA:412554:STIF">version=480224</StopPlaceRef> + <StopPlaceRef ref="FR:93073:LDA:412553:STIF">version=480203</StopPlaceRef> + <StopPlaceRef ref="FR:77291:LDA:73699:STIF">version=654808</StopPlaceRef> + <StopPlaceRef ref="FR:null:LDA:412679:STIF">version=483360</StopPlaceRef> + <StopPlaceRef ref="FR:95527:LDA:74162:STIF">version=739348</StopPlaceRef> + <StopPlaceRef ref="FR:77291:LDA:411293:STIF">version=411628</StopPlaceRef> + <StopPlaceRef ref="FR:93073:LDA:73596:STIF">version=73596</StopPlaceRef> + <StopPlaceRef ref="FR:93073:LDA:73846:STIF">version=73846</StopPlaceRef> + <StopPlaceRef ref="FR:77291:LDA:73845:STIF">version=73845</StopPlaceRef> + <StopPlaceRef ref="FR:77291:LDA:73595:STIF">version=73595</StopPlaceRef> + </members> + </GeneralGroupOfEntities> + <GeneralGroupOfEntities version="657747" created="2015-04-21T10:04:27.0Z" changed="2015-04-21T10:04:27.0Z" id="FR:75115:GDL:415730:STIF"> + <Name>Gare Montparnasse</Name> + <PurposeOfGroupingRef version="any" ref="NETEX_ARRET_STIF:PurposeOfGrouping:groupOfStopPlace"/> + <members> + <StopPlaceRef ref="FR:75115:LDA:71139:STIF">version=657746</StopPlaceRef> + </members> + </GeneralGroupOfEntities> + <ValueSet version="any" id="NETEX_ARRET_STIF:ValueSet:VS01"> + <values> + <PurposeOfGrouping version="any" id="NETEX_ARRET_STIF:PurposeOfGrouping:groupOfStopPlace"> + <Name>Group of Stop Place</Name> + <classes> + <ClassRef nameOfClass="StopPlace"/> + </classes> + </PurposeOfGrouping> + </values> + </ValueSet> + </members> + </GeneralFrame> + <GeneralFrame version="001" id="STIF-REFLEX:TypeOfFrame:NETEX_ARRET_STIF"> + <Name>Frame NETEX_ARRET_STIF</Name> + <Description>Frame NETEX_ARRET_STIF</Description> + <members modificationSet="all"> + <StopPlace version="777416" created="2014-12-29T03:12:51.0Z" changed="2016-07-26T12:07:19.0Z" id="FR:77153:LDA:69325:STIF"> + <Name>First stopPlace</Name> + <placeTypes> + <TypeOfPlaceRef ref="LDA"/> + </placeTypes> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:69325"> + <Town>Dammartin-en-Goële</Town> + <PostalRegion>77153</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:69325"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + <StopPlaceType>onstreetBus</StopPlaceType> + </StopPlace> + <StopPlace version="42564" created="2014-12-29T03:12:51.0Z" changed="2014-12-29T03:12:51.0Z" id="FR:77153:ZDL:42564:STIF"> + <keyList> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>OBJECT_STATUS</Key> + <Value>REFERENCE_OBJECT</Value> + </KeyValue> + </keyList> + <Name>First stopPlace children</Name> + <placeTypes> + <TypeOfPlaceRef ref="ZDL"/> + </placeTypes> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:42564"> + <Town>Dammartin-en-Goële</Town> + <PostalRegion>77153</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:42564"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + <ParentSiteRef ref="FR:77153:LDA:69325:STIF" version="777416"/> + <entrances> + <StopPlaceEntrance version="174" id="FR:91421:ADL:174:STIF"> + <Name>Montgeron Crosne - Rue Du Moulin De Senlis</Name> + <Centroid> + <Location> + <gml:pos srsName="EPSG:2154">660491.94 6845481.0</gml:pos> + </Location> + </Centroid> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:174"> + <Town>Montgeron</Town> + <PostalRegion>91421</PostalRegion> + </PostalAddress> + <IsEntry>true</IsEntry> + <IsExit>true</IsExit> + </StopPlaceEntrance> + <StopPlaceEntrance version="173" id="FR:91421:ADL:173:STIF"> + <Name>Montgeron Crosne - Rue Du Moulin De Senlis</Name> + <Centroid> + <Location> + <gml:pos srsName="EPSG:2154">660324.94 6845590.5</gml:pos> + </Location> + </Centroid> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:173"> + <Town>Montgeron</Town> + <PostalRegion>91421</PostalRegion> + </PostalAddress> + <IsEntry>true</IsEntry> + <IsExit>true</IsExit> + </StopPlaceEntrance> + </entrances> + <StopPlaceType>onstreetBus</StopPlaceType> + <quays> + <QuayRef ref="FR:77153:ZDE:38240:STIF" version="782150"/> + </quays> + </StopPlace> + + <StopPlace version="779971" created="2014-12-29T12:12:00.0Z" changed="2016-07-28T03:07:39.0Z" id="FR:95277:LDA:65926:STIF"> + <Name>Second StopPlace</Name> + <placeTypes> + <TypeOfPlaceRef ref="LDA"/> + </placeTypes> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:65926"> + <Town>Gonesse</Town> + <PostalRegion>95277</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:65926"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + <StopPlaceType>onstreetBus</StopPlaceType> + </StopPlace> + <StopPlace version="779966" created="2014-12-29T03:12:51.0Z" changed="2016-07-28T03:07:56.0Z" id="FR:95277:ZDL:46738:STIF"> + <keyList> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>OBJECT_STATUS</Key> + <Value>REFERENCE_OBJECT</Value> + </KeyValue> + </keyList> + <Name>Second StopPlace children</Name> + <placeTypes> + <TypeOfPlaceRef ref="ZDL"/> + </placeTypes> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:46738"> + <Town>Gonesse</Town> + <PostalRegion>95277</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:46738"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + <ParentSiteRef ref="FR:95277:LDA:65926:STIF" version="779971"/> + <StopPlaceType>onstreetBus</StopPlaceType> + <quays> + <QuayRef ref="FR:95277:ZDE:38010:STIF" version="777963"/> + </quays> + </StopPlace> + <Quay version="783636" created="2014-12-29T03:12:51.0Z" changed="2016-08-05T10:08:59.0Z" id="FR:95277:ZDE:38010:STIF"> + <keyList> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>OBJECT_STATUS</Key> + <Value>REFERENCE_OBJECT</Value> + </KeyValue> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>LINE_ID</Key> + <Value>002002003</Value> + </KeyValue> + </keyList> + <Name>Quay of Second StopPlace children</Name> + <Centroid> + <Location> + <gml:pos srsName="EPSG:2154">657252.0 6847664.0</gml:pos> + </Location> + </Centroid> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:21634"> + <Town>Ablon-sur-Seine</Town> + <PostalRegion>94001</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:21634"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + </Quay> + <Quay version="783636" created="2014-12-29T03:12:51.0Z" changed="2016-08-05T10:08:59.0Z" id="FR:77153:ZDE:38240:STIF"> + <keyList> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>OBJECT_STATUS</Key> + <Value>REFERENCE_OBJECT</Value> + </KeyValue> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>LINE_ID</Key> + <Value>002002003</Value> + </KeyValue> + </keyList> + <Name>Quay of First stopPlace children</Name> + <Centroid> + <Location> + <gml:pos srsName="EPSG:2154">657252.0 6847664.0</gml:pos> + </Location> + </Centroid> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:21634"> + <Town>Ablon-sur-Seine</Town> + <PostalRegion>94001</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:21634"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + </Quay> + </members> + </GeneralFrame> + </frames> + </CompositeFrame> + </dataObjects> +</PublicationDelivery> diff --git a/spec/fixtures/reflex.zip b/spec/fixtures/reflex.zip Binary files differnew file mode 100644 index 000000000..7c8858a8f --- /dev/null +++ b/spec/fixtures/reflex.zip diff --git a/spec/fixtures/reflex_updated.xml b/spec/fixtures/reflex_updated.xml new file mode 100755 index 000000000..e49b84759 --- /dev/null +++ b/spec/fixtures/reflex_updated.xml @@ -0,0 +1,207 @@ +<?xml version="1.0" encoding="UTF-8"?> +<PublicationDelivery xsi:schemaLocation="http://www.netex.org.uk/netex localPathToXSDFileIfNecessary/NeTEx_publication.xsd" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:acsb="http://www.ifopt.org.uk/acsb" xmlns:ifopt="http://www.ifopt.org.uk/ifopt" xmlns:netex="http://www.netex.org.uk/netex" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <PublicationTimestamp>2016-08-11T06:00:46.0Z</PublicationTimestamp> + <ParticipantRef>SYS001</ParticipantRef> + <dataObjects> + <CompositeFrame version="1" created="2016-08-11T06:00:46.0Z" id="STIF-REFLEX:CompositeFrame:NETEX_STIF"> + <frames> + <GeneralFrame version="001" id="STIF-REFLEX:TypeOfFrame:NETEX_COMMUN"> + <Name>Frame NETEX_COMMUN</Name> + <Description>Frame NETEX_COMMUN</Description> + <members modificationSet="all"> + <GeneralGroupOfEntities version="657750" created="2015-04-21T10:04:37.0Z" changed="2015-04-21T10:04:37.0Z" id="FR:91479:GDL:415731:STIF"> + <Name>Aéroport d'Orly</Name> + <PurposeOfGroupingRef version="any" ref="NETEX_ARRET_STIF:PurposeOfGrouping:groupOfStopPlace"/> + <members> + <StopPlaceRef ref="FR:91479:LDA:63284:STIF">version=63284</StopPlaceRef> + <StopPlaceRef ref="FR:91479:LDA:63278:STIF">version=63278</StopPlaceRef> + </members> + </GeneralGroupOfEntities> + <GeneralGroupOfEntities version="657753" created="2015-04-21T10:04:57.0Z" changed="2015-04-21T10:04:57.0Z" id="FR:77282:GDL:415732:STIF"> + <Name>Aéroport Roissy Charles de Gaulle</Name> + <PurposeOfGroupingRef version="any" ref="NETEX_ARRET_STIF:PurposeOfGrouping:groupOfStopPlace"/> + <members> + <StopPlaceRef ref="FR:77282:LDA:69212:STIF">version=69212</StopPlaceRef> + <StopPlaceRef ref="FR:93073:LDA:412554:STIF">version=480224</StopPlaceRef> + <StopPlaceRef ref="FR:93073:LDA:412553:STIF">version=480203</StopPlaceRef> + <StopPlaceRef ref="FR:77291:LDA:73699:STIF">version=654808</StopPlaceRef> + <StopPlaceRef ref="FR:null:LDA:412679:STIF">version=483360</StopPlaceRef> + <StopPlaceRef ref="FR:95527:LDA:74162:STIF">version=739348</StopPlaceRef> + <StopPlaceRef ref="FR:77291:LDA:411293:STIF">version=411628</StopPlaceRef> + <StopPlaceRef ref="FR:93073:LDA:73596:STIF">version=73596</StopPlaceRef> + <StopPlaceRef ref="FR:93073:LDA:73846:STIF">version=73846</StopPlaceRef> + <StopPlaceRef ref="FR:77291:LDA:73845:STIF">version=73845</StopPlaceRef> + <StopPlaceRef ref="FR:77291:LDA:73595:STIF">version=73595</StopPlaceRef> + </members> + </GeneralGroupOfEntities> + <GeneralGroupOfEntities version="657747" created="2015-04-21T10:04:27.0Z" changed="2015-04-21T10:04:27.0Z" id="FR:75115:GDL:415730:STIF"> + <Name>Gare Montparnasse</Name> + <PurposeOfGroupingRef version="any" ref="NETEX_ARRET_STIF:PurposeOfGrouping:groupOfStopPlace"/> + <members> + <StopPlaceRef ref="FR:75115:LDA:71139:STIF">version=657746</StopPlaceRef> + </members> + </GeneralGroupOfEntities> + <ValueSet version="any" id="NETEX_ARRET_STIF:ValueSet:VS01"> + <values> + <PurposeOfGrouping version="any" id="NETEX_ARRET_STIF:PurposeOfGrouping:groupOfStopPlace"> + <Name>Group of Stop Place</Name> + <classes> + <ClassRef nameOfClass="StopPlace"/> + </classes> + </PurposeOfGrouping> + </values> + </ValueSet> + </members> + </GeneralFrame> + <GeneralFrame version="001" id="STIF-REFLEX:TypeOfFrame:NETEX_ARRET_STIF"> + <Name>Frame NETEX_ARRET_STIF</Name> + <Description>Frame NETEX_ARRET_STIF</Description> + <members modificationSet="all"> + <StopPlace version="777416" created="2014-12-29T03:12:51.0Z" changed="2016-07-26T12:07:19.0Z" id="FR:77153:LDA:69325:STIF"> + <Name>First stopPlace edited</Name> + <placeTypes> + <TypeOfPlaceRef ref="LDA"/> + </placeTypes> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:69325"> + <Town>Dammartin-en-Goële</Town> + <PostalRegion>77153</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:69325"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + <StopPlaceType>onstreetBus</StopPlaceType> + </StopPlace> + <StopPlace version="42564" created="2014-12-29T03:12:51.0Z" changed="2014-12-29T03:12:51.0Z" id="FR:77153:ZDL:42564:STIF"> + <keyList> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>OBJECT_STATUS</Key> + <Value>REFERENCE_OBJECT</Value> + </KeyValue> + </keyList> + <Name>First stopPlace children edited</Name> + <placeTypes> + <TypeOfPlaceRef ref="ZDL"/> + </placeTypes> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:42564"> + <Town>Dammartin-en-Goële</Town> + <PostalRegion>77153</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:42564"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + <ParentSiteRef ref="FR:77153:LDA:69325:STIF" version="777416"/> + <entrances> + <StopPlaceEntrance version="174" id="FR:91421:ADL:174:STIF"> + <Name>Montgeron Crosne - Rue Du Moulin De Senlis</Name> + <Centroid> + <Location> + <gml:pos srsName="EPSG:2154">660491.94 6845481.0</gml:pos> + </Location> + </Centroid> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:174"> + <Town>Montgeron</Town> + <PostalRegion>91421</PostalRegion> + </PostalAddress> + <IsEntry>true</IsEntry> + <IsExit>true</IsExit> + </StopPlaceEntrance> + <StopPlaceEntrance version="173" id="FR:91421:ADL:173:STIF"> + <Name>Montgeron Crosne - Rue Du Moulin De Senlis</Name> + <Centroid> + <Location> + <gml:pos srsName="EPSG:2154">660324.94 6845590.5</gml:pos> + </Location> + </Centroid> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:173"> + <Town>Montgeron</Town> + <PostalRegion>91421</PostalRegion> + </PostalAddress> + <IsEntry>true</IsEntry> + <IsExit>true</IsExit> + </StopPlaceEntrance> + </entrances> + <StopPlaceType>onstreetBus</StopPlaceType> + <quays> + <QuayRef ref="FR:77153:ZDE:38240:STIF" version="782150"/> + </quays> + </StopPlace> + <StopPlace version="779966" created="2014-12-29T03:12:51.0Z" changed="2016-07-28T03:07:56.0Z" id="FR:95277:ZDL:46738:STIF"> + <keyList> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>OBJECT_STATUS</Key> + <Value>REFERENCE_OBJECT</Value> + </KeyValue> + </keyList> + <Name>Second StopPlace children</Name> + <placeTypes> + <TypeOfPlaceRef ref="ZDL"/> + </placeTypes> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:46738"> + <Town>Gonesse</Town> + <PostalRegion>95277</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:46738"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + <ParentSiteRef ref="FR:95277:LDA:65926:STIF" version="779971"/> + <StopPlaceType>onstreetBus</StopPlaceType> + <quays> + <QuayRef ref="FR:95277:ZDE:38010:STIF" version="777963"/> + </quays> + </StopPlace> + <Quay version="783636" created="2014-12-29T03:12:51.0Z" changed="2016-08-05T10:08:59.0Z" id="FR:95277:ZDE:38010:STIF"> + <keyList> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>OBJECT_STATUS</Key> + <Value>REFERENCE_OBJECT</Value> + </KeyValue> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>LINE_ID</Key> + <Value>002002003</Value> + </KeyValue> + </keyList> + <Name>Quay of Second StopPlace children</Name> + <Centroid> + <Location> + <gml:pos srsName="EPSG:2154">657252.0 6847664.0</gml:pos> + </Location> + </Centroid> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:21634"> + <Town>Ablon-sur-Seine</Town> + <PostalRegion>94001</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:21634"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + </Quay> + <Quay version="783636" created="2014-12-29T03:12:51.0Z" changed="2016-08-05T10:08:59.0Z" id="FR:77153:ZDE:38240:STIF"> + <keyList> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>OBJECT_STATUS</Key> + <Value>REFERENCE_OBJECT</Value> + </KeyValue> + <KeyValue typeOfKey="OBJET_QUALIFIER"> + <Key>LINE_ID</Key> + <Value>002002003</Value> + </KeyValue> + </keyList> + <Name>Quay of First stopPlace children</Name> + <Centroid> + <Location> + <gml:pos srsName="EPSG:2154">657252.0 6847664.0</gml:pos> + </Location> + </Centroid> + <PostalAddress version="any" id="STIF-REFLEX:PostalAddress:21634"> + <Town>Ablon-sur-Seine</Town> + <PostalRegion>94001</PostalRegion> + </PostalAddress> + <AccessibilityAssessment version="any" id="STIF-REFLEX:AccessibilityAssessment:21634"> + <MobilityImpairedAccess>false</MobilityImpairedAccess> + </AccessibilityAssessment> + </Quay> + </members> + </GeneralFrame> + </frames> + </CompositeFrame> + </dataObjects> +</PublicationDelivery> diff --git a/spec/fixtures/reflex_updated.zip b/spec/fixtures/reflex_updated.zip Binary files differnew file mode 100644 index 000000000..772327c4d --- /dev/null +++ b/spec/fixtures/reflex_updated.zip diff --git a/spec/fixtures/users.json b/spec/fixtures/users.json new file mode 100644 index 000000000..d5affc81b --- /dev/null +++ b/spec/fixtures/users.json @@ -0,0 +1,144 @@ +[{ + "id": 1, + "username": "admin", + "email": "stif-portail@af83.com", + "firstname": "admin", + "lastname": "stif", + "phone_number": null, + "created_at": "2016-08-05T12:33:45.152Z", + "updated_at": "2016-08-05T12:33:45.152Z", + "locked_at": null, + "profile": "Administrateur", + "organization_name": "STIF", + "organization_code": "STIF" +}, { + "id": 2, + "username": "luc.donnet", + "email": "luc.donnet@af83.com", + "firstname": "Luc", + "lastname": "Donnet", + "phone_number": "+336 69 25 15 71", + "created_at": "2016-08-05T12:34:03.049Z", + "updated_at": "2016-08-05T12:34:03.049Z", + "locked_at": null, + "profile": "Administrateur", + "organization_name": "STIF", + "organization_code": "STIF" +}, { + "id": 3, + "username": "alban.peignier", + "email": "alban.peignier@af83.com", + "firstname": "Alban", + "lastname": "Peignier", + "phone_number": "0697099622", + "created_at": "2016-08-05T12:34:03.161Z", + "updated_at": "2016-08-05T12:34:03.161Z", + "locked_at": null, + "profile": "Administrateur", + "organization_name": "STIF", + "organization_code": "STIF" +}, { + "id": 4, + "username": "pierre.vabre", + "email": "pierre.vabre@af83.com", + "firstname": "Pierre", + "lastname": "Vabre", + "phone_number": "0033778300069", + "created_at": "2016-08-05T12:34:03.256Z", + "updated_at": "2016-08-05T12:34:03.256Z", + "locked_at": null, + "profile": "Administrateur", + "organization_name": "STIF", + "organization_code": "STIF" +}, { + "id": 5, + "username": "laure.dubuc", + "email": "laure.dubuc@af83.com", + "firstname": "Laure", + "lastname": "Dubuc", + "phone_number": "0302098171", + "created_at": "2016-08-05T12:34:03.360Z", + "updated_at": "2016-08-05T12:34:03.360Z", + "locked_at": null, + "profile": "Administrateur", + "organization_name": "STIF", + "organization_code": "STIF" +}, { + "id": 6, + "username": "thomas.haddad", + "email": "thomas.haddad@af83.com", + "firstname": "Thomas", + "lastname": "Haddad", + "phone_number": "0033763987210", + "created_at": "2016-08-05T12:34:03.457Z", + "updated_at": "2016-08-05T12:34:03.457Z", + "locked_at": null, + "profile": "Administrateur", + "organization_name": "STIF", + "organization_code": "STIF" +}, { + "id": 7, + "username": "jean-paul.lescouzeres", + "email": "jean-paul.lescouzeres@af83.com", + "firstname": "Jean-Paul", + "lastname": "Lescouzères", + "phone_number": "0033790632621", + "created_at": "2016-08-05T12:34:03.553Z", + "updated_at": "2016-08-05T12:34:03.553Z", + "locked_at": null, + "profile": "Administrateur", + "organization_name": "STIF", + "organization_code": "STIF" +}, { + "id": 8, + "username": "xinhui.xu", + "email": "xinhui.xu@af83.com", + "firstname": "Xinhui", + "lastname": "Xu", + "phone_number": "+33799062141", + "created_at": "2016-08-05T12:34:03.649Z", + "updated_at": "2016-08-05T12:34:03.649Z", + "locked_at": null, + "profile": "Administrateur", + "organization_name": "STIF", + "organization_code": "STIF" +}, { + "id": 9, + "username": "edouard.maffert", + "email": "edouard.maffert@af83.com", + "firstname": "Edouard", + "lastname": "Maffert", + "phone_number": "+33614563995", + "created_at": "2016-08-05T12:34:03.756Z", + "updated_at": "2016-08-05T12:34:03.756Z", + "locked_at": null, + "profile": "Administrateur", + "organization_name": "STIF", + "organization_code": "STIF" +}, { + "id": 10, + "username": "john.doe", + "email": "john.doe@af83.com", + "firstname": "John", + "lastname": "Doe", + "phone_number": "00337 67 87 93 02", + "created_at": "2016-08-05T12:34:03.894Z", + "updated_at": "2016-08-05T12:34:03.894Z", + "locked_at": null, + "profile": "Référent IV Transporteur", + "organization_name": "RATP", + "organization_code": "RATP" +}, { + "id": 11, + "username": "jane.doe", + "email": "jane.doe@af83.com", + "firstname": "Jane", + "lastname": "Doe", + "phone_number": "+337 07 54 55 73", + "created_at": "2016-08-05T12:34:03.995Z", + "updated_at": "2016-08-05T12:34:03.995Z", + "locked_at": "2016-08-05T12:34:03.995Z", + "profile": "Référent IV Transporteur", + "organization_name": "RATP", + "organization_code": "RATP" +}] diff --git a/spec/models/chouette/line_spec.rb b/spec/models/chouette/line_spec.rb index 2394db85a..4b22a911d 100644 --- a/spec/models/chouette/line_spec.rb +++ b/spec/models/chouette/line_spec.rb @@ -15,7 +15,7 @@ describe Chouette::Line, :type => :model do describe '#objectid' do subject { super().objectid } - it { is_expected.to be_kind_of(Chouette::ObjectId) } + it { is_expected.to be_kind_of(Chouette::NetexObjectId) } end # it { should validate_numericality_of :objectversion } diff --git a/spec/models/line_referential_spec.rb b/spec/models/line_referential_spec.rb index 70c005017..677d61f77 100644 --- a/spec/models/line_referential_spec.rb +++ b/spec/models/line_referential_spec.rb @@ -6,4 +6,5 @@ RSpec.describe LineReferential, :type => :model do end it { should validate_presence_of(:name) } + it { should validate_presence_of(:sync_interval) } end diff --git a/spec/models/line_referential_sync_spec.rb b/spec/models/line_referential_sync_spec.rb new file mode 100644 index 000000000..a237f4d24 --- /dev/null +++ b/spec/models/line_referential_sync_spec.rb @@ -0,0 +1,23 @@ +require 'rails_helper' + +RSpec.describe LineReferentialSync, :type => :model do + it 'should have a valid factory' do + expect(FactoryGirl.build(:line_referential_sync)).to be_valid + end + + it { is_expected.to belong_to(:line_referential) } + + describe '.record_status' + let!(:line_ref_sync) { create(:line_referential_sync) } + let!(:line_ref_sync_with_records) { create(:line_referential_sync_with_record, line_sync_operations_count: 30) } + + it 'should add a new record' do + line_ref_sync.record_status :ok, "message" + expect(line_ref_sync.line_sync_operations.count).to eq(1) + end + + it 'should not have more than 30 records' do + line_ref_sync_with_records.record_status :ok, "message" + expect(line_ref_sync_with_records.line_sync_operations.count).to eq(30) + end +end diff --git a/spec/models/line_sync_operation_spec.rb b/spec/models/line_sync_operation_spec.rb new file mode 100644 index 000000000..dab7f1056 --- /dev/null +++ b/spec/models/line_sync_operation_spec.rb @@ -0,0 +1,9 @@ +require 'rails_helper' + +RSpec.describe LineSyncOperation, :type => :model do + it 'should have a valid factory' do + expect(FactoryGirl.build(:line_sync_operation)).to be_valid + end + + it { is_expected.to belong_to(:line_referential_sync) } +end diff --git a/spec/models/organisation_spec.rb b/spec/models/organisation_spec.rb index fb9d3629b..9d9749b18 100644 --- a/spec/models/organisation_spec.rb +++ b/spec/models/organisation_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Organisation do +describe Organisation, :type => :model do it { should validate_presence_of(:name) } it { should validate_uniqueness_of(:name) } @@ -13,4 +13,39 @@ describe Organisation do organisation = create(:organisation) organisation.rule_parameter_sets.size.should == 1 end + + describe "Portail sync" do + let(:conf) { Rails.application.config.stif_portail_api } + before :each do + stub_request(:get, "#{conf[:url]}/api/v1/organizations"). + with(headers: { 'Authorization' => "Token token=\"#{conf[:key]}\"" }). + to_return(body: File.open(File.join(Rails.root, 'spec', 'fixtures', 'organizations.json')), status: 200) + end + + it 'should retrieve data from portail api' do + expect(Organisation.portail_api_request).to be_truthy + expect(WebMock).to have_requested(:get, "#{conf[:url]}/api/v1/organizations"). + with(headers: { 'Authorization' => "Token token=\"#{conf[:key]}\"" }) + end + + it 'should create new organisations' do + expect{Organisation.portail_sync}.to change{ Organisation.count }.by(5) + expect(Organisation.all.map(&:name)).to include 'ALBATRANS', 'OPTILE', 'SNCF', 'STIF' + end + + it 'should update existing organisations' do + create :organisation, name: 'dummy_name', code:'RATP', updated_at: 10.days.ago + Organisation.portail_sync + Organisation.find_by(code: 'RATP').tap do |org| + expect(org.name).to eq('RATP') + expect(org.updated_at.utc).to be_within(1.second).of Time.now + expect(org.synced_at.utc).to be_within(1.second).of Time.now + end + end + + it 'should not create organisation if code is already present' do + create :organisation, code:'RATP' + expect{Organisation.portail_sync}.to change{ Organisation.count }.by(4) + end + end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index e22e53797..16fbed27a 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1,14 +1,113 @@ require 'spec_helper' describe User, :type => :model do - #it { should validate_uniqueness_of :email } - #it { should validate_presence_of :name } + # it { should validate_uniqueness_of :email } + # it { should validate_presence_of :name } + + describe "SSO" do + let(:ticket) do + CASClient::ServiceTicket.new("ST-test", nil).tap do |ticket| + ticket.extra_attributes = { + :full_name => 'john doe', + :username => 'john.doe', + :email => 'john.doe@af83.com', + :organisation_code => '0083', + :organisation_name => 'af83' + } + ticket.user = "john.doe" + ticket.success = true + end + end + + context 'First time sign on' do + it 'should create a new user if user is not registered' do + expect{User.authenticate_with_cas_ticket(ticket)}.to change{ User.count } + user = User.find_by(username: 'john.doe') + expect(user.email).to eq(ticket.extra_attributes[:email]) + expect(user.name).to eq(ticket.extra_attributes[:full_name]) + end + + it 'should create a new organisation if organisation is not present' do + expect{User.authenticate_with_cas_ticket(ticket)}.to change{ Organisation.count } + expect(Organisation.find_by(code: ticket.extra_attributes[:organisation_code])).to be_truthy + end + + it 'should not create a new organisation if organisation is already present' do + ticket.extra_attributes[:organisation_code] = create(:organisation).code + expect{User.authenticate_with_cas_ticket(ticket)}.not_to change{ Organisation.count } + end + end + + context 'Update attributes on sign on' do + let!(:organisation) { create(:organisation) } + let!(:user) { create(:user, username: 'john.doe', name:'fake name' , email: 'test@example.com', :organisation => organisation) } + + it 'should update user attributes on sign on' do + User.authenticate_with_cas_ticket(ticket) + expect(user.reload.email).to eq(ticket.extra_attributes[:email]) + expect(user.reload.name).to eq(ticket.extra_attributes[:full_name]) + end + end + end + + describe "Portail sync" do + let(:conf) { Rails.application.config.stif_portail_api } + before :each do + stub_request(:get, "#{conf[:url]}/api/v1/users"). + with(headers: { 'Authorization' => "Token token=\"#{conf[:key]}\"" }). + to_return(body: File.open(File.join(Rails.root, 'spec', 'fixtures', 'users.json')), status: 200) + end + + it 'should retrieve data from portail api' do + expect(User.portail_api_request).to be_truthy + expect(WebMock).to have_requested(:get, "#{conf[:url]}/api/v1/users"). + with(headers: { 'Authorization' => "Token token=\"#{conf[:key]}\"" }) + end + + it 'should create new users' do + User.portail_sync + expect(User.count).to eq(11) + expect(Organisation.count).to eq(3) + end + + it 'should update existing users' do + create :user, username: 'alban.peignier', email:'dummy@example.com', updated_at: 10.days.ago + User.portail_sync + user = User.find_by(username: 'alban.peignier') + + expect(user.name).to eq('Alban Peignier') + expect(user.email).to eq('alban.peignier@af83.com') + expect(user.updated_at.utc).to be_within(1.second).of Time.now + expect(user.synced_at.utc).to be_within(1.second).of Time.now + end + + it 'should update organisation assignement' do + create :user, username: 'alban.peignier', organisation: create(:organisation) + User.portail_sync + expect(User.find_by(username: 'alban.peignier').organisation.name).to eq("STIF") + end + + it 'should update locked_at attribute' do + create :user, username: 'alban.peignier', locked_at: Time.now + User.portail_sync + expect(User.find_by(username: 'alban.peignier').locked_at).to be_nil + expect(User.find_by(username: 'jane.doe').locked_at).to eq("2016-08-05T12:34:03.995Z") + end + + it 'should not create new user if username is already present' do + create :user, username: 'alban.peignier' + User.portail_sync + expect(User.count).to eq(11) + end + end describe "#destroy" do let!(:organisation){create(:organisation)} let!(:user){create(:user, :organisation => organisation)} + context "user's organisation contains many user" do let!(:other_user){create(:user, :organisation => organisation)} + it "should destoy also user's organisation" do user.destroy expect(Organisation.where(:name => organisation.name).exists?).to be_truthy diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 92afd410b..93b148496 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,10 +11,17 @@ require 'capybara/poltergeist' require 'georuby-ext' require 'will_paginate/array' require 'fakeweb' +require 'webmock/rspec' require 'simplecov' -SimpleCov.start 'rails' do - add_filter "/.bundle" + +if ENV['JOB_NAME'] + require 'simplecov-rcov' + SimpleCov.formatters = [ + SimpleCov::Formatter::HTMLFormatter, + SimpleCov::Formatter::RcovFormatter + ] end +SimpleCov.start 'rails' # Requires supporting ruby files with custom matchers and macros, etc, in # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are @@ -42,7 +49,7 @@ RSpec.configure do |config| config.filter_run_excluding :js => true config.run_all_when_everything_filtered = true config.include TokenInputHelper, :type => :feature - + # ## Mock Framework # # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: diff --git a/spec/support/devise.rb b/spec/support/devise.rb index cd5782f36..d33812e6f 100644 --- a/spec/support/devise.rb +++ b/spec/support/devise.rb @@ -4,7 +4,6 @@ module DeviseRequestHelper def login_user organisation = Organisation.where(:name => "first").first_or_create(attributes_for(:organisation)) @user ||= create(:user, :organisation => organisation) - @user.confirm! login_as @user, :scope => :user # post_via_redirect user_session_path, 'user[email]' => @user.email, 'user[password]' => @user.password end @@ -36,7 +35,6 @@ module DeviseControllerHelper @request.env["devise.mapping"] = Devise.mappings[:user] organisation = Organisation.where(:name => "first").first_or_create(attributes_for(:organisation)) user = create(:user, :organisation => organisation) - user.confirm! sign_in user end end diff --git a/spec/tasks/reflex_rake_spec.rb b/spec/tasks/reflex_rake_spec.rb new file mode 100644 index 000000000..bf1a81a82 --- /dev/null +++ b/spec/tasks/reflex_rake_spec.rb @@ -0,0 +1,61 @@ +require 'spec_helper' + +describe 'reflex:sync' do + context 'On first sync' do + before(:each) do + ['getOP', 'getOR'].each do |method| + stub_request(:get, "https://reflex.stif.info/ws/reflex/V1/service=getData/?format=xml&idRefa=0&method=#{method}"). + to_return(body: File.open("#{fixture_path}/reflex.zip"), status: 200) + end + create(:stop_area_referential, name: 'Reflex') + Stif::ReflexSynchronization.synchronize + end + + it 'should create stopArea on successfull request' do + expect(Chouette::StopArea.count).to eq 6 + expect(Chouette::AccessPoint.count).to eq 2 + end + + it 'should convert StopPlaceEntrance to AccessPoint' do + access = Chouette::AccessPoint.find_by(name: 'Montgeron Crosne - Rue Du Moulin De Senlis') + expect(access.stop_area.name).to eq 'First stopPlace children' + end + + it 'should save hierarchy' do + stop_area = Chouette::StopArea.find_by(name: 'First stopPlace children') + expect(stop_area.parent.name).to eq 'First stopPlace' + end + + it 'should map xml data to StopArea attribute' do + stop_area = Chouette::StopArea.find_by(name: 'First stopPlace') + expect(stop_area.city_name).to eq 'Dammartin-en-Goële' + expect(stop_area.zip_code).to eq '77153' + expect(stop_area.area_type).to eq 'StopPlace' + end + + context 'On next sync' do + before(:each) do + ['getOP', 'getOR'].each do |method| + stub_request(:get, "https://reflex.stif.info/ws/reflex/V1/service=getData/?format=xml&idRefa=0&method=#{method}"). + to_return(body: File.open("#{fixture_path}/reflex_updated.zip"), status: 200) + end + Stif::ReflexSynchronization.synchronize + end + + it 'should not create duplicate stop_area' do + expect(Chouette::StopArea.count).to eq 6 + expect(Chouette::AccessPoint.count).to eq 2 + end + + it 'should flag deleted_at for missing element from last sync' do + stop_area = Chouette::StopArea.find_by(name: 'Second StopPlace') + expect(stop_area.deleted_at).to be_within(1.minute).of(Time.now) + end + + it 'should update existing stop_area' do + expect(Chouette::StopArea.where(name: 'First stopPlace edited')).to exist + expect(Chouette::StopArea.where(name: 'First stopPlace children edited')).to exist + end + end + end +end diff --git a/spec/views/referentials/edit.html.erb_spec.rb b/spec/views/referentials/edit.html.erb_spec.rb index a3978210b..a73fb2ef5 100644 --- a/spec/views/referentials/edit.html.erb_spec.rb +++ b/spec/views/referentials/edit.html.erb_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe "referentials/edit.html.erb", :type => :view do +describe "referentials/edit", :type => :view do pending "add some examples to (or delete) #{__FILE__}" end diff --git a/spec/views/referentials/new.html.erb_spec.rb b/spec/views/referentials/new.html.erb_spec.rb index 82c8161ca..0673b4578 100644 --- a/spec/views/referentials/new.html.erb_spec.rb +++ b/spec/views/referentials/new.html.erb_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe "referentials/new.html.erb", :type => :view do +describe "referentials/new", :type => :view do before(:each) do assign(:referential, Referential.new) diff --git a/spec/views/referentials/show.html.erb_spec.rb b/spec/views/referentials/show.html.erb_spec.rb index 1ea888c31..8b7a4e4b5 100644 --- a/spec/views/referentials/show.html.erb_spec.rb +++ b/spec/views/referentials/show.html.erb_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe "referentials/show.html.erb", :type => :view do +describe "referentials/show", :type => :view do assign_referential it "should have a title with name" do |
