aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Etienne2012-07-04 10:42:10 +0200
committerMichel Etienne2012-07-04 10:42:10 +0200
commite59dc611c392976b654d3fbde34188dae97a657b (patch)
treed9bd4e8292fa1eaf6d0be12a27abe84ff8d98224
parent2ebd042fc74919dc21e40c9faffb6e785a255b56 (diff)
downloadchouette-core-e59dc611c392976b654d3fbde34188dae97a657b.tar.bz2
add object count to dashboard
-rw-r--r--app/assets/stylesheets/referentials.css.scss14
-rw-r--r--app/controllers/referentials_controller.rb6
-rw-r--r--app/views/referentials/show.html.erb35
-rw-r--r--config/locales/referentials.yml26
4 files changed, 81 insertions, 0 deletions
diff --git a/app/assets/stylesheets/referentials.css.scss b/app/assets/stylesheets/referentials.css.scss
index dd03adb05..26d0411ba 100644
--- a/app/assets/stylesheets/referentials.css.scss
+++ b/app/assets/stylesheets/referentials.css.scss
@@ -7,6 +7,20 @@
.summary p label {
font-weight: bold;
}
+
+ .count td {
+ border: 1px solid #61970b;
+ padding-left: 5px;
+ padding-right: 5px;
+ }
+ .count thead td {
+ background: #61970b;
+ color: white;
+ }
+ .value {
+ text-align: right;
+ }
+
}
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb
index a5e3b7247..face0663f 100644
--- a/app/controllers/referentials_controller.rb
+++ b/app/controllers/referentials_controller.rb
@@ -1,4 +1,10 @@
class ReferentialsController < InheritedResources::Base
respond_to :html
+ def show
+ resource.switch
+ show!
+ end
+
+
end
diff --git a/app/views/referentials/show.html.erb b/app/views/referentials/show.html.erb
index 2f2afdbed..59beb0c3f 100644
--- a/app/views/referentials/show.html.erb
+++ b/app/views/referentials/show.html.erb
@@ -17,6 +17,41 @@
<label><%= Referential.human_attribute_name("time_zone") %>: </label>
<%= @referential.time_zone %>
</p>
+
+ <table class="count">
+ <thead>
+ <tr>
+ <td><%= t(".objects") %></td>
+ <td><%= t(".count") %></td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="object"><%= Referential.human_attribute_name("networks") %></td>
+ <td class="value"> <%= @referential.networks.size %></d>
+ </tr>
+ <tr>
+ <td class="object"><%= Referential.human_attribute_name("lines") %></td>
+ <td class="value"> <%= @referential.lines.size %></d>
+ </tr>
+ <tr>
+ <td class="object"><%= Referential.human_attribute_name("companies") %></td>
+ <td class="value"> <%= @referential.companies.size %></d>
+ </tr>
+ <tr>
+ <td class="object"><%= Referential.human_attribute_name("stop_areas") %></td>
+ <td class="value"> <%= @referential.stop_areas.size %></d>
+ </tr>
+ <tr>
+ <td class="object"><%= Referential.human_attribute_name("time_tables") %></td>
+ <td class="value"> <%= @referential.time_tables.size %></d>
+ </tr>
+ <tr>
+ <td class="object"><%= Referential.human_attribute_name("connection_links") %></td>
+ <td class="value"> <%= @referential.connection_links.size %></d>
+ </tr>
+ </tbody>
+ </table>
</div>
<% content_for :sidebar do %>
diff --git a/config/locales/referentials.yml b/config/locales/referentials.yml
index 3b78f495c..379e00fc7 100644
--- a/config/locales/referentials.yml
+++ b/config/locales/referentials.yml
@@ -4,6 +4,8 @@ en:
title: "Edit the data space"
show:
title: Data space
+ objects: Data space elements
+ count: count
new:
title: Create a new data space
submit: "Create a data space"
@@ -22,6 +24,17 @@ en:
prefix: Neptune Object Id prefix
projection_type: Optional spatial reference system code (SRID)
time_zone: time zone
+ networks: Networks
+ lines: Lines
+ companies: Companies
+ stop_areas: Stop Areas
+ time_tables: Time tables
+ connection_links: Connection links
+ quays: quays
+ boarding_positions: boarding positions
+ commercial_stops: commercial stops
+ stop_places: stop places
+ itls: routing contraints
formtastic:
hints:
referential:
@@ -35,6 +48,8 @@ fr:
title: "Modifier l'espace de données"
show:
title: Espace de données
+ objects: Eléments
+ count: Qté
new:
title: Créer un nouvel espace de données
submit: "Créer un espace de données"
@@ -53,6 +68,17 @@ fr:
prefix: Préfixe des identifiants Neptune
projection_type: Système de référence spatiale optionnel (SRID)
time_zone: Fuseau horaire
+ networks: Réseaux
+ lines: Lignes
+ companies: Transporteurs
+ stop_areas: Arrêts
+ time_tables: Calendriers
+ connection_links: Correspondances
+ quays: quais
+ boarding_positions: "points d'embarquement"
+ commercial_stops: arrêts commerciaux
+ stop_places: "pôles d'échange"
+ itls: ITL
formtastic:
hints:
referential: