Browse Source

base de l'application

* Affichage des ressources
* Affichage des évènements
* Affichage des réservations
* Partie d'administration protégée
master
François Vaux 10 years ago
parent
commit
8d3dad9b8c
87 changed files with 13975 additions and 0 deletions
  1. +10
    -0
      Rakefile
  2. +10
    -0
      app/controllers/application_controller.rb
  3. +2
    -0
      app/controllers/bookings_controller.rb
  4. +37
    -0
      app/controllers/events_controller.rb
  5. +53
    -0
      app/controllers/items_controller.rb
  6. +3
    -0
      app/helpers/application_helper.rb
  7. +2
    -0
      app/helpers/bookings_helper.rb
  8. +2
    -0
      app/helpers/events_helper.rb
  9. +13
    -0
      app/helpers/item_helper.rb
  10. +2
    -0
      app/helpers/items_helper.rb
  11. +18
    -0
      app/models/booking.rb
  12. +25
    -0
      app/models/event.rb
  13. +39
    -0
      app/models/item.rb
  14. +5
    -0
      app/views/bookings/_booking.html.erb
  15. +7
    -0
      app/views/events/_event.html.erb
  16. +111
    -0
      app/views/items/_calendar.html.erb
  17. +27
    -0
      app/views/items/_item.html.erb
  18. +14
    -0
      app/views/items/_time_picker.html.erb
  19. +5
    -0
      app/views/items/index.html.erb
  20. +6
    -0
      app/views/items/public_edit.html.erb
  21. +5
    -0
      app/views/items/public_index.html.erb
  22. +60
    -0
      app/views/items/show.html.erb
  23. +18
    -0
      app/views/layouts/application.html.erb
  24. +110
    -0
      config/boot.rb
  25. +22
    -0
      config/database.yml
  26. +52
    -0
      config/environment.rb
  27. +17
    -0
      config/environments/development.rb
  28. +28
    -0
      config/environments/production.rb
  29. +28
    -0
      config/environments/test.rb
  30. +7
    -0
      config/initializers/backtrace_silencers.rb
  31. +10
    -0
      config/initializers/inflections.rb
  32. +5
    -0
      config/initializers/mime_types.rb
  33. +21
    -0
      config/initializers/new_rails_defaults.rb
  34. +15
    -0
      config/initializers/session_store.rb
  35. +5
    -0
      config/locales/en.yml
  36. +50
    -0
      config/routes.rb
  37. BIN
      db/development.sqlite3
  38. +15
    -0
      db/migrate/20100722152749_create_items.rb
  39. +16
    -0
      db/migrate/20100722153153_create_events.rb
  40. +15
    -0
      db/migrate/20100722153250_create_bookings.rb
  41. +39
    -0
      db/schema.rb
  42. +7
    -0
      db/seeds.rb
  43. +2
    -0
      doc/README_FOR_APP
  44. +25
    -0
      lib/tasks/evoresa.rake
  45. +4702
    -0
      log/development.log
  46. +0
    -0
      log/production.log
  47. +0
    -0
      log/server.log
  48. +0
    -0
      log/test.log
  49. +30
    -0
      public/404.html
  50. +30
    -0
      public/422.html
  51. +30
    -0
      public/500.html
  52. +0
    -0
      public/favicon.ico
  53. BIN
      public/images/gradient.png
  54. BIN
      public/images/help.png
  55. +2
    -0
      public/javascripts/application.js
  56. +963
    -0
      public/javascripts/controls.js
  57. +973
    -0
      public/javascripts/dragdrop.js
  58. +1128
    -0
      public/javascripts/effects.js
  59. +4320
    -0
      public/javascripts/prototype.js
  60. +5
    -0
      public/robots.txt
  61. +281
    -0
      public/stylesheets/main.css
  62. +368
    -0
      public/stylesheets/main.scss
  63. +7
    -0
      public/stylesheets/reset-min.css
  64. +4
    -0
      script/about
  65. +3
    -0
      script/console
  66. +3
    -0
      script/dbconsole
  67. +3
    -0
      script/destroy
  68. +3
    -0
      script/generate
  69. +3
    -0
      script/performance/benchmarker
  70. +3
    -0
      script/performance/profiler
  71. +3
    -0
      script/plugin
  72. +3
    -0
      script/runner
  73. +3
    -0
      script/server
  74. +11
    -0
      test/fixtures/bookings.yml
  75. +13
    -0
      test/fixtures/events.yml
  76. +11
    -0
      test/fixtures/items.yml
  77. +8
    -0
      test/functional/bookings_controller_test.rb
  78. +8
    -0
      test/functional/events_controller_test.rb
  79. +8
    -0
      test/functional/items_controller_test.rb
  80. +9
    -0
      test/performance/browsing_test.rb
  81. +38
    -0
      test/test_helper.rb
  82. +8
    -0
      test/unit/booking_test.rb
  83. +8
    -0
      test/unit/event_test.rb
  84. +4
    -0
      test/unit/helpers/bookings_helper_test.rb
  85. +4
    -0
      test/unit/helpers/events_helper_test.rb
  86. +4
    -0
      test/unit/helpers/items_helper_test.rb
  87. +8
    -0
      test/unit/item_test.rb

+ 10
- 0
Rakefile View File

@ -0,0 +1,10 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'

+ 10
- 0
app/controllers/application_controller.rb View File

@ -0,0 +1,10 @@
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
# filter_parameter_logging :password
end

+ 2
- 0
app/controllers/bookings_controller.rb View File

@ -0,0 +1,2 @@
class BookingsController < ApplicationController
end

+ 37
- 0
app/controllers/events_controller.rb View File

@ -0,0 +1,37 @@
class EventsController < ApplicationController
# GET /:key/event/:id/edit
def edit
end
# POST /:key/event/add
def create
@item = Item.find_by_key(params[:key])
dates = params[:event].delete(:dates)
e = Event.new(params[:event].merge(:item => @item))
if e.valid?
dates = extract_dates(dates)
p dates
else
flash[:errors] = ""
e.errors.each do |attr,msg|
flash[:errors] += "<li>#{msg}</li>"
end
redirect_to item_path(:key => @item.key)
end
end
# PUT /:key/event/:id
def update
end
# DELETE /:key/event/:id
def delete
end
private
def extract_dates(text)
text.each_line.to_a
end
end

+ 53
- 0
app/controllers/items_controller.rb View File

@ -0,0 +1,53 @@
class ItemsController < ApplicationController
before_filter :set_date
# GET /
def index
render :action => 'public_index' unless session[:authorized]
@items = Item.find(:all, :include => [:events])
end
# GET /:key
def show
@item = Item.find_by_key(params[:key])
end
# GET /new
def new
end
# GET /:key/edit
def edit
render :action => 'public_edit' unless session[:authorized]
end
# POST /
def create
end
# PUT /:key
def update
end
# DELETE /:key
def delete
end
# GET /authentify
def authentify
if params[:secret] == ADMIN_SECRET_KEY
session[:authorized] = true
end
redirect_to '/'
end
private
def set_date
@date = begin
Date.strptime(params[:date], '%d/%m/%Y')
rescue ArgumentError, TypeError
Date.today
end
end
end

+ 3
- 0
app/helpers/application_helper.rb View File

@ -0,0 +1,3 @@
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end

+ 2
- 0
app/helpers/bookings_helper.rb View File

@ -0,0 +1,2 @@
module BookingsHelper
end

+ 2
- 0
app/helpers/events_helper.rb View File

@ -0,0 +1,2 @@
module EventsHelper
end

+ 13
- 0
app/helpers/item_helper.rb View File

@ -0,0 +1,13 @@
module ItemHelper
def default_dates
[ @date.strftime('%d/%m/%Y'), hour(+0), hour(+1) ].join(' ')
end
def hour(hdelta)
t = Time.now + (hdelta*3600)
q = ((t.min / 60.0) * 4).ceil / 4.0 * 60
hour = (q == 60 ? t.hour + 1 : t.hour).round
min = (q == 60 ? 0 : q ).round
"%02d:%02d" % [hour, min]
end
end

+ 2
- 0
app/helpers/items_helper.rb View File

@ -0,0 +1,2 @@
module ItemsHelper
end

+ 18
- 0
app/models/booking.rb View File

@ -0,0 +1,18 @@
class Booking < ActiveRecord::Base
UNIT = 100 / 24.0 / 4
belongs_to :event
def margin_for(date, offset)
quarter = [0, 15, 30, 45].index(((start_at.min/15.0).round * 15) % 60)
(start_at.hour * 4*UNIT) + (quarter * UNIT) - offset
end
def width_for(date)
(length/3600.0 * 4*UNIT) + ((length/60.0%60) * UNIT)
end
def length
end_at - start_at
end
end

+ 25
- 0
app/models/event.rb View File

@ -0,0 +1,25 @@
class Event < ActiveRecord::Base
TAG_RE = /\[[^]]+\]/
belongs_to :item
has_many :bookings
validates_presence_of :title, :message => "Le titre ne peut pas être vide"
validates_length_of :title, :within => 4...140,
:message => "Le titre doit faire entre 4 et 140 caractères"
def generate_color
digest = Digest::MD5.hexdigest(title =~ TAG_RE ? $~.to_s : self.title)
self.color = "##{digest[0...6]}"
end
def upcoming_bookings
self.bookings.
find(:all, :conditions => ['start_at >= ?', Date.today.at_midnight])
end
def anchor
'event-%s' % id.to_s(16)
end
end

+ 39
- 0
app/models/item.rb View File

@ -0,0 +1,39 @@
class Item < ActiveRecord::Base
has_many :events
has_many :bookings, :through => :events
validates_presence_of :name, :email
before_create :regenerate_key
def self.find_by_key(*args)
super(*args) or raise NotFound
end
class NotFound < StandardError; end
# Create a random string (128 ^ 32 possibilities)
def regenerate_key
string = Array.new(32) { rand(128).chr }.join
self.key = Digest::MD5.hexdigest(string)
end
def upcoming_events
self.events.map(&:upcoming_bookings).flatten.map(&:event)
end
def bookings_for(date)
bookings_between(date, date)
end
def bookings_between(lower, upper)
bookings_range(lower.at_midnight, 1.day.since(upper).at_midnight - 1)
end
private
def bookings_range(lower, upper)
self.bookings.find :all,
:conditions => ['start_at >= ? AND end_at <= ?', lower, upper]
end
end

+ 5
- 0
app/views/bookings/_booking.html.erb View File

@ -0,0 +1,5 @@
<li class="booking">
De <%= booking.start_at.strftime('%H:%M') %>
à <%= booking.end_at.strftime('%H:%M') %>
le <%= booking.start_at.strftime('%d/%m/%Y') %>
</li>

+ 7
- 0
app/views/events/_event.html.erb View File

@ -0,0 +1,7 @@
<li class="event">
<h3 style="background-color: <%= event.color %>"><%=h event.title %></h3>
<p><%=h event.details %></p>
<ul class="booking-list">
<%= render :partial => 'bookings/booking', :collection => event.upcoming_bookings %>
</ul>
</li>

+ 111
- 0
app/views/items/_calendar.html.erb View File

