From 3a916c964b8ce1402751c3f79641e5748a89fa9b Mon Sep 17 00:00:00 2001 From: Liloka Date: Wed, 15 Mar 2017 23:40:22 +0000 Subject: [PATCH] Issue #150 - Positioned forms to be centered - Added position sass using margins and not floats or text centre --- app/assets/stylesheets/application.scss | 1 + app/assets/stylesheets/layout.scss | 8 ++++++++ app/views/drawings/_form.html.haml | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 app/assets/stylesheets/layout.scss diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index a4636ec..a6c1a30 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -2,6 +2,7 @@ @import "font-awesome-sprockets"; @import "font-awesome"; +@import "layout"; @import "drawings"; @import "organisations"; @import "edit"; diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss new file mode 100644 index 0000000..2891196 --- /dev/null +++ b/app/assets/stylesheets/layout.scss @@ -0,0 +1,8 @@ +.position { + float: none; + + &.central { + margin-left: auto; + margin-right: auto; + } +} \ No newline at end of file diff --git a/app/views/drawings/_form.html.haml b/app/views/drawings/_form.html.haml index 6b0f514..352b9b0 100644 --- a/app/views/drawings/_form.html.haml +++ b/app/views/drawings/_form.html.haml @@ -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' @@ -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