diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 321e48c..b0d6a98 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -134,6 +134,11 @@ body{ margin-left:250px; padding:1px 1em; + .text{ + max-width:600px; + margin:auto; + + } } #pagination{ diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 2183547..3174d37 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -2,10 +2,17 @@ class PagesController < ApplicationController def show - @slug = params[:slug] ? params[:slug] : "index" + @slug = params[:slug] - if params[:slug] - @page = Page.find_by_slug(params[:slug]) + + if @slug + @page = Page.find_by_slug(@slug) + @err_404 = true if !@page + @page = Page.find_by_slug("404") if !@page + + if @err_404 + render :status => 404 + end else end diff --git a/app/helpers/icon_helper.rb b/app/helpers/icon_helper.rb index a08e9c1..188e50d 100644 --- a/app/helpers/icon_helper.rb +++ b/app/helpers/icon_helper.rb @@ -2,9 +2,9 @@ module IconHelper - def i(name,color=:gray_dark, size=16) + def i(name,color=:gray_dark, size=16,options = nil) - image_tag(i_path(name,color,size)) + image_tag(i_path(name,color,size), options) end def i_path(name,color=:gray_dark, size=16) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index ad7a45b..f3b44c3 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -28,16 +28,18 @@ #menu =link_to image_tag("logo.png", :id => "logo"), "/" - =link_to raw("

A propos

") + =link_to raw("

A propos

"), "a-propos.html" - %h4 Portfolios - =link_to "nouveau portfolio", new_portfolio_path, :remote => true if current_admin + %h4 + Portfolios + =link_to i(:plus,:white,32, :style => "width:10px;"), new_portfolio_path, :remote => true if current_admin %ul.portfolios_links =render Portfolio.order(:title) - =link_to raw("

Contact

") + =link_to raw("

Partenaires

"), "partenaires.html" + =link_to raw("

Contact

"), "contact.html" -if @images @@ -45,7 +47,8 @@ =render :partial => "portfolios/pagination" - #main= yield + #main + = yield -if current_admin #admin_over diff --git a/app/views/pages/show.html.haml b/app/views/pages/show.html.haml index cc99c8d..f03fa4c 100644 --- a/app/views/pages/show.html.haml +++ b/app/views/pages/show.html.haml @@ -1 +1 @@ -=markdown @page.markdown_content \ No newline at end of file +.text=markdown @page.markdown_content \ No newline at end of file diff --git a/app/views/portfolios/_portfolio.haml b/app/views/portfolios/_portfolio.haml index c26fb73..a33af63 100644 --- a/app/views/portfolios/_portfolio.haml +++ b/app/views/portfolios/_portfolio.haml @@ -2,5 +2,5 @@ =link_to portfolio.title, portfolio.path -if current_admin - =link_to "m", edit_portfolio_path(portfolio, :format => "js"), :remote => true - =link_to "s", portfolio_path(portfolio, :format => "js"), :method => :delete, :confirm => "Voulez-vous vraiment supprimer cette portfolio ?", :remote => true \ No newline at end of file + =link_to i(:pen_alt_fill,:white,32, :style => "width:10px;"), edit_portfolio_path(portfolio, :format => "js"), :remote => true + =link_to i(:x_alt,:white,32, :style => "width:10px;"), portfolio_path(portfolio, :format => "js"), :method => :delete, :confirm => "Voulez-vous vraiment supprimer cette portfolio ?", :remote => true \ No newline at end of file