styling it up

This commit is contained in:
Mark Moser 2015-10-04 20:27:03 -05:00
parent 1e3917ada0
commit 63d4063392
18 changed files with 125 additions and 38 deletions

View File

@ -1,7 +1,7 @@
.btn { .btn {
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
padding: 5px; text-decoration: none;
&:hover { &:hover {
color: $grey; color: $grey;

View File

@ -0,0 +1,8 @@
$gutter: 15px;
$gutter-full: $gutter * 2;
body {
margin: $gutter auto;
padding: 0 $gutter;
}

View File

@ -8,11 +8,17 @@ $red: #b10001;
$taupe: #f2e8df; $taupe: #f2e8df;
$white: #fff; $white: #fff;
$copy: $dark;
$hover-copy: $light;
$hover-background: $dark;
@import 'mixins'; @import 'mixins';
@import 'reset'; @import 'reset';
@import 'grid';
@import 'atoms/buttons'; @import 'atoms/buttons';
@import 'molecules/lists';
@import 'molecules/nav'; @import 'molecules/nav';
@import 'organisms/alerts'; @import 'organisms/alerts';

View File

@ -1,19 +1,25 @@
@mixin inline-ul { @mixin clean-ul {
display: inline-block;
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
li { li {
display: inline-block;
float: left;
margin: 0; margin: 0;
padding: 0; padding: 0;
a { a {
display: inline-block; display: inline-block;
padding: 15px;
text-decoration: none; text-decoration: none;
} }
} }
} }
@mixin inline-ul {
@include clean-ul;
display: inline-block;
li {
display: inline-block;
float: left;
}
}

View File

@ -0,0 +1,35 @@
.index {
@include clean-ul;
border-bottom: 1px solid $grey;
margin: 0 0 $gutter;
padding-bottom: $gutter / 2;
&:last-of-type { border-bottom: 0; }
li {
line-height: 1.8em;
.btn {
margin-left: $gutter / 2;
padding: 0 5px;
}
a {
color: $dark;
text-decoration: underline;
&:visited { color: $copy; }
&:hover,
&:active {
color: $hover-copy;
}
}
}
.name {
font-size: 1.2em;
text-transform: capitalize;
.btn { font-size: 1rem; }
}
ul { margin-left: $gutter; }
}

View File

@ -6,16 +6,22 @@
width: calc(100% + 30px); width: calc(100% + 30px);
li { li {
&:hover { border-bottom: 1px solid $black;
border-right: 1px solid $black;
&:hover,
&:active {
background-color: $grey; background-color: $grey;
} }
a { a {
color: $light; color: $light;
padding: 15px;
} }
&.active { &.active {
background-color: $taupe; background-color: $taupe;
border-bottom: 1px solid $taupe;
a { a {
color: $dark; color: $dark;
@ -27,10 +33,11 @@
.sub-nav { .sub-nav {
@include inline-ul; @include inline-ul;
margin: -19px -15px 0; margin: -20px -15px 0;
a { a {
color: $dark; color: $dark;
padding: 15px;
&:hover { &:hover {
background-color: $light; background-color: $light;

View File

@ -1,11 +1,6 @@
form { form {
width: 100%; width: 100%;
* {
font-size: 14px;
line-height: 1.6em;
}
label { label {
display: inline-block; display: inline-block;
margin: 0.6em 0 0; margin: 0.6em 0 0;
@ -18,6 +13,8 @@ form {
input { input {
display: block; display: block;
font-size: 14px;
line-height: 1.6em;
margin: 0 0 0.6em; margin: 0 0 0.6em;
padding: 5px; padding: 5px;
} }
@ -33,4 +30,8 @@ form {
width: calc(100% - 30px); width: calc(100% - 30px);
} }
fieldset {
margin: 15px;
border: 0;
}
} }

View File

@ -1,11 +1,7 @@
html { html {
background-color: $taupe; background-color: $taupe;
color: $dark; color: $dark;
font-size: 18px;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
body {
margin: 15px;
padding: 0;
}

View File

@ -2,7 +2,11 @@ module ApplicationHelper
def page_link(person) def page_link(person)
return if person.phone.blank? return if person.phone.blank?
link_to 'page', page_person_path(person) link_to 'page', page_person_path(person), class: 'btn'
end
def edit_btn(url)
link_to 'edit', url, class: 'btn'
end end
def active_controller(kontroller) def active_controller(kontroller)

View File

@ -1,5 +1,6 @@
%h2 Edit #{@child.name} %h2 Edit #{@child.name}
%p= link_to 'back', child_path(@child) %ul.sub-nav
%li= link_to 'back', :back
= render partial: 'form' = render partial: 'form'

View File

@ -1,12 +1,15 @@
%h1 Children %h1 Children
- @children.each do |child| - @children.each do |child|
%ul %ul.index
%li %li
= link_to child.name, child_path(child) = link_to child.name, child_path(child)
= link_to 'edit', edit_child_path(child) = edit_btn(edit_child_path(child))
%ul
- child.parents.each do |parent| - unless child.parents.empty?
%li %li Parents:
= link_to parent.name, parent_path(parent) %ul
= page_link(parent) - child.parents.each do |parent|
%li
= link_to parent.name, parent_path(parent)
= page_link(parent)

View File

@ -1,3 +1,6 @@
%h2 Add a New Child %h2 Add a New Child
%ul.sub-nav
%li= link_to 'back', :back
= render partial: 'form' = render partial: 'form'

View File

@ -1,5 +1,8 @@
%h2= @child.name %h2= @child.name
%p= link_to 'edit', edit_child_path(@child)
%ul.sub-nav
%li= link_to 'back', :back
%li= link_to 'edit', edit_child_path(@child)
- unless @child.parents.empty? - unless @child.parents.empty?
%p Parents: %p Parents:

View File

@ -2,6 +2,6 @@
%li{ class: active_controller('docs') }= link_to 'Home', root_path %li{ class: active_controller('docs') }= link_to 'Home', root_path
%li{ class: active_controller('parents') }= link_to 'Parents', list_parents_path %li{ class: active_controller('parents') }= link_to 'Parents', list_parents_path
%li{ class: active_controller('children') }= link_to 'Children', list_children_path %li{ class: active_controller('children') }= link_to 'Children', list_children_path
%li{ class: active_controller('pages') }= link_to 'Pages', list_pages_path
%li{ class: active_controller('staff') }= link_to 'Staff', list_staff_path %li{ class: active_controller('staff') }= link_to 'Staff', list_staff_path
%li{ class: active_controller('users') }= link_to 'Users', list_users_path %li{ class: active_controller('users') }= link_to 'Users', list_users_path
%li{ class: active_controller('pages') }= link_to 'Pages', list_pages_path

View File

@ -1,6 +1,7 @@
%h2 Edit #{@parent.name} %h2 Edit #{@parent.name}
%p= link_to 'back', parent_path(@parent) %ul.sub-nav
%li= link_to 'back', :back
- if @parent.errors.full_messages.any? - if @parent.errors.full_messages.any?
.errors .errors

View File

@ -1,13 +1,19 @@
%h1 Parents %h1 Parents
- @parents.each do |parent| - @parents.each do |parent|
%ul %ul.index
%li= link_to parent.name, parent_path(parent) %li.name
= link_to parent.name, parent_path(parent)
= edit_btn(edit_parent_path(parent))
%li %li
= number_to_phone parent.phone = number_to_phone parent.phone
= page_link(parent) = page_link(parent)
%li= mail_to parent.email, nil, encode: 'hex'
%li Children: - if parent.email.present?
%ul %li= mail_to parent.email, nil, encode: 'hex'
- parent.children.each do |child|
%li= link_to child.name, child_path(child) - unless parent.children.empty?
%li Children:
%ul
- parent.children.each do |child|
%li= link_to child.name, child_path(child)

View File

@ -1,5 +1,8 @@
%h2 Add a New Parent %h2 Add a New Parent
%ul.sub-nav
%li= link_to 'back', :back
- if @parent.errors.full_messages.any? - if @parent.errors.full_messages.any?
.errors .errors
%h1 Uh oh! %h1 Uh oh!

View File

@ -1,5 +1,9 @@
%h2= @parent.name %h2= @parent.name
%p= link_to 'edit', edit_parent_path(@parent)
%ul.sub-nav
%li= link_to 'back', :back
%li= link_to 'edit', edit_parent_path(@parent)
%p Email: #{mail_to(@parent.email, nil, encode: 'hex')} %p Email: #{mail_to(@parent.email, nil, encode: 'hex')}
%p Phone: #{number_to_phone @parent.phone} #{page_link(@parent)} %p Phone: #{number_to_phone @parent.phone} #{page_link(@parent)}