Merge branch 'develop' of ssh://37.187.249.111:2200/opt/git/tps into develop

Conflicts:
	app/views/dossiers/_infos_dossier.html.haml
This commit is contained in:
Tanguy PATTE 2015-09-22 15:02:04 +02:00
commit d034176fe3
24 changed files with 143 additions and 109 deletions

View file

@ -9,8 +9,8 @@ class CarteController < ApplicationController
def save_ref_api_carto
dossier = current_dossier
if dossier.ref_dossier.blank?
dossier.update_attributes(ref_dossier: params[:ref_dossier])
if dossier.ref_dossier_carto.blank?
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 = {

View file

@ -52,6 +52,6 @@ class DescriptionController < ApplicationController
private
def create_params
params.permit(:nom_projet, :description, :montant_projet, :montant_aide_demande, :date_previsionnelle, :lien_plus_infos, :mail_contact)
params.permit(:nom_projet, :description, :montant_projet, :montant_aide_demande, :date_previsionnelle)
end
end

View file

@ -8,7 +8,8 @@ class RecapitulatifController < ApplicationController
@commentaires = @commentaires.all.decorate
@commentaire_email = @dossier.mail_contact
#TODO load user email
@commentaire_email = 'user@email'
rescue ActiveRecord::RecordNotFound
redirect_to url_for(controller: :start, action: :error_dossier)
end

View file

@ -11,7 +11,7 @@ class StartController < ApplicationController
end
def error_procedure
render :file => "#{Rails.root}/public/404.html", :status => 404
render :file => "#{Rails.root}/public/404_procedure_not_found.html", :status => 404
end
def error_siret

View file

@ -14,7 +14,6 @@ class Dossier < ActiveRecord::Base
after_save :build_default_pieces_justificatives, if: Proc.new { procedure_id_changed? }
validates :mail_contact, format: { with: /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/ }, unless: 'mail_contact.nil?'
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

View file

@ -1,4 +1,7 @@
class TypeDePieceJustificative < ActiveRecord::Base
has_many :pieces_justificatives
belongs_to :procedure
validates :libelle, presence: true, allow_blank: false, allow_nil: false
validates :description, presence: true, allow_blank: false, allow_nil: false
end

View file

@ -4,7 +4,7 @@
%script{type: 'text/javascript'}
="url_carte = '#{@dossier.id}/'"
="ref_dossier = '#{@dossier.ref_dossier}'"
="ref_dossier = '#{@dossier.ref_dossier_carto}'"
= render partial: '/dossiers/infos_entreprise'
%br

View file

@ -1,6 +1,6 @@
%script{type: 'text/javascript'}
="var dossier_id =#{@dossier.id}"
="var ref_dossier=#{@dossier.ref_dossier}"
="var ref_dossier=#{@dossier.ref_dossier_carto}"
%div#sources_JS_api_carto_backend

View file

@ -33,10 +33,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'
.col-lg-6.col-md-6
%h4 Mail de contact *
= email_field_tag :mail_contact, @dossier.mail_contact, placeholder: 'Mail de contact', class: 'form-control'
%br
%h3 Documents administratifs

View file

@ -24,21 +24,14 @@
%p
= @dossier.date_fr
.col-lg-6.col-md-6
%br
%h4 Contact
%a{ href: "mailto:#{@dossier.mail_contact}" }
= @dossier.mail_contact
/ -if !request.url.include?('admin')
.col-lg-6.col-md-6
%br
%br
%a#modif_carte{href: "/dossiers/#{@dossier.id}/carte?back_url=recapitulatif"} Modifier la localisation
%br
%a#modif_description{href: "/dossiers/#{@dossier.id}/description?back_url=recapitulatif"} Modifier la description
.col-md-6
= pie_chart({"Montant à charge #{(100 - @dossier.montant_aide_demande.to_f/@dossier.montant_projet.to_f*100).round(2)}%" => (@dossier.montant_projet.to_f - @dossier.montant_aide_demande.to_f), "Montant souhaité #{(@dossier.montant_aide_demande.to_f/@dossier.montant_projet.to_f*100).round(2)}%" => @dossier.montant_aide_demande})