@ -0,0 +1,111 @@
<div id="day-view">
<table id="monthly-calendar">
<thead>
<tr class="cal-nav">
<th colspan="7">
<a href="?date=<%= 1.month.until(now).strftime('%d/%m/%Y')
%>" class="cal-prev" title="Mois précédent">«</a>
<strong><%= now.strftime('%B %Y') %></strong>
<a href="?date=<%= 1.month.since(now).strftime('%d/%m/%Y')
%>" class="cal-next" title="Mois suivant">»</a>
</th>
</tr>
<tr class="cal-head">
<th>lun</th> <th>mar</th> <th>mer</th> <th>jeu</th>
<th>ven</th> <th>sam</th> <th>dim</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="7">
<form action="" method="get">
<p>
<input type="text" name="date" value="<%= now.strftime('%d/%m/%Y') %>" />
<input type="submit" value="Go" /><br />
<a href="?date=<%= Date.today.strftime('%d/%m/%Y') %>">Aujourd'hui</a>
</p>
</form>
</td>
</tr>
</tfoot>
<tbody>
<tr><%
first = Date.civil(now.year, now.month, 1)
last = Date.civil(now.year, now.month, -1)
wday = 1
current = 1
# Initial padding, if needed
while wday != first.wday %>
<td></td> <%
wday = (wday + 1) % 7
end
# Day cells
while current <= last.mday %>
<td<%= ' class="current-day"' if current == now.day
%>><a href="?date=<%= now.strftime('%02d/%%m/%%Y' % current) %>"><%=
current
%></a></td><%
# Next row after every sunday
if (wday % 7).zero? %>
</tr>
<tr><%
end
wday = (wday + 1) % 7
current += 1
end
# Fill the remaining space
until ((wday-1) % 7).zero? %>
<td></td><%
wday += 1
end %>
</tr>
</tbody>
</table>
<table id="booking-calendar">
<thead>
<tr>
<td></td>
<th>00:00</th> <th>02:00</th> <th>04:00</th>
<th>06:00</th> <th>08:00</th> <th>10:00</th>
<th>12:00</th> <th>14:00</th> <th>16:00</th>
<th>18:00</th> <th>20:00</th> <th>22:00</th>
</tr>
</thead>
<tbody>
<%
7.times do |offset|
current_day = offset.days.since(now)
bookings = @item.bookings_for(current_day)
offset, m, w = 0.0, 0.0, 0.0
%>
<tr<%= ' class="calendar-now"' if current_day == now %>>
<th><%= current_day.strftime('%a %d/%m') %></th>
<td class="calendar-day" colspan="12"><%
bookings.each do |booking| %>
<a class="calendar-booking" href="#<%= booking.event.anchor %>"
style="background-color: <%=
booking.event.color
%>; margin-left: <%=
m = booking.margin_for(current_day, offset)
m + 0.15
%>%; width: <%=
w = booking.width_for(current_day)
%>%;"><span><%= booking.event.title %></span></a><%
offset += m if booking == bookings.first
offset += w
end
%>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>

+ 27
- 0
app/views/items/_item.html.erb View File

@ -0,0 +1,27 @@
<li class="item">
<h2><%= item.name %></h2>
<p>
<span class="key"><%=
link_to item.key, item_path(:key => item.key)
%></span>
&lt;<span class="email"><%=
link_to item.email, "mailto:#{item.email}"
%></span>&gt;
<span class="edit">
<%= link_to "Éditer", edit_item_path(:key => item.key) %>
</span>
</p>
<ul class="event-list">
<% if item.upcoming_events.empty? %>
<li>Aucun évènement à venir</li>
<% else %>
<li>Évènements à venir :</li>
<%= render :partial => 'events/event', :collection => item.upcoming_events %>
<% end %>
</ul>
<p class="timestamps">
<%= item.created_at.localtime.strftime('Créé le %d/%m/%Y à %Hh%M') %>
</p>
</li>

+ 14
- 0
app/views/items/_time_picker.html.erb View File

@ -0,0 +1,14 @@
<select name="<%= name %>_hour" id="event-<%= name %>-hour">
<% (0..23).each do |i| -%>
<option value="<%= i %>" <%=
'selected="selected"' if i == hour
%>><%= "%02d" % i %>h</option>
<% end -%>
</select>
<select name="<%= name %>_min" id="event-<%= name %>-min">
<% (0..59).step(15) do |i| -%>
<option value="<%= i %>" <%=
'selected="selected"' if i == min
%>><%= "%02d" % i %></option>
<% end -%>
</select>

+ 5
- 0
app/views/items/index.html.erb View File

@ -0,0 +1,5 @@
<h1>EvoResa</h1>
<ul id="item-list">
<%= render :partial => 'item', :collection => @items %>
</ul>

+ 6
- 0
app/views/items/public_edit.html.erb View File

@ -0,0 +1,6 @@
<h1>EvoResa</h1>
<div id="content-page">
<p>Vous devez être authentifié pour éditer une ressource.</p>
</div>

+ 5
- 0
app/views/items/public_index.html.erb View File

@ -0,0 +1,5 @@
<h1>EvoResa</h1>
<div id="content-page">
<p>L'accès à une ressource nécessite une clé.</p>
</div>

+ 60
- 0
app/views/items/show.html.erb View File

