This commit is contained in:
Nicolas Bally 2018-02-27 23:03:37 +01:00
parent b0f675716c
commit 0d3687e09b
14 changed files with 392 additions and 383 deletions

View File

@ -32,7 +32,14 @@ $sans_serif:'Lato', Arial, sans-serif;
.breadcrumb{
color:rgb(150,150,150);
padding:20px 0;
*{
color:rgb(150,150,150);
}
}
b, strong{
font-weight:900;
@ -46,10 +53,23 @@ b, strong{
height:640px;
}
.slider_home{
.title{
position:absolute;
bottom:20px;
left:0;
background:rgba(0,0,0,0.5);
color:white;
max-width:400px;
padding:10px 30px;
padding-left:70px;
}
}
#large{
@ -578,3 +598,88 @@ h2.home_title{
}
.input{
&.has-error{
.form-control{
border: 1px solid red;
}
}
.control-label{
display:block;
font-size:0.9em;
}
.form-control{
display:block;
box-sizing:border-box;
width:100%;
padding:5px;
font-size:1em;
border:1px solid rgba(0,0,0,0.3);
}
textarea{
box-sizing:border-box;
width:100%;
padding:5px;
font-size:1em;
border:1px solid rgba(0,0,0,0.3);
}
.help-block{
display:block;
color:red;
font-size:0.9em;
}
}
fieldset{
border:0;
padding:0;
}
.contact_form{
padding:20px 0;
td{padding:0;}
input, textarea{
margin-top:5px;
}
.btn{
background:$orange;
padding:7px 14px;
font-size:1.1em;
color:white;
margin:5px 0;
}
}
.bottom{
background:rgb(40,40,40);
.inner{
color:rgba(255,255,255,0.9);
*{
text-decoration:none;
color:rgba(255,255,255,0.9);
}
max-width:1000px;
padding:30px 20px;
padding-bottom:60px;
margin:auto;
.span{
color:rgba(255,255,255,0.7);
font-size:0.8em;
padding-top:0px;
}
}
}

View File

@ -1,19 +1,19 @@
class Contact < ActiveRecord::Base
has_many :document_orders
has_many :data_files, :through => :document_orders
accepts_nested_attributes_for :document_orders
validates :name, :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

View File

@ -4,7 +4,7 @@ class DynamicContent < ActiveRecord::Base
belongs_to :item
NAMES = {"historique_monde" => "Historique monde", "militer" => "Index militer", "detenus" => "Index détenus"}
NAMES = {"contact" => "Contact"}
def self.picto
"cog"

View File

@ -7,8 +7,9 @@
=f.hidden_field :home_slider_id
=f.input :enabled, :label => "Activé ?"
=f.input :image_file_id, :label => "Image :", :as => :qi_image_select
=f.input :blur_image_id, :label => "Image floue :", :as => :qi_image_select
=f.input :title, :label => "Titre :"
=f.input :blur_color, :label => "Couleur de fond :"
= f.input :start_at, :label => "Début :", :as => :qi_datetime_picker
= f.input :end_at, :label => "Fin :", :as => :qi_datetime_picker

View File

@ -221,44 +221,56 @@
-if @menu_item and @menu_item.id == 1
=raw"</div>"
#slider_banner
#slider_left
.slider_home
#bxslider
-@home_slider = HomeSlider.find_by_slug("home")
-@date = Time.now
-if @home_slider
-@home_slides_simu = @home_slider.home_slider_slides.where(:enabled => true)
-@home_slides_simu = @home_slides_simu.where("start_at IS NULL or start_at <= ?",@date)
-@home_slides_simu = @home_slides_simu.where("end_at IS NULL or end_at >= ?",@date)
-@home_slides_simu = @home_slides_simu.order(:position)
-@home_slides_simu = @home_slides_simu.joins(:lang_sites).where("lang_sites.id = ?", @lang.id)
-@home_slides_simu.each do |home_slider_slide|
-if home_slider_slide.image_file
-url = ""
-url = home_slider_slide.image_file.file.large.url
=link_to home_slider_slide.url.to_s do
.slide_inner.with_ratio{:style => "background:url('#{url}') black no-repeat center center;background-size:100%;background-size:cover;", :data => {:ratio => 0.45}}
-if @menu_item and @menu_item.id == 1
#slider_banner
.slider_home
#bxslider
-@home_slider = HomeSlider.find_by_slug("home")
-@date = Time.now
-if @home_slider
-@home_slides_simu = @home_slider.home_slider_slides.where(:enabled => true)
-@home_slides_simu = @home_slides_simu.where("start_at IS NULL or start_at <= ?",@date)
-@home_slides_simu = @home_slides_simu.where("end_at IS NULL or end_at >= ?",@date)
-@home_slides_simu = @home_slides_simu.order(:position)
-@home_slides_simu = @home_slides_simu.joins(:lang_sites).where("lang_sites.id = ?", @lang.id)
-@home_slides_simu.each do |home_slider_slide|
-if home_slider_slide.image_file
-url = ""
-url = home_slider_slide.image_file.file.large.url
=link_to home_slider_slide.url.to_s do
.slide_inner.with_ratio{:style => "background:url('#{url}') black no-repeat center center;background-size:100%;background-size:cover;position:relative;", :data => {:ratio => 0.45}}
-if home_slider_slide.title
%h1.title
=home_slider_slide.title
:javascript
$(document).ready(function(){
$('#bxslider').bxSlider({
@ -267,28 +279,98 @@
});
});
=yield
:scss
#sub_menu_top.home_sub_menu{
margin-bottom:50px;
ul li a{
&:hover{
color:#BF2F2A;
.noir{
display:block !important;
}
.blanc{
display:none !important;
}
}
}
}
-if @menu_item and @menu_item.id == 1
#sub_menu_top.home_sub_menu
-first_level_menu = MenuItem.where(:id => 4).first
-if first_level_menu and first_level_menu.children.size > 0
-if !@menu_item or @menu_item.id != 1
=yield
%ul
-first_level_menu.children.order(:position).each do |menu_item|
%li
-if @ancestor_1
-if @ancestor_1 == menu_item
-active = true
-menu_item_lang = menu_item.menu_item_langs.find_by_lang_site_id(@lang.id)
-if active == nil
-if @menu_item and (@menu_item == menu_item or @menu_item.ancestors.include?(menu_item))
-active = true
-else
-active = false
-name = menu_item_lang.name
-if menu_item_lang.enabled == true and menu_item_lang.visible == true
=link_to @jipe_host.to_s+menu_item_path(:url => menu_item_lang.url, :lang => @lang.slug), :class => ("active" if active) do
-if menu_item.icon_image_file
=image_tag menu_item.icon_b_image_file.file.url, :class => "blanc" if menu_item.icon_image_file
=image_tag menu_item.icon_image_file.file.url, :class => "noir" if menu_item.icon_b_image_file
=name
.clear
:javascript
resize()
.bottom
.inner
Jipé
="-"
2 Rue de l'industrie
="-"
67730 CHATENOIS
="-"
France
="-"
=ic(:phone)
+33 (0)3 88 85 05 40
="-"
=ic(:"envelope-o")
=link_to "contact@jipe.fr", "mailto:contact@jipe.fr"
.span
SARL au capital de 651 510,00 €
="-"
RCS : Colmar B 530 702 331
="-"
APE : 2511Z
:javascript
resize()

