This commit is contained in:
Nicolas Bally 2020-07-01 18:14:53 +02:00
parent 859c5d000a
commit 4c750c08b0
15 changed files with 353 additions and 275 deletions

File diff suppressed because one or more lines are too long

72
app/assets/javascripts/main.js Executable file
View File

@ -0,0 +1,72 @@
// Par Nicolas VARROT (Olwen Capital)
(function(){
$(document).ready(function(){
// Pour que le menu soit active en fonction du scroll
$(document).on("scroll", onScroll);
function onScroll(event){
var scrollPos = $(document).scrollTop();
if ((window.innerHeight + window.scrollY) >= (document.body.offsetHeight - 10)) {
$(".menu a").removeClass("active");
$(".menu a:last").addClass("active");
}
else{
$('#top_bar ul>li>a').each(function () {
var currLink = $(this);
var refElement = $("#" + currLink.attr("data-link"));
if(refElement.html()){
if (refElement.position().top <= scrollPos + 54 && refElement.position().top + refElement.height() > scrollPos + 54) {
$('#top_bar ul>li>a').removeClass("active");
currLink.addClass("active");
}
else{
currLink.removeClass("active");
}
}
});
}
}
// Pour que les élements s'animent au scroll
$(".animated-block > *").css('opacity', 0);
var options = {offset:"100%"};
$('#header, #footer, #edito, #home, #products').waypoint(function(direction) {
contentAnimation(this.element);
},options);
function contentAnimation(element){
if($(element).attr("animation-done") != "true"){
$(element).find("*").addClass('animated fadeInUp');
$(element).css("overflow", "hidden");
$(element).find("*").css('opacity', 1);
setTimeout(function(){
$(element).find("*").removeClass('animated fadeInUp');
$(element).attr("animation-done","true")
},1000)
}
}
})
})()

View File

@ -21,6 +21,10 @@
#= require vendor/flipclock.js
#= require vendor/jquery.cookiebar.js
#= require jquery.waypoints.min
#= require main.js
#=require ./popover
top = 20

View File

@ -7,6 +7,8 @@
@import "fontawesome/regular";
@import "fontawesome/solid";
@import "public/animated.min";
@import "qi_grids";
@import url('https://fonts.googleapis.com/css?family=Archivo+Narrow:400,400i,500,500i,600,600i,700,700i|Fugaz+One|Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Roboto+Condensed:300,300i,400,400i,700,700i|Russo+One');

File diff suppressed because one or more lines are too long

View File

@ -7,13 +7,13 @@ class Contact < ApplicationRecord
accepts_nested_attributes_for :document_orders
validates :name, :presence => true
validates :firstname, :presence => true
validates :civilite, :presence => true
#validates :firstname, :presence => true
#validates :civilite, :presence => true
validates :address, :presence => true, :if => :postal_need
validates :cp, :presence => true, :if => :postal_need
validates :city, :presence => true, :if => :postal_need
validates :country, :presence => true, :if => :postal_need
#validates :address, :presence => true, :if => :postal_need
#validates :cp, :presence => true, :if => :postal_need
#validates :city, :presence => true, :if => :postal_need
#validates :country, :presence => true, :if => :postal_need
validates :email, :presence => true, :format => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :if => :email_need
@ -28,7 +28,7 @@ class Contact < ApplicationRecord
true if Time.now > self.date_rgdp
end
validates :rgdp, :presence => {:if => :valid_rgpd}
#validates :rgdp, :presence => {:if => :valid_rgpd}
#raison_id

View File

@ -313,7 +313,7 @@
.clear
= timer_watcher() if Rails.env.production?
=# timer_watcher() if Rails.env.production?
%div{:style => "position:fixed;bottom:2px;right:3px;font-size:9px;z-index:1000"}
-if @gen_past_time

View File

