diff --git a/app/assets/stylesheets/addons/fade_down.css.scss b/app/assets/stylesheets/addons/fade_down.css.scss new file mode 100644 index 00000000..e286334a --- /dev/null +++ b/app/assets/stylesheets/addons/fade_down.css.scss @@ -0,0 +1,87 @@ +@-webkit-keyframes fadeOutDownBig { + 0% { + opacity: 1; + -webkit-transform: translateY(0); + } + + 100% { + opacity: 0; + -webkit-transform: translateY(2000px); + } +} + +@-moz-keyframes fadeOutDownBig { + 0% { + opacity: 1; + -moz-transform: translateY(0); + } + + 100% { + opacity: 0; + -moz-transform: translateY(2000px); + } +} + +@-ms-keyframes fadeOutDownBig { + 0% { + opacity: 1; + -ms-transform: translateY(0); + } + + 100% { + opacity: 0; + -ms-transform: translateY(2000px); + } +} + +@-o-keyframes fadeOutDownBig { + 0% { + opacity: 1; + -o-transform: translateY(0); + } + + 100% { + opacity: 0; + -o-transform: translateY(2000px); + } +} + +@keyframes fadeOutDownBig { + 0% { + opacity: 1; + transform: translateY(0); + } + + 100% { + opacity: 0; + transform: translateY(2000px); + } +} + +@mixin fadedown() { + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-animation-duration: 1s; + -webkit-animation-delay: 5s; + -webkit-animation-timing-function: ease; + -webkit-animation-fill-mode: both; + -moz-animation-duration: 1s; + -moz-animation-delay: 5s; + -moz-animation-timing-function: ease; + -moz-animation-fill-mode: both; + -ms-animation-duration: 1s; + -ms-animation-delay: 5s; + -ms-animation-timing-function: ease; + -ms-animation-fill-mode: both; + animation-duration: 1s; + animation-delay: 5s; + animation-timing-function: ease; + animation-fill-mode: both; + -webkit-animation-name: fadeOutDownBig; + -moz-animation-name: fadeOutDownBig; + -ms-animation-name: fadeOutDownBig; + -o-animation-name: fadeOutDownBig; + animation-name: fadeOutDownBig; +} \ No newline at end of file diff --git a/app/assets/stylesheets/addons/micro_clearfix.css.scss b/app/assets/stylesheets/addons/micro_clearfix.css.scss new file mode 100644 index 00000000..43dd7194 --- /dev/null +++ b/app/assets/stylesheets/addons/micro_clearfix.css.scss @@ -0,0 +1,15 @@ +/* For modern browsers */ +.cf:before, +.cf:after { + content:""; + display:table; +} + +.cf:after { + clear:both; +} + +/* For IE 6/7 (trigger hasLayout) */ +.cf { + zoom:1; +} \ No newline at end of file diff --git a/app/assets/stylesheets/addons/mixins.css.scss b/app/assets/stylesheets/addons/mixins.css.scss new file mode 100644 index 00000000..e89bd27c --- /dev/null +++ b/app/assets/stylesheets/addons/mixins.css.scss @@ -0,0 +1,6 @@ +@mixin opacity($property: 100) { + filter:alpha(opacity=$property); + -moz-opacity: $property/100; + -khtml-opacity: $property/100; + opacity: $property/100; +} \ No newline at end of file diff --git a/app/assets/stylesheets/addons/shadows.css.scss b/app/assets/stylesheets/addons/shadows.css.scss new file mode 100644 index 00000000..1f0799bd --- /dev/null +++ b/app/assets/stylesheets/addons/shadows.css.scss @@ -0,0 +1,53 @@ +.drop-shadow { + position:relative; + @include box-shadow(0 0 3px rgba(0, 0, 0, 0.1), 0 0 30px rgba(255, 255, 255, 0.07) inset); + &:before, + &:after { + content:""; + position:absolute; + z-index:-2; + } +} + + +.lifted:before, +.lifted:after { + bottom: 15px; + left: 10px; + width: 50%; + height: 27%; + max-width: 300px; + @include box-shadow(0 18px 8px rgba(0, 0, 0, 0.3)); + @include transform(rotate(-3deg)); +} + +.lifted:after { + right: 10px; + left: auto; + @include transform(rotate(3deg)); +} + +.curved:before { + top:10px; + bottom:10px; + left:0; + right:50%; + -webkit-box-shadow:0 0 15px rgba(0,0,0,0.6); + -moz-box-shadow:0 0 15px rgba(0,0,0,0.6); + box-shadow:0 0 15px rgba(0,0,0,0.6); + -moz-border-radius:10px / 100px; + border-radius:10px / 100px; +} + +.curved-vt-2:before { + right:0; +} + +.curved-hz-1:before { + top:50%; + bottom:0; + left:10px; + right:10px; + -moz-border-radius:100px / 10px; + border-radius:100px / 10px; +} \ No newline at end of file diff --git a/app/assets/stylesheets/addons/vars.css.scss b/app/assets/stylesheets/addons/vars.css.scss new file mode 100644 index 00000000..9677e30d --- /dev/null +++ b/app/assets/stylesheets/addons/vars.css.scss @@ -0,0 +1,6 @@ +/* Colors */ +$body_color: #dfe0e3; + + +/* Sizes */ +$layout_width: 990px; \ No newline at end of file diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 08a842c9..f106d50a 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -1,16 +1,17 @@ @import 'bourbon'; -@import 'defaults/reset'; -@import 'defaults/lists'; -@import 'defaults/forms'; -@import 'defaults/tables'; - -@import 'common'; -@import 'navigation'; -@import 'forms'; -@import 'login'; - - - - +@import 'addons/mixins'; +@import 'addons/vars'; +@import 'addons/micro_clearfix'; +@import 'addons/shadows'; +@import 'addons/fade_down'; +@import 'resets/main'; +@import 'resets/forms'; +@import 'styling/main'; +@import 'styling/header'; +@import 'styling/tables'; +@import 'styling/types'; +@import 'styling/forms'; +@import 'styling/flash_messages'; +@import 'styling/footer'; diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss deleted file mode 100644 index b78ced1a..00000000 --- a/app/assets/stylesheets/common.css.scss +++ /dev/null @@ -1,370 +0,0 @@ -/* GLOBAL */ -body { - background-color: #dadada; - color: #222; - font-size: 13px; - font-family: "helvetica neue", arial, helvetica, "lucida grande", sans-serif; -} -/* Headings */ -h1, h2, h3, h4, h5, h6 { - font-weight: bold; - margin-bottom: 0.1em; - color: #111; - font-family: "helvetica neue", Helvetica, arial, sans-serif; -} - -h1 { - font-size: 2.2em; - line-height: 1.4; -} - -h2 { - font-size: 1.6em; - line-height: 1.1; -} - -h3 { - font-size: 1.3em; - line-height: 1; -} - -h4 { - font-size: 1.1em; - line-height: 1.25; -} - -h5 { - font-size: 1em; -} - -h6 { - font-size: 1em; -} - -/* Text elements */ -p { - margin-bottom: 0.5em; - &.last { - margin-bottom: 0; - } - img { - float: left; - margin: 1.5em 1.5em 1.5em 0; - padding: 0; - &.top { - margin-top: 0; - } - } -} - -/* Use this if the image is at the top of the

