aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/lines/index.html.erb
blob: ff14e87491ea605206d778e9cb005cd96e8eb18e (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
<%= title_tag t('lines.index.title') %> 

<%= search_form_for @q, :url => referential_lines_path(@referential), :html => {:method => :get} do |f| %>
  <%= f.label :name_or_number_cont, "#{t('.name_or_number')} :" %>
  <%= f.text_field :name_or_number_cont %>

  <%= f.hidden_field :company_id_eq %>
  <%= f.hidden_field :network_id_eq %>
  <%= f.hidden_field :group_of_lines_id_eq %>

  <%= f.submit t('actions.search') %> <%= t("or") %>
  <%= link_to t("cancel"), referential_lines_path(@referential) %>
<% end %>

<% if @q.network_id_eq.present? %>
<p>
  <%= Chouette::Line.human_attribute_name('network') %> : <%= @referential.networks.find(@q.network_id_eq).name %>
</p>
<% end %>

<% if @q.company_id_eq.present? %>
<p>
  <%= Chouette::Line.human_attribute_name('company') %> : <%= @referential.companies.find(@q.company_id_eq).name %>
</p>
<% end %>

<% if @q.group_of_lines_id_eq.present? %>
<p>
  <%= Chouette::Line.human_attribute_name('group_of_line') %> : <%= @referential.group_of_lines.find(@q.group_of_lines_id_eq).name %>
</p>
<% end %>

<div class="page_info">
  <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @lines %>
</div>
<div class="lines paginated_content">
  <%= render :partial => "line", :collection => @lines %>
</div>
<div class="pagination">
  <%= will_paginate @lines, :container => false %>
</div>

<% content_for :sidebar do %>
<ul class="actions">
  <li><%= link_to t('lines.actions.new'), new_referential_line_path(@referential), :class => "add" %></li> 
</ul>

<ul class="actions">
  <li><%= link_to t('lines.actions.import'), new_referential_import_path(@referential), :class => "import" %></li> 
</ul>

<h3><%= t(".selection") %></h3>

<h4><%= Chouette::Company.model_name.human.pluralize %></h4>

<ul class="selection">
<% @referential.companies.each do |company| %>
<li><%= link_with_search company.name, "company_id_eq" => company.id %></li>
<% end %>
<li><%= link_with_search t(".selection_all"), {"company_id_eq" => nil}, :class => "all" %></li>
</ul>

<h4><%= Chouette::Network.model_name.human.pluralize %></h4>

<ul class="selection">
<% @referential.networks.each do |network| %>
<li><%= link_with_search network.name, "network_id_eq" => network.id %></li>
<% end %>
<li><%= link_with_search t(".selection_all"), {"network_id_eq" => nil}, :class => "all" %></li>
</ul>

<% if  @referential.group_of_lines.count > 0 %>
	<h4><%= Chouette::GroupOfLine.model_name.human.pluralize %></h4>
	
	<ul class="selection">
	<% @referential.group_of_lines.each do |group_of_line| %>
	<li><%= link_with_search group_of_line.name, "group_of_lines_id_eq" => group_of_line.id %></li>
	<% end %>
	<li><%= link_with_search t(".selection_all"), {"group_of_lines_id_eq" => nil}, :class => "all" %></li>
	</ul>
<% end %>

<div id="multiple_selection_menu">
  <h3><%= t(".multi_selection") %> </h3>
  <div class="disabled">
    <a class="enable" href="#"><%= t(".multi_selection_enable") %></a>
  </div>

  <div class="enabled" style="display: none;">
    <a class="disable" href="#"><%= t(".multi_selection_disable") %></a>
    
    <ul class="actions">
      <%= link_to t(".delete_selected"), referential_lines_path(@referential), "data-multiple-method" => "delete", :class => "remove" %>
      <li><a href="#" class="export"><%= t(".export_selected") %></a></li>
    </ul>

    <a class="select_all" href="#"><%= t(".select_all") %></a> | <a class="deselect_all" href="#"><%= t(".deselect_all") %></a>
  </div> 
</div>

<% end %>