View File

@ -0,0 +1,4 @@
-@contact = @contact || Contact.new(:raison_id => 1, :survey_set_id => params[:id])
.contact_form.contact_militer#form
=render :partial => "public/contacts/form"

View File

@ -2,20 +2,21 @@
=semantic_form_for [:public, @contact], :remote => true do |f|
=f.inputs do
.row
.columns.span_8
.columns.span_8.result
%h2 Contactez-nous
%br
=f.hidden_field :raison_id
=f.hidden_field :survey_set_id
%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;"}
%td{:style => "width:50%;vertical-align:top;padding-right:3px;"}
=f.input :name, :label => false, :placeholder => qit("contact nom","Nom*")
%td{:style => "width:40%;vertical-align:top;"}
%td{:style => "width:50%;vertical-align:top;padding-left:3px;"}
=f.input :firstname, :label => false, :placeholder => qit("contact prenom","Prénom*")
@ -62,7 +63,19 @@
.inner
%h2 Jipé
%p
=ic(:home)
2 Rue de l'industrie
%br
&nbsp;&nbsp;&nbsp;&nbsp;
67730 CHATENOIS
%br
&nbsp;&nbsp;&nbsp;&nbsp;
France
%p

View File

@ -1,5 +1,5 @@
%div{:style => "text-align:center;"}
%h3 Merci pour votre message !
%p Nous mettons tout en œuvre pour vous répondre dans les meilleurs délais.
%p Léquipe de Jipe
%h2 Merci pour votre message !
%p Nous mettons tout en œuvre pour vous répondre dans les meilleurs délais.
%p Léquipe Jipé

