Merge branch 'staging'

This commit is contained in:
gregoirenovel 2017-04-13 15:48:11 +02:00
commit a6708ce1f0
411 changed files with 2720 additions and 2129 deletions

70
.circleci/config.yml Normal file
View file

@ -0,0 +1,70 @@
version: 2
jobs:
build:
docker:
- image: ruby:2.3.1
- image: postgres:9.4.1
environment:
POSTGRES_USER: tps_test
POSTGRES_PASSWORD: tps_test
POSTGRES_DB: tps_test
working_directory: /tps
steps:
- checkout
- run:
name: Install System Dependencies
command: apt-get update -qq && apt-get install -y build-essential nodejs
- restore_cache:
key: bundle-install-v3-{{ checksum "Gemfile.lock" }}
- run:
name: Install Ruby Dependencies
command: bundle install
- save_cache:
key: bundle-install-v3-{{ checksum "Gemfile.lock" }}
paths:
- /usr/local/bundle
- restore_cache:
key: phantomjs-2-1-1
- run:
name: Install PhantomJS Dependencies
command: |
[ -f /usr/local/bin/phantomjs ] || apt-get update
[ -f /usr/local/bin/phantomjs ] || apt-get install -y fontconfig wget
- run:
name: Install PhantomJS
command: |
[ -f /usr/local/bin/phantomjs ] || wget -O /tmp/phantomjs.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
[ -f /usr/local/bin/phantomjs ] || tar -xjf /tmp/phantomjs.tar.bz2 -C /tmp
[ -f /usr/local/bin/phantomjs ] || mv /tmp/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
- save_cache:
key: phantomjs-2-1-1
paths:
- /usr/local/bin/phantomjs
- run:
environment:
DATABASE_URL: "postgres://tps_test@localhost:5432/tps_test"
name: Create DB
command: bundle exec rake db:create db:schema:load db:migrate RAILS_ENV=test
- run:
environment:
DATABASE_URL: "postgres://tps_test@localhost:5432/tps_test"
name: Run Tests, Splitted by Timings
command: |
TESTFILES=$(circleci tests glob "spec/**/*.rb"| xargs -n 1 echo | grep -v "spec/factories/" | tr " " "\n" | circleci tests split --split-by=timings)
bundle exec rspec --color --require spec_helper -- ${TESTFILES}
- run:
name: Run haml-lint
command: bundle exec haml-lint app/views/
- add_ssh_keys:
fingerprints:
- "0a:67:42:7d:7e:b7:e1:3c:48:8f:bf:68:10:51:a8:44"
- deploy:
command: |
if [ "${CIRCLE_BRANCH}" == "staging" ]; then
bundle exec rake deploy_ha
fi
if [ "${CIRCLE_BRANCH}" == "master" ]; then
bundle exec rake deploy_ha to=production
fi

11
.editorconfig Normal file
View file

@ -0,0 +1,11 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.{haml,html,js,scss,rake,rb,yml}]
charset = utf-8
indent_size = 2
indent_style = space
trim_trailing_whitespace = true

119
.haml-lint.yml Normal file
View file

@ -0,0 +1,119 @@
linters:
AlignmentTabs:
enabled: true
AltText:
enabled: false
ClassAttributeWithStaticValue:
enabled: true
ClassesBeforeIds:
enabled: false
ConsecutiveComments:
enabled: false
ConsecutiveSilentScripts:
enabled: false
max_consecutive: 2
EmptyObjectReference:
enabled: true
EmptyScript:
enabled: true
FinalNewline:
enabled: true
present: true
HtmlAttributes:
enabled: true
IdNames:
enabled: false
style: lisp_case
ImplicitDiv:
enabled: false
Indentation:
enabled: true
character: space # or tab
width: 2 # ignored if character == tab
InstanceVariables:
enabled: false
file_types: partials
matchers:
all: .*
partials: \A_.*\.haml\z
LeadingCommentSpace:
enabled: true
LineLength:
enabled: false
max: 80
MultilinePipe:
enabled: true
MultilineScript:
enabled: true
ObjectReferenceAttributes:
enabled: true
RepeatedId:
enabled: false
severity: error
RuboCop:
enabled: false
# These cops are incredibly noisy when it comes to HAML templates, so we
# ignore them.
ignored_cops:
- Lint/BlockAlignment
- Lint/EndAlignment
- Lint/Void
- Metrics/BlockLength
- Metrics/LineLength
- Style/AlignParameters
- Style/BlockNesting
- Style/ElseAlignment
- Style/EndOfLine
- Style/FileName
- Style/FinalNewline
- Style/FrozenStringLiteralComment
- Style/IfUnlessModifier
- Style/IndentationWidth
- Style/Next
- Style/TrailingBlankLines
- Style/TrailingWhitespace
- Style/WhileUntilModifier
RubyComments:
enabled: true
SpaceBeforeScript:
enabled: true
SpaceInsideHashAttributes:
enabled: true
style: space
TagName:
enabled: true
TrailingWhitespace:
enabled: true
UnnecessaryInterpolation:
enabled: true
# Disabled because too agressive, but to enable
# locally from time to time
UnnecessaryStringOutput:
enabled: false

View file

@ -16,7 +16,7 @@ gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks', '~> 2.5'
gem 'turbolinks', '~> 5.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
@ -93,6 +93,8 @@ gem 'simple_form'
gem 'newrelic_rpm'
gem 'scenic'
# Sidekiq
gem 'sidekiq'
gem 'sidekiq-cron', '~> 0.4.4'
@ -114,7 +116,6 @@ group :test do
gem 'guard-livereload', '~> 2.4', require: false
gem 'vcr'
gem 'rails-controller-testing'
gem 'sqlite3'
end
group :development do
@ -122,6 +123,7 @@ group :development do
gem 'web-console'
gem 'rack-handlers'
gem 'xray-rails'
gem 'haml-lint'
end
group :development, :test do
@ -145,6 +147,3 @@ group :production, :staging do
gem 'sentry-raven'
end
group :production, :staging, :development do
gem 'scenic'
end

View file

@ -69,7 +69,7 @@ GEM
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.0)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
apipie-rails (0.3.7)
json
@ -78,6 +78,7 @@ GEM
actionpack (>= 3.0)
activemodel (>= 3.0)
responders
ast (2.3.0)
attr_required (1.0.1)
autoprefixer-rails (6.5.4)
execjs
@ -95,9 +96,9 @@ GEM
bootstrap-wysihtml5-rails (0.3.3.8)
railties (>= 3.0)
browser (2.3.0)
builder (3.2.2)
builder (3.2.3)
byebug (9.0.6)
capybara (2.11.0)
capybara (2.13.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
@ -120,8 +121,8 @@ GEM
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
concurrent-ruby (1.0.2)
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
connection_pool (2.2.1)
crack (0.4.3)
safe_yaml (~> 1.0.0)
@ -313,12 +314,20 @@ GEM
rspec (>= 2.99.0, < 4.0)
haml (4.0.7)
tilt
haml-lint (0.999.999)
haml_lint
haml-rails (0.9.0)
actionpack (>= 4.0.1)
activesupport (>= 4.0.1)
haml (>= 4.0.6, < 5.0)
html2haml (>= 1.0.1)
railties (>= 4.0.1)
haml_lint (0.24.0)
haml (>= 4.0, < 5.1)
rainbow
rake (>= 10, < 13)
rubocop (>= 0.47.0)
sysexits (~> 1.1)
hashdiff (0.3.1)
hashie (3.4.6)
html2haml (2.0.0)
@ -331,7 +340,7 @@ GEM
domain_name (~> 0.5)
http_parser.rb (0.6.0)
httpclient (2.8.3)
i18n (0.7.0)
i18n (0.8.1)
inflecto (0.0.2)
ipaddress (0.8.3)
jquery-rails (4.2.1)
@ -412,11 +421,14 @@ GEM
openstack (3.3.7)
json
orm_adapter (0.5.0)
parser (2.4.0.0)
ast (~> 2.2)
pg (0.19.0)
poltergeist (1.12.0)
poltergeist (1.14.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
powerpack (0.1.1)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
@ -424,7 +436,7 @@ GEM
pry-byebug (3.4.2)
byebug (~> 9.0)
pry (~> 0.10)
public_suffix (2.0.4)
public_suffix (2.0.5)
rack (2.0.1)
rack-handlers (0.7.3)
rack
@ -452,9 +464,9 @@ GEM
actionpack (~> 5.x)
actionview (~> 5.x)
activesupport (~> 5.x)
rails-dom-testing (2.0.1)
rails-dom-testing (2.0.2)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6.0)
nokogiri (~> 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.0.1)
@ -463,6 +475,7 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.2.1)
raindrops (0.17.0)
rake (12.0.0)
rb-fsevent (0.9.8)
@ -513,6 +526,13 @@ GEM
rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubocop (0.48.1)
parser (>= 2.3.3.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
ruby_dep (1.5.0)
ruby_parser (3.8.3)
sexp_processor (~> 4.1)
@ -574,30 +594,32 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
swd (1.0.1)
activesupport (>= 3)
attr_required (>= 0.0.5)
httpclient (>= 2.4)
i18n
json (>= 1.4.3)
sysexits (1.2.0)
therubyracer (0.12.2)
libv8 (~> 3.16.14.0)
ref
thor (0.19.4)
thread_safe (0.3.5)
thread_safe (0.3.6)
tilt (2.0.5)
timecop (0.8.1)
trollop (2.1.2)
turbolinks (2.5.3)
coffee-rails
tzinfo (1.2.2)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.3)
thread_safe (~> 0.1)
uglifier (3.0.4)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
unicode-display_width (1.1.3)
unicode_utils (1.4.0)
unicorn (5.2.0)
kgio (~> 2.6)
@ -625,7 +647,7 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
websocket-driver (0.6.4)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
will_paginate (3.1.5)
@ -666,6 +688,7 @@ DEPENDENCIES
guard
guard-livereload (~> 2.4)
guard-rspec
haml-lint
haml-rails
hashie
jquery-rails
@ -704,10 +727,9 @@ DEPENDENCIES
spreadsheet_architect
spring
spring-commands-rspec
sqlite3
therubyracer
timecop
turbolinks (~> 2.5)
turbolinks (~> 5.0)
uglifier (>= 1.3.0)
unicode_utils
unicorn

View file

@ -73,6 +73,7 @@ guard :rspec, cmd: 'spring rspec' do
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^app/services/(.+)_(service)\.rb$}) { |m| "spec/services/#{m[1]}_service_spec.rb" }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }

View file

@ -2,13 +2,18 @@
## Context
TéléProcédure Simplifiée, ou TPS pour les intimes, est une plateforme 100% web et 0% email, conçue afin de répondre au besoin urgent de l'État d'appliquer la directive sur le 100% démat' à l'horizon 2018 pour les démarches administratives.
TéléProcédure Simplifiée, ou TPS pour les intimes, est une plateforme 100 % web et 0 % email, conçue afin de répondre au besoin urgent de l'État d'appliquer la directive sur le 100 % démat' à l'horizon 2018 pour les démarches administratives.
## Technologies utilisées
## Dépendances
Ruby : 2.3.1
Rails : 5.0.0.1
### Tous environnements
- postgresql
### Tests
- PhantomJS
## Initialisation de l'environnement de développement
@ -20,32 +25,23 @@ Afin d'initialiser l'environnement de développement, éxécutez la commande sui
## Création de la base de données
L'application utilise une base de donnée Postgresql. Pour en installer une, utilisez la commande suivante :
sudo apt-get install postgresql
Les informations nécessaire à l'initialisation de la base doivent être pré-configurées à la main grâce à la procédure suivante :
su - postgres
psql
> create user tps with password 'lol' superuser;
> create user tps_development with password 'tps_development' superuser;
> create user tps_test with password 'tps_test' superuser;
> \q
Afin de générer la BDD de l'application, il est nécessaire d'éxécuter les commandes suivantes :
rake db:create db:schema:load db:migrate
rake db:create db:schema:load db:migrate RAILS_ENV=test
## Installation de Phantom JS
## Exécution des tests (RSpec)
Installer PhantomJS qui est utilisé par les tests automatisés de l'application.
## Exécution des tests (Rspec)
Pour éxécuter les tests de l'application, plusieurs possibilités :
Pour exécuter les tests de l'application, plusieurs possibilités :
- Lancer tous les tests
@ -62,8 +58,11 @@ Pour éxécuter les tests de l'application, plusieurs possibilités :
rake spec SPEC=file_path/file_name_spec.rb
rspec file_path/file_name_spec.rb
## Linting
## Regénérer les binstubs
- Linter les fichiers HAML : `bundle exec haml-lint app/views/`
## Régénérer les binstubs
bundle binstub railties --force
rake rails:update:bin

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,5 +1,4 @@
$(document).on('page:load', init_action_btn_rules);
$(document).ready(init_action_btn_rules);
$(document).on('turbolinks:load', init_action_btn_rules);
function init_action_btn_rules() {
$('.btn-send').click(function () {

View file

@ -1,22 +1,22 @@
function address_type_init() {
display = 'label';
display = 'label';
var bloodhound = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(display),
queryTokenizer: Bloodhound.tokenizers.whitespace,
var bloodhound = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(display),
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
url: '/ban/search?request=%QUERY',
wildcard: '%QUERY'
}
});
bloodhound.initialize();
remote: {
url: '/ban/search?request=%QUERY',
wildcard: '%QUERY'
}
});
bloodhound.initialize();
$("input[type='address']").typeahead({
minLength: 1
}, {
display: display,
source: bloodhound,
limit: 5
});
$("input[type='address']").typeahead({
minLength: 1
}, {
display: display,
source: bloodhound,
limit: 5
});
}

View file

@ -1,47 +1,46 @@
$(document).on('page:load', init_admin);
$(document).ready(init_admin);
$(document).on('turbolinks:load', init_admin);
function init_admin(){
destroy_action();
on_change_type_de_champ_select();
destroy_action();
on_change_type_de_champ_select();
}
function destroy_action(){
$(".delete").on('click', function(){
$(this).hide();
$(this).closest('td').find(".confirm").show();
});
$(".delete").on('click', function(){
$(this).hide();
$(this).closest('td').find(".confirm").show();
});
$(".cancel").on('click', function(){
$(this).closest('td').find(".delete").show();
$(this).closest('td').find(".confirm").hide();
});
$(".cancel").on('click', function(){
$(this).closest('td').find(".delete").show();
$(this).closest('td').find(".confirm").hide();
});
$("#liste_gestionnaire #libelle").on('click', function(){
setTimeout(destroy_action, 500);
});
$("#liste_gestionnaire #libelle").on('click', function(){
setTimeout(destroy_action, 500);
});
}
function on_change_type_de_champ_select (){
$("select.form-control.type_champ").on('change', function(e){
$("select.form-control.type_champ").on('change', function(e){
parent = $(this).parent().parent();
parent = $(this).parent().parent();
parent.removeClass('header_section');
parent.children(".drop_down_list").removeClass('show_inline');
$('.mandatory', parent).show();
parent.removeClass('header_section');
parent.children(".drop_down_list").removeClass('show_inline');
$('.mandatory', parent).show();
switch(this.value){
case 'header_section':
parent.addClass('header_section');
break;
case 'drop_down_list':
case 'multiple_drop_down_list':
parent.children(".drop_down_list").addClass('show_inline');
break;
case 'explication':
$('.mandatory', parent).hide();
break;
}
});
switch(this.value){
case 'header_section':
parent.addClass('header_section');
break;
case 'drop_down_list':
case 'multiple_drop_down_list':
parent.children(".drop_down_list").addClass('show_inline');
break;
case 'explication':
$('.mandatory', parent).hide();
break;
}
});
}

