Merge branch 'develop' into refactor_type_de_xxx

Conflicts:
	db/schema.rb
This commit is contained in:
Tanguy PATTE 2015-11-20 17:16:45 +01:00
commit d6e4a76bf9
73 changed files with 1352 additions and 212 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -18,4 +18,10 @@
//= require bootstrap-sprockets
//= require bootstrap-datepicker/core
//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr.js
//= require leaflet
//= require leaflet.js
//= require d3.min
//= require clipper
//= require concavehull.min
//= require graham_scan.min
//= require leaflet.freedraw

View file

@ -1,10 +1,64 @@
//récupération de la position de l'entreprise
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>'
});
function get_position(){
var LON = '2.428462';
var LAT = '46.538192';
position = get_position() || {lon: LON, lat: LAT, zoom: 13};
if (typeof position.zoom == 'undefined')
position.zoom = 13;
var map = L.map("map", {
center: new L.LatLng(position.lat, position.lon),
zoom: position.zoom,
layers: [OSM]
});
var freeDraw = new L.FreeDraw({
//mode: L.FreeDraw.MODES.CREATE
});
map.addLayer(freeDraw);
if ($("#json_latlngs").val() != '' && $("#json_latlngs").val() != '[]') {
$.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), 5);
add_event_freeDraw(freeDraw);
}
function add_event_freeDraw(freeDraw) {
freeDraw.on('markers', function (e) {
$("#json_latlngs").val(JSON.stringify(e.latLngs));
});
$("#new").on('click', function (e) {
freeDraw.setMode(L.FreeDraw.MODES.CREATE);
});
$("#edit").on('click', function (e) {
freeDraw.setMode(L.FreeDraw.MODES.EDIT);
});
$("#delete").on('click', function (e) {
freeDraw.setMode(L.FreeDraw.MODES.DELETE);
});
}
function get_position() {
var position;
$.ajax({
url: '/users/dossiers/'+dossier_id+'/carte/position',
url: '/users/dossiers/' + dossier_id + '/carte/position',
dataType: 'json',
async: false
}).done(function (data) {
@ -12,23 +66,4 @@ function get_position(){
});
return position;
}
function get_ref_dossier (){
$.post("http://apicarto.coremaps.com/api/v1/datastore", {
contentType: "application/json",
dataType: 'json',
geom: JSON.stringify(window.featureCollection.features[0]),
ascyn: false
}).done(function (data) {
$("#ref_dossier").val(data.reference);
});
}
function submit_check_draw(e) {
if (window.location.href.indexOf('carte') > -1 && window.featureCollection.features.length == 0) {
$("#flash_message").html('<div class="alert alert-danger">Un dessin est obligatoire.</div>');
e.preventDefault();
return false;
}
}

View file

@ -0,0 +1,32 @@
#backoffice_search {
.table {
tr th {
border-top: none
}
}
ul {
li {
margin-top: 11px;
a {
height: 45px;
h5 {
margin-top: 4px;
}
}
}
#search {
margin-top: 0;
a {
height: auto;
}
a:hover {
height: 56px;
background-color: transparent;
border: none;
padding: 11px 16px;
}
}
}
}

View file

