diff options
| author | Michel Etienne | 2014-11-12 16:55:40 +0100 |
|---|---|---|
| committer | Michel Etienne | 2014-11-12 16:55:40 +0100 |
| commit | 28350f95744a03290a28dd8d941d1e6248f2eeb2 (patch) | |
| tree | 6ce8b6b89525b0428d29fc93d27949e60e2c2efb /app | |
| parent | 0906ff71269c2bcec1a6445a6fb53900be66be9b (diff) | |
| download | chouette-core-28350f95744a03290a28dd8d941d1e6248f2eeb2.tar.bz2 | |
new fields for GTFS exchange
Diffstat (limited to 'app')
| -rw-r--r-- | app/assets/stylesheets/main/lines.css.scss | 16 | ||||
| -rw-r--r-- | app/helpers/lines_helper.rb | 17 | ||||
| -rw-r--r-- | app/views/companies/_form.erb | 2 | ||||
| -rw-r--r-- | app/views/companies/show.html.erb | 8 | ||||
| -rw-r--r-- | app/views/lines/_form.erb | 3 | ||||
| -rw-r--r-- | app/views/lines/_line.erb | 9 | ||||
| -rw-r--r-- | app/views/lines/show.html.erb | 23 | ||||
| -rw-r--r-- | app/views/stop_areas/_form.html.erb | 2 | ||||
| -rw-r--r-- | app/views/stop_areas/show.html.erb | 8 |
9 files changed, 77 insertions, 11 deletions
diff --git a/app/assets/stylesheets/main/lines.css.scss b/app/assets/stylesheets/main/lines.css.scss index 3ce3c50e0..6e2f14dc5 100644 --- a/app/assets/stylesheets/main/lines.css.scss +++ b/app/assets/stylesheets/main/lines.css.scss @@ -23,20 +23,24 @@ #workspace.lines.edit, #workspace.lines.new, #workspace.lines.create, #workspace.lines.update { - #line_color{ width: 100px; + #line_color_old{ width: 100px; color: white; font-weight: bold;} } #workspace.lines.show { - .line_color{ color: white; - font-weight: bold; - padding: 0 5px 0 5px;} - - .summary p label { + .summary p + { + label { font-weight: bold; + } + .color + { + padding: 3px 15px 3px 15px; + } } + .group_of_line { .position { diff --git a/app/helpers/lines_helper.rb b/app/helpers/lines_helper.rb index a03868a0a..623d091ca 100644 --- a/app/helpers/lines_helper.rb +++ b/app/helpers/lines_helper.rb @@ -1,2 +1,19 @@ module LinesHelper + + def line_sticker( line) + return line.name if line.number.blank? + line.number + end + + def colors?(line) + line.text_color.present? || line.color.present? + end + + def text_color(line) + line.text_color.blank? ? "black" : "##{line.text_color}" + end + + def background_color(line) + line.color.blank? ? "white" : "#"+line.color + end end diff --git a/app/views/companies/_form.erb b/app/views/companies/_form.erb index 6f89edbbc..f23edbef9 100644 --- a/app/views/companies/_form.erb +++ b/app/views/companies/_form.erb @@ -8,6 +8,8 @@ <%= form.input :phone, :as => :phone %> <%= form.input :fax, :as => :phone %> <%= form.input :email, :as => :email %> + <%= form.input :time_zone, :include_blank => true %> + <%= form.input :url %> <%= form.input :registration_number, :input_html => { :title => t("formtastic.titles.company.registration_number")} %> <%= form.input :objectid, :required => !@company.new_record?, :input_html => { :title => t("formtastic.titles.company.objectid")} %> <% end %> diff --git a/app/views/companies/show.html.erb b/app/views/companies/show.html.erb index 0c8585a6c..513b0364e 100644 --- a/app/views/companies/show.html.erb +++ b/app/views/companies/show.html.erb @@ -32,6 +32,14 @@ <%= @company.email %> </p> <p> + <label><%= Chouette::Company.human_attribute_name("time_zone") %>: </label> + <%= @company.time_zone %> + </p> + <p> + <label><%= Chouette::Company.human_attribute_name("url") %>: </label> + <%= @company.url %> + </p> + <p> <label><%= Chouette::Company.human_attribute_name("registration_number") %>: </label> <%= @company.registration_number %> </p> diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb index c1f59ed01..0e393ac53 100644 --- a/app/views/lines/_form.erb +++ b/app/views/lines/_form.erb @@ -8,6 +8,9 @@ <%= form.input :registration_number, :input_html => { :title => t("formtastic.titles.line.registration_number")} %> <%= form.input :number %> <%= form.input :transport_mode, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") } %> + <%= form.input :color, :as => :string %> + <%= form.input :text_color %> + <%= form.input :url %> <%= form.input :mobility_restricted_suitability, :as => :select, :collection => [[@line.human_attribute_name("accessible"), true], [@line.human_attribute_name("not_accessible"), false]], :include_blank => true %> <%= form.input :flexible_service, :as => :select, :collection => [[@line.human_attribute_name("on_demaond_fs"), true], [@line.human_attribute_name("regular_fs"), false]], :include_blank => true %> <%= form.input :comment %> diff --git a/app/views/lines/_line.erb b/app/views/lines/_line.erb index f5606d907..24450fa20 100644 --- a/app/views/lines/_line.erb +++ b/app/views/lines/_line.erb @@ -12,7 +12,14 @@ <h5> <%= check_box_tag "ids[]", line.id, false, :class => "multiple_selection", :style => "display: none;" %> <% if line.number and line.number.length <= 3 %> - <span class="label label-default line_number"><%= line.number %></span> + <% if !line.text_color.blank? || !line.color.blank? %> + <% text_color = line.text_color.blank? ? "black" : "##{line.text_color}" %> + <% bg_color = line.color.blank? ? "white" : "##{line.color}" %> + <% number_style = "color: #{text_color}; background-color: #{bg_color};" %> + <% else %> + <% number_style = "" %> + <% end %> + <span class="label label-default line_number" style="<%= number_style %>"><%= line.number %></span> <% end %> <%= link_to([@referential, line], :class => "preview", :title => "#{Chouette::Line.model_name.human.capitalize} #{line.name}") do %> <span class="name"> diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb index 24eebd794..12af00ff7 100644 --- a/app/views/lines/show.html.erb +++ b/app/views/lines/show.html.erb @@ -1,9 +1,20 @@ +<% text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" %> +<% bg_color = @line.color.blank? ? "white" : "#"+@line.color %> + <%= title_tag t('lines.show.title', :line => @line.name ) %> <div class="line_show"> <%= @map.to_html %> <div class="summary"> +<% text_color = @line.text_color.blank? ? "black" : "##{@line.text_color}" %> +<% bg_color = @line.color.blank? ? "white" : "#"+@line.color %> + <% if colors?(@line) %> + <p> + <label><%= t('lines.index.color') %>: </label> + <label class="color" style='<%="color: #{text_color(@line)}; background-color: #{background_color(@line)};"%>'><%= line_sticker(@line) %></label> + </p> + <% end %> <p> <label><%= @line.human_attribute_name(:network) %>: </label> <% if @line.network.nil? %> @@ -21,6 +32,10 @@ <% end %> </p> <p> + <label><%= @line.human_attribute_name("number") %>: </label> + <%= @line.number %> + </p> + <p> <label><%= @line.human_attribute_name("published_name") %>: </label> <%= @line.published_name %> </p> @@ -29,13 +44,13 @@ <%= @line.registration_number %> </p> <p> - <label><%= @line.human_attribute_name("number") %>: </label> - <%= @line.number %> - </p> - <p> <label><%= @line.human_attribute_name("transport_mode") %>: </label> <%= t("transport_modes.label.#{@line.transport_mode}") %> </p> + <p> + <label><%= @line.human_attribute_name("url") %>: </label> + <%= @line.url %> + </p> <p> <label><%= @line.human_attribute_name("mobility_restricted_suitability") %> : </label> diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb index d108ef193..9fd549e18 100644 --- a/app/views/stop_areas/_form.html.erb +++ b/app/views/stop_areas/_form.html.erb @@ -35,6 +35,8 @@ <%= form.input :fare_code, :as => :number %> <%= form.input :nearest_topic_name %> <%= form.input :comment, :as => :text, :input_html => { :rows => 5 } %> + <%= form.input :time_zone, :include_blank => true %> + <%= form.input :url %> <% end %> </div> <div class="pmr_info"> diff --git a/app/views/stop_areas/show.html.erb b/app/views/stop_areas/show.html.erb index 3a6d88207..7ca59cf70 100644 --- a/app/views/stop_areas/show.html.erb +++ b/app/views/stop_areas/show.html.erb @@ -34,6 +34,14 @@ <%= @stop_area.fare_code %> </p> <p> + <label><%= @stop_area.human_attribute_name("time_zone") %>: </label> + <%= @stop_area.time_zone %> + </p> + <p> + <label><%= @stop_area.human_attribute_name("url") %>: </label> + <%= @stop_area.url %> + </p> + <p> <label><%= @stop_area.human_attribute_name("registration_number") %>: </label> <%= @stop_area.registration_number %> </p> |