@ -89,6 +89,164 @@
%span.remove=ic :times
=flash[:alert]
-if params[:force]
#menu_top
=image_tag "/logo-basic.png", :id => "logo"
=yield
#footer
.center
%h1
Réalisons ensemble
%strong votre projet
="!"
%h2
Posez votre question à un expert
%br
-@contact = @contact || Contact.new()
.animated-block.contact_form#form
=render :partial => "public/contacts/form"
.clear
:scss
.contact_form{
margin:auto;
width:800px;
margin:auto;
.btn{
background:red;
color:white;
border-radius:0;
}
}
#menu_top{
#header{
position:relative;
}
#logo{
width:200px;
}
padding:15px 20px;
font-weight:bold;
background:white;
box-shadow:0 0 10px rgba(0,0,0,0.5);
position:relative !important;
z-index:2;
}
.center{
max-width:1100px;
padding: 0 20px;
margin:auto;
}
h1,h2,h3{
text-transform:uppercase;
strong{
color:red;
}
}
h1{
font-weight:bold;
font-size:30px;
}
h2{
font-weight:normal;
font-size:20px;
}
h3{
font-weight:normal;
font-size:16px;
}
img{
max-width:100%;
}
#home{
h2{
max-width:600px;
display:block;
float:right;
}
}
.quote{
padding:10px 70px;
max-width:700px;
margin:auto;
position:relative;
.guillemet{
font-family:palatino;
opacity:0.6;
font-size:3em;
position:absolute;
&.top_corner{
top:5px;
left:5px;
padding-top:15px;
padding-left:5px;
}
&.bottom_corner{
bottom:5px;
right:5px;
}
}
.quote_content{
font-family: 'Pacifico', cursive;
font-size:2em;
padding-top:45px;
text-align:center;
line-height:1.3em;
color:rgba(0,0,0,0.9) !important;
}
.author{
padding-top:10px;
padding-right:50px;
font-size:1em;
text-align:right;
opacity:0.8;
color:rgba(0,0,0,0.9) !important;
}
}
#footer{
text-align:center;
padding:40px 20px;
}
-else
.vertical_center
=image_tag "/logo-basic.png", :id => "logo"
@ -125,7 +283,7 @@
}
=#yield

View File

@ -94,4 +94,13 @@
= form.input :padding_left, :label => "Marge intérieure gauche :"
= form.input :padding_right, :label => "Marge intérieure droite :"
= form.input :html_id, :label => "ID HTML :"
= form.input :html_class, :label => "Class HTML :"
= form.input :html_ratio, :label => "Ratio affichage :"

View File

@ -35,7 +35,7 @@
%p.img{:style =>style}
%p.img.animated-block{:style =>style}
=image_tag(url, :alt => image_content.alt.to_s, :style => styleimg)

View File

@ -9,7 +9,7 @@
- css_class = ""
- css_class = "#{input.html_class} "
- css_class = "blanc_encadre" if input.style == 2
- css_class = "center_block" if input.style == 3
- css_class = "dark_center_block" if input.style == 5
@ -42,8 +42,11 @@
=raw "</div>" if input.style == 5 or input.style == 6 and !@admin
-if input.html_ratio?
-ratio = "data-ratio='#{input.html_ratio}'"
-css_class += " with_ratio"
=raw "<div class='#{css_class}' style=\""+css_style+"\">"
=raw "<div class='#{css_class}' id='#{input.html_id}' style=\""+css_style+"\" "+ratio.to_s+">"
=raw "<div class='inner_frame'>" if input.style == 2

View File

@ -5,7 +5,10 @@
-css_style = "text-align:#{input.alignement};"
-if admin
=raw '<h'+level+" class='title_content_inline' style='#{css_style}' data-title-id='"+sanitize(input.id.to_s)+"'>"
=sanitize input.content
=raw '</h'+level+" >"
-else
.animated-block
=raw '<h'+level+" style='#{css_style}' class='title_#{input.style}' >"
=sanitize input.content
=raw '</h'+level+" >"
=sanitize input.content
=raw '</h'+level+" >"

View File