. */ - -img { - margin: 0 0 1.5em; -} - -address { - font-style: italic; - margin-top: 1.5em; -} - -del { - color: #666; -} - -a { - color: #1a4882; - text-decoration: underline; - &:visited { - color: #1a4882; - } - &:hover { - color: #052246; - } - &:active { - color: #1a4882; - } -} - -blockquote { - border-left: 4px solid #d1d1d1; - color: #666; - font-style: italic; - margin: 1.5em 0; - padding-left: 1em; -} - -strong { - font-weight: bold; -} - -em, -dfn { - font-style: italic; -} - -dfn { - font-weight: bold; -} - -pre, code { - margin: 1.5em 0; - white-space: pre; /* CSS2 */ - white-space: pre-wrap; /* CSS 2.1 */ - word-wrap: break-word; /* IE */ -} - -pre, code, tt { - font: 1em 'andale mono', 'monotype.com', 'lucida console', monospace; - line-height: 1.5; -} - -pre.code { - background: #000; - color: #fff; - padding: 20px; -} - -tt { - display: block; - line-height: 1.5; - margin: 1.5em 0; -} - -/* GENERAL */ -.content { - background: #fff; - width: 880px; - overflow: hidden; - margin: 40px auto; - padding: 40px; - @include border-radius(24px); -} - -/* LIST */ -table.list { - th { - white-space: nowrap; - background: #f1f1f1; - padding: .5em; - } - td { - padding: .5em; - } - td.actions { - width: 2em; - text-align: center; - padding: 0; - img { - margin: 2px 1px; - } - a { - width: 20px; - height: 20px; - text-indent: -9999em; - overflow: hidden; - display: block; - float: left; - background-position: 0 0; - background-repeat: no-repeat; - margin: auto; - &:hover { - filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0.5); - -moz-opacity: 0.5; - -khtml-opacity: 0.5; - opacity: 0.5; - } - } - } - tr.odd td { - background: #fafafa; - } - th.numeric, td.numeric { - text-align: right; - } -} - -div.gauge { - border: solid 1px #ccc; - width: 100%; - position: relative; - height: 10px; -} -div.gauge-line { - height: 10px; - background: #f0f0f0; - position: absolute; - top: 0; - left: 0; -} -div.percent { - text-align: center; - font-size: 10px; - position: relative; - z-index: 9; - width: 100%; -} - -/* ACTIONS */ -.edit_link a { - background-image:url(/assets/icon_edit.gif); -} -.destroy_link a { - background-image:url(/assets/icon_delete.gif); -} -.show_link a { - background-image:url(/assets/icon_view.gif); -} - -/* PAGINATION */ -.pagination { - text-align:center; - .page.current { - font-style: italic; - background: #f0f0f0; - border: solid 1px #ddd; - margin: 0 2px; - padding: 0 5px; - @include border-radius(6px); - } -} - -/* Success, error & notice boxes for messages and errors. */ -div.error, div.notice, div.success, -#flash_failure, #flash_success, #flash_notice { - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - border: 1px solid #ddd; - margin-bottom: 1em; - padding: 0.8em; -} - -div.error, #flash_failure { - background: #FBE3E4; - border-color: #FBC2C4; - color: #D12F19; -} - -div.error a, #flash_failure a { - color: #D12F19; -} - -div.notice, #flash_notice { - background: #FFF6BF; - border-color: #FFD324; - color: #817134; -} - -div.notice a, #flash_notice a { - color: #817134; -} - -div.success, #flash_success { - background: #E6EFC2; - border-color: #C6D880; - color: #529214; -} - -div.success a, #flash_success a { - color: #529214; -} - -div.alert { - border: 1px solid #FBC2C4; - margin-bottom: 1em; - background: #FBE3E4; - color: #D12F19; - padding: .8em; - @include border-radius(8px); -} - -/* Misc classes and elements */ -/* Use a .box to create a padded box inside a column. */ -.box { - background: #eee; - margin-bottom: 1.5em; - padding: 1.5em; -} - -/* Use this to create a horizontal ruler across a column. */ -hr { - background: #ddd; - border: none; - clear: both; - color: #ddd; - float: none; - height: 1px; - margin: 0 0 1.4em; - width: 100%; - .space { - background: #fff; - color: #fff; - } -} - - -/* for image replacement */ -.ir { - background-repeat: no-repeat; - direction: ltr; - display: block; - overflow: hidden; - text-align: left; - text-indent: -999em; -} - -/* Hide for both screenreaders and browsers - css-discuss.incutio.com/wiki/Screenreader_Visibility */ -.hidden { - display: none; - visibility: hidden; -} - -/* Hide only visually, but have it available for screenreaders - www.webaim.org/techniques/css/invisiblecontent/ & j.mp/visuallyhidden */ -.visuallyhidden { - clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ - clip: rect(1px, 1px, 1px, 1px); - position: absolute !important; -} - -/* Hide visually and from screenreaders, but maintain layout */ -.invisible { - visibility: hidden; -} - -/* >> The Magnificent CLEARFIX: Updated to prevent margin-collapsing on child elements << j.mp/bestclearfix */ -.clearfix:before, -.clearfix:after { - content: "\0020"; - display: block; - height: 0; - visibility: hidden; -} - -.clearfix:after { - clear: both; -} - -/* Fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */ -.clearfix { - zoom: 1; -} - -.ie7 img { - -ms-interpolation-mode: bicubic; -} - -@media print { - * { background: transparent !important; color: #444 !important; text-shadow: none !important; } - a, a:visited { color: #444 !important; text-decoration: underline; } - a:after { content: " (" attr(href) ")"; } - abbr:after { content: " (" attr(title) ")"; } - .ir a:after { content: ""; } /* Don't show links for images */ - pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } - thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */ - tr, img { page-break-inside: avoid; } - @page { margin: 0.5cm; } - p, h2, h3 { orphans: 3; widows: 3; } - h2, h3{ page-break-after: avoid; } -} diff --git a/app/assets/stylesheets/defaults/forms.css.scss b/app/assets/stylesheets/defaults/forms.css.scss deleted file mode 100644 index 22926fae..00000000 --- a/app/assets/stylesheets/defaults/forms.css.scss +++ /dev/null @@ -1,190 +0,0 @@ - /* Forms */ - - /*removes dotted outline on submit buttons when clicking in firefox */ - input[type="submit"]::-moz-focus-inner { - border: none; - } - - form ol { - list-style: none; - margin: 0 0 1em 0; - li { - list-style-position: outside; - margin: 0 0 1em 0; - &.error input { - background: #FBE3E4; - } - &.file { - background: #e1e1e1; - border: 1px solid #c8c8c8; - padding: 10px; - } - } - ol { - margin-left: 0; - /*list-style-position fixes IE label margin bug*/ - li { - list-style-position: outside; - margin: 0 0 .25em 0; - } - } - } - - - p.inline-errors { - color: #D12F19; - } - - - form abbr { - border-bottom: 0; - } - - label { - display: block; - } - - .required label { - font-weight: bold; - } - - .checkbox_field label, - .radio_field label { - font-weight: normal; - } - - a.cancel { - color: #7d0d0d; - } - - .inline-hints { - color: #666; - font-size: 0.8em; - margin-bottom: 0.25em; - } - - /* Fieldsets */ - - fieldset fieldset, - fieldset fieldset fieldset { - border: 0; - padding: 0; - } - - legend { - font-weight: bold; - } - .ie6 legend, .ie7 legend { margin-left: -7px; } - - fieldset.buttons { - background: inherit; - border: 0; - padding: 0; - li { - display: inline; - } - } - - - .radio fieldset { - margin: 0; - padding: 0; - - } - /* Text fields */ - input[type="color"], - input[type="date"], - input[type="datetime"], - input[type="datetime-local"], - input[type="email"], - input[type="month"], - input[type="number"], - input[type="password"], - input[type="range"], - input[type="search"], - input[type="tel"], - input[type="text"], - input[type="time"], - input[type="url"], - input[type="week"] { - font-size: inherit; - padding: 3px 2px; - width: 300px; - } - .ie6 input { - vertical-align: text-bottom; - } - - input[disabled='disabled'] { - background-color: #fcfcfc; - cursor:default; - } - - input[type="checkbox"] { - margin: 0 3px 0 0; - position: relative; - top: -2px; - vertical-align: middle; - } - .ie7 input[type="checkbox"] { - vertical-align: baseline; - } - - input[type="radio"] { - margin: 0 3px 0 0; - position: relative; - top: -2px; - vertical-align: middle; - } - - .check_boxes label { - display: inline; - padding: 0; - vertical-align: middle; - } - - .radio label { - padding: 0; - } - - /* Textareas */ -textarea { - font-size: inherit; - height: 200px; - margin: 0 0.5em 0.5em 0; - padding: 5px; - width: 440px; - overflow: auto; - } - - /* Select fields */ - fieldset .select select { - width: 200px; - font-size: 0.9em; - } - - optgroup { - margin: 0 0 .5em 0; - } - - /* Date & Time */ - form ol li.date ol li, - form ol li.time ol li { - display: inline; - } - - form ol li.datetime ol li { - display: inline-block; - } - - form ol li.datetime select, - form ol li.date select, - form ol li.time select { - display: inline; - width: auto; - } - - form ol li.date label, - form ol li.time label { - display: none; - } diff --git a/app/assets/stylesheets/defaults/lists.css.scss b/app/assets/stylesheets/defaults/lists.css.scss deleted file mode 100644 index 8069819d..00000000 --- a/app/assets/stylesheets/defaults/lists.css.scss +++ /dev/null @@ -1,34 +0,0 @@ -/* Lists */ - -ul, ol { - list-style-position: inside; - margin-bottom: 1.5em; - li { - line-height: 1.4; - } -} - -ul { - list-style-type: disc; -} - -ol { - list-style-type: decimal; -} - -dl { - line-height: 1.4; - margin-bottom: 1.5em; - dt { - font-weight: bold; - margin-top: 0.5em; - } - dd { - margin-bottom: 0em; - margin-left: 0.5em; - } -} - -ol ol, ol ul, ul ul, ul ol { - margin-left: 1em; -} diff --git a/app/assets/stylesheets/defaults/tables.css.scss b/app/assets/stylesheets/defaults/tables.css.scss deleted file mode 100644 index d62c9cca..00000000 --- a/app/assets/stylesheets/defaults/tables.css.scss +++ /dev/null @@ -1,34 +0,0 @@ -/* Tables */ - -table { - margin-bottom: 2em; - width: 100%; - th { - border-bottom: 2px solid #ccc; - font-weight: bold; - text-align: left; - } - td { - border-bottom: 1px solid #ddd; - } - tr, td, th { - vertical-align: middle; - } - /* Use this if you use span-x classes on th/td. */ - .last { - padding-right: 0; - } -} - -caption, th, td { - padding: 4px 10px 4px 0; -} - -caption { - background: #f1f1f1; - margin-bottom: 1em; - padding: 10px 0; -} - - - diff --git a/app/assets/stylesheets/forms.css.scss b/app/assets/stylesheets/forms.css.scss deleted file mode 100644 index fbb1dc77..00000000 --- a/app/assets/stylesheets/forms.css.scss +++ /dev/null @@ -1,125 +0,0 @@ -/* FORMS */ -a.button, input.button { - background: url('/assets/button_bg.gif') bottom left repeat-x; - height: 32px; - overflow: visible; - cursor: pointer; - border: solid 1px #d2d2d2; - line-height: 30px; - font-weight: bold; - text-shadow: 1px 1px #fff; - text-transform: uppercase; - color: #000; - text-decoration: none; - margin: 0; - padding: 0 10px; - margin-bottom: 1.5em; - @include border-radius(3px); - &:hover { - color: #555; - } - &:focus { - background-position: top left; - border-bottom: solid 1px #f3f3f3; - } -} -a.button { - line-height: 30px; - display: block; - height: 30px; - float: left; - clear: both; -} -div.buttons { - overflow: hidden; -} -a.button.add span { - background: url('/assets/icon_add.gif') left center no-repeat; - padding-left: 20px; -} -h5.legend { - font-size: 1.2em; -} -fieldset.buttons li.commit{ - margin-right: 1em; -} -textarea { - border-color: #A7A7A7 #E3E3E3 #E3E3E3 #A7A7A7; - border-style: solid; - border-width: 1px; - @include border-radius(3px); -} -textarea:focus, input[type=text]:focus, input[type=password]:focus { - outline: 0; - @include box-shadow(0 0 5px #FFF6BF); -} - -li.error input[type=text]:focus, li.error input[type=password]:focus, li.error textarea:focus { - @include box-shadow(0 0 5px #FBE3E4); -} -input[type=text], input[type=password] { - width: 300px; - border-color: #A7A7A7 #E3E3E3 #E3E3E3 #A7A7A7; - border-style: solid; - border-width: 1px; - padding: 3px 2px; - @include border-radius(3px); -} -fieldset { - background: #F1F1F1; - border: 1px solid #E3E3E3; - margin: 0 0 1.5em 0; - padding: 1.5em 1.5em 1em 1.5em; - @include border-radius(10px); - .hint { - display: block; - font-size: 10px; - color: #aaa; - } - .input.boolean { - margin: 4px 0 0; - label { - margin: 0 0 0 6px; - display: inline; - } - } -} -form { - .input.string, .input.select, .input.boolean { - width:350px; - float:left; - margin: 0 0 3px; - } - .input.datetime, input.text { - clear:both; - width:700px; - } - abbr { - color:red; - font-size:1.2em; - margin-left:.2em; - } - .field_with_errors { - input { - background: #FBE3E4; - } - } - .error { - clear: both; - color: #D12F19; - display: block; - } -} -#user_remember_me_input { - clear:both; -} -#session_new, #user_new, #user_edit { - width:400px; - float:left; -} - -.notifications { - margin: 3px 0 5px; - line-height: 20px; - clear: both; -} diff --git a/app/assets/stylesheets/login.css.scss b/app/assets/stylesheets/login.css.scss deleted file mode 100644 index ef45ac82..00000000 --- a/app/assets/stylesheets/login.css.scss +++ /dev/null @@ -1,28 +0,0 @@ -/* TWITTER 2 */ -#oauth { -float:right; - strong { - float: left; - font-size: 32px; - padding: 95px 40px 0 0; - } - fieldset { - float: right; - width: 320px; - position: relative; - a { - overflow: hidden; - float: left; - padding: 70px 15px 0; - background-repeat: no-repeat; - background-position: center top; - &.twitter { - background-image: url('/assets/oauth/twitter_64.png'); - } - } - legend { - float: left; - width: 100%; - } - } -} diff --git a/app/assets/stylesheets/navigation.css.scss b/app/assets/stylesheets/navigation.css.scss deleted file mode 100644 index 14d3b12e..00000000 --- a/app/assets/stylesheets/navigation.css.scss +++ /dev/null @@ -1,25 +0,0 @@ -#navigation { - width: 100%; - ul { - float: left; - margin: 0; - padding: 0; - li { - display: inline; - a { - float: left; - text-decoration: none; - padding: 5px; - &:hover { - color: #000; - } - } - .selected { - a { - color: #000; - } - } - } - - } -} \ No newline at end of file diff --git a/app/assets/stylesheets/resets/forms.css.scss b/app/assets/stylesheets/resets/forms.css.scss new file mode 100755 index 00000000..ce0e53b9 --- /dev/null +++ b/app/assets/stylesheets/resets/forms.css.scss @@ -0,0 +1,60 @@ +input[type="submit"]::-moz-focus-inner { + border: none; +} + +form input:-webkit-autofill, form input::-moz-autofill{ + background-color: #f0f0f0 !important; +} + +p.inline-errors { + color: #D12F19; +} +.field_with_errors{ + input { + border-color: #D12F19; + } +} +form abbr { + border: 0; +} + +label { + display: block; + abbr { + color: #D12F19; + margin-left: 3px; + } +} + +.required label { + font-weight: bold; +} + +.inline-hints, .hint { + color: #777; + font-size: 10px; + margin-left: 10px; +} + +legend { + font-weight: bold; +} + +input[disabled='disabled'] { + background-color: #fcfcfc; + cursor:default; +} + +textarea { + font-size: inherit; + resize: vertical; + overflow: auto; +} +.boolean { + label { + display: inline; + } + input { + margin-right: 5px; + } +} diff --git a/app/assets/stylesheets/defaults/reset.css.scss b/app/assets/stylesheets/resets/main.css.scss old mode 100644 new mode 100755 similarity index 64% rename from app/assets/stylesheets/defaults/reset.css.scss rename to app/assets/stylesheets/resets/main.css.scss index b317321b..60d47929 --- a/app/assets/stylesheets/defaults/reset.css.scss +++ b/app/assets/stylesheets/resets/main.css.scss @@ -29,8 +29,13 @@ footer, header, hgroup, menu, nav, section { display: block; } +body { + line-height:1; +} + nav ul { list-style: none; + margin: 0; } blockquote, q { @@ -69,20 +74,35 @@ abbr[title], dfn[title] { cursor:help; } -/* tables still need cellspacing="0" in the markup */ -table { - border-collapse:collapse; - border-spacing:0; +input, select { + vertical-align: middle; } -hr { - display:block; - height:1px; - border:0; - border-top:1px solid #ccc; - margin:1em 0; padding:0; +/* Table resets */ +table { + border-collapse: collapse; + border-spacing: 0; + width: 100%; + th { + font-weight: bold; + text-align: left; + } + tr, td, th { + vertical-align: middle; + } } +dd { margin: 0 0 0 30px; } +dt { font-weight: bold; margin-top: 10px; } +hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; border-bottom: 1px solid #fff; } -input, select { - vertical-align:middle; +pre, code, kbd, samp, tt { font: 15px/18px 'andale mono','monotype.com','lucida console',monospace; color:#000; } + +tt, pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } + +blockquote { + border-left: 4px solid #D1D1D1; + color: #666; + font-style: italic; + margin: 15px 0; + padding-left: 10px; } \ No newline at end of file diff --git a/app/assets/stylesheets/styling/flash_messages.css.scss b/app/assets/stylesheets/styling/flash_messages.css.scss new file mode 100644 index 00000000..dfac1321 --- /dev/null +++ b/app/assets/stylesheets/styling/flash_messages.css.scss @@ -0,0 +1,28 @@ +.alert, .error.flash-message { + border-color: #FBC2C4; + color: #c00; + @include linear-gradient(top, #fbcfd1 0%, #FBE3E4 78%); +} +.notice { + @include linear-gradient(top, #f8efb9 0%, #fff6bf 78%); + border-color: #f5ecb7; + color: #817134; +} +.success { + color: #333; + border-color: #a1cea3; + @include linear-gradient(top, #c1e1c3 0%, #d2ead3 38%); +} +.alert, .notice, .flash-message{ + @include fadedown(); + padding: 10px 0; + width: 100%; + position: fixed; + bottom: 0; + bottom: 0; + text-align: center; + text-shadow: 0 1px 0 #fff; + border-style: solid; + border-width: 8px 1px; + z-index: 99999; +} diff --git a/app/assets/stylesheets/styling/footer.css.scss b/app/assets/stylesheets/styling/footer.css.scss new file mode 100644 index 00000000..24b9c2cc --- /dev/null +++ b/app/assets/stylesheets/styling/footer.css.scss @@ -0,0 +1,8 @@ +footer { + border-top: 1px solid lighten($body_color, 2%); + padding: 10px; + margin: 70px 0 0; + @include box-shadow(inset 0 1px 1px 0 rgba(0, 0, 0, 0.1)); + text-shadow: 0 1px 0 #fff; + color: #555; +} \ No newline at end of file diff --git a/app/assets/stylesheets/styling/forms.css.scss b/app/assets/stylesheets/styling/forms.css.scss new file mode 100644 index 00000000..067c4163 --- /dev/null +++ b/app/assets/stylesheets/styling/forms.css.scss @@ -0,0 +1,223 @@ +.simple_form { + fieldset { + background: #e5e6e9; + overflow: hidden; + @include box-shadow(inset 0 1px 2px 0 rgba(0, 0, 0, 0.2)); + @include border-radius(0 0 12px 12px); + text-align: left; + display: inline-block; + padding: 30px; + margin-bottom: 20px; + .input.search input{ + -webkit-appearance: none; + padding: 5px 0; + } + .input.file { + margin: 0 -10px 15px -10px; + padding: 8px 12px; + @include border-radius(8px); + background: #f7f7f7; + overflow: hidden; + label { + float: left; + width: 80px; + padding-top: 3px; + } + } + div.buttons { + color: #888; + font-size: 15px; + input { + margin-right: 10px; + } + a { + color: #888; + &:hover { + color: #333; + } + } + } + div.input.field_with_errors { + position: relative; + label { + color: #b13734; + } + span.error { + position: absolute; + right: 0; + top: 0; + color: #b13734; + } + input { + color: #b13734; + } + } + .input.boolean { + padding-bottom: 15px; + } + .disabled { + label { + color: #777; + } + input { + background: #f3f3f3; + } + } + label { + text-shadow: 0 1px 0 #fff; + font-size: 15px; + } + .notifications { + padding: 5px 0 0; + margin-top: 20px; + @include box-shadow(inset 0 1px 1px 0 rgba(0, 0, 0, 0.1)); + a { + display: block; + float: left; + clear: both; + margin-top: 8px; + } + } + .input { + select { + font-size: 15px; + margin: 5px 1px 15px; + } + &.check_boxes, &.radio { + overflow: hidden; + width: 600px; + margin-bottom: 15px; + } + &.datetime, &.select, &.date, &.time, &.time_zone { + overflow: hidden; + width: 600px; + margin: 0 16px 15px 0; + label { + float: left; + width: 200px; + } + select { + margin: 0 1px 0; + } + } + &.select { + select { + width: 350px; + } + } + &.date, &.time, &.time_zone, &.select { + .hint { + clear: both; + display: block; + margin: 0 0 0 200px; + float: left; + } + } + &.radio, &.check_boxes { + position: relative; + span { + width: 350px; + float: left; + display: block; + margin-bottom: 5px; + margin-left: 200px; + input { + float: left; + } + &.hint { + position: absolute; + left: 0; + width: 180px; + top: 50px; + margin-left: 0; + + } + } + label { + display: inline; + &.radio, &.check_boxes { + float: left; + width: 200px; + position: absolute; + left: 0; + top: 0; + } + &.collection_radio, &.collection_check_boxes { + font-weight: normal; + padding-left: 5px; + } + } + } + } + } +} +input[type=submit], a.button, .buttons.actions a { + @include box-shadow(inset 0 1px 0 0 #ffffff); + @include border-radius(3px); + @include linear-gradient(top, #ecedf1 0%, #bfc4cf 100%); + border: 1px solid #8f949f; + border-top: 1px solid #b8bdc8; + display: inline-block; + color: #5e6472; + font-size: 18px; + font-weight: bold; + height: auto; + padding: 9px 24px; + text-decoration: none; + text-shadow: 1px 1px 0 #fff; + cursor: pointer; + &.small { + font-size: 12px; + padding: 0 12px; + } + &:hover { + color: #4a4f5a; + } + &:active { + @include linear-gradient(top, #bfc4cf 0%, #ecedf1 100%); + border: 1px solid #8f949f; + border-top: 1px solid #b8bdc8; + } +} + +.input.password input, .input.string input, textarea { + @include box-shadow(inset 0 1px 2px 0 #ccc); + border-color: #c7c7c7 #E3E3E3 #E3E3E3 #c7c7c7; + border-style: solid; + border-width: 1px; + padding: 5px 8px; + @include border-radius(3px); + font-size: 15px; + margin: 5px 0 15px; + &:focus { + border-color: #b3b3b3 #d0d0d0 #d0d0d0 #b3b3b3; + } +} + + +.inline-hints, .hint { + margin: -12px 0 12px 0; + display: block; +} + + + +.buttons { + &.actions { + text-align: left; + margin-top: 20px; + padding-top: 20px; + border-top: 1px solid #f0f0f0; + a { + margin-right: 20px; + font-size: 15px; + padding: 6px 17px; + } + } + .add-btn { + float: left; + font-size: 15px; + margin: 0 20px 0 0; + } +} + diff --git a/app/assets/stylesheets/styling/header.css.scss b/app/assets/stylesheets/styling/header.css.scss new file mode 100644 index 00000000..0be4bf65 --- /dev/null +++ b/app/assets/stylesheets/styling/header.css.scss @@ -0,0 +1,66 @@ +header { + border-bottom: 1px solid darken($body_color, 28%); + border-top: 1px solid lighten($body_color, 2%); + @include box-shadow(0 1px 2px 0 rgba(0, 0, 0, 0.2)); + @include linear-gradient(top, #d1d3d7 0%, #b6b9bf 100%); + height: 30px; + position: relative; + z-index: 99; + nav { + ul { + li { + display: inline-block; + text-shadow: 0 1px 0 rgba(255,255,255, 0.7); + font-weight: bold; + a { + text-decoration: none; + color: #000; + line-height: 30px; + display: inline-block; + height: 30px; + padding: 0 10px; + margin: 0 1px; + &:hover { + @include linear-gradient(top, #d1d3d7 78%, #b6b9bf 100%); + color: #333; + } + &.selected { + color: #000; + @include linear-gradient(top, #d1d3d7 78%, #b6b9bf 100%); + border: 1px solid #9396A0; + border-width: 0 1px; + margin: 0; + } + } + } + } + } +} +.sub-head { + padding: 20px 0; + margin: 0; + @include linear-gradient(top, #e3e4e7 8%, #d5d7da 100%); + @include box-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.1)); + @include border-radius(0 0 5px 5px); +} + +.app { + nav { + text-align: left; + margin: 0 auto; + width: $layout_width; + ul { + display: inline-block; + &.user { + float: right; + li:first-child { + border-right: 1px solid #999; + font-weight: normal; + a { + border-right: 0; + } + } + } + } + } +} diff --git a/app/assets/stylesheets/styling/main.css.scss b/app/assets/stylesheets/styling/main.css.scss new file mode 100644 index 00000000..a418315a --- /dev/null +++ b/app/assets/stylesheets/styling/main.css.scss @@ -0,0 +1,57 @@ +html { + height: 100%; +} +body { + background: $body_color; + font-family: $helvetica; + height: 100%; + text-align: center; + color: #333; + font-size: 13px; +} +a { + color: #0088d2; + &:hover { + color: #036; + } +} +.main-layout { + @include linear-gradient(top, darken($body_color, 8%) 12%, $body_color 38%); +} +:hover { + @include transition (all, 0.5s); +} + + +.view { + background: #fcfcfc; + border: 1px solid #f7f8fa; + border-width: 8px 1px 1px 1px; + @include linear-gradient(top, #fcfcfe 77%, #f3f4f7 100%); + margin: 30px 0; + padding: 10px 30px 30px; + text-align: left; + @extend .drop-shadow; + @extend .curved; + h1 { + border-bottom: 2px solid #f0f0f0; + padding-bottom: 10px; + margin-bottom: 10px; + } + hr { + margin: 30px 0; + } + dl { font-size: 15px; margin-top: 20px;} +} + +.app { + .input.password input, .input.string input, textarea { + width: 600px; + } +} + +.content { + padding: 0 30px 30px; + margin: auto; + width: $layout_width; +} diff --git a/app/assets/stylesheets/styling/tables.css.scss b/app/assets/stylesheets/styling/tables.css.scss new file mode 100644 index 00000000..86df5e21 --- /dev/null +++ b/app/assets/stylesheets/styling/tables.css.scss @@ -0,0 +1,132 @@ +table { + width: 100%; + margin: 20px auto; + th { + white-space: nowrap; + padding: 8px 15px; + @include linear-gradient(top, #fff 0%, #edeff4 100%); + border-left: 1px solid #eceff5; + text-shadow: 0 1px 0 #fff; + cursor: default; + } + td { + padding: 8px 15px; + color: #383838; + border-left: 1px solid #eceff5; + cursor: default; + text-align: left; + } + td.actions { + text-align: center; + border: 0 !important; + padding: 5px 0; + img { + margin: 2px 1px; + } + a { + width: 20px; + height: 20px; + text-indent: -9999em; + overflow: hidden; + display: block; + float: left; + background-position: 0 0; + background-repeat: no-repeat; + margin: auto; + &:hover { + @include opacity(50); + } + } + &.edit_link a { + background-image: url("/assets/icon_edit.gif"); + } + &.show_link a { + background-image: url("/assets/icon_view.gif"); + } + &.destroy_link a { + background-image: url("/assets/icon_delete.gif"); + } + } + tr.odd td { + background: #f5f9fd; + } + tr.even td { + background: #fff; + } + th.numeric, td.numeric { + text-align: right; + } + tr:hover { + td { + color: #000; + } + } +} + +.no-data { + background: #e5e6e9; + overflow: hidden; + @include box-shadow(inset 0 1px 2px 0 rgba(0, 0, 0, 0.2)); + @include border-radius(12px); + font-size: 16px; + text-align: left; + display: inline-block; + padding: 30px; + margin-top: 20px; + text-align: center; + p { + background: #fcfcfc; + padding: 10px 20px; + @include border-radius(8px); + text-align: left; + } +} + +.app nav.pagination { + margin-top: 10px; + text-align: center; + font-size: 15px; + span, a { + display: inline-block; + @include border-radius(15px); + } + .page.current { + font-style: normal; + @include box-shadow(0 1px 0 1px rgba(0, 0, 0, 0.1) inset); + line-height: 23px; + width: 23px; + text-align: center; + background: #dfe0e4; + color: #000; + font-size: 12px; + font-weight: bold; + height: auto; + text-decoration: none; + text-shadow: 1px 1px 0 #fff; + cursor: default; + @include opacity(80); + height: 23px; + overflow: hidden; + } + a { + margin: 0 3px; + width: 23px; + line-height: 23px; + text-align: center; + background: #9d9d9d; + color: #fff; + font-size: 12px; + text-shadow: 0 1px 0 rgba(0,0,0,0.2); + font-weight: bold; + height: auto; + text-decoration: none; + height: 23px; + overflow: hidden; + cursor: pointer; + &:hover { + color: #fff; + background-color: #6c6c6c; + @include box-shadow(0 1px 0 1px rgba(0, 0, 0, 0.1) inset); + } + } +} diff --git a/app/assets/stylesheets/styling/types.css.scss b/app/assets/stylesheets/styling/types.css.scss new file mode 100644 index 00000000..a993b723 --- /dev/null +++ b/app/assets/stylesheets/styling/types.css.scss @@ -0,0 +1,74 @@ + +ol, ul { + margin: 0 0 20px 20px; + ol, ul { + margin-bottom: 0; + } + li { + font-size: 15px; + line-height: 20px; + p { + margin: 0 0 2px 0; + } + } +} + +code, pre { + background: #fff; + padding: 10px; + border: 1px solid #f0f0f0; + margin: 10px; +} +pre.code { + border: 1px solid #f0f0f0; + margin: 10px 0; + background: #333; + color: #fff; + @extend .drop-shadow; + code { + padding: 0; + border: 0; + background: #333; + color: #fff; + } +} + +h1, h2, h3 { + font-weight: normal; + text-shadow: 0 1px 0 #fff; + text-align: left; +} +h1 { + font-size: 28px; + margin: 30px 0 -10px; +} + +h2 { + font-size: 22px; + margin-bottom: 10px; + margin-top: 30px; +} + +h3 { + font-size: 18px; + font-weight: bold; + margin: 15px 0 5px; +} + +h4 { + font-size: 16px; + font-weight: bold; + margin: 15px 0 5px; +} + +h5 { + font-size: 15px; + margin: 15px 0 5px; + font-weight: bold; +} + +p { + font-size: 15px; + line-height: 20px; + margin: 0 0 18px 5px; +} diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 391fa2e9..013466e8 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -1,4 +1,7 @@ +require 'rdoc' + class DashboardController < ApplicationController def index + @rdoc = RDoc::Markup::ToHtml.new.convert(File.read(File.join(Rails.root, 'doc', 'README_FOR_APP_TEMPLATE.rdoc'))) end end diff --git a/app/views/dashboard/index.html.slim b/app/views/dashboard/index.html.slim index a5e5e258..f3250e21 100644 --- a/app/views/dashboard/index.html.slim +++ b/app/views/dashboard/index.html.slim @@ -1 +1,4 @@ -title 'Dashboard' +- title 'Dashboard' + +.view + == @rdoc diff --git a/app/views/devise/confirmations/new.html.slim b/app/views/devise/confirmations/new.html.slim index 339300a0..2e60a63c 100644 --- a/app/views/devise/confirmations/new.html.slim +++ b/app/views/devise/confirmations/new.html.slim @@ -1,7 +1,7 @@ -title 'Resend confirmation instructions' +- title "Resend confirmation instructions", false = simple_form_for(@user, :url => user_confirmation_path) do |form| fieldset = form.input :email, :required => true - = form.button :submit, 'Resend confirmation instructions' + = form.button :submit, 'Resend instructions' diff --git a/app/views/devise/passwords/edit.html.slim b/app/views/devise/passwords/edit.html.slim index 32cfba71..ab97cf18 100644 --- a/app/views/devise/passwords/edit.html.slim +++ b/app/views/devise/passwords/edit.html.slim @@ -1,4 +1,4 @@ -title 'Change your password' +- title "Change your password", false = simple_form_for(@user, \ :url => user_password_path, \ @@ -7,5 +7,5 @@ title 'Change your password' fieldset = form.input :password, :required => true = form.input :password_confirmation, :required => true - = form.button :submit, 'Change my password' + = form.button :submit, 'Change password' diff --git a/app/views/devise/passwords/new.html.slim b/app/views/devise/passwords/new.html.slim index 41fc6504..e4cfa46b 100644 --- a/app/views/devise/passwords/new.html.slim +++ b/app/views/devise/passwords/new.html.slim @@ -1,7 +1,7 @@ -title 'Forgot your password?' +- title "Forgot your password?", false = simple_form_for(@user, :url => user_password_path) do |form| fieldset = form.input :email, :required => true - = form.button :submit, 'Send me reset password instructions' + = form.button :submit, 'Send instructions' diff --git a/app/views/devise/registrations/edit.html.slim b/app/views/devise/registrations/edit.html.slim index 8fc095f1..cbce0cb9 100644 --- a/app/views/devise/registrations/edit.html.slim +++ b/app/views/devise/registrations/edit.html.slim @@ -1,4 +1,4 @@ -title "Edit #{resource_name.to_s.humanize}" +- title "Edit account", false = simple_form_for(@user, \ :url => user_registration_path, \ @@ -14,11 +14,9 @@ title "Edit #{resource_name.to_s.humanize}" = form.input :current_password, \ :required => true, \ :hint => "we need your current password to confirm your changes" - = form.button :submit - -.notifications - | Unhappy? - = link_to "Cancel my account", \ - user_registration_path, \ - :confirm => "Are you sure?", \ - :method => :delete + = form.button :submit + .notifications + = link_to "Cancel account", \ + user_registration_path, \ + :confirm => "Are you sure?", \ + :method => :delete diff --git a/app/views/devise/registrations/new.html.slim b/app/views/devise/registrations/new.html.slim old mode 100644 new mode 100755 index 3470582c..0d936d80 --- a/app/views/devise/registrations/new.html.slim +++ b/app/views/devise/registrations/new.html.slim @@ -1,6 +1,6 @@ -title %Q{Sign up to "#{configatron.app_name}"} +- title %Q{Sign up to "#{configatron.app_name}"}, false -.notifications +.sub-head | Already member? = link_to 'Sign in here!', new_user_session_path diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim old mode 100644 new mode 100755 index 00983a1e..3bf78e5e --- a/app/views/devise/sessions/new.html.slim +++ b/app/views/devise/sessions/new.html.slim @@ -1,6 +1,5 @@ -title %Q{Sign in to your "#{configatron.app_name}" account} - -.notifications +- title %Q{Sign in to your "#{configatron.app_name}" account}, false +.sub-head | Not a member? = link_to 'Sign up here!', new_user_registration_path @@ -11,12 +10,11 @@ title %Q{Sign in to your "#{configatron.app_name}" account} fieldset = form.input :email, :required => true = form.input :password, :required => true - - .notifications + = form.input :remember_me, \ + :as => :boolean, \ + :label => 'Remember my login on this computer' + = form.button :submit, 'Sign in' + .notifications.cf = link_to 'Forgot your password? ', new_user_password_path = link_to "Didn't receive confirmation instructions? ", \ new_user_confirmation_path - = form.input :remember_me, \ - :as => :boolean, \ - :label => 'Remember my login on this computer' - = form.button :submit, 'Sign in' diff --git a/app/views/layouts/_messages.html.slim b/app/views/layouts/_messages.html.slim index fdf09135..14022c94 100644 --- a/app/views/layouts/_messages.html.slim +++ b/app/views/layouts/_messages.html.slim @@ -1,2 +1,2 @@ - flash.each do |type, content| - = content_tag :div, content, :class => type + = content_tag :div, content, :class => type \ No newline at end of file diff --git a/app/views/layouts/_navigation.html.slim b/app/views/layouts/_navigation.html.slim old mode 100644 new mode 100755 index e4eb620d..e9735283 --- a/app/views/layouts/_navigation.html.slim +++ b/app/views/layouts/_navigation.html.slim @@ -1,4 +1,4 @@ -nav#navigation +nav = render_navigation(:context => :main) = render_navigation(:context => :user) diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index a9858043..23af0e6c 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -9,13 +9,18 @@ html = javascript_include_tag :application = csrf_meta_tag = yield(:head) - body - .content - = render 'layouts/navigation' - hr + body[class=(user_signed_in? ? "app" : "")] + .main-layout = render 'layouts/messages' - - if show_title? - h1 - = yield(:title) + header + = render 'layouts/navigation' + .content + - if show_title? + h1 + = yield(:title) - = yield \ No newline at end of file + = yield + + footer + | Copyright Flatstack + = Time.now.strftime("%Y") \ No newline at end of file diff --git a/app/views/styleguides/_01_heading.html.erb b/app/views/styleguides/_01_heading.html.erb new file mode 100644 index 00000000..9ecca29b --- /dev/null +++ b/app/views/styleguides/_01_heading.html.erb @@ -0,0 +1,36 @@ +

+

This is an example page of our basic styles

+

This is an h2 level heading

+ +

Wolbachia pipientis is a maternally transmitted obligate intracellular bacterium that chronically infects thousands of insect species, as well as a range of other arthropods and filarial nematodes. Wolbachia bacteria can induce various reproductive abnormalities in hosts that promote the bacteria's vertical transmission and spread. The discordance of host and Wolbachia phylogenies indicates that these bacteria have moved between host lineages on multiple occasions during their evolutionary history, although the mechanisms that facilitate the transfer of Wolbachia are not well understood. The success of such host shifts is inherently reliant on the ability of the bacteria to adapt to new intracellular environments.

+ +

The experimental transfer of Wolbachia between host species (transinfection) has proved technically challenging, and the success of such experiments is difficult to predict. Despite an increasing number of reports that document Wolbachia transinfection, many attempts to experimentally infect host species are unsuccessful due to poor maternal transmission rates in the novel host (40). In some cases, transferred strains are extremely stable and maternally inherited at very high rates. This situation occurs primarily when Wolbachia is transferred within or between closely related species in a family or genus. In other cases, the infecting strain appears to be poorly adapted to its new host, showing fluctuating infection densities and various degrees of transovarial transmission. The result is often the loss of infection within a few host generations. Not surprisingly, Wolbachia infections tend to be more susceptible to loss when they have been transferred between phylogenetically distant hosts (17, 35). Similarly, those species that do not naturally harbor Wolbachia can be especially challenging to successfully transinfect.

+ +
+

Blockquoted text. Not too long ago, two friends of mine were talking to a Cuban refugee, a businessman who had escaped from Castro, and in the midst of his story one of my friends turned to the other and said, "We don't know how lucky we are." And the Cuban stopped and said, "How lucky you are? I had someplace to escape to." And in that sentence he told us the entire story. If we lose freedom here, there's no place to escape to. This is the last stand on earth.

+
+ +

This is an h3 level heading

+

Senator Humphrey last week charged that Barry Goldwater, as President, would seek to eliminate farmers. He should do his homework a little better, because he'll find out that we've had a decline of 5 million in the farm population under these government programs. He'll also find that the Democratic administration has sought to get from Congress [an] extension of the farm program to include that three-fourths that is now free. He'll find that they've also asked for the right to imprison farmers who wouldn't keep books as prescribed by the federal government. The Secretary of Agriculture asked for the right to seize farms through condemnation and resell them to other individuals. And contained in that same program was a provision that would have allowed the federal government to remove 2 million farmers from the soil.

+ +
+ +

This is an h1 heading

+

This is an h2 heading

+

This is an h3 heading

+

This is an h4 heading

+
This is an h5 heading
+ +
+ +

This is an h1 heading. It's extremely long and will undoubtedly wrap on a line or two by the time it's completely and utterly finished in ultimate perpetuity.

+

And this is some text in a paragraph below it. Looks good. To understand what is really going on in a colony of ants or bees, Dr. Dornhaus, an assistant professor of ecology and evolutionary biology at the University of Arizona, tracks the little creatures individually — hence the paint and the numbers. Individual ants, she said, have “their own brains and legs, as well as complex and flexible behaviors.” She continues, “Each ant’s behavior and the rules under which it operates generate a pattern for the colony, so it’s crucial to discover its individual cognitive skill.”

+

This is an h2 heading. It's also far too long for a typical headline but we need to know what it will look like when it wraps. I'm sure you understand. Don't read too far in to it, if at all possible.

+

And this is some text in a paragraph below it. The study identifies that there are two scenarios in which a group can act as a unit. The first is when all the members are very closely related, and carry the same genes, so ensuring their genes are passed on to the next generation. The second is when the group's behaviour is controlled by a form of policing -in honey bee hives, for example, any egg not laid by the queen is destroyed by worker bees, to ensure only the queen's offspring survive. Both methods ensure that all the individuals involved are united in a common purpose.

+

This is an h3 heading that, as you can probably imagine, is going to be much too long than is typically desired but you have to understand there is a perfectly good reason.

+

And this is some text in a paragraph below it. Dr Andy Gardner, from the School of Biological Sciences at the University of Edinburgh, said: "We often see animals appearing to move in unison, such as bison or fish. However, what looks like a team effort is in fact each animal jostling to get to the middle of the group to evade predators.

+

This is an h4 heading

+

And this is some text in a paragraph below it. Looks good.Dr. Dornhaus is breaking new ground in her studies of whether the efficiency of ant society, based on a division of labor among ant specialists, is important to their success. To do that, she said, I briefly anesthetized 1,200 ants, one by one, and painted them using a single wire-size brush, with model airplane paint — Rally Green, Racing Red, Daytona Yellow.

+ +

After recording their behavior with two video cameras aiming down on an insect-size stage, she analyzed 300 hours of videotape of the ants in action. She discovered behavior more worthy of Aesop’s grasshopper than the proverbial industrious ants.

+
\ No newline at end of file diff --git a/app/views/styleguides/_02_lists.html.erb b/app/views/styleguides/_02_lists.html.erb new file mode 100644 index 00000000..6553eff3 --- /dev/null +++ b/app/views/styleguides/_02_lists.html.erb @@ -0,0 +1,55 @@ + +
+

List styles

+ + + +
    +
  1. Ordered list test
  2. +
  3. Another list element
  4. +
  5. Yet another element in the list
  6. +
  7. How many things do you really need in a list
  8. +
+ +
    +
  1. Outer Ordered list item
  2. +
  3. Outer Ordered list item +
      +
    • Nested Unordered list item
    • +
    • Nested Unordered list item +
        +
      1. Inner Nested Ordered list item
      2. +
      3. Inner Nested Ordered list item
      4. +
      +
    • +
    +
  4. +
  5. Outer Ordered list item
  6. +
  7. Outer Ordered list item +
      +
    1. Nested Ordered list item
    2. +
    3. Nested Ordered list item +
        +
      • Inner Nested Unordered list item
      • +
      • Inner Nested Unordered list item
      • +
      +
    4. +
    +
  8. +
+ +
+
definition list dt
+
definition list dd
+
definition list dt
+
definition list dd
+
definition list dt
+
definition list dd one
+
definition list dd two
+
+
\ No newline at end of file diff --git a/app/views/styleguides/_03_flash.html.erb b/app/views/styleguides/_03_flash.html.erb new file mode 100644 index 00000000..fdcbba37 --- /dev/null +++ b/app/views/styleguides/_03_flash.html.erb @@ -0,0 +1,11 @@ +

Flash messages

+ +
+ This is a <div> with the class .error. +
+
+ This is a <div> with the class .notice. +
+
+ This is a <div> with the class .success. +
diff --git a/app/views/styleguides/_04_misc.html.erb b/app/views/styleguides/_04_misc.html.erb new file mode 100644 index 00000000..ff71655e --- /dev/null +++ b/app/views/styleguides/_04_misc.html.erb @@ -0,0 +1,26 @@ +
+

+ <strong>
+ <ins> inserted
+ <del> deleted
+ <dfn> dfn
+ <em> emphasis
+

+ +

+ <a> anchor
+ <a> a + href
+

+ +

+ <abbr> abbr - extended text when mouseover.
+ <acronym> acronym - extended text when mouseover.
+

+ +
+ <address>
+ Donald Duck
+ Box 555
+ Disneyland +
+
\ No newline at end of file diff --git a/app/views/styleguides/_05_code.html.erb b/app/views/styleguides/_05_code.html.erb new file mode 100644 index 00000000..b9114a77 --- /dev/null +++ b/app/views/styleguides/_05_code.html.erb @@ -0,0 +1,29 @@ +
+

Code Styles

+ +
<pre>
+  What light
+    through yonder window breaks
+ + <code> + User.new + +
<pre class="code"><code>
+  class User < ActiveRecord::Base
+  has_many :groups
+  belongs_to :account
+  
+  def name
+    [first_name, last_name].join(' ')
+  end
+  end
+ + <tt> + This tt text should be monospaced + and + wrap as if + one line of text + even though the code has newlines, spaces, and tabs. + It should be the same size as <p> text. + +
\ No newline at end of file diff --git a/app/views/styleguides/_06_form.html.erb b/app/views/styleguides/_06_form.html.erb new file mode 100644 index 00000000..4031be60 --- /dev/null +++ b/app/views/styleguides/_06_form.html.erb @@ -0,0 +1,633 @@ +
+
+
+
+ + + this is some hint text +
+
+ + + You need to be an admin to edit this +
+
+ + +
+
+ + +
+
+ + + can't be blank +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+ +
+ or cancel +
+
+
+
+ + +
+
+
+
+ + + + + — + + : + +
+
+ + + + +
+
+ + + + + + : + +
+
+ + +
+
+ + + this is some hint text +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + this is some very very very very long hint text +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + this is some hint text +
+
+ or cancel +
+
+
+
\ No newline at end of file diff --git a/app/views/styleguides/_tabletastic.html.erb b/app/views/styleguides/_tabletastic.html.erb index c48ad115..ec8f772c 100644 --- a/app/views/styleguides/_tabletastic.html.erb +++ b/app/views/styleguides/_tabletastic.html.erb @@ -1,13 +1,10 @@

Tabletastic styles

- - - @@ -16,8 +13,6 @@ - - @@ -26,8 +21,6 @@ - - @@ -36,18 +29,15 @@ - -
Title Body AuthorPercentPrice Actions
Something Lorem ipsum dolor sit amet consequat. Duis aute irure dolor. Jim Beam
80%
$100 Second Post This is the second post Jack Daniels
18%
$100 Something else Blah!
8%
$100
- - -
- -

- Add new offer -

+
+ Add new offer +
diff --git a/config/database.yml.example b/config/database.yml.example index 6bf8ef5b..424af5e9 100644 --- a/config/database.yml.example +++ b/config/database.yml.example @@ -10,23 +10,23 @@ development: <<: *defaults_developmet test: - database: db/test<%= ENV['TEST_ENV_NUMBER'] %>.sqlite3 + database: db/test.sqlite3 <<: *defaults_developmet -## mysql@locahost -## -#defaults_developmet: &defaults_developmet -# adapter: mysql -# encoding: utf8 -# host: localhost -# username: root -# password: -# -#development: -# database: application_dev -# <<: *defaults_developmet -# -#test: -# database: application_test<%= ENV['TEST_ENV_NUMBER'] %> -# <<: *defaults_developmet +# # mysql@locahost +# # +# defaults_developmet: &defaults_developmet +# adapter: mysql +# encoding: utf8 +# host: localhost +# username: root +# password: +# +# development: +# database: application_dev +# <<: *defaults_developmet +# +# test: +# database: application_test +# <<: *defaults_developmet diff --git a/doc/CHANGELOG_FOR_APP_TEMPLATE.rdoc b/doc/CHANGELOG_FOR_APP_TEMPLATE.rdoc index 1eeaf798..df63b921 100644 --- a/doc/CHANGELOG_FOR_APP_TEMPLATE.rdoc +++ b/doc/CHANGELOG_FOR_APP_TEMPLATE.rdoc @@ -1,3 +1,11 @@ += 0.2.rc4 + +* We use slim for all views for now +* New nice styling +* flutie gem replaced with styleguides gem (onlu /styleguides support) +* Removed omniauth from the template b/c we should have very simple app +* Cleaned up cucumber steps + = 0.2.rc3 * Added brakeman - a static analysis security vulnerability scanner for Ruby on Rails applications diff --git a/doc/README_FOR_APP_TEMPLATE.rdoc b/doc/README_FOR_APP_TEMPLATE.rdoc index dc4108d7..e939a2ec 100644 --- a/doc/README_FOR_APP_TEMPLATE.rdoc +++ b/doc/README_FOR_APP_TEMPLATE.rdoc @@ -253,5 +253,4 @@ We have main and user navigation which accessible for visitor and authorized use (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) * Send a pull request. Bonus points for topic branches. -Thanks, -FlatStack +(c) FlatStack diff --git a/features/step_definitions/authentication_steps.rb b/features/step_definitions/authentication_steps.rb index 630107b9..6c836b3b 100644 --- a/features/step_definitions/authentication_steps.rb +++ b/features/step_definitions/authentication_steps.rb @@ -1,27 +1,20 @@ -Given /^I am registered user$/ do +Given /^I exist as a user$/ do @current_user = Factory.create :confirmed_user end -Given /^I am an authenticated user$/ do +Given /^I am signed in$/ do @current_user = Factory.create :confirmed_user sign_in_with @current_user.email, "123456" end -Given /^I am an authenticated user over Twitter$/ do - steps %Q{ - Given I am registered user over Twitter - When I sign in with my Twitter account - } -end - Then /^I should be signed in$/ do - within "#navigation" do + within "nav" do page.should have_content "Sign out" end end Then /^I should be signed out$/ do - within "#navigation" do + within "nav" do page.should_not have_content "Sign out" end end diff --git a/features/step_definitions/user/manage_account_steps.rb b/features/step_definitions/user/manage_account_steps.rb index 71452afc..1e5f0f5e 100644 --- a/features/step_definitions/user/manage_account_steps.rb +++ b/features/step_definitions/user/manage_account_steps.rb @@ -12,11 +12,15 @@ def submit_update_account_form(fields) When /^I cancel my account$/ do visit edit_user_registration_path - click_link "Cancel my account" + click_link "Cancel account" end -Then /^my account should not exists$/ do - User.exists?(@current_user.id).should be_false +When /^I submit update account form with valid data but with wrong current password$/ do + submit_update_account_form :full_name => 'My new name with invalid password', + :email => @current_user.email, + :password => '123456', + :password_confirmation => '123456', + :current_password => 'invalid password' end When /^I submit update account form with valid data$/ do @@ -27,36 +31,20 @@ def submit_update_account_form(fields) :current_password => '123456' end +Then /^my account should not exists$/ do + User.exists?(@current_user.id).should be_false +end + Then /^my account should be updated successfully$/ do @current_user.reload @current_user.full_name.should eql 'My new name' end -When /^I submit update account form with valid data but with wrong current password$/ do - submit_update_account_form :full_name => 'My new name with invalid password', - :email => @current_user.email, - :password => '123456', - :password_confirmation => '123456', - :current_password => 'invalid password' -end - Then /^my account should not be updated$/ do @current_user.reload @current_user.full_name.should_not eql 'My new name with invalid password' end -When /^I submit update account form without current password$/ do - submit_update_account_form :full_name => 'My new name', - :email => @current_user.email -end - -When /^I submit update account form with passwords but without current password$/ do - submit_update_account_form :full_name => 'My new name', - :email => @current_user.email, - :password => 'new-password', - :password_confirmation => 'new-password' -end - Then /^my account should be updated successfully with new passwords$/ do @current_user.reload @current_user.encrypted_password.should be_present diff --git a/features/step_definitions/visitor/sign_in_steps.rb b/features/step_definitions/visitor/sign_in_steps.rb index f79cd22e..d5fe33eb 100644 --- a/features/step_definitions/visitor/sign_in_steps.rb +++ b/features/step_definitions/visitor/sign_in_steps.rb @@ -7,6 +7,10 @@ def sign_in_with(email, password) click_button "Sign in" end +Given /^I exist as a user with not comfirmed email$/ do + @current_user = Factory.create :not_confirmed_user +end + When /^I sign in with valid credentials$/ do sign_in_with @current_user.email, "123456" end @@ -15,41 +19,21 @@ def sign_in_with(email, password) sign_in_with "empty@email.com", "empty password" end -Given /^I am registered user with not comfirmed email$/ do - @current_user = Factory.create :not_confirmed_user -end - -Then /^I should see that my email is not confirmed$/ do - page.should have_content "You have to confirm your account before continuing" -end - When /^I sign out$/ do - within "#navigation" do + within "nav" do click_link "Sign out" end end -Given /^I am registered user over Twitter$/ do - @current_user = Factory.create :user_registered_over_twitter -end - -When /^I sign in with my Twitter account$/ do - OmniAuth.config.test_mode = true - OmniAuth.config.mock_auth[:twitter] = { - "provider" => "twitter", - "uid" => 1, - "info" => { "name" => @current_user.full_name } - } - - visit new_user_session_path - click_link "Twitter" -end - When /^I request new password$/ do visit new_user_password_path fill_in "Email", :with => @current_user.email - click_button "Send me reset password instructions" + click_button "Send instructions" +end + +Then /^I should see that my email is not confirmed$/ do + page.should have_content "You have to confirm your account before continuing" end Then /^I should receive reset password instructions email$/ do diff --git a/features/step_definitions/visitor/sign_up_steps.rb b/features/step_definitions/visitor/sign_up_steps.rb index b004bdb5..aaba9725 100644 --- a/features/step_definitions/visitor/sign_up_steps.rb +++ b/features/step_definitions/visitor/sign_up_steps.rb @@ -1,3 +1,7 @@ +Given /^I have email with confirmation link$/ do + steps %Q{When I submit registration form with required fields} +end + When /^I submit registration form with required fields$/ do visit new_user_registration_path @@ -9,53 +13,27 @@ click_button "Sign up" end -Then /^I should receive registration confirmation email$/ do - open_email "chuck.norris@example.com" - - current_email.should have_subject /Confirmation instructions/ - current_email.default_part_body.to_s.should =~ /Chuck Norris/ -end - -Given /^I have email with confirmation link$/ do - steps %Q{When I submit registration form with required fields} -end - When /^I follow registration confirmation link in the email$/ do open_email "chuck.norris@example.com" visit_in_email "Confirm my account" end -Then /^my account should be confirmed$/ do - User.find_by_email("chuck.norris@example.com").should be_confirmed -end - When /^I submit resent confirmtion instruction form$/ do Factory.create :not_confirmed_user, :email => "chuck.norris@example.com", :full_name => "Chuck Norris" visit new_user_confirmation_path fill_in "Email", :with => "chuck.norris@example.com" - click_button "Resend confirmation instructions" + click_button "Resend instructions" end -When /^I follow Twitter link for sign up$/ do - OmniAuth.config.test_mode = true - OmniAuth.config.mock_auth[:twitter] = { - "provider" => "twitter", - "uid" => 1, - "info" => { "name" => "John Smith" } - } +Then /^I should receive registration confirmation email$/ do + open_email "chuck.norris@example.com" - visit new_user_registration_path - click_link "Twitter" -end - -Then /^I should see form for completing registration over Twitter with prefilled fields$/ do - find_field("Full name").value.should =~ /John Smith/ + current_email.should have_subject /Confirmation instructions/ + current_email.default_part_body.to_s.should =~ /Chuck Norris/ end -When /^I submit registration over Twitter form with required fields$/ do - fill_in "Email", :with => "john@smith.com" - click_button "Sign up" +Then /^my account should be confirmed$/ do + User.find_by_email("chuck.norris@example.com").should be_confirmed end - diff --git a/features/user/manage_account/cancel_account.feature b/features/user/manage_account/cancel_account.feature index 0bae397c..9ceff96f 100644 --- a/features/user/manage_account/cancel_account.feature +++ b/features/user/manage_account/cancel_account.feature @@ -4,7 +4,7 @@ Feature: Cancel account I want to be able to cancel my account Background: - Given I am an authenticated user + Given I am signed in Scenario: Cancel user account When I cancel my account diff --git a/features/user/manage_account/update_account.feature b/features/user/manage_account/update_account.feature index 745142b0..88ed3b79 100644 --- a/features/user/manage_account/update_account.feature +++ b/features/user/manage_account/update_account.feature @@ -4,7 +4,7 @@ Feature: Update account information I want to be able to update my account information Background: - Given I am an authenticated user + Given I am signed in Scenario: Update user information successfully When I submit update account form with valid data diff --git a/features/visitor/sign_in/sign_in.feature b/features/visitor/sign_in/sign_in.feature index 92437670..e5071974 100644 --- a/features/visitor/sign_in/sign_in.feature +++ b/features/visitor/sign_in/sign_in.feature @@ -4,21 +4,21 @@ Feature: Sign in I want to sign in Scenario: User signs in successfully - Given I am registered user + Given I exist as a user When I sign in with valid credentials Then I should be signed in Scenario: User signs in with invalid credentials - Given I am registered user + Given I exist as a user When I sign in with invalid credentials Then I should be signed out Scenario: User has not confirmed email address - Given I am registered user with not comfirmed email + Given I exist as a user with not comfirmed email When I sign in with valid credentials Then I should see that my email is not confirmed Scenario: User forgets his password - Given I am registered user + Given I exist as a user When I request new password Then I should receive reset password instructions email diff --git a/features/visitor/sign_in/sign_out.feature b/features/visitor/sign_in/sign_out.feature index ffe3fffa..11e1c6f5 100644 --- a/features/visitor/sign_in/sign_out.feature +++ b/features/visitor/sign_in/sign_out.feature @@ -4,6 +4,6 @@ Feature: Sign out I want to sign out Scenario: Logged in user signs out - Given I am an authenticated user + Given I am signed in When I sign out Then I should be signed out \ No newline at end of file diff --git a/features/visitor/sign_up/sign_up_with_password.feature b/features/visitor/sign_up/sign_up.feature similarity index 100% rename from features/visitor/sign_up/sign_up_with_password.feature rename to features/visitor/sign_up/sign_up.feature diff --git a/lib/templates/slim/scaffold/edit.html.slim b/lib/templates/slim/scaffold/edit.html.slim index e70c85ae..4191ceb6 100644 --- a/lib/templates/slim/scaffold/edit.html.slim +++ b/lib/templates/slim/scaffold/edit.html.slim @@ -1,3 +1,3 @@ -title 'Editing <%= singular_table_name %>' +- title 'Editing <%= singular_table_name %>', false = render 'form' \ No newline at end of file diff --git a/lib/templates/slim/scaffold/index.html.slim b/lib/templates/slim/scaffold/index.html.slim index 3cf28586..316f3da7 100644 --- a/lib/templates/slim/scaffold/index.html.slim +++ b/lib/templates/slim/scaffold/index.html.slim @@ -1,4 +1,4 @@ -title 'Listing <%= plural_table_name %>' +- title 'Listing <%= plural_table_name %>' - unless collection.all.blank? = table_for(collection) diff --git a/lib/templates/slim/scaffold/new.html.slim b/lib/templates/slim/scaffold/new.html.slim index 83b23f8e..d56cdeeb 100644 --- a/lib/templates/slim/scaffold/new.html.slim +++ b/lib/templates/slim/scaffold/new.html.slim @@ -1,3 +1,3 @@ -title 'Create new <%= singular_table_name %>' +- title 'Create new <%= singular_table_name %>', false = render 'form' \ No newline at end of file diff --git a/lib/templates/slim/scaffold/show.html.slim b/lib/templates/slim/scaffold/show.html.slim index 697263de..64d752ad 100644 --- a/lib/templates/slim/scaffold/show.html.slim +++ b/lib/templates/slim/scaffold/show.html.slim @@ -1,10 +1,11 @@ -p#notice = notice -.view.<%= singular_table_name %> - ul - <% for attribute in attributes -%>li -strong <%= attribute.human_name %> -span.value= @<%= singular_table_name %>.<%= attribute.name %> +- title 'View <%= singular_table_name %>' +.view.lifted.drop-shadow.<%= singular_table_name %> + dl +<% for attribute in attributes -%> + dt + | <%= attribute.human_name %> + dd= @<%= singular_table_name %>.<%= attribute.name %> <% end -%> -.actions.buttons - = link_to 'Edit', edit_article_path(@article) - = link_to 'Back', articles_path + .actions.buttons + = link_to 'Edit', edit_<%= singular_table_name %>_path(resource) + = link_to 'Back', <%= plural_table_name %>_path