View File

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

View File

@ -10,277 +10,120 @@
-@sidebar = false
-content_for :corps do
-if @menu_item.id == 7
-if @menu_item.title_image
-if @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file
-img_url = @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file.file.large.url
-@facebook_img = @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file.file.large.medium.url
-elsif @menu_item.image_file
-img_url = @menu_item.image_file.file.large.url
-@facebook_img = @menu_item.image_file.file.large.medium.url
=raw"</div>"
.follow_row_container
.main_container
.inner
-@nos_combats = MenuItem.find(7)
-@nos_combats.children.order(:position).each do |mi|
- menu_item_lang = mi.menu_item_langs.find_by_lang_site_id(@lang.id)
-if menu_item_lang.enabled == true and menu_item_lang.visible == true
-css_style = ""
-ratio = 1
-url = mi.cible_url(@lang)
-if mi.image_file
-img_url = mi.image_file.file.large.medium.url
-if mi.image_file and mi.image_file.photograph
-@page_images_credits << mi.image_file.photograph
-css_style += "background-image:url('#{img_url}');background-size:100%;background-size:cover;background-position:center center;display:block;"
.element#element
=link_to url.to_s , :style => css_style, :data => {:ratio => ratio}, :class => "with_ratio" do
.overlay
%h4.title
=#image_tag mi.icon_image_file.file.url if mi.icon_image_file
=mi.menu_item_langs.find_by_lang_site_id(@lang.id).name
=raw "<div class='main_container'>"
-elsif [247, 34,42, 251, 248, 249, 250].include?(@menu_item.id)
=raw "</div>"
.special_show
-if @menu_item.id == 34
%div.special_show_special1{:style => "width:50%;display:inline-block"}=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(50)}
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(107)}
-if img_url
.menu_item_top.principal{:style => "background-image:url('#{img_url}');"}
-if !@menu_item.title_cached
-elsif @menu_item.id == 247
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(35)}
.clear
.row
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(110)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(43)}
.columns.span_6
.row
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(191)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(132)}
.clear
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(36)}
-elsif @menu_item.id == 42
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(41)}
.clear
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(241)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(143)}
.clear
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(244)}
-elsif @menu_item.id == 251
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(96)}
.clear
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(224)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(256)}
.clear
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(95)}
-elsif @menu_item.id == 248
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(45)}
.clear
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(47)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(46)}
.clear
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(253)}
-elsif @menu_item.id == 249
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(39)}
.clear
.columns.span_6
.row
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(118)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(225)}
.clear
-elsif @menu_item.id == 250
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(48)}
.clear
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(185)}
.clear
%h1.first_title=raw @menu_item.menu_content.lang_pages.find_by_lang_site_id(@lang.id).title
-else
=#%div{:style => "height:55px;"}
=raw "<div class='main_container'>"
-else
-if @menu_item.title_image
-if @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file
-img_url = @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file.file.large.url
-@facebook_img = @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file.file.large.medium.url
-elsif @menu_item.image_file
-img_url = @menu_item.image_file.file.large.url
-@facebook_img = @menu_item.image_file.file.large.medium.url
=raw "</div>"
-if img_url
.menu_item_top.principal{:style => "background-image:url('#{img_url}');"}
-if !@menu_item.title_cached
%h1.first_title=raw @menu_item.menu_content.lang_pages.find_by_lang_site_id(@lang.id).title
-else
%div{:style => "height:55px;"}
=raw "<div class='main_container'>"
.menu_content_inner{:class => @menu_item_lang.slug}
.inner
.menu_item_content
=render :partial => "public/blocks/block", :locals => {:block => @menu_item.menu_content.blocks.find_by_lang_site_id(@lang.id)}
.bottom_subpages
-@menu_item.children.order(:position).each do |menu_item|
-menu_item_lang = menu_item.menu_item_langs.find_by_lang_site_id(@lang.id)
-name = menu_item_lang.name
-if menu_item_lang.enabled == true and menu_item_lang.visible == true
-if menu_item.image_file
-img_url = menu_item.image_file.file.large.medium.url
-if menu_item.image_file and menu_item.image_file.photograph
-@page_images_credits << menu_item.image_file.photograph
-css_style = "background-image:url('#{img_url}');background-size:100%;background-size:cover;background-position:center center;display:block;min-height:50px;"
.subpage_link
=link_to @jipe_host.to_s+menu_item_path(:url => menu_item_lang.url, :lang => @lang.slug) , :class => "with_ratio" do
.with_ratio{:style => css_style, :data => {:ratio => 0.62}}
.overlay
%h4.title
=menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name
-articles_ids = @menu_item.articles.all.map {|u| u.id}
-categories_ids = @menu_item.categories.map {|u| u.id}
-tags_ids = @menu_item.tags.map {|u| u.id}
- tags_articles_ids = Article.joins(:tags).where(:tags =>{:id => tags_ids }).map {|u| u.id}
- categories_articles_ids = Article.where(:category_id => categories_ids ).map {|u| u.id}
-ids = articles_ids + categories_articles_ids +tags_articles_ids
-ids =ids.sort.uniq
-articles = Article.recents.where("articles.published_at <= ?", Date.today).joins(:lang_articles).where("lang_articles.enabled = 1 and lang_articles.lang_site_id = ?", @lang.id)
-articles = articles.where(:id => ids)
-articles = articles.order("published_at DESC")
-articles = articles.limit(10)
-if articles.count > 0
.center{:style => "padding:0 10px;margin:40px 20px;border-top:1px solid rgba(5, 5, 5, 0.05);border-bottom:1px solid rgba(5, 5, 5, 0.05);"}
%h3
=qit 'Pages - Titre articles associés ', "Pour aller plus loin, sur notre"
=link_to("blog", "/fr/blog.html")+"..."
.menu_content_inner{:class => @menu_item_lang.slug}
.inner
.menu_item_content
%ul
-articles.each do |article|
%li
-lang_article = article.lang_articles.find_by_lang_site_id(@lang.id)
=link_to lang_article.title, article_path(:slug => lang_article.slug, :lang => @lang.slug)
-if @menu_item.slug != "index" and @menu_item.ancestors.length >= 1 and !@original_menu_item
.breadcrumb
-if @menu_item.ancestors
=link_to i(:home), "/"
>
-for menu_item in @menu_item.ancestors.reverse
=menu_item_link(menu_item)
>
=@menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name
=render :partial => "public/blocks/block", :locals => {:block => @menu_item.menu_content.blocks.find_by_lang_site_id(@lang.id)}
.bottom_subpages
-@menu_item.children.order(:position).each do |menu_item|
-menu_item_lang = menu_item.menu_item_langs.find_by_lang_site_id(@lang.id)
-name = menu_item_lang.name
-if menu_item_lang.enabled == true and menu_item_lang.visible == true
-if menu_item.image_file
-img_url = menu_item.image_file.file.large.medium.url
-if menu_item.image_file and menu_item.image_file.photograph
-@page_images_credits << menu_item.image_file.photograph
-css_style = "background-image:url('#{img_url}');background-size:100%;background-size:cover;background-position:center center;display:block;min-height:50px;"
.subpage_link
=link_to @jipe_host.to_s+menu_item_path(:url => menu_item_lang.url, :lang => @lang.slug) , :class => "with_ratio" do
.with_ratio{:style => css_style, :data => {:ratio => 0.62}}
.overlay
%h4.title
=menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name
-articles_ids = @menu_item.articles.all.map {|u| u.id}
-categories_ids = @menu_item.categories.map {|u| u.id}
-tags_ids = @menu_item.tags.map {|u| u.id}
- tags_articles_ids = Article.joins(:tags).where(:tags =>{:id => tags_ids }).map {|u| u.id}
- categories_articles_ids = Article.where(:category_id => categories_ids ).map {|u| u.id}
-ids = articles_ids + categories_articles_ids +tags_articles_ids
-ids =ids.sort.uniq
-articles = Article.recents.where("articles.published_at <= ?", Date.today).joins(:lang_articles).where("lang_articles.enabled = 1 and lang_articles.lang_site_id = ?", @lang.id)
-articles = articles.where(:id => ids)
-articles = articles.order("published_at DESC")
-articles = articles.limit(10)
-if articles.count > 0
.center{:style => "padding:0 10px;margin:40px 20px;border-top:1px solid rgba(5, 5, 5, 0.05);border-bottom:1px solid rgba(5, 5, 5, 0.05);"}
%h3
=qit 'Pages - Titre articles associés ', "Pour aller plus loin, sur notre"
=link_to("blog", "/fr/blog.html")+"..."
%ul
-articles.each do |article|
%li
-lang_article = article.lang_articles.find_by_lang_site_id(@lang.id)
=link_to lang_article.title, article_path(:slug => lang_article.slug, :lang => @lang.slug)
-if @menu_item.slug != "index" and @menu_item.ancestors.length >= 1 and !@original_menu_item
.breadcrumb
-if @menu_item.ancestors
=link_to i(:home), "/"
>
-for menu_item in @menu_item.ancestors.reverse
=menu_item_link(menu_item)
>
=@menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name
-if current_admin
.admin_panel

