Skip to content

Commit

Permalink
Reworked layout haml. Some minor fixes has been made in category index
Browse files Browse the repository at this point in the history
  • Loading branch information
eivel committed Aug 13, 2014
1 parent dcbcdb8 commit f56f6fd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
9 changes: 8 additions & 1 deletion app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions app/views/categories/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

16 changes: 7 additions & 9 deletions app/views/layouts/application.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion app/views/products/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.panel.panel-default
.panel-heading
%h3= 'Product info'
%h4= 'Product info'
.panel-body
.row
.col-md-12.col-sm-12
Expand Down

0 comments on commit f56f6fd

Please sign in to comment.