ajout gestion adhérents

This commit is contained in:
Nicolas Bally 2013-03-15 13:11:58 +01:00
parent 96ffb84c01
commit df56a3a64c
73 changed files with 5603 additions and 10516 deletions

View File

@ -1,19 +1,19 @@
/*
*= require ./shared/jquery.js
*= require ./shared/jquery-ui.js
=require jquery
= require jquery.ui.all
*= require ./shared/jquery.strings.js
*= require ./shared/jquery.utils.js
*= require ./shared/ui.timepickr.js
*= require ./shared/modernizr.custom.39712.js
require ./shared/jquery.strings.js
require ./shared/jquery.utils.js
require ./shared/ui.timepickr.js
require ./shared/modernizr.custom.39712.js
*= require jquery_ujs
*=require_tree ./admin
*=require_tree ./wysihtml5
*= require ./shared/raphael
*= require ./shared/morris
@ -21,4 +21,16 @@
*= require_tree ./note_files
*/
$(document).ready(function(){
$(".raptor").editor({
initialLocale: 'fr',
});
});

View File

@ -0,0 +1,68 @@
var RELANG = {};
RELANG['fr'] = {
html: 'Code HTML',
video: 'Insérer une vidéo...',
image: 'Insérer une image...',
table: 'Tableau',
link: 'Lien',
link_insert: 'Insérer un lien...',
unlink: 'Supprimer le lien',
formatting: 'Styles',
paragraph: 'Paragraphe',
quote: 'Citation',
code: 'Code',
header1: 'Titre 1',
header2: 'Titre 2',
header3: 'Titre 3',
header4: 'Titre 4',
bold: 'Gras',
italic: 'Italique',
fontcolor: 'Couleur du texte',
backcolor: 'Couleur d\'arrière plan du texte',
unorderedlist: 'Liste à puces',
orderedlist: 'Liste numérotée',
outdent: 'Diminuer le trait',
indent: 'Augmenter le trait',
cancel: 'Annuler',
insert: 'Insérer',
save: 'Sauvegarder',
_delete: 'Supprimer',
insert_table: 'Insérer un tableau...',
insert_row_above: 'Ajouter une rangée au-dessus',
insert_row_below: 'Ajouter une rangée en-dessous',
insert_column_left: 'Ajouter une colonne à gauche',
insert_column_right: 'Ajouter une colonne à droite',
delete_column: 'Supprimer la colonne',
delete_row: 'Supprimer la rangée',
delete_table: 'Supprimer le tableau',
rows: 'Rangées',
columns: 'Colonnes',
add_head: 'Ajouter un en-tête',
delete_head: 'Supprimer l\'en-tête',
title: 'Titre',
image_position: 'Position',
none: 'Aucun',
left: 'Gauche',
right: 'Droite',
image_web_link: 'Adresse URL de l\'image',
text: 'Texte',
mailto: 'Courriel',
web: 'Adresse URL',
video_html_code: 'Code d\'intégration du vidéo',
file: 'Insérer un fichier...',
upload: 'Téléverser',
download: 'Télécharger',
choose: 'Choisir',
or_choose: 'Ou choisissez',
drop_file_here: 'Déposez le fichier ici',
align_left: 'Aligner à gauche',
align_center: 'Aligner au centre',
align_right: 'Aligner à droite',
align_justify: 'Justifier',
horizontalrule: 'Insérer une ligne horizontale',
deleted: 'Supprimé',
anchor: 'Ancre',
link_new_tab: 'Ouvrir le lien dans un nouvel onglet',
underline: 'Underline',
alignment: 'Alignment'
};

File diff suppressed because it is too large Load Diff

View File

@ -138,6 +138,3 @@ function chartbar(Container, Datas, Categories, Title){
}

View File

