aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Peignier2012-07-11 16:16:03 +0200
committerAlban Peignier2012-07-11 16:16:03 +0200
commitb26ece76b66cca7d773d2a906dba67907398a329 (patch)
treeced660f04eb0082777c123ff1737f94cbc3621ef
parent725f83bb5d68d3d8f77d6dd8e4a1b4fbf535e10f (diff)
downloadchouette-core-b26ece76b66cca7d773d2a906dba67907398a329.tar.bz2
Display a collection of SRIDs to create a Referential. Fixes #54
-rw-r--r--app/models/referential.rb12
-rw-r--r--app/views/referentials/_form.erb6
-rw-r--r--config/locales/referentials.yml2
3 files changed, 15 insertions, 5 deletions
diff --git a/app/models/referential.rb b/app/models/referential.rb
index 4a9fc33aa..9ab9b332f 100644
--- a/app/models/referential.rb
+++ b/app/models/referential.rb
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
class Referential < ActiveRecord::Base
validates_presence_of :name
@@ -52,6 +53,17 @@ class Referential < ActiveRecord::Base
self
end
+ def self.available_srids
+ [
+ [ "NTF Lambert Zone 1 (27561)", 27561 ],
+ [ "NTF Lambert Zone 2 (27562)", 27562 ],
+ [ "NTF Lambert Zone 3 (27563)", 27563 ],
+ [ "NTF Lambert Zone 4 (27564)", 27564 ],
+ [ "NTF Lambert 2 étendu (27572)", 27582 ],
+ ["RGF 93 Lambert 93 (2154)", 2154 ]
+ ]
+ end
+
before_create :create_schema
before_destroy :destroy_schema
diff --git a/app/views/referentials/_form.erb b/app/views/referentials/_form.erb
index d794d828c..f9beb480e 100644
--- a/app/views/referentials/_form.erb
+++ b/app/views/referentials/_form.erb
@@ -9,9 +9,9 @@
<%= @referential.slug %>
</li>
<% end %>
- <%= form.input :prefix%>
- <%= form.input :projection_type%>
- <%= form.input :time_zone%>
+ <%= form.input :prefix %>
+ <%= form.input :projection_type, :as => :select, :collection => Referential.available_srids %>
+ <%= form.input :time_zone %>
<% if @referential.new_record? %>
<%= form.input :resources, :as => :file %>
diff --git a/config/locales/referentials.yml b/config/locales/referentials.yml
index da0eda2d1..c5f4cdbd9 100644
--- a/config/locales/referentials.yml
+++ b/config/locales/referentials.yml
@@ -45,7 +45,6 @@ en:
referential:
slug: only lowercase alphanumerical or underscore characters
prefix: only alphanumerical or underscore characters
- projection_type: "see SRID codes on http://spatialreference.org"
fr:
referentials:
@@ -94,4 +93,3 @@ fr:
referential:
slug: "caractères autorisés : alphanumériques minuscules et 'souligné'"
prefix: "caractères autorisés : alphanumériques et 'souligné'"
- projection_type: "voir http://spatialreference.org pour les codes SRID"