View file

@ -1,98 +1,97 @@
$(document).on('page:load', init_path_modal);
$(document).ready(init_path_modal);
$(document).on('turbolinks:load', init_path_modal);
function init_path_modal() {
path_modal_action();
path_validation_action();
path_type_init();
path_validation($("input[id='procedure_path']"));
path_modal_action();
path_validation_action();
path_type_init();
path_validation($("input[id='procedure_path']"));
}
function path_modal_action() {
$('#publishModal').on('show.bs.modal', function (event) {
$("#publishModal .modal-body .table .tr_content").hide();
$('#publishModal').on('show.bs.modal', function (event) {
$("#publishModal .modal-body .table .tr_content").hide();
var button = $(event.relatedTarget) // Button that triggered the modal
var modal_title = button.data('modal_title'); // Extract info from data-* attributes
var modal_index = button.data('modal_index'); // Extract info from data-* attributes
var button = $(event.relatedTarget) // Button that triggered the modal
var modal_title = button.data('modal_title'); // Extract info from data-* attributes
var modal_index = button.data('modal_index'); // Extract info from data-* attributes
var modal = $(this)
modal.find('#publishModal_title').html(modal_title);
$("#publishModal .modal-body .table #"+modal_index).show();
})
var modal = $(this)
modal.find('#publishModal_title').html(modal_title);
$("#publishModal .modal-body .table #"+modal_index).show();
})
}
function path_validation_action() {
$("input[id='procedure_path']").keyup(function (key) {
if (key.keyCode != 13)
path_validation(this);
});
$("input[id='procedure_path']").keyup(function (key) {
if (key.keyCode != 13)
path_validation(this);
});
}
function togglePathMessage(valid, mine) {
$('#path_messages .message').hide();
$('#path_messages .message').hide();
if (valid === true && mine === true) {
$('#path_is_mine').show();
} else if (valid === true && mine === false) {
$('#path_is_not_mine').show();
} else if (valid === false && mine === null) {
$('#path_is_invalid').show();
}
if (valid === true && mine === true) {
$('#path_is_mine').show();
} else if (valid === true && mine === false) {
$('#path_is_not_mine').show();
} else if (valid === false && mine === null) {
$('#path_is_invalid').show();
}
if ((valid && mine === null) || mine === true)
$('#publishModal #publish').removeAttr('disabled')
else
$('#publishModal #publish').attr('disabled', 'disabled')
if ((valid && mine === null) || mine === true)
$('#publishModal #publish').removeAttr('disabled')
else
$('#publishModal #publish').attr('disabled', 'disabled')
}
function path_validation(el) {
var valid = validatePath($(el).val());
toggleErrorClass(el, valid);
togglePathMessage(valid, null);
var valid = validatePath($(el).val());
toggleErrorClass(el, valid);
togglePathMessage(valid, null);
}
function validatePath(path) {
var re = /^[a-z0-9_]{3,30}$/;
return re.test(path);
var re = /^[a-z0-9_]{3,30}$/;
return re.test(path);
}
function path_type_init() {
display = 'label';
display = 'label';
var bloodhound = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(display),
queryTokenizer: Bloodhound.tokenizers.whitespace,
var bloodhound = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(display),
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
url: '/admin/procedures/path_list?request=%QUERY',
wildcard: '%QUERY'
}
});
bloodhound.initialize();
remote: {
url: '/admin/procedures/path_list?request=%QUERY',
wildcard: '%QUERY'
}
});
bloodhound.initialize();
$("#procedure_path").typeahead({
minLength: 1
}, {
display: display,
source: bloodhound,
templates: {
empty: 'Ce lien est disponible !',
suggestion: Handlebars.compile("<div class='path_mine_{{mine}}'>{{label}}</div>")
},
limit: 5
});
$("#procedure_path").typeahead({
minLength: 1
}, {
display: display,
source: bloodhound,
templates: {
empty: 'Ce lien est disponible !',
suggestion: Handlebars.compile("<div class='path_mine_{{mine}}'>{{label}}</div>")
},
limit: 5
});
$('#procedure_path').bind('typeahead:select', function(ev, suggestion) {
togglePathMessage(true, suggestion['mine']);
});
$('#procedure_path').bind('typeahead:select', function(ev, suggestion) {
togglePathMessage(true, suggestion['mine']);
});
}
function transfer_errors_message(show) {
if(show){
$("#not_found_admin").slideDown(100)
}
else {
$("#not_found_admin").slideUp(100)
}
if(show){
$("#not_found_admin").slideDown(100)
}
else {
$("#not_found_admin").slideUp(100)
}
}

View file

@ -33,26 +33,24 @@
//= require typeahead.bundle
//= require select2
$(document).on('page:load', application_init);
$(document).ready(application_init);
$(document).on('turbolinks:load', application_init);
function application_init(){
tooltip_init();
scroll_to();
tooltip_init();
scroll_to();
}
function tooltip_init() {
$('.action_button[data-toggle="tooltip"]').tooltip({delay: { "show": 100, "hide": 100 }});
$('[data-toggle="tooltip"]').tooltip({delay: { "show": 800, "hide": 100 }});
$('.action_button[data-toggle="tooltip"]').tooltip({delay: { "show": 100, "hide": 100 }});
$('[data-toggle="tooltip"]').tooltip({delay: { "show": 800, "hide": 100 }});
}
function scroll_to() {
$('.js-scrollTo').on('click', function () { // Au clic sur un élément
var page = $(this).attr('cible'); // Page cible
var speed = 600; // Durée de l'animation (en ms)
$('html, body').animate({scrollTop: $(page).offset().top - 200}, speed); // Go
return false;
});
$('.js-scrollTo').on('click', function () { // Au clic sur un élément
var page = $(this).attr('cible'); // Page cible
var speed = 600; // Durée de l'animation (en ms)
$('html, body').animate({scrollTop: $(page).offset().top - 200}, speed); // Go
return false;
});
}

View file

@ -1,14 +1,13 @@
$(document).on('page:load', buttons_archived);
$(document).ready(buttons_archived);
$(document).on('turbolinks:load', buttons_archived);
function buttons_archived(){
$("button#archive").on('click', function(){
$("button#archive").hide();
$("#confirm").show();
});
$("button#archive").on('click', function(){
$("button#archive").hide();
$("#confirm").show();
});
$("#confirm #cancel").on('click', function(){
$("button#archive").show();
$("#confirm").hide();
});
$("#confirm #cancel").on('click', function(){
$("button#archive").show();
$("#confirm").hide();
});
}

View file

@ -1,8 +1,7 @@
$(document).ready(wysihtml5_active);
$(document).on('page:load', wysihtml5_active);
$(document).on('turbolinks:load', wysihtml5_active);
function wysihtml5_active (){
$('.wysihtml5').each(function(i, elem) {
$(elem).wysihtml5({ toolbar:{ "fa": true, "link": false, "color": false }, "locale": "fr-FR" });
});
$('.wysihtml5').each(function(i, elem) {
$(elem).wysihtml5({ toolbar:{ "fa": true, "link": false, "color": false }, "locale": "fr-FR" });
});
}

View file

@ -6,8 +6,8 @@
//= require_tree ./channels
//(function() {
// this.App || (this.App = {});
// this.App || (this.App = {});
//
// App.cable = ActionCable.createConsumer();
// App.cable = ActionCable.createConsumer();
//
//}).call(this);

View file

@ -1,60 +1,60 @@
function cadastre_active() {
return $("#map.cadastre").length > 0
return $("#map.cadastre").length > 0
}
function get_cadastre(coordinates) {
if (!cadastre_active())
return;
if (!cadastre_active())
return;
var cadastre;
var cadastre;
$.ajax({
method: 'post',
url: '/users/dossiers/' + dossier_id + '/carte/cadastre',
data: {coordinates: JSON.stringify(coordinates)},
dataType: 'json',
async: false
}).done(function (data) {
cadastre = data
});
$.ajax({
method: 'post',
url: '/users/dossiers/' + dossier_id + '/carte/cadastre',
data: {coordinates: JSON.stringify(coordinates)},
dataType: 'json',
async: false
}).done(function (data) {
cadastre = data
});
return cadastre['cadastres'];
return cadastre['cadastres'];
}
function display_cadastre(cadastre_array) {
if (!cadastre_active())
return;
if (!cadastre_active())
return;
$("#cadastre.list ul").html('');
new_cadastreLayer();
$("#cadastre.list ul").html('');
new_cadastreLayer();
if (cadastre_array.length == 1 && cadastre_array[0]['zoom_error'])
$("#cadastre.list ul").html('<li><b>Merci de dessiner une surface plus petite afin de récupérer les parcelles cadastrales.</b></li>');
if (cadastre_array.length == 1 && cadastre_array[0]['zoom_error'])
$("#cadastre.list ul").html('<li><b>Merci de dessiner une surface plus petite afin de récupérer les parcelles cadastrales.</b></li>');
else if (cadastre_array.length > 0) {
cadastre_array.forEach(function (cadastre) {
$("#cadastre.list ul").append('<li> Parcelle n°' + cadastre.numero + ' - Feuille ' + cadastre.code_arr + ' ' + cadastre.section + ' ' + cadastre.feuille+ '</li>');
else if (cadastre_array.length > 0) {
cadastre_array.forEach(function (cadastre) {
$("#cadastre.list ul").append('<li> Parcelle n°' + cadastre.numero + ' - Feuille ' + cadastre.code_arr + ' ' + cadastre.section + ' ' + cadastre.feuille+ '</li>');
cadastreItems.addData(cadastre.geometry);
});
cadastreItems.addData(cadastre.geometry);
});
cadastreItems.setStyle({
fillColor: '#8a6d3b',
weight: 2,
opacity: 0.3,
color: 'white',
dashArray: '3',
fillOpacity: 0.7
})
}
else
$("#cadastre.list ul").html('<li>AUCUN</li>');
cadastreItems.setStyle({
fillColor: '#8a6d3b',
weight: 2,
opacity: 0.3,
color: 'white',
dashArray: '3',
fillOpacity: 0.7
})
}
else
$("#cadastre.list ul").html('<li>AUCUN</li>');
}
function new_cadastreLayer() {
if (typeof cadastreItems != 'undefined')
map.removeLayer(cadastreItems);
if (typeof cadastreItems != 'undefined')
map.removeLayer(cadastreItems);
cadastreItems = new L.GeoJSON();
cadastreItems.addTo(map);
cadastreItems = new L.GeoJSON();
cadastreItems.addTo(map);
}

View file

@ -2,162 +2,162 @@ var LON = '2.428462';
var LAT = '46.538192';
function initCarto() {
OSM = L.tileLayer("http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
OSM = L.tileLayer("http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
position = get_position() || default_gestionnaire_position();
map = L.map("map", {
center: new L.LatLng(position.lat, position.lon),
zoom: position.zoom,
layers: [OSM],
scrollWheelZoom: false
});
icon = L.icon({
iconUrl: '/assets/marker-icon.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [34.48, 40], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [20, 20] // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
//popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
});
if (qp_active())
display_qp(JSON.parse($("#quartier_prioritaires").val()));
if (cadastre_active())
display_cadastre(JSON.parse($("#cadastres").val()));
freeDraw = new L.FreeDraw();
freeDraw.options.setSmoothFactor(4);
freeDraw.options.simplifyPolygon = false;
map.addLayer(freeDraw);
if ($("#json_latlngs").val() != '' && $("#json_latlngs").val() != '[]') {
map.setZoom(18);
$.each($.parseJSON($("#json_latlngs").val()), function (i, val) {
freeDraw.createPolygon(val);
});
position = get_position() || default_gestionnaire_position();
map.fitBounds(freeDraw.polygons[0].getBounds());
}
else if (position.lat == LAT && position.lon == LON)
map.setView(new L.LatLng(position.lat, position.lon), position.zoom);
map = L.map("map", {
center: new L.LatLng(position.lat, position.lon),
zoom: position.zoom,
layers: [OSM],
scrollWheelZoom: false
});
icon = L.icon({
iconUrl: '/assets/marker-icon.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [34.48, 40], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [20, 20] // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
//popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
});
if (qp_active())
display_qp(JSON.parse($("#quartier_prioritaires").val()));
if (cadastre_active())
display_cadastre(JSON.parse($("#cadastres").val()));
freeDraw = new L.FreeDraw();
freeDraw.options.setSmoothFactor(4);
freeDraw.options.simplifyPolygon = false;
map.addLayer(freeDraw);
if ($("#json_latlngs").val() != '' && $("#json_latlngs").val() != '[]') {
map.setZoom(18);
$.each($.parseJSON($("#json_latlngs").val()), function (i, val) {
freeDraw.createPolygon(val);
});
map.fitBounds(freeDraw.polygons[0].getBounds());
}
else if (position.lat == LAT && position.lon == LON)
map.setView(new L.LatLng(position.lat, position.lon), position.zoom);
add_event_freeDraw();
add_event_search_address();
add_event_freeDraw();
add_event_search_address();
}
function default_gestionnaire_position() {
return {lon: LON, lat: LAT, zoom: 5}
return {lon: LON, lat: LAT, zoom: 5}
}
function get_external_data(latLngs) {
if (qp_active())
display_qp(get_qp(latLngs));
if (qp_active())
display_qp(get_qp(latLngs));
if (cadastre_active()) {
polygons = {"type": "FeatureCollection", "features": []};
if (cadastre_active()) {
polygons = {"type": "FeatureCollection", "features": []};
for (i = 0; i < latLngs.length; i++)
polygons.features.push(feature_polygon_latLngs(latLngs[i]))
for (i = 0; i < latLngs.length; i++)
polygons.features.push(feature_polygon_latLngs(latLngs[i]))
cadastre_list = [{zoom_error: true}];
cadastre_list = [{zoom_error: true}];
if (turf_area(polygons) < 300000)
cadastre_list = get_cadastre(latLngs);
if (turf_area(polygons) < 300000)
cadastre_list = get_cadastre(latLngs);
display_cadastre(cadastre_list);
}
display_cadastre(cadastre_list);
}
}
function feature_polygon_latLngs(coordinates) {
return ({
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
JSON.parse(L.FreeDraw.Utilities.getJsonPolygons([coordinates]))['latLngs']
]
}
})
return ({
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
JSON.parse(L.FreeDraw.Utilities.getJsonPolygons([coordinates]))['latLngs']
]
}
})
}
function add_event_freeDraw() {
freeDraw.on('markers', function (e) {
$("#json_latlngs").val(JSON.stringify(e.latLngs));
freeDraw.on('markers', function (e) {
$("#json_latlngs").val(JSON.stringify(e.latLngs));
add_event_edit();
add_event_edit();
get_external_data(e.latLngs);
});
get_external_data(e.latLngs);
});
$("#map").on('click', function(){
freeDraw.setMode(L.FreeDraw.MODES.VIEW);
});
$("#map").on('click', function(){
freeDraw.setMode(L.FreeDraw.MODES.VIEW);
});
$("#new").on('click', function (e) {
freeDraw.setMode(L.FreeDraw.MODES.CREATE);
});
$("#new").on('click', function (e) {
freeDraw.setMode(L.FreeDraw.MODES.CREATE);
});
$("#delete").on('click', function (e) {
freeDraw.setMode(L.FreeDraw.MODES.DELETE);
});
$("#delete").on('click', function (e) {
freeDraw.setMode(L.FreeDraw.MODES.DELETE);
});
}
function add_event_edit (){
$(".leaflet-container g path").on('click', function (e) {
setTimeout(function(){freeDraw.setMode(L.FreeDraw.MODES.EDIT | L.FreeDraw.MODES.DELETE)}, 50);
});
$(".leaflet-container g path").on('click', function (e) {
setTimeout(function(){freeDraw.setMode(L.FreeDraw.MODES.EDIT | L.FreeDraw.MODES.DELETE)}, 50);
});
}
function get_position() {
var position;
var position;
$.ajax({
url: '/users/dossiers/' + dossier_id + '/carte/position',
dataType: 'json',
async: false
}).done(function (data) {
position = data
});
$.ajax({
url: '/users/dossiers/' + dossier_id + '/carte/position',
dataType: 'json',
async: false
}).done(function (data) {
position = data
});
return position;
return position;
}
function get_address_point(request) {
$.ajax({
url: '/ban/address_point?request=' + request,
dataType: 'json',
async: true
}).done(function (data) {
if (data.lat != null) {
map.setView(new L.LatLng(data.lat, data.lon), data.zoom);
//L.marker([data.lat, data.lon], {icon: icon}).addTo(map);
}
});
$.ajax({
url: '/ban/address_point?request=' + request,
dataType: 'json',
async: true
}).done(function (data) {
if (data.lat != null) {
map.setView(new L.LatLng(data.lat, data.lon), data.zoom);
//L.marker([data.lat, data.lon], {icon: icon}).addTo(map);
}
});
}
function jsObject_to_array(qp_list) {
return Object.keys(qp_list).map(function (v) {
return qp_list[v];
});
return Object.keys(qp_list).map(function (v) {
return qp_list[v];
});
}
function add_event_search_address() {
$("#search_by_address input[type='address']").bind('typeahead:select', function (ev, seggestion) {
get_address_point(seggestion['label']);
});
$("#search_by_address input[type='address']").bind('typeahead:select', function (ev, seggestion) {
get_address_point(seggestion['label']);
});
$("#search_by_address input[type='address']").keypress(function (e) {
if (e.keyCode == 13)
get_address_point($(this).val());
});
$("#search_by_address input[type='address']").keypress(function (e) {
if (e.keyCode == 13)
get_address_point($(this).val());
});
}

