afimb/chouette2

View on GitHub
app/views/lines/index.html.erb

Summary

Maintainability
Test Coverage
<%= title_tag t('lines.index.title') %>

<%= search_form_for @q, :url => referential_lines_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %>
<div class="panel panel-default">
  <div class="panel-heading">
    <div class="input-group col-md-9">
      <%= f.text_field :name_or_number_cont, :placeholder => "#{t('.name_or_number')}", :class => 'form-control' %>
      <div class="input-group-btn">
        <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
      </div>
    </div><!-- /input-group -->
    <a data-toggle="collapse" data-parent="#search" href="#advanced_search">
      <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %>
    </a>
  </div>

  <div id="advanced_search" class="panel-collapse collapse">
    <div class="panel-body">
      <%= f.select(:network_id_eq, @referential.networks.collect {|n| [ n.name, n.id ] }.unshift([t('.no_networks'), -1]), {include_blank: t('.all_networks')}, { :class => 'form-control' }) %>
      <%= f.select(:company_id_eq, @referential.companies.collect {|c| [ c.name, c.id ] }.unshift([t('.no_companies'), -1]), { include_blank: t('.all_companies')}, { :class => 'form-control' }) %>
      <%= f.select(:group_of_lines_id_eq, @referential.group_of_lines.collect {|c| [ c.name, c.id ] }.unshift([t('.no_group_of_lines'), -1]), {include_blank: t('.all_group_of_lines')}, { :class => 'form-control' }) %>
    </div>
  </div>
</div>
<% end %>

<div id="lines"><%= render 'lines' %></div>

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

<div id="multiple_selection_menu">
  <h4><%= t(".multi_selection") %> </h4>
  <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", "confirmation-text" => t("lines.actions.destroy_selection_confirm") %>
    </ul>

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

<% end %>