aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Etienne2012-06-19 14:32:24 +0200
committerMichel Etienne2012-06-19 14:32:24 +0200
commitd142fee1e270ded464e3fb482d5a075b8f640a6c (patch)
tree2099f94ea674b75382e978a79d0febd395bbf0f6
parent5e858faea9eeff60b2f0d7f524ec2f80d1221acf (diff)
downloadchouette-core-d142fee1e270ded464e3fb482d5a075b8f640a6c.tar.bz2
effective export with reports
-rw-r--r--app/assets/stylesheets/layout.css.scss2
-rw-r--r--app/models/export.rb9
-rw-r--r--config/locales/exports.yml4
3 files changed, 11 insertions, 4 deletions
diff --git a/app/assets/stylesheets/layout.css.scss b/app/assets/stylesheets/layout.css.scss
index 13151abb8..79126e7ed 100644
--- a/app/assets/stylesheets/layout.css.scss
+++ b/app/assets/stylesheets/layout.css.scss
@@ -9,7 +9,7 @@ $text_color: #222;
#header .infos div.title
{
- margin: 13px 0 0 30px;
+ margin: 20px 0 0 30px;
h1 {
font-family: "Comic Sans", "Comic Sans MS", cursive;
diff --git a/app/models/export.rb b/app/models/export.rb
index a202e77ef..4fd6ff2f1 100644
--- a/app/models/export.rb
+++ b/app/models/export.rb
@@ -21,6 +21,10 @@ class Export < ActiveRecord::Base
end
end
+ def exporter
+ exporter ||= ::Chouette::Exporter.new(referential.slug)
+ end
+
def options
read_attribute(:options) || write_attribute(:options, {})
end
@@ -42,7 +46,7 @@ class Export < ActiveRecord::Base
end
def export_options
- { :export_id => self.id, :output_file => file }
+ { :export_id => self.id }
end
before_validation :define_default_attributes, :on => :create
@@ -61,8 +65,7 @@ class Export < ActiveRecord::Base
begin
log_messages.create :key => :started
- # TODO
- # Make real export here
+ exporter.export file, export_options
update_attribute :status, "completed"
rescue => e
diff --git a/config/locales/exports.yml b/config/locales/exports.yml
index bb26978a6..19beced06 100644
--- a/config/locales/exports.yml
+++ b/config/locales/exports.yml
@@ -21,6 +21,8 @@ en:
completed: Completed export
failed: Failed export
undefined: %{key} undefined
+ NEPTUNE_EXPORT: Neptune Export
+ NEPTUNE_EXPORTED_LINE: "Line %{0} (%{1}) exported"
severities:
info: Information
ok: Ok
@@ -63,6 +65,8 @@ fr:
completed: Export achevé avec succès
failed: Export interromptu
undefined: %{key} non défini
+ NEPTUNE_EXPORT: Export Neptune
+ NEPTUNE_EXPORTED_LINE: "Ligne %{0} (%{1}) exportée"
severities:
info: Information
ok: Ok