diff options
| author | jpl | 2016-08-04 15:36:35 +0200 | 
|---|---|---|
| committer | jpl | 2016-08-04 15:36:35 +0200 | 
| commit | 53c77cf7ad225463f7cbbed5bf7563548de125c1 (patch) | |
| tree | e886cb73bf6f5f5ba19f27f3027eed21316b4974 | |
| parent | 54526c007f4c904ab0edf76768af87bb0f331d71 (diff) | |
| download | chouette-core-53c77cf7ad225463f7cbbed5bf7563548de125c1.tar.bz2 | |
Refs #1295: convert erb to slim (timebands)
| -rw-r--r-- | app/views/timebands/_form.html.erb | 12 | ||||
| -rw-r--r-- | app/views/timebands/_form.html.slim | 9 | ||||
| -rw-r--r-- | app/views/timebands/_sidebar.html.erb | 11 | ||||
| -rw-r--r-- | app/views/timebands/_sidebar.html.slim | 9 | ||||
| -rw-r--r-- | app/views/timebands/edit.html.erb | 3 | ||||
| -rw-r--r-- | app/views/timebands/edit.html.slim | 3 | ||||
| -rw-r--r-- | app/views/timebands/index.html.erb | 29 | ||||
| -rw-r--r-- | app/views/timebands/index.html.slim | 22 | ||||
| -rw-r--r-- | app/views/timebands/new.html.erb | 3 | ||||
| -rw-r--r-- | app/views/timebands/new.html.slim | 3 | ||||
| -rw-r--r-- | app/views/timebands/show.html.erb | 12 | ||||
| -rw-r--r-- | app/views/timebands/show.html.slim | 8 | 
12 files changed, 54 insertions, 70 deletions
| diff --git a/app/views/timebands/_form.html.erb b/app/views/timebands/_form.html.erb deleted file mode 100644 index bfa32212e..000000000 --- a/app/views/timebands/_form.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= semantic_form_for [@referential, @timeband] do |form| %> -  <%= form.inputs do %> -    <%= form.input :name %> -    <%= form.input :start_time %> -    <%= form.input :end_time %> -  <% end %> - -  <%= form.actions do %> -    <%= form.action :submit, :as => :button %> -    <%= form.action :cancel, :as => :link %> -  <% end %> -<% end %> diff --git a/app/views/timebands/_form.html.slim b/app/views/timebands/_form.html.slim new file mode 100644 index 000000000..433d777dc --- /dev/null +++ b/app/views/timebands/_form.html.slim @@ -0,0 +1,9 @@ += semantic_form_for [@referential, @timeband] do |form| +  = form.inputs do +    = form.input :name +    = form.input :start_time +    = form.input :end_time + +  = form.actions do +    = form.action :submit, as: :button +    = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/timebands/_sidebar.html.erb b/app/views/timebands/_sidebar.html.erb deleted file mode 100644 index 8ffa16dca..000000000 --- a/app/views/timebands/_sidebar.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% content_for :sidebar do %> -  <ul class="actions"> -    <li><%= link_to t('timebands.actions.new'), new_referential_timeband_path(@referential), :class => "add" %></li> -    <% if @timeband %> -      <li><%= link_to t('timebands.actions.edit'), edit_referential_timeband_path(@referential, @timeband), :class => "edit" %></li> -      <li><%= link_to t('timebands.actions.destroy'), referential_timeband_path(@referential, @timeband), :method => :delete, :data => {:confirm =>  t('timebands.actions.destroy_confirm')}, :class => "remove" %></li> -    <% end %> -  </ul> -<% end %> - - diff --git a/app/views/timebands/_sidebar.html.slim b/app/views/timebands/_sidebar.html.slim new file mode 100644 index 000000000..07dcebdad --- /dev/null +++ b/app/views/timebands/_sidebar.html.slim @@ -0,0 +1,9 @@ +- content_for :sidebar do +  ul.actions +    li = link_to t('timebands.actions.new'), new_referential_timeband_path(@referential), class: "add" + +    - if @timeband +      li +        = link_to t('timebands.actions.edit'), edit_referential_timeband_path(@referential, @timeband), class: "edit" +      li +        = link_to t('timebands.actions.destroy'), referential_timeband_path(@referential, @timeband), :method => :delete, :data => {:confirm =>  t('timebands.actions.destroy_confirm')}, class: "remove"
\ No newline at end of file diff --git a/app/views/timebands/edit.html.erb b/app/views/timebands/edit.html.erb deleted file mode 100644 index bc2c73ace..000000000 --- a/app/views/timebands/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('timebands.edit.title', timeband: @timeband.name) %> - -<%= render "form" %> diff --git a/app/views/timebands/edit.html.slim b/app/views/timebands/edit.html.slim new file mode 100644 index 000000000..af62ae8db --- /dev/null +++ b/app/views/timebands/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('timebands.edit.title', timeband: @timeband.name) + += render 'form'
\ No newline at end of file diff --git a/app/views/timebands/index.html.erb b/app/views/timebands/index.html.erb deleted file mode 100644 index 54be52675..000000000 --- a/app/views/timebands/index.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<%= title_tag t('timebands.index.title') %> - -<% if @timebands.any? %> -  <table class="table table-striped table-condensed"> -    <thead> -      <tr> -        <th><%= t('activerecord.attributes.timeband.name') %></th> -        <th><%= t('activerecord.attributes.timeband.start_time') %></th> -        <th><%= t('activerecord.attributes.timeband.end_time') %></th> -        <th></th> -      </tr> -    </thead> -    <tbody> -      <% @timebands.each do |timeband| %> -        <tr> -          <td><%= link_to timeband.name, referential_timeband_path(@referential, timeband) %></td> -          <td><%= l(timeband.start_time, format: :hour) %></td> -          <td><%= l(timeband.end_time, format: :hour) %></td> -          <td> -            <%= link_to '', edit_referential_timeband_path(@referential, timeband), :class => "edit" %> -            <%= link_to '', referential_timeband_path(@referential, timeband), :method => :delete, :data => {:confirm =>  t('timebands.actions.destroy_confirm')}, :class => "remove" %> -          </td> -        </tr> -      <% end %> -    </tbody> -  </table> -<% end %> - -<%= render 'sidebar' %> diff --git a/app/views/timebands/index.html.slim b/app/views/timebands/index.html.slim new file mode 100644 index 000000000..c81c0a670 --- /dev/null +++ b/app/views/timebands/index.html.slim @@ -0,0 +1,22 @@ += title_tag t('timebands.index.title') + +- if @timebands.any? +  table.table.table-striped.table-condensed +    thead +      tr +        th = t('activerecord.attributes.timeband.name') +        th = t('activerecord.attributes.timeband.start_time') +        th = t('activerecord.attributes.timeband.end_time') +        th + +    tbody +      - @timebands.each do |timeband| +        tr +          td = link_to timeband.name, referential_timeband_path(@referential, timeband) +          td = l(timeband.start_time, format: :hour) +          td = l(timeband.end_time, format: :hour) +          td +            = link_to '', edit_referential_timeband_path(@referential, timeband), class: "edit" +            = link_to '', referential_timeband_path(@referential, timeband), :method => :delete, :data => {:confirm =>  t('timebands.actions.destroy_confirm')}, class: "remove" + +== render 'sidebar' diff --git a/app/views/timebands/new.html.erb b/app/views/timebands/new.html.erb deleted file mode 100644 index c016325d0..000000000 --- a/app/views/timebands/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('timebands.new.title') %> - -<%= render "form" %> diff --git a/app/views/timebands/new.html.slim b/app/views/timebands/new.html.slim new file mode 100644 index 000000000..90aa1bd2e --- /dev/null +++ b/app/views/timebands/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('timebands.new.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/timebands/show.html.erb b/app/views/timebands/show.html.erb deleted file mode 100644 index 1a6171712..000000000 --- a/app/views/timebands/show.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= title_tag t( 'timebands.show.title', timeband: @timeband.name )%> - -<div class="summary"> -  <p> -    <label><%= @timeband.name %>: </label> -    <%= l(@timeband.start_time, format: :hour) %> -    - -    <%= l(@timeband.end_time, format: :hour) %> -  </p> -</div> - -<%= render 'sidebar' %> diff --git a/app/views/timebands/show.html.slim b/app/views/timebands/show.html.slim new file mode 100644 index 000000000..100457226 --- /dev/null +++ b/app/views/timebands/show.html.slim @@ -0,0 +1,8 @@ += title_tag t( 'timebands.show.title', timeband: @timeband.name ) + +.summary +  p +    label = "#{@timeband.name} : " +    = "#{l(@timeband.start_time, format: :hour)} - #{l(@timeband.end_time, format: :hour)}" +   +== render 'sidebar'
\ No newline at end of file | 