@ -5,6 +5,88 @@
table {
font-size: 13;
}
#map{
height:600px;
width: 100%;
}
#map.mini{
height:300px;
}
#map section.overlay {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
box-shadow: inset -100px 0 100px -100px rgba(0, 0, 0, .25);
width: 100%;
height: 100%;
z-index: 2001;
}
#map.mode-create {
cursor: crosshair !important;
}
#map g path {
transition: all 0.25s;
stroke-width: 4px;
stroke-opacity: 1;
stroke: #D7217E;
position: absolute;
z-index: 1001;
fill: #D7217E;
fill-opacity: .75;
-webkit-filter: none;
}
#map.mode-delete path {
cursor: no-drop !important;
}
#map.mode-delete path:hover {
fill: #4d4d4d !important;
}
#map div.polygon-elbow {
-webkit-transition: opacity .25s;
box-shadow: 0 0 0 2px white, 0 0 10px rgba(0, 0, 0, .35);
border: 5px solid #D7217E;
border-radius: 10px;
transition: opacity 0.25s;
cursor: move;
opacity: 0;
pointer-events: none;
box-sizing: border-box;
width: 0 !important;
height: 0 !important;
}
#map div.polygon-elbow.non-polygon {
opacity: 0 !important;
pointer-events: none !important;
border: 5px solid darkgray;
}
#map.mode-edit div.polygon-elbow {
opacity: 1;
pointer-events: all;
}
#map svg.tracer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2001;
pointer-events: none;
}
.info {
padding: 6px 8px;
font: 14px/16px Arial, Helvetica, sans-serif;

View file

@ -5,6 +5,33 @@ class Backoffice::DossiersController < ApplicationController
initialize_instance_params params[:id]
end
def a_traiter
@dossiers_a_traiter = Dossier.a_traiter(current_gestionnaire).decorate
total_dossiers_per_state
end
def en_attente
@dossiers_en_attente = Dossier.en_attente(current_gestionnaire).decorate
total_dossiers_per_state
end
def termine
@dossiers_termine = Dossier.termine(current_gestionnaire).decorate
total_dossiers_per_state
end
def search
@search_terms = params[:search_terms]
@dossiers_search, @dossier = Dossier.search(current_gestionnaire, @search_terms)
@dossiers_search = @dossiers_search.decorate unless @dossiers_search.empty?
@dossier = @dossier.decorate unless @dossier.nil?
total_dossiers_per_state
rescue RuntimeError
@dossiers_search = []
end
def valid
initialize_instance_params params[:dossier_id]
@ -25,6 +52,12 @@ class Backoffice::DossiersController < ApplicationController
private
def total_dossiers_per_state
@dossiers_a_traiter_total = !@dossiers_a_traiter.nil? ? @dossiers_a_traiter.size : Dossier.a_traiter(current_gestionnaire).size
@dossiers_en_attente_total = !@dossiers_en_attente.nil? ? @dossiers_en_attente.size : Dossier.en_attente(current_gestionnaire).size
@dossiers_termine_total = !@dossiers_termine.nil? ? @dossiers_termine.size : Dossier.termine(current_gestionnaire).size
end
def initialize_instance_params dossier_id
@dossier = Dossier.find(dossier_id)
@entreprise = @dossier.entreprise.decorate

View file

@ -4,9 +4,7 @@ class BackofficeController < ApplicationController
if !gestionnaire_signed_in?
redirect_to(controller: '/gestionnaires/sessions', action: :new)
else
@dossiers_a_traiter = Dossier.a_traiter(current_gestionnaire).decorate
@dossiers_en_attente = Dossier.en_attente(current_gestionnaire).decorate
@dossiers_termine = Dossier.termine(current_gestionnaire).decorate
redirect_to(:backoffice_dossiers_a_traiter)
end
end
end

View file

@ -0,0 +1,7 @@
class DemoController < ApplicationController
def index
end
end

View file

@ -8,11 +8,12 @@ class Users::CarteController < UsersController
redirect_to url_for(root_path)
end
#TODO change name funtion
def save_ref_api_carto
dossier = current_user_dossier
dossier.update_attributes(json_latlngs: params[:json_latlngs])
if dossier.draft?
#dossier.update_attributes(ref_dossier_carto: params[:ref_dossier])
redirect_to url_for(controller: :description, action: :show, dossier_id: params[:dossier_id])
else
commentaire_params = {
@ -23,7 +24,6 @@ class Users::CarteController < UsersController
commentaire = Commentaire.new commentaire_params
commentaire.save
redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: params[:dossier_id])
end
end

View file

@ -19,6 +19,17 @@ class Users::DossiersController < UsersController
procedure = Procedure.find(params['procedure_id'])
@etablissement = Etablissement.new(SIADE::EtablissementAdapter.new(siret).to_params)
@entreprise = Entreprise.new(SIADE::EntrepriseAdapter.new(siren).to_params)
exercices = SIADE::ExercicesAdapter.new(siret).to_params
unless exercices.nil?
exercices.each_value do |exercice|
exercice = Exercice.new(exercice)
exercice.etablissement = @etablissement
exercice.save
end
end
@dossier = Dossier.create(user: current_user)
@dossier.draft!

View file

@ -31,4 +31,10 @@ class DossierDecorator < Draper::Decorator
fail 'State not valid'
end
end
def state_color_class
return 'text-danger' if a_traiter?
return 'text-info' if en_attente?
return 'text-success' if termine?
end
end

View file

@ -4,8 +4,8 @@ class Dossier < ActiveRecord::Base
replied: 'replied',
updated: 'updated',
validated: 'validated',
submitted: 'submitted', #-submit_validated
closed: 'closed'} #-processed
submitted: 'submitted',
closed: 'closed'}
has_one :etablissement, dependent: :destroy
has_one :entreprise, dependent: :destroy
@ -30,6 +30,10 @@ class Dossier < ActiveRecord::Base
validates :description, presence: true, allow_blank: false, allow_nil: true
validates :user, presence: true
A_TRAITER = %w(initiated updated submitted)
EN_ATTENTE = %w(replied validated)
TERMINE = %w(closed)
def retrieve_piece_justificative_by_type(type)
pieces_justificatives.where(type_de_piece_justificative_id: type).last
end
@ -116,16 +120,67 @@ class Dossier < ActiveRecord::Base
state
end
def a_traiter?
A_TRAITER.include?(state)
end
def en_attente?
EN_ATTENTE.include?(state)
end
def termine?
TERMINE.include?(state)
end
def self.a_traiter current_gestionnaire
Dossier.joins(:procedure).where("(state='initiated' OR state='updated' OR state='submitted') AND dossiers.procedure_id = procedures.id AND procedures.administrateur_id = #{current_gestionnaire.administrateur_id}").order('updated_at ASC')
current_gestionnaire.dossiers.where(state: A_TRAITER).order('updated_at ASC')
end
def self.en_attente current_gestionnaire
Dossier.joins(:procedure).where("(state='replied' OR state='validated') AND dossiers.procedure_id = procedures.id AND procedures.administrateur_id = #{current_gestionnaire.administrateur_id}").order('updated_at ASC')
current_gestionnaire.dossiers.where(state: EN_ATTENTE).order('updated_at ASC')
end
def self.termine current_gestionnaire
Dossier.joins(:procedure).where("state='closed' AND dossiers.procedure_id = procedures.id AND procedures.administrateur_id = #{current_gestionnaire.administrateur_id}").order('updated_at ASC')
current_gestionnaire.dossiers.where(state: TERMINE).order('updated_at ASC')
end
def self.search current_gestionnaire, terms
return [], nil if terms.blank?
dossiers = Dossier.arel_table
users = User.arel_table
etablissements = Etablissement.arel_table
entreprises = Entreprise.arel_table
composed_scope = self.joins('LEFT OUTER JOIN users ON users.id = dossiers.user_id')
.joins('LEFT OUTER JOIN entreprises ON entreprises.dossier_id = dossiers.id')
.joins('LEFT OUTER JOIN etablissements ON etablissements.dossier_id = dossiers.id')
terms.split.each do |word|
query_string = "%#{word}%"
query_string_start_with = "#{word}%"
composed_scope = composed_scope.where(
dossiers[:nom_projet].matches(query_string).or\
users[:email].matches(query_string).or\
etablissements[:siret].matches(query_string_start_with).or\
entreprises[:raison_sociale].matches(query_string))
end
#TODO refactor
composed_scope = composed_scope.where(
dossiers[:id].eq_any(current_gestionnaire.dossiers.ids).and\
dossiers[:state].does_not_match('draft'))
begin
if Float(terms) && terms.to_i <= 2147483647 && current_gestionnaire.dossiers.ids.include?(terms.to_i)
dossier = Dossier.where("state != 'draft'").find(terms.to_i)
end
rescue ArgumentError, ActiveRecord::RecordNotFound
dossier = nil
end
return composed_scope, dossier
end
private

