aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorMarc Florisson2012-10-03 09:37:09 +0200
committerMarc Florisson2012-10-03 09:37:09 +0200
commit04835501dbf267b2046d24e65400e23c927d4ab3 (patch)
tree52e218503aa75a083c498a83fea3fe11e0077218 /app/views
parent159e9c1ee586cf48cd2150f64d825a1580d79225 (diff)
parent7d447652d1adf357ce9fd1c89a5fa8fda638608e (diff)
downloadchouette-core-04835501dbf267b2046d24e65400e23c927d4ab3.tar.bz2
Merge branch 'master' of chouette.dryade.priv:/srv/git/chouette2
Diffstat (limited to 'app/views')
-rw-r--r--app/views/exports/index.html.erb2
-rw-r--r--app/views/file_validations/index.html.erb2
-rw-r--r--app/views/imports/index.html.erb2
-rw-r--r--app/views/time_tables/_date_fields.erb4
-rw-r--r--app/views/time_tables/_dates.html.erb4
-rw-r--r--app/views/time_tables/_form.erb37
-rw-r--r--app/views/time_tables/_period_fields.erb5
-rw-r--r--app/views/time_tables/_periods.html.erb3
-rw-r--r--app/views/time_tables/show.html.erb27
9 files changed, 70 insertions, 16 deletions
diff --git a/app/views/exports/index.html.erb b/app/views/exports/index.html.erb
index 25db2e1ba..b7847b70e 100644
--- a/app/views/exports/index.html.erb
+++ b/app/views/exports/index.html.erb
@@ -1,5 +1,5 @@
<%= title_tag t('.title') %>
-
+<div class="warning"><%= t('.warning') %> </div>
<div class="page_info">
<span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @exports %>
</div>
diff --git a/app/views/file_validations/index.html.erb b/app/views/file_validations/index.html.erb
index e1416fa96..2e0cefbe8 100644
--- a/app/views/file_validations/index.html.erb
+++ b/app/views/file_validations/index.html.erb
@@ -1,5 +1,5 @@
<%= title_tag t('.title') %>
-
+<div class="warning"><%= t('.warning') %> </div>
<div class="pagination">
<div class="page_info">
<%= page_entries_info @file_validations %>
diff --git a/app/views/imports/index.html.erb b/app/views/imports/index.html.erb
index 7e0d366a3..8469fbd7b 100644
--- a/app/views/imports/index.html.erb
+++ b/app/views/imports/index.html.erb
@@ -1,5 +1,5 @@
<%= title_tag t('.title') %>
-
+<div class="warning"><%= t('.warning') %> </div>
<div class="page_info">
<span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @imports %>
</div>
diff --git a/app/views/time_tables/_date_fields.erb b/app/views/time_tables/_date_fields.erb
new file mode 100644
index 000000000..5d24456a3
--- /dev/null
+++ b/app/views/time_tables/_date_fields.erb
@@ -0,0 +1,4 @@
+<%= f.inputs :class => 'dates nested-fields' do %>
+ <%= f.input :date, :as => :date_picker, :label => @time_table.human_attribute_name("date"), :wrapper_html => { :class => 'fl1' }%>
+ <%= link_to_remove_association t('actions.destroy'), f %>
+<% end %>
diff --git a/app/views/time_tables/_dates.html.erb b/app/views/time_tables/_dates.html.erb
index 47ae01710..663efec58 100644
--- a/app/views/time_tables/_dates.html.erb
+++ b/app/views/time_tables/_dates.html.erb
@@ -1,10 +1,6 @@
<ul class='dates'>
<% @time_table.dates.each do |tmd| %>
<li class="<%= (tmd.position%2==0) ? 'odd' : 'even' %>"><%= l tmd.date %>
- <div class="actions">
- <%= link_to t("actions.destroy"), referential_time_table_time_table_date_path(@referential, @time_table,tmd), :method => :delete, :confirm => t('time_tables.actions.destroy_date_confirm'), :class => "remove" %>
- </div>
-
</li>
<% end %>
</ul>
diff --git a/app/views/time_tables/_form.erb b/app/views/time_tables/_form.erb
index fbced7bd4..3325b97a5 100644
--- a/app/views/time_tables/_form.erb
+++ b/app/views/time_tables/_form.erb
@@ -17,6 +17,43 @@
<%= form.input :objectid, :required => !@time_table.new_record?, :input_html => { :disabled => !@time_table.new_record? } %>
<% end %>
+ <h3 class="time_table_dates">
+ <a class="dates"><%= @time_table.human_attribute_name("dates") %>
+ <%= image_tag("icons/plus.png" , :class => "switcher", :style => "display: none;") %>
+ <%= image_tag("icons/minus.png" , :class => "switcher" ) %>
+ </a>
+ </h3>
+
+ <div class="dates content" id="dates_content">
+ <div id="dates">
+ <%= form.semantic_fields_for :dates do |p| %>
+ <%= render "date_fields", :f => p %>
+ <% end %>
+ </div>
+ <%= link_to_add_association t("time_tables.actions.add_date"), form, :dates ,
+ :"data-association-insertion-method" => "append",
+ :"data-association-insertion-node" => "div#dates" %>
+ </div>
+
+
+ <h3 class="time_table_periods">
+ <a class="periods"><%= @time_table.human_attribute_name("periods") %>
+ <%= image_tag("icons/plus.png" , :class => "switcher", :style => "display: none;") %>
+ <%= image_tag("icons/minus.png" , :class => "switcher" ) %>
+ </a>
+
+ </h3>
+ <div class="periods content" id="periods_content">
+ <div id="periods">
+ <%= form.semantic_fields_for :periods do |p| %>
+ <%= render "period_fields", :f => p %>
+ <% end %>
+ </div>
+ <%= link_to_add_association t("time_tables.actions.add_period"), form, :periods ,
+ :"data-association-insertion-method" => "append",
+ :"data-association-insertion-node" => "div#periods"%>
+ </div>
+ <p/>
<%= form.actions do %>
<%= form.action :submit, :as => :button %>
<%= form.action :cancel, :as => :link %>
diff --git a/app/views/time_tables/_period_fields.erb b/app/views/time_tables/_period_fields.erb
new file mode 100644
index 000000000..120a526bb
--- /dev/null
+++ b/app/views/time_tables/_period_fields.erb
@@ -0,0 +1,5 @@
+<%= f.inputs :class => 'periods nested-fields' do %>
+ <%= f.input :period_start, :as => :date_picker, :label => @time_table.human_attribute_name("period_start"), :wrapper_html => { :class => 'fl1' }%>
+ <%= f.input :period_end, :as => :date_picker, :label => @time_table.human_attribute_name("period_end"), :wrapper_html => { :class => 'fl2' }%>
+ <%= link_to_remove_association t('actions.destroy'), f %>
+<% end %>
diff --git a/app/views/time_tables/_periods.html.erb b/app/views/time_tables/_periods.html.erb
index 9f3974735..1f0aea057 100644
--- a/app/views/time_tables/_periods.html.erb
+++ b/app/views/time_tables/_periods.html.erb
@@ -1,9 +1,6 @@
<ul class='periods'>
<% @time_table.periods.each do |tmp| %>
<li class='period'><%= t('time_tables.show.from')%> <%= l tmp.period_start %> <%= t('time_tables.show.to')%> <%= l tmp.period_end %>
- <div class="actions">
- <%= link_to t("actions.destroy"), referential_time_table_time_table_period_path(@referential, @time_table,tmp), :method => :delete, :confirm => t('time_tables.actions.destroy_period_confirm'), :class => "remove" %>
- </div>
</li>
<% end %>
</ul>
diff --git a/app/views/time_tables/show.html.erb b/app/views/time_tables/show.html.erb
index 60eee8d04..3536dedae 100644
--- a/app/views/time_tables/show.html.erb
+++ b/app/views/time_tables/show.html.erb
@@ -70,18 +70,33 @@
<%= @time_table.creator_id %>
</p>
</div>
- <h3 class="dates"><%= t('.dates') %></h3>
- <%= render "dates" %>
- <h3 class="periods"><%= t('.periods') %></h3>
- <%= render "periods" %>
+ <h3 class="time_table_dates">
+ <a class="dates"><%= @time_table.human_attribute_name("dates") %>
+ <%= image_tag("icons/plus.png" , :class => "switcher", :style => "display: none;") %>
+ <%= image_tag("icons/minus.png" , :class => "switcher" ) %>
+ </a>
+ </h3>
+
+ <div class="dates content">
+ <%= render "dates" %>
+ </div>
+
+ <h3 class="time_table_periods">
+ <a class="periods"><%= @time_table.human_attribute_name("periods") %>
+ <%= image_tag("icons/plus.png" , :class => "switcher", :style => "display: none;") %>
+ <%= image_tag("icons/minus.png" , :class => "switcher" ) %>
+ </a>
+
+ </h3>
+ <div class="periods content">
+ <%= render "periods" %>
+ </div>
</div>
<% content_for :sidebar do %>
<ul class="actions">
<li><%= link_to t('time_tables.actions.edit'), edit_referential_time_table_path(@referential, @time_table), :class => "edit" %></li>
<li><%= link_to t('time_tables.actions.destroy'), referential_time_table_path(@referential, @time_table), :method => :delete, :confirm => t('time_tables.actions.destroy_confirm'), :class => "remove" %></li>
- <li><%= link_to t('time_tables.show.add_date'), new_referential_time_table_time_table_date_path(@referential, @time_table), :class => 'add' %></li>
- <li><%= link_to t('time_tables.show.add_period'), new_referential_time_table_time_table_period_path(@referential, @time_table), :class => 'add' %></li>
<br>
</ul>
<% end %>