diff options
| author | Michel Etienne | 2012-09-11 09:12:23 +0200 |
|---|---|---|
| committer | Michel Etienne | 2012-09-11 09:12:23 +0200 |
| commit | 8d2130e78faa92420cab3a9bbc2edcd39dbd8cac (patch) | |
| tree | c3996490cc3afedd09e74b2891430f21c40f7cd8 | |
| parent | 4947504b6451cf70ae34891213513af84a7fcfae (diff) | |
| parent | 8024e9a869c3eeb4ca752206a7fb3add9559de13 (diff) | |
| download | chouette-core-8d2130e78faa92420cab3a9bbc2edcd39dbd8cac.tar.bz2 | |
merge
| -rw-r--r-- | Gemfile | 8 | ||||
| -rw-r--r-- | Gemfile.lock | 30 | ||||
| -rw-r--r-- | app/assets/stylesheets/time_tables.css.scss | 43 | ||||
| -rw-r--r-- | app/helpers/time_tables_helper.rb | 9 | ||||
| -rw-r--r-- | app/helpers/users_helper.rb | 6 | ||||
| -rw-r--r-- | app/views/connection_links/_connection_link.erb | 19 | ||||
| -rw-r--r-- | app/views/layouts/application.html.erb | 2 | ||||
| -rw-r--r-- | app/views/referentials/show.html.erb | 10 | ||||
| -rw-r--r-- | app/views/time_tables/_time_table.erb | 14 | ||||
| -rw-r--r-- | app/views/time_tables/show.html.erb | 11 | ||||
| -rw-r--r-- | config/locales/connection_links.yml | 8 | ||||
| -rw-r--r-- | config/locales/referentials.yml | 20 | ||||
| -rw-r--r-- | config/locales/time_tables.yml | 4 |
13 files changed, 139 insertions, 45 deletions
@@ -24,8 +24,8 @@ end gem "map_layers", "~> 0.0.4" gem "georuby-ext", :git => 'git://github.com/dryade/georuby-ext.git' -gem 'user_interface', :git => 'git://github.com/dryade/user-interface.git' -#gem 'user_interface', :git => 'git://sim.dryade.priv/user_interface' #, :path => '~/Projects/UserInterfaceDryade' +#gem 'user_interface', :git => 'git://github.com/dryade/user-interface.git' +gem 'user_interface', :git => 'git://sim.dryade.priv/user_interface' #, :path => '~/Projects/UserInterfaceDryade' gem 'json' gem 'cocoon' gem 'formtastic' @@ -39,8 +39,8 @@ gem "modernizr-rails", "~> 2.0.6" gem 'gravatar_image_tag' gem "acts_as_tree", :git => "git://github.com/dryade/acts_as_tree.git" -gem 'ninoxe', :git => 'git://github.com/dryade/ninoxe.git' -#gem 'ninoxe', :git => 'git://chouette.dryade.priv/ninoxe' #, :path => '~/Projects/Ninoxe' +#gem 'ninoxe', :git => 'git://github.com/dryade/ninoxe.git' +gem 'ninoxe', :git => 'git://chouette.dryade.priv/ninoxe' #, :path => '~/Projects/Ninoxe' gem 'acts_as_list', '0.1.6' #gem 'composite_primary_keys', '~> 5.0.8' diff --git a/Gemfile.lock b/Gemfile.lock index 169eb656b..03ad2fb8d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,4 +1,16 @@ GIT + remote: git://chouette.dryade.priv/ninoxe + revision: 848e356ff197dc5dcd143057e770373646b4c62c + specs: + ninoxe (0.0.8) + GeoRuby + activerecord (>= 3.1.3) + acts_as_list (= 0.1.6) + composite_primary_keys (>= 4.1.2) + geokit + rails (>= 3.1.3) + +GIT remote: git://github.com/dnagir/database_cleaner.git revision: 0c0aa44f13ae392000a6f506b62d5d1602cb4e53 branch: postgre_jruby_issue @@ -48,20 +60,8 @@ GIT rgeo (~> 0.3.8) GIT - remote: git://github.com/dryade/ninoxe.git - revision: a2fa3bf8ef30572bf91f64746b92a47653c1c0a6 - specs: - ninoxe (0.0.8) - GeoRuby - activerecord (>= 3.1.3) - acts_as_list (= 0.1.6) - composite_primary_keys (>= 4.1.2) - geokit - rails (>= 3.1.3) - -GIT - remote: git://github.com/dryade/user-interface.git - revision: 9e10343c6eb2a889154bfd63322910634071b56d + remote: git://sim.dryade.priv/user_interface + revision: 0fac5e33ba61eaa691a65d9a5f49f6acd3755927 specs: user_interface (0.0.1) rails (> 3.1.0) @@ -109,7 +109,7 @@ GEM bcrypt-ruby (3.0.1) bcrypt-ruby (3.0.1-java) bouncy-castle-java (1.5.0146.1) - builder (3.0.2) + builder (3.0.3) capistrano (2.13.3) highline net-scp (>= 1.0.0) diff --git a/app/assets/stylesheets/time_tables.css.scss b/app/assets/stylesheets/time_tables.css.scss index 961f1657b..81beb645b 100644 --- a/app/assets/stylesheets/time_tables.css.scss +++ b/app/assets/stylesheets/time_tables.css.scss @@ -24,7 +24,32 @@ width: 350px; float: left; padding-right: 10px; + position: relative; + .state-code { + width: 25px; + height: 64px; + float: left; + margin-right: 10px; + + .validity_out { + background-color: #FC4903; + width: 25px; + height: 25px; + } + + .validity_out_soon { + background-color: orange; + width: 25px; + height: 25px; + } + + .validity_regular { + background-color: #86B41D; + width: 25px; + height: 25px; + } + } } } @@ -56,6 +81,24 @@ .summary p label { font-weight: bold; } + + .resume { + .validity { + float: left; + width: 20px; + height: 20px; + margin-right: 10px; + } + .validity.validity_out { + background-color: #FC4903; + } + .validity.validity_out_soon { + background-color: orange; + } + .validity.validity_regular { + background-color: #86B41D; + } + } } #workspace.time_tables.edit,#workspace.time_tables.new,#workspace.time_tables.create,#workspace.time_tables.update diff --git a/app/helpers/time_tables_helper.rb b/app/helpers/time_tables_helper.rb index a7607f7a0..b6dc3de48 100644 --- a/app/helpers/time_tables_helper.rb +++ b/app/helpers/time_tables_helper.rb @@ -1,4 +1,13 @@ module TimeTablesHelper + def time_table_state_code(time_table) + if time_table.validity_out_from_on?(Date.today) + "validity_out" + elsif time_table.validity_out_between?(Date.today,Date.today+7.day) + "validity_out_soon" + else + "validity_regular" + end + end def bounding_info(time_table) return t('time_tables.time_table.empty') if time_table.bounding_dates.empty? t('time_tables.time_table.bounding', diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 82ecb3273..6ebb20fc5 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -7,8 +7,10 @@ module UsersHelper def user_default_avatar return "#{root_url}#{image_path('icons/user.png')}" if Rails.application.config.relative_url_root.blank? - relative_url_root = Rails.application.config.relative_url_root.sub( /\//, '') - "#{root_url}#{image_path('icons/user.png')}".sub( Regexp.new("/#{relative_url_root}/#{relative_url_root}/"), "/#{relative_url_root}/") + relative_url_root = Rails.application.config.relative_url_root.gsub( /\//, '') + "#{root_url}#{image_path('icons/user.png')}". + sub( Regexp.new("/#{relative_url_root}/#{relative_url_root}/"), "/#{relative_url_root}/"). + sub( Regexp.new("/#{relative_url_root}//#{relative_url_root}/"), "/#{relative_url_root}/") end end diff --git a/app/views/connection_links/_connection_link.erb b/app/views/connection_links/_connection_link.erb index 7690fb18f..b3b44aed5 100644 --- a/app/views/connection_links/_connection_link.erb +++ b/app/views/connection_links/_connection_link.erb @@ -1,18 +1,19 @@ <%= div_for(connection_link) do %> - <%= link_to truncate(connection_link.name, :length => 30), [@referential, connection_link], :title => "Correspondance #{connection_link.name}" %> + <%= link_to truncate(connection_link.name, :length => 30), [@referential, connection_link], :title => "#{Chouette::TimeTable.model_name.human} #{connection_link.name}" %> <div class="info"> - <%= connection_link.human_attribute_name('departure') %> + <%= t('.from') %> <% if connection_link.departure.present? %> - <%= link_to_if connection_link.departure, connection_link.departure.name, referential_stop_area_path(@referential, connection_link.departure), :title => "#{connection_link.human_attribute_name('departure')} #{connection_link.departure.name}" %> + <%= link_to_if connection_link.departure, connection_link.departure.name, 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 %><br> - <%= connection_link.human_attribute_name('arrival') %> + <%= connection_link.human_attribute_name('undefined') %> + <% end %> + <%= t('.to') %> <% if connection_link.arrival.present? %> - <%= link_to_if( connection_link.arrival, connection_link.arrival.name, referential_stop_area_path(@referential, connection_link.arrival), :title => "#{connection_link.human_attribute_name('arrival')} #{connection_link.arrival.name}" ) %> + <%= link_to_if( connection_link.arrival, connection_link.arrival.name, 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 %> + <%= connection_link.human_attribute_name("undefined") %> + <% end %> - + <%= 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") %> <div class="actions"> <%= link_to t("actions.edit"), edit_referential_connection_link_path(@referential, connection_link), :class => "edit" %> | diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 604e34e23..b5fb169d5 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -43,7 +43,7 @@ <li class="admin"><%= tab_link_to Organisation.model_name.human, organisation_path %></li> <% end %> <% else %> - <li><%= link_to t("layouts.tabs.dashboard"), referential_path(@referential), :class => ("current" if current_page?(referential_path(@referential))) %></li> + <li><%= link_to t("layouts.tabs.dashboard").capitalize, referential_path(@referential), :class => ("current" if current_page?(referential_path(@referential))) %></li> <li><%= tab_link_to Chouette::Network, referential_networks_path(@referential) %></li> <li><%= tab_link_to Chouette::Company, referential_companies_path(@referential) %></li> <li><%= tab_link_to Chouette::Line, referential_lines_path(@referential) %></li> diff --git a/app/views/referentials/show.html.erb b/app/views/referentials/show.html.erb index 3a45e51fe..e1baf0d57 100644 --- a/app/views/referentials/show.html.erb +++ b/app/views/referentials/show.html.erb @@ -14,7 +14,7 @@ <%= @referential.projection_type %> </p> <p> - <label><%= Referential.human_attribute_name("time_zone") %>: </label> + <label><%= Referential.human_attribute_name("time_zone").capitalize %>: </label> <%= @referential.time_zone %> </p> <p> @@ -100,12 +100,12 @@ <table class="count" width="75%"> <thead> <tr> - <td><%= t('.expired_time_tables') %>: <%= tm_cnt = @referential.time_tables.expired_on(Date.today).size %></td> + <td><%= t('.validity_out_time_tables') %>: <%= tm_cnt = @referential.time_tables.validity_out_from_on?(Date.today).size %></td> </tr> </thead> <tbody> <% if tm_cnt > 0 %> - <% @referential.time_tables.expired_on(Date.today,5).each do |tm| %> + <% @referential.time_tables.validity_out_from_on?(Date.today,5).each do |tm| %> <tr><td><%= link_to tm.comment, referential_time_table_path(@referential, tm) %></td></tr> <% end %> <% if tm_cnt > 5 %> @@ -118,12 +118,12 @@ <table class="count" width="75%"> <thead> <tr> - <td><%= t('.almost_expired_time_tables', :count => "7") %>: <%= tm_cnt = @referential.time_tables.expired_between(Date.today,Date.today+7).size %></td> + <td><%= t('.validity_out_soon_time_tables', :count => "7") %>: <%= tm_cnt = @referential.time_tables.validity_out_between?(Date.today,Date.today+7).size %></td> </tr> </thead> <tbody> <% if tm_cnt > 0 %> - <% @referential.time_tables.expired_between(Date.today,Date.today+7,5).each do |tm| %> + <% @referential.time_tables.validity_out_between?(Date.today,Date.today+7,5).each do |tm| %> <tr><td><%= link_to tm.comment, referential_time_table_path(@referential, tm) %></td></tr> <% end %> <% if tm_cnt > 5 %> diff --git a/app/views/time_tables/_time_table.erb b/app/views/time_tables/_time_table.erb index 6cb4289a3..a2b3f1ff3 100644 --- a/app/views/time_tables/_time_table.erb +++ b/app/views/time_tables/_time_table.erb @@ -1,6 +1,16 @@ -<%= div_for(time_table, :class => "time_table") do %> - <%= link_to time_table.comment, [@referential, time_table] %> +<%= div_for(time_table) do %> + <%= link_to ( [@referential, time_table]) do %> + <div class="state-code" > + <div class="<%= time_table_state_code(time_table) %>" > + </div> + </div> + <% end %> + <div class="name"> + <%= link_to truncate(time_table.comment, :length => 30), [@referential, time_table], :title => "#{Chouette::TimeTable.model_name.human.capitalize} #{time_table.comment}"%> + </div> <div class="info"> + <%= time_tables_shortest_info(time_table) %> - + <%= composition_info(time_table) %> <div class="actions"> <%= link_to t("actions.edit"), edit_referential_time_table_path(@referential, time_table), :class => "edit" %> | <%= link_to t("actions.destroy"), referential_time_table_path(@referential, time_table), :method => :delete, :confirm => t('time_tables.actions.destroy_confirm'), :class => "remove" %> diff --git a/app/views/time_tables/show.html.erb b/app/views/time_tables/show.html.erb index f3e0bbce3..60eee8d04 100644 --- a/app/views/time_tables/show.html.erb +++ b/app/views/time_tables/show.html.erb @@ -2,6 +2,17 @@ <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("comment") %>: </label> diff --git a/config/locales/connection_links.yml b/config/locales/connection_links.yml index 6c7426f82..fb9b98ba4 100644 --- a/config/locales/connection_links.yml +++ b/config/locales/connection_links.yml @@ -13,6 +13,9 @@ en: show: title: Connection link %{connection_link} durations: "Durations (hh mm ss):" + connection_link: + from: From + to: to index: title: Connection links name: Name @@ -73,7 +76,10 @@ fr: title: Modifier la correspondance %{connection_link} show: title: Correspondance %{connection_link} - durations: "Durées (hh mm ss) :" + durations: "Durées (hh mm ss) :" + connection_link: + from: De + to: vers index: name: Nom title: Correspondances diff --git a/config/locales/referentials.yml b/config/locales/referentials.yml index ff09fc35d..ea56917bc 100644 --- a/config/locales/referentials.yml +++ b/config/locales/referentials.yml @@ -4,11 +4,15 @@ en: title: "Edit the data space" show: title: Data space + clean_up: Clean up + validity_out_time_tables: Closed timetables + validity_out_soon_time_tables: Timetables closed in %{count} days + counts: objects: Data space elements count: count - clean_up: Clean up - expired_time_tables: Closed timetables - almost_expired_time_tables: Timetables closed in %{count} days + validity_out: + validity_out_time_tables: Closed timetables + validity_out_soon_time_tables: Timetables closed in %{count} days new: title: Create a new data space submit: "Create a data space" @@ -66,11 +70,15 @@ fr: title: "Modifier l'espace de données" show: title: Espace de données + clean_up: Purge des données obsolètes + validity_out_time_tables: Calendriers échus + validity_out_soon_time_tables: Calendriers à échoir dans %{count} jours + counts: objects: Eléments count: Qté - clean_up: Purge des données obsolètes - expired_time_tables: Calendriers échus - almost_expired_time_tables: Calendriers à échoir dans %{count} jours + validity_out: + validity_out_time_tables: Calendriers échus + validity_out_soon_time_tables: Calendriers à échoir dans %{count} jours new: title: Créer un nouvel espace de données submit: "Créer un espace de données" diff --git a/config/locales/time_tables.yml b/config/locales/time_tables.yml index 421838586..d2fd44887 100644 --- a/config/locales/time_tables.yml +++ b/config/locales/time_tables.yml @@ -18,6 +18,8 @@ en: edit: title: Update timetable %{time_table} show: + resume: "From %{start_date} to %{end_date} (independently of any period day types)" + resume_empty: "Empty timetable" title: Timetable %{time_table} dates: "Application dates" periods: "Application periods" @@ -84,6 +86,8 @@ fr: edit: title: "Modifier le calendrier %{time_table}" show: + resume: "Validité comprise du %{start_date} au %{end_date} (sans tenir compte des jours d'application)" + resume_empty: "Calendrier vide" title: Calendrier %{time_table} dates: "Dates d'application" periods: "Périodes d'application" |
