diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss
index 9d49988..09e557a 100644
--- a/app/assets/stylesheets/public.scss
+++ b/app/assets/stylesheets/public.scss
@@ -353,6 +353,8 @@ img {
position:static;
background:$green;
text-align:center;
+
+
img{
width:200px;
@@ -454,6 +456,13 @@ img {
}
}
+ #menu_top, #menu_fixed{
+ display:none;
+ }
+ #devis-img{
+ top:0 !important;
+ width:200px;
+ }
}
@@ -484,4 +493,52 @@ img {
}
}
+.quote{
+
+ padding:10px 10px;
+
+ 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:Stylograph;
+ font-size:1.6em;
+ padding-top:45px;
+ text-align:center;
+ line-height:1.3em;
+
+
+
+
+ }
+ .author{
+ padding-right:50px;
+ font-size:1em;
+ text-align:right;
+ opacity:0.8;
+ }
+
+
+}
+
diff --git a/app/controllers/admin/testimonies_controller.rb b/app/controllers/admin/testimonies_controller.rb
new file mode 100644
index 0000000..27ca25c
--- /dev/null
+++ b/app/controllers/admin/testimonies_controller.rb
@@ -0,0 +1,84 @@
+# -*- encoding : utf-8 -*-
+class Admin::TestimoniesController < ApplicationController
+ layout "admin"
+
+ before_filter :auth_admin
+
+
+ def index
+
+
+ @testimonies = Testimony.order("created_at DESC").all
+
+
+
+ end
+
+ def new
+
+ @testimony = Testimony.new
+
+
+
+ end
+
+
+ def edit
+ @testimony = Testimony.find(params[:id])
+
+ end
+
+def show
+ @testimony = Testimony.find(params[:id])
+
+ end
+
+ def create
+
+ @testimony = Testimony.new(testimony_params)
+
+
+ if @testimony.save
+
+ else
+ render :action => "new"
+ end
+
+
+ end
+
+ def update
+ @testimony = Testimony.find(params[:id])
+
+
+ if @testimony.update_attributes(testimony_params)
+
+ else
+
+ end
+
+
+ end
+
+ def destroy
+ @testimony = Testimony.find(params[:id])
+
+ @testimony.destroy
+ flash[:notice] = "Le témoignage de "+@testimony.author.to_s+" a bien été supprimé."
+
+
+ end
+
+ private
+ def testimony_params
+ params.require(:testimony).permit(:quote,:author, :image_file_id)
+
+
+
+
+ end
+
+
+
+
+end
diff --git a/app/controllers/public/testimonies_controller.rb b/app/controllers/public/testimonies_controller.rb
new file mode 100644
index 0000000..f6a60bd
--- /dev/null
+++ b/app/controllers/public/testimonies_controller.rb
@@ -0,0 +1,34 @@
+# -*- encoding : utf-8 -*-
+class Public::TestimoniesController < ApplicationController
+ layout "public"
+
+
+
+ def show
+
+
+ if params[:slug]
+ testimony_id = params[:slug].split('-')[0].to_i
+ testimony = Testimony.find(:first, :conditions => {:id => testimony_id})
+
+ if testimony
+ @testimony = testimony
+ else
+ @testimony = Testimony.find(:first)
+ end
+
+
+ else
+ @testimony = Testimony.find(:first)
+ end
+
+
+
+ end
+
+
+ def index
+ @testimonies = Testimony.all
+ end
+
+end
diff --git a/app/models/testimony.rb b/app/models/testimony.rb
new file mode 100644
index 0000000..d50e263
--- /dev/null
+++ b/app/models/testimony.rb
@@ -0,0 +1,22 @@
+# -*- encoding : utf-8 -*-
+class Testimony < ActiveRecord::Base
+ belongs_to :image_file
+
+
+ has_one :block, :as => :blockable
+
+
+ before_create do
+ self.block = Block.new
+ end
+
+
+ def alloweds_types
+ self.block.allow_types :TitleContent, :TextContent, :ImageContent, :LinkContent, :GalleryContent
+
+ end
+
+
+
+
+end
diff --git a/app/views/admin/testimonies/_form.html.haml b/app/views/admin/testimonies/_form.html.haml
new file mode 100644
index 0000000..932e0f3
--- /dev/null
+++ b/app/views/admin/testimonies/_form.html.haml
@@ -0,0 +1,10 @@
+= semantic_form_for [:admin,@testimony], :remote => true do |form|
+ .content
+ = form.inputs do
+ = form.input :quote, :label => "Citation :"
+ = form.input :author, :label => "Auteur :"
+
+ = form.input :image_file_id, :label => "Image :", :as => :qi_image_select
+
+ .actions
+ = form.submit "Sauvegarder", :class => "btn btn-primary"
diff --git a/app/views/admin/testimonies/_show.html.haml b/app/views/admin/testimonies/_show.html.haml
new file mode 100644
index 0000000..76b496a
--- /dev/null
+++ b/app/views/admin/testimonies/_show.html.haml
@@ -0,0 +1,17 @@
+
+
+%table#testimony_show
+ %tr
+ %td{:style => "vertical-align:top;"}
+ %p
+ Auteur :
+ =@testimony.author
+
+ %p
+ Citation :
+ =@testimony.quote
+
+ %td{:style => "text-align:right;"}
+ -if @testimony.image_file
+ =image_tag @testimony.image_file.file.square.url
+
\ No newline at end of file
diff --git a/app/views/admin/testimonies/_testimony.html.haml b/app/views/admin/testimonies/_testimony.html.haml
new file mode 100644
index 0000000..fae4cc1
--- /dev/null
+++ b/app/views/admin/testimonies/_testimony.html.haml
@@ -0,0 +1,9 @@
+%tr#testimony_row.testimony_row{:id => testimony.id}
+ %td=testimony.author
+ %td=testimony.quote
+
+ %td{:style => "width:100px;"}
+ = link_to i(:"trash-o"), [:admin, testimony], :confirm => 'Voulez-vous vraiment supprimer cette testimony ?', :method => :delete, :remote => true
+
+ = link_to i(:pencil), edit_admin_testimony_path(testimony)
+
diff --git a/app/views/admin/testimonies/create.js.erb b/app/views/admin/testimonies/create.js.erb
new file mode 100644
index 0000000..c3800ab
--- /dev/null
+++ b/app/views/admin/testimonies/create.js.erb
@@ -0,0 +1,5 @@
+close_pane_hover();
+
+$('#testimonies').prepend("<%= escape_javascript(render(@testimony))%>");
+
+
diff --git a/app/views/admin/testimonies/destroy.js.erb b/app/views/admin/testimonies/destroy.js.erb
new file mode 100644
index 0000000..942854d
--- /dev/null
+++ b/app/views/admin/testimonies/destroy.js.erb
@@ -0,0 +1,2 @@
+
+$('#testimony_row_<%=@testimony.id%>').remove();
diff --git a/app/views/admin/testimonies/edit.html.haml b/app/views/admin/testimonies/edit.html.haml
new file mode 100644
index 0000000..8197f5a
--- /dev/null
+++ b/app/views/admin/testimonies/edit.html.haml
@@ -0,0 +1,78 @@
+#toolbar-text
+
+#menu_item_block_edit{:style => "margin-right:330px;margin-top:45px;"}
+
+ =render :partial => "admin/blocks/block", :locals => {:block => @testimony.block, :sortable => true}
+
+
+%br
+%br
+%br
+%br
+%br
+%br
+%br
+%br
+%br
+%br
+%br
+#menu_item_inspector_container
+
+
+
+
+
+
+
+ #menu_item_informations
+ %h4
+ Infos sur le témoignage
+
+
+ .panel#collapseOne{:style => "display:none;"}
+ =link_to "modifier", edit_admin_testimony_path(@testimony), :remote => true,:class => "btn"
+ =render :partial => "show"
+
+ %h4 éléments
+
+ .panel#collapse2
+ .block_portlets_sortable#content_types
+ -@testimony.alloweds_types.each do |slug, name|
+
+ .content_type{:id => slug, :"data-type" => slug}
+ =image_tag("admin/content_type/type_"+slug.to_s+".png", :alt => name, :title => name, :class => "handle")
+
+
+ #collapse3{:style => "display:none;"}
+ %h4 Modifier l'élément
+
+
+ .panel
+ #element_form
+
+ %div#element_form_action
+ %a.move.btn.btn-default.portlet_handle{:href => "#", :data => {:portlet_id => nil}}
+ %span.move_message
+ =ic :arrows
+
+ déplacer
+ %span.cancel_message
+ =ic :ban
+
+ annuler
+
+ =link_to ic(:"trash-o"), "#", :method => :delete, :data => { :confirm => "Etes-vous sûr ?"}, :remote => true, :class => "btn btn-danger trash"
+
+ %button.save.btn.btn-primary
+ =ic(:"floppy-o")
+
+ Sauvegarder
+
+
+
+
+
+
+
+
+
diff --git a/app/views/admin/testimonies/edit.js.erb b/app/views/admin/testimonies/edit.js.erb
new file mode 100644
index 0000000..457baa4
--- /dev/null
+++ b/app/views/admin/testimonies/edit.js.erb
@@ -0,0 +1,2 @@
+show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",550,600);
+
diff --git a/app/views/admin/testimonies/index.html.haml b/app/views/admin/testimonies/index.html.haml
new file mode 100644
index 0000000..c4374b9
--- /dev/null
+++ b/app/views/admin/testimonies/index.html.haml
@@ -0,0 +1,9 @@
+%h1 Témoignages
+
+.right= link_to "Ajouter un témoignage", new_admin_testimony_path(), :class => "btn btn-primary", :remote => true
+
+
+%table.table.table-striped#testimonies
+
+ =render @testimonies
+
diff --git a/app/views/admin/testimonies/index.js.erb b/app/views/admin/testimonies/index.js.erb
new file mode 100644
index 0000000..63a1a69
--- /dev/null
+++ b/app/views/admin/testimonies/index.js.erb
@@ -0,0 +1,2 @@
+
+$('#Testimony_index_block').replaceWith("<%= escape_javascript(render(:partial => "index_block")) %>");
\ No newline at end of file
diff --git a/app/views/admin/testimonies/new.html.haml b/app/views/admin/testimonies/new.html.haml
new file mode 100644
index 0000000..0bc9c07
--- /dev/null
+++ b/app/views/admin/testimonies/new.html.haml
@@ -0,0 +1,2 @@
+#Testimony_new_form=render :partial => "form"
+
diff --git a/app/views/admin/testimonies/new.js.erb b/app/views/admin/testimonies/new.js.erb
new file mode 100644
index 0000000..383e5d9
--- /dev/null
+++ b/app/views/admin/testimonies/new.js.erb
@@ -0,0 +1,2 @@
+
+show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",550,600);
diff --git a/app/views/admin/testimonies/show.html.haml b/app/views/admin/testimonies/show.html.haml
new file mode 100644
index 0000000..88634db
--- /dev/null
+++ b/app/views/admin/testimonies/show.html.haml
@@ -0,0 +1,35 @@
+-content_for :dock_actions do
+ = link_to image_tag("/quartz_admin/icons/dock_edit.png"), edit_admin_testimony_path(@testimony), :class => "open_thing_box"
+
+.padding
+ #general_informations
+ =render :partial => "show"
+
+.block_links
+ Blocks :
+ -@testimony.blocks.each do |block|
+ =link_to block.block_name, admin_block_path(block), :data_div_id => "Testimony_"+@testimony.id.to_s+"_blocks_part", :class => "update_auto_load_div "+("selected" if block == @testimony.blocks[0]).to_s
+
+
+=auto_load_div(admin_block_path(@testimony.blocks[0]),"Testimony_"+@testimony.id.to_s+"_blocks_part")
+
+%br
+%br
+%br
+%h3 Ce témoignage est la cible des éléments de menu suivants :
+-@testimony.item.menu_items.each do |menu_item|
+
+ =link_to cms_fil_ariane(menu_item,false, false, false), edit_admin_menu_item_path(menu_item),:class => "int_link "+("active" if params[:menu_item_id] and MenuItem.find(params[:menu_item_id]) == menu_item).to_s
+
+ =link_to "", menu_route(menu_item),:target => "_blank", :class => "ext_link "+("active" if params[:menu_item_id] and MenuItem.find(params[:menu_item_id]) == menu_item).to_s
+
+ %br
+
+
+
+
+
+
+
+
+
diff --git a/app/views/admin/testimonies/update.js.erb b/app/views/admin/testimonies/update.js.erb
new file mode 100644
index 0000000..0dc9828
--- /dev/null
+++ b/app/views/admin/testimonies/update.js.erb
@@ -0,0 +1,6 @@
+close_pane_hover();
+
+$('#testimony_row_<%= @testimony.id %>').replaceWith("<%= escape_javascript(render(@testimony))%>");
+
+$('#testimony_show').replaceWith("<%= escape_javascript(render(:partial => "show"))%>");
+
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
index 86c6a5c..14ef725 100644
--- a/app/views/layouts/admin.html.haml
+++ b/app/views/layouts/admin.html.haml
@@ -69,7 +69,7 @@
%li.divider
%li= link_to "Sliders", admin_home_slider_path(1)
-
+ %li= link_to "Témoignages", admin_testimonies_path
%li= link_to "Contacts", admin_contacts_path
diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml
index 9c6acce..dde4e33 100644
--- a/app/views/layouts/public.html.haml
+++ b/app/views/layouts/public.html.haml
@@ -88,7 +88,8 @@
-if @menu_item and @menu_item.id == 1
.slide_home_wrapper
=image_tag("/services-a-la-personne.png?a=n", :id => "services-img")
- =image_tag("/devis.png", :id => "devis-img")
+ =link_to "#footer" do
+ =image_tag("/devis.png", :id => "devis-img")
@@ -174,8 +175,56 @@
.clear
- #avis
+
+ #avis{:style => "padding:20px 0;background:url('/fond.jpg') no-repeat;background-size:cover;padding-bottom:60px !important;"}
+
%h2 Témoignages clients
+
+ .center{:style => "max-width:800px;"}
+ -Testimony.all.sort_by { rand }.each do |testimony|
+ -css_style = ""
+
+ -color = "black"
+
+ -css_style += "color:#{color};" if color
+
+ .quote{:style => css_style}
+ .guillemet.bottom_corner
+
+
+
+ .guillemet.top_corner
+
+
+
+
+ =#'+(color ? color : "black")+'
+ .quote_content
+ =simple_format testimony.quote
+ %p.author
+ =testimony.author
+ .clear
+ %br
+
+
#footer
.center
%h2
@@ -195,9 +244,9 @@
=ic :phone
06 87 99 14 96
="-"
- =link_to "mailto:eyssard.joris@gmail.com" do
+ =link_to "mailto:info@abritium.fr" do
=ic :"envelope-o"
- eyssard.joris@gmail.com
+ info@abritium.fr
.clear
diff --git a/app/views/public/testimonies/_testimony.html.haml b/app/views/public/testimonies/_testimony.html.haml
new file mode 100644
index 0000000..37e5826
--- /dev/null
+++ b/app/views/public/testimonies/_testimony.html.haml
@@ -0,0 +1,7 @@
+.testimony
+ =link_to image_tag(testimony.image_file.file.square.url()), testimony_path(testimony) if testimony.image_file
+ %blockquote
+ =link_to testimony.quote, testimony_path(testimony)
+
+ .author=link_to testimony.author+" - lire la suite >", testimony_path(testimony)
+ .clear{:style => "clear:both;"}
diff --git a/app/views/public/testimonies/index.haml b/app/views/public/testimonies/index.haml
new file mode 100644
index 0000000..2b4003f
--- /dev/null
+++ b/app/views/public/testimonies/index.haml
@@ -0,0 +1,21 @@
+#testimony_index
+
+ %h1 Témoignages
+
+ .traduction_avertissement
+ %p
+ %strong Avertissement
+ %p
+ Les témoignages des médecins formés par l'Ecole EFT France présents sur les sites de Geneviève Gagos, www.Technique-EFT.com et www.Ecole-EFT-France.fr, ne peuvent être reproduits ou cités sur d'autres sites ou documents ; toute reproduction pouvant créer une confusion dans l’esprit du public, en donnant une fausse validation d’ordre médical, est strictement interdite.
+
+ :scss
+ .traduction_avertissement{
+
+ padding:10px 20px;
+ background:#f4f4f4;
+ margin:20px 0;
+ }
+
+
+
+ =render @testimonies
\ No newline at end of file
diff --git a/app/views/public/testimonies/show.html.haml b/app/views/public/testimonies/show.html.haml
new file mode 100644
index 0000000..013a02b
--- /dev/null
+++ b/app/views/public/testimonies/show.html.haml
@@ -0,0 +1,29 @@
+.traduction_avertissement
+ %p
+ %strong Avertissement
+ %p
+ Les témoignages des médecins formés par l'Ecole EFT France présents sur les sites de Geneviève Gagos, www.Technique-EFT.com et www.Ecole-EFT-France.fr, ne peuvent être reproduits ou cités sur d'autres sites ou documents ; toute reproduction pouvant créer une confusion dans l’esprit du public, en donnant une fausse validation d’ordre médical, est strictement interdite.
+
+ :scss
+ .traduction_avertissement{
+
+ padding:10px 20px;
+ background:#f4f4f4;
+ margin:20px 0;
+ }
+
+
+
+-if !@testimony.block
+ -@testimony.block = Block.new
+ -@testimony.save
+
+#testimony_header
+ =image_tag(@testimony.image_file.file.square.url) if @testimony.image_file
+ .quote
+ =@testimony.quote
+ .author
+ =@testimony.author
+
+%p{:style => "clear:both;"}
+=render @testimony.block
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index f244b37..365b217 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -60,6 +60,7 @@ Rails.application.routes.draw do
namespace :public do
resources :contacts
+ resources :testimonies
resources :specific_maps
@@ -111,7 +112,7 @@ Rails.application.routes.draw do
end
namespace :admin do
-
+ resources :testimonies
resources :mail_contents
resources :mail_templates
diff --git a/db/migrate/20190529138444_create_testimonies.rb b/db/migrate/20190529138444_create_testimonies.rb
new file mode 100644
index 0000000..8bc221c
--- /dev/null
+++ b/db/migrate/20190529138444_create_testimonies.rb
@@ -0,0 +1,18 @@
+# -*- encoding : utf-8 -*-
+class CreateTestimonies < ActiveRecord::Migration
+ def self.up
+ create_table :testimonies do |t|
+ t.string :author
+ t.references :image_file
+ t.text :quote
+ t.references :menu_item
+
+ t.timestamps
+ end
+
+ end
+
+ def self.down
+ drop_table :testimonies
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 52900d8..b415ab1 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20190508091713) do
+ActiveRecord::Schema.define(version: 20190529138444) do
create_table "admin_admin_roles", force: :cascade do |t|
t.integer "admin_id", limit: 4
@@ -918,6 +918,15 @@ ActiveRecord::Schema.define(version: 20190508091713) do
t.datetime "updated_at"
end
+ create_table "testimonies", force: :cascade do |t|
+ t.string "author", limit: 255
+ t.integer "image_file_id", limit: 4
+ t.text "quote", limit: 65535
+ t.integer "menu_item_id", limit: 4
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
create_table "text_contents", force: :cascade do |t|
t.string "style", limit: 255
t.text "content", limit: 65535
diff --git a/public/devis.png b/public/devis.png
index 26d6e19..9ad67c2 100644
Binary files a/public/devis.png and b/public/devis.png differ
diff --git a/public/fond.jpg b/public/fond.jpg
new file mode 100644
index 0000000..201bd4a
Binary files /dev/null and b/public/fond.jpg differ
diff --git a/public/left.png b/public/left.png
new file mode 100644
index 0000000..1bb64a0
Binary files /dev/null and b/public/left.png differ
diff --git a/public/right.png b/public/right.png
new file mode 100644
index 0000000..c675a62
Binary files /dev/null and b/public/right.png differ