Skip to content

Commit

Permalink
Issue #150 - Positioned forms to be centered
Browse files Browse the repository at this point in the history
- Added position sass using margins and not floats or text centre
  • Loading branch information
EChesters committed Mar 15, 2017
1 parent 3ae7485 commit 3a916c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import "font-awesome-sprockets";
@import "font-awesome";

@import "layout";
@import "drawings";
@import "organisations";
@import "edit";
Expand Down
8 changes: 8 additions & 0 deletions app/assets/stylesheets/layout.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.position {
float: none;

&.central {
margin-left: auto;
margin-right: auto;
}
}
4 changes: 2 additions & 2 deletions app/views/drawings/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
=f.input :image, label: false, required: false, input_html: { onChange: 'loadFile(event)' }

.col-xs-12.col-sm-6
.col-xs-12.col-sm-10.col-md-8
.col-xs-12.col-sm-10.col-md-8.position.central
%h2.text-center Drawing Details
.form-group
= f.input :country, priority: TOP_COUNTRIES, selected: (@drawing.new_record? ? current_user.country : @drawing.country), label: "Country drawn in", class: 'form-control'
Expand All @@ -24,7 +24,7 @@
= f.input :description, as: :text, label: 'Description of drawing'

.col-xs-12.col-sm-6
.col-xs-12.col-sm-10.col-md-8
.col-xs-12.col-sm-10.col-md-8.position.central
%h2.text-center Artist Details
.form-group
= f.input :age, type: 'number', label: 'Age of artist', required: false
Expand Down

0 comments on commit 3a916c9

Please sign in to comment.