aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Peignier2012-07-11 12:01:35 +0200
committerAlban Peignier2012-07-11 12:01:35 +0200
commitfe06a6955e44e1aa3b9d2bfef7187e064b3858a3 (patch)
tree04d94ebe32f903a379db28c283cd0e0d8e4a192b
parent0a44390146ef87422fe2213158a7abcba0253ed1 (diff)
parent3ee2295d14765aa8a8aecb88e96e296bc2112607 (diff)
downloadchouette-core-fe06a6955e44e1aa3b9d2bfef7187e064b3858a3.tar.bz2
Merge branch 'master' of chouette.dryade.priv:/srv/git/chouette2
-rw-r--r--app/assets/stylesheets/referentials.css.scss31
-rw-r--r--app/controllers/clean_ups_controller.rb22
-rw-r--r--app/models/clean_up.rb151
-rw-r--r--app/models/file_validation.rb44
-rw-r--r--app/views/file_validations/_test_sheet_toc.html.erb2
-rw-r--r--app/views/file_validations/new.html.erb2
-rw-r--r--app/views/referentials/show.html.erb18
-rw-r--r--app/views/test_sheet/1_1.html (renamed from app/views/test_sheet/1.1.html)0
-rw-r--r--app/views/test_sheet/1_2.html (renamed from app/views/test_sheet/1.2.html)0
-rw-r--r--app/views/test_sheet/2_1.html (renamed from app/views/test_sheet/2.1.html)0
-rw-r--r--app/views/test_sheet/2_10.html (renamed from app/views/test_sheet/2.10.html)0
-rw-r--r--app/views/test_sheet/2_11.html (renamed from app/views/test_sheet/2.11.html)0
-rw-r--r--app/views/test_sheet/2_12.html (renamed from app/views/test_sheet/2.12.html)0
-rw-r--r--app/views/test_sheet/2_13.html (renamed from app/views/test_sheet/2.13.html)0
-rw-r--r--app/views/test_sheet/2_14.html (renamed from app/views/test_sheet/2.14.html)0
-rw-r--r--app/views/test_sheet/2_15.html (renamed from app/views/test_sheet/2.15.html)0
-rw-r--r--app/views/test_sheet/2_16.html (renamed from app/views/test_sheet/2.16.html)0
-rw-r--r--app/views/test_sheet/2_17.html (renamed from app/views/test_sheet/2.17.html)0
-rw-r--r--app/views/test_sheet/2_18.html (renamed from app/views/test_sheet/2.18.html)0
-rw-r--r--app/views/test_sheet/2_19.html (renamed from app/views/test_sheet/2.19.html)0
-rw-r--r--app/views/test_sheet/2_2.html (renamed from app/views/test_sheet/2.2.html)0
-rw-r--r--app/views/test_sheet/2_20.html (renamed from app/views/test_sheet/2.20.html)0
-rw-r--r--app/views/test_sheet/2_21.html (renamed from app/views/test_sheet/2.21.html)0
-rw-r--r--app/views/test_sheet/2_22.html (renamed from app/views/test_sheet/2.22.html)0
-rw-r--r--app/views/test_sheet/2_23.html (renamed from app/views/test_sheet/2.23.html)0
-rw-r--r--app/views/test_sheet/2_24.html (renamed from app/views/test_sheet/2.24.html)0
-rw-r--r--app/views/test_sheet/2_25.html (renamed from app/views/test_sheet/2.25.html)0
-rw-r--r--app/views/test_sheet/2_26.html (renamed from app/views/test_sheet/2.26.html)0
-rw-r--r--app/views/test_sheet/2_27.html (renamed from app/views/test_sheet/2.27.html)0
-rw-r--r--app/views/test_sheet/2_28.html (renamed from app/views/test_sheet/2.28.html)0
-rw-r--r--app/views/test_sheet/2_3.html (renamed from app/views/test_sheet/2.3.html)0
-rw-r--r--app/views/test_sheet/2_4.html (renamed from app/views/test_sheet/2.4.html)0
-rw-r--r--app/views/test_sheet/2_5.html (renamed from app/views/test_sheet/2.5.html)0
-rw-r--r--app/views/test_sheet/2_6.html (renamed from app/views/test_sheet/2.6.html)0
-rw-r--r--app/views/test_sheet/2_7.html (renamed from app/views/test_sheet/2.7.html)0
-rw-r--r--app/views/test_sheet/2_8.html (renamed from app/views/test_sheet/2.8.html)0
-rw-r--r--app/views/test_sheet/2_9.html (renamed from app/views/test_sheet/2.9.html)0
-rw-r--r--app/views/test_sheet/3_1.html (renamed from app/views/test_sheet/3.1.html)0
-rw-r--r--app/views/test_sheet/3_10.html (renamed from app/views/test_sheet/3.10.html)0
-rw-r--r--app/views/test_sheet/3_11.html (renamed from app/views/test_sheet/3.11.html)0
-rw-r--r--app/views/test_sheet/3_12.html (renamed from app/views/test_sheet/3.12.html)0
-rw-r--r--app/views/test_sheet/3_13.html (renamed from app/views/test_sheet/3.13.html)0
-rw-r--r--app/views/test_sheet/3_14.html (renamed from app/views/test_sheet/3.14.html)0
-rw-r--r--app/views/test_sheet/3_15.html (renamed from app/views/test_sheet/3.15.html)0
-rw-r--r--app/views/test_sheet/3_16.html (renamed from app/views/test_sheet/3.16.html)0
-rw-r--r--app/views/test_sheet/3_17.html (renamed from app/views/test_sheet/3.17.html)0
-rw-r--r--app/views/test_sheet/3_18.html (renamed from app/views/test_sheet/3.18.html)0
-rw-r--r--app/views/test_sheet/3_19.html (renamed from app/views/test_sheet/3.19.html)0
-rw-r--r--app/views/test_sheet/3_2.html (renamed from app/views/test_sheet/3.2.html)0
-rw-r--r--app/views/test_sheet/3_20.html (renamed from app/views/test_sheet/3.20.html)0
-rw-r--r--app/views/test_sheet/3_21.html (renamed from app/views/test_sheet/3.21.html)0
-rw-r--r--app/views/test_sheet/3_3.html (renamed from app/views/test_sheet/3.3.html)0
-rw-r--r--app/views/test_sheet/3_4.html (renamed from app/views/test_sheet/3.4.html)0
-rw-r--r--app/views/test_sheet/3_5.html (renamed from app/views/test_sheet/3.5.html)0
-rw-r--r--app/views/test_sheet/3_6.html (renamed from app/views/test_sheet/3.6.html)0
-rw-r--r--app/views/test_sheet/3_7.html (renamed from app/views/test_sheet/3.7.html)0
-rw-r--r--app/views/test_sheet/3_8.html (renamed from app/views/test_sheet/3.8.html)0
-rw-r--r--app/views/test_sheet/3_9.html (renamed from app/views/test_sheet/3.9.html)0
-rw-r--r--app/views/test_sheet/toc.html102
-rw-r--r--config/locales/clean_ups.yml53
-rw-r--r--config/locales/referentials.yml2
-rw-r--r--config/routes.rb2
62 files changed, 337 insertions, 92 deletions
diff --git a/app/assets/stylesheets/referentials.css.scss b/app/assets/stylesheets/referentials.css.scss
index fe38f4f81..2d916232f 100644
--- a/app/assets/stylesheets/referentials.css.scss
+++ b/app/assets/stylesheets/referentials.css.scss
@@ -24,9 +24,36 @@
.count td.value {
text-align: right;
}
-
+
+}
+#sidebar div#clean_up {
+ form {
+ border-bottom: 1px solid #BBB;
+ fieldset {
+ padding: 0;
+ border: 0;
+ li.date {
+ padding: 0;
+ label { padding-left: 10px;
+ width: 40%;}
+ input { width: 42%; }
+ }
+ li {
+ padding: 0;
+ label { padding-left: 10px;
+ width: 90%;}
+ input { width: 12%; }
+ }
+ }
+ fieldset.actions {
+ margin-bottom: 0;
+ padding-left: 20px;
+ }
+ fieldset.inputs {
+ padding-top: 16px;
+ }
+ }
}
-
ul.logos {
margin: 30px 30px 0 0;
diff --git a/app/controllers/clean_ups_controller.rb b/app/controllers/clean_ups_controller.rb
new file mode 100644
index 000000000..4fe980266
--- /dev/null
+++ b/app/controllers/clean_ups_controller.rb
@@ -0,0 +1,22 @@
+class CleanUpsController < ChouetteController
+ respond_to :html, :only => [:create]
+
+ belongs_to :referential
+
+ def create
+ clean_up = CleanUp.new( params[:clean_up])
+ if clean_up.invalid?
+ flash[:alert] = clean_up.errors.full_messages.join("<br/>")
+ else
+ begin
+ clean_up.clean
+ flash[:notice] = clean_up.notice.join("<br/>")
+ rescue
+ flash[:alert] = t('clean_ups.failure')
+ end
+ end
+ redirect_to referential_path(@referential)
+
+ end
+
+end
diff --git a/app/models/clean_up.rb b/app/models/clean_up.rb
new file mode 100644
index 000000000..f96bb02f6
--- /dev/null
+++ b/app/models/clean_up.rb
@@ -0,0 +1,151 @@
+class CleanUp
+ include ActiveModel::Validations
+ include ActiveModel::Conversion
+ extend ActiveModel::Naming
+
+
+ attr_accessor :expected_date, :keep_lines, :keep_stops , :keep_companies, :keep_networks
+ attr_accessor :time_table_count,:vehicle_journey_count,:journey_pattern_count,:route_count,:line_count
+ attr_accessor :stop_count,:company_count,:network_count
+
+ validates_presence_of :expected_date
+
+ def initialize(attributes = {})
+ attributes.each do |name, value|
+ send("#{name}=", value)
+ end
+ end
+
+ def persisted?
+ false
+ end
+
+ def notice
+ a = Array.new
+ a << I18n.t('clean_ups.success_tm', :count => time_table_count.to_s)
+ if (vehicle_journey_count > 0)
+ a << I18n.t('clean_ups.success_vj', :count => vehicle_journey_count.to_s)
+ end
+ if (journey_pattern_count > 0)
+ a << I18n.t('clean_ups.success_jp', :count => journey_pattern_count.to_s)
+ end
+ if (route_count > 0)
+ a << I18n.t('clean_ups.success_r', :count => route_count.to_s)
+ end
+ if (line_count > 0)
+ a << I18n.t('clean_ups.success_l', :count => line_count.to_s)
+ end
+ if (company_count > 0)
+ a << I18n.t('clean_ups.success_c', :count => company_count.to_s)
+ end
+ if (network_count > 0)
+ a << I18n.t('clean_ups.success_n', :count => network_count.to_s)
+ end
+ if (stop_count > 0)
+ a << I18n.t('clean_ups.success_sa', :count => stop_count.to_s)
+ end
+ a
+
+ end
+
+ def clean
+
+ # find and remove time_tables
+ tms = Chouette::TimeTable.expired_on(Date.parse(expected_date))
+ self.time_table_count = tms.size
+ tms.each do |tm|
+ tm.destroy
+ end
+ # remove vehiclejourneys without timetables
+ self.vehicle_journey_count = 0
+ Chouette::VehicleJourney.find_each(:conditions => "id not in (select distinct vehicle_journey_id from time_tables_vehicle_journeys)") do |vj|
+ if vj.time_tables.size == 0
+ self.vehicle_journey_count += 1
+ vj.destroy
+ end
+ end
+ # remove journeypatterns without vehicle journeys
+ self.journey_pattern_count = 0
+ Chouette::JourneyPattern.find_each(:conditions => "id not in (select distinct journey_pattern_id from vehicle_journeys)") do |jp|
+ if jp.vehicle_journeys.size == 0
+ self.journey_pattern_count += 1
+ jp.destroy
+ end
+ end
+ # remove routes without journeypatterns
+ self.route_count = 0
+ Chouette::Route.find_each(:conditions => "id not in (select distinct route_id from journey_patterns)") do |r|
+ if r.journey_patterns.size == 0
+ self.route_count += 1
+ r.destroy
+ end
+ end
+ # if asked remove lines without routes
+ self.line_count = 0
+ if keep_lines == "0"
+ Chouette::Line.find_each(:conditions => "id not in (select distinct line_id from routes)") do |l|
+ if l.routes.size == 0
+ self.line_count += 1
+ l.destroy
+ end
+ end
+ end
+ # if asked remove stops without children (recurse)
+ self.stop_count = 0
+ if keep_stops == "0"
+ Chouette::StopArea.find_each(:conditions => { :area_type => "BoardingPosition" }) do |bp|
+ if bp.stop_points.size == 0
+ self.stop_count += 1
+ bp.destroy
+ end
+ end
+ Chouette::StopArea.find_each(:conditions => { :area_type => "Quay" }) do |q|
+ if q.stop_points.size == 0
+ self.stop_count += 1
+ q.destroy
+ end
+ end
+ Chouette::StopArea.find_each(:conditions => { :area_type => "CommercialStopPoint" }) do |csp|
+ if csp.children.size == 0
+ self.stop_count += 1
+ csp.destroy
+ end
+ end
+ Chouette::StopArea.find_each(:conditions => { :area_type => "StopPlace" }) do |sp|
+ if sp.children.size == 0
+ self.stop_count += 1
+ sp.destroy
+ end
+ end
+ Chouette::StopArea.find_each(:conditions => { :area_type => "ITL" }) do |itl|
+ if itl.routing_stops.size == 0
+ self.stop_count += 1
+ itl.destroy
+ end
+ end
+ end
+ # if asked remove companies without lines or vehicle journeys
+ self.company_count = 0
+ if keep_companies == "0"
+ Chouette::Company.find_each do |c|
+ if c.lines.size == 0
+ self.company_count += 1
+ c.destroy
+ end
+ end
+ end
+
+ # if asked remove networks without lines
+ self.network_count = 0
+ if keep_networks == "0"
+ Chouette::Network.find_each do |n|
+ if n.lines.size == 0
+ self.network_count += 1
+ n.destroy
+ end
+ end
+ end
+
+ end
+
+end
diff --git a/app/models/file_validation.rb b/app/models/file_validation.rb
index 26f2b2e90..af5857689 100644
--- a/app/models/file_validation.rb
+++ b/app/models/file_validation.rb
@@ -14,18 +14,14 @@ class FileValidation < ActiveRecord::Base
name = name.to_s
define_method(name) do
- self.options[name]
+ self.options and self.options[name]
end
define_method("#{name}=") do |prefix|
- self.options[name] = prefix
+ (self.options ||= {})[name] = prefix
end
end
- def options
- read_attribute(:options) || write_attribute(:options, {})
- end
-
option :test3_1_minimal_distance
option :test3_2_minimal_distance
option :test3_2_polygon_points
@@ -110,37 +106,11 @@ class FileValidation < ActiveRecord::Base
def validation_options
{ :validation_id => self.id ,
- :file_format => self.file_type ,
- :test3_1_minimal_distance => self.test3_1_minimal_distance ,
- :test3_2_minimal_distance => self.test3_2_minimal_distance ,
- :test3_2_polygon_points => self.test3_2_polygon_points ,
- :test3_7_minimal_distance => self.test3_7_minimal_distance ,
- :test3_7_maximal_distance => self.test3_7_maximal_distance ,
- :test3_8a_minimal_speed => self.test3_8a_minimal_speed ,
- :test3_8a_maximal_speed => self.test3_8a_maximal_speed ,
- :test3_8b_minimal_speed => self.test3_8b_minimal_speed ,
- :test3_8b_maximal_speed => self.test3_8b_maximal_speed ,
- :test3_8c_minimal_speed => self.test3_8c_minimal_speed ,
- :test3_8c_maximal_speed => self.test3_8c_maximal_speed ,
- :test3_8d_minimal_speed => self.test3_8d_minimal_speed ,
- :test3_8d_maximal_speed => self.test3_8d_maximal_speed ,
- :test3_9_minimal_speed => self.test3_9_minimal_speed ,
- :test3_9_maximal_speed => self.test3_9_maximal_speed ,
- :test3_10_minimal_distance => self.test3_10_minimal_distance ,
- :test3_15_minimal_time => self.test3_15_minimal_time ,
- :test3_16_1_maximal_time => self.test3_16_1_maximal_time ,
- :test3_16_3a_maximal_time => self.test3_16_3a_maximal_time ,
- :test3_16_3b_maximal_time => self.test3_16_3b_maximal_time ,
- :test3_21a_minimal_speed => self.test3_21a_minimal_speed ,
- :test3_21a_maximal_speed => self.test3_21a_maximal_speed ,
- :test3_21b_minimal_speed => self.test3_21b_minimal_speed ,
- :test3_21b_maximal_speed => self.test3_21b_maximal_speed ,
- :test3_21c_minimal_speed => self.test3_21c_minimal_speed ,
- :test3_21c_maximal_speed => self.test3_21c_maximal_speed ,
- :test3_21d_minimal_speed => self.test3_21d_minimal_speed ,
- :test3_21d_maximal_speed => self.test3_21d_maximal_speed ,
- :projection_reference => self.projection_reference
- }
+ :file_format => self.file_type}
+ options.keys.each do |opt|
+ hash.merge! opt.to_sym => self.send(opt.to_sym)
+ end
+ hash
end
def validate
diff --git a/app/views/file_validations/_test_sheet_toc.html.erb b/app/views/file_validations/_test_sheet_toc.html.erb
index 34383a19d..0605510b4 100644
--- a/app/views/file_validations/_test_sheet_toc.html.erb
+++ b/app/views/file_validations/_test_sheet_toc.html.erb
@@ -6,7 +6,7 @@
<li>Catégorie <%= j.to_s %>
<ul>
<% 1.upto(cnt[j]) do |i| %>
- <li><%= link_to 'Fiche '+j.to_s+'.'+i.to_s , test_sheet_path+j.to_s+"."+i.to_s, :target => "chouette_help" %></li>
+ <li><%= link_to 'Fiche '+j.to_s+'.'+i.to_s , test_sheet_path+j.to_s+"_"+i.to_s, :target => "chouette_help" %></li>
<% end %>
</ul>
</li>
diff --git a/app/views/file_validations/new.html.erb b/app/views/file_validations/new.html.erb
index 1bca668fe..3a86cfac9 100644
--- a/app/views/file_validations/new.html.erb
+++ b/app/views/file_validations/new.html.erb
@@ -1,6 +1,6 @@
<%= title_tag t(".title") %>
-<%= semantic_form_for [@file_validation], :as => :file_validation, :url => file_validations_path() do |form| %>
+<%= semantic_form_for @file_validation do |form| %>
<%= form.inputs do %>
<%= form.input :resources, :as => :file %>
<%= form.input :test3_1_minimal_distance, :as => :number,:input_html => { :value => '10.0' }, :wrapper_html => { :class => 'fl' } %>
diff --git a/app/views/referentials/show.html.erb b/app/views/referentials/show.html.erb
index f6c9522ce..ba12da4b4 100644
--- a/app/views/referentials/show.html.erb
+++ b/app/views/referentials/show.html.erb
@@ -96,4 +96,22 @@
<li><%= link_to t('referentials.actions.destroy'), referential_path(@referential), :method => :delete, :confirm => t('referentials.actions.destroy_confirm'), :class => "remove" %></li>
<br>
</ul>
+
+ <h3><%= t('.clean_up') %></h3>
+ <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' }%>
+ <%= form.input :keep_lines, :as => :boolean %>
+ <%= form.input :keep_stops, :as => :boolean %>
+ <%= form.input :keep_companies, :as => :boolean %>
+ <%= form.input :keep_networks, :as => :boolean %>
+ <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button, :label => t('clean_ups.actions.clean_up') , :button_html => {:confirm => t('clean_ups.actions.confirm') }%>
+ <% end %>
+ <% end %>
+ </div>
+
+
<% end %>
diff --git a/app/views/test_sheet/1.1.html b/app/views/test_sheet/1_1.html
index e7623184a..e7623184a 100644
--- a/app/views/test_sheet/1.1.html
+++ b/app/views/test_sheet/1_1.html
diff --git a/app/views/test_sheet/1.2.html b/app/views/test_sheet/1_2.html
index dae76e7aa..dae76e7aa 100644
--- a/app/views/test_sheet/1.2.html
+++ b/app/views/test_sheet/1_2.html
diff --git a/app/views/test_sheet/2.1.html b/app/views/test_sheet/2_1.html
index b4f3995a8..b4f3995a8 100644
--- a/app/views/test_sheet/2.1.html
+++ b/app/views/test_sheet/2_1.html
diff --git a/app/views/test_sheet/2.10.html b/app/views/test_sheet/2_10.html
index bfe452e12..bfe452e12 100644
--- a/app/views/test_sheet/2.10.html
+++ b/app/views/test_sheet/2_10.html
diff --git a/app/views/test_sheet/2.11.html b/app/views/test_sheet/2_11.html
index c2b5c4308..c2b5c4308 100644
--- a/app/views/test_sheet/2.11.html
+++ b/app/views/test_sheet/2_11.html
diff --git a/app/views/test_sheet/2.12.html b/app/views/test_sheet/2_12.html
index 12516725e..12516725e 100644
--- a/app/views/test_sheet/2.12.html
+++ b/app/views/test_sheet/2_12.html
diff --git a/app/views/test_sheet/2.13.html b/app/views/test_sheet/2_13.html
index 613e4f0ac..613e4f0ac 100644
--- a/app/views/test_sheet/2.13.html
+++ b/app/views/test_sheet/2_13.html
diff --git a/app/views/test_sheet/2.14.html b/app/views/test_sheet/2_14.html
index 26a7f1622..26a7f1622 100644
--- a/app/views/test_sheet/2.14.html
+++ b/app/views/test_sheet/2_14.html
diff --git a/app/views/test_sheet/2.15.html b/app/views/test_sheet/2_15.html
index 24fb2d502..24fb2d502 100644
--- a/app/views/test_sheet/2.15.html
+++ b/app/views/test_sheet/2_15.html
diff --git a/app/views/test_sheet/2.16.html b/app/views/test_sheet/2_16.html
index c5448bbea..c5448bbea 100644
--- a/app/views/test_sheet/2.16.html
+++ b/app/views/test_sheet/2_16.html
diff --git a/app/views/test_sheet/2.17.html b/app/views/test_sheet/2_17.html
index e7d9eb55d..e7d9eb55d 100644
--- a/app/views/test_sheet/2.17.html
+++ b/app/views/test_sheet/2_17.html
diff --git a/app/views/test_sheet/2.18.html b/app/views/test_sheet/2_18.html
index 4bab93f36..4bab93f36 100644
--- a/app/views/test_sheet/2.18.html
+++ b/app/views/test_sheet/2_18.html
diff --git a/app/views/test_sheet/2.19.html b/app/views/test_sheet/2_19.html
index f19939744..f19939744 100644
--- a/app/views/test_sheet/2.19.html
+++ b/app/views/test_sheet/2_19.html
diff --git a/app/views/test_sheet/2.2.html b/app/views/test_sheet/2_2.html
index a03053d70..a03053d70 100644
--- a/app/views/test_sheet/2.2.html
+++ b/app/views/test_sheet/2_2.html
diff --git a/app/views/test_sheet/2.20.html b/app/views/test_sheet/2_20.html
index 7d433e7ff..7d433e7ff 100644
--- a/app/views/test_sheet/2.20.html
+++ b/app/views/test_sheet/2_20.html
diff --git a/app/views/test_sheet/2.21.html b/app/views/test_sheet/2_21.html
index c083741eb..c083741eb 100644
--- a/app/views/test_sheet/2.21.html
+++ b/app/views/test_sheet/2_21.html
diff --git a/app/views/test_sheet/2.22.html b/app/views/test_sheet/2_22.html
index 258bb16e9..258bb16e9 100644
--- a/app/views/test_sheet/2.22.html
+++ b/app/views/test_sheet/2_22.html
diff --git a/app/views/test_sheet/2.23.html b/app/views/test_sheet/2_23.html
index dc5d20ad6..dc5d20ad6 100644
--- a/app/views/test_sheet/2.23.html
+++ b/app/views/test_sheet/2_23.html
diff --git a/app/views/test_sheet/2.24.html b/app/views/test_sheet/2_24.html
index 04280b8ca..04280b8ca 100644
--- a/app/views/test_sheet/2.24.html
+++ b/app/views/test_sheet/2_24.html
diff --git a/app/views/test_sheet/2.25.html b/app/views/test_sheet/2_25.html
index 4413a2710..4413a2710 100644
--- a/app/views/test_sheet/2.25.html
+++ b/app/views/test_sheet/2_25.html
diff --git a/app/views/test_sheet/2.26.html b/app/views/test_sheet/2_26.html
index 6f3034a19..6f3034a19 100644
--- a/app/views/test_sheet/2.26.html
+++ b/app/views/test_sheet/2_26.html
diff --git a/app/views/test_sheet/2.27.html b/app/views/test_sheet/2_27.html
index 1c7440555..1c7440555 100644
--- a/app/views/test_sheet/2.27.html
+++ b/app/views/test_sheet/2_27.html
diff --git a/app/views/test_sheet/2.28.html b/app/views/test_sheet/2_28.html
index 461c913e6..461c913e6 100644
--- a/app/views/test_sheet/2.28.html
+++ b/app/views/test_sheet/2_28.html
diff --git a/app/views/test_sheet/2.3.html b/app/views/test_sheet/2_3.html
index 8785be94f..8785be94f 100644
--- a/app/views/test_sheet/2.3.html
+++ b/app/views/test_sheet/2_3.html
diff --git a/app/views/test_sheet/2.4.html b/app/views/test_sheet/2_4.html
index 7bd6d3bea..7bd6d3bea 100644
--- a/app/views/test_sheet/2.4.html
+++ b/app/views/test_sheet/2_4.html
diff --git a/app/views/test_sheet/2.5.html b/app/views/test_sheet/2_5.html
index cff209e5d..cff209e5d 100644
--- a/app/views/test_sheet/2.5.html
+++ b/app/views/test_sheet/2_5.html
diff --git a/app/views/test_sheet/2.6.html b/app/views/test_sheet/2_6.html
index 2b2a7a852..2b2a7a852 100644
--- a/app/views/test_sheet/2.6.html
+++ b/app/views/test_sheet/2_6.html
diff --git a/app/views/test_sheet/2.7.html b/app/views/test_sheet/2_7.html
index 7618e3356..7618e3356 100644
--- a/app/views/test_sheet/2.7.html
+++ b/app/views/test_sheet/2_7.html
diff --git a/app/views/test_sheet/2.8.html b/app/views/test_sheet/2_8.html
index 372ec6429..372ec6429 100644
--- a/app/views/test_sheet/2.8.html
+++ b/app/views/test_sheet/2_8.html
diff --git a/app/views/test_sheet/2.9.html b/app/views/test_sheet/2_9.html
index 1650f0a9a..1650f0a9a 100644
--- a/app/views/test_sheet/2.9.html
+++ b/app/views/test_sheet/2_9.html
diff --git a/app/views/test_sheet/3.1.html b/app/views/test_sheet/3_1.html
index 7467796ea..7467796ea 100644
--- a/app/views/test_sheet/3.1.html
+++ b/app/views/test_sheet/3_1.html
diff --git a/app/views/test_sheet/3.10.html b/app/views/test_sheet/3_10.html
index 22180a1aa..22180a1aa 100644
--- a/app/views/test_sheet/3.10.html
+++ b/app/views/test_sheet/3_10.html
diff --git a/app/views/test_sheet/3.11.html b/app/views/test_sheet/3_11.html
index 56d5e2ef6..56d5e2ef6 100644
--- a/app/views/test_sheet/3.11.html
+++ b/app/views/test_sheet/3_11.html
diff --git a/app/views/test_sheet/3.12.html b/app/views/test_sheet/3_12.html
index 9a93c2888..9a93c2888 100644
--- a/app/views/test_sheet/3.12.html
+++ b/app/views/test_sheet/3_12.html
diff --git a/app/views/test_sheet/3.13.html b/app/views/test_sheet/3_13.html
index 5f3a51bcd..5f3a51bcd 100644
--- a/app/views/test_sheet/3.13.html
+++ b/app/views/test_sheet/3_13.html
diff --git a/app/views/test_sheet/3.14.html b/app/views/test_sheet/3_14.html
index feaee5be7..feaee5be7 100644
--- a/app/views/test_sheet/3.14.html
+++ b/app/views/test_sheet/3_14.html
diff --git a/app/views/test_sheet/3.15.html b/app/views/test_sheet/3_15.html
index da861b959..da861b959 100644
--- a/app/views/test_sheet/3.15.html
+++ b/app/views/test_sheet/3_15.html
diff --git a/app/views/test_sheet/3.16.html b/app/views/test_sheet/3_16.html
index 6b007bfcb..6b007bfcb 100644
--- a/app/views/test_sheet/3.16.html
+++ b/app/views/test_sheet/3_16.html
diff --git a/app/views/test_sheet/3.17.html b/app/views/test_sheet/3_17.html
index 530526ca2..530526ca2 100644
--- a/app/views/test_sheet/3.17.html
+++ b/app/views/test_sheet/3_17.html
diff --git a/app/views/test_sheet/3.18.html b/app/views/test_sheet/3_18.html
index d9c26f0cb..d9c26f0cb 100644
--- a/app/views/test_sheet/3.18.html
+++ b/app/views/test_sheet/3_18.html
diff --git a/app/views/test_sheet/3.19.html b/app/views/test_sheet/3_19.html
index ed032f4f5..ed032f4f5 100644
--- a/app/views/test_sheet/3.19.html
+++ b/app/views/test_sheet/3_19.html
diff --git a/app/views/test_sheet/3.2.html b/app/views/test_sheet/3_2.html
index c0866df30..c0866df30 100644
--- a/app/views/test_sheet/3.2.html
+++ b/app/views/test_sheet/3_2.html
diff --git a/app/views/test_sheet/3.20.html b/app/views/test_sheet/3_20.html
index caf922356..caf922356 100644
--- a/app/views/test_sheet/3.20.html
+++ b/app/views/test_sheet/3_20.html
diff --git a/app/views/test_sheet/3.21.html b/app/views/test_sheet/3_21.html
index 104181277..104181277 100644
--- a/app/views/test_sheet/3.21.html
+++ b/app/views/test_sheet/3_21.html
diff --git a/app/views/test_sheet/3.3.html b/app/views/test_sheet/3_3.html
index d54516b4d..d54516b4d 100644
--- a/app/views/test_sheet/3.3.html
+++ b/app/views/test_sheet/3_3.html
diff --git a/app/views/test_sheet/3.4.html b/app/views/test_sheet/3_4.html
index 735f814a6..735f814a6 100644
--- a/app/views/test_sheet/3.4.html
+++ b/app/views/test_sheet/3_4.html
diff --git a/app/views/test_sheet/3.5.html b/app/views/test_sheet/3_5.html
index 968d199a7..968d199a7 100644
--- a/app/views/test_sheet/3.5.html
+++ b/app/views/test_sheet/3_5.html
diff --git a/app/views/test_sheet/3.6.html b/app/views/test_sheet/3_6.html
index 2ad4af075..2ad4af075 100644
--- a/app/views/test_sheet/3.6.html
+++ b/app/views/test_sheet/3_6.html
diff --git a/app/views/test_sheet/3.7.html b/app/views/test_sheet/3_7.html
index 5193c9ae9..5193c9ae9 100644
--- a/app/views/test_sheet/3.7.html
+++ b/app/views/test_sheet/3_7.html
diff --git a/app/views/test_sheet/3.8.html b/app/views/test_sheet/3_8.html
index 08e6f6d19..08e6f6d19 100644
--- a/app/views/test_sheet/3.8.html
+++ b/app/views/test_sheet/3_8.html
diff --git a/app/views/test_sheet/3.9.html b/app/views/test_sheet/3_9.html
index 249a1d722..249a1d722 100644
--- a/app/views/test_sheet/3.9.html
+++ b/app/views/test_sheet/3_9.html
diff --git a/app/views/test_sheet/toc.html b/app/views/test_sheet/toc.html
index 23ccdfcaf..ce280322e 100644
--- a/app/views/test_sheet/toc.html
+++ b/app/views/test_sheet/toc.html
@@ -1,56 +1,56 @@
h3. Définition des tests
* Catégorie 1
-** "Fiche 1.1":1.1
-** "Fiche 1.2":1.2
+** "Fiche 1.1":1_1
+** "Fiche 1.2":1_2
* Catégorie 2
-** "Fiche 2.1":2.1
-** "Fiche 2.2":2.2
-** "Fiche 2.3":2.3
-** "Fiche 2.4":2.4
-** "Fiche 2.5":2.5
-** "Fiche 2.6":2.6
-** "Fiche 2.7":2.7
-** "Fiche 2.8":2.8
-** "Fiche 2.9":2.9
-** "Fiche 2.10":2.10
-** "Fiche 2.11":2.11
-** "Fiche 2.12":2.12
-** "Fiche 2.13":2.13
-** "Fiche 2.14":2.14
-** "Fiche 2.15":2.15
-** "Fiche 2.16":2.16
-** "Fiche 2.17":2.17
-** "Fiche 2.18":2.18
-** "Fiche 2.19":2.19
-** "Fiche 2.20":2.20
-** "Fiche 2.21":2.21
-** "Fiche 2.22":2.22
-** "Fiche 2.23":2.23
-** "Fiche 2.24":2.24
-** "Fiche 2.25":2.25
-** "Fiche 2.26":2.26
-** "Fiche 2.27":2.27
-** "Fiche 2.28":2.28
+** "Fiche 2.1":2_1
+** "Fiche 2.2":2_2
+** "Fiche 2.3":2_3
+** "Fiche 2.4":2_4
+** "Fiche 2.5":2_5
+** "Fiche 2.6":2_6
+** "Fiche 2.7":2_7
+** "Fiche 2.8":2_8
+** "Fiche 2.9":2_9
+** "Fiche 2.10":2_10
+** "Fiche 2.11":2_11
+** "Fiche 2.12":2_12
+** "Fiche 2.13":2_13
+** "Fiche 2.14":2_14
+** "Fiche 2.15":2_15
+** "Fiche 2.16":2_16
+** "Fiche 2.17":2_17
+** "Fiche 2.18":2_18
+** "Fiche 2.19":2_19
+** "Fiche 2.20":2_20
+** "Fiche 2.21":2_21
+** "Fiche 2.22":2_22
+** "Fiche 2.23":2_23
+** "Fiche 2.24":2_24
+** "Fiche 2.25":2_25
+** "Fiche 2.26":2_26
+** "Fiche 2.27":2_27
+** "Fiche 2.28":2_28
* Catégorie 3
-** "Fiche 3.1":3.1
-** "Fiche 3.2":3.2
-** "Fiche 3.3":3.3
-** "Fiche 3.4":3.4
-** "Fiche 3.5":3.5
-** "Fiche 3.6":3.6
-** "Fiche 3.7":3.7
-** "Fiche 3.8":3.8
-** "Fiche 3.9":3.9
-** "Fiche 3.10":3.10
-** "Fiche 3.11":3.11
-** "Fiche 3.12":3.12
-** "Fiche 3.13":3.13
-** "Fiche 3.14":3.14
-** "Fiche 3.15":3.15
-** "Fiche 3.16":3.16
-** "Fiche 3.17":3.17
-** "Fiche 3.18":3.18
-** "Fiche 3.19":3.19
-** "Fiche 3.20":3.20
-** "Fiche 3.21":3.21
+** "Fiche 3.1":3_1
+** "Fiche 3.2":3_2
+** "Fiche 3.3":3_3
+** "Fiche 3.4":3_4
+** "Fiche 3.5":3_5
+** "Fiche 3.6":3_6
+** "Fiche 3.7":3_7
+** "Fiche 3.8":3_8
+** "Fiche 3.9":3_9
+** "Fiche 3.10":3_10
+** "Fiche 3.11":3_11
+** "Fiche 3.12":3_12
+** "Fiche 3.13":3_13
+** "Fiche 3.14":3_14
+** "Fiche 3.15":3_15
+** "Fiche 3.16":3_16
+** "Fiche 3.17":3_17
+** "Fiche 3.18":3_18
+** "Fiche 3.19":3_19
+** "Fiche 3.20":3_20
+** "Fiche 3.21":3_21
diff --git a/config/locales/clean_ups.yml b/config/locales/clean_ups.yml
new file mode 100644
index 000000000..470ee19a6
--- /dev/null
+++ b/config/locales/clean_ups.yml
@@ -0,0 +1,53 @@
+en:
+ clean_ups:
+ success_tm: "%{count} time tables deleted"
+ success_vj: "%{count} vehicle journeys deleted"
+ success_jp: "%{count} journey patterns deleted"
+ success_r: "%{count} routes deleted"
+ success_l: "%{count} lines deleted"
+ success_sa: "%{count} stop areas deleted"
+ success_c: "%{count} companies deleted"
+ success_n: "%{count} networks deleted"
+ failure: "Fail when clean_up"
+ actions:
+ clean_up: "clean up"
+ confirm: "Clean up will destroy time tables which ended on requested date\nand next recursively all object without any time table\nPlease confirm this action"
+ activemodel:
+ attributes:
+ clean_up:
+ expected_date: "Final date"
+ keep_lines: keep lines
+ keep_stops: keep stop areas
+ keep_companies: keep companies
+ keep_networks: keep networks
+ formtastic:
+ hints:
+ clean_up:
+ expected_date: "value included in clean up"
+fr:
+ clean_ups:
+ success_tm: "%{count} calendriers supprimés"
+ success_vj: "%{count} courses supprimées"
+ success_jp: "%{count} missions supprimées"
+ success_r: "%{count} séquences d'arrêt supprimées"
+ success_l: "%{count} lignes supprimées"
+ success_sa: "%{count} arrêts supprimés"
+ success_c: "%{count} transporteurs supprimés"
+ success_n: "%{count} réseaux supprimés"
+ failure: "Echec de la purge"
+ actions:
+ clean_up: "Purger"
+ confirm: "La purge détruit les calendriers se finissant au plus tard à la date indiquée \npuis en cascade les objets qui n'ont pas ou plus de calendrier\nConfirmer cette action SVP"
+ activemodel:
+ attributes:
+ clean_up:
+ expected_date: "date limite"
+ keep_lines: conserver les lignes
+ keep_stops: conserver les arrêts
+ keep_companies: conserver les transporteurs
+ keep_networks: conserver les réseaux
+ formtastic:
+ hints:
+ clean_up:
+ expected_date: "valeur incluse dans la purge"
+
diff --git a/config/locales/referentials.yml b/config/locales/referentials.yml
index feaca8082..da0eda2d1 100644
--- a/config/locales/referentials.yml
+++ b/config/locales/referentials.yml
@@ -6,6 +6,7 @@ en:
title: Data space
objects: Data space elements
count: count
+ clean_up: Clean up
new:
title: Create a new data space
submit: "Create a data space"
@@ -54,6 +55,7 @@ fr:
title: Espace de données
objects: Eléments
count: Qté
+ clean_up: Purge des données obsolètes
new:
title: Créer un nouvel espace de données
submit: "Créer un espace de données"
diff --git a/config/routes.rb b/config/routes.rb
index de74fa522..2d2b7ba81 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -90,6 +90,8 @@ ChouetteIhm::Application.routes.draw do
end
end
+ resources :clean_ups
+
end
match '/help/(*slug)' => 'help#show'