diff --git a/app/assets/images/book.jpg b/app/assets/images/book.jpg new file mode 100644 index 0000000..ec45fc8 Binary files /dev/null and b/app/assets/images/book.jpg differ diff --git a/app/assets/stylesheets/public.css.scss b/app/assets/stylesheets/public.css.scss index 6e179af..79381a3 100644 --- a/app/assets/stylesheets/public.css.scss +++ b/app/assets/stylesheets/public.css.scss @@ -256,9 +256,28 @@ body{ #home_main{ @extend .center; + #new_book{ + color:white; + h3{ + color:white; + margin-top:5px; + } + margin: 0px 15px 20px 23px ; + padding: 10px ; + background:#80a93f; + img{ + width:100%; + } + + } + #right{ + float:right; + width:430px; + + + } #events_container{ - float:right; - width:430px; + background:url('/assets/events_shadow.png') no-repeat bottom center; position:relative; top:-22px; diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 808b0a6..a0d55c0 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -1,58 +1,58 @@ !!! %html{:xmlns=>"http://www.w3.org/1999/xhtml", :"xml:lang"=>"fr", :lang=>"fr"} - %head - %meta{:"http-equiv" => "content-type" ,:content =>"text/html;charset=UTF-8" } - %title - ="Ecologie Noblet - #{@title} - Jean-François Noblet" - -if @description - %meta{:name => "description", :content => @description} - -else - %meta{:name => "description", :content => "Site officiel de Jean-François Noblet, activités, actualité écologie..."} - -if @keywords - %meta{:name => "keywords", :content => @keywords} - -else - %meta{:name => "keywords", :content => "JFN, Jean François Noblet, Ecologie Noblet, Ecologie, Environnement, Nature, Ecrivain"} - - - = csrf_meta_tag + %head + %meta{:"http-equiv" => "content-type" ,:content =>"text/html;charset=UTF-8" } + %title + ="Ecologie Noblet - #{@title} - Jean-François Noblet" + -if @description + %meta{:name => "description", :content => @description} + -else + %meta{:name => "description", :content => "Site officiel de Jean-François Noblet, activités, actualité écologie..."} + -if @keywords + %meta{:name => "keywords", :content => @keywords} + -else + %meta{:name => "keywords", :content => "JFN, Jean François Noblet, Ecologie Noblet, Ecologie, Environnement, Nature, Ecrivain"} + + + = csrf_meta_tag - = javascript_include_tag "public" - - = stylesheet_link_tag 'public' - + = javascript_include_tag "public" + + = stylesheet_link_tag 'public' + - =render :partial => "public/shared/ga" - - - %body + =render :partial => "public/shared/ga" + + + %body - .top - #menu_top - =render(:partial => "public/shared/first_menu") - - =link_to image_tag('logo.png', :id => "logo", :alt => "Ecologie Noblet, logo JFN"), "/", :title => "Site officiel de Jean François Noblet" - - - #main - #sidebar - =yield :sidebar + .top + #menu_top + =render(:partial => "public/shared/first_menu") + + =link_to image_tag('logo.png', :id => "logo", :alt => "Ecologie Noblet, logo JFN"), "/", :title => "Site officiel de Jean François Noblet" + + + #main + #sidebar + =yield :sidebar - #body - =yield :body - %p{:style => "clear:both"} - - #footer_container - #footer - =render :partial => "public/shared/footer" - %p{:style => "clear:both;"} + #body + =yield :body + %p{:style => "clear:both"} + + #footer_container + #footer + =render :partial => "public/shared/footer" + %p{:style => "clear:both;"} - #legals - %p{:style => "float:right"} - =link_to "Site réalisé par Nicolas Bally - Quartz Agence", "http://www.quartz-agence.com", :target => "_blank" + #legals + %p{:style => "float:right"} + =link_to "Site réalisé par Nicolas Bally", "http://nicolasbally.com", :target => "_blank" - %p=link_to "Mentions légales" + %p=link_to "Mentions légales" diff --git a/app/views/public/events/_event.html.haml b/app/views/public/events/_event.html.haml index d601e6f..9e94773 100644 --- a/app/views/public/events/_event.html.haml +++ b/app/views/public/events/_event.html.haml @@ -1,9 +1,10 @@ - + .event - %h3=event.title - %p.date= event_human_date(event) + %h3=event.title + %p.date= event_human_date(event) - %p - =image_tag(event.image_file.file.large.medium.small.thumb.url, :alt => "Jean François Noblet - Blog écologie") - %p.desc - =simple_format(event.description) \ No newline at end of file + -if event.image_file + %p + =image_tag(event.image_file.file.large.medium.small.thumb.url, :alt => "Jean François Noblet - Blog écologie") + %p.desc + =simple_format(event.description) \ No newline at end of file diff --git a/app/views/public/home/home.html.haml b/app/views/public/home/home.html.haml index 9668ffa..77914c7 100644 --- a/app/views/public/home/home.html.haml +++ b/app/views/public/home/home.html.haml @@ -1,89 +1,92 @@ !!! %html{:xmlns=>"http://www.w3.org/1999/xhtml", :"xml:lang"=>"fr", :lang=>"fr"} - %head - %meta{:"http-equiv" => "content-type" ,:content =>"text/html;charset=UTF-8" } - %title - Jean-François Noblet - - - - = csrf_meta_tag + %head + %meta{:"http-equiv" => "content-type" ,:content =>"text/html;charset=UTF-8" } + %title + Jean-François Noblet + + + + = csrf_meta_tag - = javascript_include_tag "public" - - = stylesheet_link_tag 'public' - - =render :partial => "public/shared/ga" - - - - %body + = javascript_include_tag "public" + + = stylesheet_link_tag 'public' + + =render :partial => "public/shared/ga" + + + + %body - .top - #menu_top - =render(:partial => "public/shared/first_menu") - =link_to image_tag('logo.png', :id => "logo"), "/" - - .slider - .slides - .slides_container - -photos = 1..20 - -photos = photos.sort {rand(8)} - -photos = photos.sort {rand(6)} - -photos = photos.sort {rand(4)} - -photos = photos[0..4] - -photos.each do |photo| - .slide{:style => "width:1000px;height:460px;"}=link_to image_tag('diaporama/'+("%02d" % photo)+'.jpg', :style => "width:1000px;height:460px;"), "" - - - - - - - .photos_link.hover - =link_to "Actuellement plus de 24 000 photos visibles dans ma photothèque", "http://www.photo-nature-environnement.com", :target => "_blank" - - %a.prev.hover{:href => "#"} - =image_tag('arrow-prev.png') - %a.next.hover{:href => "#"} - =image_tag('arrow-next.png') - - #slider_shadow - - + .top + #menu_top + =render(:partial => "public/shared/first_menu") + =link_to image_tag('logo.png', :id => "logo"), "/" + + .slider + .slides + .slides_container + -photos = 1..20 + -photos = photos.sort {rand(8)} + -photos = photos.sort {rand(6)} + -photos = photos.sort {rand(4)} + -photos = photos[0..4] + -photos.each do |photo| + .slide{:style => "width:1000px;height:460px;"}=link_to image_tag('diaporama/'+("%02d" % photo)+'.jpg', :style => "width:1000px;height:460px;"), "" + + + + + + + .photos_link.hover + =link_to "Actuellement plus de 24 000 photos visibles dans ma photothèque", "http://www.photo-nature-environnement.com", :target => "_blank" + + %a.prev.hover{:href => "#"} + =image_tag('arrow-prev.png') + %a.next.hover{:href => "#"} + =image_tag('arrow-next.png') + + #slider_shadow + + - #home_main - - #events_container - #events - .slide - %h2 A ne pas rater ! - - =render Event.after(Time.now.beginning_of_day).order(:start_at).limit(3) - - =link_to "voir la suite.", public_events_path, :style => "display:block;padding-top:15px;text-align:right" - - - #articles - =render Article.recents.limit 3 - =link_to "Voir tout les articles du blog", articles_path(), :id => "bloglink" - - - %p{:style => "clear:both"} - #footer_container.home - #footer - =render :partial => "public/shared/footer" - %p{:style => "clear:both;"} - - #legals - %p{:style => "float:right"} - =link_to "Site réalisé par Nicolas Bally - Quartz Agence", "http://www.quartz-agence.com", :target => "_blank" - - %p=link_to "Mentions légales" - + #home_main + #right + #events_container + #events + .slide + %h2 A ne pas rater ! + + =render Event.after(Time.now.beginning_of_day).order(:start_at).limit(3) + + =link_to "voir la suite.", public_events_path, :style => "display:block;padding-top:15px;text-align:right" + #new_book + %h3 Découvrez mon nouveau livre ! + =link_to image_tag("book.jpg"), "http://www.plumedecarotte.com/ouvrage_fiche.php?id=147" + + + #articles + =render Article.recents.limit 3 + =link_to "Voir tout les articles du blog", articles_path(), :id => "bloglink" + + + %p{:style => "clear:both"} + #footer_container.home + #footer + =render :partial => "public/shared/footer" + %p{:style => "clear:both;"} + + #legals + %p{:style => "float:right"} + =link_to "Site réalisé par Nicolas Bally - Quartz Agence", "http://www.quartz-agence.com", :target => "_blank" + + %p=link_to "Mentions légales" + diff --git a/config/database.yml b/config/database.yml index 408e663..47d9eb7 100644 --- a/config/database.yml +++ b/config/database.yml @@ -4,13 +4,10 @@ # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' development: - adapter: mysql2 - encoding: utf8 - database: jfn_app + adapter: sqlite3 + database: db/development.sqlite3 pool: 5 - username: root - - socket: /tmp/mysql.sock + timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". diff --git a/db/migrate/20131209165939_add_image_to_events.rb b/db/migrate/20131209165939_add_image_to_events.rb index e55b27c..90fd8a1 100644 --- a/db/migrate/20131209165939_add_image_to_events.rb +++ b/db/migrate/20131209165939_add_image_to_events.rb @@ -1,5 +1,5 @@ class AddImageToEvents < ActiveRecord::Migration def change - add_column :events, :image_file, :references + add_column :events, :image_file_id, :integer end end diff --git a/db/schema.rb b/db/schema.rb index 75b3d20..beef809 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20111209094403) do +ActiveRecord::Schema.define(:version => 20131209165939) do create_table "actualities", :force => true do |t| t.string "title" @@ -184,6 +184,7 @@ ActiveRecord::Schema.define(:version => 20111209094403) do t.datetime "stop_at" t.datetime "created_at" t.datetime "updated_at" + t.integer "image_file_id" end create_table "external_links", :force => true do |t|