View file

@ -1,4 +1,6 @@
class Etablissement < ActiveRecord::Base
belongs_to :dossier
belongs_to :entreprise
has_many :exercices
end

3
app/models/exercice.rb Normal file
View file

@ -0,0 +1,3 @@
class Exercice < ActiveRecord::Base
belongs_to :etablissement
end

View file

@ -5,4 +5,7 @@ class Gestionnaire < ActiveRecord::Base
:recoverable, :rememberable, :trackable, :validatable
belongs_to :administrateur
has_many :procedures, through: :administrateur
has_many :dossiers, through: :procedures
end

View file

@ -0,0 +1,25 @@
%h1 Gestion des dossiers
%br
%ul.nav.nav-tabs
%li{class: "#{'active' unless @dossiers_a_traiter.nil? }"}
%a{:href => "#{url_for :backoffice_dossiers_a_traiter}"}
%h5.text-danger
= "À traiter (#{@dossiers_a_traiter_total})"
%li{class: "#{'active' unless @dossiers_en_attente.nil? }"}
%a{:href => "#{url_for :backoffice_dossiers_en_attente}"}
%h5.text-info
="En attente (#{@dossiers_en_attente_total})"
%li{class: "#{'active' unless @dossiers_termine.nil? }"}
%a{:href => "#{url_for :backoffice_dossiers_termine}"}
%h5.text-success
= "Terminé (#{@dossiers_termine_total})"
%li#search{class: "#{'active' unless @dossiers_search.nil?}", style:'float:right'}
%a
= form_tag(backoffice_dossiers_search_url, method: :post) do
.input-group{style:'width: 300px'}
= text_field_tag('search_terms', "#{@search_terms unless @search_terms.nil? }", id: 'search_terms', placeholder: "Rechercher un dossier ...", class:'form-control')
%span.input-group-btn
= button_tag('', id:'search_button', class:'btn btn-default') do
%i.fa.fa-search
%br