View File

@ -1,19 +1,6 @@
%p{:style => "margin-top:15px;font-size:1.2em;"}
%strong
-if @contact.raison_id == 1
Demande de contact générale
-elsif @contact.raison_id == 2
Demande de contact pour legs, assurance, donation
-elsif @contact.raison_id == 3
Demande de documents
%table
%tr
%td Civilité
%td=@contact.civilite
%tr
%td Nom
%td=@contact.name
@ -42,31 +29,3 @@
%hr
=simple_format @contact.message
%hr
.row
-@contact.document_orders.each do |document_order|
-data_file = document_order.data_file
-if data_file.image_file
.data_file#data_file{:id => data_file.token}
=image_tag "https://jipe.fr"+data_file.image_file.file.large.medium.small.thumb.url.to_s
=data_file.title
%br
Quantité :
=document_order.qte
%br
%br
.clear{:style => "clear:both;"}
:scss
.data_file{
img{
float:left;
width:70px;
margin-right:5px;
}
margin-bottom:10px;
}

View File

@ -124,12 +124,6 @@ Rails.application.routes.draw do
scope "(:lang)", locale: /#{I18n.available_locales.join("|")}/ do
get "contact.html" =>"public/contacts#new", :defaults => {:raison_id => 1}, :as => :general_contact
get "contact-donation.html" =>"public/contacts#new", :defaults => {:raison_id => 2}, :as => :donation_contact
get "contact-documents.html" =>"public/contacts#new", :defaults => {:raison_id => 3}, :as => :document_contact
scope "(:slug)" do

View File

@ -0,0 +1,6 @@
class AddInfosToHomeSliderSlides < ActiveRecord::Migration
def change
add_column :home_slider_slides, :title, :string
add_column :home_slider_slides, :description, :text
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170826070908) do
ActiveRecord::Schema.define(version: 20180227213707) do
create_table "admins", force: :cascade do |t|
t.string "name", limit: 255
@ -350,11 +350,13 @@ ActiveRecord::Schema.define(version: 20170826070908) do
t.datetime "end_at"
t.integer "image_file_id", limit: 4
t.boolean "enabled"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "url", limit: 255
t.integer "blur_image_id", limit: 4
t.string "blur_color", limit: 255
t.string "title", limit: 255
t.text "description", limit: 65535
end
add_index "home_slider_slides", ["home_slider_id"], name: "index_home_slider_slides_on_home_slider_id", using: :btree