diff --git a/app/assets/stylesheets/forum.scss b/app/assets/stylesheets/forum.scss index 7dc40c4..cf8e2ed 100644 --- a/app/assets/stylesheets/forum.scss +++ b/app/assets/stylesheets/forum.scss @@ -7,7 +7,32 @@ @import "redactor"; +@import "public/top"; +.top{ + font-family:"Museo sans"; + font-weight:300; + position:relative; + background:rgba(31,31,31,1); +} +#forum_nav{ + + background:rgba(116,180,55,1); + border:0; + color:white; + a{ + + color:white; + + &:hover{ + color:#0088cc; + } + } + .dropdown-menu a{ + + color:#262626; + } +} #main{ min-height:600px; diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss index 8eaf9e3..e2f8fd8 100644 --- a/app/assets/stylesheets/public.scss +++ b/app/assets/stylesheets/public.scss @@ -3,6 +3,8 @@ @import "fontawesome/font-awesome"; +@import "public/top"; + .observer-et-photographier-la-faune-sans-deranger{ .couv{ @@ -245,71 +247,6 @@ margin:auto; } -.top{ - #logo{ - width:185px; - position:absolute; - bottom:0; - left:40px; - - - - } - - min-height:90px; - width:100%; - - margin:auto; - - - position:fixed; - top:0px; - right:0; - left:0; - background:rgba(0,0,0,0.7); - z-index:3; - - #menu{ - margin-right:40px; - margin-bottom:14px; - font-size:14px; - text-align:right; - text-transform:uppercase; - position:absolute; - right:0; - bottom:0; - - a{ - - margin:0; - - display: inline-block; - color:white; - text-decoration: none; - - - padding: 2px 10px; - - margin-right:5px; - - - - &:hover, &.active{ - - color:rgba(116,180,55,1); - } - - &:last-child{ - margin-right:0; - - } - - - } - } - - -} @@ -753,4 +690,36 @@ article{ a,a.active{ color:rgba(115,115,115,1); } -} \ No newline at end of file +} + + .event_mini_link{ + + &:hover{ + text-decoration:none !important; + + } + .event_mini{ + + margin-bottom:15px; + img{ + float:left; + width:120px; + margin-right:5px; + } + + .date{ + font-size:1em; + } + h2{ + + color:rgba(106,148,54,1); + font-size:1.2em; + } + + color:black; + + + + + + } } diff --git a/app/assets/stylesheets/public/top.css.scss b/app/assets/stylesheets/public/top.css.scss new file mode 100644 index 0000000..c21b008 --- /dev/null +++ b/app/assets/stylesheets/public/top.css.scss @@ -0,0 +1,92 @@ +.top{ + #logo{ + width:185px; + position:absolute; + bottom:0; + left:40px; + + + + } + + min-height:90px; + width:100%; + + margin:auto; + + + position:fixed; + top:0px; + right:0; + left:0; + background:rgba(0,0,0,0.7); + z-index:3; + + #menu{ + margin-right:40px; + margin-bottom:14px; + font-size:14px; + text-align:right; + text-transform:uppercase; + position:absolute; + right:0; + bottom:0; + + a{ + + margin:0; + + display: inline-block; + color:white; + text-decoration: none; + + + padding: 2px 10px; + + margin-right:5px; + + + + &:hover, &.active{ + + color:rgba(116,180,55,1); + } + + &:last-child{ + margin-right:0; + + } + + + } + } + + #personnal_menu{ + a{ + + margin:0; + + display: inline-block; + color:white; + opacity:0.5; + font-size:0.9em; + text-decoration: none; + + + padding: 2px 10px; + + margin-right:5px; + + + + &:hover, &.active{ + opacity:1; + color:rgba(116,180,55,1); + } + position:absolute; + top:15px; + right:35px; + + } +} +} diff --git a/app/controllers/forum/auths_controller.rb b/app/controllers/forum/auths_controller.rb index 54f8810..3809a47 100644 --- a/app/controllers/forum/auths_controller.rb +++ b/app/controllers/forum/auths_controller.rb @@ -1,6 +1,6 @@ # -*- encoding : utf-8 -*- class Forum::AuthsController < ApplicationController - layout "connexion" + layout "public" def new @forum = true diff --git a/app/controllers/forum/forum_categories_controller.rb b/app/controllers/forum/forum_categories_controller.rb index c58c937..33ec76e 100644 --- a/app/controllers/forum/forum_categories_controller.rb +++ b/app/controllers/forum/forum_categories_controller.rb @@ -10,7 +10,7 @@ class Forum::ForumCategoriesController < ApplicationController def show @category = ForumCategory.find(params[:id]) - + @forum_topics = @category.forum_topics.where(:enabled => true).all end diff --git a/app/views/forum/auths/new.haml b/app/views/forum/auths/new.haml index d3911cc..47ef024 100644 --- a/app/views/forum/auths/new.haml +++ b/app/views/forum/auths/new.haml @@ -1,6 +1,4 @@ -=image_tag("logo.png", :style => "width:200px;display:block;margin:auto;margin-bottom:2em;") - -%h1 Se connecter +%h1 Se connecter au forum = form_tag forum_auths_path do %p diff --git a/app/views/forum/forum_categories/show.html.haml b/app/views/forum/forum_categories/show.html.haml new file mode 100644 index 0000000..52559d0 --- /dev/null +++ b/app/views/forum/forum_categories/show.html.haml @@ -0,0 +1,17 @@ +=link_to "Lancer un fil de discussion", new_forum_forum_topic_path, :class => "btn btn-primary", :style => "margin:1em 0em;float:right" + +%h1=@category.title +%table.table.table-striped.table-hover + %tr.transparent + %th Fil de discussion + %th{:style => "width:150px;"} Catégorie + %th Réponses + %th Lancé + %th Activité + + -if moderator? + %th{:style => "width:50px;"} + =render @forum_topics + + +=link_to "Lancer un fil de discussion", new_forum_forum_topic_path, :class => "btn btn-primary", :style => "margin:1em 0em;float:right" \ No newline at end of file diff --git a/app/views/forum/forum_topics/_forum_topic.haml b/app/views/forum/forum_topics/_forum_topic.haml index ba929e2..658a080 100644 --- a/app/views/forum/forum_topics/_forum_topic.haml +++ b/app/views/forum/forum_topics/_forum_topic.haml @@ -1,6 +1,7 @@ %tr.topic#topic{:id => forum_topic.id} %td=link_to forum_topic.title, [:forum, forum_topic] - %td{:style => "width:160px;"}=forum_topic.category.title if forum_topic.category + %td{:style => "width:160px;"} + =link_to forum_topic.category.title, [:forum, forum_topic.category] if forum_topic.category %td{:style => "width:100px;"} =forum_topic.forum_messages.count - 1 %br diff --git a/app/views/layouts/forum.haml b/app/views/layouts/forum.haml index ec45229..669a34b 100644 --- a/app/views/layouts/forum.haml +++ b/app/views/layouts/forum.haml @@ -15,8 +15,10 @@ %body.admin + + =render :partial => "public/shared/top" -if current_fuser - %nav#admin_nav.navbar.navbar-default.navbar-inverse{role: "navigation", :style => "border-radius:0;"} + %nav#forum_nav.navbar.navbar-default.navbar-inverse{role: "navigation", :style => "border-radius:0;"} .container-fluid / Brand and toggle get grouped for better mobile display .navbar-header diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 8035c4b..ca3996a 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -49,70 +49,65 @@ - .top - - =link_to image_tag("/logo_pic_vert_w.png", :id => "logo"), "/" - - #menu - - -MenuItem.where(:parent_id => nil, :enabled => true, :visible => true).order(:position).each do |menu_item| - -description = "" - -description = menu_item.menu_content.description if menu_item.menu_content and menu_item.menu_content_type == "Page" - =link_to sanitize("#{menu_item.name}"),menu_item_path(:url => menu_item.url), :class => menu_item.slug.to_s+"_menu"+(" active" if @menu_item and (@menu_item == menu_item or @menu_item.ancestors.include?(menu_item))).to_s + =render :partial => "public/shared/top" + - - #main - #corps{:class => (@menu_item.slug if @menu_item)} + -if !@no_sidebar + #main + #corps{:class => (@menu_item.slug if @menu_item)} - -if @menu_item and @menu_item.slug and @menu_item.slug == "index" - .main_section_title - =link_to "Actualités +", "/actualites.html" + -if @menu_item and @menu_item.slug and @menu_item.slug == "index" + .main_section_title + =link_to "Actualités +", "/actualites.html" - -article = Article.where(:echo => false).before(Date.today).recents.first + -article = Article.where(:echo => false).before(Date.today).recents.first - -if article - %a{:href => public_article_path(:id => article.slug)} - .first_article - .image{:style => "background-image:url('"+(article.image_file.file.large.medium.url if article.image_file).to_s+"');"} + -if article + %a{:href => public_article_path(:id => article.slug)} + .first_article + .image{:style => "background-image:url('"+(article.image_file.file.large.medium.url if article.image_file).to_s+"');"} - .description - %h1=article.title - =simple_format article.description - .clear + .description + %h1=article.title + =simple_format article.description + .clear - -articles = Article.where(:echo => false).before(Date.today).recents.offset(1).limit(6) + -articles = Article.where(:echo => false).before(Date.today).recents.offset(1).limit(6) - -if articles - .articles - -articles.each do |article| - %a{:href => public_article_path(:id => article.slug)} - .article - .image{:style => "background-image:url('"+(article.image_file.file.large.medium.url if article.image_file).to_s+"');"} + -if articles + .articles + -articles.each do |article| + %a{:href => public_article_path(:id => article.slug)} + .article + .image{:style => "background-image:url('"+(article.image_file.file.large.medium.url if article.image_file).to_s+"');"} - .description - %h2=article.title + .description + %h2=article.title - .clear + .clear + =yield + + #sidebar + -if @menu_item and @menu_item.slug and @menu_item.slug == "index" + .main_section_title + =link_to "Prochainement +", "/agenda.html" + + -@side_events = Event.where(' (start_at > ?) or (stop_at > ?)',Time.now,Time.now).order(:start_at).limit(5) + =render :partial => "public/events/event_mini", :collection => @side_events, :as => :event + + =yield :sidebar + + .clear + -else + #main =yield - - #sidebar - -if @menu_item and @menu_item.slug and @menu_item.slug == "index" - .main_section_title - =link_to "Prochainement +", "/agenda.html" - - - =#render Event.recents.limit(2) - - =yield :sidebar - - .clear .bottom diff --git a/app/views/public/events/_event_mini.html.haml b/app/views/public/events/_event_mini.html.haml new file mode 100644 index 0000000..4d51a9a --- /dev/null +++ b/app/views/public/events/_event_mini.html.haml @@ -0,0 +1,13 @@ + + +=link_to public_event_path(event), :class => "event_mini_link" do + .event_mini + .image=image_tag event.image_file.file.square.url if event.image_file + %p.date + =raw event_human_date(event) + %h2=event.title + + .clear + + + \ No newline at end of file diff --git a/app/views/public/shared/_top.html.haml b/app/views/public/shared/_top.html.haml new file mode 100644 index 0000000..8e6f456 --- /dev/null +++ b/app/views/public/shared/_top.html.haml @@ -0,0 +1,11 @@ +.top + + =link_to image_tag("/logo_pic_vert_w.png", :id => "logo"), "/" + #personnal_menu + =link_to "Accès au forum »", "/forum" + #menu + + -MenuItem.where(:parent_id => nil, :enabled => true, :visible => true).order(:position).each do |menu_item| + -description = "" + -description = menu_item.menu_content.description if menu_item.menu_content and menu_item.menu_content_type == "Page" + =link_to sanitize("#{menu_item.name}"),menu_item_path(:url => menu_item.url), :class => menu_item.slug.to_s+"_menu"+(" active" if @menu_item and (@menu_item == menu_item or @menu_item.ancestors.include?(menu_item))).to_s \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 9c4b980..4b11300 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -251,7 +251,7 @@ Survey::Application.routes.draw do get '*url.:f' => 'public/menu_items#redirect', :f => "html" - root 'public/menu_items#show' ,:constraints => {:domain => ["lepicvert.org"]} - + root 'public/menu_items#show' ,:constraints => {:domain => ["lepicvert.org","localhost"]} + end