commit
8e1ab17f15
16 changed files with 101 additions and 112 deletions
|
@ -1,4 +1,4 @@
|
||||||
.administrateurs-activate.container {
|
.container.devise-container {
|
||||||
margin-top: 60px;
|
margin-top: 60px;
|
||||||
margin-bottom: 60px;
|
margin-bottom: 60px;
|
||||||
}
|
}
|
32
app/controllers/users/confirmations_controller.rb
Normal file
32
app/controllers/users/confirmations_controller.rb
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class Users::ConfirmationsController < Devise::ConfirmationsController
|
||||||
|
layout "new_application"
|
||||||
|
|
||||||
|
# GET /resource/confirmation/new
|
||||||
|
# def new
|
||||||
|
# super
|
||||||
|
# end
|
||||||
|
|
||||||
|
# POST /resource/confirmation
|
||||||
|
# def create
|
||||||
|
# super
|
||||||
|
# end
|
||||||
|
|
||||||
|
# GET /resource/confirmation?confirmation_token=abcdef
|
||||||
|
# def show
|
||||||
|
# super
|
||||||
|
# end
|
||||||
|
|
||||||
|
# protected
|
||||||
|
|
||||||
|
# The path used after resending confirmation instructions.
|
||||||
|
# def after_resending_confirmation_instructions_path_for(resource_name)
|
||||||
|
# super(resource_name)
|
||||||
|
# end
|
||||||
|
|
||||||
|
# The path used after confirmation.
|
||||||
|
# def after_confirmation_path_for(resource_name, resource)
|
||||||
|
# super(resource_name, resource)
|
||||||
|
# end
|
||||||
|
end
|
|
@ -1,4 +1,6 @@
|
||||||
class Users::PasswordsController < Devise::PasswordsController
|
class Users::PasswordsController < Devise::PasswordsController
|
||||||
|
layout "new_application"
|
||||||
|
|
||||||
after_action :try_to_authenticate_gestionnaire, only: [:update]
|
after_action :try_to_authenticate_gestionnaire, only: [:update]
|
||||||
after_action :try_to_authenticate_administrateur, only: [:update]
|
after_action :try_to_authenticate_administrateur, only: [:update]
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
class ProcedurePresentation < ApplicationRecord
|
class ProcedurePresentation < ApplicationRecord
|
||||||
|
EXTRA_SORT_COLUMNS = {
|
||||||
|
'notifications' => Set['notifications'],
|
||||||
|
'self' => Set['id', 'state']
|
||||||
|
}
|
||||||
|
|
||||||
belongs_to :assign_to
|
belongs_to :assign_to
|
||||||
|
|
||||||
delegate :procedure, to: :assign_to
|
delegate :procedure, to: :assign_to
|
||||||
|
@ -40,6 +45,6 @@ class ProcedurePresentation < ApplicationRecord
|
||||||
private
|
private
|
||||||
|
|
||||||
def valid_sort_column?(procedure, table, column)
|
def valid_sort_column?(procedure, table, column)
|
||||||
DossierFieldService.valid_column?(procedure, table, column) || (table == 'notifications' && column == 'notifications')
|
DossierFieldService.valid_column?(procedure, table, column) || EXTRA_SORT_COLUMNS[table]&.include?(column)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -76,49 +76,6 @@
|
||||||
Cette démarche n’a pas encore de lien, et n’est donc pas accessible par le public.
|
Cette démarche n’a pas encore de lien, et n’est donc pas accessible par le public.
|
||||||
|
|
||||||
%br
|
%br
|
||||||
%h3 Détails
|
|
||||||
|
|
||||||
.row{ style: 'margin-right: 3%; margin-left: 3%;' }
|
|
||||||
.description.col-xs-6.col-md-3.procedure-description
|
|
||||||
%h4.text-info
|
|
||||||
= @procedure.libelle
|
|
||||||
|
|
||||||
= h string_to_html(@procedure.description)
|
|
||||||
|
|
||||||
.champs.col-xs-6.col-md-3
|
|
||||||
%h4.text-info
|
|
||||||
Champs
|
|
||||||
.badge.progress-bar-info
|
|
||||||
= @procedure.types_de_champ.size
|
|
||||||
%ul
|
|
||||||
- @procedure.types_de_champ.order(:order_place).each do |champ|
|
|
||||||
%li= champ.libelle
|
|
||||||
|
|
||||||
.champs_private.col-xs-6.col-md-3
|
|
||||||
%h4.text-info
|
|
||||||
Annotations privées
|
|
||||||
.badge.progress-bar-info
|
|
||||||
= @procedure.types_de_champ_private.size
|
|
||||||
%ul
|
|
||||||
- @procedure.types_de_champ_private.order(:order_place).each do |champ|
|
|
||||||
%li= champ.libelle
|
|
||||||
|
|
||||||
.pieces-justificatives.col-xs-6.col-md-3
|
|
||||||
%h4.text-info
|
|
||||||
Pièces jointes
|
|
||||||
.badge.progress-bar-info
|
|
||||||
= @procedure.types_de_piece_justificative.size
|
|
||||||
- @procedure.types_de_piece_justificative.each do |piece_justificative|
|
|
||||||
= piece_justificative.libelle
|
|
||||||
%br
|
|
||||||
|
|
||||||
- durees_de_conservation = politiques_conservation_de_donnees(@procedure)
|
|
||||||
- if durees_de_conservation.present?
|
|
||||||
.row{ style: 'margin-right: 3%; margin-left: 3%;' }
|
|
||||||
.col-xs-6.col-md-3
|
|
||||||
%h4.text-info Conservation des données
|
|
||||||
- durees_de_conservation.each do |text|
|
|
||||||
%p= text
|
|
||||||
|
|
||||||
- if @procedure.publiee_ou_archivee?
|
- if @procedure.publiee_ou_archivee?
|
||||||
%h3 Supprimer la démarche
|
%h3 Supprimer la démarche
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
- content_for :footer do
|
- content_for :footer do
|
||||||
= render partial: "root/footer"
|
= render partial: "root/footer"
|
||||||
|
|
||||||
.administrateurs-activate.container
|
.container.devise-container
|
||||||
.one-column-centered
|
.one-column-centered
|
||||||
= form_for @administrateur, url: { controller: 'administrateurs/activate', action: :create }, html: { class: "form" } do |f|
|
= form_for @administrateur, url: { controller: 'administrateurs/activate', action: :create }, html: { class: "form" } do |f|
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control'
|
= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control'
|
||||||
%br
|
%br
|
||||||
%h4
|
%h4
|
||||||
= f.label 'Retaper le mot de passe'
|
= f.label 'Confirmez le nouveau mot de passe'
|
||||||
.input-group
|
.input-group
|
||||||
.input-group-addon
|
.input-group-addon
|
||||||
%span.fa.fa-asterisk
|
%span.fa.fa-asterisk
|
||||||
|
@ -25,5 +25,5 @@
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
.actions
|
.actions
|
||||||
= f.submit "Changer", class: 'btn btn-primary'
|
= f.submit 'Changer le mot de passe', class: 'btn btn-primary'
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -17,5 +17,5 @@
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
.actions
|
.actions
|
||||||
= f.submit "Renvoyer", class: 'btn btn-primary'
|
= f.submit 'Réinitialiser', class: 'btn btn-primary'
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#procedure-list
|
#procedure-list
|
||||||
%a#onglet-infos{ href: url_for(admin_procedure_path(@procedure)) }
|
%a#onglet-infos{ href: url_for(admin_procedure_path(@procedure)) }
|
||||||
.procedure-list-element{ class: ('active' if active == 'Informations') }
|
.procedure-list-element{ class: ('active' if active == 'Informations') }
|
||||||
Informations
|
Publication
|
||||||
|
|
||||||
%a#onglet-services{ href: current_administrateur.services.present? ? url_for(services_path(procedure_id: @procedure.id)) : url_for(new_service_path(procedure_id: @procedure.id)) }
|
%a#onglet-services{ href: current_administrateur.services.present? ? url_for(services_path(procedure_id: @procedure.id)) : url_for(new_service_path(procedure_id: @procedure.id)) }
|
||||||
.procedure-list-element
|
.procedure-list-element
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
<h2>Renvoyer les instructions de confirmation de compte</h2>
|
|
||||||
|
|
||||||
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
|
||||||
<%= devise_error_messages! %>
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :email %><br />
|
|
||||||
<%= f.email_field :email, autofocus: true %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="actions">
|
|
||||||
<%= f.submit "Renvoyer les instructions de confirmation" %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= render "users/shared/links" %>
|
|
17
app/views/users/confirmations/new.html.haml
Normal file
17
app/views/users/confirmations/new.html.haml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
- content_for(:title, 'Renvoyer les instructions de confirmation de compte')
|
||||||
|
|
||||||
|
- content_for :footer do
|
||||||
|
= render partial: 'root/footer'
|
||||||
|
|
||||||
|
.container.devise-container
|
||||||
|
.one-column-centered
|
||||||
|
= devise_error_messages!
|
||||||
|
|
||||||
|
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { class: 'form' }) do |f|
|
||||||
|
|
||||||
|
%h1 Renvoyer les instructions de confirmation de compte
|
||||||
|
|
||||||
|
= f.label :email, 'Email'
|
||||||
|
= f.email_field :email, autofocus: true
|
||||||
|
|
||||||
|
= f.submit 'Renvoyer les instructions de confirmation', class: 'button primary'
|
|
@ -1,29 +1,22 @@
|
||||||
|
- content_for(:title, 'Changement de mot de passe')
|
||||||
|
|
||||||
|
- content_for :footer do
|
||||||
|
= render partial: 'root/footer'
|
||||||
|
|
||||||
|
.container.devise-container
|
||||||
|
.one-column-centered
|
||||||
= devise_error_messages!
|
= devise_error_messages!
|
||||||
|
|
||||||
#form-login
|
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :patch, class: 'form' }) do |f|
|
||||||
%h2#gestionnaire_login Changement de mot de passe
|
|
||||||
|
%h1 Changement de mot de passe
|
||||||
|
|
||||||
%br
|
|
||||||
%br
|
|
||||||
#new-user
|
|
||||||
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
|
|
||||||
= f.hidden_field :reset_password_token
|
= f.hidden_field :reset_password_token
|
||||||
%h4
|
|
||||||
= f.label 'Nouveau mot de passe'
|
|
||||||
|
|
||||||
.input-group
|
= f.label 'Nouveau mot de passe'
|
||||||
.input-group-addon
|
= f.password_field :password, autofocus: true, autocomplete: 'off'
|
||||||
%span.fa.fa-asterisk
|
|
||||||
= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control'
|
= f.label 'Confirmez le nouveau mot de passe'
|
||||||
%br
|
= f.password_field :password_confirmation, autocomplete: 'off'
|
||||||
%h4
|
|
||||||
= f.label 'Retaper le mot de passe'
|
= f.submit 'Changer le mot de passe', class: 'button primary'
|
||||||
.input-group
|
|
||||||
.input-group-addon
|
|
||||||
%span.fa.fa-asterisk
|
|
||||||
= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control'
|
|
||||||
%br
|
|
||||||
%br
|
|
||||||
.actions
|
|
||||||
= f.submit "Changer", class: 'btn btn-primary'
|
|
||||||
%br
|
|
||||||
|
|
|
@ -1,21 +1,17 @@
|
||||||
|
- content_for(:title, 'Mot de passe oublié')
|
||||||
|
|
||||||
|
- content_for :footer do
|
||||||
|
= render partial: 'root/footer'
|
||||||
|
|
||||||
|
.container.devise-container
|
||||||
|
.one-column-centered
|
||||||
= devise_error_messages!
|
= devise_error_messages!
|
||||||
|
|
||||||
%br
|
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { class: 'form' }) do |f|
|
||||||
#form-login
|
|
||||||
%h2#gestionnaire_login Mot de passe oublié
|
|
||||||
|
|
||||||
%br
|
%h1 Mot de passe oublié
|
||||||
%br
|
|
||||||
#new-user
|
= f.label :email, 'Email'
|
||||||
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
|
= f.email_field :email, autofocus: true
|
||||||
%h4
|
|
||||||
= f.label :email
|
= f.submit 'Réinitialier', class: 'button primary'
|
||||||
.input-group
|
|
||||||
.input-group-addon
|
|
||||||
%span.fa.fa-user
|
|
||||||
= f.email_field :email, class: 'form-control', placeholder: 'Email'
|
|
||||||
%br
|
|
||||||
%br
|
|
||||||
.actions
|
|
||||||
= f.submit "Renvoyer", class: 'btn btn-primary'
|
|
||||||
%br
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ fr:
|
||||||
not_found_in_database: "adresse email ou mot de passe invalide."
|
not_found_in_database: "adresse email ou mot de passe invalide."
|
||||||
timeout: "Votre session est expirée. Veuillez vous reconnecter pour continuer."
|
timeout: "Votre session est expirée. Veuillez vous reconnecter pour continuer."
|
||||||
unauthenticated: "Vous devez vous connecter ou vous inscrire pour continuer."
|
unauthenticated: "Vous devez vous connecter ou vous inscrire pour continuer."
|
||||||
unconfirmed: "Vous devez activer votre compte pour continuer."
|
unconfirmed: "Vous devez confirmer votre adresse email pour continuer. Cliquez sur le lien qui vous a été envoyé par email."
|
||||||
mailer:
|
mailer:
|
||||||
confirmation_instructions:
|
confirmation_instructions:
|
||||||
subject: "Instructions d'activation de votre compte"
|
subject: "Instructions d'activation de votre compte"
|
||||||
|
@ -34,7 +34,7 @@ fr:
|
||||||
no_token: "Vous ne pouvez accéder à cette page sans passer par un email de réinitialisation de mot de passe. Si vous êtes passé par un email de ce type, assurez-vous d'utiliser l'URL complète."
|
no_token: "Vous ne pouvez accéder à cette page sans passer par un email de réinitialisation de mot de passe. Si vous êtes passé par un email de ce type, assurez-vous d'utiliser l'URL complète."
|
||||||
send_instructions: "Vous allez recevoir les instructions de réinitialisation du mot de passe dans quelques instants"
|
send_instructions: "Vous allez recevoir les instructions de réinitialisation du mot de passe dans quelques instants"
|
||||||
send_paranoid_instructions: "Si votre adresse email existe dans notre base de données, vous allez recevoir un lien de réinitialisation par email"
|
send_paranoid_instructions: "Si votre adresse email existe dans notre base de données, vous allez recevoir un lien de réinitialisation par email"
|
||||||
updated: "Votre mot de passe a été édité avec succès, vous êtes maintenant connecté"
|
updated: "Votre mot de passe a été changé avec succès, vous êtes maintenant connecté"
|
||||||
updated_not_active: "Votre mot de passe a été changé avec succès."
|
updated_not_active: "Votre mot de passe a été changé avec succès."
|
||||||
registrations:
|
registrations:
|
||||||
destroyed: "Votre compte a été supprimé avec succès. Nous espérons vous revoir bientôt."
|
destroyed: "Votre compte a été supprimé avec succès. Nous espérons vous revoir bientôt."
|
||||||
|
|
|
@ -73,6 +73,7 @@ Rails.application.routes.draw do
|
||||||
devise_for :users, controllers: {
|
devise_for :users, controllers: {
|
||||||
sessions: 'users/sessions',
|
sessions: 'users/sessions',
|
||||||
registrations: 'users/registrations',
|
registrations: 'users/registrations',
|
||||||
|
confirmations: 'users/confirmations',
|
||||||
passwords: 'users/passwords'
|
passwords: 'users/passwords'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@ describe ProcedurePresentation do
|
||||||
|
|
||||||
context 'of sort' do
|
context 'of sort' do
|
||||||
it { expect(build(:procedure_presentation, sort: { "table" => "notifications", "column" => "notifications", "order" => "asc" })).to be_valid }
|
it { expect(build(:procedure_presentation, sort: { "table" => "notifications", "column" => "notifications", "order" => "asc" })).to be_valid }
|
||||||
|
it { expect(build(:procedure_presentation, sort: { "table" => "self", "column" => "id", "order" => "asc" })).to be_valid }
|
||||||
|
it { expect(build(:procedure_presentation, sort: { "table" => "self", "column" => "state", "order" => "asc" })).to be_valid }
|
||||||
it { expect(build(:procedure_presentation, sort: { "table" => "user", "column" => "reset_password_token", "order" => "asc" })).to be_invalid }
|
it { expect(build(:procedure_presentation, sort: { "table" => "user", "column" => "reset_password_token", "order" => "asc" })).to be_invalid }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue