From 06a595570f729fecc9524f03879a13fc9967fe12 Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Sun, 20 Jul 2014 21:57:41 +0200 Subject: [PATCH] debug --- app/assets/stylesheets/student.scss | 15 ++++++- .../admin/student_groups_controller.rb | 2 +- .../student/student_users_controller.rb | 23 +++++++--- app/mailers/student_mails.rb | 6 +++ app/models/student_group.rb | 2 +- .../admin/data_files/_data_file.html.haml | 4 +- .../admin/file_folders/_file_folder.html.haml | 2 +- app/views/admin/student_groups/_show.haml | 45 +++++++++++++++++++ .../student_groups/_student_group.html.haml | 6 ++- .../admin/student_groups/index.html.haml | 2 +- app/views/admin/student_groups/show.js.erb | 1 + .../student_users/_student_user.html.haml | 8 ++-- .../render_public/_downloadcontent.html.haml | 4 +- app/views/student/student_users/new.haml | 33 +++++++++++++- .../student_mails/new_account_admin.haml | 6 +++ 15 files changed, 136 insertions(+), 23 deletions(-) create mode 100644 app/views/admin/student_groups/_show.haml create mode 100644 app/views/admin/student_groups/show.js.erb create mode 100644 app/views/student_mails/new_account_admin.haml diff --git a/app/assets/stylesheets/student.scss b/app/assets/stylesheets/student.scss index 4beb13d..2373d50 100644 --- a/app/assets/stylesheets/student.scss +++ b/app/assets/stylesheets/student.scss @@ -2,7 +2,20 @@ @import "fontawesome/font-awesome"; @import "./redactor"; -.download_content a{ +.translucide{ +max-width: 900px; +padding: 30px; +margin: 20px auto ; +background:rgba(255,255,255,.7); +border-radius :5px; +box-shadow: 0 1px 2px rgba(0,0,0,.05); +color:rgba(0,0,0,.5); +label{ color:rgba(0,0,0,.5); } +p:last-child{ margin-bottom:0px;} +} + + +.download_link a{ display:block; padding:5px 10px; diff --git a/app/controllers/admin/student_groups_controller.rb b/app/controllers/admin/student_groups_controller.rb index 3f524f3..09686ce 100644 --- a/app/controllers/admin/student_groups_controller.rb +++ b/app/controllers/admin/student_groups_controller.rb @@ -53,7 +53,7 @@ class Admin::StudentGroupsController < ApplicationController @student_group = StudentGroup.find(params[:id]) @student_group.destroy if @student_group != @current_student_group - + render :layout => false end private diff --git a/app/controllers/student/student_users_controller.rb b/app/controllers/student/student_users_controller.rb index e5b6f1a..93ad3e5 100644 --- a/app/controllers/student/student_users_controller.rb +++ b/app/controllers/student/student_users_controller.rb @@ -29,17 +29,26 @@ class Student::StudentUsersController < ApplicationController @user = StudentUser.new(params.require(:student_user).permit!) @user.lock = true @user.locked_at = Time.now - if @user.save + if params[:conditions] + if @user.save - @user.authenticate(params[:password]) - session[:student_user_id] = @user.id - redirect_to student_root_path, notice: "Vous êtes désormais inscrit." + @user.authenticate(params[:password]) + session[:student_user_id] = @user.id + + StudentMails.new_account_admin(@user).deliver + + redirect_to student_root_path, notice: "Vous êtes désormais inscrit. Vous pourrez vous connecter une fois votre compte vérifié." - else - render :action => "new" - end + else + render :action => "new" + end + else + @condition_error = true + render :action => "new" + + end end def update diff --git a/app/mailers/student_mails.rb b/app/mailers/student_mails.rb index b0c5a32..f72d47f 100644 --- a/app/mailers/student_mails.rb +++ b/app/mailers/student_mails.rb @@ -8,6 +8,12 @@ class StudentMails < ActionMailer::Base @options = options mail(:to => student_user.email, :subject => "Réinitialisation de votre mot de passe.") end + + + def new_account_admin(student_user) + mail(:to => "genevieve.gagos@technique-eft.com", :subject => "Nouvel étudiant inscrit.") + + end diff --git a/app/models/student_group.rb b/app/models/student_group.rb index b58d1b0..144ad09 100644 --- a/app/models/student_group.rb +++ b/app/models/student_group.rb @@ -1,7 +1,7 @@ class StudentGroup < ActiveRecord::Base has_many :student_user_groups - has_many :student_user, :through => :student_user_groups + has_many :student_users, :through => :student_user_groups has_many :topic_student_groups has_many :topics, :through => :topic_student_groups diff --git a/app/views/admin/data_files/_data_file.html.haml b/app/views/admin/data_files/_data_file.html.haml index 913a684..5699d48 100644 --- a/app/views/admin/data_files/_data_file.html.haml +++ b/app/views/admin/data_files/_data_file.html.haml @@ -15,6 +15,6 @@ %td{:style => "width:100px;"} =link_to i(:"download"), data_file.file.url - = link_to i(:trash), admin_data_file_path(:id => data_file.id, :manager => params[:manager], :multiple => params[:multiple]), :data => {:confirm => 'Voulez-vous vraiment supprimer cette image ?'}, :method => :delete, :remote => true - = link_to i(:ok), "#",:onclick => "manager_send_data_file("+data_file.id.to_s+");return false;" if params[:manager] and !params[:multiple] + = link_to i(:"trash-o"), admin_data_file_path(:id => data_file.id, :manager => params[:manager], :multiple => params[:multiple]), :data => {:confirm => 'Voulez-vous vraiment supprimer cette image ?'}, :method => :delete, :remote => true + = link_to i(:"check"), "#",:onclick => "manager_send_data_file("+data_file.id.to_s+");return false;" if params[:manager] and !params[:multiple] diff --git a/app/views/admin/file_folders/_file_folder.html.haml b/app/views/admin/file_folders/_file_folder.html.haml index e463235..5785a87 100644 --- a/app/views/admin/file_folders/_file_folder.html.haml +++ b/app/views/admin/file_folders/_file_folder.html.haml @@ -6,7 +6,7 @@ = link_to i(:pencil),edit_admin_file_folder_url(:id => params[:file_folder_id], :file_folder_id => params[:file_folder_id], :manager => params[:manager], :multiple => params[:multiple]), :remote => true, :id => "edit_current_file_folder", :style => "display:inline-block; margin-right:5px;" - = link_to i(:trash), admin_file_folder_url(:id => params[:file_folder_id],:file_folder_id => params[:file_folder_id], :manager => params[:manager], :multiple => params[:multiple]), :remote => true, :id => "remove_current_file_folder", :method => :delete, :confirm => "Voulez-vous vraiment supprimer cet file_folder ? Attention, toutes les images de celui-ci seront définitivement supprimées.", :style => "display:inline-block;" + = link_to i(:"trash-o"), admin_file_folder_url(:id => params[:file_folder_id],:file_folder_id => params[:file_folder_id], :manager => params[:manager], :multiple => params[:multiple]), :remote => true, :id => "remove_current_file_folder", :method => :delete, :confirm => "Voulez-vous vraiment supprimer cet file_folder ? Attention, toutes les images de celui-ci seront définitivement supprimées.", :style => "display:inline-block;" diff --git a/app/views/admin/student_groups/_show.haml b/app/views/admin/student_groups/_show.haml new file mode 100644 index 0000000..1a9755a --- /dev/null +++ b/app/views/admin/student_groups/_show.haml @@ -0,0 +1,45 @@ +.content + %h2 + Liste des étudiants du groupe : + =@student_group.name + + + + %table.table.table-hover + %thead#Admin_rows_header.rows_header + + %tr + %td + + %td + Nom + %td + Adresse + %td + Email + %td + Téléphone + + + + + + + %tbody#admin_rows.rows + + =render @student_group.student_users + +.actions + + + + + + + + + + + + + diff --git a/app/views/admin/student_groups/_student_group.html.haml b/app/views/admin/student_groups/_student_group.html.haml index ecdb738..731e9cc 100644 --- a/app/views/admin/student_groups/_student_group.html.haml +++ b/app/views/admin/student_groups/_student_group.html.haml @@ -1,11 +1,13 @@ -%tr.vertical_center.student_group#student_group{:id => student_group.id} +%tr.vertical_center.student_group#student_group_row{:id => student_group.id} %td=student_group.name %td.actions = link_to i(:"trash-o"), [:admin, student_group], :confirm => 'Voulez-vous vraiment supprimer cet utilisateur ?', :method => :delete, :remote => true - = link_to i(:pencil), edit_admin_student_group_path(student_group) + = link_to i(:pencil), edit_admin_student_group_path(student_group), :remote => true + + = link_to i(:eye), [:admin, student_group], :remote => true diff --git a/app/views/admin/student_groups/index.html.haml b/app/views/admin/student_groups/index.html.haml index 03d6bdb..f6a3cc7 100644 --- a/app/views/admin/student_groups/index.html.haml +++ b/app/views/admin/student_groups/index.html.haml @@ -14,7 +14,7 @@ Nom - %td{:style => "width:100px"} + %td{:style => "width:120px"}   diff --git a/app/views/admin/student_groups/show.js.erb b/app/views/admin/student_groups/show.js.erb new file mode 100644 index 0000000..1613e0b --- /dev/null +++ b/app/views/admin/student_groups/show.js.erb @@ -0,0 +1 @@ +show_pane_hover("<%= escape_javascript(render(:partial => "show"))%>",700,900); \ No newline at end of file diff --git a/app/views/admin/student_users/_student_user.html.haml b/app/views/admin/student_users/_student_user.html.haml index 3804dd8..cbdeca3 100644 --- a/app/views/admin/student_users/_student_user.html.haml +++ b/app/views/admin/student_users/_student_user.html.haml @@ -17,10 +17,12 @@ =student_user.tel %td ="Verouillé" if student_user.lock - %td.actions - = link_to i(:"trash-o"), [:admin, student_user], :confirm => 'Voulez-vous vraiment supprimer cet utilisateur ?', :method => :delete, :remote => true - = link_to i(:pencil), edit_admin_student_user_path(student_user) + -if !@student_group + %td.actions + = link_to i(:"trash-o"), [:admin, student_user], :confirm => 'Voulez-vous vraiment supprimer cet utilisateur ?', :method => :delete, :remote => true + + = link_to i(:pencil), edit_admin_student_user_path(student_user) diff --git a/app/views/portlets/render_public/_downloadcontent.html.haml b/app/views/portlets/render_public/_downloadcontent.html.haml index f86c9f4..760bedf 100644 --- a/app/views/portlets/render_public/_downloadcontent.html.haml +++ b/app/views/portlets/render_public/_downloadcontent.html.haml @@ -2,11 +2,11 @@ - .portlet.download_content + .download_link =link_to ic(:"cloud-download")+raw("   ")+input.title.to_s, input.data_file.file.url -else - .portlet.download_content + .download_link =link_to input.title.to_s, "" diff --git a/app/views/student/student_users/new.haml b/app/views/student/student_users/new.haml index a461917..14d0042 100644 --- a/app/views/student/student_users/new.haml +++ b/app/views/student/student_users/new.haml @@ -1,4 +1,4 @@ -.form-signin +.translucide %h1 M'inscrire @@ -6,8 +6,37 @@ = semantic_form_for [:student, @user] do |f| =render :partial => "form_min", :locals => {:f => f} - + %h2 Conditions relatives à cet espace. + .pad{:style => "border:1px solid rgba(66,139,202,1);"} + %p Ce nouveau service est uniquement réservé à ceux de mes étudiants qui s’investissent dans leur supervision individuelle. + Il complète cette supervision mais ne la remplace pas. De ce fait l’étudiant qui cesserait l’envoi des cas serait immédiatement radié de cet espace. + + %p Vous y trouverez différentes ressources que je mettrai à votre disposition au fil des semaines et mois à venir, afin de vous permettre d'affiner votre pratique personnelle de l'EFT par l'étude d'autres cas supervisés ou de retranscrits de séances dignes d’intérêts. + + %p Ces documents doivent impérativement rester dans le cadre de la formation et sont donc soumis au secret professionnel propre à la formation. + Ils ne peuvent être ni partagés avec d'autres, ni servir pour votre communication, ni pour tout autre utilisation que le caractère consultatif pour lequel ils sont ici stockés. + + %p Le seul fait de vous inscrire sur cet espace engage votre totale responsabilité dans le respect des conditions ci-dessus. + Tout contrevenant sera passible de poursuites. Je serai intransigeante ! + %br + -if @condition_error + .alert.alert-danger + Vous devez accepter les conditions relatives à cet espace. + %p + =check_box_tag :conditions, true, params[:conditions] + =label_tag :conditions, "J'accepte les conditions relatives à cet espace." %br =f.submit "Sauvegarder", :class => "btn btn-primary" + %br + %br + %p J'espère que cet espace vous rendra le service pour lequel il a été spécifiquement créé. + + %p N'hésitez pas à me faire part de vos commentaires directement par messagerie. + + %p J'en tiendrai compte selon leur pertinence et dans la mesure de mes %p possibilités. + + %p À bientôt + + %p Geneviève \ No newline at end of file diff --git a/app/views/student_mails/new_account_admin.haml b/app/views/student_mails/new_account_admin.haml new file mode 100644 index 0000000..5ffe1cc --- /dev/null +++ b/app/views/student_mails/new_account_admin.haml @@ -0,0 +1,6 @@ + +%p + Un nouvel étudiant c'est inscrit : +%p{:style => "text-align:center;"} + -url = "http://ecole-eft-france.fr/admin" + =link_to url, url