Travail sur les notes
This commit is contained in:
parent
6844cac3a0
commit
795b7f647c
10
Gemfile
10
Gemfile
|
@ -5,9 +5,6 @@ gem 'rails'
|
||||||
# Use mysql as the database for Active Record
|
# Use mysql as the database for Active Record
|
||||||
gem 'mysql2'
|
gem 'mysql2'
|
||||||
|
|
||||||
# Use SCSS for stylesheets
|
|
||||||
gem 'sass-rails'
|
|
||||||
|
|
||||||
# Use Uglifier as compressor for JavaScript assets
|
# Use Uglifier as compressor for JavaScript assets
|
||||||
gem 'uglifier'
|
gem 'uglifier'
|
||||||
|
|
||||||
|
@ -49,11 +46,16 @@ gem 'rails-i18n'
|
||||||
gem 'devise-i18n'
|
gem 'devise-i18n'
|
||||||
gem 'jquery-turbolinks'
|
gem 'jquery-turbolinks'
|
||||||
gem 'font-awesome-rails'
|
gem 'font-awesome-rails'
|
||||||
gem 'compass-rails', "~> 2.0.alpha.0"
|
|
||||||
gem 'has_scope'
|
gem 'has_scope'
|
||||||
gem 'simple_calendar', github: 'echarp/simple_calendar'
|
gem 'simple_calendar', github: 'echarp/simple_calendar'
|
||||||
gem 'redcarpet'
|
gem 'redcarpet'
|
||||||
|
|
||||||
|
group :assets do
|
||||||
|
# Use SASS for stylesheets
|
||||||
|
gem 'sass-rails'
|
||||||
|
gem 'compass-rails'
|
||||||
|
end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem 'guard-livereload'
|
gem 'guard-livereload'
|
||||||
gem 'guard-bundler'
|
gem 'guard-bundler'
|
||||||
|
|
49
Gemfile.lock
49
Gemfile.lock
|
@ -7,7 +7,7 @@ GIT
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/gregbell/active_admin.git
|
remote: git://github.com/gregbell/active_admin.git
|
||||||
revision: 7465eb37877897849a2466a05afd2af4ee7a9338
|
revision: d7a26247de866fba5e3d2cce872ba978247f80a2
|
||||||
specs:
|
specs:
|
||||||
activeadmin (1.0.0.pre)
|
activeadmin (1.0.0.pre)
|
||||||
arbre (~> 1.0)
|
arbre (~> 1.0)
|
||||||
|
@ -18,7 +18,7 @@ GIT
|
||||||
inherited_resources (~> 1.3)
|
inherited_resources (~> 1.3)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
jquery-ui-rails
|
jquery-ui-rails
|
||||||
kaminari (~> 0.14, != 0.15.0)
|
kaminari (~> 0.15)
|
||||||
rails (>= 3.2, < 4.1)
|
rails (>= 3.2, < 4.1)
|
||||||
ransack (~> 1.0)
|
ransack (~> 1.0)
|
||||||
sass-rails
|
sass-rails
|
||||||
|
@ -52,7 +52,7 @@ GEM
|
||||||
tzinfo (~> 0.3.37)
|
tzinfo (~> 0.3.37)
|
||||||
arbre (1.0.1)
|
arbre (1.0.1)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
arel (4.0.1)
|
arel (4.0.2)
|
||||||
atomic (1.1.14)
|
atomic (1.1.14)
|
||||||
bcrypt-ruby (3.1.2)
|
bcrypt-ruby (3.1.2)
|
||||||
bourbon (3.1.8)
|
bourbon (3.1.8)
|
||||||
|
@ -61,7 +61,10 @@ GEM
|
||||||
builder (3.1.4)
|
builder (3.1.4)
|
||||||
celluloid (0.15.2)
|
celluloid (0.15.2)
|
||||||
timers (~> 1.1.0)
|
timers (~> 1.1.0)
|
||||||
chunky_png (1.2.9)
|
celluloid-io (0.15.0)
|
||||||
|
celluloid (>= 0.15.0)
|
||||||
|
nio4r (>= 0.5.0)
|
||||||
|
chunky_png (1.3.0)
|
||||||
coderay (1.1.0)
|
coderay (1.1.0)
|
||||||
coffee-rails (4.0.1)
|
coffee-rails (4.0.1)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
|
@ -69,13 +72,13 @@ GEM
|
||||||
coffee-script (2.2.0)
|
coffee-script (2.2.0)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.6.3)
|
coffee-script-source (1.7.0)
|
||||||
compass (0.12.2)
|
compass (0.12.2)
|
||||||
chunky_png (~> 1.2)
|
chunky_png (~> 1.2)
|
||||||
fssm (>= 0.2.7)
|
fssm (>= 0.2.7)
|
||||||
sass (~> 3.1)
|
sass (~> 3.1)
|
||||||
compass-rails (2.0.alpha.0)
|
compass-rails (1.1.4)
|
||||||
compass (>= 0.12.2, < 0.14)
|
compass (>= 0.12.2)
|
||||||
devise (3.2.2)
|
devise (3.2.2)
|
||||||
bcrypt-ruby (~> 3.0)
|
bcrypt-ruby (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
|
@ -96,7 +99,7 @@ GEM
|
||||||
formtastic (2.3.0.rc2)
|
formtastic (2.3.0.rc2)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
fssm (0.2.10)
|
fssm (0.2.10)
|
||||||
guard (2.2.5)
|
guard (2.4.0)
|
||||||
formatador (>= 0.2.4)
|
formatador (>= 0.2.4)
|
||||||
listen (~> 2.1)
|
listen (~> 2.1)
|
||||||
lumberjack (~> 1.0)
|
lumberjack (~> 1.0)
|
||||||
|
@ -105,11 +108,11 @@ GEM
|
||||||
guard-bundler (2.0.0)
|
guard-bundler (2.0.0)
|
||||||
bundler (~> 1.0)
|
bundler (~> 1.0)
|
||||||
guard (~> 2.2)
|
guard (~> 2.2)
|
||||||
guard-livereload (2.1.0)
|
guard-livereload (2.1.1)
|
||||||
em-websocket (~> 0.5)
|
em-websocket (~> 0.5)
|
||||||
guard (~> 2.0)
|
guard (~> 2.0)
|
||||||
multi_json (~> 1.8)
|
multi_json (~> 1.8)
|
||||||
guard-minitest (2.1.3)
|
guard-minitest (2.2.0)
|
||||||
guard (~> 2.0)
|
guard (~> 2.0)
|
||||||
minitest (>= 3.0)
|
minitest (>= 3.0)
|
||||||
haml (4.0.5)
|
haml (4.0.5)
|
||||||
|
@ -128,23 +131,24 @@ GEM
|
||||||
inherited_resources (1.4.1)
|
inherited_resources (1.4.1)
|
||||||
has_scope (~> 0.6.0.rc)
|
has_scope (~> 0.6.0.rc)
|
||||||
responders (~> 1.0.0.rc)
|
responders (~> 1.0.0.rc)
|
||||||
jbuilder (2.0.2)
|
jbuilder (2.0.3)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
multi_json (>= 1.2.0)
|
multi_json (>= 1.2.0)
|
||||||
jquery-rails (3.0.4)
|
jquery-rails (3.1.0)
|
||||||
railties (>= 3.0, < 5.0)
|
railties (>= 3.0, < 5.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
jquery-turbolinks (2.0.1)
|
jquery-turbolinks (2.0.2)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
turbolinks
|
turbolinks
|
||||||
jquery-ui-rails (4.1.1)
|
jquery-ui-rails (4.1.1)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
json (1.8.1)
|
json (1.8.1)
|
||||||
kaminari (0.14.1)
|
kaminari (0.15.1)
|
||||||
actionpack (>= 3.0.0)
|
actionpack (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
listen (2.4.0)
|
listen (2.5.0)
|
||||||
celluloid (>= 0.15.2)
|
celluloid (>= 0.15.2)
|
||||||
|
celluloid-io (>= 0.15.0)
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
rb-inotify (>= 0.9)
|
rb-inotify (>= 0.9)
|
||||||
lumberjack (1.0.4)
|
lumberjack (1.0.4)
|
||||||
|
@ -155,12 +159,13 @@ GEM
|
||||||
mime-types (1.25.1)
|
mime-types (1.25.1)
|
||||||
minitest (4.7.5)
|
minitest (4.7.5)
|
||||||
multi_json (1.8.4)
|
multi_json (1.8.4)
|
||||||
mysql2 (0.3.14)
|
mysql2 (0.3.15)
|
||||||
|
nio4r (1.0.0)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
polyamorous (0.6.4)
|
polyamorous (0.6.4)
|
||||||
activerecord (>= 3.0)
|
activerecord (>= 3.0)
|
||||||
polyglot (0.3.3)
|
polyglot (0.3.3)
|
||||||
pry (0.9.12.4)
|
pry (0.9.12.6)
|
||||||
coderay (~> 1.0)
|
coderay (~> 1.0)
|
||||||
method_source (~> 0.8)
|
method_source (~> 0.8)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
|
@ -195,10 +200,10 @@ GEM
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
rdoc (4.1.1)
|
rdoc (4.1.1)
|
||||||
json (~> 1.4)
|
json (~> 1.4)
|
||||||
redcarpet (3.0.0)
|
redcarpet (3.1.0)
|
||||||
responders (1.0.0)
|
responders (1.0.0)
|
||||||
railties (>= 3.2, < 5)
|
railties (>= 3.2, < 5)
|
||||||
sass (3.2.13)
|
sass (3.2.14)
|
||||||
sass-rails (4.0.1)
|
sass-rails (4.0.1)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
sass (>= 3.1.10)
|
sass (>= 3.1.10)
|
||||||
|
@ -216,7 +221,7 @@ GEM
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
sprockets (~> 2.8)
|
sprockets (~> 2.8)
|
||||||
thor (0.18.1)
|
thor (0.18.1.20140116)
|
||||||
thread_safe (0.1.3)
|
thread_safe (0.1.3)
|
||||||
atomic
|
atomic
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
|
@ -224,7 +229,7 @@ GEM
|
||||||
treetop (1.4.15)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
turbolinks (2.1.0)
|
turbolinks (2.2.1)
|
||||||
coffee-rails
|
coffee-rails
|
||||||
tzinfo (0.3.38)
|
tzinfo (0.3.38)
|
||||||
uglifier (2.4.0)
|
uglifier (2.4.0)
|
||||||
|
@ -240,7 +245,7 @@ PLATFORMS
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
activeadmin!
|
activeadmin!
|
||||||
coffee-rails
|
coffee-rails
|
||||||
compass-rails (~> 2.0.alpha.0)
|
compass-rails
|
||||||
devise-i18n
|
devise-i18n
|
||||||
font-awesome-rails
|
font-awesome-rails
|
||||||
guard-bundler
|
guard-bundler
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://coffeescript.org/
|
|
@ -81,9 +81,36 @@ main
|
||||||
margin: 0.95em 0
|
margin: 0.95em 0
|
||||||
line-height: 1.3em
|
line-height: 1.3em
|
||||||
text-align: justify
|
text-align: justify
|
||||||
|
&.label
|
||||||
|
text-align: center
|
||||||
hr
|
hr
|
||||||
margin: 10px 20px
|
margin: 10px 20px
|
||||||
|
|
||||||
|
input, textarea, select
|
||||||
|
margin: 3px 0
|
||||||
|
border: 1px solid #868686
|
||||||
|
&:focus
|
||||||
|
background-color: #F0F8FF
|
||||||
|
/*
|
||||||
|
input, textarea, select
|
||||||
|
color: black
|
||||||
|
margin: 3px 0
|
||||||
|
border: 1px solid #868686
|
||||||
|
padding: 0.2em 0.8em
|
||||||
|
font-family: georgia, serif
|
||||||
|
background-color: white
|
||||||
|
@include border-radius(0.7em)
|
||||||
|
&:focus
|
||||||
|
outline: 0
|
||||||
|
background-color: #F0F8FF
|
||||||
|
input[type=submit]
|
||||||
|
border: none
|
||||||
|
font-size: x-large
|
||||||
|
@include box-shadow(0 0 1em lightblue)
|
||||||
|
@include text-shadow(1px 1px 1px white)
|
||||||
|
&:hover
|
||||||
|
@include box-shadow(5px 5px 5px lightblue)
|
||||||
|
|
||||||
footer.bottom nav
|
footer.bottom nav
|
||||||
margin: 26px auto -3px
|
margin: 26px auto -3px
|
||||||
font-size: smaller
|
font-size: smaller
|
||||||
|
|
|
@ -160,11 +160,6 @@ table.calendar
|
||||||
display: inline-block
|
display: inline-block
|
||||||
&:after
|
&:after
|
||||||
content: ':'
|
content: ':'
|
||||||
input, textarea, select
|
|
||||||
margin: 3px 0
|
|
||||||
border: 1px solid #868686
|
|
||||||
&:focus
|
|
||||||
background-color: #F0F8FF
|
|
||||||
.actions
|
.actions
|
||||||
margin-left: 6.75em
|
margin-left: 6.75em
|
||||||
margin-bottom: 10px
|
margin-bottom: 10px
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.moderations
|
.moderations, .notes
|
||||||
table.list
|
table.list
|
||||||
width: 100%
|
width: 100%
|
||||||
margin-top: 15px
|
margin-top: 15px
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
.notes
|
||||||
|
form
|
||||||
|
label:after
|
||||||
|
content: ':'
|
|
@ -0,0 +1,69 @@
|
||||||
|
body {
|
||||||
|
background-color: #fff;
|
||||||
|
color: #333;
|
||||||
|
font-family: verdana, arial, helvetica, sans-serif;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p, ol, ul, td {
|
||||||
|
font-family: verdana, arial, helvetica, sans-serif;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
background-color: #eee;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #000;
|
||||||
|
&:visited {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
&.field, &.actions {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#notice {
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.field_with_errors {
|
||||||
|
padding: 2px;
|
||||||
|
background-color: red;
|
||||||
|
display: table;
|
||||||
|
}
|
||||||
|
|
||||||
|
#error_explanation {
|
||||||
|
width: 450px;
|
||||||
|
border: 2px solid red;
|
||||||
|
padding: 7px;
|
||||||
|
padding-bottom: 0;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
h2 {
|
||||||
|
text-align: left;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 5px 5px 5px 15px;
|
||||||
|
font-size: 12px;
|
||||||
|
margin: -7px;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
background-color: #c00;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
ul li {
|
||||||
|
font-size: 12px;
|
||||||
|
list-style: square;
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,8 +6,7 @@
|
||||||
display: inline-block
|
display: inline-block
|
||||||
.field, .actions
|
.field, .actions
|
||||||
text-align: left
|
text-align: left
|
||||||
margin-left: 2px
|
margin: 0.5em
|
||||||
margin-bottom: 2px !important
|
|
||||||
*
|
*
|
||||||
vertical-align: middle
|
vertical-align: middle
|
||||||
p.helper
|
p.helper
|
||||||
|
@ -16,26 +15,12 @@
|
||||||
label
|
label
|
||||||
width: 8em
|
width: 8em
|
||||||
display: inline-block
|
display: inline-block
|
||||||
text-align: right
|
|
||||||
&:after
|
&:after
|
||||||
content: ':'
|
content: ':'
|
||||||
input, textarea, select
|
/*
|
||||||
color: black
|
input, textarea, select
|
||||||
margin: 3px 0
|
font-size: larger
|
||||||
border: 1px solid #868686
|
background-color: #FFB
|
||||||
padding: 0.2em 0.8em
|
|
||||||
font-size: larger
|
|
||||||
font-family: georgia, serif
|
|
||||||
background-color: #FFB
|
|
||||||
@include border-radius(0.8em)
|
|
||||||
&:focus
|
|
||||||
outline: 0
|
|
||||||
background-color: #F0F8FF !important
|
|
||||||
input[type=submit]
|
|
||||||
border: none
|
|
||||||
font-size: x-large
|
|
||||||
@include box-shadow(0 0 1em lightblue)
|
|
||||||
@include text-shadow(1px 1px 1px white)
|
|
||||||
.actions
|
.actions
|
||||||
margin-left: 6.75em
|
margin-left: 6.75em
|
||||||
margin-bottom: 10px
|
margin-bottom: 10px
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
class NotesController < InheritedResources::Base
|
||||||
|
belongs_to :event
|
||||||
|
|
||||||
|
private
|
||||||
|
def begin_of_association_chain
|
||||||
|
@event = Event.unscoped.find params[:moderation_id]
|
||||||
|
end
|
||||||
|
|
||||||
|
def permitted_params
|
||||||
|
params.permit note: [:contents]
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,2 @@
|
||||||
|
module NotesHelper
|
||||||
|
end
|
|
@ -1,4 +1,4 @@
|
||||||
- if request.format == 'text/html' && controller.controller_name != 'moderations'
|
- if request.format == 'text/html' && controller.controller_name != 'moderations' && controller.controller_name != 'notes'
|
||||||
%p#notice= notice
|
%p#notice= notice
|
||||||
|
|
||||||
#lug-list
|
#lug-list
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
%br/
|
%br/
|
||||||
= link_to t('.askInfos'), edit_moderation_path(event), class: 'fa-bullhorn'
|
= link_to t('.askInfos'), edit_moderation_path(event), class: 'fa-bullhorn'
|
||||||
%br/
|
%br/
|
||||||
= link_to t('.createNote'), new_note_path('event.id' => event), class: 'fa-files-o'
|
= link_to t('.createNote'), new_moderation_note_path(event), class: 'fa-files-o'
|
||||||
|
|
||||||
- event.notes.each do |note|
|
- event.notes.each do |note|
|
||||||
%tr
|
%tr
|
||||||
|
@ -50,6 +50,6 @@
|
||||||
%em.author
|
%em.author
|
||||||
=t '.posted_by',
|
=t '.posted_by',
|
||||||
author: "#{note.author.firstname} #{note.author.lastname}",
|
author: "#{note.author.firstname} #{note.author.lastname}",
|
||||||
date: l(note.date, format: :at)
|
date: l(note.date, format: :at) rescue nil
|
||||||
|
|
||||||
.logout= link_to t('logout'), destroy_user_session_path, method: :delete
|
.logout= link_to t('logout'), destroy_user_session_path, method: :delete
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
= form_for [:moderation, @note] do |f|
|
||||||
|
- if @note.errors.any?
|
||||||
|
#error_explanation
|
||||||
|
%h2= "#{pluralize(@note.errors.count, "error")} prohibited this note from being saved:"
|
||||||
|
%ul
|
||||||
|
- @note.errors.full_messages.each do |msg|
|
||||||
|
%li= msg
|
||||||
|
.field
|
||||||
|
%p.label= f.label Note.human_attribute_name :contents
|
||||||
|
= f.text_area :contents, cols: 70, rows: 10
|
||||||
|
|
||||||
|
.actions
|
||||||
|
= f.submit t('save')
|
|
@ -0,0 +1,8 @@
|
||||||
|
%h3
|
||||||
|
= link_to t('.back'), moderations_path
|
||||||
|
>>>
|
||||||
|
=t '.title'
|
||||||
|
|
||||||
|
.box= render 'form'
|
||||||
|
|
||||||
|
.box= render file: '/events/show'
|
|
@ -1,5 +1,6 @@
|
||||||
fr:
|
fr:
|
||||||
show: Voir
|
show: Voir
|
||||||
|
save: Enregistrer
|
||||||
edit: Éditer
|
edit: Éditer
|
||||||
validate: Valider
|
validate: Valider
|
||||||
refuse: Refuser
|
refuse: Refuser
|
||||||
|
@ -56,6 +57,8 @@ fr:
|
||||||
region:
|
region:
|
||||||
name_values:
|
name_values:
|
||||||
all: Toutes les régions
|
all: Toutes les régions
|
||||||
|
note:
|
||||||
|
contents: Votre commentaire
|
||||||
|
|
||||||
helpers:
|
helpers:
|
||||||
submit:
|
submit:
|
||||||
|
@ -148,6 +151,10 @@ fr:
|
||||||
moderation: Modération
|
moderation: Modération
|
||||||
preview: Prévisualisation de l'évènement
|
preview: Prévisualisation de l'évènement
|
||||||
edit: Édition de l'évènement
|
edit: Édition de l'évènement
|
||||||
|
notes:
|
||||||
|
new:
|
||||||
|
back: Modération
|
||||||
|
title: Ajout d'une note de modération
|
||||||
users:
|
users:
|
||||||
sign_in:
|
sign_in:
|
||||||
title: Identification
|
title: Identification
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
AgendaDuLibreRails::Application.routes.draw do
|
AgendaDuLibreRails::Application.routes.draw do
|
||||||
|
resources :users
|
||||||
|
resources :events
|
||||||
|
resources :moderations do
|
||||||
|
resources :notes, only: [:new, :create]
|
||||||
|
end
|
||||||
resources :regions, only: [ :index ] do
|
resources :regions, only: [ :index ] do
|
||||||
get 'icallist', on: :collection
|
get 'icallist', on: :collection
|
||||||
get 'stats', on: :collection
|
get 'stats', on: :collection
|
||||||
end
|
end
|
||||||
resources :events
|
|
||||||
resources :notes
|
|
||||||
resources :users
|
|
||||||
resources :tags, only: [ :index, :show ]
|
resources :tags, only: [ :index, :show ]
|
||||||
resources :moderations
|
|
||||||
|
|
||||||
get 'ical.php' => 'events#index', format: :ics
|
get 'ical.php' => 'events#index', format: :ics
|
||||||
get ':format.php' => 'events#index'
|
get ':format.php' => 'events#index'
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class NotesControllerTest < ActionController::TestCase
|
||||||
|
setup do
|
||||||
|
@note = notes(:one)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get index" do
|
||||||
|
get :index
|
||||||
|
assert_response :success
|
||||||
|
assert_not_nil assigns(:notes)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get new" do
|
||||||
|
get :new
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should create note" do
|
||||||
|
assert_difference('Note.count') do
|
||||||
|
post :create, note: { author: @note.author, contents: @note.contents, date: @note.date, event: @note.event }
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_redirected_to note_path(assigns(:note))
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should show note" do
|
||||||
|
get :show, id: @note
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get edit" do
|
||||||
|
get :edit, id: @note
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should update note" do
|
||||||
|
patch :update, id: @note, note: { author: @note.author, contents: @note.contents, date: @note.date, event: @note.event }
|
||||||
|
assert_redirected_to note_path(assigns(:note))
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should destroy note" do
|
||||||
|
assert_difference('Note.count', -1) do
|
||||||
|
delete :destroy, id: @note
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_redirected_to notes_path
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,13 +1,13 @@
|
||||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
one:
|
one:
|
||||||
|
event: one
|
||||||
|
author: one
|
||||||
contents: MyText
|
contents: MyText
|
||||||
date: 2014-01-05 23:34:46
|
date: 2014-01-11 10:55:54
|
||||||
event_id:
|
|
||||||
author_id:
|
|
||||||
|
|
||||||
two:
|
two:
|
||||||
|
event: one
|
||||||
|
author: one
|
||||||
contents: MyText
|
contents: MyText
|
||||||
date: 2014-01-05 23:34:46
|
date: 2014-01-11 10:55:54
|
||||||
event_id:
|
|
||||||
author_id:
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class NotesHelperTest < ActionView::TestCase
|
||||||
|
end
|
Loading…
Reference in New Issue