@ -1,551 +0,0 @@
/**
* Full HTML5 compatibility rule set
* These rules define which tags and css classes are supported and which tags should be specially treated.
*
* Examples based on this rule set:
*
* <a href="http://foobar.com">foo</a>
* ... becomes ...
* <a href="http://foobar.com" target="_blank" rel="nofollow">foo</a>
*
* <img align="left" src="http://foobar.com/image.png">
* ... becomes ...
* <img class="wysiwyg-float-left" src="http://foobar.com/image.png" alt="">
*
* <div>foo<script>alert(document.cookie)</script></div>
* ... becomes ...
* <div>foo</div>
*
* <marquee>foo</marquee>
* ... becomes ...
* <span>foo</marquee>
*
* foo <br clear="both"> bar
* ... becomes ...
* foo <br class="wysiwyg-clear-both"> bar
*
* <div>hello <iframe src="http://google.com"></iframe></div>
* ... becomes ...
* <div>hello </div>
*
* <center>hello</center>
* ... becomes ...
* <div class="wysiwyg-text-align-center">hello</div>
*/
var wysihtml5ParserRules = {
/**
* CSS Class white-list
* Following css classes won't be removed when parsed by the wysihtml5 html parser
*/
"classes": {
"wysiwyg-clear-both": 1,
"wysiwyg-clear-left": 1,
"wysiwyg-clear-right": 1,
"wysiwyg-color-aqua": 1,
"wysiwyg-color-black": 1,
"wysiwyg-color-blue": 1,
"wysiwyg-color-fuchsia": 1,
"wysiwyg-color-gray": 1,
"wysiwyg-color-green": 1,
"wysiwyg-color-lime": 1,
"wysiwyg-color-maroon": 1,
"wysiwyg-color-navy": 1,
"wysiwyg-color-olive": 1,
"wysiwyg-color-purple": 1,
"wysiwyg-color-red": 1,
"wysiwyg-color-silver": 1,
"wysiwyg-color-teal": 1,
"wysiwyg-color-white": 1,
"wysiwyg-color-yellow": 1,
"wysiwyg-float-left": 1,
"wysiwyg-float-right": 1,
"wysiwyg-font-size-large": 1,
"wysiwyg-font-size-larger": 1,
"wysiwyg-font-size-medium": 1,
"wysiwyg-font-size-small": 1,
"wysiwyg-font-size-smaller": 1,
"wysiwyg-font-size-x-large": 1,
"wysiwyg-font-size-x-small": 1,
"wysiwyg-font-size-xx-large": 1,
"wysiwyg-font-size-xx-small": 1,
"wysiwyg-text-align-center": 1,
"wysiwyg-text-align-justify": 1,
"wysiwyg-text-align-left": 1,
"wysiwyg-text-align-right": 1
},
/**
* Tag list
*
* Following options are available:
*
* - add_class: converts and deletes the given HTML4 attribute (align, clear, ...) via the given method to a css class
* The following methods are implemented in wysihtml5.dom.parse:
* - align_text: converts align attribute values (right/left/center/justify) to their corresponding css class "wysiwyg-text-align-*")
<p align="center">foo</p> ... becomes ... <p> class="wysiwyg-text-align-center">foo</p>
* - clear_br: converts clear attribute values left/right/all/both to their corresponding css class "wysiwyg-clear-*"
* <br clear="all"> ... becomes ... <br class="wysiwyg-clear-both">
* - align_img: converts align attribute values (right/left) on <img> to their corresponding css class "wysiwyg-float-*"
*
* - remove: removes the element and it's content
*
* - rename_tag: renames the element to the given tag
*
* - set_class: adds the given class to the element (note: make sure that the class is in the "classes" white list above)
*
* - set_attributes: sets/overrides the given attributes
*
* - check_attributes: checks the given HTML attribute via the given method
* - url: checks whether the given string is an url, deletes the attribute if not
* - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML)
* - numbers: ensures that the attribute only contains numeric characters
*/
"tags": {
"tr": {
"add_class": {
"align": "align_text"
}
},
"strike": {
"remove": 1
},
"form": {
"rename_tag": "div"
},
"rt": {
"rename_tag": "span"
},
"code": {},
"acronym": {
"rename_tag": "span"
},
"br": {
"add_class": {
"clear": "clear_br"
}
},
"details": {
"rename_tag": "div"
},
"h4": {
"add_class": {
"align": "align_text"
}
},
"em": {},
"title": {
"remove": 1
},
"multicol": {
"rename_tag": "div"
},
"figure": {
"rename_tag": "div"
},
"xmp": {
"rename_tag": "span"
},
"small": {
"rename_tag": "span",
"set_class": "wysiwyg-font-size-smaller"
},
"area": {
"remove": 1
},
"time": {
"rename_tag": "span"
},
"dir": {
"rename_tag": "ul"
},
"bdi": {
"rename_tag": "span"
},
"command": {
"remove": 1
},
"ul": {},
"progress": {
"rename_tag": "span"
},
"dfn": {
"rename_tag": "span"
},
"iframe": {
"remove": 1
},
"figcaption": {
"rename_tag": "div"
},
"a": {
"check_attributes": {
"href": "url"
},
"set_attributes": {
"rel": "nofollow",
"target": "_blank"
}
},
"img": {
"check_attributes": {
"width": "numbers",
"alt": "alt",
"src": "url",
"height": "numbers"
},
"add_class": {
"align": "align_img"
}
},
"rb": {
"rename_tag": "span"
},
"footer": {
"rename_tag": "div"
},
"noframes": {
"remove": 1
},
"abbr": {
"rename_tag": "span"
},
"u": {},
"bgsound": {
"remove": 1
},
"sup": {
"rename_tag": "span"
},
"address": {
"rename_tag": "div"
},
"basefont": {
"remove": 1
},
"nav": {
"rename_tag": "div"
},
"h1": {
"add_class": {
"align": "align_text"
}
},
"head": {
"remove": 1
},
"tbody": {
"add_class": {
"align": "align_text"
}
},
"dd": {
"rename_tag": "div"
},
"s": {
"rename_tag": "span"
},
"li": {},
"td": {
"check_attributes": {
"rowspan": "numbers",
"colspan": "numbers"
},
"add_class": {
"align": "align_text"
}
},
"object": {
"remove": 1
},
"div": {
"add_class": {
"align": "align_text"
}
},
"option": {
"rename_tag": "span"
},
"select": {
"rename_tag": "span"
},
"i": {},
"track": {
"remove": 1
},
"wbr": {
"remove": 1
},
"fieldset": {
"rename_tag": "div"
},
"big": {
"rename_tag": "span",
"set_class": "wysiwyg-font-size-larger"
},
"button": {
"rename_tag": "span"
},
"noscript": {
"remove": 1
},
"svg": {
"remove": 1
},
"input": {
"remove": 1
},
"table": {},
"keygen": {
"remove": 1
},
"h5": {
"add_class": {
"align": "align_text"
}
},
"meta": {
"remove": 1
},
"map": {
"rename_tag": "div"
},
"isindex": {
"remove": 1
},
"mark": {
"rename_tag": "span"
},
"caption": {
"add_class": {
"align": "align_text"
}
},
"tfoot": {
"add_class": {
"align": "align_text"
}
},
"base": {
"remove": 1
},
"video": {
"remove": 1
},
"strong": {},
"canvas": {
"remove": 1
},
"output": {
"rename_tag": "span"
},
"marquee": {
"rename_tag": "span"
},
"b": {},
"q": {
"check_attributes": {
"cite": "url"
}
},
"applet": {
"remove": 1
},
"span": {},
"rp": {
"rename_tag": "span"
},
"spacer": {
"remove": 1
},
"source": {
"remove": 1
},
"aside": {
"rename_tag": "div"
},
"frame": {
"remove": 1
},
"section": {
"rename_tag": "div"
},
"body": {
"rename_tag": "div"
},
"ol": {},
"nobr": {
"rename_tag": "span"
},
"html": {
"rename_tag": "div"
},
"summary": {
"rename_tag": "span"
},
"var": {
"rename_tag": "span"
},
"del": {
"remove": 1
},
"blockquote": {
"check_attributes": {
"cite": "url"
}
},
"style": {
"remove": 1
},
"device": {
"remove": 1
},
"meter": {
"rename_tag": "span"
},
"h3": {
"add_class": {
"align": "align_text"
}
},
"textarea": {
"rename_tag": "span"
},
"embed": {
"remove": 1
},
"hgroup": {
"rename_tag": "div"
},
"font": {
"rename_tag": "span",
"add_class": {
"size": "size_font"
}
},
"tt": {
"rename_tag": "span"
},
"noembed": {
"remove": 1
},
"thead": {
"add_class": {
"align": "align_text"
}
},
"blink": {
"rename_tag": "span"
},
"plaintext": {
"rename_tag": "span"
},
"xml": {
"remove": 1
},
"h6": {
"add_class": {
"align": "align_text"
}
},
"param": {
"remove": 1
},
"th": {
"check_attributes": {
"rowspan": "numbers",
"colspan": "numbers"
},
"add_class": {
"align": "align_text"
}
},
"legend": {
"rename_tag": "span"
},
"hr": {},
"label": {
"rename_tag": "span"
},
"dl": {
"rename_tag": "div"
},
"kbd": {
"rename_tag": "span"
},
"listing": {
"rename_tag": "div"
},
"dt": {
"rename_tag": "span"
},
"nextid": {
"remove": 1
},
"pre": {},
"center": {
"rename_tag": "div",
"set_class": "wysiwyg-text-align-center"
},
"audio": {
"remove": 1
},
"datalist": {
"rename_tag": "span"
},
"samp": {
"rename_tag": "span"
},
"col": {
"remove": 1
},
"article": {
"rename_tag": "div"
},
"cite": {},
"link": {
"remove": 1
},
"script": {
"remove": 1
},
"bdo": {
"rename_tag": "span"
},
"menu": {
"rename_tag": "ul"
},
"colgroup": {
"remove": 1
},
"ruby": {
"rename_tag": "span"
},
"h2": {
"add_class": {
"align": "align_text"
}
},
"ins": {
"rename_tag": "span"
},
"p": {
"add_class": {
"align": "align_text"
}
},
"sub": {
"rename_tag": "span"
},
"comment": {
"remove": 1
},
"frameset": {
"remove": 1
},
"optgroup": {
"rename_tag": "span"
},
"header": {
"rename_tag": "div"
}
}
};

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,9 @@
/*
*=require jquery.ui.all
*/
@import "compass";
@import "compass/reset";
@ -39,6 +43,8 @@
@import "admin/topics";
@import "admin/redactor";
@ -46,7 +52,7 @@
body {
-webkit-font-smoothing: antialiased;
width:100%;
font-size: 13px;
font-size: 16px;
font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial, Verdana, sans-serif;
padding: 0px;
margin: 0px;
@ -76,7 +82,7 @@ body {
}
.personnal{
width:140px;
width:250px;
float:right;
position:relative;
@ -107,7 +113,7 @@ body {
a{
display:block;
width:120px;
width:250px;
padding:10px 15px;
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,44 @@
.person_form{
.error_field{
*{
color:red;
}
input{
border-color:red;
}
}
.groups{
ol{
display:inline;
padding-start:0px;
padding:0px !important;
width:auto !important;
}
label{
width:auto;
}
li{
display:inline-block;
padding:0.1em 1em;
padding-left:0;
margin:0;
input{
position:inherit;
margin-right:0.2em;
}
}
}
}
.sheet_window{
h3{
background:#1b1b1b;
color:white;
}
@include border-radius(5px);
overflow:auto;
@include box-shadow(0px 0px 10px rgba(0,0,0,0.8));

View File

@ -0,0 +1,17 @@
# -*- encoding : utf-8 -*-
class Admins::PasswordsController < ::Devise::PasswordsController
layout "connexion"
def create
self.resource = resource_class.send_reset_password_instructions(params[resource_name])
if resource.errors.empty?
set_flash_message :notice, :send_instructions
redirect_to new_session_path(resource_name)
else
@flash_i= {}
@flash_i[:alert] = "Aucun compte associé à cette adresse mail n'a été trouvé."
render_with_scope :new
end
end
end

View File

@ -0,0 +1,5 @@
# -*- encoding : utf-8 -*-
class Admins::SessionsController < ::Devise::SessionsController
layout "connexion"
end

View File

@ -13,56 +13,51 @@ class NewslettersController < ApplicationController
# require_permission 'newsletter.send', :only => [:send_test, :send_newsletter, :select_recipients]
def index
redirect_to :action => :newsletter_list
@h2 = "Lister les newsletters éxistantes"
@newsletter= Newsletter.find(:all, :order => "created_at DESC")
end
def newsletter_new
def new
@h2 = "Creer une newsletter"
@newsletter = Newsletter.new
end
def newsletter_create
def create
@h2 = "Creer une newsletter"
@newsletter = Newsletter.new(params[:newsletter])
if @newsletter.save
to_my_log("Ajout de la newsletter "+@newsletter.id.to_s)
flash[:notice]= t('rest.create_message')
redirect_to :action => :newsletter_list
redirect_to :action => :index
else
render :action => :newsletter_new
render :action => :new
end
end
def newsletter_edit
def edit
@h2 = "Editer une newsletter"
@newsletter = Newsletter.find(params[:id])
end
def newsletter_update
def update
@h2 = "Editer une newsletter"
@newsletter = Newsletter.find(params[:id])
if @newsletter.update_attributes(params[:newsletter])
flash[:notice]= "La newsletter à été mise à jour"
to_my_log("Modification de la newsletter "+@newsletter.id.to_s)
redirect_to :action => :newsletter_list
redirect_to :action => :index
else
render :action => :newsletter_edit
render :action => :edit
end
end
def newsletter_list
@h2 = "Lister les newsletters éxistantes"
@newsletter= Newsletter.find(:all, :order => "created_at DESC")
end
def newsletter_del
def destroy
@newsletter = Newsletter.find(params[:id])
@newsletter.destroy
to_my_log("Suppression de la newsletter "+@newsletter.id.to_s)
flash[:notice]= "La newsletter à été supprimé avec succès"
redirect_to :action => :newsletter_list
redirect_to :action => :index
end
@ -70,24 +65,35 @@ class NewslettersController < ApplicationController
def send_test
@newsletter = Newsletter.find(params[:id])
Newsmailer.deliver_newsletter(@newsletter, params[:email])
NewsletterMails.newsletter(@newsletter, params[:email]).deliver
to_my_log("Envoi de la newsletter "+@newsletter.id.to_s+" en test")
flash[:notice]= "La newsletter a bien été envoyée à l'email de test"
redirect_to :action => :newsletter_list
redirect_to :action => :index
end
def send_helper(newsletter, email)
begin
NewsletterMails.newsletter(newsletter, email).deliver if email and email != ""
rescue
@errors << "<span class'error'>#{p.email}</span>"
end
end
def send_newsletter
@errors = []
@newsletter = Newsletter.find(params[:id])
if params[:confirmed_groups]
PeopleNewsgroup.all(:conditions => {:newsgroup_id => params[:confirmed_groups]}).each do |pn|
p =pn.person
Newsmailer.deliver_newsletter(@newsletter, p.email) if p.email and p.email != "" and p.newsletter
if pn.person
p =pn.person
send_helper(@newsletter, p.email) if p.newsletter
end
end
elsif params[:confirmed_sheets]
@ -98,19 +104,19 @@ class NewslettersController < ApplicationController
@persons = Person.find(:all, :conditions => {:sheet_id => params[:confirmed_sheets], :newsletter => true})
@persons.each do |p|
Newsmailer.deliver_newsletter(@newsletter, p.email) if p.email and p.email != ""
send_helper(@newsletter, p.email)
end
@sheets.each do |s|
Newsmailer.deliver_newsletter(@newsletter, s.other_mail) if s.other_mail and s.other_mail != ""
end
send_helper(@newsletter, s.other_mail)
end
end
to_my_log("Envoi de la newsletter "+@newsletter.id.to_s+" à une selection d'adresses mail")
flash[:notice]= "La newsletter a bien été envoyée à toutes les adresses mail séléctionnée"
redirect_to :action => :newsletter_list
redirect_to :action => :index
end
@ -121,10 +127,7 @@ class NewslettersController < ApplicationController
end
respond_to do |format|
format.html # index.html.erb
format.js { render(:update){|page| page.replace_html 'sheets_selecteds', :partial => "sheets_selecteds", :object => @sheets} }
end
end

View File

@ -190,7 +190,7 @@ require 'iconv'
if @sheet.update_attributes(params[:sheet])
flash[:notice] = 'Sheet was successfully updated.'
format.html { redirect_to(@sheet) }
format.js { render :action => "update", :layout => false }
format.js { render :action => "show", :layout => false }
format.xml { head :ok }
else
format.html { render :action => "edit" }

View File

@ -11,7 +11,7 @@ module DocumentLineHelper
fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder|
render(association.to_s + "/form", :form => builder)
end
link_to_function(name, "alert('test');add_fields(this, \"#{association}\", \"#{escape_javascript(fields)}\");")
link_to_function(name, "add_fields(this, \"#{association}\", \"#{escape_javascript(fields)}\");")
end
end

View File

@ -0,0 +1,19 @@
class NewsletterMails < ActionMailer::Base
layout 'mail'
default from: "Le Pic Vert <contact@lepicvert.asso.fr>"
def newsletter(newsletter,email)
@newsletter = newsletter
@email = email
@title = @newsletter.title
@content = @newsletter.content
mail(:to => @email, :from => "Le Pic Vert <contact@lepicvert.asso.fr>", :subject => @title)
end
end

View File

@ -2,4 +2,6 @@
class Donate < ActiveRecord::Base
belongs_to :sheet
attr_accessible :paid_at, :amount, :payment_type, :bank, :check_number
end

5
app/models/newsletter.rb Executable file
View File

@ -0,0 +1,5 @@
class Newsletter < ActiveRecord::Base
validates_presence_of :title
attr_accessible :title, :content
end

View File

@ -1,7 +1,7 @@
# -*- encoding : utf-8 -*-
class NoteFile < ActiveRecord::Base
attr_accessor :original_filename
attr_accessible :description, :file, :name, :slug, :note, :note_id, :file_cache, :original_filename
belongs_to :note
mount_uploader :file, FileUploader

View File

@ -9,6 +9,7 @@ class Person < ActiveRecord::Base
validates :surname, :presence => true
validates :firstname, :presence => true
# validates :email, :format => { :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i }
def name
self.firstname.to_s+" "+self.surname.to_s
end

View File

@ -12,15 +12,28 @@ class Sheet < ActiveRecord::Base
belongs_to :first_people, :class_name => "Person", :foreign_key => :first_people
validates :sheet_type, :presence => true
attr_accessible :sheet_type, :people_attributes, :corporate, :address, :address2, :address3, :pc, :city, :country, :skills
attr_accessible :donates_attributes, :sheet_type, :people_attributes, :sheet_years_attributes, :corporate, :address, :address2, :address3, :pc, :city, :country, :skills
accepts_nested_attributes_for :people
accepts_nested_attributes_for :people, :allow_destroy => true
accepts_nested_attributes_for :sheet_years, :allow_destroy => true
accepts_nested_attributes_for :donates, :allow_destroy => true
SHEET_TYPE = {1 => "adherent",2 => "sympathisant"}
before_save do
if !self.person and self.people.size > 0
puts "TEST"
self.person = self.people.first
end
end
def self.search_by_params(input)
requette = ""
requette += "(last_year IN(?))" if input[:sheet_year]

View File

@ -4,6 +4,8 @@ class SheetYear < ActiveRecord::Base
validates_presence_of :year
attr_accessible :year, :join_type, :benefactor, :gift_year, :paid_at, :amount, :payment_type, :bank, :check_number, :sheet_id
JOIN_TYPE = {1 => "Individuel", 2 => "Familial", 3 =>"Association"}
PAYMENT_TYPE = {1 => "Chèque", 2 => "Liquide"}

View File

@ -10,10 +10,12 @@
#rapid_links
=link_to "notes", topics_path
=link_to "admins (internet)", admin_admins_path
=link_to "urls courtes", tiny_urls_path
%ul#rapid_links
%li=link_to "notes", topics_path
%li=link_to "admins (internet)", admin_admins_path
%li=link_to "urls courtes", tiny_urls_path
%li=link_to "adhérents", sheets_path
%li=link_to "newsletters", newsletters_path

View File

@ -0,0 +1,9 @@
%h2 Resend confirmation instructions
= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f|
= devise_error_messages!
%p
= f.label :email
%br/
= f.text_field :email
%p= f.submit "Resend confirmation instructions"
= render :partial => "devise/shared/links"

View File

@ -0,0 +1,4 @@
%p
Welcome #{@resource.email}!
%p You can confirm your account through the link below:
%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token)

View File

@ -0,0 +1,6 @@
%p
Bonjour #{@resource.email}!
%p Quelqu'un a demandé un lien pour changer votre mot de passe, et vous pouvez le faire en suivant le lien ci-dessous :
%p= link_to edit_password_url(@resource, :reset_password_token => @resource.reset_password_token), edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)
%p Si vous n'avez pas demandé cela, merci d'ignorer ce mail.
%p Votre mot de passe ne sera pas changé tant que vous n'aurez pas suivi ce lien et spécifié un nouveau mot de passe.

View File

@ -0,0 +1,5 @@
%p
Hello #{@resource.email}!
%p Your account has been locked due to an excessive amount of unsuccessful sign in attempts.
%p Click the link below to unlock your account:
%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token)

View File

@ -0,0 +1,18 @@
-content_for :title do
%h1 Changer mon mot de passe.
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f|
= error_messages_for resource, :header_message => "Impossible d'enregistrer votre nouveau mot de passe."
= f.hidden_field :reset_password_token
%p
= f.label :password, "Nouveau mot de passe :"
%br/
= f.password_field :password
%p
= f.label :password_confirmation, "Confirmation :"
%br/
= f.password_field :password_confirmation
%p
%button{:type => "submit"} Changer mon mot de passe
%p= link_to "Se connecter", new_session_path(resource_name)

View File

@ -0,0 +1,11 @@
-content_for :title do
%h1 Mot de passe perdu ?
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f|
%p
= f.label :email, "Email :"
%br/
= f.text_field :email
%button{:type => "submot"} Recevoir les instructions pour changer de mot de passe.
%p= link_to "Se connecter", new_session_path(resource_name)

View File

@ -0,0 +1,27 @@
%h2
Edit #{resource_name.to_s.humanize}
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
= devise_error_messages!
%p
= f.label :email
%br/
= f.text_field :email
%p
= f.label :password
%i (leave blank if you don't want to change it)
%br/
= f.password_field :password
%p
= f.label :password_confirmation
%br/
= f.password_field :password_confirmation
%p
= f.label :current_password
%i (we need your current password to confirm your changes)
%br/
= f.password_field :current_password
%p= f.submit "Update"
%h3 Cancel my account
%p
Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete}.
= link_to "Back", :back

View File

@ -0,0 +1,17 @@
%h2 Sign up
= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
= devise_error_messages!
%p
= f.label :email
%br/
= f.text_field :email
%p
= f.label :password
%br/
= f.password_field :password
%p
= f.label :password_confirmation
%br/
= f.password_field :password_confirmation
%p= f.submit "Sign up"
= render :partial => "devise/shared/links"

View File

@ -0,0 +1,21 @@
-content_for :title do
%h1 Espace d'administration
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
%p
= f.label :username, "Login:"
%br/
= f.text_field :username
%p
= f.label :password, "Mot de passe :"
%br/
= f.password_field :password
%p
= f.check_box :remember_me
= f.label :remember_me, "Se rappeler de moi (connexion automatique)"
%button{:type => "submit"} Connexion
%p= link_to "Mot de passe perdu ?", new_password_path(resource_name)

View File

@ -0,0 +1,15 @@
- if controller_name != 'sessions'
= link_to "Sign in", new_session_path(resource_name)
%br/
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to "Sign up", new_registration_path(resource_name)
%br/
- if devise_mapping.recoverable? && controller_name != 'passwords'
= link_to "Forgot your password?", new_password_path(resource_name)
%br/
- if devise_mapping.confirmable? && controller_name != 'confirmations'
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
%br/
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
%br/

View File

@ -0,0 +1,9 @@
%h2 Resend unlock instructions
= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f|
= devise_error_messages!
%p
= f.label :email
%br/
= f.text_field :email
%p= f.submit "Resend unlock instructions"
= render :partial => "devise/shared/links"

View File

@ -0,0 +1,23 @@
#donate.sheet_block{:id => donate.id}
%p
Date de paiement :
=l donate.paid_at if donate.paid_at
%p
Montant :
=number_to_currency donate.amount if donate.amount
%p
Type de paiement :
=SheetYear::PAYMENT_TYPE[donate.payment_type] if donate.payment_type
-if donate.payment_type == 1
%p
Banque :
=donate.bank
%p
Numéro de chèque :
=donate.check_number

View File

@ -0,0 +1,24 @@
.field
= form.label :paid_at, "Date de paiement : "
= form.date_select :paid_at, :include_blank => true
= form.label :amount, "Montant : "
= form.text_field :amount
%br
= form.label :payment_type, "Type de paiement : "
= form.select :payment_type, SheetYear::PAYMENT_TYPE.map {|u| [u[1], u[0]] }, {},{:onchange => "check_form("+form.object.id.to_s+",$(this).val());"}
%br
#check_form{:id => form.object.id, :style => ("display:none;" if form.object.payment_type != 1)}
= form.label :bank, "Banque : "
= form.text_field :bank
= form.label :check_number, "Numéro du chèque : "
= form.text_field :check_number
= link_to_remove_fields i(:x_alt), form

View File

@ -7,8 +7,10 @@
Espace d'Administration
=javascript_include_tag "admin"
=stylesheet_link_tag "admin"
<script src="/ace_editor/ace-uncompressed-noconflict.js" type="text/javascript" charset="utf-8"></script>
= csrf_meta_tag
%style=Pygments.css('.highlight')
@ -39,7 +41,7 @@
=current_admin.name
.menu
=link_to "Se déconnecter", destroy_admin_session_path, :class => "logout_link"
=link_to "Se déconnecter", destroy_admin_session_path, :class => "logout_link",:method => :delete
%nav

View File

@ -0,0 +1,43 @@
!!!
%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" }
%title
Administration
= csrf_meta_tag
=javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"
=javascript_include_tag "connexion"
= stylesheet_link_tag 'connexion'
%body
#title=yield :title
#main
= yield
#flash
-if flash[:alert] or (@flash_i and @flash_i[:alert])
.message.closeable.alert
= flash[:alert]
= @flash_i[:alert] if @flash_i and @flash_i[:alert]
-if flash[:notice]
.message.closeable.notice
= flash[:notice]

View File

@ -0,0 +1,9 @@
!!!
%html
%head
%meta{ :"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8" }
%body
= yield

View File

@ -0,0 +1 @@
=@content

View File

@ -0,0 +1,28 @@
=form_for @newsletter do |f|
=f.submit "sauvegarder"
%p
Sujet :
=f.text_field :title, :class => "inputText"
%p
=f.text_area :content, :class => "redactor_content", :style => "height:600px;width:100%;max-width:100%"
:javascript
$('.redactor_content').redactor({
fixed: true,
lang: 'fr',
buttons : ['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted','underline','|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', '|','fontcolor', 'backcolor','|', 'horizontalrule'],
});
=f.submit "sauvegarder"

View File

@ -1,16 +0,0 @@
.links
=f.submit t('rest.save')
%p
Sujet :
=f.text_field :title, :class => "inputText"
%p
Contenu :
%p
=f.text_area :content, :class => "input_text tinymce", :style => "height:600px;width:100%"
.links
=f.submit t('rest.save')

View File

@ -1,5 +1,5 @@
-if @sheets
-form_tag :controller => "newsletters", :action => "send_newsletter", :id => params[:id] do
=form_tag send_newsletter_newsletter_path(params[:id]) do
#sheets_checkboxs
-@sheets.sort{|u,v| ((u.person.surname if u.person) || u.corporate).to_s <=>(( v.person.surname if v.person )|| v.corporate).to_s}.each do |sheet|
=check_box_tag "confirmed_sheets[]", sheet.id,true, :id => "confirmed_sheets_"+sheet.id.to_s

View File

@ -0,0 +1,4 @@
%h1 Modifier une newsletter
=render :partial => "form"

View File

@ -0,0 +1,27 @@
.links
=link_to "Créer une newsletter", new_newsletter_path
%table.admin_table#newsletters-list
%tr
%th Sujet
%th
%th
-for u in @newsletter
- klass = cycle("a","b")
%tr
%td
= u.title
%td
- if has_permission?('newsletter.send')
=form_tag send_test_newsletter_path(u) do
= text_field_tag :email
= submit_tag "Envoyer un email de test", :class => "lien"
%td.link-column{:style => "width:200px;"}
= link_to "Editer", edit_newsletter_path(u)
= link_to "Effacer", u, :method => :delete, :confirm => 'Voulez-vous vraiment supprimer cette newsletter ?'
= link_to "Envoyer", select_recipients_newsletter_path(u)

View File

@ -0,0 +1,3 @@
%h1 Créer une newsletter
=render :partial => "form"

View File

@ -1,5 +0,0 @@
%h1 Modifier une newsletter
-form_for @newsletter, :url => {:action => :newsletter_update, :id => @newsletter.id} do |f|
=render :partial => "form_newsletter", :locals => {:f => f}

View File

@ -1,27 +0,0 @@
.links
=link_to "Créer une newsletter", {:action => :newsletter_new}, :class => "lien" if has_permission?('newsletter.add')
%table.admin_table#newsletters-list
%tr
%th Sujet
%th
%th
-for u in @newsletter
- klass = cycle("a","b")
%tr
%td
= truncate(u.title, 70)
%td
- if has_permission?('newsletter.send')
-form_tag :action => :send_test, :id => u.id do
= text_field_tag :email
= submit_tag "Envoyer un email de test", :class => "lien"
%td.link-column{:style => "width:200px;"}
= link_to "Editer", { :action => :newsletter_edit, :id => u.id}, :class => "lien" if has_permission?('newsletter.edit')
= link_to "Effacer", { :action => :newsletter_del , :id => u.id}, :confirm => 'Voulez-vous vraiment supprimer cette newsletter ?', :class => "lien" if has_permission?('newsletter.delete')
= link_to "Envoyer", { :action => :select_recipients, :id => u.id}, :class => "lien" if has_permission?('newsletter.send')

View File

@ -1,3 +0,0 @@
%h1 Créer une newsletter
-form_for @newsletter, :url => {:action => :newsletter_create} do |f|
=render :partial => "form_newsletter", :locals => {:f => f}

View File

@ -16,7 +16,7 @@
%h2 Envoyer la newsletter directement à un ou plusieurs groupes d'inscrit :
-form_tag :controller => "newsletters", :action => "send_newsletter", :id => params[:id] do
=form_tag :controller => "newsletters", :action => "send_newsletter", :id => params[:id] do
-Newsgroup.all.each do |ng|
=check_box_tag "confirmed_groups[]", ng.id,false, :id => "confirmed_sheets_"+ng.id.to_s
%label{:for => "confirmed_groups_"+ng.id.to_s}=ng.name

View File

@ -0,0 +1 @@
$("#sheets_selecteds").html("<%= escape_javascript(render(:partial => "sheets_selecteds"))%>");

View File

@ -1,14 +1,33 @@
%div{:style => "width:50%;float:right"}
=form.inputs do
=form.input :newsgroups, :as => :check_boxes, :collection => Newsgroup.all, :label => "Groupes"
%div{:style => "width:50%;"}
=form.inputs do
=form.input :newsletter
=form.input :surname, :placeholder => "Nom"
=form.input :firstname , :placeholder => "Prénom"
=form.input :email, :placeholder => "Email"
=form.input :phone, :placeholder => "Téléphone"
=form.input :job, :placeholder => "Profession"
.field
.person_form
.person
%table
%tr
%td=form.label :newsletter, "Newsletter"
%td=form.label :surname, "Nom", :style => ("color:red;" if form.object.errors.include?(:surname))
%td=form.label :firstname, "Prénom", :style => ("color:red;" if form.object.errors.include?(:firstname))
%td=form.label :email, "Email", :style => ("color:red;" if form.object.errors.include?(:email))
%td=form.label :phone, "Tél"
%td=form.label :job, "Job"
%td.del{:rowspan => 2}
= link_to_remove_fields i(:x_alt), form
%tr
%td=form.check_box :newsletter, :place_holder => "Newsletter"
%td=form.text_field :surname, :place_holder => "Nom", :style => ("border-color:red;" if form.object.errors.include?(:surname))
%td=form.text_field :firstname, :place_holder => "Prénom", :style => ("border-color:red;" if form.object.errors.include?(:firstname))
%td=form.text_field :email, :place_holder => "Email", :style => ("border-color:red;" if form.object.errors.include?(:email))
%td=form.text_field :phone, :place_holder => "Tél"
%td=form.text_field :job, :place_holder => "Job"
%tr.groups
%td{:colspan => 6}
=form.input :newsgroups, :as => :check_boxes, :collection => Newsgroup.all, :label => ""

View File

@ -1,5 +0,0 @@
page.replace_html 'sheet_peoples', :partial => "people/person",:collection => @sheet.people
page.replace_html 'new_sheet_people', ""

View File

@ -1,44 +0,0 @@
<h1>Editing person</h1>
<% form_for(@person) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :newsletter %><br />
<%= f.check_box :newsletter %>
</p>
<p>
<%= f.label :surname %><br />
<%= f.text_field :surname %>
</p>
<p>
<%= f.label :firstname %><br />
<%= f.text_field :firstname %>
</p>
<p>
<%= f.label :email %><br />
<%= f.text_field :email %>
</p>
<p>
<%= f.label :phone %><br />
<%= f.text_field :phone %>
</p>
<p>
<%= f.label :job %><br />
<%= f.text_field :job %>
</p>
<p>
<%= f.label :sheet %><br />
<%= f.text_field :sheet %>
</p>
<p>
<%= f.label :positon %><br />
<%= f.text_field :positon %>
</p>
<p>
<%= f.submit 'Update' %>
</p>
<% end %>
<%= link_to 'Show', @person %> |
<%= link_to 'Back', people_path %>

View File

@ -1,34 +0,0 @@
<h1>Listing people</h1>
<table>
<tr>
<th>Newsletter</th>
<th>Surname</th>
<th>Firstname</th>
<th>Email</th>
<th>Phone</th>
<th>Job</th>
<th>Sheet</th>
<th>Positon</th>
</tr>
<% @people.each do |person| %>
<tr>
<td><%=h person.newsletter %></td>
<td><%=h person.surname %></td>
<td><%=h person.firstname %></td>
<td><%=h person.email %></td>
<td><%=h person.phone %></td>
<td><%=h person.job %></td>
<td><%=h person.sheet %></td>
<td><%=h person.positon %></td>
<td><%= link_to 'Show', person %></td>
<td><%= link_to 'Edit', edit_person_path(person) %></td>
<td><%= link_to 'Destroy', person, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New person', new_person_path %>

View File

@ -1,2 +0,0 @@
=render :partial => "form"

View File

@ -1,49 +1,42 @@
%div{:class => ("sheet_block" if !@sheet_year.id)}
.field
= form.label :year, "Année :"
= form.text_field :year
= form.label :join_type , "Type d'adhésion : "
= form.select :join_type, SheetYear::JOIN_TYPE.map {|u| [u[1], u[0]] }
-remote_form_for(@sheet_year) do |f|
= f.error_messages
= form.label :benefactor, "Bienfaiteur : "
= form.check_box :benefactor
= f.label :year, "Année :"
= f.text_field :year
%br
= form.label :gift_year, "Année d'adhésion offerte : "
= form.check_box :gift_year, :onchange => "payment_form("+form.object.id.to_s+",$(this).attr('checked'));"
= f.label :join_type , "Type d'adhésion : "
= f.select :join_type, SheetYear::JOIN_TYPE.map {|u| [u[1], u[0]] }
%br
= f.label :benefactor, "Bienfaiteur : "
= f.check_box :benefactor
#payment_form{:id => form.object.id, :style => ("display:none;" if form.object.gift_year)}
= form.label :paid_at, "Date de paiement : "
= form.date_select :paid_at, :include_blank => true
= form.label :amount, "Montant : "
= form.text_field :amount
%br
= f.label :gift_year, "Année d'adhésion offerte : "
= f.check_box :gift_year, :onchange => "payment_form("+@sheet_year.id.to_s+",$(this).attr('checked'));"
%br
#payment_form{:id => @sheet_year.id, :style => ("display:none;" if @sheet_year.gift_year)}
= f.label :paid_at, "Date de paiement : "
= f.date_select :paid_at, :include_blank => true
= f.label :amount, "Montant : "
= f.text_field :amount
%br
= f.label :payment_type, "Type de paiement : "
= f.select :payment_type, SheetYear::PAYMENT_TYPE.map {|u| [u[1], u[0]] }, {},{:onchange => "check_form("+@sheet_year.id.to_s+",$(this).val());"}
= form.label :payment_type, "Type de paiement : "
= form.select :payment_type, SheetYear::PAYMENT_TYPE.map {|u| [u[1], u[0]] }, {},{:onchange => "check_form("+form.object.id.to_s+",$(this).val());"}
%br
#check_form{:id => @sheet_year.id, :style => ("display:none;" if @sheet_year.payment_type != 1)}
= f.label :bank, "Banque : "
= f.text_field :bank
%br
#check_form{:id => form.object.id, :style => ("display:none;" if form.object.payment_type != 1)}
= form.label :bank, "Banque : "
= form.text_field :bank
= f.label :check_number, "Numéro du chèque : "
= f.text_field :check_number
= form.label :check_number, "Numéro du chèque : "
= form.text_field :check_number
= f.hidden_field :sheet_id
= f.submit 'Sauvegarder'
-if @sheet_year.id
= link_to_remote 'Annuler', :url => @sheet_year, :method => :get
-else
= link_to 'Annuler', "#", :onclick => "$('#new_sheet_year').html('');return false;"
= form.hidden_field :sheet_id
= link_to_remove_fields i(:x_alt), form

View File

@ -1,5 +0,0 @@
page.replace_html 'sheet_years', :partial => "sheet_years/sheet_year",:collection => @sheet.sheet_years
page.replace_html 'new_sheet_year', ""

View File

@ -1,44 +0,0 @@
<h1>Editing sheet_year</h1>
<% form_for(@sheet_year) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :join_type %><br />
<%= f.text_field :join_type %>
</p>
<p>
<%= f.label :gift_year %><br />
<%= f.check_box :gift_year %>
</p>
<p>
<%= f.label :benefactor %><br />
<%= f.check_box :benefactor %>
</p>
<p>
<%= f.label :paid_at %><br />
<%= f.date_select :paid_at %>
</p>
<p>
<%= f.label :amount %><br />
<%= f.text_field :amount %>
</p>
<p>
<%= f.label :payment_type %><br />
<%= f.text_field :payment_type %>
</p>
<p>
<%= f.label :bank %><br />
<%= f.text_field :bank %>
</p>
<p>
<%= f.label :check_number %><br />
<%= f.text_field :check_number %>
</p>
<p>
<%= f.submit 'Update' %>
</p>
<% end %>
<%= link_to 'Show', @sheet_year %> |
<%= link_to 'Back', sheet_years_path %>

View File

@ -1,34 +0,0 @@
<h1>Listing sheet_years</h1>
<table>
<tr>
<th>Join type</th>
<th>Gift year</th>
<th>Benefactor</th>
<th>Paid at</th>
<th>Amount</th>
<th>Payment type</th>
<th>Bank</th>
<th>Check number</th>
</tr>
<% @sheet_years.each do |sheet_year| %>
<tr>
<td><%=h sheet_year.join_type %></td>
<td><%=h sheet_year.gift_year %></td>
<td><%=h sheet_year.benefactor %></td>
<td><%=h sheet_year.paid_at %></td>
<td><%=h sheet_year.amount %></td>
<td><%=h sheet_year.payment_type %></td>
<td><%=h sheet_year.bank %></td>
<td><%=h sheet_year.check_number %></td>
<td><%= link_to 'Show', sheet_year %></td>
<td><%= link_to 'Edit', edit_sheet_year_path(sheet_year) %></td>
<td><%= link_to 'Destroy', sheet_year, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New sheet_year', new_sheet_year_path %>

View File

@ -1 +0,0 @@
=render :partial => "form"

View File

@ -3,12 +3,14 @@
=form.input :sheet_type, :as => :select, :collection => Sheet::SHEET_TYPE.map {|u| [u[1], u[0]] }, :include_blank => false
%h3 Foyer
%p= link_to_add_fields "Ajouter une ligne", form, :people
.people_form
=form.semantic_fields_for :people do |form|
=render :partial => "people/form", :locals => {:form => form}
%h3 Généralités
=form.input :corporate, :label => "Organisation"
=form.input :address, :label => "Adresse"
@ -19,7 +21,17 @@
=form.input :country, :label => "Pays", :as => :string
=form.input :skills, :label => "Compétences"
%h3 Années d'adhésions
%p= link_to_add_fields "Ajouter une année", form, :sheet_years
.sheet_years_form
=form.semantic_fields_for :sheet_years do |form|
=render :partial => "sheet_years/form", :locals => {:form => form}
%h3 Dons
%p= link_to_add_fields "Ajouter un don", form, :donates
.donates_form
=form.semantic_fields_for :donates do |form|
=render :partial => "donates/form", :locals => {:form => form}
= form.submit 'Enregistrer'
= link_to 'Annuler', :url => sheet_path(@sheet), :method => :get, :remote => true if @sheet.id

View File

@ -17,7 +17,6 @@
=sheet.other_mail
%td.link-column
%strong=#"Alerte" if sheet.sheet_years.count(:conditions => {:year => 2010}) >1
=link_to 'Modifier', edit_sheet_path(sheet), :method => :get, :remote => true
=link_to "Voir", sheet, :class => "lien", :remote => true
=link_to "Supprimer", sheet, :method => :delete, :confirm => "*********ATTENTION*********\n Supprimer cette fiche entrainera la suppression de toutes traces concernant celle-ci : y compris les traces d'années d'adhésion, pouvant donc fausser les statistiques de l'ensemble du fichier. \n \nVous pouvez convertir la fiche en fiche 'sympathisant'.\n\n\ Pour annuler cliquez sur 'annuler', pour supprimer cette fiche malgrès cet avertissement cliquez sur 'OK'. \n\n", :class => "lien"

View File

@ -1,5 +1,5 @@
#sheet_search
=form_tag(url,{:method => :post, :remote => true, :onsubmit => "$('#sheets').html('<center>Chargement en cours...</center>');"}) do
=form_tag(url,{:method => :put, :remote => true, :onsubmit => "$('#sheets').html('<center>Chargement en cours...</center>');"}) do
%table.sheet_search
%tr
%td

View File

@ -1,6 +1,6 @@
#sheet_show
.links{:style => "float:right;"}
=link_to "Retour", @sheet, :class => "lien", :remote => true
=link_to "Retour", @sheet, :class => "lien", :remote => true, :confirm => "Attention, les changements éventuellements apportés ne seront pas sauvegardés."
%h1 Modifier une fiche
= semantic_form_for [@sheet], :remote => true do |form|

View File

@ -10,8 +10,7 @@
=@sheet.first_year
="/"
=@sheet.last_year
=#debug Sheet.all(:conditions => ['"first_year".year == ?', 2006], :include => :first_year)
%h2 Cette adhésion regroupe :
= link_to 'Ajouter', :url => new_person_path(:sheet_id => @sheet), :update => "new_sheet_people", :method => :get, :remote => true #if has_permission?('adherent.edit')
#new_sheet_people
@ -20,24 +19,22 @@
%h2 Informations principales
= link_to 'Modifier', :url => edit_sheet_path(@sheet), :update => "sheet_detail", :method => :get, :remote => true #if has_permission?('adherent.edit')
#sheet_detail.sheet_block=render :partial => "sheet_detail"
%h2 Années d'adhésion
= link_to 'Ajouter', :url => new_sheet_year_path(:sheet_id => @sheet), :update => "new_sheet_year", :method => :get, :remote => true #if has_permission?('adherent.edit')
#new_sheet_year
#new_sheet_years
#sheet_years
=render @sheet.sheet_years
%h2 Dons
= link_to 'Ajouter', :url => new_donate_path(:sheet_id => @sheet), :update => "new_donate", :method => :get, :remote => true #if has_permission?('adherent.edit')
#new_donate
#new_donates
#donates
=#render @sheet.donates
=render @sheet.donates

View File

@ -38,8 +38,9 @@ Survey::Application.configure do
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
config.assets.debug = false
config.action_mailer.delivery_method = :file
config.action_mailer.default_url_options = { :host => HOSTNAME }

View File

@ -49,7 +49,7 @@ Survey::Application.configure do
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
config.assets.precompile += %w( admin.js admin.css forum.css forum.js plaquettes.css plaquettes.js )
config.assets.precompile += %w( admin.js admin.css forum.css forum.js plaquettes.css plaquettes.js connexion.js connexion.css )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false

View File

@ -40,7 +40,7 @@ Survey::Application.routes.draw do
resources :newsletters do
member do
get "select_recipients"
post "select_recipients"
put "select_recipients"
post "send_test"
post "send_newsletter"
end
@ -65,13 +65,13 @@ Survey::Application.routes.draw do
collection do
get 'stats'
get 'recus'
post 'index'
put 'index'
end
end
devise_for :admins
devise_for :admins, :controllers => {:sessions => "admins/sessions", :passwords => "admins/passwords"}
match 'u/:id' => 'tiny_urls#show', :as => :tiny_url
@ -143,7 +143,7 @@ Survey::Application.routes.draw do
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
root :to => 'survey_sets#new'
root :to => 'admin/dashboard#index'
# See how all your routes lay out with "rake routes"

View File

@ -0,0 +1,15 @@
class CreateNewsletters < ActiveRecord::Migration
def self.up
create_table :newsletters do |t|
t.string :title
t.text :content
t.datetime :sendmail
t.boolean :archive
t.timestamps
end
end
def self.down
drop_table :newsletters
end
end

View File

@ -49,14 +49,14 @@ ActiveRecord::Schema.define(:version => 20130115105842) do
create_table "donates", :force => true do |t|
t.date "paid_at"
t.decimal "amount", :precision => 10, :scale => 0
t.integer "amount"
t.integer "payment_type"
t.string "bank"
t.string "check_number"
t.text "comment"
t.integer "sheet_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "forum_categories", :force => true do |t|
@ -135,8 +135,17 @@ ActiveRecord::Schema.define(:version => 20130115105842) do
create_table "newsgroups", :force => true do |t|
t.string "name"
t.text "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "newsletters", :force => true do |t|
t.string "title"
t.text "content"
t.datetime "sendmail"
t.boolean "archive"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "note_files", :force => true do |t|

View File

@ -0,0 +1,20 @@
require 'test_helper'
class NewsletterMailsTest < ActionMailer::TestCase
test "mail" do
mail = NewsletterMails.mail
assert_equal "Mail", mail.subject
assert_equal ["to@example.org"], mail.to
assert_equal ["from@example.com"], mail.from
assert_match "Hi", mail.body.encoded
end
test "newsletter" do
mail = NewsletterMails.newsletter
assert_equal "Newsletter", mail.subject
assert_equal ["to@example.org"], mail.to
assert_equal ["from@example.com"], mail.from
assert_match "Hi", mail.body.encoded
end
end