diff options
| author | jpl | 2016-08-04 11:05:43 +0200 |
|---|---|---|
| committer | jpl | 2016-08-04 11:05:43 +0200 |
| commit | f3edc0caf3dfe803b62a5dee0699af999290f3fe (patch) | |
| tree | a6b3c506a2eda840a2c4c195c18042a54cdb95eb | |
| parent | 51023c5ed5e1de7e62a7f2bb04f05c5fd3e50343 (diff) | |
| download | chouette-core-f3edc0caf3dfe803b62a5dee0699af999290f3fe.tar.bz2 | |
Refs #1295: convert erb to slim (stop_points)
| -rw-r--r-- | app/views/stop_points/_stop_point.html.erb | 36 | ||||
| -rw-r--r-- | app/views/stop_points/_stop_point.html.slim | 30 |
2 files changed, 30 insertions, 36 deletions
diff --git a/app/views/stop_points/_stop_point.html.erb b/app/views/stop_points/_stop_point.html.erb deleted file mode 100644 index 3e0163a62..000000000 --- a/app/views/stop_points/_stop_point.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -<div id="index_item" class="panel panel-default stop_point"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <h5> - <%= link_to([@referential, stop_point.stop_area], :class => "preview", :title => "#{Chouette::StopArea.model_name.human.capitalize} #{stop_point.stop_area.name}") do %> - <span class="name"> - <span class="label label-primary"><%= stop_point.position + 1 %></span><%= image_tag "map/" + stop_point.stop_area.stop_area_type + ".png" %> <%= truncate(stop_point.stop_area.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <% unless stop_point.stop_area.geometry %> - <span class="warning"><%= t('.no_position') %></span> - - <% end %> - </p> - <p> - <%= stop_point.stop_area.human_attribute_name('registration_number') %> : <%= stop_point.stop_area.registration_number.present? ? stop_point.stop_area.registration_number : t(".no_object") %> - </p> - <p> - <%= t('.address') %> : <%= (stop_point.stop_area.zip_code.present? || stop_point.stop_area.city_name.present?) ? "#{stop_point.stop_area.zip_code} #{stop_point.stop_area.city_name}" : t(".no_object") %> - </p> - <p> - <%= t('.lines') %> <% if stop_point.stop_area.lines.blank? %> - <%= t(".no_object") %> - <% else %> - <% stop_point.stop_area.lines.each do |line| %> - <span class="label label-default line"><%= line.number || truncate( line.name, :length => 4 ) %></span> - <% end %> - <% end %> - </p> - </div> -</div> - diff --git a/app/views/stop_points/_stop_point.html.slim b/app/views/stop_points/_stop_point.html.slim new file mode 100644 index 000000000..ca86e339a --- /dev/null +++ b/app/views/stop_points/_stop_point.html.slim @@ -0,0 +1,30 @@ +#index_item.panel.panel-default.stop_point + .panel-heading + .panel-title.clearfix + h5 + = link_to [@referential, stop_point.stop_area], class: "preview", title: "#{Chouette::StopArea.model_name.human.capitalize} #{stop_point.stop_area.name}" do + span.name + span.label.label-primary = stop_point.position + 1 + = image_tag "map/" + stop_point.stop_area.stop_area_type + ".png" + = truncate(stop_point.stop_area.name, length: 20) + + .panel-body + p + - unless stop_point.stop_area.geometry + span.warning = t('.no_position') + + p + = "#{stop_point.stop_area.human_attribute_name('registration_number')} : " + = stop_point.stop_area.registration_number.present? ? stop_point.stop_area.registration_number : t(".no_object") + + p + = "#{t('.address')} : " + = (stop_point.stop_area.zip_code.present? || stop_point.stop_area.city_name.present?) ? "#{stop_point.stop_area.zip_code} #{stop_point.stop_area.city_name}" : t(".no_object") + + p + = t('.lines') + - if stop_point.stop_area.lines.blank? + = t(".no_object") + - else + - stop_point.stop_area.lines.each do |line| + span.label.label-default.line = line.number || truncate( line.name, length: 4 )
\ No newline at end of file |
