REFACTOR : remove column 'montant_projet', 'montant_aide_demande', 'date_previsionnelle', 'position_lat', 'position_lon' et 'ref_dossier_cart' of dossier table
This commit is contained in:
parent
8db705ec94
commit
2050465a75
15 changed files with 87 additions and 240 deletions
|
@ -12,13 +12,13 @@ class Users::CarteController < UsersController
|
|||
dossier = current_user_dossier
|
||||
|
||||
if dossier.draft?
|
||||
dossier.update_attributes(ref_dossier_carto: params[:ref_dossier])
|
||||
#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 = {
|
||||
email: 'Modification localisation',
|
||||
body: 'La localisation de la demande a été modifiée. Merci de le prendre en compte.',
|
||||
dossier_id: dossier.id
|
||||
email: 'Modification localisation',
|
||||
body: 'La localisation de la demande a été modifiée. Merci de le prendre en compte.',
|
||||
dossier_id: dossier.id
|
||||
}
|
||||
commentaire = Commentaire.new commentaire_params
|
||||
commentaire.save
|
||||
|
@ -28,18 +28,12 @@ class Users::CarteController < UsersController
|
|||
end
|
||||
|
||||
def get_position
|
||||
dossier = current_user_dossier
|
||||
tmp_position = Carto::Geocodeur.convert_adresse_to_point(current_user_dossier.etablissement.adresse.gsub("\r\n", ' '))
|
||||
|
||||
if dossier.position_lat.nil?
|
||||
tmp_position = Carto::Geocodeur.convert_adresse_to_point(dossier.etablissement.adresse.gsub("\r\n", ' '))
|
||||
|
||||
if tmp_position.point.nil?
|
||||
dossier.update_attributes(position_lat: '0', position_lon: '0')
|
||||
else
|
||||
dossier.update_attributes(position_lat: tmp_position.point.y, position_lon: tmp_position.point.x)
|
||||
end
|
||||
if !tmp_position.point.nil?
|
||||
render json: {lon: tmp_position.point.x.to_s, lat: tmp_position.point.y.to_s, dossier_id: params[:dossier_id]}
|
||||
else
|
||||
render json: {lon: '0', lat: '0', dossier_id: params[:dossier_id]}
|
||||
end
|
||||
|
||||
render json: { lon: dossier.position_lon, lat: dossier.position_lat, dossier_id: params[:dossier_id] }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -56,6 +56,6 @@ class Users::DescriptionController < UsersController
|
|||
private
|
||||
|
||||
def create_params
|
||||
params.permit(:nom_projet, :description, :montant_projet, :montant_aide_demande, :date_previsionnelle)
|
||||
params.permit(:nom_projet, :description)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,9 +25,6 @@ class Dossier < ActiveRecord::Base
|
|||
|
||||
validates :nom_projet, presence: true, allow_blank: false, allow_nil: true
|
||||
validates :description, presence: true, allow_blank: false, allow_nil: true
|
||||
validates :montant_projet, presence: true, allow_blank: false, allow_nil: true
|
||||
validates :montant_aide_demande, presence: true, allow_blank: false, allow_nil: true
|
||||
validates :date_previsionnelle, presence: true, allow_blank: false, unless: Proc.new { description.nil? }
|
||||
validates :user, presence: true
|
||||
|
||||
def retrieve_piece_justificative_by_type(type)
|
||||
|
|
|
@ -7,24 +7,6 @@
|
|||
= @dossier.nom_projet
|
||||
|
||||
%br
|
||||
%div.row
|
||||
.col-lg-6.col-md-6
|
||||
%h4 Montant total
|
||||
%p{style:'margin-left:5%'}
|
||||
=number_to_currency(@dossier.montant_projet.to_f, :unit => " ", :separator => ",", :delimiter => " ")
|
||||
!='€'
|
||||
|
||||
.col-lg-6.col-md-6
|
||||
%h4 Début du projet souhaité
|
||||
%p{style:'margin-left:5%'}
|
||||
= @dossier.date_fr
|
||||
%div.row
|
||||
.col-lg-6.col-md-6
|
||||
%h4 Montant souhaité
|
||||
%p{style:'margin-left:5%'}
|
||||
=number_to_currency(@dossier.montant_aide_demande.to_f, :unit => " ", :separator => ",", :delimiter => " ")
|
||||
!='€'
|
||||
%br
|
||||
.description
|
||||
- begin
|
||||
- @dossier.description.split(/(?:\n\r?|\r\n?')/).each do |line|
|
||||
|
|
|
@ -14,23 +14,6 @@
|
|||
.col-md-12
|
||||
%h4 Description de votre projet *
|
||||
= text_area_tag :description, @dossier.description, rows: '6', placeholder: 'Description du projet', class: 'form-control'
|
||||
%br
|
||||
.row
|
||||
.col-lg-6.col-md-6
|
||||
%h4 Montant du projet *
|
||||
= number_field_tag :montant_projet, @dossier.montant_projet, class: 'form-control', placeholder: 'Montant du projet'
|
||||
!= '€'
|
||||
|
||||
.col-lg-6.col-md-6
|
||||
%h4 Montant des aides que vous sollicitez *
|
||||
= number_field_tag :montant_aide_demande, @dossier.montant_aide_demande, class: 'form-control', placeholder: 'Montant des aides'
|
||||
!='€'
|
||||
%br
|
||||
.row
|
||||
.col-lg-6.col-md-6
|
||||
%h4 Date prévisionnelle du début de votre projet *
|
||||
= text_field_tag :date_previsionnelle, @dossier.date_previsionnelle, placeholder: 'Date prévisionnelle', class: 'form-control', 'data-provide' => 'datepicker', 'data-date-format' => 'dd/mm/yyyy'
|
||||
|
||||
%br
|
||||
%h3 Documents administratifs
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue