convert stylesheets in sass (wip) + fix the installation module + customize devise (wip)

This commit is contained in:
did 2011-11-03 14:01:08 +01:00
parent 851a255301
commit 8979957d43
35 changed files with 9984 additions and 1175 deletions

View File

@ -0,0 +1,35 @@
@import "compass/css3";
@import "compass/css3/border-radius";
@import "compass/css3/images";
@import "compass/css3/text-shadow";
@mixin black-button {
display: inline-block;
position: relative;
cursor: pointer;
border: 1px solid #000;
@include border-radius(5px);
line-height: 30px;
padding: 0 10px;
@include background-image(linear-gradient(top, #474850, #1f2027));
@include box-shadow(rgba(0, 0, 0, 0.3) 1px 1px 0px 0px);
font-size: 12px;
color: #fff;
text-decoration: none;
@include text-shadow(rgba(0, 0, 0, 0.8), 0px, 1px, 0px);
&:hover {
@include background-image(linear-gradient(top, #575862, #2f303b));
}
&:active {
top: 1px;
}
}

View File

@ -0,0 +1,11 @@
@import "compass/css3";
@import "compass/css3/border-radius";
@import "compass/css3/images";
@import "compass/css3/text-shadow";
@mixin hover-link {
text-decoration: none;
&:hover {
text-decoration: underline;
}
}

View File

@ -1,153 +0,0 @@
body { background: #000 url(/assets/locomotive/background/body.png) repeat 0 0; }
#wrapper {
background: transparent url(/assets/locomotive/box/wrapper_bg.png) repeat-x 0 0;
min-height: 400px;
}
#light {
background: transparent url(/assets/locomotive/box/light_bg.png) no-repeat center 0;
min-height: 400px;
padding-top: 100px;
}
#panel {
background: transparent url(/assets/locomotive/box/top_panel_bg.png) no-repeat center 0;
width: 356px;
height: 344px;
padding: 9px 0px 0 0px;
}
#panel h1 {
height: 41px;
margin: 0px;
padding: 20px 0px 0 0;
font-size: 1.8em;
color: white;
text-align: center;
text-shadow: 1px 1px 1px #000;
}
#panel .inner {
background: transparent url(/assets/locomotive/box/content_panel_bg.png) repeat-y center 0;
padding: 5px 0px 20px 0px;
}
#panel fieldset {
border: 0px;
padding: 0px;
margin: 0px;
}
#panel fieldset ol {
width: 260px;
list-style: none;
padding: 0px;
margin: 0px auto 0 auto;
}
#panel fieldset ol li {
margin-top: 20px;
}
#panel fieldset ol li label {
display: block;
font-size: 1.2em;
color: #222;
}
#panel fieldset ol li input {
background: white url(/assets/locomotive/box/input_bg.png) no-repeat 0 0;
width: 246px;
padding: 7px;
border: 0px;
font-size: 1.2em;
color: #222;
}
#panel fieldset ol li input[type=file] {
background: none;
padding: 0px;
}
#panel fieldset ol li div.inline-errors p {
padding: 3px 5px;
margin: 5px 0px;
background: #FFE5E5;
color: #CE2525;
}
#panel p.notice {
font-size: 1.2em;
color: #222;
margin: 15px 49px 0 49px;
text-align: center;
}
#panel p.link {
margin: 15px 0 0 49px;
}
#panel p.link a {
color: #1f82bc;
text-decoration: none;
}
#panel p.link a:hover {
text-decoration: underline;
}
#panel p.tright {
text-align: right;
margin-right: 20px;
}
#panel div.footer {
background: transparent url(/assets/locomotive/box/bottom_panel_bg.png) no-repeat center 0;
text-align: right;
margin: 0px 0px 0 0px;
padding: 22px 0;
}
#panel div.footer .button {
display: inline-block;
background: transparent url(/assets/locomotive/box/buttons/left_bg.png) no-repeat 0 0;
margin: 0 38px 0 0;
padding: 0px 0px 0px 2px;
font-size: 1.1em;
color: white;
cursor: pointer;
border: none;
height: 31px;
}
#panel div.footer .button span {
display: inline-block;
background: transparent url(/assets/locomotive/box/buttons/right_bg.png) no-repeat right top;
position: relative;
top: -1px;
padding: 3px 9px 9px 4px;
line-height: 21px;
}
/* ___ Messages ___ */
div.application-message {
font-size: 1.2em;
font-weight: bold;
padding: 8px;
margin: 10px 20px 0 20px;
text-align: justify;
}
div#flash-alert {
background: #FFE5E5;
color: #CE2525;
}
div#flash-notice {
background: #c7ff99;
color: #58852b;
}

View File

@ -0,0 +1,168 @@
@import "compass/css3";
@import "compass/css3/border-radius";
@import "compass/css3/images";
@import "compass/css3/text-shadow";
@import "buttons";
body { background: #000 image-url("locomotive/background/body.png") repeat 0 0; }
div.application-message {
font-size: 1.2em;
font-weight: bold;
padding: 8px;
margin: 10px 20px 0 20px;
text-align: justify;
}
div#flash-alert {
background: #FFE5E5;
color: #CE2525;
}
div#flash-notice {
background: #c7ff99;
color: #58852b;
}
#wrapper {
background: transparent image-url("locomotive/box/wrapper_bg.png") repeat-x 0 0;
min-height: 400px;
}
#light {
background: transparent image-url("locomotive/box/light_bg.png") no-repeat center 0;
min-height: 400px;
padding-top: 100px;
}
#panel {
width: 356px;
height: 344px;
padding: 0px 0px 0 0px;
@include box-shadow(rgba(0, 0, 0, 0.2) 0px 0px 10px 3px);
h1 {
height: 41px;
margin: 0px;
padding: 20px 0px 0 0;
@include border-top-radius(3px);
border-top: 1px solid #63646a;
@include background-image(linear-gradient(#393a41, #1e1f26));
font-size: 22px;
color: #fff;
text-align: center;
text-shadow: 1px 1px 1px #000;
} // h1
.inner {
background: #fff;
padding: 5px 20px 20px 20px;
fieldset {
border: 0px;
padding: 0px;
margin: 0px;
ol {
width: 100%;
list-style: none;
padding: 0px;
margin: 0px auto 0 auto;
li {
margin-top: 20px;
label {
display: block;
font-size: 1.2em;
color: #222;
} // label
input {
// background: white url(/assets/locomotive/box/input_bg.png) no-repeat 0 0;
padding: 7px;
border: 1px solid #b5b7c4;
@include background-image(linear-gradient(top, #dedfe4, #f8f9fa 25%, #f8f9fa 25%, #fefefe 50%, #fefefe));
font-size: 14px;
color: #222;
&[type=text] {
width: 302px;
}
&[type=password] {
width: 180px;
}
&[type=file] {
background: none;
padding: 0px;
} // type=file
} // input
div.inline-errors p {
padding: 3px 5px;
margin: 5px 0px;
background: #FFE5E5;
color: #CE2525;
} // inline-errors p
} // li
} // ol
} // fieldset
p.notice {
font-size: 1.2em;
color: #222;
margin: 15px 49px 0 49px;
text-align: center;
} // p.notice
p.link {
margin: 15px 0 0 49px;
a {
color: #1f82bc;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
} // p.link
p.tright {
text-align: right;
margin-right: 20px;
} // p.tright
} // .inner
.footer {
margin: 0px 0px 0 0px;
padding: 22px 0;
background: #8b8d9a;
@include border-bottom-radius(3px);
text-align: right;
input[type=submit] {
@include black-button;
margin: 0 18px 0 0;
}
} // .footer
} // #panel

View File

@ -1,61 +0,0 @@
/* ___ AUTOMATICALLY GENERATED: see admin/button.scss for the source file */
/* ___ rounded ___ */
/* ___ box shadow ___ */
/* ___ others ___ */
.button {
display: inline-block;
background: transparent url(/assets/locomotive//buttons/dark-gray-left.png) no-repeat 0 0;
padding: 0px 0px 0px 2px;
font-size: 0.9em;
color: white;
cursor: pointer;
border: none;
height: 31px;
outline: none; }
.button span {
display: inline-block;
background: transparent url(/assets/locomotive//buttons/dark-gray-right.png) no-repeat right top;
position: relative;
top: -1px;
padding: 3px 9px 9px 4px;
line-height: 21px;
text-shadow: 1px 1px 1px #000;
outline: none; }
.button.light {
background-image: url(/assets/locomotive//buttons/light-gray-left.png);
color: #787a89; }
.button.light span {
background-image: url(/assets/locomotive//buttons/light-gray-right.png);
text-shadow: 1px 1px 1px #fff; }
.button.small {
background: #ebedf4;
outline: none;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
height: 20px;
font-size: 0.7em;
padding: 0px 12px 0px 12px;
color: #8B8D9A !important;
text-decoration: none;
text-shadow: 1px 1px 1px #fff; }
.button.mini.add {
background: transparent;
height: 20px;
background: #e1e4ed;
background: -moz-linear-gradient(0% 100% 90deg, #d7dbe7, #ebedf4);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ebedf4), to(#d7dbe7));
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
-webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4); }
.button.mini.add span {
background: none;
line-height: 10px;
padding: 0px 5px 0 0; }
.button.remove {
color: #ff092c !important;
font-size: 1.1em; }
.button.remove:hover {
text-decoration: underline; }

View File

@ -1,81 +0,0 @@
#panel .inner {
padding-left: 20px;
padding-right: 20px;
color: #222;
}
#panel .inner a {
color: #1F82BC;
text-decoration: none;
}
#panel .inner a:hover {
text-decoration: underline;
}
#panel .inner p.explanations {
margin-top: 10px;
font-size: 1.2em;
}
#panel .inner p.done {
margin: 20px 0px 15px;
font-size: 1.2em;
}
#panel .inner p {
margin-bottom: 5px;
text-align: justify;
}
#panel .inner dl {
margin-bottom: 0px;
font-size: 1.2em;
}
#panel .inner dt {
margin-bottom: 7px;
}
#panel .inner dt em {
margin-left: 10px;
font-size: 1.1em;
color: #666;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}
#panel .inner dd p {
}
/* ___ custom ___ */
#panel fieldset ol li.question input[type=checkbox] {
display: inline;
width: auto;
margin-right: 10px;
}
#panel fieldset ol li.question label {
display: inline;
font-weight: normal;
}
#panel fieldset ol li div.inline-errors {
background: transparent url(/assets/locomotive//form/error-arrow.png) no-repeat 17px 0;
margin: 2px 0 0 0;
padding: 8px 0 0 0;
}
#panel fieldset ol li div.inline-errors p {
display: inline-block;
width: auto;
margin: 0px;
padding: 3px 12px 4px 30px;
color: #fff !important;
text-shadow: #000 0px 1px;
font-size: 0.9em;
padding-left: 30px;
background: #cd0f19 url(/assets/locomotive//form/icons/error.png) no-repeat 10px 6px;
}

View File

@ -0,0 +1,67 @@
@import "compass/css3";
@import "compass/css3/border-radius";
@import "compass/css3/images";
@import "compass/css3/text-shadow";
@import "helpers";
#panel {
.inner {
a {
color: #1F82BC;
@include hover-link;
}
p.explanations {
margin-top: 10px;
color: #222;
font-size: 14px;
text-align: justify;
}
p.done {
margin: 20px 0px 15px;
color: #222;
font-size: 14px;
}
fieldset {
ol {
li.question {
label {
display: inline;
font-weight: normal;
}
input[type=checkbox] {
display: inline;
width: auto;
margin-right: 10px;
}
} // li.question
li {
div.inline-errors {
background: transparent image-url("locomotive/form/error-arrow.png") no-repeat 17px 0;
margin: 2px 0 0 0;
padding: 8px 0 0 0;
p {
display: inline-block;
width: auto;
margin: 0px;
padding: 3px 12px 4px 30px;
color: #fff !important;
text-shadow: #000 0px 1px;
font-size: 11px;
padding-left: 30px;
background: #cd0f19 image-url("locomotive/form/icons/error.png") no-repeat 10px 6px;
}
}
} // li
} // ol
} // fieldset
} // inner
} // panel

