Merge branch 'dev'
This commit is contained in:
commit
c27c01530d
23 changed files with 166 additions and 10 deletions
|
@ -23,6 +23,17 @@
|
|||
}
|
||||
}
|
||||
|
||||
.radios {
|
||||
label {
|
||||
display: inline;
|
||||
margin-left: $default-padding;
|
||||
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
input[type=text]:not([data-address='true']),
|
||||
input[type=email],
|
||||
input[type=password],
|
||||
|
@ -153,7 +164,7 @@
|
|||
}
|
||||
|
||||
.header-section {
|
||||
color: #4393F3;
|
||||
color: $blue;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
margin-bottom: 2 * $default-padding;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
display: inline-block;
|
||||
}
|
||||
|
||||
a {
|
||||
.tab-link {
|
||||
display: inline-block;
|
||||
height: 72px;
|
||||
line-height: 72px;
|
||||
|
@ -41,8 +41,61 @@
|
|||
&:hover {
|
||||
color: $blue;
|
||||
border-bottom: 2px solid $blue;
|
||||
|
||||
&.contact-link {
|
||||
border-bottom: none;
|
||||
|
||||
.contact-details {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contact-details {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: -165px;
|
||||
background: #FFFFFF;
|
||||
border: 2px solid $blue;
|
||||
border-radius: 5px;
|
||||
padding: 15px;
|
||||
width: 400px;
|
||||
color: $black;
|
||||
z-index: 100;
|
||||
font-size: initial;
|
||||
line-height: 1.6;
|
||||
|
||||
&::after,
|
||||
&::before {
|
||||
bottom: 100%;
|
||||
left: 50%;
|
||||
border: solid transparent;
|
||||
content: " ";
|
||||
height: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&::after {
|
||||
border-color: rgba(255, 255, 255, 0);
|
||||
border-bottom-color: #FFFFFF;
|
||||
border-width: 15px;
|
||||
margin-left: -15px;
|
||||
}
|
||||
|
||||
&::before {
|
||||
border-color: rgba(255, 255, 255, 0);
|
||||
border-bottom-color: $blue;
|
||||
border-width: 18px;
|
||||
margin-left: -18px;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: disc;
|
||||
}
|
||||
}
|
||||
|
||||
.header-right-content {
|
||||
|
|
|
@ -69,6 +69,7 @@ class Users::SessionsController < Sessions::SessionsController
|
|||
private
|
||||
|
||||
def error_procedure
|
||||
session["user_return_to"] = nil
|
||||
flash.alert = t('errors.messages.procedure_not_found')
|
||||
redirect_to url_for root_path
|
||||
end
|
||||
|
|
|
@ -355,6 +355,14 @@ class Dossier < ActiveRecord::Base
|
|||
sanitize_sql_for_order(order)
|
||||
end
|
||||
|
||||
def owner_name
|
||||
if entreprise.present?
|
||||
entreprise.raison_sociale
|
||||
elsif individual.present?
|
||||
"#{individual.nom} #{individual.prenom}"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def build_attestation
|
||||
|
|
|
@ -11,16 +11,25 @@
|
|||
%ul.header-tabs
|
||||
- if current_gestionnaire.procedures.count > 0
|
||||
%li
|
||||
= link_to "Procédures", procedures_path, class: (controller_name != 'avis') ? "active" : nil
|
||||
= link_to "Procédures", procedures_path, class: (controller_name != 'avis') ? "tab-link active" : 'tab-link'
|
||||
- if current_gestionnaire.avis.count > 0
|
||||
%li
|
||||
= link_to avis_index_path, class: (controller_name == 'avis') ? "active" : nil do
|
||||
= link_to avis_index_path, class: (controller_name == 'avis') ? "tab-link active" : 'tab-link' do
|
||||
Avis
|
||||
- avis_counter = current_gestionnaire.avis.without_answer.count
|
||||
- if avis_counter > 0
|
||||
%span.badge.warning= avis_counter
|
||||
%li
|
||||
= link_to "Ancienne interface", backoffice_dossiers_path
|
||||
= link_to "Ancienne interface", backoffice_dossiers_path, class: 'tab-link'
|
||||
%li
|
||||
.tab-link.contact-link
|
||||
Contact
|
||||
.contact-details
|
||||
Vous avez besoin d’aide ? Contactez-nous :
|
||||
%br
|
||||
– par téléphone : 09 72 62 57 12
|
||||
%br
|
||||
– par email : <a href="mailto:contact@tps.apientreprise.fr">contact@tps.apientreprise.fr</a>
|
||||
|
||||
%ul.header-right-content
|
||||
- if gestionnaire_signed_in?
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
= csrf_meta_tags
|
||||
|
||||
%title
|
||||
= t("dynamics.page_title")
|
||||
= content_for?(:title) ? yield(:title) : "TPS - Téléprocédures simplifiées"
|
||||
|
||||
= favicon_link_tag(image_url("favicons/16x16.png"), type: "image/png", sizes: "16x16")
|
||||
= favicon_link_tag(image_url("favicons/32x32.png"), type: "image/png", sizes: "32x32")
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
- avis_statut = (@statut == NewGestionnaire::AvisController::A_DONNER_STATUS) ? 'à donner' : 'rendus'
|
||||
- content_for(:title, "Avis #{avis_statut}")
|
||||
|
||||
#avis-index
|
||||
.backoffice-header
|
||||
.container.flex
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
- content_for(:title, "Avis · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")
|
||||
|
||||
#avis-show
|
||||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
- content_for(:title, "Messagerie · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")
|
||||
|
||||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||
|
||||
.messagerie.container
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
- content_for(:title, "Demande · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")
|
||||
|
||||
#avis-show
|
||||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||
|
||||
|
|
|
@ -15,6 +15,17 @@
|
|||
- c.value.split(", ").each do |item|
|
||||
%li
|
||||
= item
|
||||
- when "dossier_link"
|
||||
%th.libelle
|
||||
= "#{c.libelle} :"
|
||||
%td.rich-text
|
||||
- dossier = Dossier.includes(:procedure).find_by(id: c.value)
|
||||
- if dossier
|
||||
= link_to("Dossier nº #{dossier.id}", dossier_path(dossier.procedure, dossier), target: '_blank')
|
||||
%br
|
||||
= dossier.text_summary
|
||||
- else
|
||||
Pas de dossier associé
|
||||
- else
|
||||
%th.libelle
|
||||
= "#{c.libelle} :"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
- content_for(:title, "Annotations privées · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")
|
||||
|
||||
= render partial: "header", locals: { dossier: @dossier }
|
||||
|
||||
#dossier-annotations-privees.container
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
- content_for(:title, "Avis · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")
|
||||
|
||||
= render partial: "header", locals: { dossier: @dossier }
|
||||
|
||||
.container
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
= render partial: 'new_gestionnaire/dossiers/champs/champ_label', locals: { form: form, champ: champ }
|
||||
|
||||
%div
|
||||
.radios
|
||||
%label
|
||||
= form.radio_button :value, 'M.'
|
||||
Monsieur
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
= render partial: 'new_gestionnaire/dossiers/champs/champ_label', locals: { form: form, champ: champ }
|
||||
|
||||
%div
|
||||
.radios
|
||||
%label
|
||||
= form.radio_button :value, true
|
||||
Oui
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
- content_for(:title, "Messagerie · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")
|
||||
|
||||
= render partial: "header", locals: { dossier: @dossier }
|
||||
|
||||
.messagerie.container
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
- content_for(:title, "Demande · Dossier nº #{@dossier.id} (#{@dossier.owner_name})")
|
||||
|
||||
= render partial: "header", locals: { dossier: @dossier }
|
||||
|
||||
.container
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
- content_for(:title, "Procédures")
|
||||
|
||||
.container
|
||||
%h1.backoffice-title Procédures
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
- content_for(:title, "#{@procedure.libelle}")
|
||||
|
||||
#procedure-show
|
||||
.backoffice-header
|
||||
.container.flex
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
- if !dossier.was_piece_justificative_uploaded_for_type_id?(tpj.id)
|
||||
= file_field_tag "piece_justificative_#{tpj.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes
|
||||
- else
|
||||
- pj = dossier.retrieve_last_piece_justificative_by_type(tpj.id)
|
||||
%a{ href: pj.content_url, target: '_blank' }
|
||||
= pj.original_filename
|
||||
%span.btn.btn-sm.btn-file.btn-success
|
||||
Modifier
|
||||
= file_field_tag "piece_justificative_#{tpj.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes
|
||||
|
|
|
@ -13,5 +13,9 @@ FactoryGirl.define do
|
|||
trait :explication do
|
||||
type_de_champ { FactoryGirl.create(:type_de_champ_public, :explication) }
|
||||
end
|
||||
|
||||
trait :dossier_link do
|
||||
type_de_champ { FactoryGirl.create(:type_de_champ_public, :type_dossier_link) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -944,4 +944,27 @@ describe Dossier do
|
|||
|
||||
after { Timecop.return }
|
||||
end
|
||||
|
||||
describe '#owner_name' do
|
||||
let!(:procedure) { create(:procedure) }
|
||||
subject { dossier.owner_name }
|
||||
|
||||
context 'when there is no entreprise or individual' do
|
||||
let(:dossier) { create(:dossier, individual: nil, entreprise: nil, procedure: procedure) }
|
||||
|
||||
it { is_expected.to be_nil }
|
||||
end
|
||||
|
||||
context 'when there is entreprise' do
|
||||
let(:dossier) { create(:dossier, :with_entreprise, procedure: procedure) }
|
||||
|
||||
it { is_expected.to eq(dossier.entreprise.raison_sociale) }
|
||||
end
|
||||
|
||||
context 'when there is an individual' do
|
||||
let(:dossier) { create(:dossier, :for_individual, procedure: procedure) }
|
||||
|
||||
it { is_expected.to eq("#{dossier.individual.nom} #{dossier.individual.prenom}") }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
describe 'new_gestionnaire/dossiers/champs.html.haml', type: :view do
|
||||
before { render 'new_gestionnaire/dossiers/champs.html.haml', champs: champs }
|
||||
|
||||
context "there is some champs" do
|
||||
context "there are some champs" do
|
||||
let(:dossier) { create(:dossier) }
|
||||
let(:champ1) { create(:champ, :checkbox, value: "true") }
|
||||
let(:champ2) { create(:champ, :header_section, value: "Section") }
|
||||
let(:champ3) { create(:champ, :explication, value: "mazette") }
|
||||
let(:champs) { [champ1, champ2, champ3] }
|
||||
let(:champ4) { create(:champ, :dossier_link, value: dossier.id) }
|
||||
let(:champs) { [champ1, champ2, champ3, champ4] }
|
||||
|
||||
it { expect(rendered).to include(champ1.libelle) }
|
||||
it { expect(rendered).to include(champ1.value) }
|
||||
|
@ -15,5 +17,15 @@ describe 'new_gestionnaire/dossiers/champs.html.haml', type: :view do
|
|||
|
||||
it { expect(rendered).not_to include(champ3.libelle) }
|
||||
it { expect(rendered).not_to include(champ3.value) }
|
||||
|
||||
it { expect(rendered).to have_link("Dossier nº #{dossier.id}") }
|
||||
it { expect(rendered).to include(dossier.text_summary) }
|
||||
end
|
||||
|
||||
context "with a dossier_link champ but without value" do
|
||||
let(:champ) { create(:champ, :dossier_link, value: nil) }
|
||||
let(:champs) { [champ] }
|
||||
|
||||
it { expect(rendered).to include("Pas de dossier associé") }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue