diff options
| author | Bruno Perles | 2015-10-28 11:35:08 +0100 | 
|---|---|---|
| committer | Bruno Perles | 2015-10-28 11:35:08 +0100 | 
| commit | 5b4136b2907ffc918210495d8f9a29c1e7d681fb (patch) | |
| tree | 6b73ff915c90d450572f5eb9599d3bc0d8938678 /app/views | |
| parent | 843bec92850de6f4b46498611842f894a78e7d3d (diff) | |
| download | chouette-core-5b4136b2907ffc918210495d8f9a29c1e7d681fb.tar.bz2 | |
Merge Timeband feature and revert Gemfile
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/help/timebands.textile | 0 | ||||
| -rw-r--r-- | app/views/shared/_header.erb | 4 | ||||
| -rw-r--r-- | app/views/timebands/_form.html.erb | 12 | ||||
| -rw-r--r-- | app/views/timebands/_sidebar.html.erb | 11 | ||||
| -rw-r--r-- | app/views/timebands/edit.html.erb | 3 | ||||
| -rw-r--r-- | app/views/timebands/index.html.erb | 29 | ||||
| -rw-r--r-- | app/views/timebands/new.html.erb | 3 | ||||
| -rw-r--r-- | app/views/timebands/show.html.erb | 12 | 
8 files changed, 74 insertions, 0 deletions
| diff --git a/app/views/help/timebands.textile b/app/views/help/timebands.textile new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/help/timebands.textile diff --git a/app/views/shared/_header.erb b/app/views/shared/_header.erb index d1e8dd2ce..1e8a63fba 100644 --- a/app/views/shared/_header.erb +++ b/app/views/shared/_header.erb @@ -65,6 +65,10 @@                 <span class="badge pull-right"><%= @referential.time_tables.size %></span><%= Referential.human_attribute_name("time_tables") %>                <% end %>              </li> +            <li><%= link_to referential_timebands_path(@referential) do %> +                <span class="badge pull-right"><%= @referential.timebands.size %></span><%= Referential.human_attribute_name("timebands") %> +              <% end %> +            </li>            </ul>          </li>          <li><%= link_to Referential.human_attribute_name("imports"), referential_imports_path(@referential) %></li> diff --git a/app/views/timebands/_form.html.erb b/app/views/timebands/_form.html.erb new file mode 100644 index 000000000..bfa32212e --- /dev/null +++ b/app/views/timebands/_form.html.erb @@ -0,0 +1,12 @@ +<%= 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/_sidebar.html.erb b/app/views/timebands/_sidebar.html.erb new file mode 100644 index 000000000..8ffa16dca --- /dev/null +++ b/app/views/timebands/_sidebar.html.erb @@ -0,0 +1,11 @@ +<% 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/edit.html.erb b/app/views/timebands/edit.html.erb new file mode 100644 index 000000000..bc2c73ace --- /dev/null +++ b/app/views/timebands/edit.html.erb @@ -0,0 +1,3 @@ +<%= title_tag t('timebands.edit.title', timeband: @timeband.name) %> + +<%= render "form" %> diff --git a/app/views/timebands/index.html.erb b/app/views/timebands/index.html.erb new file mode 100644 index 000000000..54be52675 --- /dev/null +++ b/app/views/timebands/index.html.erb @@ -0,0 +1,29 @@ +<%= 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/new.html.erb b/app/views/timebands/new.html.erb new file mode 100644 index 000000000..c016325d0 --- /dev/null +++ b/app/views/timebands/new.html.erb @@ -0,0 +1,3 @@ +<%= title_tag t('timebands.new.title') %> + +<%= render "form" %> diff --git a/app/views/timebands/show.html.erb b/app/views/timebands/show.html.erb new file mode 100644 index 000000000..1a6171712 --- /dev/null +++ b/app/views/timebands/show.html.erb @@ -0,0 +1,12 @@ +<%= 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' %> | 