@ -0,0 +1,60 @@
<% content_for :title do %>
<%= @item.name %> /
<% end %>
<h1><%= @item.name %></h1>
<%= render :partial => 'calendar', :locals => { :now => @date } %>
<div id="actions">
<div id="booking-form">
<h2>Réserver</h2>
<% if flash[:errors] %>
<ul class="errors">
<%= flash[:errors] %>
</ul>
<% end %>
<% form_for :event, :url => add_event_path(:key => @item.key) do |f| %>
<p>
<%= f.label :title, "Titre :" %>
<%= f.text_field :title %>
<span class="form-field-info">140 caractères maximum</span>
</p>
<p>
<%= f.label :details, "Détails :" %>
<%= f.text_area :details, :rows => 5, :cols => 20 %>
</p>
<p>
<%= f.label :dates, "Dates :" %>
<%= text_area_tag 'event[dates]', default_dates, :rows => 5, :cols => 20 %>
<span class="form-field-info">Une date par ligne</span>
</p>
<p>
<%= f.submit "Valider" %>
</p>
<% end %>
</div>
<ul id="event-list">
<% upper = 6.days.since(@date)
@item.bookings_between(@date, upper).map(&:event).uniq.each do |event| %>
<li class="event" id="<%= event.anchor %>">
<strong style="background-color: <%= event.color %>;">
<%=h event.title %>
<a href="#" class="top-anchor">↑</a>
</strong>
<span class="details">
<%=h event.details %>
<br />
</span>
<ul class="booking-list">
<%=
render :partial => 'bookings/booking',
:collection => event.item.bookings_between(@date, upper)
%>
</ul>
<p class="edit">
<%= link_to 'Éditer', edit_event_path(:key => @item.key, :id => event.id) %>
</p>
</li>
<% end %>
</div>

+ 18
- 0
app/views/layouts/application.html.erb View File

@ -0,0 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%= stylesheet_link_tag "reset-min", "main" %>
<title><%= yield :title %> EvoResa</title>
</head>
<body>
<%= yield %>
<p id="footer">
propulsé par EvoResa
<a id="help" href="#" title="Aide d'EvoResa">Aide</a>
</p>
</body>
</html>

+ 110
- 0
config/boot.rb View File

@ -0,0 +1,110 @@
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
module Rails
class << self
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
def booted?
defined? Rails::Initializer
end
def pick_boot
(vendor_rails? ? VendorBoot : GemBoot).new
end
def vendor_rails?
File.exist?("#{RAILS_ROOT}/vendor/rails")
end
def preinitialize
load(preinitializer_path) if File.exist?(preinitializer_path)
end
def preinitializer_path
"#{RAILS_ROOT}/config/preinitializer.rb"
end
end
class Boot
def run
load_initializer
Rails::Initializer.run(:set_load_path)
end
end
class VendorBoot < Boot
def load_initializer
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
Rails::Initializer.run(:install_gem_spec_stubs)
Rails::GemDependency.add_frozen_gem_path
end
end
class GemBoot < Boot
def load_initializer
self.class.load_rubygems
load_rails_gem
require 'initializer'
end
def load_rails_gem
if version = self.class.gem_version
gem 'rails', version
else
gem 'rails'
end
rescue Gem::LoadError => load_error
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
exit 1
end
class << self
def rubygems_version
Gem::RubyGemsVersion rescue nil
end
def gem_version
if defined? RAILS_GEM_VERSION
RAILS_GEM_VERSION
elsif ENV.include?('RAILS_GEM_VERSION')
ENV['RAILS_GEM_VERSION']
else
parse_gem_version(read_environment_rb)
end
end
def load_rubygems
min_version = '1.3.2'
require 'rubygems'
unless rubygems_version >= min_version
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
exit 1
end
rescue LoadError
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
exit 1
end
def parse_gem_version(text)
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
end
private
def read_environment_rb
File.read("#{RAILS_ROOT}/config/environment.rb")
end
end
end
end
# All that for this:
Rails.boot!

+ 22
- 0
config/database.yml View File

@ -0,0 +1,22 @@
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000

+ 52
- 0
config/environment.rb View File

@ -0,0 +1,52 @@
# Be sure to restart your server when you modify this file
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{RAILS_ROOT}/extras )
# Specify gems that this application depends on and have them installed with rake gems:install
# config.gem "bj"
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# config.gem "sqlite3-ruby", :lib => "sqlite3"
# config.gem "aws-s3", :lib => "aws/s3"
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Skip frameworks you're not going to use. To use Rails without a database,
# you must remove the Active Record framework.
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
# Activate observers that should always be running
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names.
config.time_zone = 'UTC'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
# config.i18n.default_locale = :de
end
# Local options
Date::MONTHNAMES = [nil,
'Janvier', 'Février', 'Mars', 'Avril',
'Mai', 'Juin', 'Juillet', 'Août',
'Septembre', 'Octobre', 'Novembre', 'Décembre'
]
Date::ABBR_DAYNAMES = %w(dim lun mar mer jeu ven sam)
ADMIN_SECRET_KEY = 'ee7ebb0a6e3ce158407baf986811a3a2'

+ 17
- 0
config/environments/development.rb View File

@ -0,0 +1,17 @@
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false

+ 28
- 0
config/environments/production.rb View File

@ -0,0 +1,28 @@
# Settings specified here will take precedence over those in config/environment.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.action_view.cache_template_loading = true
# See everything in the log (default is :info)
# config.log_level = :debug
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Enable threaded mode
# config.threadsafe!

+ 28
- 0
config/environments/test.rb View File

@ -0,0 +1,28 @@
# Settings specified here will take precedence over those in config/environment.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_view.cache_template_loading = true
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql

+ 7
- 0
config/initializers/backtrace_silencers.rb View File

@ -0,0 +1,7 @@
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
# Rails.backtrace_cleaner.remove_silencers!

+ 10
- 0
config/initializers/inflections.rb View File

@ -0,0 +1,10 @@
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end

+ 5
- 0
config/initializers/mime_types.rb View File