@ -1,44 +1,14 @@
-if !@new_site
- @contact = @contact || Contact.new
=semantic_form_for [:public, @contact], :remote => true do |f|
- @contact = @contact || Contact.new
=semantic_form_for [:public, @contact], :remote => true do |f|
=f.inputs do
.row
.columns.span_8
=f.hidden_field :raison_id
=f.hidden_field :survey_set_id
-if @contact.raison_id == 2
%p
Je souhaite recevoir sous pli confidentiel votre guide d'information consacré aux legs, donations et assurances-vie. Pour cela, je vous transmets mes coordonnées :
%br
%br
%table{:style => "border-collapse:collapse;width:100%;"}
%tr
%td{:style => "width:20%;vertical-align:top;"}
=f.input :civilite, :label =>false, :as => :select, :collection => [[qit("don-particular-civilite-mme","Mme."), "Mme"], [qit("don-particular-civilite-m","M."), "M"]], :include_blank => false
%td{:style => "width:40%;vertical-align:top;"}
=f.input :name, :label => false, :placeholder => qit("contact nom","Nom*")
%td{:style => "width:40%;vertical-align:top;"}
=f.input :firstname, :label => false, :placeholder => qit("contact prenom","Prénom*")
-if @contact.raison_id != 1
=f.input :address, :label => false, :placeholder => qit("contact adresse","Adresse")
%table{:style => "border-collapse:collapse;width:100%;"}
%tr
%td{:style => "width:35%;vertical-align:top;"}=f.input :cp, :label => false, :placeholder => qit("contact cp","Code postal")
%td{:style => "width:65%;vertical-align:top;"}=f.input :city, :label =>false, :placeholder => qit("contact city","Ville")
=f.input :country, :label => false, :priority_countries => ["FR", "CH", "BE"], :locale => @lang.slug
=f.input :email, :label => false , :placeholder =>"Email"
=f.input :phone, :label => false, :placeholder => qit("contact tel","Téléphone")
@ -46,26 +16,12 @@
=f.input :message, :label =>false , :placeholder => "Message"
-if @contact.raison_id == 3
.contact_documents
=f.semantic_fields_for :document_orders do |f|
.data_file#data_file{:id => f.object.data_file.token}
=f.hidden_field :data_file_id
=image_tag f.object.data_file.image_file.file.large.medium.small.thumb.url
%p{:style => "text-align:left;"}
Prenez connaissance de notre déclaration de protection des données
%br
%br
%p
Quantité :
=f.text_field :qte
%p
=link_to "Supprimer de la liste", public_document_order_path(f.object.data_file.token), :method => :delete, :remote => true, :data => {:confirm => "Voulez-vous vraiment enlever ce document de la liste ?"}
.clear
.clear
En soumettant ce formulaire j'accepte que Basic utilise mes données pour me communiquer des informations sur ses domaines dactivités
=f.submit "Envoyer", :class => "btn"
@ -80,166 +36,6 @@
.columns.span_4.button_container{:style => "padding-left:60px;"}
.inner
%p
= "Association" if @lang.id != 2
3P
%br
1 A place des Orphelins
%br
67000 Strasbourg
%br
FRANCE
%p
=ic(:phone)
+33 (0)3 88 35 67 30
%p
=ic(:"envelope-o")
=link_to "info@3p.quartz.xyz", "mailto:info@3p.quartz.xyz"
.clear
-else
.title
-if @contact.raison_id == 1
=qit "contact-general-titre", "Je souhaite"
-elsif @contact.raison_id == 2
=qit "contact-legs-titre", "Je souhaite en savoir plus"
-elsif @contact.raison_id == 3
=qit "contact-commande-docs-titre", "Je souhaite"
-elsif @contact.raison_id == 4
=qit "contact-militer-titre", "Je souhaite en savoir plus"
-else
=qit "Contacter 3P"
.inner
=semantic_form_for [:public, @contact], :remote => true do |f|
=f.inputs do
=f.hidden_field :raison_id
=f.hidden_field :survey_set_id
-if @contact.raison_id == 1
%p.intro
=qit "contact-general-intro" do
entrer en contact avec 3P. Laissez-nous votre message, nous reviendrons vers vous rapidement :
-if @contact.raison_id == 2
%p.intro
=qit "contact-legs-intro" do
sur les legs, donations, et assurances-vie en faveur de 3P. Vous pouvez me contacter pour répondre à mes questions :
%br
%br
-if @contact.raison_id == 3
%p.intro
=qit "contact-commande-docs-intro" do
recevoir gratuitement ces documents à cette adresse :
-if @contact.raison_id == 4
%p.intro
=qit "contact-militer-intro" do
sur le militantisme avec 3P. Vous pouvez nous contacter et nous répondrons à vos questions.
.civilite=f.input :civilite, :label =>false, :as => :radio, :collection => [[qit("don-particular-civilite-mme2","Madame"), "Mme"], [qit("don-particular-civilite-m2","Monsieur"), "M"]], :include_blank => false
%table{:style => "border-collapse:collapse;width:100%;"}
%tr
%td{:style => "width:50%;vertical-align:top;padding-right:10px;"}
=f.input :firstname, :label => false, :placeholder => qit("contact prenom","Prénom*")
%td{:style => "width:50%;vertical-align:top;padding-left:10px;"}
=f.input :email, :label => false , :placeholder =>"Email"
%tr
%td{:style => "width:50%;vertical-align:top;padding-right:10px;"}
=f.input :name, :label => false, :placeholder => qit("contact nom","Nom*")
%td{:style => "width:50%;vertical-align:top;padding-left:10px;"}
=f.input :phone, :label => false, :placeholder => qit("contact tel","Téléphone")
-if @contact.raison_id == 1
=f.input :raison_text, :label =>false, :as => :radio, :collection => ["Demande d'informations", "Faire appel à la Cellule Zoé", "Autre"], :include_blank => false
-if @contact.raison_id != 4 and @contact.raison_id != 2
-if @contact.raison_id != 1
=f.input :address, :label => false, :placeholder => qit("contact adresse","Adresse")
%table{:style => "border-collapse:collapse;width:100%;"}
%tr
%td{:style => "width:35%;vertical-align:top;padding-right:10px;"}=f.input :cp, :label => false, :placeholder => qit("contact cp","Code postal")
%td{:style => "width:65%;vertical-align:top;padding-left:10px;"}=f.input :city, :label =>false, :placeholder => qit("contact city","Ville")
=f.input :country, :label => false, :priority_countries => ["FR", "CH", "BE"], :locale => @lang.slug
-if @contact.raison_id == 4
=f.input :objet, :label =>false , :placeholder => qit("contact-objet", "Objet de votre message"), :as => :string
=f.input :message, :label =>false , :placeholder => "Message"
-if @contact.raison_id == 3
.contact_documents
=f.semantic_fields_for :document_orders do |f|
.data_file#data_file{:id => f.object.data_file.token}
=f.hidden_field :data_file_id
=image_tag f.object.data_file.image_file.file.large.medium.small.thumb.url if f.object.data_file.image_file and f.object.data_file.image_file.file
.desc
%h3
=f.object.data_file.title
%p
Quantité :
=f.text_field :qte
%p
=link_to qit("Supprimer de la liste"), public_document_order_path(f.object.data_file.token), :method => :delete, :remote => true, :data => {:confirm => qit("Voulez-vous vraiment enlever ce document de la liste ?")}
.clear
.clear
.rgdp
=f.input :rgdp, :label => qit("rgpd-consentement-contact","J'accepte que les informations saisies dans le formulaire soient enregistrées et utilisées par l'association dans le cadre du traitement de ma demande et je certifie avoir 16 ans ou plus.")
%p.rgpd_link_legals=qit "rgpd-detail-line", "Pour en savoir plus sur le traitement de vos données personnelles consultez le détail <a href='/fr/gestion-des-donnees-personnelles.html' target='_blank'>sur cette page</a>."
-if @contact.raison_id == 2
.left_sign
.cta.vertical_center=f.submit qit("Contactez-moi >"), :class => "btn"
.img
=image_tag "/muriel.png"
.description.vertical_center
Muriel Arnal
%br
02 97 13 11 10
%br
=link_to "muriel@3p.quartz.xyz", "mailto:muriel@3p.quartz.xyz"
.clear
.clear
-else
.cta=f.submit qit("Contactez-nous >"), :class => "btn"

View File

@ -0,0 +1,8 @@
class AddStuffToBlockContents < ActiveRecord::Migration[6.0]
def change
add_column :block_contents, :html_id, :string
add_column :block_contents, :html_class, :string
add_column :block_contents, :html_style, :string
add_column :block_contents, :html_ratio, :decimal, :precision => 10, :scale => 4
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_04_16_212613) do
ActiveRecord::Schema.define(version: 2020_07_01_135523) do
create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "name"
@ -125,6 +125,11 @@ ActiveRecord::Schema.define(version: 2020_04_16_212613) do
t.string "gradient_stop"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "html_css"
t.string "html_id"
t.string "html_class"
t.string "html_style"
t.decimal "html_ratio", precision: 10, scale: 4
t.index ["image_file_id"], name: "index_block_contents_on_image_file_id"
end