diff options
| author | Alban Peignier | 2016-05-13 11:56:54 +0200 | 
|---|---|---|
| committer | Alban Peignier | 2016-05-13 11:56:54 +0200 | 
| commit | 6e28e49262ede9c57a6c5726570a4921f4b63d04 (patch) | |
| tree | 31a26a03e2c1dd3af796c9854918d112ad6e97c8 /app/views/group_of_lines | |
| parent | 781142afdb90bb0ca62783435f582725794f4f57 (diff) | |
| download | chouette-core-6e28e49262ede9c57a6c5726570a4921f4b63d04.tar.bz2 | |
Refactor models and controllers to manage Lines in LineReferential. Refs #825
Diffstat (limited to 'app/views/group_of_lines')
| -rw-r--r-- | app/views/group_of_lines/_form.erb | 8 | ||||
| -rw-r--r-- | app/views/group_of_lines/_group_of_line.erb | 14 | ||||
| -rw-r--r-- | app/views/group_of_lines/index.html.erb | 10 | ||||
| -rw-r--r-- | app/views/group_of_lines/show.html.erb | 8 | 
4 files changed, 20 insertions, 20 deletions
| diff --git a/app/views/group_of_lines/_form.erb b/app/views/group_of_lines/_form.erb index 0f92897ca..d8417466a 100644 --- a/app/views/group_of_lines/_form.erb +++ b/app/views/group_of_lines/_form.erb @@ -1,7 +1,7 @@ -<%= semantic_form_for [@referential, @group_of_line] do |form| %> +<%= semantic_form_for [@line_referential, @group_of_line] do |form| %>    <%= form.inputs do %> -    <%= form.input :name, :input_html => {  :title => I18n.t("formtastic.titles#{format_restriction_for_locales(@referential)}.group_of_line.name") } %> -    <%= form.input :registration_number, :input_html => {  :title => I18n.t("formtastic.titles#{format_restriction_for_locales(@referential)}.group_of_line.registration_number") } %> +    <%= form.input :name, :input_html => {  :title => I18n.t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.group_of_line.name") } %> +    <%= form.input :registration_number, :input_html => {  :title => I18n.t("formtastic.titles#{format_restriction_for_locales(@line_referential)}.group_of_line.registration_number") } %>      <%= form.input :comment %>      <%= form.input :objectid, :required => !@group_of_line.new_record?, :input_html => {  :title => I18n.t("formtastic.titles#{format_restriction_for_locales(@referential)}.group_of_line.objectid") } %>    <% end %> @@ -18,7 +18,7 @@  <script>    $(function() { -    $( "#group_of_line_line_tokens" ).tokenInput('<%= name_filter_referential_lines_path(@referential, :format => :json) %>', { +    $( "#group_of_line_line_tokens" ).tokenInput('<%= name_filter_referential_lines_path(@line_referential, :format => :json) %>', {         crossDomain: false,         prePopulate: $('#line_tokens').data('pre'),         minChars: 1, diff --git a/app/views/group_of_lines/_group_of_line.erb b/app/views/group_of_lines/_group_of_line.erb index 98a1e03d2..c88a3835b 100644 --- a/app/views/group_of_lines/_group_of_line.erb +++ b/app/views/group_of_lines/_group_of_line.erb @@ -1,24 +1,24 @@  <div id="index_item" class="panel panel-default">    <div class="panel-heading">      <div class="panel-title clearfix"> -      <span class="pull-right">                 -        <%= link_to edit_referential_group_of_line_path(@referential, group_of_line), :class => "btn btn-default btn-sm" do %> +      <span class="pull-right"> +        <%= link_to edit_referential_group_of_line_path(@line_referential, group_of_line), :class => "btn btn-default btn-sm" do %>            <span class="fa fa-pencil"></span>          <% end if edit %> -        <%= link_to('<span class="fa fa-trash-o"></span>'.html_safe, referential_group_of_line_path(@referential, group_of_line), :method => :delete, :data => {:confirm =>  t('group_of_lines.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm") if delete %>          +        <%= link_to('<span class="fa fa-trash-o"></span>'.html_safe, line_referential_group_of_line_path(@line_referential, group_of_line), :method => :delete, :data => {:confirm =>  t('group_of_lines.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm") if delete %>        </span>        <h5> -        <%= link_to([@referential, group_of_line], :class => "preview", :title => "#{Chouette::GroupOfLine.model_name.human.capitalize} #{group_of_line.name}") do %>         +        <%= link_to([@line_referential, group_of_line], :class => "preview", :title => "#{Chouette::GroupOfLine.model_name.human.capitalize} #{group_of_line.name}") do %>          <span class="name"> -          <%= truncate(group_of_line.name, :length => 20) %>           +          <%= truncate(group_of_line.name, :length => 20) %>          </span>          <% end %>        </h5> -    </div>                           +    </div>    </div>    <div class="panel-body">      <p> -    <%= group_of_line.human_attribute_name('line_count') %> <%=  group_of_line.lines.count %>    +    <%= group_of_line.human_attribute_name('line_count') %> <%=  group_of_line.lines.count %>      </p>    </div>  </div> diff --git a/app/views/group_of_lines/index.html.erb b/app/views/group_of_lines/index.html.erb index 2257096bd..0f34128f4 100644 --- a/app/views/group_of_lines/index.html.erb +++ b/app/views/group_of_lines/index.html.erb @@ -1,9 +1,9 @@ -<%= title_tag t('group_of_lines.index.title') %>  +<%= title_tag t('group_of_lines.index.title') %> -<%= search_form_for @q, :url => referential_group_of_lines_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> +<%= search_form_for @q, :url => referential_group_of_lines_path(@line_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-12">    +  <div class="panel-heading"> +    <div class="input-group col-md-12">        <%= f.text_field :name_cont, :placeholder => "#{t('.name')}", :class => "form-control" %>        <div class="input-group-btn">          <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> @@ -20,7 +20,7 @@  <% content_for :sidebar do %>  <ul class="actions"> -  <li><%= link_to t('group_of_lines.actions.new'), new_referential_group_of_line_path(@referential), :class => "add" %></li> +  <li><%= link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), :class => "add" %></li>    <br>  </ul>  <% end %> diff --git a/app/views/group_of_lines/show.html.erb b/app/views/group_of_lines/show.html.erb index 3369f284d..557d8c82b 100644 --- a/app/views/group_of_lines/show.html.erb +++ b/app/views/group_of_lines/show.html.erb @@ -12,7 +12,7 @@        <%= @group_of_line.comment %>      </p>    </div> -   +    <p class="after_map" />    <h3 class="group_of_line_lines"><%= t('.lines') %></h3>    <div class="lines_detail"> @@ -22,9 +22,9 @@  <% content_for :sidebar do %>  <ul class="actions"> -  <li><%= link_to t('group_of_lines.actions.new'), new_referential_group_of_line_path(@referential), :class => "add" %></li> -  <li><%= link_to t('group_of_lines.actions.edit'), edit_referential_group_of_line_path(@referential, @group_of_line), :class => "edit" %></li> -  <li><%= link_to  t('group_of_lines.actions.destroy'), referential_group_of_line_path(@referential, @group_of_line), :method => :delete, :data => {:confirm =>  t('group_of_lines.actions.destroy_confirm')} , :class => "remove" %></li> +  <li><%= link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), :class => "add" %></li> +  <li><%= link_to t('group_of_lines.actions.edit'), edit_line_referential_group_of_line_path(@line_referential, @group_of_line), :class => "edit" %></li> +  <li><%= link_to  t('group_of_lines.actions.destroy'), line_referential_group_of_line_path(@line_referential, @group_of_line), :method => :delete, :data => {:confirm =>  t('group_of_lines.actions.destroy_confirm')} , :class => "remove" %></li>    <br>  </ul>    <%= creation_tag(@group_of_line) %> | 
