commit
9018a493d2
11 changed files with 109 additions and 23 deletions
|
@ -1,7 +1,7 @@
|
|||
- content_for(:title, 'Expiration du délai de conservation des dossiers')
|
||||
|
||||
- if @expired_dossiers.present?
|
||||
%h1= t('mail.administration.dossier_expiration_summary.expired_dossiers', count: @expired_dossiers.count)
|
||||
%h2= t('mail.administration.dossier_expiration_summary.expired_dossiers', count: @expired_dossiers.count)
|
||||
- @expired_dossiers.group_by(&:procedure).each do |procedure, dossiers|
|
||||
%dl
|
||||
%dt
|
||||
|
@ -10,7 +10,7 @@
|
|||
= dossiers.map { |d| link_to(d.id, manager_dossier_url(d)) }.join(', ').html_safe
|
||||
|
||||
- if @expiring_dossiers.present?
|
||||
%h1= t('mail.administration.dossier_expiration_summary.expiring_dossiers', count: @expiring_dossiers.count)
|
||||
%h2= t('mail.administration.dossier_expiration_summary.expiring_dossiers', count: @expiring_dossiers.count)
|
||||
- @expiring_dossiers.group_by(&:procedure).each do |procedure, dossiers|
|
||||
%dl
|
||||
%dt
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
- content_for(:title, 'Vous avez été invité à donner votre avis')
|
||||
|
||||
- content_for(:title, 'Invitation à donner votre avis')
|
||||
- avis_link = @avis.gestionnaire.present? ? gestionnaire_avis_url(@avis) : sign_up_gestionnaire_avis_url(@avis.id, @avis.email)
|
||||
|
||||
- content_for(:footer) do
|
||||
|
@ -21,7 +20,7 @@
|
|||
%p
|
||||
= "#{@avis.claimant.email} vous a écrit :"
|
||||
%br
|
||||
%p{ style: "padding: 8px; color: #333333; background-color: #EEEEEE; font-size: 16px;" }
|
||||
%p{ style: "padding: 8px; color: #333333; background-color: #EEEEEE; font-size: 14px;" }
|
||||
= @avis.introduction
|
||||
|
||||
- if @avis.gestionnaire.present?
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
- content_for(:title, @subject)
|
||||
|
||||
%p
|
||||
Bonjour,
|
||||
|
||||
%p
|
||||
Voici le résumé de votre activité hebdomadaire :
|
||||
|
||||
- @overview[:procedure_overviews].each_with_index do |procedure_overview, index|
|
||||
|
||||
%h2{ style: 'font-size: 20px; font-weight: 300; margin: 25px 0 5px;' }
|
||||
%h2{ style: 'font-size: 16px; font-weight: 300; margin: 25px 0 5px;' }
|
||||
#{procedure_overview.procedure.libelle}
|
||||
= link_to 'voir', gestionnaire_procedure_url(procedure_overview.procedure), style: 'color: #0069CC; font-size: 14px;'
|
||||
%table{ cellpadding: '0', cellspacing: '0', style: 'width: 100%; padding-bottom: 20px;' }
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
%p
|
||||
L'utilisateur
|
||||
= @invite.email_sender
|
||||
souhaite que vous participiez à l'élaboration d'un dossier sur demarches-simplifiees.fr.
|
||||
souhaite que vous participiez à l'élaboration d'un dossier pour la démarche
|
||||
%strong= @invite.dossier.procedure.libelle
|
||||
sur demarches-simplifiees.fr.
|
||||
|
||||
%p
|
||||
Cette plateforme permet à ses utilisateurs d'établir des dossiers 100 % en ligne et de dialoguer avec plusieurs interlocuteurs privilégiés avant d'instruire un dépot.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
class AdministrateurMailerPreview < ActionMailer::Preview
|
||||
def activate_before_expiration
|
||||
AdministrateurMailer.activate_before_expiration(Administrateur.inactive.where.not(reset_password_token: nil).last)
|
||||
administrateur = Administrateur.new(reset_password_sent_at: Time.now.utc)
|
||||
|
||||
AdministrateurMailer.activate_before_expiration(administrateur, "a4d4e4f4b4d445")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,17 +1,42 @@
|
|||
class AdministrationMailerPreview < ActionMailer::Preview
|
||||
def dubious_procedures
|
||||
procedures_and_champs = [
|
||||
[Procedure.first, [TypeDeChamp.new(libelle: 'iban'), TypeDeChamp.new(libelle: 'religion')]],
|
||||
[Procedure.last, [TypeDeChamp.new(libelle: 'iban'), TypeDeChamp.new(libelle: 'numéro de carte bleu')]]
|
||||
[procedure_1, [TypeDeChamp.new(libelle: 'iban'), TypeDeChamp.new(libelle: 'religion')]],
|
||||
[procedure_2, [TypeDeChamp.new(libelle: 'iban'), TypeDeChamp.new(libelle: 'numéro de carte bleu')]]
|
||||
]
|
||||
AdministrationMailer.dubious_procedures(procedures_and_champs)
|
||||
end
|
||||
|
||||
def invite_admin
|
||||
AdministrationMailer.invite_admin(Administrateur.last, "12345678", 0)
|
||||
AdministrationMailer.invite_admin(administrateur, "12345678", 0)
|
||||
end
|
||||
|
||||
def refuse_admin
|
||||
AdministrationMailer.refuse_admin('bad_admin@pipo.com')
|
||||
end
|
||||
|
||||
def new_admin
|
||||
administration = Administration.new(email: 'superadmin@demarches-simplifiees.fr')
|
||||
AdministrationMailer.new_admin_email(administrateur, administration)
|
||||
end
|
||||
|
||||
def dossier_expiration_summary
|
||||
expiring_dossiers = [Dossier.new(id: 100, procedure: procedure_1)]
|
||||
expired_dossiers = [Dossier.new(id: 100, procedure: procedure_2)]
|
||||
AdministrationMailer.dossier_expiration_summary(expiring_dossiers, expired_dossiers)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def procedure_1
|
||||
Procedure.new(id: 10, libelle: "Démarche des marches", administrateur: administrateur)
|
||||
end
|
||||
|
||||
def procedure_2
|
||||
Procedure.new(id: 20, libelle: "Démarche pieds", administrateur: administrateur)
|
||||
end
|
||||
|
||||
def administrateur
|
||||
Administrateur.new(id: 111, email: "chef.de.service@administration.gouv.fr")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
# Preview all emails at http://localhost:3000/rails/mailers/avis_mailer
|
||||
class AvisMailerPreview < ActionMailer::Preview
|
||||
def avis_invitation
|
||||
AvisMailer.avis_invitation(Avis.last)
|
||||
gestionaire = Gestionnaire.new(id: 1, email: 'jeanmichel.de-chauvigny@exemple.fr')
|
||||
avis = Avis.new(id: 1, email: 'test@exemple.fr', claimant: gestionaire)
|
||||
avis.dossier = Dossier.new(id: 1)
|
||||
avis.dossier.procedure = Procedure.new(libelle: 'Démarche pour faire des marches')
|
||||
avis.introduction = 'Il faudrait vérifier le certificat de conformité.'
|
||||
AvisMailer.avis_invitation(avis)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
class DeviseUserMailerPreview < ActionMailer::Preview
|
||||
def confirmation_instructions
|
||||
DeviseUserMailer.confirmation_instructions(User.first, "faketoken", {})
|
||||
DeviseUserMailer.confirmation_instructions(user, "faketoken", {})
|
||||
end
|
||||
|
||||
def reset_password_instructions
|
||||
DeviseUserMailer.reset_password_instructions(User.first, "faketoken", {})
|
||||
DeviseUserMailer.reset_password_instructions(user, "faketoken", {})
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def user
|
||||
User.new(id: 10, email: "usager@example.com")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,18 +1,32 @@
|
|||
# Preview all emails at http://localhost:3000/rails/mailers/dossier_mailer
|
||||
class DossierMailerPreview < ActionMailer::Preview
|
||||
def notify_new_draft
|
||||
DossierMailer.notify_new_draft(Dossier.last)
|
||||
DossierMailer.notify_new_draft(dossier)
|
||||
end
|
||||
|
||||
def notify_new_answer
|
||||
DossierMailer.notify_new_answer(Dossier.last)
|
||||
DossierMailer.notify_new_answer(dossier)
|
||||
end
|
||||
|
||||
def notify_deletion_to_user
|
||||
DossierMailer.notify_deletion_to_user(DeletedDossier.last, "user@ds.fr")
|
||||
DossierMailer.notify_deletion_to_user(deleted_dossier, "user@ds.fr")
|
||||
end
|
||||
|
||||
def notify_deletion_to_administration
|
||||
DossierMailer.notify_deletion_to_administration(DeletedDossier.last, "admin@ds.fr")
|
||||
DossierMailer.notify_deletion_to_administration(deleted_dossier, "admin@ds.fr")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def deleted_dossier
|
||||
DeletedDossier.new(dossier_id: 1, procedure: procedure)
|
||||
end
|
||||
|
||||
def dossier
|
||||
Dossier.new(id: 1, procedure: procedure, user: User.new(email: "usager@example.com"))
|
||||
end
|
||||
|
||||
def procedure
|
||||
Procedure.new(libelle: 'Démarche pour des marches')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,14 +1,35 @@
|
|||
class GestionnaireMailerPreview < ActionMailer::Preview
|
||||
def last_week_overview
|
||||
gestionnaire = Gestionnaire.first
|
||||
GestionnaireMailer.last_week_overview(gestionnaire)
|
||||
GestionnaireMailer.last_week_overview(Gestionnaire.first)
|
||||
end
|
||||
|
||||
def send_dossier
|
||||
GestionnaireMailer.send_dossier(Gestionnaire.first, Dossier.first, Gestionnaire.last)
|
||||
GestionnaireMailer.send_dossier(gestionnaire, Dossier.new(id: 10, procedure: procedure), target_gestionnaire)
|
||||
end
|
||||
|
||||
def send_login_token
|
||||
GestionnaireMailer.send_login_token(Gestionnaire.first, "token")
|
||||
GestionnaireMailer.send_login_token(gestionnaire, "token")
|
||||
end
|
||||
|
||||
def invite_gestionnaire
|
||||
GestionnaireMailer.invite_gestionnaire(gestionnaire, 'aedfa0d0')
|
||||
end
|
||||
|
||||
def user_to_gestionnaire
|
||||
GestionnaireMailer.user_to_gestionnaire(gestionnaire.email)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def gestionnaire
|
||||
Gestionnaire.new(id: 10, email: 'instructeur@administration.gouv.fr')
|
||||
end
|
||||
|
||||
def target_gestionnaire
|
||||
Gestionnaire.new(id: 12, email: 'collegue@administration.gouv.fr')
|
||||
end
|
||||
|
||||
def procedure
|
||||
Procedure.new(id: 15)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
class UserMailerPreview < ActionMailer::Preview
|
||||
def new_account_warning
|
||||
UserMailer.new_account_warning(User.first)
|
||||
UserMailer.new_account_warning(user)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def user
|
||||
User.new(id: 10, email: 'test@exemple.fr')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue