From f56f6fd4496972cd29b81eef66ef0abe61a90984 Mon Sep 17 00:00:00 2001 From: eivel Date: Wed, 13 Aug 2014 14:47:43 +0200 Subject: [PATCH] Reworked layout haml. Some minor fixes has been made in category index --- app/assets/stylesheets/application.css.scss | 9 ++++++++- app/views/categories/index.html.haml | 4 ++-- app/views/layouts/application.haml | 16 +++++++--------- app/views/products/show.html.haml | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index e6612a8..9aa1de6 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -21,13 +21,20 @@ @import "scaffolds"; @import "products"; -#user-actions { +#session-button { .btn { position: absolute; top: 20px; right: 15px; } } +#homepage-button { + .btn { + position: absolute; + top: 20px; + right: 50px; + } +} #header { margin-bottom: 15px; diff --git a/app/views/categories/index.html.haml b/app/views/categories/index.html.haml index 362162c..acb0e71 100644 --- a/app/views/categories/index.html.haml +++ b/app/views/categories/index.html.haml @@ -14,15 +14,15 @@ %tr %td= link_to category.name, category %td + = link_to 'Show', category_path(category), class: 'btn btn-primary btn-xs' - if current_user && current_user.admin == true = link_to 'Edit', edit_category_path(category), class: 'btn btn-warning btn-xs' = link_to 'Destroy', category, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger btn-xs' - else - Requires admin permissions + Requires admin permissions to make changes %br -#categories-actions - if current_user && current_user.admin == true = link_to 'New Category', new_category_path, class: 'btn btn-success' diff --git a/app/views/layouts/application.haml b/app/views/layouts/application.haml index 12d6f5f..27a04f6 100644 --- a/app/views/layouts/application.haml +++ b/app/views/layouts/application.haml @@ -11,13 +11,13 @@ %body .container .row - .col-md-2.col-md-offset-8 - #user-actions + #homepage-button + .col-md-10 = link_to root_url, class: 'btn btn-default' do %i.glyphicon.glyphicon-home - Homepage - .col-md-2.col-md-offset-10 - #user-actions + Homepage + #session-button + .col-md-2 - unless current_user.nil? = link_to destroy_user_session_path, method: :delete, class: 'btn btn-info' do %i.glyphicon.glyphicon-log-out @@ -27,7 +27,5 @@ = link_to new_user_session_path, class: 'btn btn-success' do %i.glyphicon.glyphicon-log-in Log in - - .row - .col-md-12 - = yield + .row + = yield diff --git a/app/views/products/show.html.haml b/app/views/products/show.html.haml index 2e947ad..d8df783 100644 --- a/app/views/products/show.html.haml +++ b/app/views/products/show.html.haml @@ -3,7 +3,7 @@ .panel.panel-default .panel-heading - %h3= 'Product info' + %h4= 'Product info' .panel-body .row .col-md-12.col-sm-12