aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock3
-rw-r--r--app/views/time_tables/_date_fields.erb3
-rw-r--r--app/views/time_tables/show.html.erb44
-rw-r--r--db/schema.rb3
-rw-r--r--spec/requests/time_tables_spec.rb16
6 files changed, 37 insertions, 34 deletions
diff --git a/Gemfile b/Gemfile
index 79a4bdbb1..dbac2f452 100644
--- a/Gemfile
+++ b/Gemfile
@@ -61,7 +61,7 @@ gem 'google-analytics-rails'
gem 'will_paginate', '~> 3.0'
gem 'ransack'
gem 'squeel'
-gem 'ninoxe', :git => 'https://github.com/afimb/ninoxe.git'
+gem 'ninoxe', :git => 'https://github.com/afimb/ninoxe.git', :branch => :sismo
#gem 'ninoxe',:path => '~/projects/ninoxe'
#gem 'ninoxe',:path => '~/workspace/chouette/ninoxe'
#gem 'ninoxe', '~> 1.0.1'
diff --git a/Gemfile.lock b/Gemfile.lock
index 3e4e987b5..848035401 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,7 @@
GIT
remote: https://github.com/afimb/ninoxe.git
- revision: 8e51f48524cfbe4aea48e574a4ba11546cf0f722
+ revision: 7bccab0c74779854062788db98e995f1e4a7f50a
+ branch: sismo
specs:
ninoxe (1.0.1)
activerecord (>= 3.1.3, < 4.0)
diff --git a/app/views/time_tables/_date_fields.erb b/app/views/time_tables/_date_fields.erb
index 5d24456a3..8c6259f3f 100644
--- a/app/views/time_tables/_date_fields.erb
+++ b/app/views/time_tables/_date_fields.erb
@@ -1,4 +1,5 @@
-<%= f.inputs :class => 'dates nested-fields' do %>
+<%= f.inputs :class => 'dates nested-fields' do %>
<%= f.input :date, :as => :date_picker, :label => @time_table.human_attribute_name("date"), :wrapper_html => { :class => 'fl1' }%>
+ <%= f.input :in_out, :as => :hidden, :value => true %>
<%= link_to_remove_association t('actions.destroy'), f %>
<% end %>
diff --git a/app/views/time_tables/show.html.erb b/app/views/time_tables/show.html.erb
index dbc9fe7ec..2f2bda244 100644
--- a/app/views/time_tables/show.html.erb
+++ b/app/views/time_tables/show.html.erb
@@ -2,7 +2,7 @@
<%= title_tag t('time_tables.show.title', :time_table => @time_table.comment )%>
<div class="time_table_show">
-
+
<div class="resume">
<div class="validity <%= time_table_state_code(@time_table) %>"></div>
<label>
@@ -27,17 +27,17 @@
<label><%= @time_table.human_attribute_name("peculiarities") %>:&nbsp;&nbsp;</label>
<% if @time_table.int_day_types & 1536 == 0 %>
<label><%= @time_table.human_attribute_name("none") %></label>
- <% else %>
- <% if @time_table.school_holliday %>
+ <% else %>
+ <% if @time_table.school_holliday %>
<span class='day_type'>&nbsp;<%= @time_table.human_attribute_name("school_holliday") %>&nbsp;</span>
- <% end %>
-
- <% if @time_table.public_holliday %>
+ <% end %>
+
+ <% if @time_table.public_holliday %>
<span class='day_type'>&nbsp;<%= @time_table.human_attribute_name("public_holliday") %>&nbsp;</span>
- <% end %>
-
- <% end %>
-
+ <% end %>
+
+ <% end %>
+
</p>
<p>
<label><%= @time_table.human_attribute_name("objectid") %>: </label>
@@ -49,31 +49,31 @@
<%= image_tag("icons/plus.png" , :class => "switcher", :style => "display: none;") %>
<%= image_tag("icons/minus.png" , :class => "switcher" ) %>
</a>
-
+
</h3>
<div class="calendars content">
<div class="year_choice">
- <span class="previous"> <%= link_to("<", referential_time_table_path(@referential, @time_table, :year => (@year - 1)) ) %> </span>
- <span class="year"> <%= "#{@year}" %> </span>
+ <span class="previous"> <%= link_to("<", referential_time_table_path(@referential, @time_table, :year => (@year - 1)) ) %> </span>
+ <span class="year"> <%= "#{@year}" %> </span>
<span class="next"> <%= link_to(">", referential_time_table_path(@referential, @time_table, :year => (@year + 1)) ) %> </span>
</div>
<div class="calendar_helper">
<%= cal = ""
(1..12).each do |month|
cal << calendar(:year => @year, :month => month, :first_day_of_week => 1) do |d|
- if @time_table.include_in_dates?(d)
- [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "selected_date"}]
+ if @time_table.include_in_overlap_dates?(d)
+ [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "overlap_date"}]
+ elsif @time_table.include_in_dates?(d)
+ [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "selected_date"}]
elsif @time_table.include_in_periods?(d)
- [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "selected_period"}]
- elsif @time_table.include_in_overlap_dates?(d)
- [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "overlap_date"}]
+ [link_to(d.mday, edit_referential_time_table_path(@referential, @time_table) ), {:class => "selected_period"}]
end
end
end
cal.html_safe
%>
- </div>
- </div>
+ </div>
+ </div>
</div>
@@ -82,7 +82,7 @@
<%= 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" %>
@@ -98,7 +98,7 @@
<div class="dates content">
<%= render "dates" %>
</div>
-
+
</div>
<% content_for :sidebar do %>
diff --git a/db/schema.rb b/db/schema.rb
index 0978a437a..70f317878 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20140207162334) do
+ActiveRecord::Schema.define(:version => 20140626081658) do
create_table "access_links", :force => true do |t|
t.integer "access_point_id", :limit => 8
@@ -429,6 +429,7 @@ ActiveRecord::Schema.define(:version => 20140207162334) do
t.integer "time_table_id", :limit => 8, :null => false
t.date "date"
t.integer "position", :null => false
+ t.boolean "in_out"
end
add_index "time_table_dates", ["time_table_id"], :name => "index_time_table_dates_on_time_table_id"
diff --git a/spec/requests/time_tables_spec.rb b/spec/requests/time_tables_spec.rb
index 48bc5f0fd..fbe03db2b 100644
--- a/spec/requests/time_tables_spec.rb
+++ b/spec/requests/time_tables_spec.rb
@@ -13,34 +13,34 @@ describe "TimeTables" do
page.should have_content(time_tables.first.comment)
page.should have_content(time_tables.last.comment)
end
-
- end
- describe "show" do
+ end
+
+ describe "show" do
it "display time_table" do
visit referential_time_tables_path(referential)
click_link "#{time_tables.first.comment}"
page.should have_content(time_tables.first.comment)
end
-
+
end
- describe "new" do
+ describe "new" do
it "creates time_table and return to show" do
visit referential_time_tables_path(referential)
click_link "Ajouter un calendrier"
- fill_in "Description", :with => "TimeTable 1"
+ fill_in "Nom", :with => "TimeTable 1"
fill_in "Identifiant Neptune", :with => "test:Timetable:1"
click_button("Créer Calendrier")
page.should have_content("TimeTable 1")
end
end
- describe "edit and return to show" do
+ describe "edit and return to show" do
it "edit time_table" do
visit referential_time_table_path(referential, subject)
click_link "Modifier ce calendrier"
- fill_in "Description", :with => "TimeTable Modified"
+ fill_in "Nom", :with => "TimeTable Modified"
click_button("Modifier Calendrier")
page.should have_content("TimeTable Modified")
end