View File

@ -2,7 +2,6 @@
* This is a manifest file that'll automatically include all the stylesheets available in this directory * This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope. * the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require ./locomotive/blueprint/screen.css *= require ./locomotive/blueprint/screen.css
*= require ./locomotive/box.css *= require ./locomotive/box.css
*= require ./locomotive/installation.css *= require ./locomotive/installation.css

View File

@ -1,116 +0,0 @@
@mixin clearfix {
&:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
};
}
/* ___ rounded ___ */
@mixin rounded($side, $radius: 10px, $important: false) {
@if $important == true {
$important: !important; }
@else {
$important: ""; }
border-#{$side}-radius: $radius unquote($important);
-moz-border-radius-#{$side}: $radius unquote($important);
-webkit-border-#{$side}-radius: $radius unquote($important);
}
@mixin border-rounded($vert, $horz, $radius, $important: false) {
@if $important == true {
$important: !important; }
@else {
$important: ""; }
border-#{$vert}-#{$horz}-radius: $radius unquote($important);
-moz-border-radius-#{$vert}#{$horz}: $radius unquote($important);
-webkit-border-#{$vert}-#{$horz}-radius: $radius unquote($important);
}
@mixin full-rounded($radius: 10px) {
border-radius: $radius;
-moz-border-radius: $radius;
-webkit-border-radius: $radius;
}
/* ___ box shadow ___ */
@mixin box-shadow($hoffset, $voffset, $depth, $color) {
box-shadow: $hoffset $voffset $depth $color;
-moz-box-shadow: $hoffset $voffset $depth $color;
-webkit-box-shadow: $hoffset $voffset $depth $color;
}
@mixin box-shadow-with-inset($color_top, $color_bottom: $color_top, $important: false) {
$color_bottom: $color_top !default;
@if $important == true {
$important: " !important"; }
@else {
$important: ""; }
box-shadow: inset 0 1px 0 0 $color_top, 0 1px 0 0 $color_bottom unquote($important);
-moz-box-shadow: inset 0 1px 0 0 $color_top, 0 1px 0 0 $color_bottom unquote($important);
-webkit-box-shadow: inset 0 1px 0 0 $color_top, 0 1px 0 0 $color_bottom unquote($important);
}
@mixin no-box-shadow($important: false) {
@if $important == true {
$important: " !important"; }
@else {
$important: ""; }
box-shadow: none $important;
-moz-box-shadow: none $important;
-webkit-box-shadow: none $important;
}
@mixin popup-box {
@include full-rounded(4px);
box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.17), 3px 3px 5px 0 rgba(0, 0, 0, 0.41);
-moz-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.17), 3px 3px 5px 0 rgba(0, 0, 0, 0.41);
-webkit-box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.17), 3px 3px 5px 0 rgba(0, 0, 0, 0.41);
}
/* ___ others ___ */
@mixin reset {
padding: 0px;
margin: 0px;
list-style: none;
a {
text-decoration: none;
}
}
@mixin absolute-position($vside, $vvalue, $hside, $hvalue, $display: block) {
display: $display;
position: absolute;
#{$vside}: $vvalue;
#{$hside}: $hvalue;
}
@mixin linear-background-gradient($from, $to) {
background: mix($from, $to);
background: -moz-linear-gradient(0% 100% 90deg, $to, $from);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to));
}
@mixin icon($where, $width, $height, $enabled: false, $top: 0, $left: 0) {
position: relative;
width: $width;
height: $height;
line-height: $height + 1;
@if $enabled == true {
background-position: -#{$width} $where; }
@else {
background-position: 0 $where; }
top: $top;
left: $left;
}

View File

@ -1,126 +0,0 @@
/* ___ AUTOMATICALLY GENERATED: see admin/button.scss for the source file */
@import "helpers";
.button {
display: inline-block;
background: transparent url(/assets/locomotive//buttons/dark-gray-left.png) no-repeat 0 0;
padding: 0px 0px 0px 2px;
font-size: 0.9em;
color: white;
cursor: pointer;
border: none;
height: 31px;
outline: none;
span {
display: inline-block;
background: transparent url(/assets/locomotive//buttons/dark-gray-right.png) no-repeat right top;
position: relative;
top: -1px;
padding: 3px 9px 9px 4px;
line-height: 21px;
text-shadow: 1px 1px 1px #000;
outline: none;
}
&.light {
background-image: url(/assets/locomotive//buttons/light-gray-left.png);
color: #787a89;
span {
background-image: url(/assets/locomotive//buttons/light-gray-right.png);
text-shadow: 1px 1px 1px #fff;
}
}
&.small {
background: #ebedf4;
outline: none;
-moz-border-radius : 10px;
-webkit-border-radius: 10px;
height: 20px;
font-size: 0.7em;
padding: 0px 12px 0px 12px;
color: #8B8D9A !important;
text-decoration: none;
text-shadow: 1px 1px 1px #fff;
}
&.mini.add {
background: transparent;
height: 20px;
@include linear-background-gradient(#ebedf4, #d7dbe7);
@include full-rounded(4px);
@include box-shadow(1px, 1px, 1px, rgba(0, 0, 0, 0.4));
span {
background: none;
line-height: 10px;
padding: 0px 5px 0 0;
}
}
&.remove {
color: #ff092c !important;
font-size: 1.1em;
&:hover { text-decoration: underline; }
}
}
// .button {
// display: inline-block;
// background: transparent url(/assets/locomotive//buttons/dark-gray-left.png) no-repeat 0 0;
// padding: 0px 0px 0px 2px;
// font-size: 0.9em;
// color: white;
// cursor: pointer;
// border: none;
// height: 31px;
// outline: none;
// }
//
// .button span {
// display: inline-block;
// background: transparent url(/assets/locomotive//buttons/dark-gray-right.png) no-repeat right top;
// position: relative;
// top: -1px;
// padding: 3px 9px 9px 4px;
// line-height: 21px;
// text-shadow: 1px 1px 1px #000;
// outline: none;
// }
//
// .button.light {
// background-image: url(/assets/locomotive//buttons/light-gray-left.png);
// color: #787a89;
// }
//
// .button.light span {
// background-image: url(/assets/locomotive//buttons/light-gray-right.png);
// text-shadow: 1px 1px 1px #fff;
// }
//
// .button.small {
// background: #ebedf4;
// outline: none;
// -moz-border-radius : 10px;
// -webkit-border-radius: 10px;
// height: 20px;
// font-size: 0.7em;
// padding: 0px 12px 0px 12px;
// color: #8B8D9A !important;
// text-decoration: none;
// text-shadow: 1px 1px 1px #fff;
// }
//
// .button.small.add {
// }
//
// .button.remove {
// color: #ff092c !important;
// font-size: 1.1em;
// }
//
// .button.remove:hover { text-decoration: underline; }

View File

@ -1,455 +0,0 @@
/* ___ AUTOMATICALLY GENERATED: see admin/menu.scss for the source file */
@import "helpers";
/* ___ submenu: bg ___*/
#submenu {
clear: both;
position: relative;
top: -1px;
z-index: 998;
height: 60px;
margin: 0px;
padding: 0 8px;
background: transparent url(/assets/locomotive//menu/shadow.png) repeat-y 0 0;
/* ___ submenu items ___ */
& > ul {
@include reset;
border-top: 1px solid rgba(255, 255, 255, 0.4);
background: transparent url(/assets/locomotive//menu/submenu/shadow.png) repeat-x 0 0;
@include rounded(top-right, 3px);
height: 60px;
& > li {
margin: 15px 7px 0 8px;
float: left;
&.hoverable > a span {
em {
display: inline-block;
background: transparent url(/assets/locomotive//menu/icons.png) no-repeat 0 -16px;
width: 12px;
height: 7px;
position: relative;
top: 0px;
left: 6px;
}
}
& > a {
display: inline-block;
@include full-rounded(16px);
@include box-shadow-with-inset(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
border: 1px solid rgba(0, 0, 0, 0.4);
border-top: 1px solid rgba(0, 0, 0, 0.3);
padding: 0px 16px 0px 16px;
height: 26px;
line-height: 22px;
outline: none;
span {
color: #fff;
font-size: 0.8em;
font-weight: normal;
text-shadow: 1px 1px 1px #000;
}
&:hover {
border: 1px solid rgba(0, 0, 0, 0.9);
border-top: 1px solid rgba(0, 0, 0, 0.8);
}
&.on, &:active {
border: 1px solid rgba(0, 0, 0, 0.2);
border-top: 1px solid rgba(0, 0, 0, 0.4);
border-bottom: 1px solid transparent !important;
@include box-shadow-with-inset(rgba(0, 0, 0, 0), rgba(255, 255, 255, 0.2), true);
}
&.hover {
background: #fff !important;
border-color: transparent !important;
border-color-bottom: #fff;
padding-bottom: 0px;
@include border-rounded(bottom, left, 0px, true);
@include border-rounded(bottom, right, 0px, true);
position: relative;
z-index: 998;
span {
color: #8b8d9a;
text-shadow: none;
@include no-box-shadow(true);
}
span em {
background-position: -12px -16px;
}
& > em {
@include absolute-position(bottom, 0px, right, -11px);
width: 13px;
height: 13px;
background: transparent url(/assets/locomotive//menu/popup/bottom-right-corner.png) no-repeat 0 0;
}
}
}
}
}
/* ___ submenu: actions ___ */
& > .action {
@include absolute-position(top, 0px, right, 22px);
height: 60px;
padding-left: 20px;
z-index: 1;
background: transparent url(/assets/locomotive//menu/submenu/action-border.png) repeat-y left 0;
a {
margin-top: 18px;
display: inline-block;
background: rgba(0, 0, 0, 0.4);
@include full-rounded(16px);
padding: 0px 10px 0 15px;
height: 22px;
line-height: 20px;
text-decoration: none;
border: 1px solid transparent;
outline: none;
em {
display: inline-block;
position: relative;
background: transparent url(/assets/locomotive//menu/icons.png) no-repeat 0 0px;
height: 11px;
width: 11px;
top: 1px;
left: -5px;
}
span {
position: relative;
top: -2px;
color: #fff;
font-size: 0.7em;
text-shadow: 1px 1px 1px #000;
}
&:hover {
border-color: rgba(0, 0, 0, 1);
}
}
}
/* ___ submenu: popup ___ */
.popup {
position: absolute;
top: 42px;
min-width: 250px;
background: #fff;
@include box-shadow(0px, 0px, 10px, rgba(0, 0, 0, 0.5));
@include full-rounded(16px);
@include border-rounded(top, left, 0px);
z-index: 997;
a {
color: #1f82bc;
text-decoration: none;
&:hover { text-decoration: underline; }
}
.header {
border-bottom: 1px dotted #bbbbbd;
padding-bottom: 6px;
margin: 0px 16px;
}
.inner { padding: 8px 16px; }
h2 {
font-size: 0.7em;
font-weight: bold;
color: #1e1f26;
margin-bottom: 0px;
}
p {
margin: 0px;
padding: 10px 0 0 0px;
a {
font-size: 0.8em;
background: transparent url(/assets/locomotive//menu/popup/add.png) no-repeat left 4px;
padding-left: 12px;
}
&.edit {
padding-top: 0px;
a {
background: transparent url(/assets/locomotive//menu/popup/bullet.png) no-repeat left 5px;
}
}
}
ul {
list-style-image: url(/assets/locomotive//menu/popup/bullet.png);
margin: 0px 0px 0 15px;
li {
position: relative;
a { font-size: 0.7em; }
span {
@include absolute-position(top, 6px, right, 15px, inline);
color: #8b8d9a;
font-size: 0.7em;
}
}
&.big-links {
list-style: none;
margin: 0px;
li {
margin: 10px 0;
a {
@include full-rounded(16px);
padding: 3px 10px;
background: #ebedf4;
font-weight: bold;
font-size: 0.8em;
}
}
}
}
.footer {
background: #ebedf4;
padding: 8px 16px;
@include rounded("bottom-left", 16px);
@include rounded("bottom-right", 16px);
a {
color: #8b8d9a;
font-weight: bold;
}
}
}
}
@mixin black-submenu {
& > ul {
background: #23242b url(/assets/locomotive//menu/submenu/black-bg.png) repeat-x 0 0;
border-color: rgba(255, 255, 255, 0.2);
& > li > a {
border: 1px solid rgba(0, 0, 0, 0.2);
border-top: 1px solid rgba(0, 0, 0, 0.1);
border-bottom: 1px solid rgba(0, 0, 0, 0.6);
@include box-shadow-with-inset(rgba(255, 255, 255, 0.1));
@include linear-background-gradient(#303138, #1e1e24);
&.on, &:active {
border: 1px solid rgba(0, 0, 0, 0.4);
border-top: 1px solid rgba(0, 0, 0, 0.6);
@include linear-background-gradient(#1e1e24, #212229);
}
}
}
& > .action {
background-image: url(/assets/locomotive//menu/submenu/black-action-border.png) !important;
}
}
@mixin green-submenu {
& > ul {
background-color: #2e9a7d;
& > li > a {
@include linear-background-gradient(#258c70, #13604b);
&.on, &:active {
@include linear-background-gradient(#195e4b, #166d55);
}
}
}
}
@mixin blue-submenu {
& > ul {
background-color: #2579ae;
& > li > a {
@include linear-background-gradient(#1f6ea1, #135179);
&.on, &:active {
@include linear-background-gradient(#13496c, #175b88);
}
}
}
}
@mixin orange-submenu {
& > ul {
background-color: #ed8102;
& > li > a {
@include linear-background-gradient(#e07a02, #a25804);
&.on, &:active {
@include linear-background-gradient(#965201, #9d5603);
}
}
}
}
@mixin red-submenu {
& > ul {
background-color: #d23c45;
& > li > a {
@include linear-background-gradient(#b63e45, #89272d);
&.on, &:active {
@include linear-background-gradient(#7b292e, #972e35);
}
}
}
}
@mixin submenu-color($color) {
@if $color == black { @include black-submenu; }
@if $color == green { @include green-submenu; }
@if $color == blue { @include blue-submenu; }
@if $color == orange { @include orange-submenu; }
@if $color == red { @include red-submenu; }
}
/* ___ menu ___ */
#menu {
@include reset;
margin: 20px 0 0 0px;
li.item {
float: left;
position: relative;
z-index: 994;
& > span, a {
float: left;
display: block;
}
& > span {
background: transparent url(/assets/locomotive//menu/left.png) no-repeat 0 0;
width: 40px;
height: 39px;
background-position: 0 -39px;
}
&.first > span {
width: 18px;
background-position: 0 0;
}
a {
background: transparent url(/assets/locomotive//menu/right.png) no-repeat right 0px;
padding: 0px 52px 0 2px;
height: 39px;
line-height: 26px;
outline: none;
em, span { display: inline-block; position: relative; }
em {
background: transparent url(/assets/locomotive//menu/icons.png) no-repeat 0px 0px;
}
span {
top: 9px;
left: 6px;
color: #787A89;
text-shadow: #C5CFD1 1px 1px 1px;
font-size: 0.8em;
}
}
@for $i from 2 through 5 {
&.item-#{$i} { left: -35px * ($i - 1); z-index: 993 - $i; }
}
}
}
@mixin menu-color($color) {
$color-index: 1;
@if $color == green { $color-index: 1; }
@if $color == black { $color-index: 2; }
@if $color == blue { $color-index: 3; }
@if $color == orange { $color-index: 4; }
@if $color == red { $color-index: 5; }
z-index: 999;
a {
background-position: right -39px * $color-index;
span {
color: #fff;
text-shadow: none;
}
}
& > span { background-position: -40px * $color-index -39px; }
&.first > span { background-position: -18px * $color-index 0px; }
}
@mixin menu-contents-icon($enabled: false) {
@include icon(-64px, 16px, 12px, $enabled, 10px);
}
@mixin menu-assets-icon($enabled: false) {
@include icon(-48px, 20px, 16px, $enabled, 11px);
}
@mixin menu-settings-icon($enabled: false) {
@include icon(-32px, 14px, 13px, $enabled, 11px);
}
/* ___ section/color/icon associations ___ */
#menu li.contents a em { @include menu-contents-icon; }
body.contents {
$color: black;
#menu li.contents {
@include menu-color($color);
em { @include menu-contents-icon(true); }
}
#submenu { @include submenu-color($color); }
}
#menu li.assets a em { @include menu-assets-icon; }
body.assets {
$color: green;
#menu li.assets {
@include menu-color($color);
em { @include menu-assets-icon(true); }
}
#submenu { @include submenu-color($color); }
}
#menu li.settings a em { @include menu-settings-icon; }
body.settings {
$color: blue;
#menu li.settings {
@include menu-color($color);
em { @include menu-settings-icon(true); }
}
#submenu { @include submenu-color($color); }
}

View File

@ -1,82 +0,0 @@
/* ___ AUTOMATICALLY GENERATED: see admin/sites_picker.scss for the source file */
@import "helpers";
#sites-picker {
position: absolute;
top: 97px;
padding: 0px 0 0 0;
@include popup-box;
border: 1px solid #000;
background: rgba(50, 51, 59, 1);
min-width: 160px;
z-index: 999;
font-size: 12px;
p {
margin-bottom: 0px;
padding: 0 8px;
&, a {
color: #fff;
text-shadow: #000 0px 1px;
}
a {
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
&.action {
margin-top: 0px;
padding: 2px 8px 4px 8px;
text-align: right;
font-size: 11px;
}
}
ul {
@include reset;
margin: 1px 0 0 0;
li {
color: #aaa;
text-shadow: #000 0px 1px;
background: transparent url(/assets/locomotive//plugins/sites_picker_entry_bg.png) repeat-x 0 bottom;
padding: 2px 8px 6px 8px;
cursor: pointer;
a {
text-decoration: none;
color: #aaa;
}
&:hover {
&, a { color: #fff; }
}
}
}
&:before {
content: " ";
display: block;
width: 21px;
height: 13px;
position: absolute;
top: -11px;
right: 20px;
background: transparent url(/assets/locomotive//plugins/sites_picker_top_arrow.png) no-repeat 0 0;
}
}

View File

@ -20,7 +20,7 @@ module Locomotive
helper_method :sections, :current_site_url, :site_url, :page_url, :current_ability helper_method :sections, :current_site_url, :site_url, :page_url, :current_ability
# https://rails.lighthouseapp.com/projects/8994/tickets/1905-apphelpers-within-plugin-not-being-mixed-in # https://rails.lighthouseapp.com/projects/8994/tickets/1905-apphelpers-within-plugin-not-being-mixed-in
helper Locomotive::BaseHelper, Locomotive::BoxHelper helper Locomotive::BaseHelper #, Locomotive::BoxHelper
# Dir[File.dirname(__FILE__) + "/../../helpers/**/*_helper.rb"].each do |file| # Dir[File.dirname(__FILE__) + "/../../helpers/**/*_helper.rb"].each do |file|
# helper "locomotive/#{File.basename(file, '.rb').gsub(/_helper$/, '')}" # helper "locomotive/#{File.basename(file, '.rb').gsub(/_helper$/, '')}"
# end # end

View File

@ -25,16 +25,16 @@ module Locomotive::BaseHelper
end end
end end
def admin_button_tag(text, url, options = {}) # def admin_button_tag(text, url, options = {})
text = text.is_a?(Symbol) ? t(".#{text}") : text # text = text.is_a?(Symbol) ? t(".#{text}") : text
link_to(url, options) do # link_to(url, options) do
content_tag(:em, escape_once(' ')) + text # content_tag(:em, escape_once(' ')) + text
end # end
end # end
def admin_item_toggler(object) # def admin_item_toggler(object)
image_tag("admin/list/icons/node_#{(cookies["folder-#{object._id}"] != 'none') ? 'open' : 'closed'}.png", :class => 'toggler') # image_tag("admin/list/icons/node_#{(cookies["folder-#{object._id}"] != 'none') ? 'open' : 'closed'}.png", :class => 'toggler')
end # end
def collection_to_js(collection, options = {}) def collection_to_js(collection, options = {})
js = collection.collect { |object| object.to_json } js = collection.collect { |object| object.to_json }
@ -58,4 +58,28 @@ module Locomotive::BaseHelper
link_to 'noCoffee', 'http://www.nocoffee.fr', :id => 'nocoffee' link_to 'noCoffee', 'http://www.nocoffee.fr', :id => 'nocoffee'
end end
# sites
def application_domain
domain = Locomotive.config.domain
domain += ":#{request.port}" if request.port != 80
domain
end
def manage_subdomain_or_domains?
Locomotive.config.manage_subdomain? || Locomotive.config.manage_domains?
end
def manage_subdomain?
Locomotive.config.manage_subdomain?
end
def manage_domains?
Locomotive.config.manage_domains?
end
def multi_sites?
Locomotive.config.multi_sites?
end
end end

View File

@ -10,12 +10,12 @@ module Locomotive::BoxHelper
end end
end end
def box_button_tag(label) # def box_button_tag(label)
content_tag(:button, content_tag(:span, label), :type => 'submit', :class => 'button') # content_tag(:button, content_tag(:span, label), :type => 'submit', :class => 'button')
end # end
def next_installation_step_link(step = 1, label = nil) # def next_installation_step_link(step = 1, label = nil)
link_to(content_tag(:span, label || t('locomotive.installation.common.next')), installation_step_url(step), :class => 'button') # link_to(content_tag(:span, label || t('locomotive.installation.common.next')), installation_step_url(step), :class => 'button')
end # end
end end

View File

@ -1,11 +1,5 @@
module Locomotive::SitesHelper module Locomotive::SitesHelper
def application_domain
domain = Locomotive.config.domain
domain += ":#{request.port}" if request.port != 80
domain
end
def error_on_domain(site, name) def error_on_domain(site, name)
if (error = (site.errors[:domains] || []).detect { |n| n.include?(name) }) if (error = (site.errors[:domains] || []).detect { |n| n.include?(name) })
content_tag(:span, error, :class => 'inline-errors') content_tag(:span, error, :class => 'inline-errors')
@ -14,20 +8,4 @@ module Locomotive::SitesHelper
end end
end end
def manage_subdomain_or_domains?
Locomotive.config.manage_subdomain? || Locomotive.config.manage_domains?
end
def manage_subdomain?
Locomotive.config.manage_subdomain?
end
def manage_domains?
Locomotive.config.manage_domains?
end
def multi_sites?
Locomotive.config.multi_sites?
end
end end

View File

@ -1,4 +1,4 @@
Locomotive module Locomotive
class Ability class Ability
include CanCan::Ability include CanCan::Ability

View File

@ -17,7 +17,7 @@ module Locomotive
mount_uploader :source, AssetUploader mount_uploader :source, AssetUploader
## associations ## ## associations ##
referenced_in :site referenced_in :site, :class_name => 'Locomotive::Site'
## validations ## ## validations ##
validates_presence_of :source validates_presence_of :source

View File

@ -19,7 +19,7 @@ module Locomotive
validates_presence_of :_slug validates_presence_of :_slug
## associations ## ## associations ##
embedded_in :content_type, :inverse_of => :contents embedded_in :content_type, :class_name => 'Locomotive::ContentType', :inverse_of => :contents
## callbacks ## ## callbacks ##
before_validation :set_slug before_validation :set_slug

View File

@ -18,8 +18,8 @@ module Locomotive
field :api_accounts, :type => Array field :api_accounts, :type => Array
## associations ## ## associations ##
referenced_in :site referenced_in :site, :class_name => 'Locomotive::Site'
embeds_many :contents, :class_name => 'Locomotive::ContentInstance', :validate => false do embeds_many :contents, :class_name => 'Locomotive::ContentInstance', :validate => false do
def visible def visible
@target.find_all { |c| c.visible? } @target.find_all { |c| c.visible? }
end end
@ -32,14 +32,14 @@ module Locomotive
index [[:site_id, Mongo::ASCENDING], [:slug, Mongo::ASCENDING]] index [[:site_id, Mongo::ASCENDING], [:slug, Mongo::ASCENDING]]
## callbacks ## ## callbacks ##
before_validation :normalize_slug before_validation :normalize_slug
before_save :set_default_values before_save :set_default_values
after_destroy :remove_uploaded_files after_destroy :remove_uploaded_files
## validations ## ## validations ##
validates_presence_of :site, :name, :slug validates_presence_of :site, :name, :slug
validates_uniqueness_of :slug, :scope => :site_id validates_uniqueness_of :slug, :scope => :site_id
validates_size_of :content_custom_fields, :minimum => 1, :message => :array_too_short validates_size_of :content_custom_fields, :minimum => 1, :message => :array_too_short
## behaviours ## ## behaviours ##
custom_fields_for :contents custom_fields_for :contents

View File

@ -15,7 +15,7 @@ module Locomotive
field :from_parent, :type => Boolean, :default => false field :from_parent, :type => Boolean, :default => false
## associations ## ## associations ##
embedded_in :page, :inverse_of => :editable_elements embedded_in :page, :class_name => 'Locomotive::Page', :inverse_of => :editable_elements
## validations ## ## validations ##
validates_presence_of :slug validates_presence_of :slug

View File

@ -141,13 +141,13 @@ module Locomotive
end end
def add_to_list_bottom def add_to_list_bottom
self.position ||= (::Page.where(:_id.ne => self._id).and(:parent_id => self.parent_id).max(:position) || 0) + 1 self.position ||= (self.class.where(:_id.ne => self._id).and(:parent_id => self.parent_id).max(:position) || 0) + 1
end end
def remove_from_list def remove_from_list
return if (self.site rescue nil).nil? return if (self.site rescue nil).nil?
::Page.where(:parent_id => self.parent_id).and(:position.gt => self.position).each do |p| self.class.where(:parent_id => self.parent_id).and(:position.gt => self.position).each do |p|
p.position -= 1 p.position -= 1
p.save p.save
end end

View File

@ -7,12 +7,12 @@ module Locomotive
field :role, :default => 'author' field :role, :default => 'author'
## associations ## ## associations ##
referenced_in :account, :validate => false referenced_in :account, :class_name => 'Locomotive::Account', :validate => false
embedded_in :site, :inverse_of => :memberships embedded_in :site, :class_name => 'Locomotive::Site', :inverse_of => :memberships
## validations ## ## validations ##
validates_presence_of :account validates_presence_of :account
validate :can_change_role, :if => :role_changed? validate :can_change_role, :if => :role_changed?
## callbacks ## ## callbacks ##
before_save :define_role before_save :define_role

View File

@ -22,7 +22,7 @@ module Locomotive
field :cache_strategy, :default => 'none' field :cache_strategy, :default => 'none'
## associations ## ## associations ##
referenced_in :site referenced_in :site, :class_name => 'Locomotive::Site'
## indexes ## ## indexes ##
index :site_id index :site_id
@ -30,10 +30,10 @@ module Locomotive
index [[:fullpath, Mongo::ASCENDING], [:site_id, Mongo::ASCENDING]] index [[:fullpath, Mongo::ASCENDING], [:site_id, Mongo::ASCENDING]]
## callbacks ## ## callbacks ##
after_initialize :set_default_raw_template after_initialize :set_default_raw_template
before_validation :normalize_slug before_validation :normalize_slug
before_save { |p| p.fullpath = p.fullpath(true) } before_save { |p| p.fullpath = p.fullpath(true) }
before_destroy :do_not_remove_index_and_404_pages before_destroy :do_not_remove_index_and_404_pages
## validations ## ## validations ##
validates_presence_of :site, :title, :slug validates_presence_of :site, :title, :slug

View File

@ -13,19 +13,19 @@ module Locomotive
field :robots_txt field :robots_txt
## associations ## ## associations ##
references_many :pages, :validate => false references_many :pages, :class_name => 'Locomotive::Page', :validate => false
references_many :snippets, :dependent => :destroy, :validate => false references_many :snippets, :class_name => 'Locomotive::Snippet', :dependent => :destroy, :validate => false
references_many :theme_assets, :dependent => :destroy, :validate => false references_many :theme_assets, :class_name => 'Locomotive::ThemeAsset', :dependent => :destroy, :validate => false
references_many :assets, :dependent => :destroy, :validate => false references_many :assets, :class_name => 'Locomotive::Asset', :dependent => :destroy, :validate => false
references_many :content_types, :dependent => :destroy, :validate => false references_many :content_types, :class_name => 'Locomotive::ContentType', :dependent => :destroy, :validate => false
embeds_many :memberships embeds_many :memberships, :class_name => 'Locomotive::Membership'
## validations ## ## validations ##
validates_presence_of :name validates_presence_of :name
## callbacks ## ## callbacks ##
after_create :create_default_pages! after_create :create_default_pages!
after_destroy :destroy_pages after_destroy :destroy_pages
## behaviours ## ## behaviours ##
enable_subdomain_n_domains_if_multi_sites enable_subdomain_n_domains_if_multi_sites

View File

@ -9,12 +9,12 @@ module
field :template field :template
## associations ## ## associations ##
referenced_in :site referenced_in :site, :class_name => 'Locomotive::Site'
## callbacks ## ## callbacks ##
before_validation :normalize_slug before_validation :normalize_slug
after_save :update_templates after_save :update_templates
after_destroy :update_templates after_destroy :update_templates
## validations ## ## validations ##
validates_presence_of :site, :name, :slug, :template validates_presence_of :site, :name, :slug, :template

View File

@ -16,7 +16,7 @@ module Locomotive
mount_uploader :source, ThemeAssetUploader mount_uploader :source, ThemeAssetUploader
## associations ## ## associations ##
referenced_in :site referenced_in :site, :class_name => 'Locomotive::Site'
## indexes ## ## indexes ##
index :site_id index :site_id
@ -28,11 +28,11 @@ module Locomotive
before_validation :build_local_path before_validation :build_local_path
## validations ## ## validations ##
validates_presence_of :site, :source validates_presence_of :site, :source
validates_presence_of :plain_text_name, :if => Proc.new { |a| a.performing_plain_text? } validates_presence_of :plain_text_name, :if => Proc.new { |a| a.performing_plain_text? }
validates_uniqueness_of :local_path, :scope => :site_id validates_uniqueness_of :local_path, :scope => :site_id
validates_integrity_of :source validates_integrity_of :source
validate :content_type_can_not_changed validate :content_type_can_not_changed
## named scopes ## ## named scopes ##

View File

@ -3,9 +3,6 @@
- title t('.title') - title t('.title')
/ - content_for :head do
/ = include_stylesheets :installation
- if @step_done.blank? - if @step_done.blank?
= semantic_form_for(@account, :url => installation_step_url(1)) do |f| = semantic_form_for(@account, :url => installation_step_url(1)) do |f|
.inner .inner
@ -16,7 +13,7 @@
= f.input :password_confirmation, :label => t('.password_confirmation'), :required => false = f.input :password_confirmation, :label => t('.password_confirmation'), :required => false
.footer .footer
= box_button_tag t('.next') = submit_tag t('.next')
- else - else
.inner .inner
%p.done %p.done

View File

@ -3,10 +3,6 @@
- title t('.title') - title t('.title')
- content_for :head do
= include_stylesheets :installation
= include_javascripts :installation
= semantic_form_for(@site, :url => installation_step_url(2), :html => { :multipart => true }) do |f| = semantic_form_for(@site, :url => installation_step_url(2), :html => { :multipart => true }) do |f|
.inner .inner
@ -31,4 +27,4 @@
%p.inline-hints!= t('.back_to_default_template') %p.inline-hints!= t('.back_to_default_template')
.footer .footer
= box_button_tag t('.next') = submit_tag t('.next')

View File

@ -4,18 +4,11 @@
%head %head
%title= yield(:head_title) || escape_once("#{Locomotive.config.name} — #{current_site.name}") %title= yield(:head_title) || escape_once("#{Locomotive.config.name} — #{current_site.name}")
/ = javascript_include_tag 'locomotive/box.js' = javascript_include_tag 'locomotive/jquery.js'
= stylesheet_link_tag :locomotive_installation, :media => 'screen' = stylesheet_link_tag 'locomotive_installation', :media => 'screen'
/ = stylesheet_link_tag 'locomotive/foo', :debug => true #, :media => 'screen'
/ / [if IE] / [if IE]
/ = stylesheet_link_tag 'blueprint/ie', :media => 'screen' = stylesheet_link_tag 'locomotive/blueprint/ie', :media => 'screen'
/ = include_javascripts :box
/ = include_stylesheets :box, :media => 'screen'
/
/ / [if IE]
/ = include_stylesheets :ie, :media => 'screen'
= yield :head = yield :head

View File

@ -11,7 +11,7 @@
= f.input :password, :label => t('.password'), :required => false = f.input :password, :label => t('.password'), :required => false
%p.link %p.link
= link_to t('.link'), new_admin_password_path = link_to t('.link'), new_locomotive_password_path
.footer .footer
= box_button_tag t('locomotive.buttons.login') = box_button_tag t('locomotive.buttons.login')

View File

@ -8,7 +8,13 @@ Locomotive::Engine.routes.draw do
# get '/admin' => 'admin/sessions#new' # get '/admin' => 'admin/sessions#new'
# end # end
root :to => 'sessions#new' # locomotive authentication
devise_for :account, :class_name => 'Locomotive::Account', :controllers => { :sessions => 'locomotive/sessions', :passwords => 'locomotive/passwords' } do
match '/' => 'sessions#new'
match '/sign_in' => 'sessions#new'
end
# root :to => 'sessions#new'
resources :pages do resources :pages do
put :sort, :on => :member put :sort, :on => :member

View File

@ -13,3 +13,7 @@
- https://github.com/sferik/rails_admin - https://github.com/sferik/rails_admin
- http://railscasts.com/episodes/277-mountable-engines?view=comments - http://railscasts.com/episodes/277-mountable-engines?view=comments
- Creer un project sur fulcrum
- donner droit a Vincent / Mario
- migrer les stories la-bas

View File

@ -1,8 +1,5 @@
Rails.application.routes.draw do Rails.application.routes.draw do
# locomotive authentication mount Locomotive::Engine => '/foo'
devise_for :account, :class_name => 'Locomotive::Account', :controllers => { :sessions => 'locomotive/sessions', :passwords => 'locomotive/passwords' }
mount Locomotive::Engine => '/locomotive'
end end

File diff suppressed because it is too large Load Diff