aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Etienne2012-05-07 14:38:10 +0200
committerMichel Etienne2012-05-07 14:38:10 +0200
commit71ce6186539670f108624949acdfcac79f74303f (patch)
tree5981305c8a10f135b10cc3ac2e5e1dae96a2e3d6
parent96d5d1014fe99f51edb1b3fbb207bfd1825d2d4a (diff)
downloadchouette-core-71ce6186539670f108624949acdfcac79f74303f.tar.bz2
prepare edit timetable with cocoon
-rw-r--r--Gemfile.lock2
-rw-r--r--app/assets/stylesheets/time_tables.css.scss19
-rw-r--r--app/views/time_tables/_date_fields.erb10
-rw-r--r--app/views/time_tables/_form.erb32
-rw-r--r--app/views/time_tables/_period_fields.erb12
5 files changed, 44 insertions, 31 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 47e385c2e..d8e89e12b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -160,7 +160,7 @@ GEM
jruby-openssl (0.7.6.1)
bouncy-castle-java (>= 1.5.0146.1)
jruby-rack (1.1.5)
- json (1.7.0-java)
+ json (1.7.1-java)
launchy (2.1.0)
addressable (~> 2.2.6)
launchy (2.1.0-java)
diff --git a/app/assets/stylesheets/time_tables.css.scss b/app/assets/stylesheets/time_tables.css.scss
index e27920037..ba771262e 100644
--- a/app/assets/stylesheets/time_tables.css.scss
+++ b/app/assets/stylesheets/time_tables.css.scss
@@ -89,8 +89,10 @@
padding: 0 10% 0 15%;
width: auto;
}
- .period_add {
- padding: 0 0 0 25%;
+ .links {
+ margin-left: 25%;
+ padding-left: 20px;
+ background: url(image-path('user_interface/ui/add.png')) no-repeat;
}
.dates ol {
float: left;
@@ -112,9 +114,6 @@
padding: 0 10% 0 15%;
width: auto;
}
- .date_add {
- padding: 0 0 0 25%;
- }
}
#workspace.time_tables.new
@@ -160,8 +159,10 @@
padding: 0 10% 0 15%;
width: auto;
}
- .period_add {
- padding: 0 0 0 25%;
+ .links {
+ margin-left: 25%;
+ padding-left: 20px;
+ background: url(image-path('user_interface/ui/add.png')) no-repeat;
}
.dates ol {
float: left;
@@ -183,8 +184,4 @@
padding: 0 10% 0 15%;
width: auto;
}
- .date_add {
- padding: 0 0 0 25%;
- }
-
}
diff --git a/app/views/time_tables/_date_fields.erb b/app/views/time_tables/_date_fields.erb
index f08376c70..7ecc58fc5 100644
--- a/app/views/time_tables/_date_fields.erb
+++ b/app/views/time_tables/_date_fields.erb
@@ -1,4 +1,6 @@
-<%= f.inputs :class => 'dates' do %>
- <%= f.input :date, :as => :date , :label => @time_table.human_attribute_name("date")%>
- <%= link_to_remove_association t('actions.destroy'), f %>
-<% end %>
+<div class='nested-fields'>
+ <%= f.inputs :class => 'dates' do %>
+ <%= f.input :date, :as => :date , :label => @time_table.human_attribute_name("date")%>
+ <%= link_to_remove_association t('actions.destroy'), f %>
+ <% end %>
+</div> \ No newline at end of file
diff --git a/app/views/time_tables/_form.erb b/app/views/time_tables/_form.erb
index d5a1e044d..777dd9c18 100644
--- a/app/views/time_tables/_form.erb
+++ b/app/views/time_tables/_form.erb
@@ -23,17 +23,27 @@
</li>
<% end %>
<% end %>
-
- <label><%= @time_table.human_attribute_name("periods") %>: </label>
- <%= form.semantic_fields_for :periods do |period| %>
- <%= render 'period_fields', :f => period %>
- <% end %>
+<!--
+ <div id='periods'>
+ <label><%= @time_table.human_attribute_name("periods") %>: </label>
+ <%= form.semantic_fields_for :periods do |period| %>
+ <%= render 'period_fields', :f => period %>
+ <% end %>
+ <div class='links'>
+ <%= link_to_add_association t('time_tables.edit.add_period'), form, :periods %>
+ </div>
+ </div>
<p/>
- <label><%= @time_table.human_attribute_name("dates") %>: </label>
- <%= form.semantic_fields_for :dates do |date| %>
- <%= render 'date_fields', :f => date %>
- <% end %>
-
+ <div id='dates'>
+ <label><%= @time_table.human_attribute_name("dates") %>: </label>
+ <%= form.semantic_fields_for :dates do |date| %>
+ <%= render 'date_fields', :f => date %>
+ <% end %>
+ <div class='links'>
+ <%= link_to_add_association t('time_tables.edit.add_date'), form, :dates %>
+ </div>
+ </div>
+-->
<%= form.buttons do %>
<%= form.commit_button %>
<li><%= t('or') %></li>
@@ -41,11 +51,13 @@
<% end %>
<% end %>
+<!--
<% content_for :sidebar do %>
<ul class="actions">
<li><%= link_to_add_association t('time_tables.edit.add_period'), form, :periods %></li>
<li><%= link_to_add_association t('time_tables.edit.add_date'), form, :dates %></li>
<br>
</ul>
+-->
<% end %>
diff --git a/app/views/time_tables/_period_fields.erb b/app/views/time_tables/_period_fields.erb
index 615a6f6f1..8c42d8264 100644
--- a/app/views/time_tables/_period_fields.erb
+++ b/app/views/time_tables/_period_fields.erb
@@ -1,5 +1,7 @@
-<%= f.inputs :class => 'periods' do %>
- <%= f.input :period_start, :as => :date , :label => @time_table.human_attribute_name("period_start")%>
- <%= f.input :period_end, :as => :date , :label => @time_table.human_attribute_name("period_end")%>
- <%= link_to_remove_association t('actions.destroy'), f %>
-<% end %>
+<div class='nested-fields'>
+ <%= f.inputs :class => 'periods' do %>
+ <%= f.input :period_start, :as => :date , :label => @time_table.human_attribute_name("period_start")%>
+ <%= f.input :period_end, :as => :date , :label => @time_table.human_attribute_name("period_end")%>
+ <%= link_to_remove_association t('actions.destroy'), f %>
+ <% end %>
+</div>