aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/vehicle_journeys/show.html.erb
blob: f964fc4ea11eb196e6ab2355dc9509072fb1b4a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<%= title_tag vehicle_title(@vehicle_journey) %>

<div id="modal_translation" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="myModalLabel"><%= t('.translation_form') %></h4>
        <div id="translate_form"></div>
      </div>
    </div>
  </div>
</div>

<div class="vehicle_journey">
  <div class="summary">
    <p>
      <label><%= @vehicle_journey.human_attribute_name(:journey_pattern) %>: </label>
      <%= link_to journey_name(@vehicle_journey.journey_pattern), [@referential, @line, @route, @vehicle_journey.journey_pattern] %>
    </p>
    <p>
      <label><%= @vehicle_journey.human_attribute_name("number") %>: </label>
      <%= @vehicle_journey.number %>
    </p>
    <p>
      <label><%= @vehicle_journey.human_attribute_name("published_journey_name") %>: </label>
      <%= @vehicle_journey.published_journey_name %>
    </p>
    <p>
      <label><%= @vehicle_journey.human_attribute_name("published_journey_identifier") %>: </label>
      <%= @vehicle_journey.published_journey_identifier %>
    </p>

    <p>
      <label><%= @vehicle_journey.human_attribute_name("mobility_restricted_suitability") %>: </label>
      <% if @vehicle_journey.mobility_restricted_suitability.nil? %>
      <%= @vehicle_journey.human_attribute_name("unspecified_mrs") %>
      <% elsif @vehicle_journey.mobility_restricted_suitability? %>
      <%= @vehicle_journey.human_attribute_name("accessible") %>
      <% else %>
      <%= @vehicle_journey.human_attribute_name("not_accessible") %>
      <% end %>
    </p>
    <p>
      <label><%= @vehicle_journey.human_attribute_name("flexible_service") %>: </label>
      <% if @vehicle_journey.flexible_service.nil? %>
      <%= @vehicle_journey.human_attribute_name("unspecified_fs") %>
      <% elsif @vehicle_journey.flexible_service? %>
      <%= @vehicle_journey.human_attribute_name("on_demaond_fs") %>
      <% else %>
      <%= @vehicle_journey.human_attribute_name("regular_fs") %>
      <% end %>
    </p>

    <p>
      <label><%= @vehicle_journey.human_attribute_name("comment") %>: </label>
      <%= @vehicle_journey.comment %>
    </p>
    <p>
      <label><%= @vehicle_journey.human_attribute_name("status_value") %>: </label>
      <%= @vehicle_journey.status_value %>
    </p>
    <p>
      <label><%= @vehicle_journey.human_attribute_name("facility") %>: </label>
      <%= @vehicle_journey.facility %>
    </p>
    <p>
      <label><%= @vehicle_journey.human_attribute_name("vehicle_type_identifier") %>: </label>
      <%= @vehicle_journey.vehicle_type_identifier %>
    </p>
  </div>
</div>
<h3><%= @vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids) %></h3>
<div class="vehicle_journey_at_stops content">
  <table class="table table-hover table-striped">
    <thead>
      <tr>
        <th class="hour title"><%= t('.arrival') %></th>
        <th class="stop title" ><%= t('.stop_title') %></th>
        <th class="hour title"><%= t('.departure') %></th>
      </tr>
    <thead>
      <tbody>
        <% @vehicle_journey.vehicle_journey_at_stops.each_with_index do |vjas, index| %>
        <tr class="<%= index%2==0 ? "odd" : "even" %>">
          <td class="hour <%= vjas.arrival_time.nil? ? "missing" : "" %>"><%= vjas.arrival_time ? l( vjas.arrival_time, :format => :hour) : "" %></td>
          <td><%= link_to vjas.stop_point.stop_area.name, [@referential, vjas.stop_point.stop_area] %></td>
          <td class="hour <%= vjas.departure_time.nil? ? "missing" : "" %>"><%= vjas.departure_time ? l( vjas.departure_time, :format => :hour) : "" %></td>
        </tr>
        <% end %>
      </tbody>
  </table>
</div>

<h3><%= t('.time_tables') %></h3>
<div class="time_tables paginated_content">
  <%= paginated_content @vehicle_journey.time_tables, "time_table" %>
</div>


<% content_for :sidebar do %>
  <ul class="actions">
    <li><%= link_to t('vehicle_journeys.actions.new'), new_referential_line_route_vehicle_journey_path(@referential, @line, @route), :class => "add" %></li>
    <li><%= link_to t('vehicle_journeys.actions.edit'), edit_referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :class => "edit" %></li>
    <li><%= link_to t('vehicle_journeys.actions.destroy'), referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :method => :delete, :data => {:confirm =>  t('vehicle_journeys.actions.destroy_confirm')}, :class => "remove" %></li>
  <% unless @vehicle_journey.vehicle_journey_at_stops.empty? %>
    <li><font color="#D98F3B"><i class="fa fa-cubes fa-fw"></i></font><%= link_to t('.translation_form'), new_referential_line_route_vehicle_journey_vehicle_translation_path(@referential, @line, @route, @vehicle_journey), {:remote => true, 'data-toggle' =>  "modal", 'data-target' => '#modal_translation', :class => "with_fa" } %></li>
  <% end %>
  </ul>
  <%= creation_tag(@vehicle_journey) %>
<% end %>