This commit is contained in:
Nicolas Bally 2016-02-18 23:10:57 +01:00
parent a745a82971
commit 184385129d
20 changed files with 392 additions and 34 deletions

View File

@ -18,6 +18,10 @@ $orange: rgba(251,163,58,1);
@import "public/flexslider"; @import "public/flexslider";
@import "public/label"; @import "public/label";
@import "shared/formtastic";
@import "bootstrap/bootstrap";
$blue :rgba(26,147,166,1); $blue :rgba(26,147,166,1);
.clear{ .clear{
@ -101,7 +105,7 @@ h1,h2,h3{
font-size:0.9em; font-size:0.9em;
position:relative; position:relative;
#certif{ #certif{
width:230px; width:300px;
position:absolute; position:absolute;
bottom:0; bottom:0;
right:0; right:0;
@ -144,27 +148,7 @@ h1,h2,h3{
#home_slider{ #home_slider{
position:relative;
.bouvier-signa{
position:absolute;
bottom:10px;
height:30px;
left:10px;
z-index:100;
}
.certif{
position:absolute;
z-index:100;
bottom:0px;
width:170px;
right:0px;
opacity:0.8;
&:hover{
opacity:1;
}
}
.inner{ .inner{
background:black center center no-repeat; background:black center center no-repeat;
background-size:100%; background-size:100%;
@ -174,6 +158,35 @@ h1,h2,h3{
} }
} }
#slider_bottom{
position:relative;
height:55px;
background:#5d5d5d;
.bouvier-signa{
position:absolute;
bottom:10px;
height:35px;
left:10px;
z-index:100;
}
.certif{
position:absolute;
z-index:100;
bottom:2px;
width:230px;
right:0px;
&:hover{
opacity:1;
}
}
}
.q_counter_holder{ .q_counter_holder{
text-align:center; text-align:center;
@ -183,17 +196,20 @@ h1,h2,h3{
.socials_links{ .socials_links{
text-align:right; text-align:right;
margin-right:10px; margin-right:10px;
position:absolute;
right:10px;
bottom:120px;
a, .top_link{ a, .top_link{
display:inline-block; display:inline-block;
padding:10px 0px; padding:10px 0px;
text-align:center; text-align:center;
width:45px; width:45px;
color:#9d9d9d; color:white;
border: 2px solid #9d9d9d; border: 2px solid white;
margin:10px 5px; margin:10px 5px;
cursor:pointer; cursor:pointer;
&:hover{ &:hover{
background:#9d9d9d; background:white;
color:white; color:white;
} }
@ -244,3 +260,45 @@ h1,h2,h3{
} }
color:#8d8d8d; color:#8d8d8d;
}} }}
.contact_form{
padding-bottom:2em;
#form{
h3, p{
text-align:left;
}
}
.label{
font-weight:normal;
width:120px;
float:left;
}
input{
width:450px;
float: right;
}
.btn{
width:auto;
background:#dd7425;
border:2px solid #dd7425;
border-radius:0;
color:white;
text-transform:uppercase;
padding:10px 20px;
&:hover{
color:#dd7425;
background:white;
}
float:left;
}
}

View File

@ -0,0 +1,145 @@
/* -------------------------------------------------------------------------------------------------
It's *strongly* suggested that you don't modify this file. Instead, load a new stylesheet after
this one in your layouts (eg formtastic_changes.css) and override the styles to suit your needs.
This will allow you to update formtastic.css with new releases without clobbering your own changes.
This stylesheet forms part of the Formtastic Rails Plugin
(c) 2008 Justin French
--------------------------------------------------------------------------------------------------*/
/* NORMALIZE AND RESET - obviously inspired by Yahoo's reset.css, but scoped to just form.formtastic
--------------------------------------------------------------------------------------------------*/
form.formtastic, form.formtastic ul, form.formtastic ol, form.formtastic li, form.formtastic fieldset, form.formtastic legend, form.formtastic textarea, form.formtastic select, form.formtastic p { margin:0; padding:0; }
form.formtastic fieldset { border:0; }
form.formtastic em, form.formtastic strong { font-style:normal; font-weight:normal; }
form.formtastic ol, form.formtastic ul { list-style:none; }
form.formtastic abbr, form.formtastic acronym { border:0; font-variant:normal; }
form.formtastic input, form.formtastic textarea, form.formtastic select { font-family:inherit; font-size:inherit; font-weight:inherit; }
form.formtastic input, form.formtastic textarea, form.formtastic select { font-size:100%; }
form.formtastic legend { white-space:normal; color:#000; }
/* SEMANTIC ERRORS
--------------------------------------------------------------------------------------------------*/
form.formtastic ul.errors { color:#cc0000; margin:0.5em 0 1.5em 25%; list-style:square; }
form.formtastic ul.errors li { padding:0; border:none; display:list-item; }
/* FIELDSETS & LISTS
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset { overflow:auto; } /* clearing contained floats */
form.formtastic fieldset.inputs { }
form.formtastic fieldset.buttons { padding-left:25%; }
form.formtastic fieldset ol { }
form.formtastic fieldset.buttons li { float:left; padding-right:0.5em; }
/* INPUT LIs
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li { padding:0.5em 0; margin-top:-0.5em; margin-bottom:1em; } /* padding and negative margin juggling is for Firefox */
form.formtastic fieldset > ol > li { overflow:auto; } /* clearing contained floats */
form.formtastic fieldset > ol > li.required { }
form.formtastic fieldset > ol > li.optional { }
form.formtastic fieldset > ol > li.error { }
/* LABELS
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li label { display:block; width:25%; float:left; padding-top:.2em; }
form.formtastic fieldset > ol > li > li label { line-height:100%; padding-top:0; }
form.formtastic fieldset > ol > li > li label input { line-height:100%; vertical-align:middle; margin-top:-0.1em;}
/* NESTED FIELDSETS AND LEGENDS (radio, check boxes and date/time inputs use nested fieldsets)
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li fieldset { position:relative; }
form.formtastic fieldset > ol > li fieldset legend { position:absolute; width:95%; padding-top:0.1em; left: 0px; }
form.formtastic fieldset > ol > li fieldset legend span { position:absolute; }
form.formtastic fieldset > ol > li fieldset legend.label label { position:absolute; }
form.formtastic fieldset > ol > li fieldset ol { float:left; width:74%; margin:0; padding:0 0 0 25%; }
form.formtastic fieldset > ol > li fieldset ol li { padding:0; border:0; }
/* INLINE HINTS
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li p.inline-hints { color:#666; margin:0.5em 0 0 25%; }
/* INLINE ERRORS
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li p.inline-errors { color:#cc0000; margin:0.5em 0 0 25%; }
form.formtastic fieldset > ol > li ul.errors { color:#cc0000; margin:0.5em 0 0 25%; list-style:square; }
form.formtastic fieldset > ol > li ul.errors li { padding:0; border:none; display:list-item; }
/* STRING, NUMERIC, PASSWORD, EMAIL, URL, PHONE & SEARCH OVERRIDES
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li.string input,
form.formtastic fieldset > ol > li.password input,
form.formtastic fieldset > ol > li.numeric input,
form.formtastic fieldset > ol > li.email input,
form.formtastic fieldset > ol > li.url input,
form.formtastic fieldset > ol > li.phone input,
form.formtastic fieldset > ol > li.search input { width:72%; }
form.formtastic fieldset > ol > li.string input[size],
form.formtastic fieldset > ol > li.password input[size],
form.formtastic fieldset > ol > li.numeric input[size],
form.formtastic fieldset > ol > li.email input[size],
form.formtastic fieldset > ol > li.url input[size],
form.formtastic fieldset > ol > li.phone input[size],
form.formtastic fieldset > ol > li.search input[size] { width:auto; max-width:72%; }
/* TEXTAREA OVERRIDES
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li.text textarea { width:72%; }
form.formtastic fieldset > ol > li.text textarea[cols] { width:auto; max-width:72%; }
/* HIDDEN OVERRIDES
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset ol li.hidden { display:none; }
/* BOOLEAN OVERRIDES
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li.boolean label { padding-left:25%; width:auto; }
form.formtastic fieldset > ol > li.boolean label input { margin:0 0.5em 0 0.2em; }
/* RADIO OVERRIDES
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li.radio { }
form.formtastic fieldset > ol > li.radio fieldset { overflow:visible; }
form.formtastic fieldset > ol > li.radio fieldset ol { margin-bottom:-0.5em; }
form.formtastic fieldset > ol > li.radio fieldset ol li { margin:0.1em 0 0.5em 0; overflow:visible; }
form.formtastic fieldset > ol > li.radio fieldset ol li label { float:none; width:100%; }
form.formtastic fieldset > ol > li.radio fieldset ol li label input { margin-right:0.2em; }
/* CHECK BOXES (COLLECTION) OVERRIDES
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li.check_boxes { }
form.formtastic fieldset > ol > li.check_boxes fieldset { overflow:visible; }
form.formtastic fieldset > ol > li.check_boxes fieldset ol { margin-bottom:-0.5em; }
form.formtastic fieldset > ol > li.check_boxes fieldset ol li { margin:0.1em 0 0.5em 0; overflow:visible; }
form.formtastic fieldset > ol > li.check_boxes fieldset ol li label { float:none; width:100%; }
form.formtastic fieldset > ol > li.check_boxes fieldset ol li label input { margin-right:0.2em; }
/* DATE & TIME OVERRIDES
--------------------------------------------------------------------------------------------------*/
form.formtastic fieldset > ol > li.date fieldset ol li,
form.formtastic fieldset > ol > li.time fieldset ol li,
form.formtastic fieldset > ol > li.datetime fieldset ol li { float:left; width:auto; margin:0 .3em 0 0; }
form.formtastic fieldset > ol > li.date fieldset ol li label,
form.formtastic fieldset > ol > li.time fieldset ol li label,
form.formtastic fieldset > ol > li.datetime fieldset ol li label { display:none; }
form.formtastic fieldset > ol > li.date fieldset ol li label input,
form.formtastic fieldset > ol > li.time fieldset ol li label input,
form.formtastic fieldset > ol > li.datetime fieldset ol li label input { display:inline; margin:0; padding:0; }

View File

@ -0,0 +1,26 @@
class Public::ContactsController < ApplicationController
layout "public"
def index
end
def new
@contact = Contact.new
end
def create
@contact = Contact.new(params.require(:contact).permit(:website, :place, :tel, :name, :email, :message))
if @contact.save
QuestionMailer.send_contact(@contact).deliver
render :action => :create
else
render :action => :new
end
end
end

View File

@ -0,0 +1,16 @@
class QuestionMailer < ActionMailer::Base
default from: "contact@bouvier-signa.com"
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.question.deliver.subject
#
def send_contact(contact)
@contact = contact
mail to: "test@nicolasbally.com", :bcc => "info@nicolasbally.com" ,:reply_to => @contact.email, :subject => "Nouveau mail par le site"
end
end

8
app/models/contact.rb Normal file
View File

@ -0,0 +1,8 @@
class Contact < ActiveRecord::Base
validates :name, :presence => true
validates :email, :presence => true, :format => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
validates :message, :presence => true
validates :tel, :presence => true
end

View File

@ -66,10 +66,7 @@
#home_slider #home_slider
=link_to "/fr/contact.html" do
=image_tag("/certif.png", :class => "certif")
=link_to image_tag("/bouvier-signaletique.png", :class => "bouvier-signa", :style => ""), "http://www.bouvier-signa.com", :target => "_blank"
.flexslider .flexslider
@ -93,7 +90,11 @@
.inner{:style => "background-image:url('#{home_slider_slide.image_file.file.url}');"} .inner{:style => "background-image:url('#{home_slider_slide.image_file.file.url}');"}
#slider_bottom
=link_to "/fr/contact.html" do
=image_tag("/certif.png", :class => "certif")
=link_to image_tag("/bouvier-signaletique.png", :class => "bouvier-signa", :style => ""), "http://www.bouvier-signa.com", :target => "_blank"
@ -119,6 +120,9 @@
.clear .clear
.bottom
.socials_links .socials_links
=link_to "https://www.facebook.com/sharer/sharer.php?u=#{request.url}", :target => "_blank", :class => "link facebook" do =link_to "https://www.facebook.com/sharer/sharer.php?u=#{request.url}", :target => "_blank", :class => "link facebook" do
@ -130,7 +134,7 @@
.top_link .top_link
=i(:"arrow-up") =i(:"arrow-up")
.bottom
=link_to "/fr/contact.html" do =link_to "/fr/contact.html" do
=image_tag("/certif.png", :id => "certif") =image_tag("/certif.png", :id => "certif")

View File

@ -0,0 +1,9 @@
- @contact = @contact || Contact.new
=semantic_form_for [:public, @contact], :remote => true do |f|
=f.inputs do
=f.input :name, :label => "Nom :"
=f.input :email, :label => "Email :"
=f.input :tel, :label => "Téléphone :"
=f.input :message, :label => "Message :"
=f.submit "Contactez-nous", :class => "btn"

View File

@ -0,0 +1,2 @@
%h3 Merci pour votre message
%p Nous vous remercions pour votre message et vous répondrons dans les meilleurs délais.

View File

@ -0,0 +1 @@
$("#form").html("<%= escape_javascript(render(:partial => "thank")) %>");

View File

@ -0,0 +1,7 @@
%h2 Merci beaucoup
%p{:style => "text-align:center;"}
%br
Votre message m'a bien été envoyé, j'y répondrais dès que possible !
%br
%br
%br

View File

@ -0,0 +1 @@
$("#form").html("<%= escape_javascript(render(:partial => "form")) %>");

View File

@ -58,6 +58,28 @@
=yield :corps =yield :corps
-if params[:url] == "contact"
.center
.row
.columns.span_4
%p
%strong Bouvier signalétique
%p
Zone Actipôle, 4/6 boulevard Beaubourg
%br
77183 CROISSY BEAUBOURG
%p
Tél. 0(33) 1 60 17 91 76
%br
Fax. 0(33) 1 64 11 22 03
%p
email :
=link_to "signa@bouvier-signa.com", "mailto:signa@bouvier-signa.com"
.columns.span_8
.contact_form
#form=render :partial => "public/contacts/form"

View File

@ -0,0 +1,9 @@
%p
Contact de
%strong=@contact.name
%p
Téléphone
%strong=@contact.tel
%hr
=simple_format @contact.message

View File

@ -61,6 +61,7 @@ Rails.application.routes.draw do
get 'parrainage' => "public/sponsorship_animals#index", :as => :public_sponsorship_animals get 'parrainage' => "public/sponsorship_animals#index", :as => :public_sponsorship_animals
get "sitemap.:f" => "public/sitemap#sitemap" get "sitemap.:f" => "public/sitemap#sitemap"
namespace :public do namespace :public do
resources :contacts
resources :press_releases resources :press_releases
resources :label_produits do resources :label_produits do
collection do collection do

View File

@ -0,0 +1,13 @@
class CreateContacts < ActiveRecord::Migration
def change
create_table :contacts do |t|
t.string :name
t.string :email
t.string :tel
t.string :website
t.text :message
t.timestamps
end
end
end

View File

@ -0,0 +1,12 @@
class AddInfosToContacts < ActiveRecord::Migration
def change
add_column :contacts, :address, :string
add_column :contacts, :address2, :string
add_column :contacts, :cp, :string
add_column :contacts, :city, :string
add_column :contacts, :country, :string
add_column :contacts, :notes, :text
add_column :contacts, :statut, :string
add_column :contacts, :readed, :boolean
end
end

View File

@ -0,0 +1,5 @@
class AddPlaceToContacts < ActiveRecord::Migration
def change
add_column :contacts, :place, :string
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160217161702) do ActiveRecord::Schema.define(version: 20160217161705) do
create_table "admins", force: :cascade do |t| create_table "admins", force: :cascade do |t|
t.string "name", limit: 255 t.string "name", limit: 255
@ -166,6 +166,25 @@ ActiveRecord::Schema.define(version: 20160217161702) do
t.boolean "newsletter", limit: 1 t.boolean "newsletter", limit: 1
end end
create_table "contacts", force: :cascade do |t|
t.string "name", limit: 255
t.string "email", limit: 255
t.string "tel", limit: 255
t.string "website", limit: 255
t.text "message", limit: 65535
t.datetime "created_at"
t.datetime "updated_at"
t.string "address", limit: 255
t.string "address2", limit: 255
t.string "cp", limit: 255
t.string "city", limit: 255
t.string "country", limit: 255
t.text "notes", limit: 65535
t.string "statut", limit: 255
t.boolean "readed", limit: 1
t.string "place", limit: 255
end
create_table "data_file_categories", force: :cascade do |t| create_table "data_file_categories", force: :cascade do |t|
t.string "name", limit: 255 t.string "name", limit: 255
t.string "slug", limit: 255 t.string "slug", limit: 255

Binary file not shown.

BIN
public/certif.psd Normal file

Binary file not shown.