View file

@ -0,0 +1,17 @@
#backoffice_a_traiter
= render partial: 'onglets'
-#%h3.text-danger À traiter
%table.table
%thead.row
%th.col-md-4.col-lg-4 Procédure
%th.col-md-4.col-lg-4 Dossier
%th.col-md-2.col-lg-2 État
%th.col-md-2.col-lg-2 Date de mise à jour
- @dossiers_a_traiter.each do |dossier|
%tr
%td= dossier.procedure.libelle
%td
= link_to(dossier.nom_projet, "/backoffice/dossiers/#{dossier.id}")
%td= dossier.state_fr
%td= dossier.last_update

View file

@ -0,0 +1,17 @@
#backoffice_en_attente
= render partial: 'onglets'
-#%h3.text-info En attente
%table.table
%thead
%th.col-md-4.col-lg-4 Procédure
%th.col-md-4.col-lg-4 Dossier
%th.col-md-2.col-lg-2 État
%th.col-md-2.col-lg-2 Date de mise à jour
- @dossiers_en_attente.each do |dossier|
%tr
%td= dossier.procedure.libelle
%td
= link_to(dossier.nom_projet, "/backoffice/dossiers/#{dossier.id}")
%td= dossier.state_fr
%td= dossier.last_update

View file

@ -0,0 +1,47 @@
#backoffice_search
= render partial: 'onglets'
- unless @dossier.nil?
%table.table{style:'background-color: rgba(248, 248, 255, 0.8)'}
%tr
%th{colspan:2}
%h4
= "Dossier N°#{@dossier.id}"
%tr
%td.col-md-2.col-lg-1
= @dossier.id
%td.col-md-4.col-lg-3
= link_to(@dossier.nom_projet, "/backoffice/dossiers/#{@dossier.id}")
%td.col-md-2.col-lg-3
= @dossier.entreprise.raison_sociale
%td.col-md-4.col-lg-2
= @dossier.user.email
%td.col-md-2.col-lg-2
= @dossier.etablissement.siret
%td.col-md-1.col-lg-1
= @dossier.state_fr
%br
- if @dossiers_search.empty? && @dossier.nil?
%div{style: 'text-align:center'}
%h4 Aucun dossier trouvé
- elsif !@dossiers_search.empty?
%table.table
%tr
%th.col-md-2.col-lg-1 ID dossier
%th.col-md-4.col-lg-3 Dossier
%th.col-md-2.col-lg-3 Raison Sociale
%th.col-md-4.col-lg-2 Email contact
%th.col-md-2.col-lg-2 SIRET
%th.col-md-1.col-lg-1 État
- @dossiers_search.each do |dossier|
%tr
%td= dossier.id
%td
= link_to(dossier.nom_projet, "/backoffice/dossiers/#{dossier.id}")
%td= dossier.entreprise.raison_sociale
%td= dossier.user.email
%td= dossier.etablissement.siret
%td{class: dossier.state_color_class}= dossier.state_fr

View file

@ -0,0 +1,17 @@
#backoffice_termine
= render partial: 'onglets'
-#%h3.text-success Terminé
%table.table
%thead
%th.col-md-4.col-lg-4 Procédure
%th.col-md-4.col-lg-4 Dossier
%th.col-md-2.col-lg-2 État
%th.col-md-2.col-lg-2 Date de mise à jour
- @dossiers_termine.each do |dossier|
%tr
%td= dossier.procedure.libelle
%td
= link_to(dossier.nom_projet, "/backoffice/dossiers/#{dossier.id}")
%td= dossier.state_fr
%td= dossier.last_update

View file