View file

@ -1,60 +1,60 @@
function qp_active() {
return $("#map.qp").length > 0
return $("#map.qp").length > 0
}
function get_qp(coordinates) {
if (!qp_active())
return;
if (!qp_active())
return;
var qp;
var qp;
$.ajax({
method: 'post',
url: '/users/dossiers/' + dossier_id + '/carte/qp',
data: {coordinates: JSON.stringify(coordinates)},
dataType: 'json',
async: false
}).done(function (data) {
qp = data
});
$.ajax({
method: 'post',
url: '/users/dossiers/' + dossier_id + '/carte/qp',
data: {coordinates: JSON.stringify(coordinates)},
dataType: 'json',
async: false
}).done(function (data) {
qp = data
});
return qp['quartier_prioritaires'];
return qp['quartier_prioritaires'];
}
function display_qp(qp_list) {
if (!qp_active())
return;
if (!qp_active())
return;
qp_array = jsObject_to_array(qp_list);
qp_array = jsObject_to_array(qp_list);
$("#qp.list ul").html('');
$("#qp.list ul").html('');
new_qpLayer();
new_qpLayer();
if (qp_array.length > 0) {
qp_array.forEach(function (qp) {
$("#qp.list ul").append('<li>' + qp.commune + ' : ' + qp.nom + '</li>');
if (qp_array.length > 0) {
qp_array.forEach(function (qp) {
$("#qp.list ul").append('<li>' + qp.commune + ' : ' + qp.nom + '</li>');
qpItems.addData(qp.geometry);
});
qpItems.addData(qp.geometry);
});
qpItems.setStyle({
fillColor: '#31708f',
weight: 2,
opacity: 0.3,
color: 'white',
dashArray: '3',
fillOpacity: 0.7
})
}
else
$("#qp.list ul").html('<li>AUCUN</li>');
qpItems.setStyle({
fillColor: '#31708f',
weight: 2,
opacity: 0.3,
color: 'white',
dashArray: '3',
fillOpacity: 0.7
})
}
else
$("#qp.list ul").html('<li>AUCUN</li>');
}
function new_qpLayer() {
if (typeof qpItems != 'undefined')
map.removeLayer(qpItems);
if (typeof qpItems != 'undefined')
map.removeLayer(qpItems);
qpItems = new L.GeoJSON();
qpItems.addTo(map);
qpItems = new L.GeoJSON();
qpItems.addTo(map);
}

View file

@ -1,9 +1,8 @@
$(document).on('page:load', buttons_anchor);
$(document).ready(buttons_anchor);
$(document).on('turbolinks:load', buttons_anchor);
function buttons_anchor(){
$("#cgu_menu_block").on('click', 'a', function(){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top-80}, 500);
});
$("#cgu_menu_block").on('click', 'a', function(){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top-80}, 500);
});
}

View file

@ -1,23 +1,23 @@
//App.messages = App.cable.subscriptions.create('NotificationsChannel', {
// received: function (data) {
// if (window.location.href.indexOf('backoffice') !== -1) {
// $("#notification_alert").html(data['message']);
// received: function (data) {
// if (window.location.href.indexOf('backoffice') !== -1) {
// $("#notification_alert").html(data['message']);
//
// slideIn_notification_alert();
// }
// slideIn_notification_alert();
// }
// }
//});
function slideIn_notification_alert (){
$("#notification_alert").animate({
right: '20px'
}, 250);
$("#notification_alert").animate({
right: '20px'
}, 250);
setTimeout(slideOut_notification_alert, 3500);
setTimeout(slideOut_notification_alert, 3500);
}
function slideOut_notification_alert (){
$("#notification_alert").animate({
right: '-250px'
}, 200);
$("#notification_alert").animate({
right: '-250px'
}, 200);
}

View file