@ -0,0 +1,5 @@
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone

+ 21
- 0
config/initializers/new_rails_defaults.rb View File

@ -0,0 +1,21 @@
# Be sure to restart your server when you modify this file.
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.
if defined?(ActiveRecord)
# Include Active Record class name as root for JSON serialized output.
ActiveRecord::Base.include_root_in_json = true
# Store the full class name (including module namespace) in STI type column.
ActiveRecord::Base.store_full_sti_class = true
end
ActionController::Routing.generate_best_match = false
# Use ISO 8601 format for JSON serialized times and dates.
ActiveSupport.use_standard_json_time_format = true
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
# if you're including raw json in an HTML page.
ActiveSupport.escape_html_entities_in_json = false

+ 15
- 0
config/initializers/session_store.rb View File

@ -0,0 +1,15 @@
# Be sure to restart your server when you modify this file.
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
ActionController::Base.session = {
:key => '_evoresa2_session',
:secret => 'ef210f24cc7de77bcae2e22eabb805b106142d9ce41ea35fbc76b6b16657014df12e890eb2230847d45fb0f07c9f733db9a788c47eac7d4dcf83a3e862d43003'
}
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
# ActionController::Base.session_store = :active_record_store

+ 5
- 0
config/locales/en.yml View File

@ -0,0 +1,5 @@
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
hello: "Hello world"

+ 50
- 0
config/routes.rb View File

@ -0,0 +1,50 @@
ActionController::Routing::Routes.draw do |map|
map.connect '/authentify/:secret', :controller => 'items', :action => :authentify,
:conditions => { :method => :get }
map.with_options :controller => 'items' do |items|
items.connect '/', :action => :index,
:conditions => { :method => :get }
items.item "/:key", :action => :show,
:conditions => { :method => :get }
items.new_item "/new", :action => :new,
:conditions => { :method => :get }
items.edit_item "/:key/edit", :action => :edit,
:conditions => { :method => :get }
items.connect "/", :action => :create,
:conditions => { :method => :post }
items.connect "/:key", :action => :update,
:conditions => { :method => :put }
items.connect "/:key", :action => :delete,
:conditions => { :method => :delete }
items.with_options :controller => 'events' do |events|
events.edit_event '/:key/event/:id/edit', :action => :edit,
:conditions => { :method => :get }
events.add_event '/:key/event/add', :action => :create,
:conditions => { :method => :post }
events.connect '/:key/event/:id', :action => :update,
:conditions => { :method => :put }
events.connect '/:key/event/:id', :action => :delete,
:conditions => { :method => :delete }
events.with_options :controller => 'bookings' do |bookings|
bookings.edit_booking '/:key/event/:id/booking/:booking_id/edit',
:action => :edit, :conditions => { :method => :get }
bookings.connect '/:key/event/:id/booking/add', :action => :create,
:conditions => { :method => :post }
bookings.connect '/:key/event/:id/booking/:booking_id',
:action => :update, :conditions => { :method => :put }
bookings.connect '/:key/event/:id/booking/:booking_id',
:action => :delete, :conditions => { :method => :delete }
end
end
end
end

BIN
db/development.sqlite3 View File


+ 15
- 0
db/migrate/20100722152749_create_items.rb View File

@ -0,0 +1,15 @@
class CreateItems < ActiveRecord::Migration
def self.up
create_table :items do |t|
t.string :name
t.string :email
t.string :key
t.timestamps
end
end
def self.down
drop_table :items
end
end

+ 16
- 0
db/migrate/20100722153153_create_events.rb View File

@ -0,0 +1,16 @@
class CreateEvents < ActiveRecord::Migration
def self.up
create_table :events do |t|
t.string :title
t.text :details
t.references :item
t.string :color
t.timestamps
end
end
def self.down
drop_table :events
end
end

+ 15
- 0
db/migrate/20100722153250_create_bookings.rb View File

@ -0,0 +1,15 @@
class CreateBookings < ActiveRecord::Migration
def self.up
create_table :bookings do |t|
t.timestamp :start_at
t.timestamp :end_at
t.references :event
t.timestamps
end
end
def self.down
drop_table :bookings
end
end

+ 39
- 0
db/schema.rb View File

@ -0,0 +1,39 @@
# This file is auto-generated from the current state of the database. Instead of editing this file,
# please use the migrations feature of Active Record to incrementally modify your database, and
# then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
# to create the application database on another system, you should be using db:schema:load, not running
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20100722153250) do
create_table "bookings", :force => true do |t|
t.datetime "start_at"
t.datetime "end_at"
t.integer "event_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "events", :force => true do |t|
t.string "title"
t.text "details"
t.integer "item_id"
t.string "color"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "items", :force => true do |t|
t.string "name"
t.string "email"
t.string "key"
t.datetime "created_at"
t.datetime "updated_at"
end
end

+ 7
- 0
db/seeds.rb View File

@ -0,0 +1,7 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
# Major.create(:name => 'Daley', :city => cities.first)

+ 2
- 0
doc/README_FOR_APP View File

@ -0,0 +1,2 @@
Use this README file to introduce your application and point to useful places in the API for learning more.
Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.

+ 25
- 0
lib/tasks/evoresa.rake View File

@ -0,0 +1,25 @@
env_file = File.expand_path('../../../config/environment', __FILE__)
require env_file
namespace :evoresa do
desc "Show the current admin key"
task :show_key do
puts "Current key is: " + ADMIN_SECRET_KEY
puts "Change with rake evoresa:set_key [KEY=<key>]"
end
desc "Set the current admin key"
task :set_key do
require 'digest/md5'
file = env_file + '.rb'
config = File.read(file)
random_key = Digest::MD5.hexdigest(Array.new(32) { rand(128).chr }.join)
new_key = ENV['KEY'] || random_key
config.sub!(/(ADMIN_SECRET_KEY) = '[^']+'/, '\1 = \'' + new_key + "'")
File.open(file, 'w+') {|f| f.write(config) }
puts "The new key is: " + new_key
end
end

+ 4702
- 0
log/development.log View File

@ -0,0 +1,4702 @@
SQL (0.4ms)  SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'

SQL (0.2ms) select sqlite_version(*)
SQL (8.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
SQL (5.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
SQL (0.4ms)  SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'

SQL (0.1ms) SELECT version FROM schema_migrations
Migrating to CreateItems (20100722152749)
SQL (0.6ms) CREATE TABLE "items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "key" varchar(255), "created_at" datetime, "updated_at" datetime) 
SQL (0.2ms) INSERT INTO schema_migrations (version) VALUES ('20100722152749')
Migrating to CreateEvents (20100722153153)
SQL (0.5ms) CREATE TABLE "events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "details" text, "item_id" integer, "color" varchar(255), "created_at" datetime, "updated_at" datetime) 
SQL (0.1ms) INSERT INTO schema_migrations (version) VALUES ('20100722153153')
Migrating to CreateBookings (20100722153250)
SQL (0.4ms) CREATE TABLE "bookings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "start_at" datetime, "end_at" datetime, "event_id" integer, "created_at" datetime, "updated_at" datetime) 
SQL (0.2ms) INSERT INTO schema_migrations (version) VALUES ('20100722153250')
SQL (0.5ms)  SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'

SQL (0.3ms) SELECT version FROM schema_migrations
SQL (0.3ms)  SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'

SQL (0.1ms) PRAGMA index_list("bookings")
SQL (0.1ms) PRAGMA index_list("events")
SQL (0.1ms) PRAGMA index_list("items")
Processing ItemsController#show (for 127.0.0.1 at 2010-07-23 10:01:25) [GET]
ActionView::MissingTemplate (Missing template items/show.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:17:43) [GET]
ActionView::MissingTemplate (Missing template items/index.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#show (for 127.0.0.1 at 2010-07-23 11:18:04) [GET]
Parameters: {"key"=>"authentify"}
ActionView::MissingTemplate (Missing template items/show.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#show (for 127.0.0.1 at 2010-07-23 11:18:35) [GET]
Parameters: {"key"=>"authentify"}
ActionView::MissingTemplate (Missing template items/show.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#show (for 127.0.0.1 at 2010-07-23 11:18:42) [GET]
Parameters: {"key"=>"authentify"}
ActionView::MissingTemplate (Missing template items/show.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#show (for 127.0.0.1 at 2010-07-23 11:18:46) [GET]
Parameters: {"key"=>"authentify"}
ActionView::MissingTemplate (Missing template items/show.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#authentify (for 127.0.0.1 at 2010-07-23 11:19:06) [GET]
Parameters: {"secret"=>"ee7ebb0a6e3ce158407baf986811a3a"}
ActionView::MissingTemplate (Missing template items/authentify.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#authentify (for 127.0.0.1 at 2010-07-23 11:19:32) [GET]
Parameters: {"secret"=>"ee7ebb0a6e3ce158407baf986811a3a"}
Redirected to http://localhost:3000/
Completed in 6ms (DB: 0) | 302 Found [http://localhost/authentify/ee7ebb0a6e3ce158407baf986811a3a]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:19:32) [GET]
ActionView::MissingTemplate (Missing template items/index.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#authentify (for 127.0.0.1 at 2010-07-23 11:19:46) [GET]
Parameters: {"secret"=>"ee7ebb0a6e3ce158407baf986811a3a"}
Redirected to http://localhost:3000/
Completed in 6ms (DB: 0) | 302 Found [http://localhost/authentify/ee7ebb0a6e3ce158407baf986811a3a]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:19:46) [GET]
ActionView::MissingTemplate (Missing template items/index.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#authentify (for 127.0.0.1 at 2010-07-23 11:20:02) [GET]
Parameters: {"secret"=>"ee7ebb0a6e3ce158407baf986811a3a2"}
Redirected to http://localhost:3000/
Completed in 7ms (DB: 0) | 302 Found [http://localhost/authentify/ee7ebb0a6e3ce158407baf986811a3a2]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:20:02) [GET]
ActionView::MissingTemplate (Missing template items/index.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:22:13) [GET]
ActionView::MissingTemplate (Missing template items/index.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:22:15) [GET]
ActionView::MissingTemplate (Missing template items/index.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:22:35) [GET]
ActionView::MissingTemplate (Missing template items/index.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:22:46) [GET]
ActionView::MissingTemplate (Missing template items/index.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#show (for 127.0.0.1 at 2010-07-23 11:23:15) [GET]
Parameters: {"key"=>"j"}
NameError (undefined local variable or method `sessions' for #<ItemsController:0xb66a59bc>):
app/controllers/items_controller.rb:12:in `show'
Rendered rescues/_trace (116.5ms)
Rendered rescues/_request_and_response (5.9ms)
Rendering rescues/layout (internal_server_error)
Processing ItemsController#show (for 127.0.0.1 at 2010-07-23 11:23:23) [GET]
Parameters: {"key"=>"j"}
ActionView::MissingTemplate (Missing template items/show.erb in view path app/views):
Rendering rescues/layout (internal_server_error)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:23:33) [GET]
ActionView::MissingTemplate (Missing template items/public_index.erb in view path app/views):
app/controllers/items_controller.rb:6:in `index'
Rendering rescues/layout (internal_server_error)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:23:41) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 90ms (View: 84, DB: 0) | 200 OK [http://localhost/]
Processing ApplicationController#index (for 127.0.0.1 at 2010-07-23 11:23:41) [GET]
ActionController::RoutingError (No route matches "/stylesheets/reset-min.css" with {:method=>:get}):
Rendering rescues/layout (not_found)
Processing ApplicationController#index (for 127.0.0.1 at 2010-07-23 11:23:41) [GET]
ActionController::RoutingError (No route matches "/stylesheets/main.css" with {:method=>:get}):
Rendering rescues/layout (not_found)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:24:21) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 20ms (View: 13, DB: 0) | 200 OK [http://localhost/]
Processing ApplicationController#index (for 127.0.0.1 at 2010-07-23 11:24:21) [GET]
ActionController::RoutingError (No route matches "/images/help.png" with {:method=>:get}):
Rendering rescues/layout (not_found)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:25:07) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 21ms (View: 14, DB: 0) | 200 OK [http://localhost/]
Processing ApplicationController#index (for 127.0.0.1 at 2010-07-23 11:25:07) [GET]
ActionController::RoutingError (No route matches "/images/help.png" with {:method=>:get}):
Rendering rescues/layout (not_found)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:25:37) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 9ms (View: 3, DB: 0) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:25:42) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 19ms (View: 13, DB: 0) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:27:19) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 9ms (View: 3, DB: 0) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:27:31) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 19ms (View: 13, DB: 0) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:27:53) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 19ms (View: 13, DB: 0) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:43:34) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 25ms (View: 13, DB: 0) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:43:54) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 21ms (View: 14, DB: 0) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:45:38) [GET]
Rendering template within layouts/application
Rendering items/public_index
Completed in 20ms (View: 14, DB: 0) | 200 OK [http://localhost/]
Processing ItemsController#authentify (for 127.0.0.1 at 2010-07-23 11:45:44) [GET]
Parameters: {"secret"=>"ee7ebb0a6e3ce158407baf986811a3a2"}
Redirected to http://localhost:3000/
Completed in 7ms (DB: 0) | 302 Found [http://localhost/authentify/ee7ebb0a6e3ce158407baf986811a3a2]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:45:44) [GET]
Rendering template within layouts/application
Rendering items/index
Completed in 21ms (View: 14, DB: 0) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:47:48) [GET]
SyntaxError (/home/madx/dev/evolix/repos/evoresa2/app/models/item.rb:12: syntax error, unexpected tLSHFT, expecting '<' or '\n' or ';'
class NotFound << StandardError; end
^):
app/controllers/items_controller.rb:5:in `index'
Rendered rescues/_trace (121.2ms)
Rendered rescues/_request_and_response (0.8ms)
Rendering rescues/layout (internal_server_error)
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:48:00) [GET]
Item Load (1.3ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Completed in 54ms (View: 13, DB: 1) | 200 OK [http://localhost/]
Item Create (0.9ms) INSERT INTO "items" ("name", "created_at", "updated_at", "key", "email") VALUES('Salle de réunion', '2010-07-23 09:50:34', '2010-07-23 09:50:34', 'df4fac63f77f6896bb09d3b8f01441f7', 'madx@yapok.org')
Item Create (0.6ms) INSERT INTO "items" ("name", "created_at", "updated_at", "key", "email") VALUES('Rétroprojecteur', '2010-07-23 09:50:46', '2010-07-23 09:50:46', 'ea30e7bf781a84c83a5f250f47246b3b', 'madx@yapok.org')
Item Load (1.1ms) SELECT * FROM "items" 
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:50:50) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (9.4ms)
Rendered items/_item (0.3ms)
Completed in 44ms (View: 24, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:51:05) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (7.1ms)
Rendered items/_item (0.3ms)
Completed in 41ms (View: 21, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:51:37) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (7.4ms)
Rendered items/_item (0.3ms)
Completed in 40ms (View: 21, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:51:59) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (161.8ms)
Rendered items/_item (0.7ms)
Completed in 194ms (View: 176, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:52:36) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (8.0ms)
Rendered items/_item (0.5ms)
Completed in 41ms (View: 22, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:53:02) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (8.2ms)
Rendered items/_item (0.5ms)
Completed in 44ms (View: 23, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:53:07) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (8.0ms)
Rendered items/_item (0.5ms)
Completed in 51ms (View: 24, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:53:50) [GET]
Item Load (1.8ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (7.5ms)
Rendered items/_item (0.5ms)
Completed in 39ms (View: 13, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:53:51) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.2ms)
Rendered items/_item (0.5ms)
Completed in 30ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:54:05) [GET]
Item Load (1.8ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.3ms)
Rendered items/_item (0.5ms)
Completed in 30ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:54:06) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.5ms)
Rendered items/_item (0.5ms)
Completed in 34ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:54:07) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.7ms)
Rendered items/_item (0.5ms)
Completed in 158ms (View: 12, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:54:21) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (7.0ms)
Rendered items/_item (0.5ms)
Completed in 36ms (View: 12, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:54:22) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.4ms)
Rendered items/_item (0.5ms)
Completed in 31ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:54:27) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.4ms)
Rendered items/_item (0.5ms)
Completed in 30ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:54:37) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.3ms)
Rendered items/_item (0.5ms)
Completed in 30ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:54:52) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.2ms)
Rendered items/_item (0.5ms)
Completed in 30ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:55:07) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.3ms)
Rendered items/_item (0.5ms)
Completed in 29ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:55:35) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (7.1ms)
Rendered items/_item (0.5ms)
Completed in 173ms (View: 12, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:55:42) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.5ms)
Rendered items/_item (0.5ms)
Completed in 31ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:55:43) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.4ms)
Rendered items/_item (0.5ms)
Completed in 31ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:56:04) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (8.0ms)
Rendered items/_item (0.5ms)
Completed in 41ms (View: 22, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:56:19) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.4ms)
Rendered items/_item (0.5ms)
Completed in 30ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:56:20) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.1ms)
Rendered items/_item (0.5ms)
Completed in 29ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:56:27) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (8.2ms)
Rendered items/_item (0.5ms)
Completed in 41ms (View: 22, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:56:45) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (42.2ms)
Rendered items/_item (1.1ms)
Completed in 78ms (View: 58, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:56:54) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (8.4ms)
Rendered items/_item (0.8ms)
Completed in 42ms (View: 23, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:57:18) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.8ms)
Rendered items/_item (0.8ms)
Completed in 31ms (View: 12, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:57:18) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (11.1ms)
Rendered items/_item (0.8ms)
Completed in 42ms (View: 17, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:57:19) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.5ms)
Rendered items/_item (0.8ms)
Completed in 30ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:57:46) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.6ms)
Rendered items/_item (0.8ms)
Completed in 32ms (View: 12, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:57:51) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (7.2ms)
Rendered items/_item (0.8ms)
Completed in 32ms (View: 12, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:57:52) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.9ms)
Rendered items/_item (0.8ms)
Completed in 31ms (View: 12, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:58:05) [GET]
Item Load (2.8ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (7.0ms)
Rendered items/_item (0.8ms)
Completed in 33ms (View: 12, DB: 3) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:58:06) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.7ms)
Rendered items/_item (0.8ms)
Completed in 31ms (View: 12, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:58:19) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.6ms)
Rendered items/_item (0.9ms)
Completed in 30ms (View: 12, DB: 2) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 11:58:21) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Rendered items/_item (6.6ms)
Rendered items/_item (0.8ms)
Completed in 30ms (View: 11, DB: 2) | 200 OK [http://localhost/]
Item Load (0.8ms) SELECT * FROM "items" LIMIT 1
Event Create (0.7ms) INSERT INTO "events" ("created_at", "title", "details", "updated_at", "color", "item_id") VALUES('2010-07-23 10:00:23', '[Evolix] EvoBilan', 'Réunion hebdomadaire de l''équipe', '2010-07-23 10:00:23', NULL, 1)
Item Load (0.8ms) SELECT * FROM "items" LIMIT 1
Event Load (0.8ms) SELECT * FROM "events" WHERE ("events".item_id = 1) 
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 12:02:18) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Event Load (0.9ms) SELECT * FROM "events" WHERE ("events".item_id = 1) 
Rendered events/_event (1.6ms)
Rendered items/_item (176.0ms)
Event Load (0.5ms) SELECT * FROM "events" WHERE ("events".item_id = 2) 
Rendered items/_item (3.1ms)
Completed in 211ms (View: 191, DB: 3) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 12:02:50) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Event Load (0.9ms) SELECT * FROM "events" WHERE ("events".item_id = 1) 
Rendered events/_event (1.7ms)
Rendered items/_item (39.0ms)
Event Load (0.4ms) SELECT * FROM "events" WHERE ("events".item_id = 2) 
Rendered items/_item (2.8ms)
Completed in 66ms (View: 45, DB: 3) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 12:02:51) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Event Load (0.9ms) SELECT * FROM "events" WHERE ("events".item_id = 1) 
Rendered events/_event (0.3ms)
Rendered items/_item (27.1ms)
Event Load (0.4ms) SELECT * FROM "events" WHERE ("events".item_id = 2) 
Rendered items/_item (3.0ms)
Completed in 53ms (View: 33, DB: 3) | 200 OK [http://localhost/]
Item Load (0.9ms) SELECT * FROM "items" LIMIT 1
Event Load (0.7ms) SELECT * FROM "events" WHERE ("events".item_id = 1) LIMIT 1
Item Load (0.9ms) SELECT * FROM "items" LIMIT 1
Event Load (0.7ms) SELECT * FROM "events" WHERE ("events".item_id = 1) LIMIT 1
Event Update (0.6ms) UPDATE "events" SET "updated_at" = '2010-07-23 10:03:14', "color" = '#2dd706' WHERE "id" = 1
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 12:03:16) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Event Load (0.9ms) SELECT * FROM "events" WHERE ("events".item_id = 1) 
Rendered events/_event (0.3ms)
Rendered items/_item (27.3ms)
Event Load (0.4ms) SELECT * FROM "events" WHERE ("events".item_id = 2) 
Rendered items/_item (2.7ms)
Completed in 53ms (View: 33, DB: 3) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 12:04:06) [GET]
Item Load (1.7ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Event Load (0.9ms) SELECT * FROM "events" WHERE ("events".item_id = 1) 
Rendered events/_event (0.3ms)
Rendered items/_item (27.4ms)
Event Load (0.4ms) SELECT * FROM "events" WHERE ("events".item_id = 2) 
Rendered items/_item (2.7ms)
Completed in 53ms (View: 33, DB: 3) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 12:04:19) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application
Rendering items/index
Event Load (0.9ms) SELECT * FROM "events" WHERE ("events".item_id = 1) 
Rendered events/_event (0.4ms)
Rendered items/_item (36.0ms)
Event Load (0.4ms) SELECT * FROM "events" WHERE ("events".item_id = 2) 
Rendered items/_item (3.0ms)
Completed in 65ms (View: 43, DB: 3) | 200 OK [http://localhost/]
Processing ItemsController#index (for 127.0.0.1 at 2010-07-23 12:04:26) [GET]
Item Load (1.6ms) SELECT * FROM "items" 
Rendering template within layouts/application