@ -1,49 +0,0 @@
#backoffice
%h1 Gestion des dossiers
%br
%h3.text-danger À traiter
%table.table
%thead.row
%th.col-md-4.col-lg-4 Procédure
%th.col-md-4.col-lg-4 Dossier
%th.col-md-2.col-lg-2 État
%th.col-md-2.col-lg-2 Date de mise à jour
- @dossiers_a_traiter.each do |dossier|
%tr
%td= dossier.procedure.libelle
%td
= link_to(dossier.nom_projet, "/backoffice/dossiers/#{dossier.id}")
%td= dossier.state_fr
%td= dossier.last_update
%br
%h3.text-info En attente
%table.table
%thead
%th.col-md-4.col-lg-4 Procédure
%th.col-md-4.col-lg-4 Dossier
%th.col-md-2.col-lg-2 État
%th.col-md-2.col-lg-2 Date de mise à jour
- @dossiers_en_attente.each do |dossier|
%tr
%td= dossier.procedure.libelle
%td
= link_to(dossier.nom_projet, "/backoffice/dossiers/#{dossier.id}")
%td= dossier.state_fr
%td= dossier.last_update
%br
%h3.text-success Terminé
%table.table
%thead
%th.col-md-4.col-lg-4 Procédure
%th.col-md-4.col-lg-4 Dossier
%th.col-md-2.col-lg-2 État
%th.col-md-2.col-lg-2 Date de mise à jour
- @dossiers_termine.each do |dossier|
%tr
%td= dossier.procedure.libelle
%td
= link_to(dossier.nom_projet, "/backoffice/dossiers/#{dossier.id}")
%td= dossier.state_fr
%td= dossier.last_update

View file

@ -0,0 +1,15 @@
%table.table
%tr
%th{colspan: 3}
%h4 Lien vers les procédures TPS
%tr
%td
%th Titre
%th Description
- Procedure.all.each do |procedure|
%tr
%td.col-md-1.col-lg-1
%td.col-md-4.col-lg-4
= link_to procedure.libelle, "/users/siret?procedure_id=#{procedure.id}"
%td
= procedure.description

View file

@ -13,23 +13,36 @@
%br
- rescue
=''
.col-lg-6.col-md-6
=render partial: '/dossiers/pieces_justificatives'
- if @dossier.procedure.use_api_carto
.col-lg-6.col-md-6
#map.mini
%input{id: 'json_latlngs', type:'hidden', value: "#{@dossier.json_latlngs}"}
%script{type: 'text/javascript'}
= "var dossier_id =#{@dossier.id}"
initCarto();
%br
-unless @champs.nil?
%table.table#liste_champs
-@champs.each do |champ|
%tr
%th{ style: 'width:25%' }
=champ.libelle
%td
=champ.value
-unless @champs.nil?
.row
.col-lg-6.col-md-6
%table.table#liste_champs
-@champs.each do |champ|
%tr
%th{ style: 'width:25%' }
=champ.libelle
%td
=champ.value
.col-lg-6.col-md-6
=render partial: '/dossiers/pieces_justificatives'
%br
%div.row{style: 'text-align:right'}
-unless gestionnaire_signed_in?
-if !@dossier.validated? && !@dossier.submitted? && !@dossier.closed?
%a#maj_infos.btn.btn-info{href: "/users/dossiers/#{@dossier.id}/description?back_url=recapitulatif"}
-if @dossier.procedure.use_api_carto
%a#maj_carte.btn.btn-primary{href: "/users/dossiers/#{@dossier.id}/carte"}
= 'Editer ma carte'
%a#maj_infos.btn.btn-info{href: "/users/dossiers/#{@dossier.id}/description"}
= 'Editer mon dossier'
-unless user_signed_in?

View file

@ -5,24 +5,34 @@
.row#infos_entreprise
.col-lg-6.col-md-6
%dl.dl-horizontal
%dt Siret :
%dd.text-success= @etablissement.siret
- if @etablissement.siret != @entreprise.siret_siege_social
%dt SIRET siège social :
%dd= @entreprise.siret_siege_social
%dt Forme juridique :
%dd= @entreprise.forme_juridique
%dt libelle naf :
%dt Libellé naf :
%dd= @etablissement.libelle_naf
%dt Code naf :
%dd= @etablissement.naf
%dt Date de création :
%dd= Time.at(@entreprise.date_creation).strftime "%d-%m-%Y"
%dt Effectife entreprise :
%dt Effectif entreprise :
%dd= @entreprise.effectif
%dt Capital social :
%dd= @entreprise.pretty_capital_social
%dt Code effectif :
%dd= @entreprise.code_effectif_entreprise
%dt Numéro TVA intracommunautaire :
%dd= @entreprise.numero_tva_intracommunautaire
.col-lg-6.col-md-6
%dl.dl-horizontal
@ -33,3 +43,14 @@
= line
%br
%dt Capital social :
%dd= @entreprise.pretty_capital_social
%dt Exercices :
%dd
%address
- @etablissement.exercices.each_with_index do |exercice, index|
%strong
= "#{exercice.dateFinExercice.year} : "
= number_to_currency(exercice.ca)
%br