@ -1,34 +1,33 @@
$(document).on('page:load', init_default_data_block);
$(document).ready(init_default_data_block);
$(document).on('turbolinks:load', init_default_data_block);
function init_default_data_block() {
$('.default_data_block #dossier .body').toggle();
$('.default_data_block #dossier .carret-right').toggle();
$('.default_data_block #dossier .carret-down').toggle();
$('.default_data_block #dossier .body').toggle();
$('.default_data_block #dossier .carret-right').toggle();
$('.default_data_block #dossier .carret-down').toggle();
$('.default_data_block .title').click(function () {
toggle_default_data_bloc(this, 400);
});
$('.default_data_block .title').click(function () {
toggle_default_data_bloc(this, 400);
});
$('.new-action').click(function () {
var messages_block = $(this).parents().closest('.default_data_block').find('.title')
toggle_default_data_bloc(messages_block, 400);
});
$('.new-action').click(function () {
var messages_block = $(this).parents().closest('.default_data_block').find('.title')
toggle_default_data_bloc(messages_block, 400);
});
$('.default_data_block.default_visible').each(function() {
toggle_default_data_bloc($(this).find('.title'), 0);
});
$('.default_data_block.default_visible').each(function() {
toggle_default_data_bloc($(this).find('.title'), 0);
});
function toggle_default_data_bloc(element, duration) {
var block = $(element).parents('.show-block');
if (block.attr('id') == 'messages') {
block.children('.last-commentaire').toggle();
$(".commentaires").animate({ scrollTop: $(this).height() }, "slow");
}
block.children('.body').slideToggle(duration);
block.find('.carret-right').toggle();
block.find('.carret-down').toggle();
function toggle_default_data_bloc(element, duration) {
var block = $(element).parents('.show-block');
if (block.attr('id') == 'messages') {
block.children('.last-commentaire').toggle();
$(".commentaires").animate({ scrollTop: $(this).height() }, "slow");
}
block.children('.body').slideToggle(duration);
block.find('.carret-right').toggle();
block.find('.carret-down').toggle();
}
}

View file

@ -1,48 +1,47 @@
$(document).on('page:load', action_type_de_champs);
$(document).ready(action_type_de_champs);
$(document).on('turbolinks:load', action_type_de_champs);
function action_type_de_champs() {
$("input[type='email']").on('change', function () {
toggleErrorClass(this, validateEmail($(this).val()));
});
$("input[type='email']").on('change', function () {
toggleErrorClass(this, validateEmail($(this).val()));
});
$("input[type='number']").on('change', function () {
toggleErrorClass(this, validateNumber($(this).val()));
});
$("input[type='number']").on('change', function () {
toggleErrorClass(this, validateNumber($(this).val()));
});
$("input[type='phone']").on('change', function () {
val = $(this).val();
val = val.replace(/[ ]/g, '');
$("input[type='phone']").on('change', function () {
val = $(this).val();
val = val.replace(/[ ]/g, '');
toggleErrorClass(this, validatePhone(val));
});
toggleErrorClass(this, validatePhone(val));
});
address_type_init();
address_type_init();
}
function toggleErrorClass(node, boolean) {
if (boolean)
$(node).removeClass('input-error');
else
$(node).addClass('input-error');
if (boolean)
$(node).removeClass('input-error');
else
$(node).addClass('input-error');
}
function validatePhone(phone) {
var re = /^(0|(\+[1-9]{2})|(00[1-9]{2}))[1-9][0-9]{8}$/;
return validateInput(phone, re)
var re = /^(0|(\+[1-9]{2})|(00[1-9]{2}))[1-9][0-9]{8}$/;
return validateInput(phone, re)
}
function validateEmail(email) {
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return validateInput(email, re)
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return validateInput(email, re)
}
function validateNumber(number) {
var re = /^[0-9]+$/;
return validateInput(number, re)
var re = /^[0-9]+$/;
return validateInput(number, re)
}
function validateInput(input, regex) {
return regex.test(input);
return regex.test(input);
}

View file

@ -1,16 +1,15 @@
$(document).on('page:load', init_modal_commentaire);
$(document).ready(init_modal_commentaire);
$(document).on('turbolinks:load', init_modal_commentaire);
function init_modal_commentaire() {
var modal = $("#modalCommentairesDossierParChamp");
var body = modal.find(".modal-body");
var originalBody = body.html();
var modal = $("#modalCommentairesDossierParChamp");
var body = modal.find(".modal-body");
var originalBody = body.html();
modal.on("show.bs.modal", function (e) {
body.load(e.relatedTarget.getAttribute("data-href"));
});
modal.on("show.bs.modal", function (e) {
body.load(e.relatedTarget.getAttribute("data-href"));
});
$("#modalCommentairesDossierParChamp").on("hidden.bs.modal", function (e) {
body.html(originalBody);
});
$("#modalCommentairesDossierParChamp").on("hidden.bs.modal", function (e) {
body.html(originalBody);
});
}

View file

@ -1,7 +1,5 @@
$(document).on('page:load', the_terms);
$(document).ready(the_terms);
$(document).on('page:load', pannel_switch);
$(document).ready(pannel_switch);
$(document).on('turbolinks:load', the_terms);
$(document).on('turbolinks:load', pannel_switch);
function pannel_switch() {
$('#switch-notifications').click(function () {
@ -19,43 +17,43 @@ function pannel_switch() {
}
function the_terms() {
var the_terms = $("#dossier_autorisation_donnees");
var the_terms = $("#dossier_autorisation_donnees");
if (the_terms.size() == 0)
return;
if (the_terms.size() == 0)
return;
check_value(the_terms);
the_terms.click(function () {
check_value(the_terms);
});
the_terms.click(function () {
check_value(the_terms);
});
function check_value(the_terms) {
if (the_terms.is(":checked")) {
$("#etape_suivante").removeAttr("disabled");
} else {
$("#etape_suivante").attr("disabled", "disabled");
}
function check_value(the_terms) {
if (the_terms.is(":checked")) {
$("#etape_suivante").removeAttr("disabled");
} else {
$("#etape_suivante").attr("disabled", "disabled");
}
}
}
function error_form_siret(invalid_siret) {
setTimeout(function () {
$("input[type='submit']").val('Erreur SIRET');
}, 10);
setTimeout(function () {
$("input[type='submit']").val('Erreur SIRET');
}, 10);
$("input[type='submit']").removeClass('btn-success').addClass('btn-danger');
$("input[type='submit']").removeClass('btn-success').addClass('btn-danger');
$("#dossier_siret").addClass('input-error').val(invalid_siret).on('input', reset_form_siret);
$("#dossier_siret").addClass('input-error').val(invalid_siret).on('input', reset_form_siret);
}
function reset_form_siret() {
$("input[type='submit']").removeClass('btn-danger').addClass('btn-success').val('Valider');
$("#dossier_siret").removeClass('input-error');
$("input[type='submit']").removeClass('btn-danger').addClass('btn-success').val('Valider');
$("#dossier_siret").removeClass('input-error');
}
function toggle_etape_1() {
$('.row.etape.etape_1 .etapes_menu #logos').toggle(100);
$('.row.etape.etape_1 .etapes_informations #description_procedure').toggle(100);
$('.row.etape.etape_1 .etapes_menu #logos').toggle(100);
$('.row.etape.etape_1 .etapes_informations #description_procedure').toggle(100);
}

View file

@ -1,45 +1,44 @@
$(document).on('page:load', filters_init);
$(document).ready(filters_init);
$(document).on('turbolinks:load', filters_init);
function filters_init() {
$('html').click(function(event) {
var visible_filter = $('.filter_framed:visible')
if(visible_filter.length) {
if (!$(event.target).closest('.filter_framed').is(":visible")) {
visible_filter.hide();
}
}
});
$('html').click(function(event) {
var visible_filter = $('.filter_framed:visible')
if(visible_filter.length) {
if (!$(event.target).closest('.filter_framed').is(":visible")) {
visible_filter.hide();
}
}
});
$(".filter").on('click', function (event) {
filter_framed_show(event);
filter_framed_close_all_excepted(framed_id(event));
event.stopPropagation();
});
$(".filter").on('click', function (event) {
filter_framed_show(event);
filter_framed_close_all_excepted(framed_id(event));
event.stopPropagation();
});
$(".erase-filter").on('click', function (event) {
$(this).parent().find(".filter_input").val("");
});
$(".erase-filter").on('click', function (event) {
$(this).parent().find(".filter_input").val("");
});
}
function filter_framed_close_all_excepted(id) {
$(".filter_framed:not("+id+")").hide();
$(".filter_framed:not("+id+")").hide();
$(id).toggle();
$(id).toggle();
}
function framed_id(event) {
return "#framed_" + event.target.id
return "#framed_" + event.target.id
}
function filter_framed_show(event) {
dom_object = $(framed_id(event));
dom_object = $(framed_id(event));
var offset = $('#main-container').offset();
var offset = $('#main-container').offset();
var y = event.pageY - offset.top;
var x = event.pageX - offset.left;
var y = event.pageY - offset.top;
var x = event.pageX - offset.left;
dom_object.css('top', (y + 7) + 'px');
dom_object.css('left', (x + 7) + 'px');
dom_object.css('top', (y + 7) + 'px');
dom_object.css('left', (x + 7) + 'px');
}

View file

@ -1,5 +1,4 @@
$(document).on('page:load', link_init);
$(document).ready(link_init);
$(document).on('turbolinks:load', link_init);
function link_init() {
$('#dossiers_list tr').on('click', function () {

View file

@ -1,7 +1,5 @@
$(document).on('page:load', franceconnect_kit);
$(document).ready(franceconnect_kit);
$(document).on('turbolinks:load', franceconnect_kit);
function franceconnect_kit() {
franceConnectKit.init()
franceConnectKit.init()
}

View file

@ -1,16 +1,15 @@
$(document).on('page:load', modal_action);
$(document).ready(modal_action);
$(document).on('turbolinks:load', modal_action);
function modal_action() {
$('#PJmodal').on('show.bs.modal', function (event) {
$("#PJmodal .modal-body .table .tr_content").hide();
$('#PJmodal').on('show.bs.modal', function (event) {
$("#PJmodal .modal-body .table .tr_content").hide();
var button = $(event.relatedTarget) // Button that triggered the modal
var modal_title = button.data('modal_title'); // Extract info from data-* attributes
var modal_index = button.data('modal_index'); // Extract info from data-* attributes
var button = $(event.relatedTarget) // Button that triggered the modal
var modal_title = button.data('modal_title'); // Extract info from data-* attributes
var modal_index = button.data('modal_index'); // Extract info from data-* attributes
var modal = $(this)
modal.find('#PJmodal_title').html(modal_title);
$("#PJmodal .modal-body .table #"+modal_index).show();
})
var modal = $(this)
modal.find('#PJmodal_title').html(modal_title);
$("#PJmodal .modal-body .table #"+modal_index).show();
})
}

View file

@ -0,0 +1,36 @@
(function() {
var showNotFound = function() {
$('.dossier-link .text-info').hide();
$('.dossier-link .text-warning').show();
};
var showData = function(data) {
$('.dossier-link .procedureLibelle').text(data.procedureLibelle);
$('.dossier-link .text-info').show();
$('.dossier-link .text-warning').hide();
};
var hideEverything = function() {
$('.dossier-link .text-info').hide();
$('.dossier-link .text-warning').hide();
};
var fetchProcedureLibelle = function(e) {
var dossierId = $(e.target).val();
if(dossierId) {
$.get('/users/dossiers/' + dossierId + '/procedure_libelle')
.done(showData)
.fail(showNotFound);
} else {
hideEverything();
}
};
var timeOut = null;
var debounceFetchProcedureLibelle = function(e) {
if(timeOut){ clearTimeout(timeOut); }
timeOut = setTimeout(function() { fetchProcedureLibelle(e); }, 300);
};
$(document).on('input', '[data-type=dossier-link]', debounceFetchProcedureLibelle);
})();

View file

@ -1,33 +1,32 @@
$(document).on('page:load', pref_list_dossier_actions);
$(document).ready(pref_list_dossier_actions);
$(document).on('turbolinks:load', pref_list_dossier_actions);
function pref_list_dossier_actions() {
pref_list_dossier_open_action();
pref_list_dossier_close_action();
pref_list_dossier_open_action();
pref_list_dossier_close_action();
}
function pref_list_dossier_open_action() {
$("#pref_list_dossier_open_action").on('click', function () {
$("#pref_list_menu").css('display', 'block');
$("#pref_list_menu").css('visibility', 'visible');
$("#pref_list_dossier_open_action").on('click', function () {
$("#pref_list_menu").css('display', 'block');
$("#pref_list_menu").css('visibility', 'visible');
$("#pref_list_menu").animate({
right: 0
}, 250);
});
$("#pref_list_menu").animate({
right: 0
}, 250);
});
}
function pref_list_dossier_close_action() {
$("#pref_list_dossier_close_action").on('click', function () {
$("#pref_list_menu").animate({
right: parseInt($("#pref_list_menu").css('width'), 10)*(-1)+'px'
},{
duration: 250,
complete: function () {
$("#pref_list_menu").css('display', 'none');
$("#pref_list_menu").css('visibility', 'hidden');
}
}
)
});
$("#pref_list_dossier_close_action").on('click', function () {
$("#pref_list_menu").animate({
right: parseInt($("#pref_list_menu").css('width'), 10)*(-1)+'px'
},{
duration: 250,
complete: function () {
$("#pref_list_menu").css('display', 'none');
$("#pref_list_menu").css('visibility', 'hidden');
}
}
)
});
}

View file

@ -1,38 +1,37 @@
$(document).on('page:load', button_edit_procedure_init);
$(document).ready(button_edit_procedure_init);
$(document).on('turbolinks:load', button_edit_procedure_init);
function button_edit_procedure_init(){
buttons_api_carto();
button_cerfa();
button_individual();
buttons_api_carto();
button_cerfa();
button_individual();
}
function buttons_api_carto () {
$("#procedure_module_api_carto_use_api_carto").on('change', function() {
$("#modules_api_carto").toggle()
});
$("#procedure_module_api_carto_use_api_carto").on('change', function() {
$("#modules_api_carto").toggle()
});
if ($('#procedure_module_api_carto_use_api_carto').is(':checked'))
$("#modules_api_carto").show();
if ($('#procedure_module_api_carto_use_api_carto').is(':checked'))
$("#modules_api_carto").show();
}
function button_cerfa () {
$("#procedure_cerfa_flag").on('change', function() {
$("#procedure_lien_demarche").toggle()
});
$("#procedure_cerfa_flag").on('change', function() {
$("#procedure_lien_demarche").toggle()
});
if ($('#procedure_cerfa_flag').is(':checked'))
$("#procedure_lien_demarche").show();
if ($('#procedure_cerfa_flag').is(':checked'))
$("#procedure_lien_demarche").show();
}
function button_individual () {
$("#procedure_for_individual").on('change', function() {
$("#individual_with_siret").toggle()
});
$("#procedure_for_individual").on('change', function() {
$("#individual_with_siret").toggle()
});
if ($('#procedure_for_individual').is(':checked'))
$("#individual_with_siret").show();
if ($('#procedure_for_individual').is(':checked'))
$("#individual_with_siret").show();
}

View file

@ -1,60 +1,59 @@
$(document).on('page:load', init_search_anim);
$(document).ready(init_search_anim);
$(document).on('turbolinks:load', init_search_anim);
function init_search_anim(){
$("#search_area").on('click', search_fadeIn);
$("#search_area").on('click', search_fadeIn);
}
function search_fadeIn(){
var search_area = $("#search_area");
var body_dom = $('body');
var positions = search_area.position();
var width = search_area.width();
var search_area = $("#search_area");
var body_dom = $('body');
var positions = search_area.position();
var width = search_area.width();
search_area.css('position', 'fixed');
search_area.css('top', positions.top + $('.navbar').height());
search_area.css('left', positions.left);
search_area.css('z-index', 300);
search_area.css('width', width);
search_area.find('#q').animate({ height: '50px' });
search_area.find('#search_button').animate({ height: '50px' });
search_area.css('position', 'fixed');
search_area.css('top', positions.top + $('.navbar').height());
search_area.css('left', positions.left);
search_area.css('z-index', 300);
search_area.css('width', width);
search_area.find('#q').animate({ height: '50px' });
search_area.find('#search_button').animate({ height: '50px' });
body_dom.append(search_area);
$('#mask_search').fadeIn(200);
body_dom.append(search_area);
$('#mask_search').fadeIn(200);
var body_width = body_dom.width();
var body_width = body_dom.width();
var search_area_width = body_width/2.5;
var search_area_width = body_width/2.5;
search_area.animate({
width: search_area_width,
left: (body_width/2 - search_area_width/2 + 40)
}, 400, function() {
search_area.off();
$("#search_area input").focus();
search_area.animate({
width: search_area_width,
left: (body_width/2 - search_area_width/2 + 40)
}, 400, function() {
search_area.off();
$("#search_area input").focus();
$('#mask_search').on('click', search_fadeOut)
});
$('#mask_search').on('click', search_fadeOut)
});
}
function search_fadeOut(){
var search_area = $("#search_area");
var search_area = $("#search_area");
$('#mask_search').fadeOut(200);
$('#mask_search').fadeOut(200);
search_area.fadeOut(200, function(){
search_area.css('position', 'static');
search_area.css('top', '');
search_area.css('left', '');
search_area.css('z-index', '');
search_area.css('width', 'auto');
search_area.find('#q').css('height', 34);
search_area.find('#search_button').css('height', 34);
search_area.fadeOut(200, function(){
search_area.css('position', 'static');
search_area.css('top', '');
search_area.css('left', '');
search_area.css('z-index', '');
search_area.css('width', 'auto');
search_area.find('#q').css('height', 34);
search_area.find('#search_button').css('height', 34);
$('#search-block').append(search_area);
search_area.fadeIn(200);
$('#search-block').append(search_area);
search_area.fadeIn(200);
init_search_anim();
});
init_search_anim();
});
}

View file

@ -1,3 +1,3 @@
function show_dossier_id_input (){
$("#btn_show_dossier_id_input").hide()
$("#btn_show_dossier_id_input").hide()
}

View file

@ -0,0 +1,20 @@
var TPS = TPS || {};
TPS.toggleChart = function(event, chartClass) {
var nextSelectorItem = $(event.target),
nextChart = $(chartClass),
nextChartId = nextChart.children().first().attr("id"),
currentSelectorItem = nextSelectorItem.parent().find(".segmented-control-item-active"),
currentChart = nextSelectorItem.parent().parent().find(".chart:not(.hidden)");
// Change the current selector and the next selector states
currentSelectorItem.toggleClass("segmented-control-item-active");
nextSelectorItem.toggleClass("segmented-control-item-active");
// Hide the currently shown chart and show the new one
currentChart.toggleClass("hidden");
nextChart.toggleClass("hidden");
// Reflow needed, see https://github.com/highcharts/highcharts/issues/1979
Chartkick.charts[nextChartId].getChartObject().reflow();
}

View file

@ -1,5 +1,4 @@
$(document).on('page:load', activeSelect2);
$(document).ready(activeSelect2);
$(document).on('turbolinks:load', activeSelect2);
function activeSelect2() {
$('select.select2').select2({ theme: "bootstrap", width: '100%' });

View file

@ -0,0 +1,5 @@
@import "variables";
.turbolinks-progress-bar {
background-color: $light-blue;
}

View file

@ -1 +1,5 @@
// colors
$light-blue: #F2F6FA;
// Bootstrap variables
$font-size-base: 16px;

View file

@ -20,4 +20,3 @@
}
}
}

View file

@ -1,9 +0,0 @@
@import "card";
.stats {
.stat-card {
@extend .card;
margin: 15px auto;
max-width: 1200px;
}
}

View file

@ -27,7 +27,7 @@
@import "bootstrap";
body {
background-color: #F2F6FA;
background-color: $light-blue;
}
html, body {
@ -63,7 +63,7 @@ form {
}
#footer {
background-color: #F2F6FA;
background-color: $light-blue;
text-align: center;
padding: 0;
a, p {

View file

@ -1,3 +1,5 @@
@import "variables";
.default_data_block {
font-family: Arial;
@ -53,7 +55,7 @@
color: #FFFFFF;
}
.action:hover {
color: #F2F6FA;
color: $light-blue;
}
.count {
font-size: 16px;

View file

@ -1,3 +1,5 @@
@import "variables";
#header {
top: 0;
left: 0;
@ -185,7 +187,7 @@
}
}
.button-navbar-action:hover {
color: #F2F6FA;
color: $light-blue;
}
.button_navbar:hover, .button-navbar-action:hover {

View file

@ -0,0 +1,124 @@
@import "card";
$dark-grey: #333333;
$light-grey: #999999;
$blue: rgba(61, 149, 236, 1);
$blue-hover: rgba(61, 149, 236, 0.8);
$default-space: 15px;
$new-h1-margin-bottom: 4 * $default-space;
.new-h1 {
color: $dark-grey;
text-align: center;
margin-top: 0;
margin-bottom: $new-h1-margin-bottom;
}
$statistiques-padding-top: $default-space * 2;
.statistiques {
width: 1040px;
margin: 0 auto;
padding-top: $statistiques-padding-top;
}
.stat-cards {
.stat-card:nth-of-type(even) {
margin-right: 0px;
}
}
$stat-card-margin-bottom: 3 * $default-space;
.stat-card {
@extend .card;
margin-bottom: $stat-card-margin-bottom;
border-radius: 5px;
box-shadow: none;
border: 1px solid rgba(0, 0, 0, 0.15);
}
$stat-card-half-horizontal-spacing: 4 * $default-space;
.stat-card-half {
width: calc((100% - #{$stat-card-half-horizontal-spacing}) / 2);
margin-right: 3 * $default-space;
}
.stat-card-title {
color: $dark-grey;
font-size: 26px;
font-weight: 500;
width: 200px;
}
$segmented-control-margin-top: $default-space;
.segmented-control {
border-radius: 36px;
height: 36px;
line-height: 36px;
font-size: 0;
padding: 0;
display: inline-block;
margin-top: $segmented-control-margin-top;
}
$segmented-control-item-horizontal-padding: $default-space;
$segmented-control-item-border-radius: 2 * $default-space;
.segmented-control-item {
color: $blue;
display: inline-block;
font-size: 15px;
border: 2px solid $blue;
margin-right: -2px;
padding-left: $segmented-control-item-horizontal-padding;
padding-right: $segmented-control-item-horizontal-padding;
color: $blue;
&:first-of-type {
border-radius: $segmented-control-item-border-radius 0px 0px $segmented-control-item-border-radius;
}
&:last-of-type {
border-radius: 0px $segmented-control-item-border-radius $segmented-control-item-border-radius 0px;
margin-right: 0;
}
&:hover {
background-color: $blue-hover;
color: white;
cursor: pointer;
}
}
.segmented-control-item-active {
background-color: $blue;
color: white;
}
.chart-container {
margin-top: 36px;
}
.chart {
width: 100%;
}
$big-number-card-padding: 2 * $segmented-control-item-border-radius;
.big-number-card {
padding: $big-number-card-padding;
}
.big-number-card-title {
display: block;
text-align: center;
margin: 0 auto;
color: $light-grey;
}
.big-number-card-number {
display: block;
text-align: center;
font-size: 90px;
line-height: 90px;
font-weight: bold;
color: $blue;
}

View file

@ -1,3 +1,5 @@
@import "variables";
#users_index, #admins_index{
margin-left: 2rem;
margin-right: 2rem;
@ -48,7 +50,7 @@
padding: 10px;
}
.action:hover {
color: #F2F6FA;
color: $light-blue;
}
.padding-left-30 {
padding-left: 30px;

View file

@ -1,24 +0,0 @@
module Administrations
class StatsController < ApplicationController
before_action :authenticate_administration!
def index
procedures = Procedure.where(created_at: Time.current.all_quarter).group("date_trunc('day', created_at)").count
dossiers = Dossier.where(created_at: Time.current.all_quarter).group("date_trunc('day', created_at)").count
@procedures = clean_hash(procedures)
@dossiers = clean_hash(dossiers)
end
private
def clean_hash h
h.keys.each{ |key| h[key.to_date] = h[key]; h.delete(key) }
min_date = h.keys.min
max_date = h.keys.max
(min_date..max_date).each do |date|
h[date] = 0 if h[date].nil?
end
h
end
end
end

View file

@ -39,16 +39,13 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
end
def download_dossiers_tps
if procedure = Procedure.find_by(id: params[:procedure_id])
dossiers = dossiers_list_facade(param_liste).dossiers_to_display
respond_with Dossier.export_full_generation(dossiers, request.format) unless dossiers.empty?
else
dossiers = dossiers_list_facade(param_liste).dossiers_to_display
respond_to do |format|
format.xlsx { render xlsx: dossiers }
format.ods { render ods: dossiers }
format.csv { render csv: dossiers }
end
procedure = Procedure.find_by(id: params[:procedure_id])
export = procedure.generate_export
respond_to do |format|
format.csv { send_data(SpreadsheetArchitect.to_csv(data: export[:data], headers: export[:headers]), filename: 'dossiers.csv') }
format.xlsx { send_data(SpreadsheetArchitect.to_xlsx(data: export[:data], headers: export[:headers]), filename: 'dossiers.xlsx') }
format.ods { send_data(SpreadsheetArchitect.to_ods(data: export[:data], headers: export[:headers]), filename: 'dossiers.ods') }
end
end

View file

@ -5,7 +5,7 @@ class Backoffice::PrivateFormulairesController < ApplicationController
dossier = current_gestionnaire.dossiers.find(params[:dossier_id])
unless params[:champs].nil?
champs_service_errors = ChampsService.save_formulaire dossier.champs_private, params
champs_service_errors = ChampsService.save_champs dossier.champs_private, params
if champs_service_errors.empty?
flash[:notice] = "Formulaire enregistré"

View file

@ -0,0 +1,56 @@
class StatsController < ApplicationController
def index
procedures = Procedure.where(:published => true)
dossiers = Dossier.where.not(:state => :draft)
@procedures_30_days_flow = thirty_days_flow_hash(procedures)
@dossiers_30_days_flow = thirty_days_flow_hash(dossiers)
@procedures_cumulative = cumulative_hash(procedures)
@dossiers_cumulative = cumulative_hash(dossiers)
@procedures_count = procedures.count
@dossiers_count = dossiers.count
end
private
def thirty_days_flow_hash(association)
min_date = 30.days.ago.to_date
max_date = Time.now.to_date
thirty_days_flow_hash = association
.where(:created_at => min_date..max_date)
.group("date_trunc('day', created_at)")
.count
clean_hash(thirty_days_flow_hash, min_date, max_date)
end
def clean_hash(h, min_date, max_date)
# Convert keys to date
h = Hash[h.map { |(k, v)| [k.to_date, v] }]
# Add missing vales where count is 0
(min_date..max_date).each do |date|
if h[date].nil?
h[date] = 0
end
end
h
end
def cumulative_hash(association)
sum = 0
association
.group("DATE_TRUNC('month', created_at)")
.count
.to_a
.sort{ |x, y| x[0] <=> y[0] }
.map { |x, y| { x => (sum += y)} }
.reduce({}, :merge)
end
end

View file

@ -12,10 +12,7 @@ class Users::DescriptionController < UsersController
@procedure = @dossier.procedure
@champs = @dossier.ordered_champs
@headers = @champs.inject([]) do |acc, champ|
acc.push(champ) if champ.type_champ == 'header_section'
acc
end
@headers = @champs.select { |c| c.type_champ == 'header_section' }
unless @dossier.can_be_initiated?
flash[:alert] = t('errors.messages.procedure_archived')
@ -34,18 +31,12 @@ class Users::DescriptionController < UsersController
@champs = @dossier.ordered_champs
mandatory = true
mandatory = !(params[:submit].keys.first == 'brouillon') unless params[:submit].nil?
check_mandatory_fields = !draft_submission?
unless @dossier.update_attributes(create_params)
@dossier = @dossier.decorate
flash.alert = @dossier.errors.full_messages.join('<br />').html_safe
return redirect_to users_dossier_description_path(dossier_id: @dossier.id)
end
unless params[:champs].nil?
champs_service_errors = ChampsService.save_formulaire @dossier.champs, params, mandatory
if params[:champs]
champs_service_errors = ChampsService.save_champs @dossier.champs,
params,
check_mandatory_fields
unless champs_service_errors.empty?
flash.alert = (champs_service_errors.inject('') { |acc, error| acc+= error[:message]+'<br>' }).html_safe
@ -53,33 +44,30 @@ class Users::DescriptionController < UsersController
end
end
if @procedure.cerfa_flag?
unless params[:cerfa_pdf].nil?
cerfa = Cerfa.new(content: params[:cerfa_pdf], dossier: @dossier, user: current_user)
unless cerfa.save
flash.alert = cerfa.errors.full_messages.join('<br />').html_safe
return redirect_to users_dossier_description_path(dossier_id: @dossier.id)
end
if @procedure.cerfa_flag? && params[:cerfa_pdf]
cerfa = Cerfa.new(content: params[:cerfa_pdf], dossier: @dossier, user: current_user)
unless cerfa.save
flash.alert = cerfa.errors.full_messages.join('<br />').html_safe
return redirect_to users_dossier_description_path(dossier_id: @dossier.id)
end
end
unless (errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)).empty?
errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)
unless errors_upload.empty?
flash.alert = errors_upload.html_safe
return redirect_to users_dossier_description_path(dossier_id: @dossier.id)
end
if mandatory
if draft_submission?
flash.notice = 'Votre brouillon a bien été sauvegardé.'
redirect_to url_for(controller: :dossiers, action: :index, liste: :brouillon)
else
if @dossier.draft?
@dossier.initiated!
NotificationMailer.send_notification(@dossier, @dossier.procedure.initiated_mail).deliver_now!
end
flash.notice = 'Félicitations, votre demande a bien été enregistrée.'
redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: @dossier.id)
else
flash.notice = 'Votre brouillon a bien été sauvegardé.'
redirect_to url_for(controller: :dossiers, action: :index, liste: :brouillon)
end
end
@ -123,6 +111,10 @@ class Users::DescriptionController < UsersController
private
def draft_submission?
params[:submit] && params[:submit].keys.first == 'brouillon'
end
def check_autorisation_donnees
@dossier = current_user_dossier
@ -137,9 +129,4 @@ class Users::DescriptionController < UsersController
redirect_to url_for(users_dossier_path(@dossier.id))
end
end
def create_params
params.permit()
end
end

View file

@ -122,7 +122,7 @@ class Users::DossiersController < UsersController
@facade = facade params[:dossier][:id]
if checked_autorisation_donnees?
unless Dossier.find(@facade.dossier.id).update_attributes update_params
unless Dossier.find(@facade.dossier.id).update_attributes update_params_with_formatted_birthdate
flash.alert = @facade.dossier.errors.full_messages.join('<br />').html_safe
return redirect_to users_dossier_path(id: @facade.dossier.id)
@ -154,6 +154,13 @@ class Users::DossiersController < UsersController
redirect_to url_for users_dossiers_path
end
def procedure_libelle
dossier = Dossier.find(params[:dossier_id])
render json: { procedureLibelle: dossier.procedure.libelle }
rescue ActiveRecord::RecordNotFound
render json: {}, status: 404
end
private
def check_siret
@ -171,6 +178,25 @@ class Users::DossiersController < UsersController
params.require(:dossier).permit(:id, :autorisation_donnees, individual_attributes: [:gender, :nom, :prenom, :birthdate])
end
def update_params_with_formatted_birthdate
editable_params = update_params
# If the user was shown a date input field (if its browser supports it),
# the returned param will follow the YYYY-MM-DD pattern, which we need
# do convert to the DD/MM/YYYY pattern we use
if editable_params &&
editable_params[:individual_attributes] &&
editable_params[:individual_attributes][:birthdate] &&
editable_params[:individual_attributes][:birthdate] =~ /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/
original_birthdate = editable_params[:individual_attributes][:birthdate]
formatted_birthdate = I18n.l(original_birthdate.to_date, format: '%d/%m/%Y')
editable_params[:individual_attributes][:birthdate] = formatted_birthdate
end
editable_params
end
def checked_autorisation_donnees?
update_params[:autorisation_donnees] == '1'
end

View file

@ -1,4 +1,3 @@
class TypeDePieceJustificativeDecorator < Draper::Decorator
delegate_all
def button_up params

View file

@ -28,6 +28,10 @@ class Champ < ActiveRecord::Base
same_date? num, '%M'
end
def mandatory_and_blank?
mandatory? && value.blank?
end
def same_date? num, compare
if type_champ == 'datetime' && !value.nil?
if value.to_datetime.strftime(compare) == num

View file

@ -201,6 +201,8 @@ class Dossier < ActiveRecord::Base
scope :archived, -> { where(archived: true) }
scope :downloadable, -> { all_state }
def cerfa_available?
procedure.cerfa_flag? && cerfa.size != 0
end
@ -208,19 +210,16 @@ class Dossier < ActiveRecord::Base
def convert_specific_hash_values_to_string(hash_to_convert)
hash = {}
hash_to_convert.each do |key, value|
value = value.to_s if !value.kind_of?(Time) && !value.nil?
value = serialize_value_for_export(value)
hash.store(key, value)
end
return hash
end
def convert_specific_array_values_to_string(array_to_convert)
array = []
array_to_convert.each do |value|
value = value.to_s if !value.kind_of?(Time) && !value.nil?
array << value
def full_data_strings_array
data_with_champs.map do |value|
serialize_value_for_export(value)
end
return array
end
def export_entreprise_data
@ -261,23 +260,6 @@ class Dossier < ActiveRecord::Base
return headers
end
def self.export_full_generation(dossiers, format)
if dossiers && !dossiers.empty?
data = []
headers = dossiers.first.export_headers
dossiers.each do |dossier|
data << dossier.convert_specific_array_values_to_string(dossier.data_with_champs)
end
if ["csv"].include?(format)
return SpreadsheetArchitect.to_csv(data: data, headers: headers)
elsif ["xlsx"].include?(format)
return SpreadsheetArchitect.to_xlsx(data: data, headers: headers)
elsif ["ods"].include?(format)
return SpreadsheetArchitect.to_ods(data: data, headers: headers)
end
end
end
def followers_gestionnaires_emails
follows.includes(:gestionnaire).map { |f| f.gestionnaire }.pluck(:email).join(' ')
end
@ -321,4 +303,8 @@ class Dossier < ActiveRecord::Base
end
end
def serialize_value_for_export(value)
value.nil? || value.kind_of?(Time) ? value : value.to_s
end
end

View file

@ -1,6 +1,5 @@
class Notification < ActiveRecord::Base
belongs_to :dossier
serialize :liste if Rails.env.test?
# after_save :broadcast_notification

View file

@ -1,5 +1,5 @@
class Procedure < ActiveRecord::Base
has_many :types_de_piece_justificative, dependent: :destroy
has_many :types_de_piece_justificative, -> { order "order_place ASC" }, dependent: :destroy
has_many :types_de_champ, class_name: 'TypeDeChampPublic', dependent: :destroy
has_many :types_de_champ_private, dependent: :destroy
has_many :dossiers
@ -64,10 +64,6 @@ class Procedure < ActiveRecord::Base
types_de_champ_private.order(:order_place)
end
def types_de_piece_justificative_ordered
types_de_piece_justificative.order(:order_place)
end
def self.active id
Procedure.where(archived: false, published: true).find(id)
end
@ -81,7 +77,7 @@ class Procedure < ActiveRecord::Base
end
def switch_types_de_piece_justificative index_of_first_element
switch_list_order(types_de_piece_justificative_ordered, index_of_first_element)
switch_list_order(types_de_piece_justificative, index_of_first_element)
end
def switch_list_order(list, index_of_first_element)
@ -130,4 +126,16 @@ class Procedure < ActiveRecord::Base
self.dossiers.where.not(state: :draft).size
end
def generate_export
exportable_dossiers = dossiers.downloadable
headers = exportable_dossiers.any? ? exportable_dossiers.first.export_headers : []
data = exportable_dossiers.any? ? exportable_dossiers.map { |d| d.full_data_strings_array } : [[]]
{
headers: headers,
data: data
}
end
end

View file

@ -18,7 +18,8 @@ class TypeDeChamp < ActiveRecord::Base
departements: 'departements',
engagement: 'engagement',
header_section: 'header_section',
explication: 'explication'
explication: 'explication',
dossier_link: 'dossier_link'
}
belongs_to :procedure

View file

@ -1,27 +1,41 @@
class ChampsService
def self.save_formulaire champs, params, check_mandatory=true
errors = Array.new
class << self
def save_champs(champs, params, check_mandatory = true)
fill_champs(champs, params)
champs.each do |champ|
champ.value = params[:champs]["'#{champ.id}'"]
champs.select(&:changed?).each(&:save)
if champ.type_champ == 'datetime'
champ.value = params[:champs]["'#{champ.id}'"]+
' ' +
params[:time_hour]["'#{champ.id}'"] +
':' +
params[:time_minute]["'#{champ.id}'"]
end
if check_mandatory
if champ.mandatory? && (champ.value.nil? || champ.value.blank?)
errors.push({message: "Le champ #{champ.libelle} doit être rempli."})
end
end
champ.save if champ.changed?
check_mandatory ? build_error_messages(champs) : []
end
errors
private
def fill_champs(champs, h)
datetimes, not_datetimes = champs.partition { |c| c.type_champ == 'datetime' }
not_datetimes.each { |c| c.value = h[:champs]["'#{c.id}'"] }
datetimes.each { |c| c.value = parse_datetime(c.id, h) }
end
def parse_datetime(champ_id, h)
"#{h[:champs]["'#{champ_id}'"]} #{extract_hour(champ_id, h)}:#{extract_minute(champ_id, h)}"
end
def extract_hour(champ_id, h)
h[:time_hour]["'#{champ_id}'"]
end
def extract_minute(champ_id, h)
h[:time_minute]["'#{champ_id}'"]
end
def build_error_messages(champs)
champs.select(&:mandatory_and_blank?)
.map { |c| build_champ_error_message(c) }
end
def build_champ_error_message(champ)
{ message: "Le champ #{champ.libelle} doit être rempli." }
end
end
end

View file

@ -1,17 +1,17 @@
.row{style:'height: 34px'}
.row{ style: 'height: 34px;' }
- unless smart_listing.empty?
%table.table#liste_gestionnaire
%thead
%th Enlever
%th#email{style:'text-align: right'} Email
%th#email{ style: 'text-align: right;' } Email
- @accompagnateurs_assign.each do |accompagnateur|
%tr
%td.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center
%a.btn.btn-primary{href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: AccompagnateurService::NOT_ASSIGN)}", 'data-method' => 'put'}
%a.btn.btn-primary{ href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: AccompagnateurService::NOT_ASSIGN)}", 'data-method' => 'put' }
.fa.fa-arrow-left
%td{style:'padding-top: 11px; font-size:15px; text-align:right'}= accompagnateur.email
%td{ style: 'padding-top: 11px; font-size: 15px; text-align: right;' }= accompagnateur.email
= smart_listing.paginate
= smart_listing.pagination_per_page_links

View file

@ -1,8 +1,8 @@
= smart_listing_controls_for(:accompagnateurs_not_assign, {class: "form-inline text-right"}) do
= smart_listing_controls_for(:accompagnateurs_not_assign, { class: "form-inline text-right" }) do
.form-group.filter.input-append
= text_field_tag :filter, '', class: "search form-control",
placeholder: "Recherche...", autocomplete: :off
%button.btn.btn-primary{type: :submit}
%button.btn.btn-primary{ type: :submit }
%span.fa.fa-search
- unless smart_listing.empty?
@ -14,9 +14,9 @@
- @accompagnateurs_not_assign.each do |accompagnateur|
%tr
%td.col-xs-11{style:'padding-top: 11px; font-size:15px'}= accompagnateur.email
%td.col-xs-11{ style: 'padding-top: 11px; font-size: 15px;' }= accompagnateur.email
%td.center
%a.btn.btn-success.gestionnaire-affectation{href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: AccompagnateurService::ASSIGN)}", 'data-method' => 'put'}
%a.btn.btn-success.gestionnaire-affectation{ href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: AccompagnateurService::ASSIGN)}", 'data-method' => 'put' }
.fa.fa-arrow-right

View file

@ -9,15 +9,15 @@
%h3
= t('dynamics.admin.procedure.onglet_accompagnateurs.add.title')
#procedure_new.section.section-label
= form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f|
= form_for @gestionnaire, url: { controller: 'admin/gestionnaires', action: :create } do |f|
.row
.col-xs-5
= hidden_field_tag :procedure_id, params[:procedure_id]
=render partial: 'admin/gestionnaires/informations', locals: {f: f}
= render partial: 'admin/gestionnaires/informations', locals: { f: f }
.col-xs-2
%br
%br
= f.submit 'Valider', class: 'btn btn-info', style: 'float:left', id: 'add-gestionnaire-email'
= f.submit 'Valider', class: 'btn btn-info', style: 'float: left;', id: 'add-gestionnaire-email'
.col-xs-6
%h3.text-success Affectés
= smart_listing_render :accompagnateurs_assign

View file

@ -10,8 +10,8 @@
= @dossier.decorate.display_state
%br
État souhaité :
%select{id: :next_state, name: :next_state}
%select{ id: :next_state, name: :next_state }
- Dossier.states.each do |state|
%option{value: state[0]}
=DossierDecorator.case_state_fr state[1]
%option{ value: state[0] }
= DossierDecorator.case_state_fr state[1]
= f.submit 'Valider'

View file

@ -1,4 +1,4 @@
-{email: 'Email*'}.each do |key, value|
- { email: 'Email*' }.each do |key, value|
.form-group
%h4
= value

View file

@ -2,17 +2,17 @@
%table.table#liste_gestionnaire
%thead
%th#libelle= smart_listing.sortable 'Email', 'email'
%th= ''
%th
- @gestionnaires.each do |gestionnaire|
%tr
%td{style:'padding-top: 11px; font-size:15px'}= gestionnaire.email
%td{ style: 'text-align:right' }
%td{ style: 'padding-top: 11px; font-size: 15px;' }= gestionnaire.email
%td{ style: 'text-align: right;' }
.delete.btn.btn-sm.fa.fa-trash
.confirm
=link_to 'Valider', admin_gestionnaire_path(id: gestionnaire.id), {method: :delete, class: 'btn btn-sm btn-success'}
.cancel.btn.btn-sm.btn-danger.fa.fa-minus{style: 'top: 0'}
= link_to 'Valider', admin_gestionnaire_path(id: gestionnaire.id), { method: :delete, class: 'btn btn-sm btn-success' }
.cancel.btn.btn-sm.btn-danger.fa.fa-minus{ style: 'top: 0;' }
= smart_listing.paginate
= smart_listing.pagination_per_page_links

View file

@ -9,11 +9,11 @@
.col-xs-6
%h3 Ajouter un accompagnateur
#procedure_new.section.section-label
= form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f|
= form_for @gestionnaire, url: { controller: 'admin/gestionnaires', action: :create } do |f|
.row
.col-xs-5
= render partial: 'informations', locals: {f: f}
= render partial: 'informations', locals: { f: f }
.col-xs-2
%br
%br
= f.submit 'Valider', class: 'btn btn-info', style: 'float:left'
= f.submit 'Valider', class: 'btn btn-info', style: 'float: left;'

View file

@ -9,7 +9,7 @@
.row
.col-md-6
= f.input :object, label: "Objet de l'email"
= f.input :body, label: "Corps de l'email", input_html: {class: 'wysihtml5'}
= f.input :body, label: "Corps de l'email", input_html: { class: 'wysihtml5' }
.text-right
= link_to "Annuler", admin_procedure_mail_templates_path(@procedure), class: "btn btn-default"
= f.button :submit, 'Mettre à jour', class: "btn-success"
@ -27,4 +27,4 @@
%td.center
= "--#{balise.first}--"
%td
=balise.second[:description]
= balise.second[:description]

View file

@ -2,16 +2,16 @@
.form-inline
.form-group
%h4 Libellé
=ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé'
= ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé'
.form-group
%h4 Description
=ff.text_area :description, class: 'form-control description', placeholder: 'Description'
= ff.text_area :description, class: 'form-control description', placeholder: 'Description'
.form-group
%h4
Lien du formulaire vierge
%small
(optionel)
=ff.url_field :lien_demarche, class: 'form-control', placeholder: 'Lien du document vierge'
= ff.url_field :lien_demarche, class: 'form-control', placeholder: 'Lien du document vierge'
.form-group
= ff.hidden_field :order_place, value: ff.index

View file

@ -1,7 +1,7 @@
= form_for [:admin, @procedure], url: admin_procedure_pieces_justificatives_path(@procedure) , remote: true do |f|
= form_for [:admin, @procedure], url: admin_procedure_pieces_justificatives_path(@procedure), remote: true do |f|
#liste_piece_justificative
= render partial: 'fields', locals:{ types_de_piece_justificative: @procedure.types_de_piece_justificative_ordered.decorate, f: f }
= render partial: 'fields', locals: { types_de_piece_justificative: @procedure.types_de_piece_justificative.decorate, f: f }
= f.submit "Enregistrer", class: 'btn btn-success', id: :save
%hr
#new_type_de_piece_justificative
= render partial: 'fields', locals:{ types_de_piece_justificative: TypeDePieceJustificative.new.decorate, f: f }
= render partial: 'fields', locals: { types_de_piece_justificative: TypeDePieceJustificative.new.decorate, f: f }

View file

@ -1,9 +1,8 @@
- if @procedure.locked?
.alert.alert-info
Cette procédure est publiée, certains éléments de la description ne sont plus modifiables
-{libelle: 'Libellé*', description: 'Description*', organisation: 'Organisation', direction: 'Direction', lien_site_web: 'Lien site internet', lien_notice: 'Lien notice'}.each do |key, value|
- { libelle: 'Libellé*', description: 'Description*', organisation: 'Organisation', direction: 'Direction', lien_site_web: 'Lien site internet', lien_notice: 'Lien notice' }.each do |key, value|
.form-group
%h4
= value
@ -17,17 +16,17 @@
.col-md-6
%h4 Logo de la procédure
- unless @procedure.logo.blank?
= image_tag @procedure.decorate.logo_img, {style: 'height: 40px; display: inline; margin-right: 6px', id: 'preview_procedure_logo'}
= f.file_field :logo, accept: 'image/png, image/jpg, image/jpeg', style: 'display:inline'
= image_tag @procedure.decorate.logo_img, { style: 'height: 40px; display: inline; margin-right: 6px;', id: 'preview_procedure_logo' }
= f.file_field :logo, accept: 'image/png, image/jpg, image/jpeg', style: 'display: inline'
%div{style:'margin-top:5px'}
%div{ style: 'margin-top: 5px;' }
%i
Fichier accepté : JPG / JPEG / PNG
.col-md-6
%h4 Drapeau européen
.checkbox
%label
=f.check_box :euro_flag
= f.check_box :euro_flag
Afficher le drapeau européen
- unless @procedure.locked?
@ -38,7 +37,7 @@
= f.fields_for :module_api_carto, @procedure.module_api_carto do |ff|
.checkbox
%label
=ff.check_box :use_api_carto, id: :procedure_module_api_carto_use_api_carto
= ff.check_box :use_api_carto, id: :procedure_module_api_carto_use_api_carto
Utilisation de la cartographie
%ul#modules_api_carto
@ -68,7 +67,7 @@
%h4 Particuliers
.checkbox
%label
=f.check_box :for_individual
= f.check_box :for_individual
Cette procédure s'adresse à un public qui
%b
ne possède pas (ou pas encore) de numéro SIRET,
@ -84,12 +83,9 @@
.col-md-6
%h4 Options avancées
%label{ for: :auto_archive_on} Archivage automatique le
= f.text_field :auto_archive_on, id: 'auto_archive_on', value: @procedure.auto_archive_on.try{ |d| d.strftime("%d-%m-%Y") }, data: { provide: 'datepicker', 'date-format' => 'dd/mm/yyyy' }
%label{ for: :auto_archive_on } Archivage automatique le
= f.text_field :auto_archive_on, id: 'auto_archive_on', value: @procedure.auto_archive_on.try{ |d| d.strftime("%d-%m-%Y") }, data: { provide: 'datepicker', 'date-language' => 'fr', 'date-format' => 'dd/mm/yyyy' }
(à 00h00)
%p.help-block
%i.fa.fa-info-circle
L'archivage automatique de la procédure entrainera le passage en instruction de tous les dossiers en construction.

View file

@ -4,13 +4,13 @@
%th#ID= smart_listing.sortable 'ID', 'id'
%th#libelle= smart_listing.sortable 'Libellé', 'libelle'
- if @active_class
%th#lien Lien
%th Lien
%th#created_at= smart_listing.sortable 'Date création', 'created_at'
%th#lien Actions
%th Actions
- @procedures.each do |procedure|
- procedure = procedure.decorate
%tr{id: "tr_dossier_#{procedure.id}", 'data-dossier_url' => admin_procedure_path(id: procedure.id)}
%tr{ id: "tr_dossier_#{procedure.id}", 'data-dossier_url' => admin_procedure_path(id: procedure.id) }
%td= procedure.id
%td.col-xs-6
= procedure.libelle

View file

@ -1,17 +1,17 @@
#publishModal.modal.fade{"aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"}
.modal-dialog.modal-lg{:role => "document"}
#publishModal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" }
.modal-dialog.modal-lg{ :role => "document" }
= form_tag admin_procedure_publish_path(procedure_id: @procedure.id), method: :put, remote: true do
.modal-content
.modal-header
%button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%button.close{ "aria-label" => "Close", "data-dismiss" => "modal", :type => "button" }
%span{ "aria-hidden" => "true" } ×
%h4#myModalLabel.modal-title
=@procedure.archived?? 'Réactiver' : 'Publier'
= @procedure.archived? ? 'Réactiver' : 'Publier'
la procédure
%span#publishModal_title
.modal-body
Vous vous apprêtez à
=@procedure.archived?? 'republier' : 'publier'
= @procedure.archived? ? 'republier' : 'publier'
votre procédure au public.
- unless @procedure.archived?
%b
@ -23,13 +23,13 @@
%br
%h4 Lien de la procédure
%p.center
="#{root_url}commencer/"
= "#{root_url}commencer/"
= text_field_tag('procedure_path', @procedure.default_path,
id: 'procedure_path',
placeholder: 'Chemin vers la procédure',
class:'form-control',
class: 'form-control',
maxlength: 30,
style: 'width: 300px; display: inline')
style: 'width: 300px; display: inline;')
#path_messages
#path_is_mine.text-warning.center.message
Ce lien est déjà utilisé par une de vos procédure.
@ -42,7 +42,7 @@
#path_is_invalid.text-danger.center.message
Ce lien n'est pas valide. Il doit comporter au moins 3 caractères et seuls les caractères a-z, 0-9 et '_' sont autorisés.
.modal-footer
= submit_tag "#{@procedure.archived?? 'Réactiver' : 'Publier'}", class: %w(btn btn btn-success),
= submit_tag "#{@procedure.archived? ? 'Réactiver' : 'Publier'}", class: %w(btn btn btn-success),
id: 'publish',
disabled: :disabled
= button_tag 'Annuler', class: %w(btn btn btn-default), id: 'cancel', data: { dismiss: 'modal' }

View file

@ -1,21 +1,21 @@
#transferModal.modal.fade{"aria-labelledby" => "TransferProcedureModal", :role => "dialog", :tabindex => "-1"}
.modal-dialog.modal-md{:role => "document"}
#transferModal.modal.fade{ "aria-labelledby" => "TransferProcedureModal", :role => "dialog", :tabindex => "-1" }
.modal-dialog.modal-md{ :role => "document" }
= form_tag admin_procedure_transfer_path(procedure_id: @procedure.id), method: :post, remote: true do
.modal-content
.modal-header
%button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%button.close{ "aria-label" => "Close", "data-dismiss" => "modal", :type => "button" }
%span{ "aria-hidden" => "true" } ×
%h4#myModalLabel.modal-title
Petit transfert de procédure entre administrateur
.modal-body
%p
Cette fonctionnalité vous permet de transmettre un clone de votre procédure à un autre administrateur.
%div{style:'margin-top:20px'}
= text_field_tag :email_admin, '', {class: 'form-control',
%div{ style:'margin-top:20px' }
= text_field_tag :email_admin, '', { class: 'form-control',
type: 'email',
placeholder: 'Email administrateur cible',
style: 'width: 300px; margin-left:auto; margin-right:auto'}
%div#not_found_admin.center.text-danger{style:'display:none; margin-top: 10px'}
style: 'width: 300px; margin-left:auto; margin-right:auto' }
%div#not_found_admin.center.text-danger{ style:'display: none; margin-top: 10px;' }
Cet administrateur n'existe pas.
.modal-footer
= submit_tag "Envoyer", class: 'btn btn-success'

View file

@ -1,17 +1,17 @@
#onglets
%ul.nav.nav-tabs
%li{class: @draft_class}
%a{:href => "#{url_for :admin_procedures_draft}"}
%li{ class: @draft_class }
%a{ :href => "#{url_for :admin_procedures_draft}" }
%h5.text-primary
="Brouillons"
Brouillons
%li{class: @active_class}
%a{:href => "#{url_for :admin_procedures}"}
%li{ class: @active_class }
%a{ :href => "#{url_for :admin_procedures}" }
%h5.text-success
= "Actives"
Actives
%li{class: @archived_class}
%a{:href => "#{url_for :admin_procedures_archived}"}
%h5{style: 'color: black'}
="Archivées"
%li{ class: @archived_class }
%a{ :href => "#{url_for :admin_procedures_archived}" }
%h5{ style: 'color: black;' }
Archivées
%br

View file

@ -1,6 +1,6 @@
.row.white-back
#procedure_new.section.section-label
= form_for @procedure, url: url_for({controller: 'admin/procedures', action: :update, id: @procedure.id}), multipart: true do |f|
= render partial: 'informations', locals: {f: f}
= form_for @procedure, url: url_for({ controller: 'admin/procedures', action: :update, id: @procedure.id }), multipart: true do |f|
= render partial: 'informations', locals: { f: f }
.text-right
= f.submit 'Enregistrer', class: 'btn btn-success'

View file

@ -1,14 +1,14 @@
#admins_index
.default_data_block.default_visible
%div.row.show-block#new_dossiers
%div.header
%div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
%div.carret-right
%div.carret-down
.row.show-block#new_dossiers
.header
.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
.carret-right
.carret-down
Procédures
%a{href:'/admin/procedures/new'}
%a{ href: '/admin/procedures/new' }
%div#new-procedure.col-lg-2.col-md-2.col-sm-2.col-xs-2.action
Nouvelle
%div.body
.body
= smart_listing_render :procedures

View file

@ -1,8 +1,8 @@
.row.white-back
%h2
=t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure')
= t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure')
#procedure_new.section.section-label
= form_for @procedure, url: {controller: 'admin/procedures', action: :create}, multipart: true do |f|
= render partial: 'informations', locals: {f: f}
= f.submit 'Valider', class: 'btn btn-info', id: 'save-procedure', style: 'float:right'
= form_for @procedure, url: { controller: 'admin/procedures', action: :create }, multipart: true do |f|
= render partial: 'informations', locals: { f: f }
= f.submit 'Valider', class: 'btn btn-info', id: 'save-procedure', style: 'float: right;'

View file

@ -1,40 +1,40 @@
.row.white-back
#procedure_show
-unless @facade.procedure.published?
- unless @facade.procedure.published?
- if @facade.procedure.gestionnaires.size == 0
%a.action_button.btn.btn-success{style:'float: right; margin-top: 10px', disabled: 'disabled', 'data-toggle' => :tooltip, title: 'Vous ne pouvez pas publier une procédure sans qu\'aucun accompagnateur ne soit affecté à celle-ci.', id: 'publish-procedure'}
%a.action_button.btn.btn-success{ style: 'float: right; margin-top: 10px;', disabled: 'disabled', 'data-toggle' => :tooltip, title: 'Vous ne pouvez pas publier une procédure sans qu\'aucun accompagnateur ne soit affecté à celle-ci.', id: 'publish-procedure' }
%i.fa.fa-eraser
Publier
- else
%a.btn.btn-success{"data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px', id: 'publish-procedure'}
%a.btn.btn-success{ "data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style: 'float: right; margin-top: 10px;', id: 'publish-procedure' }
%i.fa.fa-eraser
Publier
=render partial: '/admin/procedures/modal_publish'
= render partial: '/admin/procedures/modal_publish'
%a#transfer.btn.btn-small.btn-default{"data-target" => "#transferModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px; margin-right: 10px'}
%a#transfer.btn.btn-small.btn-default{ "data-target" => "#transferModal", "data-toggle" => "modal", :type => "button", style: 'float: right; margin-top: 10px; margin-right: 10px;' }
%i.fa.fa-exchange
Transférer
=render partial: '/admin/procedures/modal_transfer'
= render partial: '/admin/procedures/modal_transfer'
- if @facade.procedure.archived?
%a#reenable.btn.btn-small.btn-default.text-info{"data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px'}
%a#reenable.btn.btn-small.btn-default.text-info{ "data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style: 'float: right; margin-top: 10px;' }
%i.fa.fa-eraser
Réactiver
= render partial: '/admin/procedures/modal_publish'
- elsif @facade.procedure.published?
= form_tag admin_procedure_archive_path(procedure_id: @facade.procedure.id, archive: !@facade.procedure.archived?), method: :put, style:'float: right; margin-top: 10px' do
%button#archive.btn.btn-small.btn-default.text-info{type: :button}
= form_tag admin_procedure_archive_path(procedure_id: @facade.procedure.id, archive: !@facade.procedure.archived?), method: :put, style: 'float: right; margin-top: 10px;' do
%button#archive.btn.btn-small.btn-default.text-info{ type: :button }
%i.fa.fa-eraser
= 'Archiver'
Archiver
#confirm
%button#valid.btn.btn-small.btn-success{type: :submit}
%button#valid.btn.btn-small.btn-success{ type: :submit }
%i.fa.fa-check
Valider
%button#cancel.btn.btn-small.btn-danger{type: :button}
%button#cancel.btn.btn-small.btn-danger{ type: :button }
%i.fa.fa-remove
Annuler
@ -45,7 +45,7 @@
%div
%h3 Lien procédure
%div{style:'margin-left:3%'}
%div{ style: 'margin-left: 3%;' }
- if @facade.procedure.published?
= link_to @facade.procedure.lien, @facade.procedure.lien, target: '_blank'
- else
@ -55,7 +55,7 @@
%br
%h3 Détails
.row{style:'margin-right:3%; margin-left:3%;'}
.row{ style: 'margin-right: 3%; margin-left: 3%;' }
.description.col-xs-6.col-md-3.procedure-description
%h4.text-info
= @facade.procedure.libelle
@ -90,10 +90,10 @@
%br
%br
%h3
=t('dynamics.admin.procedure.stats.title')
= t('dynamics.admin.procedure.stats.title')
.row
.col-xs-6{style:'margin-left:3%'}
.col-xs-6{ style: 'margin-left: 3%;' }
%h4 Total
%div
= @facade.dossiers_total
@ -129,4 +129,4 @@
- if @facade.dossiers_for_pie_highchart.blank?
Aucune statistique pour le moment
- else
=pie_chart @facade.dossiers_for_pie_highchart
= pie_chart @facade.dossiers_for_pie_highchart

View file

@ -14,7 +14,7 @@
%h4 Description
= ff.text_area :description, class: 'form-control description', placeholder: 'Description', rows: 3
.form-group.drop_down_list{ class: (%w(drop_down_list multiple_drop_down_list).include?(type_champ) ? 'show_inline' : nil), style: 'margin-right: 5px' }
.form-group.drop_down_list{ class: (%w(drop_down_list multiple_drop_down_list).include?(type_champ) ? 'show_inline' : nil), style: 'margin-right: 5px;' }
%h4 Liste déroulante
= ff.fields_for :drop_down_list_attributes, ff.object.object.drop_down_list do |fff|
~ fff.text_area :value, class: 'form-control drop_down_list', placeholder: "Ecrire une valeur par ligne et --valeur-- pour un séparateur.", rows: 3, cols: 30
@ -46,5 +46,3 @@
= link_to("", @types_de_champ_facade.delete_url(ff), method: :delete, remote: true, id: "delete_type_de_champ_#{ff.object.id}", class: %w(form-control btn btn-danger fa fa-trash-o) )
%div{ style: 'background-color: rgb(204, 204, 204); height: 1px; margin: 30px auto;' }

View file

@ -1,4 +1,4 @@
= form_for [:admin, @procedure], url: @types_de_champ_facade.url , remote: true do |f|
= form_for [:admin, @procedure], url: @types_de_champ_facade.url, remote: true do |f|
= render partial: 'admin/types_de_champ/fields', locals: { types_de_champ: @types_de_champ_facade.types_de_champ, f: f }
= f.submit "Enregistrer", class: 'btn btn-success', id: :save
%hr

View file

@ -3,12 +3,12 @@
= image_tag(image_url(LOGO_NAME))
%br
%h2#login_admin
=t('dynamics.admin.connexion_title')
= t('dynamics.admin.connexion_title')
%br
%br
#new_user
= form_for @administrateur, url: {controller: 'administrateurs/sessions', action: :create } do |f|
= form_for @administrateur, url: { controller: 'administrateurs/sessions', action: :create } do |f|
%h4
= f.label :email
.input-group
@ -25,5 +25,5 @@
%br
%br
.actions
= f.submit "Se connecter", class:'btn btn-primary'
= f.submit "Se connecter", class: 'btn btn-primary'
%br

View file

@ -1,19 +1,16 @@
.container
.mt-1
= form_for @admin, url: {controller: 'administrations', action: :create} do |f|
= form_for @admin, url: { controller: 'administrations', action: :create } do |f|
.form-group.form-inline.text-center
= f.text_field :email, placeholder: :email, class: 'form-control'
= f.text_field :password, placeholder: :password, class: 'form-control'
= f.submit 'Créer un administrateur', class: 'btn btn-success', id: 'submit_new_administrateur'
.text-center
=link_to 'Stats', administrations_stats_path, style: 'margin-bottom: 50px; display: block', 'data-no-turbolink': true
= smart_listing_render :admins
%br
%br
.text-center
=link_to 'Deconnexion', '/administrations/sign_out', method: :delete
= link_to 'Deconnexion', '/administrations/sign_out', method: :delete

View file

@ -1,11 +0,0 @@
= javascript_include_tag 'https://code.highcharts.com/highcharts.js', 'chartkick'
.container
.stats
.stat-card
%h1 Procédures créées
= line_chart @procedures
.stat-card
%h1 Dossiers créés
= line_chart @dossiers

View file

@ -1,10 +1,10 @@
%div.filter_framed.panel.panel-primary{id: "#{filter_framed_id}", style:'width: 300px; height: 100px; position: absolute; top: 0; left: 0; display: none'}
.filter_framed.panel.panel-primary{ id: "#{filter_framed_id}", style: 'width: 300px; height: 100px; position: absolute; top: 0; left: 0; display: none;' }
.panel-heading
= preference.libelle
=form_tag @facade_data_view.filter_url, {class: 'panel-body form-inline', method: :post} do
%input.form-control.filter_input{name: "filter_input[#{preference.table_attr}]", style:'width: 69%', value: "#{preference.filter}"}
= form_tag @facade_data_view.filter_url, { class: 'panel-body form-inline', method: :post } do
%input.form-control.filter_input{ name: "filter_input[#{preference.table_attr}]", style: 'width: 69%;', value: "#{preference.filter}" }
%button.btn.btn-sm.btn-success
%i.fa.fa-check
%div.btn.btn-sm.btn-danger.erase-filter
.btn.btn-sm.btn-danger.erase-filter
%i.fa.fa-remove

View file

@ -1,5 +1,5 @@
%h3
=t('dynamics.dossiers.followers.title')
= t('dynamics.dossiers.followers.title')
%br
.row
@ -11,5 +11,3 @@
= follower.email
- else
Aucune personne ne suit ce dossier

View file

@ -8,21 +8,21 @@
- @facade_data_view.preference_list_dossiers_filter.each do |preference|
- unless preference.libelle == 'Statut' || preference.libelle == 'État'
%th{class: "col-md-#{preference.bootstrap_lg} col-lg-#{preference.bootstrap_lg}"}
%th{ class: "col-md-#{preference.bootstrap_lg} col-lg-#{preference.bootstrap_lg}" }
- if preference.table.to_s.include? 'champs'
= preference.libelle
-else
- else
= smart_listing.sortable preference.libelle, preference.table_attr
- if @facade_data_view.active_filter? preference
%i.filter.fa.fa-filter{style: "color:#{(preference.filter.blank? ? 'grey' : 'orange')}", id: "filter_#{smart_listing.name.to_s}_#{preference.table_attr.sub('.', '_')}"}
= render partial: 'backoffice/dossiers/filter_framed', locals:{preference: preference, filter_framed_id: "framed_filter_#{smart_listing.name.to_s}_#{preference.table_attr.sub('.', '_')}"}
%i.filter.fa.fa-filter{ style: "color: #{(preference.filter.blank? ? 'grey' : 'orange')}", id: "filter_#{smart_listing.name.to_s}_#{preference.table_attr.sub('.', '_')}" }
= render partial: 'backoffice/dossiers/filter_framed', locals: { preference: preference, filter_framed_id: "framed_filter_#{smart_listing.name.to_s}_#{preference.table_attr.sub('.', '_')}" }
%th.col-xs-1.center Actions
%th.col-xs-1.center Abonnés
- unless smart_listing.empty?
- smart_listing.collection.each do |dossier|
%tr.dossier-row{id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => backoffice_dossier_url(id: dossier.id)}
%tr.dossier-row{ id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => backoffice_dossier_url(id: dossier.id) }
- if smart_listing.name.to_s == 'follow_dossiers'
%td.col-xs-1.center
- total_notif = dossier.notifications.where(already_read: false).count
@ -54,9 +54,9 @@
%td.center
- if current_gestionnaire.follow?(dossier.id)
= link_to('Quitter'.html_safe, backoffice_dossier_follow_path(dossier_id: dossier.id), 'data-method' => :put, class: 'btn-sm btn-danger', id: "suivre_dossier_#{dossier.id}")
-else
- else
= link_to('Suivre', backoffice_dossier_follow_path(dossier_id: dossier.id), 'data-method' => :put, class: 'btn-sm btn-primary', id: "suivre_dossier_#{dossier.id}")
%td.center{style:"color: #{dossier.total_follow == 0 ? 'red' : ''}"}
%td.center{ style: "color: #{dossier.total_follow == 0 ? 'red' : ''}" }
= dossier.total_follow
= smart_listing.paginate

View file

@ -1,10 +1,10 @@
%button#pref_list_dossier_close_action.btn.btn-danger.btn-xs.fixed-right
%i.fa.fa-close
%h3
=t('dynamics.backoffice.pref_list.title')
= t('dynamics.backoffice.pref_list.title')
%p{style:'margin-top: 15px; margin-bottom: 20px'}
=t('dynamics.backoffice.pref_list.description')
%p{ style: 'margin-top: 15px; margin-bottom: 20px;' }
= t('dynamics.backoffice.pref_list.description')
%h4.text-primary
Actuelles
@ -16,10 +16,10 @@
= hidden_field_tag :pref_id, preference.id
= hidden_field_tag :procedure_id, preference.procedure_id
= preference.libelle
%button.btn.btn-default.btn-xs{type: :submit, id: "delete_pref_list_#{preference[:table]}_#{preference[:attr]}"}
%button.btn.btn-default.btn-xs{ type: :submit, id: "delete_pref_list_#{preference[:table]}_#{preference[:attr]}" }
%i.fa.fa-minus
%h4.text-success{style:'margin-top: 15px'}
%h4.text-success{ style: 'margin-top: 15px;' }
Disponibles
%table
@ -27,7 +27,7 @@
- if index%2 == 0 || tables.first.to_s.include?('champs')
%tr
%td.col-xs-5{style: 'vertical-align: top', colspan: (tables.first == :champs ? 2 : 1)}
%td.col-xs-5{ style: 'vertical-align: top;', colspan: (tables.first == :champs ? 2 : 1) }
%h5= tables.first.to_s.gsub('_', ' ').capitalize
%ul
- if tables.second
@ -42,6 +42,5 @@
= hidden_field_tag :procedure_id, @facade_data_view.procedure_id
= columns.second[:libelle]
%button.btn.btn-default.btn-xs{type: :submit, id: "add_pref_list_#{columns.second[:table]}_#{columns.second[:attr]}"}
%button.btn.btn-default.btn-xs{ type: :submit, id: "add_pref_list_#{columns.second[:table]}_#{columns.second[:attr]}" }
%i.fa.fa-plus

View file

@ -1,21 +1,21 @@
#state_description.row{style:'width: 50%; margin-left: auto; margin-right: auto'}
#state_description.row{ style: 'width: 50%; margin-left: auto; margin-right: auto;' }
.panel.panel-info
.panel-body.center
.row
.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1
.fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'}
.fa.fa-info-circle.text-info{ style: 'font-size: 2em; margin-top: 20%;' }
.col-xs-11
-if dossiers_list_facade.liste == 'nouveaux'
- if dossiers_list_facade.liste == 'nouveaux'
Tous les dossiers présents dans cette liste sont ceux qui
%b
n'ont jamais été ouvert par votre service.
Il attende une première lecture et intervention de votre part.
-elsif dossiers_list_facade.liste == 'a_traiter'
- elsif dossiers_list_facade.liste == 'a_traiter'
Tous les dossiers présents dans cette liste sont ceux qui sont
%b
en cours de construction avec l'usager.
Ils ne sont pas figés et ne sont donc pas complets.
-elsif dossiers_list_facade.liste == 'fige'
- elsif dossiers_list_facade.liste == 'fige'
Tous les dossiers présents dans cette liste ont été déclarés
%b
complets
@ -23,14 +23,14 @@
%b
plus modifiables par l'usager.
Ils attendent donc leurs dépots officiels qui doit être effectué par l'usager.
-elsif dossiers_list_facade.liste == 'deposes'
- elsif dossiers_list_facade.liste == 'deposes'
Tous les dossiers présents dans cette liste ont été
%b
officiellement déposé par l'usager pour examen.
Il faut donc que vous confirmiez par "accusé de réception" la bonne réception de toutes les informations et documents demandés avant examen final.
-elsif dossiers_list_facade.liste == 'a_instruire'
- elsif dossiers_list_facade.liste == 'a_instruire'
Tous les dossiers présents dans cette liste sont à instruire. Ceux sont tous les dossiers
%b
qui ont reçu bonne réception.
-elsif dossiers_list_facade.liste == 'termine'
- elsif dossiers_list_facade.liste == 'termine'
Tous les dossiers présents dans cette liste sont considérés comme cloturé car ils ont tous reçu un verdict final qui peut être "Validé", "Refusé" ou "Sans suite".

View file

@ -16,13 +16,13 @@
.row.center
.col-xs-3
=link_to 'Tous les états', '?liste=all_state', class: 'text-info', style:"text-decoration: #{@facade_data_view.liste == 'all_state'? 'underline' : ''}"
= link_to 'Tous les états', '?liste=all_state', class: 'text-info', style: "text-decoration: #{@facade_data_view.liste == 'all_state'? 'underline' : ''}"
.col-xs-3
=link_to 'En construction', '?liste=a_traiter', class: 'text-danger', style:"text-decoration: #{@facade_data_view.liste == 'a_traiter'? 'underline' : ''}"
= link_to 'En construction', '?liste=a_traiter', class: 'text-danger', style: "text-decoration: #{@facade_data_view.liste == 'a_traiter'? 'underline' : ''}"
.col-xs-3
=link_to 'En instruction', '?liste=a_instruire', class: 'text-warning', style:"text-decoration: #{@facade_data_view.liste == 'a_instruire'? 'underline' : ''}"
= link_to 'En instruction', '?liste=a_instruire', class: 'text-warning', style: "text-decoration: #{@facade_data_view.liste == 'a_instruire'? 'underline' : ''}"
.col-xs-3
=link_to 'Terminés', '?liste=termine', class: 'text-success', style:"text-decoration: #{@facade_data_view.liste == 'termine'? 'underline' : ''}"
= link_to 'Terminés', '?liste=termine', class: 'text-success', style: "text-decoration: #{@facade_data_view.liste == 'termine'? 'underline' : ''}"
.default_data_block.default_visible
.row.show-block#follow_dossiers

View file

@ -3,15 +3,14 @@
= render partial: 'backoffice/dossiers/pref_list'
.default_data_block.default_visible
%div.row.show-block#new_dossiers
%div.header
%div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
%div.carret-right
%div.carret-down
.row.show-block#new_dossiers
.header
.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
.carret-right
.carret-down
Résultat de la recherche
%div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count
=@dossiers.count
.col-lg-2.col-md-2.col-sm-2.col-xs-2.count
= @dossiers.count
dossiers
%div.body
.body
= smart_listing_render :search

View file

@ -41,14 +41,14 @@
%br
%h3#object_website
Object du site internet
%a{:href => "https://tps.apientreprise.fr/"}
%a{ :href => "https://tps.apientreprise.fr/" }
%strong tps.apientreprise.fr
%p
Le site internet tps.apientreprise.fr a pour objet de faciliter la création de démarches administratives en ligne par les acteurs publics, et lexamen par plusieurs services des demandes formulées par les usagers auprès dun ou organismes publics.
%br
%h3#acteurs
Acteurs de
%a{:href => "https://tps.apientreprise.fr/"}
%a{ :href => "https://tps.apientreprise.fr/" }
TPS
%p Les acteurs de TPS sont les suivants :
%ul
@ -64,7 +64,7 @@
%li N° de sécurité sociale,
%li Infractions, condamnations, mesures de sécurité,
%li
%a{:href => "https://www.declaration.cnil.fr/declarations/declaration/donneesSensibles_DN.display.action"} Opinions philosophiques, politiques, religieuses, syndicales, vie sexuelle, données de santé, origine raciale.
%a{ :href => "https://www.declaration.cnil.fr/declarations/declaration/donneesSensibles_DN.display.action" } Opinions philosophiques, politiques, religieuses, syndicales, vie sexuelle, données de santé, origine raciale.
%br
%h3#data_collects
Données collectées et responsabilité des organismes publics à linitiative de démarches en ligne avec TPS.
@ -78,7 +78,7 @@
%h4 Données personnelles :
%p
En application de la loi n°78-17 Informatique et Libertés du 6 janvier 1978, vous disposez d'un droit d'accès, de rectification, de modification et de suppression concernant les données qui vous concernent. Vous pouvez exercer ce droit à travers la rubrique
%a{:href => "http://www.faire-simple.gouv.fr/contact"} Contact
%a{ :href => "http://www.faire-simple.gouv.fr/contact" } Contact
%h4 Données de connexion :
%p Conformément à la loi n°2004-575 du 21 juin 2004 pour la confiance dans léconomie numérique, certaines données de connexion sont conservées par le service aux fins de protection contre les intrusions et de poursuites judiciaires le cas échéant. Ces données sont conservées pendant un an.
@ -97,9 +97,9 @@
%br/
Tél. : 01 41 17 50 50
%p
%a{:href => "http://www.insee.fr/fr/bases-de-donnees/default.asp?page=sirene.htm"} Informations de la base SIRENE
%a{ :href => "http://www.insee.fr/fr/bases-de-donnees/default.asp?page=sirene.htm" } Informations de la base SIRENE
%br/
%a{:href => "http://www.sirene.fr/sirene/public/static/mentions-legales"} Condition légales dutilisation de service SIRENE
%a{ :href => "http://www.sirene.fr/sirene/public/static/mentions-legales" } Condition légales dutilisation de service SIRENE
%br
%h4 INFOGREFFE :
%p
@ -112,9 +112,9 @@
94300 VINCENNES
%p
Les informations transmises aux autorités publiques en charges de lexamen de dossiers de candidature sont définis par le service en ligne suivant proposé aux internautes :
%a{:href => "https://www.infogreffe.fr/societes/documents-officiels/demande-kbis.html"} https://www.infogreffe.fr/societes/documents-officiels/demande-kbis.html
%a{ :href => "https://www.infogreffe.fr/societes/documents-officiels/demande-kbis.html" } https://www.infogreffe.fr/societes/documents-officiels/demande-kbis.html
%p
%a{:href => "https://www.infogreffe.fr/societes/cgu-cgv.html"} Conditions générales dutilisation des données dinfogreffe
%a{ :href => "https://www.infogreffe.fr/societes/cgu-cgv.html" } Conditions générales dutilisation des données dinfogreffe
%br
%h4 TPS fait appel à dautres services opérés par le SGMAP afin de faciliter les démarches administratives :
@ -122,18 +122,18 @@
%p
%strong> France CONNECT
\ : informations complémentaires :
%a{:href => "https://franceconnect.gouv.fr/"} https://franceconnect.gouv.fr/
%a{ :href => "https://franceconnect.gouv.fr/" } https://franceconnect.gouv.fr/
%p
%strong La base dadresse nationale :
%a{:href => "https://adresse.data.gouv.fr/"} https://adresse.data.gouv.fr/
%a{ :href => "https://adresse.data.gouv.fr/" } https://adresse.data.gouv.fr/
%p
%strong TPS est un service de lEtat Plateforme :
%a{:href => "http://etatplateforme.modernisation.gouv.fr/"} http://etatplateforme.modernisation.gouv.fr/
%a{ :href => "http://etatplateforme.modernisation.gouv.fr/" } http://etatplateforme.modernisation.gouv.fr/
%p
%strong Il met en œuvre les principes définis par le programme « Dites-le nous une fois »
%p
%a{:href => "http://www.modernisation.gouv.fr/les-services-publics-se-simplifient-et-innovent/par-des-simplifications-pour-les-entreprises/dites-le-nous-une-fois-un-programme-pour-simplifier-la-vie-des-entreprises"} http://www.modernisation.gouv.fr/les-services-publics-se-simplifient-et-innovent/par-des-simplifications-pour-les-entreprises/dites-le-nous-une-fois-un-programme-pour-simplifier-la-vie-des-entreprises
%a{ :href => "http://www.modernisation.gouv.fr/les-services-publics-se-simplifient-et-innovent/par-des-simplifications-pour-les-entreprises/dites-le-nous-une-fois-un-programme-pour-simplifier-la-vie-des-entreprises" } http://www.modernisation.gouv.fr/les-services-publics-se-simplifient-et-innovent/par-des-simplifications-pour-les-entreprises/dites-le-nous-une-fois-un-programme-pour-simplifier-la-vie-des-entreprises
%br
%h3#reproduction
Droit de reproduction :
@ -143,7 +143,7 @@
%p Lautorisation de création de liens est valable pour tout support, à lexception de ceux diffusant des informations à caractère raciste, pornographique, xénophobe ou pouvant porter atteinte à la sensibilité du plus grand nombre.
%p
La rubrique
%a{:href => "http://www.faire-simple.gouv.fr/contact"} Contactez-nous
%a{ :href => "http://www.faire-simple.gouv.fr/contact" } Contactez-nous
est à votre disposition pour nous faire part de vos remarques et suggestions.
%br
%h3#propriete_intellectuelle

View file

@ -1,8 +1,8 @@
%br
%div{style: 'text-align: center; max-width:500px; margin-left:auto; margin-right:auto; padding: 20px;'}
%div{ style: 'text-align: center; max-width: 500px; margin-left: auto; margin-right: auto; padding: 20px;' }
= render partial: 'users/sessions/resume_procedure'
.center{style:'margin-top: -20px'}
.center{ style: 'margin-top: -20px;' }
%h3
La campagne de création de nouveau dossier
%br
@ -11,5 +11,5 @@
%br
%p
Si vous avez déjà déposé un ou plusieurs dossiers :
%a.btn.btn-lg.btn-info{href: new_user_session_path}
%a.btn.btn-lg.btn-info{ href: new_user_session_path }
Accéder à mon espace en ligne.

View file

@ -1,7 +1,7 @@
- unless smart_listing.empty?
%table.table
%tr
%th{colspan: 4}
%th{ colspan: 4 }
%h4 Lien vers les procédures TPS
%tr
%th= smart_listing.sortable 'ID', 'id'

View file

@ -16,8 +16,7 @@
%tr
%td= file.user.nil? ? 'Accompagnateur' : file.user.email
%td= file.created_at.localtime
%td= link_to file.original_filename, file.content_url, style:'color: green', target: '_blank'
%td= link_to file.original_filename, file.content_url, style: 'color: green;', target: '_blank'
- else
%h4.text-primary
Pas de fichier dans le flux de commentaires.

View file

@ -2,66 +2,66 @@
- if @facade.procedure.individual_with_siret
.default_data_block
%div.row.show-block.infos
%div.header
%div.col-xs-8.title-no-expanse
%div.carret-right
.row.show-block.infos
.header
.col-xs-8.title-no-expanse
.carret-right
INFORMATIONS DU DEMANDEUR
- if !@current_gestionnaire && ["draft", "updated", "replied", "initiated"].include?(@facade.dossier.state)
%a#add_siret.action{href: users_dossier_add_siret_path(dossier_id: @facade.dossier.id)}
%div.col-lg-4.col-md-4.col-sm-4.col-xs-4.action
= "Renseigner un SIRET"
%a#add_siret.action{ href: users_dossier_add_siret_path(dossier_id: @facade.dossier.id) }
.col-lg-4.col-md-4.col-sm-4.col-xs-4.action
Renseigner un SIRET
- unless @facade.entreprise.nil?
.default_data_block
%div.row.show-block.infos#infos_entreprise
%div.header
%div.col-xs-12.title
%div.carret-right
%div.carret-down
.row.show-block.infos#infos_entreprise
.header
.col-xs-12.title
.carret-right
.carret-down
INFORMATIONS DU DEMANDEUR
%div.body.display-block-on-print
.body.display-block-on-print
= render partial: '/dossiers/infos_entreprise'
.default_data_block.default_visible
%div.row.show-block.infos#infos_dossier
%div.header
%div.col-xs-10.title
%div.carret-right
%div.carret-down
.row.show-block.infos#infos_dossier
.header
.col-xs-10.title
.carret-right
.carret-down
CONSTRUCTION DU DOSSIER
= render partial: '/dossiers/edit_dossier'
%div.body.display-block-on-print
.body.display-block-on-print
= render partial: '/dossiers/infos_dossier'
- if @facade.dossier.procedure.module_api_carto.use_api_carto
.default_data_block.default_visible.no-page-break-inside
%div.row.show-block#carto
%div.header
%div.col-xs-10.title
%div.carret-right
%div.carret-down
.row.show-block#carto
.header
.col-xs-10.title
.carret-right
.carret-down
CARTOGRAPHIE
= render partial: '/dossiers/edit_carto'
%div.body.display-block-on-print
%input{id: 'json_latlngs', type: 'hidden', value: "#{@facade.dossier.json_latlngs}", name: 'json_latlngs'}
%input{id: 'quartier_prioritaires', type: 'hidden', value: "#{@facade.dossier.quartier_prioritaires.to_json}"}
%input{id: 'cadastres', type: 'hidden', value: "#{@facade.dossier.cadastres.to_json}"}
.body.display-block-on-print
%input{ id: 'json_latlngs', type: 'hidden', value: "#{@facade.dossier.json_latlngs}", name: 'json_latlngs' }
%input{ id: 'quartier_prioritaires', type: 'hidden', value: "#{@facade.dossier.quartier_prioritaires.to_json}" }
%input{ id: 'cadastres', type: 'hidden', value: "#{@facade.dossier.cadastres.to_json}" }
= render partial: '/users/carte/map', locals: {dossier: @facade.dossier}
= render partial: 'users/carte/init_carto', locals: {dossier: @facade.dossier}
= render partial: '/users/carte/map', locals: { dossier: @facade.dossier }
= render partial: 'users/carte/init_carto', locals: { dossier: @facade.dossier }
- if @current_gestionnaire && gestionnaire_signed_in? && @champs_private.count > 0
.default_data_block.default_visible
%div.row.show-block#private-fields
%div.header
%div.col-xs-10.title
%div.carret-right
%div.carret-down
.row.show-block#private-fields
.header
.col-xs-10.title
.carret-right
.carret-down
= "formulaire privé".upcase
%div.col-xs-2.count
.col-xs-2.count
- private_fields_count = @champs_private.count
= (private_fields_count == 1) ? "1 champ" : "#{private_fields_count} champs"
%div.body
.body
= render partial: '/dossiers/infos_private_fields'

View file

@ -1,20 +1,15 @@
%div.dropdown.pull-right#download-menu
- if @facade_data_view.dossiers_to_display.count > 400
%button.btn.btn-error.dropdown-toggle#dropdownDownloadMenu{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false, class: 'disabled'}
%span{'data-toggle' => :tooltip, "data-placement" => :left, title: 'Pour réduire le nombre de dossiers et ne pas dépasser la limite autorisée de 400, merci de bien vouloir appliquer des filtres.'}
= t('dynamics.backoffice.limit_excess_download_all_dossiers')
- else
%a.dropdown-toggle#dropdownDownloadMenu.button_navbar{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
%i.fa.fa-download
= t('dynamics.backoffice.download_all_dossiers')
%span.caret
.dropdown.pull-right#download-menu
%a.dropdown-toggle.button_navbar{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
%i.fa.fa-download
Télécharger tous les dossiers
%span.caret
%ul.dropdown-menu.dropdown-menu-right
%li
= link_to backoffice_download_dossiers_tps_path(format: :csv, procedure_id: params[:id]), { class: 'btn btn-sm export-link' } do
= link_to backoffice_download_dossiers_tps_path(format: :csv, procedure_id: params[:id]), { class: 'btn btn-sm export-link' } do
= t('dynamics.backoffice.format_csv')
%li
= link_to backoffice_download_dossiers_tps_path(format: :xlsx, procedure_id: params[:id]), { class: 'btn btn-sm export-link' } do
= t('dynamics.backoffice.format_xlsx')
%li
= link_to backoffice_download_dossiers_tps_path(format: :ods, procedure_id: params[:id]), { class: 'btn btn-sm export-link' } do
= link_to backoffice_download_dossiers_tps_path(format: :ods, procedure_id: params[:id]), { class: 'btn btn-sm export-link' } do
= t('dynamics.backoffice.format_ods')

Some files were not shown because too many files have changed in this diff Show more