View file

@ -1,6 +1,6 @@
#pieces_justificatives
%h3.text-info Liste des pièces justificatives
%br
-#%h3.text-info Liste des pièces justificatives
-#%br
%table.table
-if @procedure.lien_demarche != nil
%tr{id: "piece_justificative_0"}

View file

@ -1,5 +0,0 @@
%div#sources_CSS_api_carto
%link{:href => "https://leaflet.github.io/Leaflet.draw/leaflet.draw.css", :rel => "stylesheet", :type => "text/css"}
%link{:href => "https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css", :rel => "stylesheet"}
%link{:href => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/dd04bbf160aa33c44aa63e8a744b3632c162c340/src/easy-button.css", :rel => "stylesheet"}

View file

@ -1,11 +0,0 @@
%script{type: 'text/javascript'}
="var dossier_id =#{@dossier.id}"
%div#sources_JS_api_carto
%script{:src => "https://leaflet.github.io/Leaflet.draw/leaflet.draw.js"}
%script{:src => "https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.0.1/spin.min.js"}
%script{:src => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/14332b70b18bdec80f4cce86c643372883bf90aa/src/easy-button.bar.js"}
%script{:src => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/14332b70b18bdec80f4cce86c643372883bf90aa/src/easy-button.button.js"}

View file

@ -1,12 +0,0 @@
%script{type: 'text/javascript'}
="var dossier_id =#{@dossier.id}"
="var ref_dossier=#{@dossier.ref_dossier_carto}"
%div#sources_JS_api_carto_backend
%script{:src => "https://leaflet.github.io/Leaflet.draw/leaflet.draw.js"}
%script{:src => "https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.0.1/spin.min.js"}
%script{:src => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/14332b70b18bdec80f4cce86c643372883bf90aa/src/easy-button.bar.js"}
%script{:src => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/14332b70b18bdec80f4cce86c643372883bf90aa/src/easy-button.button.js"}

View file

@ -2,18 +2,26 @@
='Localisation de votre demande'
%br
=render partial: 'carte_sources_CSS'
.content{style:'margin-bottom:60px'}
%button#new.btn.btn-sm.btn-success{type:'button'} Nouveau
\-
%button#edit.btn.btn-sm.btn-info{type:'button'} Editer
\-
%button#delete.btn.btn-sm.btn-danger{type:'button'} Supprimer
.content
#map_qp{style: 'height:600px; width: 100%;'}
= form_tag(url_for({controller: :carte, action: :save_ref_api_carto, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST') do
%br
%input{type: 'hidden', value: '', name: 'ref_dossier', id: 'ref_dossier'}
%br
#map{style: 'height:600px; width: 100%;'}
-if @dossier.draft?
=render partial: '/layouts/etape_suivante'
-else
=render partial: '/layouts/modifications_terminees'
= form_tag(url_for({controller: :carte, action: :save_ref_api_carto, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST') do
%br
%input{type: 'hidden', value: "#{@dossier.json_latlngs}", name: 'json_latlngs', id: 'json_latlngs'}
=render partial: 'carte_sources_JS'
-if @dossier.draft?
=render partial: '/layouts/etape_suivante'
-else
=render partial: '/layouts/modifications_terminees'
%script{type: 'text/javascript'}
="var dossier_id =#{@dossier.id}"
initCarto();

View file

@ -2,7 +2,7 @@
%div#commentaire_new{style: 'width:80%; margin-left:auto; margin-right:auto'}
= form_tag(url_for({ controller: :commentaires, action: :create, dossier_id: @dossier.id }), class: 'form-inline', method: 'POST') do
%textarea.form-control{id: 'texte_commentaire', name: 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', maxlength: '255', placeholder:"Dialoguer avec votre interlocuteur privilégié en charge de votre dossier."}
%input.form-control.btn.btn-primary{:type => 'submit', :value => 'Poster', style: 'float:right'}
%input.form-control.btn.btn-success{:type => 'submit', :value => 'Poster', style: 'float:right'}
%br
%br