diff --git a/.gitignore b/.gitignore index 205c3ee52..322e2f127 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ composer.lock .DS_Store /nbproject/private/ nbproject +/.idea diff --git a/public/css/colors.css b/public/css/colors.css new file mode 100644 index 000000000..e69de29bb diff --git a/public/css/colors.less b/public/css/colors.less new file mode 100644 index 000000000..dd25e4475 --- /dev/null +++ b/public/css/colors.less @@ -0,0 +1,4 @@ +@color-darkgrey: #424e56; +@color-darkblue: #1c3d52; +@color-lightgrey: #e2e6e9; +@color-black: #000000; \ No newline at end of file diff --git a/public/css/common.css b/public/css/common.css new file mode 100644 index 000000000..d341d0b38 --- /dev/null +++ b/public/css/common.css @@ -0,0 +1,103 @@ +/* fonts */ +.verdana { + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; +} +.arial { + font-family: Arial, Helvetica, sans-serif; +} +.centuryGothic { + font-family: 'century gothic', verdana, arial, helvetica, sans-serif; +} +/** + * + * HTML ELEMENTS + * + */ +/* You can put your HTML reset declarations in here if you like */ +/** + * + * BORDER RADIUS + * + */ +/* clears the border radius from an element */ +.noBorderRadius { + -moz-border-radius: 0; + border-radius: 0; + -webkit-border-radius: 0; +} +/** + * + * BOX SHADOWS + * + */ +/* same as above, except with spread. not sure what uses above so i may screw it up */ +.noBoxShadow { + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} +/** + * + * GRADIENTS + * + */ +/** + * + * TRANSITIONS + * + */ +.noTransition { + -webkit-transition: none; + -moz-transition: none; + -ms-transition: none; + -o-transition: none; + transition: none; +} +/** + * + * REUSABLE ELEMENTS + * + */ +/* simple table */ +.simpleTable th, +.simpleTable td, +.simpleTable tr, +.simpleTable tbody { + border: none; + background: none; + padding: 0; + margin: 0; +} +/* disables selection */ +.noSelect { + -moz-user-select: none; + -webkit-user-select: none; + user-select: none; +} +/* enables selection */ +.select { + -moz-user-select: auto; + -webkit-user-select: auto; + user-select: auto; +} +/* overflow ellipsis */ +.overflowEllipsis { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +/* opacity */ +/* clearfix */ +.clearfix { + zoom: 1; +} +.clearfix:before, +.clearfix:after { + content: "\0020"; + display: block; + height: 0; + overflow: hidden; +} +.clearfix:after { + clear: both; +} diff --git a/public/css/common.less b/public/css/common.less index df655cfc0..3b8189efd 100644 --- a/public/css/common.less +++ b/public/css/common.less @@ -25,7 +25,7 @@ * BORDER RADIUS * */ -.borderRadius (@radius: 5px) { +.borderRadius (@radius: 1px) { -moz-border-radius:@radius; border-radius:@radius; -webkit-border-radius:@radius; diff --git a/public/css/elements.less b/public/css/elements.less index 8615a4b8e..a52df226d 100644 --- a/public/css/elements.less +++ b/public/css/elements.less @@ -1,28 +1,3 @@ -/* Fonts */ -@font-face { - font-family: 'Oxygen'; - src: url('fonts/Oxygen/oxygen-regular-webfont.eot'); - src: url('fonts/Oxygen/oxygen-regular-webfont.eot?#iefix') format('embedded-opentype'), - url('fonts/Oxygen/oxygen-regular-webfont.woff') format('woff'), - url('fonts/Oxygen/oxygen-regular-webfont.ttf') format('truetype'), - url('fonts/Oxygen/oxygen-regular-webfont.svg#oxygenregular') format('svg'); - font-weight: 400; - font-style: normal; -} - -@font-face { - font-family: 'Oxygen'; - src: url('fonts/Oxygen/oxygen-bold-webfont.eot'); - src: url('fonts/Oxygen/oxygen-bold-webfont.eot?#iefix') format('embedded-opentype'), - url('fonts/Oxygen/oxygen-bold-webfont.woff') format('woff'), - url('fonts/Oxygen/oxygen-bold-webfont.ttf') format('truetype'), - url('fonts/Oxygen/oxygen-bold-webfont.svg#oxygenbold') format('svg'); - font-weight: 700; - font-style: normal; -} - - - @highdensity: ~"only screen and (-webkit-min-device-pixel-ratio: 1.5)", ~"only screen and (min--moz-device-pixel-ratio: 1.5)", ~"only screen and (-o-min-device-pixel-ratio: 3/2)", @@ -34,58 +9,45 @@ @desktop: ~"only screen and (min-width: 950px) and (max-width: 1128px)"; @desktopXl: ~"only screen and (min-width: 1129px)"; -.oxygen { - font-family: 'Oxygen', sans-serif; -} - - /* Elements */ .input { display: inline-block; vertical-align: middle; height: 18px; - .oxygen; - .insetShadow(0px, 1px, 2px, 1px, #eee); + font-family: 'Open Sans', sans-serif; color:#333; padding:4px 7px; border:1px solid #cccccc; font-size: 13px; - .borderRadius(1px); - .transition; + border-radius: 1px; width: 210px; &:focus { border-color: rgba(82, 168, 236, 0.8); - .innerOuterShadow; outline: 0; } } .greyButton { + transition: background-color 0.3s; padding: 7px 13px; margin: 0; border: none; - .verticalGradient(#818181, #646464); - .boxShadow(0, 1px, 5px, #444); + background-color: @color-darkgrey; color: #fff; - font-size: 13px; + font-size: 11px; font-weight: normal; cursor: pointer; - .borderRadius(2px); - .noSelect; + border-radius: 1px; &:hover, &:focus { - .verticalGradient(#929292, #646464); - } - - &:active { - .innerOuterShadow(0, 5px, 7px, 1px, #666, 0, 1px, 2px, #777); + background-color: @color-darkblue; } } .headerButtonPadding { - padding: 9px 12px 8px; + padding: 7px 10px 6px; } .headerButton { @@ -99,7 +61,6 @@ .editForm { color: #444; - text-shadow: white 0 1px 0; a.item_link { position: absolute; @@ -242,7 +203,6 @@ div.color_preview { height: 8px; margin: 0 33px 0 1px; - .boxShadow(0px, 1px, 2px, #aaa); } } } diff --git a/public/css/main.css b/public/css/main.css index dc0766a29..ddb14f699 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -1,5 +1,4 @@ /* imports */ -/* imports */ /* fonts */ .verdana { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; @@ -103,167 +102,67 @@ .clearfix:after { clear: both; } -/* Fonts */ -@font-face { - font-family: 'Oxygen'; - src: url('fonts/Oxygen/oxygen-regular-webfont.eot'); - src: url('fonts/Oxygen/oxygen-regular-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/Oxygen/oxygen-regular-webfont.woff') format('woff'), url('fonts/Oxygen/oxygen-regular-webfont.ttf') format('truetype'), url('fonts/Oxygen/oxygen-regular-webfont.svg#oxygenregular') format('svg'); - font-weight: 400; - font-style: normal; -} -@font-face { - font-family: 'Oxygen'; - src: url('fonts/Oxygen/oxygen-bold-webfont.eot'); - src: url('fonts/Oxygen/oxygen-bold-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/Oxygen/oxygen-bold-webfont.woff') format('woff'), url('fonts/Oxygen/oxygen-bold-webfont.ttf') format('truetype'), url('fonts/Oxygen/oxygen-bold-webfont.svg#oxygenbold') format('svg'); - font-weight: 700; - font-style: normal; -} -.oxygen { - font-family: 'Oxygen', sans-serif; -} /* Elements */ .input { display: inline-block; vertical-align: middle; height: 18px; - font-family: 'Oxygen', sans-serif; - -moz-box-shadow: inset 0px 1px 2px 1px #eeeeee; - -webkit-box-shadow: inset 0px 1px 2px 1px #eeeeee; - box-shadow: inset 0px 1px 2px 1px #eeeeee; + font-family: 'Open Sans', sans-serif; color: #333; padding: 4px 7px; border: 1px solid #cccccc; font-size: 13px; - -moz-border-radius: 1px; border-radius: 1px; - -webkit-border-radius: 1px; - background-clip: padding-box; - -webkit-transition: all 0.2s ease 0s; - -moz-transition: all 0.2s ease 0s; - -ms-transition: all 0.2s ease 0s; - -o-transition: all 0.2s ease 0s; - transition: all 0.2s ease 0s; width: 210px; } .input:focus { border-color: rgba(82, 168, 236, 0.8); - -moz-box-shadow: inset 0 1px 2px 1px #eeeeee, 0 0 8px rgba(82, 168, 236, 0.6); - -webkit-box-shadow: inset 0 1px 2px 1px #eeeeee, 0 0 8px rgba(82, 168, 236, 0.6); - box-shadow: inset 0 1px 2px 1px #eeeeee, 0 0 8px rgba(82, 168, 236, 0.6); outline: 0; } .greyButton { + transition: background-color 0.3s; padding: 7px 13px; margin: 0; border: none; - background: #818181; - /* Old browsers */ - - background: -moz-linear-gradient(top, #818181 0%, #646464 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #646464), color-stop(100%, #646464)); - background: -webkit-linear-gradient(top, #818181 0%, #646464 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #818181 0%, #646464 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #818181 0%, #646464 100%); - /* IE10+ */ - - background: linear-gradient(top, #818181 0%, #646464 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); - -moz-box-shadow: 0 1px 5px #444444; - -webkit-box-shadow: 0 1px 5px #444444; - box-shadow: 0 1px 5px #444444; + background-color: #424e56; color: #fff; - font-size: 13px; + font-size: 11px; font-weight: normal; cursor: pointer; - -moz-border-radius: 2px; - border-radius: 2px; - -webkit-border-radius: 2px; - background-clip: padding-box; - -moz-user-select: none; - -webkit-user-select: none; - user-select: none; + border-radius: 1px; } .greyButton:hover, .greyButton:focus { - background: #929292; - /* Old browsers */ - - background: -moz-linear-gradient(top, #929292 0%, #646464 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #646464), color-stop(100%, #646464)); - background: -webkit-linear-gradient(top, #929292 0%, #646464 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #929292 0%, #646464 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #929292 0%, #646464 100%); - /* IE10+ */ - - background: linear-gradient(top, #929292 0%, #646464 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); -} -.greyButton:active { - -moz-box-shadow: inset 0 5px 7px 1px #666666, 0 1px 2px #777777; - -webkit-box-shadow: inset 0 5px 7px 1px #666666, 0 1px 2px #777777; - box-shadow: inset 0 5px 7px 1px #666666, 0 1px 2px #777777; + background-color: #1c3d52; } .headerButtonPadding { - padding: 9px 12px 8px; + padding: 7px 10px 6px; } .headerButton { display: inline-block; - padding: 9px 12px 8px; + padding: 7px 10px 6px; } .headerButton:hover, .headerButton.current { - background: #444444; + background: #444; /* Old browsers */ - - background: -moz-linear-gradient(top, #444444 0%, #333333 100%); + background: -moz-linear-gradient(top, #444 0%, #333 100%); /* FF3.6+ */ - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #333333)); - background: -webkit-linear-gradient(top, #444444 0%, #333333 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333), color-stop(100%, #333)); + background: -webkit-linear-gradient(top, #444 0%, #333 100%); /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #444444 0%, #333333 100%); + background: -o-linear-gradient(top, #444 0%, #333 100%); /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #444444 0%, #333333 100%); + background: -ms-linear-gradient(top, #444 0%, #333 100%); /* IE10+ */ - - background: linear-gradient(top, #444444 0%, #333333 100%); + background: linear-gradient(top, #444 0%, #333 100%); /* W3C */ - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444', endColorstr='#333', GradientType=0); } .editForm { color: #444; - text-shadow: white 0 1px 0; } .editForm a.item_link { position: absolute; @@ -388,9 +287,6 @@ .editForm > div.color div.color_preview { height: 8px; margin: 0 33px 0 1px; - -moz-box-shadow: 0px 1px 2px #aaaaaa; - -webkit-box-shadow: 0px 1px 2px #aaaaaa; - box-shadow: 0px 1px 2px #aaaaaa; } .editForm div.control_buttons { margin-top: 20px; @@ -436,7 +332,6 @@ } #settings_page form.settings_form { color: #444; - text-shadow: white 0 1px 0; } #settings_page form.settings_form a.item_link { position: absolute; @@ -561,9 +456,6 @@ #settings_page form.settings_form > div.color div.color_preview { height: 8px; margin: 0 33px 0 1px; - -moz-box-shadow: 0px 1px 2px #aaaaaa; - -webkit-box-shadow: 0px 1px 2px #aaaaaa; - box-shadow: 0px 1px 2px #aaaaaa; } #settings_page form.settings_form div.control_buttons { margin-top: 20px; @@ -692,13 +584,14 @@ a { Main Styling */ #wrapper { - font-family: 'Oxygen', sans-serif; - font-size: 13px; - line-height: 18px; + font-family: 'Open Sans', sans-serif; + font-size: 11px; + line-height: 22px; color: #333333; } #wrapper h2 { - font-size: 24px; + color: #424e56; + font-size: 18px; line-height: 36px; } #wrapper textarea, @@ -719,23 +612,12 @@ a { display: inline-block; vertical-align: middle; height: 18px; - font-family: 'Oxygen', sans-serif; - -moz-box-shadow: inset 0px 1px 2px 1px #eeeeee; - -webkit-box-shadow: inset 0px 1px 2px 1px #eeeeee; - box-shadow: inset 0px 1px 2px 1px #eeeeee; + font-family: 'Open Sans', sans-serif; color: #333; padding: 4px 7px; border: 1px solid #cccccc; font-size: 13px; - -moz-border-radius: 1px; border-radius: 1px; - -webkit-border-radius: 1px; - background-clip: padding-box; - -webkit-transition: all 0.2s ease 0s; - -moz-transition: all 0.2s ease 0s; - -ms-transition: all 0.2s ease 0s; - -o-transition: all 0.2s ease 0s; - transition: all 0.2s ease 0s; width: 210px; } #wrapper textarea:focus, @@ -754,9 +636,6 @@ a { #wrapper input[type="tel"]:focus, #wrapper input[type="color"]:focus { border-color: rgba(82, 168, 236, 0.8); - -moz-box-shadow: inset 0 1px 2px 1px #eeeeee, 0 0 8px rgba(82, 168, 236, 0.6); - -webkit-box-shadow: inset 0 1px 2px 1px #eeeeee, 0 0 8px rgba(82, 168, 236, 0.6); - box-shadow: inset 0 1px 2px 1px #eeeeee, 0 0 8px rgba(82, 168, 236, 0.6); outline: 0; } #wrapper label { @@ -773,38 +652,13 @@ a { } /* common structure */ #wrapper header { - background: #5a6064; - /* Old browsers */ - - background: -moz-linear-gradient(top, #5a6064 0%, #4a4f52 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #4a4f52), color-stop(100%, #4a4f52)); - background: -webkit-linear-gradient(top, #5a6064 0%, #4a4f52 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #5a6064 0%, #4a4f52 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #5a6064 0%, #4a4f52 100%); - /* IE10+ */ - - background: linear-gradient(top, #5a6064 0%, #4a4f52 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37); + background-color: #424e56; border-bottom: 1px solid #44484b; - text-shadow: black 0 1px 0; height: 34px; overflow: visible; - position: relative; z-index: 900; position: fixed; top: 0; @@ -814,67 +668,31 @@ a { #wrapper header h1 { float: left; margin: 0; - border-right: 1px solid #999; } #wrapper header h1 a { display: inline-block; - padding: 9px 12px 8px; + padding: 7px 10px 6px; padding: 8px 15px 9px; - font-size: 19px; - border-right: 1px solid #555; + font-size: 16px; } #wrapper header h1 a:hover, #wrapper header h1 a.current { - background: #444444; + background: #444; /* Old browsers */ - - background: -moz-linear-gradient(top, #444444 0%, #333333 100%); + background: -moz-linear-gradient(top, #444 0%, #333 100%); /* FF3.6+ */ - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #333333)); - background: -webkit-linear-gradient(top, #444444 0%, #333333 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333), color-stop(100%, #333)); + background: -webkit-linear-gradient(top, #444 0%, #333 100%); /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #444444 0%, #333333 100%); + background: -o-linear-gradient(top, #444 0%, #333 100%); /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #444444 0%, #333333 100%); + background: -ms-linear-gradient(top, #444 0%, #333 100%); /* IE10+ */ - - background: linear-gradient(top, #444444 0%, #333333 100%); + background: linear-gradient(top, #444 0%, #333 100%); /* W3C */ - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); -} -#wrapper header h1 a:hover { - background: #444444; - /* Old browsers */ - - background: -moz-linear-gradient(top, #444444 0%, #333333 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #333333)); - background: -webkit-linear-gradient(top, #444444 0%, #333333 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #444444 0%, #333333 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #444444 0%, #333333 100%); - /* IE10+ */ - - background: linear-gradient(top, #444444 0%, #333333 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444', endColorstr='#333', GradientType=0); } #wrapper header a, #wrapper header span { @@ -884,72 +702,56 @@ a { } #wrapper header .iconButton { display: inline-block; - padding: 9px 12px 8px; + padding: 7px 10px 6px; padding: 0; display: none; } #wrapper header .iconButton:hover, #wrapper header .iconButton.current { - background: #444444; + background: #444; /* Old browsers */ - - background: -moz-linear-gradient(top, #444444 0%, #333333 100%); + background: -moz-linear-gradient(top, #444 0%, #333 100%); /* FF3.6+ */ - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #333333)); - background: -webkit-linear-gradient(top, #444444 0%, #333333 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333), color-stop(100%, #333)); + background: -webkit-linear-gradient(top, #444 0%, #333 100%); /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #444444 0%, #333333 100%); + background: -o-linear-gradient(top, #444 0%, #333 100%); /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #444444 0%, #333333 100%); + background: -ms-linear-gradient(top, #444 0%, #333 100%); /* IE10+ */ - - background: linear-gradient(top, #444444 0%, #333333 100%); + background: linear-gradient(top, #444 0%, #333 100%); /* W3C */ - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444', endColorstr='#333', GradientType=0); } #wrapper header .iconButton > div { height: 35px; } #wrapper header a#menu_button { display: inline-block; - padding: 9px 12px 8px; + padding: 7px 10px 6px; padding: 0; display: none; } #wrapper header a#menu_button:hover, #wrapper header a#menu_button.current { - background: #444444; + background: #444; /* Old browsers */ - - background: -moz-linear-gradient(top, #444444 0%, #333333 100%); + background: -moz-linear-gradient(top, #444 0%, #333 100%); /* FF3.6+ */ - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #333333)); - background: -webkit-linear-gradient(top, #444444 0%, #333333 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333), color-stop(100%, #333)); + background: -webkit-linear-gradient(top, #444 0%, #333 100%); /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #444444 0%, #333333 100%); + background: -o-linear-gradient(top, #444 0%, #333 100%); /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #444444 0%, #333333 100%); + background: -ms-linear-gradient(top, #444 0%, #333 100%); /* IE10+ */ - - background: linear-gradient(top, #444444 0%, #333333 100%); + background: linear-gradient(top, #444 0%, #333 100%); /* W3C */ - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444', endColorstr='#333', GradientType=0); } #wrapper header a#menu_button > div { height: 35px; @@ -960,37 +762,29 @@ a { } #wrapper header a#filter_button { display: inline-block; - padding: 9px 12px 8px; + padding: 7px 10px 6px; padding: 0; display: none; margin-left: -3px; } #wrapper header a#filter_button:hover, #wrapper header a#filter_button.current { - background: #444444; + background: #444; /* Old browsers */ - - background: -moz-linear-gradient(top, #444444 0%, #333333 100%); + background: -moz-linear-gradient(top, #444 0%, #333 100%); /* FF3.6+ */ - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #333333)); - background: -webkit-linear-gradient(top, #444444 0%, #333333 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333), color-stop(100%, #333)); + background: -webkit-linear-gradient(top, #444 0%, #333 100%); /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #444444 0%, #333333 100%); + background: -o-linear-gradient(top, #444 0%, #333 100%); /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #444444 0%, #333333 100%); + background: -ms-linear-gradient(top, #444 0%, #333 100%); /* IE10+ */ - - background: linear-gradient(top, #444444 0%, #333333 100%); + background: linear-gradient(top, #444 0%, #333 100%); /* W3C */ - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444', endColorstr='#333', GradientType=0); } #wrapper header a#filter_button > div { height: 35px; @@ -1014,30 +808,7 @@ a { padding: 12px 14px; } #wrapper header #mobile_menu_wrapper ul#mobile_menu { - background: #333333; - /* Old browsers */ - - background: -moz-linear-gradient(top, #333333 0%, #444444 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #444444), color-stop(100%, #444444)); - background: -webkit-linear-gradient(top, #333333 0%, #444444 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #333333 0%, #444444 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #333333 0%, #444444 100%); - /* IE10+ */ - - background: linear-gradient(top, #333333 0%, #444444 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + background-color: #424e56; min-width: 300px; min-height: 100%; } @@ -1059,42 +830,21 @@ a { #wrapper header ul#menu, #wrapper header ul#lang_menu { display: inline-block; + font-size: 11px; } #wrapper header ul#menu > li, #wrapper header ul#lang_menu > li { + transition: background-color 0.3s; + background-color: #424e56; display: inline-block; position: relative; - background: #5a6064; - /* Old browsers */ - - background: -moz-linear-gradient(top, #5a6064 0%, #4a4f52 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #4a4f52), color-stop(100%, #4a4f52)); - background: -webkit-linear-gradient(top, #5a6064 0%, #4a4f52 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #5a6064 0%, #4a4f52 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #5a6064 0%, #4a4f52 100%); - /* IE10+ */ - - background: linear-gradient(top, #5a6064 0%, #4a4f52 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); margin-left: -3px; } #wrapper header ul#menu > li a, #wrapper header ul#lang_menu > li a, #wrapper header ul#menu > li span, #wrapper header ul#lang_menu > li span { - padding: 9px 12px 8px; + padding: 7px 10px 6px; } #wrapper header ul#menu > li ul, #wrapper header ul#lang_menu > li ul { @@ -1102,40 +852,7 @@ a { top: 35px; left: 0; display: none; - background: #333333; - /* Old browsers */ - - background: -moz-linear-gradient(top, #333333 0%, #444444 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #444444), color-stop(100%, #444444)); - background: -webkit-linear-gradient(top, #333333 0%, #444444 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #333333 0%, #444444 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #333333 0%, #444444 100%); - /* IE10+ */ - - background: linear-gradient(top, #333333 0%, #444444 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); - -moz-box-shadow: 0 2px 3px #555555; - -webkit-box-shadow: 0 2px 3px #555555; - box-shadow: 0 2px 3px #555555; - -moz-border-bottom-right-radius: 2px; - border-bottom-right-radius: 2px; - -webkit-border-bottom-right-radius: 2px; - -moz-border-bottom-left-radius: 2px; - border-bottom-left-radius: 2px; - -webkit-border-bottom-left-radius: 2px; - background-clip: padding-box; + background-color: #424e56; } #wrapper header ul#menu > li ul a, #wrapper header ul#lang_menu > li ul a { @@ -1158,30 +875,7 @@ a { } #wrapper header ul#menu > li ul li.menu.current, #wrapper header ul#lang_menu > li ul li.menu.current { - background: #333333; - /* Old browsers */ - - background: -moz-linear-gradient(top, #333333 0%, #444444 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #444444), color-stop(100%, #444444)); - background: -webkit-linear-gradient(top, #333333 0%, #444444 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #333333 0%, #444444 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #333333 0%, #444444 100%); - /* IE10+ */ - - background: linear-gradient(top, #333333 0%, #444444 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + background-color: #1c3d52; } #wrapper header ul#menu > li ul li.menu ul, #wrapper header ul#lang_menu > li ul li.menu ul { @@ -1193,30 +887,7 @@ a { #wrapper header ul#lang_menu > li.current, #wrapper header ul#menu > li:hover, #wrapper header ul#lang_menu > li:hover { - background: #444444; - /* Old browsers */ - - background: -moz-linear-gradient(top, #444444 0%, #333333 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #333333)); - background: -webkit-linear-gradient(top, #444444 0%, #333333 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #444444 0%, #333333 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #444444 0%, #333333 100%); - /* IE10+ */ - - background: linear-gradient(top, #444444 0%, #333333 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + background-color: #1c3d52; } #wrapper header ul#menu > li:first-child, #wrapper header ul#lang_menu > li:first-child { @@ -1234,67 +905,51 @@ a { } #wrapper header div#right_nav a#back_to_site { display: inline-block; - padding: 9px 12px 8px; + padding: 7px 10px 6px; margin-left: -3px; } #wrapper header div#right_nav a#back_to_site:hover, #wrapper header div#right_nav a#back_to_site.current { - background: #444444; + background: #444; /* Old browsers */ - - background: -moz-linear-gradient(top, #444444 0%, #333333 100%); + background: -moz-linear-gradient(top, #444 0%, #333 100%); /* FF3.6+ */ - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #333333)); - background: -webkit-linear-gradient(top, #444444 0%, #333333 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333), color-stop(100%, #333)); + background: -webkit-linear-gradient(top, #444 0%, #333 100%); /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #444444 0%, #333333 100%); + background: -o-linear-gradient(top, #444 0%, #333 100%); /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #444444 0%, #333333 100%); + background: -ms-linear-gradient(top, #444 0%, #333 100%); /* IE10+ */ - - background: linear-gradient(top, #444444 0%, #333333 100%); + background: linear-gradient(top, #444 0%, #333 100%); /* W3C */ - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444', endColorstr='#333', GradientType=0); } #wrapper header div#right_nav a#logout { display: inline-block; - padding: 9px 12px 8px; + padding: 7px 10px 6px; margin-left: -3px; } #wrapper header div#right_nav a#logout:hover, #wrapper header div#right_nav a#logout.current { - background: #444444; + background: #444; /* Old browsers */ - - background: -moz-linear-gradient(top, #444444 0%, #333333 100%); + background: -moz-linear-gradient(top, #444 0%, #333 100%); /* FF3.6+ */ - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #333333)); - background: -webkit-linear-gradient(top, #444444 0%, #333333 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333), color-stop(100%, #333)); + background: -webkit-linear-gradient(top, #444 0%, #333 100%); /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #444444 0%, #333333 100%); + background: -o-linear-gradient(top, #444 0%, #333 100%); /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #444444 0%, #333333 100%); + background: -ms-linear-gradient(top, #444 0%, #333 100%); /* IE10+ */ - - background: linear-gradient(top, #444444 0%, #333333 100%); + background: linear-gradient(top, #444 0%, #333 100%); /* W3C */ - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444', endColorstr='#333', GradientType=0); } /* * Admin page @@ -1314,7 +969,6 @@ a { } #admin_page div#sidebar h2 { color: #444; - text-shadow: #DDD 0 1px 0; margin-bottom: 15px; } #admin_page div#sidebar div.filters > div { @@ -1358,54 +1012,20 @@ a { #admin_page div#sidebar div.filters > div.color div.color_preview { height: 8px; margin: 0 33px 0 1px; - -moz-box-shadow: 0px 1px 2px #aaaaaa; - -webkit-box-shadow: 0px 1px 2px #aaaaaa; - box-shadow: 0px 1px 2px #aaaaaa; } #admin_page #content { padding-top: 35px; /* edit form */ - } #admin_page #content div.table_container { position: relative; } #admin_page #content div.table_container div.results_header { - background: #efefef; - /* Old browsers */ - - background: -moz-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #dfe1e2), color-stop(100%, #dfe1e2)); - background: -webkit-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* IE10+ */ - - background: linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37); - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37); - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37); - text-shadow: white 0 1px 0; - border: solid 1px #d4d4d4; - border-top-color: #e6e6e6; - border-bottom-color: #EEE; - font-size: 1.0em; + background-color: #e2e6e9; + font-size: 14px; font-weight: bold; line-height: 18px; - color: #5e6469; + color: #1c3d52; position: relative; z-index: 800; margin-bottom: 3px; @@ -1423,48 +1043,17 @@ a { } #admin_page #content div.table_container div.results_header div.actions a, #admin_page #content div.table_container div.results_header div.actions input { - display: inline-block; + transition: background-color 0.3s; padding: 7px 13px; margin: 0; border: none; - background: #818181; - /* Old browsers */ - - background: -moz-linear-gradient(top, #818181 0%, #646464 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #646464), color-stop(100%, #646464)); - background: -webkit-linear-gradient(top, #818181 0%, #646464 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #818181 0%, #646464 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #818181 0%, #646464 100%); - /* IE10+ */ - - background: linear-gradient(top, #818181 0%, #646464 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); - -moz-box-shadow: 0 1px 5px #444444; - -webkit-box-shadow: 0 1px 5px #444444; - box-shadow: 0 1px 5px #444444; + background-color: #424e56; color: #fff; - font-size: 13px; + font-size: 11px; font-weight: normal; cursor: pointer; - -moz-border-radius: 2px; - border-radius: 2px; - -webkit-border-radius: 2px; - background-clip: padding-box; - -moz-user-select: none; - -webkit-user-select: none; - user-select: none; + border-radius: 1px; + display: inline-block; text-shadow: none; margin-left: 10px; } @@ -1472,36 +1061,7 @@ a { #admin_page #content div.table_container div.results_header div.actions input:hover, #admin_page #content div.table_container div.results_header div.actions a:focus, #admin_page #content div.table_container div.results_header div.actions input:focus { - background: #929292; - /* Old browsers */ - - background: -moz-linear-gradient(top, #929292 0%, #646464 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #646464), color-stop(100%, #646464)); - background: -webkit-linear-gradient(top, #929292 0%, #646464 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #929292 0%, #646464 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #929292 0%, #646464 100%); - /* IE10+ */ - - background: linear-gradient(top, #929292 0%, #646464 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); -} -#admin_page #content div.table_container div.results_header div.actions a:active, -#admin_page #content div.table_container div.results_header div.actions input:active { - -moz-box-shadow: inset 0 5px 7px 1px #666666, 0 1px 2px #777777; - -webkit-box-shadow: inset 0 5px 7px 1px #666666, 0 1px 2px #777777; - box-shadow: inset 0 5px 7px 1px #666666, 0 1px 2px #777777; + background-color: #1c3d52; } #admin_page #content div.table_container div.results_header div.action_message { text-align: right; @@ -1510,37 +1070,7 @@ a { margin-right: 12px; } #admin_page #content div.table_container div.page_container { - background: #efefef; - /* Old browsers */ - - background: -moz-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #dfe1e2), color-stop(100%, #dfe1e2)); - background: -webkit-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* IE10+ */ - - background: linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37); - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37); - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37); - text-shadow: white 0 1px 0; - border: solid 1px #d4d4d4; - border-top-color: #e6e6e6; - border-bottom-color: #EEE; + background-color: #e2e6e9; font-size: 1.0em; font-weight: bold; line-height: 18px; @@ -1593,40 +1123,7 @@ a { border-spacing: 0; } #admin_page #content div.table_container table.results th { - background: #efefef; - /* Old browsers */ - - background: -moz-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #dfe1e2), color-stop(100%, #dfe1e2)); - background: -webkit-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* IE10+ */ - - background: linear-gradient(top, #efefef 0%, #dfe1e2 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); - text-shadow: white 0 1px 0; - border: solid 1px #d4d4d4; - border-top-color: #e6e6e6; - border-bottom-color: #cdcdcd; - border-right: none; - -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 1px #ffffff inset; - -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 1px #ffffff inset; - -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 1px #ffffff inset; - -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 1px #ffffff inset; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 1px #ffffff inset; + background-color: #e2e6e9; font-weight: bold; line-height: 18px; color: #5e6469; @@ -1637,7 +1134,6 @@ a { color: #5e6469; text-decoration: none; display: block; - white-space: nowrap; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; @@ -1652,30 +1148,7 @@ a { } #admin_page #content div.table_container table.results th.sorted-asc, #admin_page #content div.table_container table.results th.sorted-desc { - background: #e2e2e2; - /* Old browsers */ - - background: -moz-linear-gradient(top, #e2e2e2 0%, #d2d4d6 100%); - /* FF3.6+ */ - - /* Chrome,Safari4+ */ - - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #d2d4d6), color-stop(100%, #d2d4d6)); - background: -webkit-linear-gradient(top, #e2e2e2 0%, #d2d4d6 100%); - /* Chrome10+,Safari5.1+ */ - - background: -o-linear-gradient(top, #e2e2e2 0%, #d2d4d6 100%); - /* Opera 11.10+ */ - - background: -ms-linear-gradient(top, #e2e2e2 0%, #d2d4d6 100%); - /* IE10+ */ - - background: linear-gradient(top, #e2e2e2 0%, #d2d4d6 100%); - /* W3C */ - - /* IE6-9 */ - - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#818181', endColorstr='#646464', GradientType=0); + text-decoration: underline; } #admin_page #content div.table_container table.results th.sorted-asc div { background-position: 0 -27px; @@ -1683,9 +1156,6 @@ a { #admin_page #content div.table_container table.results th.sorted-desc div { background-position: 0 -56px; } -#admin_page #content div.table_container table.results th:last-child { - border-right: solid 1px #d4d4d4; -} #admin_page #content div.table_container table.results tr.result { cursor: pointer; } @@ -1712,7 +1182,7 @@ a { background-color: #000; opacity: 0.50; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; - filter: progid:dximagetransform.microsoft.alpha(opacity=50); + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50); filter: alpha(opacity=50); text-align: center; } @@ -1723,7 +1193,6 @@ a { right: 0; color: #fff; font-size: 35px; - text-shadow: #000 1px 1px 1px; } #admin_page #content div.table_container div.no_results { position: absolute; @@ -1736,7 +1205,6 @@ a { #admin_page #content div.table_container div.no_results > div { color: #444; font-size: 28px; - text-shadow: #ddd 1px 1px 1px; } #admin_page #content div.item_edit_container { position: absolute; @@ -1753,18 +1221,14 @@ a { position: relative; padding-top: 25px; padding-left: 27px; - background: #D9E4EC; + background-color: #e2e6e9; min-height: 430px; width: 258px; - -moz-box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.4); - -webkit-box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.4); - box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.4); margin-left: 2px; margin-bottom: 2px; } #admin_page #content div.item_edit_container div.item_edit form.edit_form { color: #444; - text-shadow: white 0 1px 0; } #admin_page #content div.item_edit_container div.item_edit form.edit_form a.item_link { position: absolute; @@ -1889,9 +1353,6 @@ a { #admin_page #content div.item_edit_container div.item_edit form.edit_form > div.color div.color_preview { height: 8px; margin: 0 33px 0 1px; - -moz-box-shadow: 0px 1px 2px #aaaaaa; - -webkit-box-shadow: 0px 1px 2px #aaaaaa; - box-shadow: 0px 1px 2px #aaaaaa; } #admin_page #content div.item_edit_container div.item_edit form.edit_form div.control_buttons { margin-top: 20px; @@ -2017,8 +1478,3 @@ a { display: none !important; } } -@media only screen and (min-width: 1129px) { - -} - -/* This beautiful CSS-File has been crafted with LESS (lesscss.org) and compiled by simpLESS (wearekiss.com/simpless) */ diff --git a/public/css/main.less b/public/css/main.less index 67489eb1f..d1be9eea1 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -2,7 +2,7 @@ @import "common.less"; @import "elements.less"; @import "settings.less"; - +@import "colors.less"; /* CSS Resets */ html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,address,cite,code,del,dfn,em,img,ins,q,small,strong,sub,sup,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;margin:0;padding:0}article,aside,figure,figure img,figcaption,hgroup,footer,header,nav,section,video,object{display:block}a img{border:0}figure{position:relative}figure img{width:100%} @@ -14,13 +14,14 @@ a{ text-decoration: none; } Main Styling */ #wrapper { - .oxygen; - font-size: 13px; - line-height: 18px; + font-family: 'Open Sans', sans-serif; + font-size: 11px; + line-height: 22px; color: #333333; h2 { - font-size: 24px; + color: @color-darkgrey; + font-size: 18px; line-height: 36px; } @@ -50,13 +51,11 @@ a{ text-decoration: none; } #wrapper { header { - .verticalGradient(#5a6064, #4a4f52); .boxShadow(0, 1px, 2px, rgba(0, 0, 0, 0.37)); + background-color: @color-darkgrey; border-bottom: 1px solid #44484b; - text-shadow: black 0 1px 0; height: 34px; overflow: visible; - position: relative; z-index: 900; position: fixed; top: 0; @@ -66,17 +65,11 @@ a{ text-decoration: none; } h1 { float: left; margin: 0; - border-right: 1px solid #999; a { .headerButton; padding: 8px 15px 9px; - font-size: 19px; - border-right: 1px solid #555; - - &:hover { - .verticalGradient(#444, #333); - } + font-size: 16px; } } @@ -132,7 +125,7 @@ a{ text-decoration: none; } } ul#mobile_menu { - .verticalGradient(#333, #444); + background-color: @color-darkgrey; min-width: 300px; min-height: 100%; @@ -161,29 +154,25 @@ a{ text-decoration: none; } ul#menu, ul#lang_menu { display: inline-block; + font-size: 9px; > li { - display: inline-block; - position: relative; - .verticalGradient(#5a6064, #4a4f52); + transition: background-color 0.3s; + background-color: @color-darkgrey; + display: inline-block; + position: relative; margin-left: -3px; a, span { .headerButtonPadding; } - &.menu { - - } - ul { position: absolute; top: 35px; left: 0; display: none; - .verticalGradient(#333, #444); - .boxShadow(0, 2px, 3px, #555); - .borderRadiusBottom(2px); + background-color: @color-darkgrey; a { display: block; @@ -206,13 +195,7 @@ a{ text-decoration: none; } position: relative; &.current { - .verticalGradient(#333, #444); - } - - &:hover { - > ul { - - } + background-color: @color-darkblue; } ul { @@ -224,7 +207,7 @@ a{ text-decoration: none; } } &.current, &:hover { - .verticalGradient(#444, #333); + background-color: @color-darkblue; } &:first-child { @@ -283,7 +266,6 @@ a{ text-decoration: none; } h2 { color: #444; - text-shadow: #DDD 0 1px 0; margin-bottom: 15px; } @@ -339,7 +321,6 @@ a{ text-decoration: none; } div.color_preview { height: 8px; margin: 0 33px 0 1px; - .boxShadow(0px, 1px, 2px, #aaa); } } } @@ -353,16 +334,11 @@ a{ text-decoration: none; } position: relative; div.results_header { - .verticalGradient(#efefef, #dfe1e2); - .boxShadow(0, 1px, 2px, rgba(0, 0, 0, 0.37)); - text-shadow: white 0 1px 0; - border: solid 1px #d4d4d4; - border-top-color: #e6e6e6; - border-bottom-color: #EEE; - font-size: 1.0em; + background-color: @color-lightgrey; + font-size: 14px; font-weight: bold; line-height: 18px; - color: #5e6469; + color: @color-darkblue; position: relative; z-index: 800; margin-bottom: 3px; @@ -380,8 +356,8 @@ a{ text-decoration: none; } right: 9px; a, input { - display: inline-block; - .greyButton; + .greyButton; + display: inline-block; text-shadow: none; margin-left: 10px; } @@ -396,12 +372,7 @@ a{ text-decoration: none; } } div.page_container { - .verticalGradient(#efefef, #dfe1e2); - .boxShadow(0, 1px, 2px, rgba(0, 0, 0, 0.37)); - text-shadow: white 0 1px 0; - border: solid 1px #d4d4d4; - border-top-color: #e6e6e6; - border-bottom-color: #EEE; + background-color: @color-lightgrey; font-size: 1.0em; font-weight: bold; line-height: 18px; @@ -458,17 +429,7 @@ a{ text-decoration: none; } border-spacing: 0; th { - .verticalGradient(#efefef, #dfe1e2); - text-shadow: white 0 1px 0; - border: solid 1px #d4d4d4; - border-top-color: #e6e6e6; - border-bottom-color: #cdcdcd; - border-right: none; - -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 1px white inset; - -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 1px white inset; - -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 1px white inset; - -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 1px white inset; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 1px white inset; + background-color: @color-lightgrey; font-weight: bold; line-height: 18px; color: #5e6469; @@ -494,7 +455,7 @@ a{ text-decoration: none; } } &.sorted-asc, &.sorted-desc { - .verticalGradient(#e2e2e2, #d2d4d6); + text-decoration: underline; } &.sorted-asc { @@ -508,10 +469,6 @@ a{ text-decoration: none; } background-position: 0 -56px; } } - - &:last-child { - border-right: solid 1px #d4d4d4; - } } tr.result { @@ -562,7 +519,6 @@ a{ text-decoration: none; } right: 0; color: #fff; font-size: 35px; - text-shadow: #000 1px 1px 1px; } } @@ -577,7 +533,6 @@ a{ text-decoration: none; } > div { color: #444; font-size:28px; - text-shadow: #ddd 1px 1px 1px; } } @@ -600,10 +555,9 @@ a{ text-decoration: none; } position: relative; padding-top: 25px; padding-left: 27px; - background: #D9E4EC; + background-color: @color-lightgrey; min-height: 430px; width: 258px; - .boxShadow(-1px, 1px, 2px, rgba(0, 0, 0, 0.4)); margin-left: 2px; margin-bottom: 2px; @@ -634,4 +588,4 @@ a{ text-decoration: none; } /* media queries */ -@import "media_queries.less"; \ No newline at end of file +@import "media_queries.less"; diff --git a/public/js/knockout/custom-bindings.js b/public/js/knockout/custom-bindings.js index 3a2696a98..01ae15b25 100644 --- a/public/js/knockout/custom-bindings.js +++ b/public/js/knockout/custom-bindings.js @@ -554,7 +554,8 @@ { $element.ckeditor({ language : language, - readOnly : !adminData.edit_fields[context.field_name].editable + readOnly : !adminData.edit_fields[context.field_name].editable, + allowedContent: true }); editor = $element.ckeditorGet(); diff --git a/src/Frozennode/Administrator/AdministratorServiceProvider.php b/src/Frozennode/Administrator/AdministratorServiceProvider.php index 71772ecd9..e1c6334b5 100644 --- a/src/Frozennode/Administrator/AdministratorServiceProvider.php +++ b/src/Frozennode/Administrator/AdministratorServiceProvider.php @@ -89,7 +89,11 @@ public function register() //set up the shared instances $this->app['admin_config_factory'] = $this->app->share(function($app) { - return new ConfigFactory($app->make('admin_validator'), LValidator::make(array(), array()), config('administrator')); + return new ConfigFactory( + $app->make('admin_validator'), + LValidator::make(array(), array()), + $this->app, + config('administrator')); }); $this->app['admin_field_factory'] = $this->app->share(function($app) diff --git a/src/Frozennode/Administrator/Config/Factory.php b/src/Frozennode/Administrator/Config/Factory.php index f2319fb73..3589a3c33 100644 --- a/src/Frozennode/Administrator/Config/Factory.php +++ b/src/Frozennode/Administrator/Config/Factory.php @@ -2,6 +2,7 @@ namespace Frozennode\Administrator\Config; use Frozennode\Administrator\Validator; +use Illuminate\Foundation\Application; use Illuminate\Validation\Validator as CustomValidator; use Frozennode\Administrator\Config\Settings\Config as SettingsConfig; use Frozennode\Administrator\Config\Model\Config as ModelConfig; @@ -50,6 +51,11 @@ class Factory { */ protected $type; + /** + * @var Application + */ + protected $app; + /** * The settings page menu prefix * @@ -71,7 +77,7 @@ class Factory { */ protected $rules = array( 'uri' => 'required|string', - 'title' => 'required|string', + 'title' => 'string', 'domain' => 'string', 'middleware' => 'array', 'model_config_path' => 'required|string|directory', @@ -90,19 +96,21 @@ class Factory { * * @param \Frozennode\Administrator\Validator $validator * @param \Illuminate\Validation\Validator $custom_validator + * @param Application $app, * @param array $options */ - public function __construct(Validator $validator, CustomValidator $custom_validator, array $options) + public function __construct(Validator $validator, CustomValidator $custom_validator, Application $app, array $options) { //set the config, and then validate it - $this->options = $options; - $this->validator = $validator; - $this->customValidator = $custom_validator; + $this->options = $options; + $this->validator = $validator; + $this->customValidator = $custom_validator; + $this->app = $app; + $validator->override($this->options, $this->rules); //if the validator failed, throw an exception - if ($validator->fails()) - { + if ($validator->fails()) { throw new \InvalidArgumentException('There are problems with your administrator.php config: ' . implode('. ', $validator->messages()->all())); } } diff --git a/src/Frozennode/Administrator/Config/Model/Config.php b/src/Frozennode/Administrator/Config/Model/Config.php index af21acab0..ebe73bdff 100644 --- a/src/Frozennode/Administrator/Config/Model/Config.php +++ b/src/Frozennode/Administrator/Config/Model/Config.php @@ -6,6 +6,9 @@ use Frozennode\Administrator\Fields\Factory as FieldFactory; use Frozennode\Administrator\Fields\Field as Field; use Frozennode\Administrator\Actions\Factory as ActionFactory; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\Relation; +use Illuminate\Http\Request; /** * The Model Config class helps retrieve a model's configuration and provides a reliable pointer for these items @@ -46,7 +49,7 @@ class Config extends ConfigBase implements ConfigInterface { /** * An instance of the Eloquent model object for this model * - * @var \Illuminate\Database\Eloquent\Model + * @var Model */ protected $model; @@ -77,7 +80,7 @@ class Config extends ConfigBase implements ConfigInterface { /** * Fetches the data model for a config * - * @return \Illuminate\Database\Eloquent\Model + * @return Model */ public function getDataModel() { @@ -93,7 +96,7 @@ public function getDataModel() /** * Sets the data model for a config * - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model * * @return void */ @@ -109,7 +112,7 @@ public function setDataModel($model) * @param array $fields * @param array $columns * - * @return \Illuminate\Database\Eloquent\Model + * @return Model */ public function getModel($id = 0, array $fields, array $columns) { @@ -133,7 +136,7 @@ public function getModel($id = 0, array $fields, array $columns) * Fills a model with the data it needs before being sent back to the user * * @param array $fields - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model * * @return void */ @@ -158,7 +161,7 @@ public function setExtraModelValues(array $fields, &$model) /** * Fills a model with the necessary relationship values for a field * - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model * @param \Frozennode\Administrator\Fields\Field $field * * @return void @@ -233,7 +236,7 @@ public function setModelRelationship(&$model, Field $field) /** * Fills a model with the necessary relationship values * - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model * @param \Frozennode\Administrator\Fields\Field $field * * @return \Illuminate\Database\Eloquent\Collection @@ -263,11 +266,11 @@ public function getModelRelatedItems($model, Field $field) /** * Updates a model with the latest permissions, links, and fields * - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model * @param \Frozennode\Administrator\Fields\Factory $fieldFactory * @param \Frozennode\Administrator\Actions\Factory $actionFactory * - * @return \Illuminate\Database\Eloquent\Model + * @return Model */ public function updateModel($model, FieldFactory $fieldFactory, ActionFactory $actionFactory) { @@ -293,14 +296,13 @@ public function updateModel($model, FieldFactory $fieldFactory, ActionFactory $a /** * Saves the model * - * @param \Illuminate\Http\Request $input - * @param array $fields - * @param array $actionPermissions - * @param int $id - * - * @return mixed //string if error, true if success + * @param Request $input + * @param Field[] $fields + * @param array $actionPermissions + * @param int $id + * @return mixed //string if error, true if success */ - public function save(\Illuminate\Http\Request $input, array $fields, array $actionPermissions = null, $id = 0) + public function save(Request $input, array $fields, array $actionPermissions = null, $id = 0) { $model = $this->getDataModel()->find($id); @@ -337,6 +339,9 @@ public function save(\Illuminate\Http\Request $input, array $fields, array $acti //if a string was kicked back, it's an error, so return it if (is_string($validation)) return $validation; + // set relation ships to model to have them available in observers + $this->setRelationships($input, $model, $fields); + //save the model $model->save(); @@ -352,13 +357,13 @@ public function save(\Illuminate\Http\Request $input, array $fields, array $acti /** * Prepare a model for saving given a post input array * - * @param \Illuminate\Database\Eloquent\Model $model - * @param \Illuminate\Http\Request $input + * @param Model $model + * @param Request $input * @param array $fields * * @return void */ - public function fillModel(&$model, \Illuminate\Http\Request $input, array $fields) + public function fillModel(&$model, Request $input, array $fields) { //run through the edit fields to see if we need to unset relationships or uneditable fields foreach ($fields as $name => $field) @@ -451,12 +456,12 @@ public function getModelStaticValidationMessages() /** * Gets the relationship inputs * - * @param \Illuminate\Http\Request $request + * @param Request $request * @param array $fields * * @return array */ - protected function getRelationshipInputs(\Illuminate\Http\Request $request, array $fields) + protected function getRelationshipInputs(Request $request, array $fields) { $inputs = array(); @@ -493,23 +498,67 @@ protected function formatRelationshipInput($value, Field $field) /** * After a model has been saved, this is called to save the relationships * - * @param \Illuminate\Http\Request $input - * @param \Illuminate\Database\Eloquent\Model $model - * @param array $fields + * @param Request $input + * @param Model $model + * @param Field[] $fields * * @return void */ - public function saveRelationships(\Illuminate\Http\Request $input, &$model, array $fields) - { - //run through the edit fields to see if we need to set relationships - foreach ($fields as $name => $field) - { - if ($field->getOption('external')) - { - $field->fillModel($model, $input->get($name, NULL)); - } - } - } + public function saveRelationships(Request $input, &$model, array $fields) + { + //run through the edit fields to see if we need to set relationships + foreach ($fields as $name => $field) { + if ($field->getOption('external')) { + $field->fillModel($model, $input->get($name, NULL)); + } + } + } + + /** + * After a model has been saved, this is called to save the relationships + * + * @param Request $input + * @param Model $model + * @param Field[] $fields + * @return void + */ + private function setRelationships(Request $input, &$model, array $fields) + { + //run through the edit fields to see if we need to set relationships + foreach ($fields as $name => $field) + { + if ($field->getOption('external')) + { + $fieldName = $field->getOption('field_name'); + $fieldValues = array_filter(explode(',', $input->get($fieldName, ''))); + + if (!count($fieldValues)) { + continue; + } + + /** + * @var Relation $relation + */ + $relation = $model->{$fieldName}(); + + /** + * @var Model $relationModel + */ + $relationModel = $relation->getRelated(); + + foreach ($fieldValues as $fieldValue) { + /** + * @var Model $relatedObject + */ + $relatedObject = $relationModel::find($fieldValue); + + if ($relatedObject) { + $model->{$fieldName}[] = $relatedObject; + } + } + } + } + } /** * Gets a model's link if one was provided, substituting for field names with this format: (:field_name) @@ -548,13 +597,13 @@ public function runQueryFilter(\Illuminate\Database\Query\Builder &$query) /** * Fetches the data model for a config given a post input array * - * @param \Illuminate\Http\Request $input + * @param Request $input * @param array $fields * @param int $id * - * @return \Illuminate\Database\Eloquent\Model + * @return Model */ - public function getFilledDataModel(\Illuminate\Http\Request $input, array $fields, $id = 0) + public function getFilledDataModel(Request $input, array $fields, $id = 0) { $model = $this->getDataModel(); diff --git a/src/Frozennode/Administrator/DataTable/DataTable.php b/src/Frozennode/Administrator/DataTable/DataTable.php index 732e381c1..289da20a5 100644 --- a/src/Frozennode/Administrator/DataTable/DataTable.php +++ b/src/Frozennode/Administrator/DataTable/DataTable.php @@ -194,6 +194,7 @@ public function performCountQuery(QueryBuilder $countQuery, $querySql, $queryBin $model = $this->config->getDataModel(); //then wrap the inner table and perform the count + $querySql = str_replace('* from', 'id from', $querySql); $sql = "SELECT COUNT({$model->getKeyName()}) AS aggregate FROM ({$querySql}) AS agg"; //then perform the count query diff --git a/src/Frozennode/Administrator/Fields/Enum.php b/src/Frozennode/Administrator/Fields/Enum.php index e176ac4b3..0541f78a1 100644 --- a/src/Frozennode/Administrator/Fields/Enum.php +++ b/src/Frozennode/Administrator/Fields/Enum.php @@ -14,29 +14,48 @@ class Enum extends Field { 'options' => 'required|array|not_empty', ); - /** - * Builds a few basic options - */ - public function build() - { - parent::build(); + /** + * Builds a few basic options + */ + public function build() + { + parent::build(); - $options = $this->suppliedOptions; + $options = $this->suppliedOptions; + $dataOptions = $options['options']; + $options['options'] = array(); + $isAssoc = $this->isArrayAssoc($dataOptions); - $dataOptions = $options['options']; - $options['options'] = array(); + //iterate over the options to create the options assoc array + foreach ($dataOptions as $val => $text) + { + $options['options'][] = array( + 'id' => $isAssoc ? $val : $text, + 'text' => $text, + ); + } - //iterate over the options to create the options assoc array - foreach ($dataOptions as $val => $text) - { - $options['options'][] = array( - 'id' => is_numeric($val) ? $text : $val, - 'text' => $text, - ); - } + $this->suppliedOptions = $options; + } - $this->suppliedOptions = $options; - } + /** + * @param array $arr + * @return bool + */ + private function isArrayAssoc(array $arr) + { + $expected = 0; + + foreach ($arr as $key => $value) { + if ($key !== $expected) { + return true; + } + + $expected++; + } + + return false; + } /** * Fill a model with input data diff --git a/src/Frozennode/Administrator/Fields/Factory.php b/src/Frozennode/Administrator/Fields/Factory.php index ffb2f5bda..4937d8b8c 100644 --- a/src/Frozennode/Administrator/Fields/Factory.php +++ b/src/Frozennode/Administrator/Fields/Factory.php @@ -89,7 +89,7 @@ class Factory { * * @var array */ - protected $editFields; + protected $editFields = []; /** * The edit field objects as arrays diff --git a/src/Frozennode/Administrator/Fields/File.php b/src/Frozennode/Administrator/Fields/File.php index 3cde16662..f73a12f75 100644 --- a/src/Frozennode/Administrator/Fields/File.php +++ b/src/Frozennode/Administrator/Fields/File.php @@ -2,9 +2,16 @@ namespace Frozennode\Administrator\Fields; use Frozennode\Administrator\Includes\Multup; +use Illuminate\Support\Facades\Input; +use Illuminate\Support\Str; +use Symfony\Component\HttpFoundation\File\UploadedFile; +use Illuminate\Support\Facades\File as LaravelFile; class File extends Field { + const NAMING_KEEP = 'keep'; + const RANDOM_DEFAULT_LENGTH = 32; + /** * The specific defaults for subclasses to override * @@ -25,7 +32,6 @@ class File extends Field { */ protected $rules = array( 'location' => 'required|string|directory', - 'naming' => 'in:keep,random', 'length' => 'integer|min:0', 'mimes' => 'string', ); @@ -42,7 +48,18 @@ public function build() $route = $this->config->getType() === 'settings' ? 'admin_settings_file_upload' : 'admin_file_upload'; //set the upload url to the proper route - $this->suppliedOptions['upload_url'] = $url->route($route, array($this->config->getOption('name'), $this->suppliedOptions['field_name'])); + $model = $this->config->getDataModel(); + + $uploadUrl = $url->route( + $route, + array( + 'model' => $this->config->getOption('name'), + 'field' => $this->suppliedOptions['field_name'], + 'id' => $model ? $model->{$model->getKeyName()} : null, + ) + ); + + $this->suppliedOptions['upload_url'] = preg_replace('$([^:])(//)$', '\1/', $uploadUrl); } /** @@ -56,10 +73,74 @@ public function doUpload() //use the multup library to perform the upload $result = Multup::open('file', 'max:' . $this->getOption('size_limit') * 1000 . $mimes, $this->getOption('location'), - $this->getOption('naming') === 'random') - ->set_length($this->getOption('length')) + $this->getFilename()) ->upload(); return $result[0]; } -} \ No newline at end of file + + /** + * @return UploadedFile + */ + protected function getFile() + { + return Input::file('file'); + } + + /** + * @return string + */ + protected function getFileExtension() + { + $file = $this->getFile(); + + return LaravelFile::extension($file->getClientOriginalName()); + } + + /** + * @return null + */ + protected function getFilename() + { + $naming = $this->getOption('naming'); + + if (self::NAMING_KEEP === $naming) { + return $this->getFile()->getClientOriginalName(); + } + + $filename = $this->getCustomFilename(); + + if ($filename) { + return $filename; + } + + return $this->getRandomFileName(); + } + + /** + * @return string|null + */ + protected function getCustomFilename() + { + $naming = $this->getOption('naming'); + + if (!is_callable($naming)) { + return null; + } + + return call_user_func($naming, $this->config->getDataModel(), $this->getFile()); + } + + /** + * @return string + */ + protected function getRandomFilename() + { + $length = self::RANDOM_DEFAULT_LENGTH; + + if (isset($this->suppliedOptions['length'])) { + $length = $this->suppliedOptions['length']; + } + return Str::random($length) . '.' . $this->getFileExtension(); + } +} diff --git a/src/Frozennode/Administrator/Fields/Image.php b/src/Frozennode/Administrator/Fields/Image.php index 214412463..8a142be3a 100644 --- a/src/Frozennode/Administrator/Fields/Image.php +++ b/src/Frozennode/Administrator/Fields/Image.php @@ -32,9 +32,8 @@ public function doUpload() { //use the multup library to perform the upload $result = Multup::open('file', 'image|max:' . $this->getOption('size_limit') * 1000, $this->getOption('location'), - $this->getOption('naming') === 'random') + $this->getFilename()) ->sizes($this->getOption('sizes')) - ->set_length($this->getOption('length')) ->upload(); return $result[0]; diff --git a/src/Frozennode/Administrator/Fields/Relationships/Relationship.php b/src/Frozennode/Administrator/Fields/Relationships/Relationship.php index 3847d40ba..1d9f0b8f2 100644 --- a/src/Frozennode/Administrator/Fields/Relationships/Relationship.php +++ b/src/Frozennode/Administrator/Fields/Relationships/Relationship.php @@ -92,7 +92,7 @@ public function build() */ public function setUpConstraints(&$options) { - $constraints = $this->validator->arrayGet($options, 'constraints'); + $constraints = $this->validator->arrayGet($options, 'constraints') ?: []; $model = $this->config->getDataModel(); //set up and check the constraints @@ -203,4 +203,4 @@ public function getDefaults() return array_merge($defaults, $this->relationshipDefaults); } -} \ No newline at end of file +} diff --git a/src/Frozennode/Administrator/Includes/Multup.php b/src/Frozennode/Administrator/Includes/Multup.php index 2916a6368..c6ef9dd92 100644 --- a/src/Frozennode/Administrator/Includes/Multup.php +++ b/src/Frozennode/Administrator/Includes/Multup.php @@ -3,7 +3,6 @@ use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Validator; -use Illuminate\Support\Facades\File; use Illuminate\Support\Str; //Use Admin\Libraries\Includes\Resize as Resize; @@ -30,9 +29,9 @@ class Multup { private $rules; /* - randomize uploaded filename + uploaded filename */ - private $random; + private $filename; /* path relative to /public/ that the image should be saved in @@ -44,16 +43,6 @@ class Multup { */ private $input; - /* - How long the random filename should be - */ - private $random_length = 32; - - /* - * Callback function for setting your own random filename - */ - private $random_cb; - /* * Sizing information for thumbs to create * array ( width, height, crop_type, path_to_save, quality) @@ -76,12 +65,12 @@ class Multup { * Instantiates the Multup * @param mixed $file The file array provided by Laravel's Input::file('field_name') or a path to a file */ - public function __construct($input, $rules, $path, $random) + public function __construct($input, $rules, $path, $filename) { - $this->input = $input; - $this->rules = $rules; - $this->path = $path; - $this->random = $random; + $this->input = $input; + $this->rules = $rules; + $this->path = $path; + $this->filename = $filename; } /** @@ -90,23 +79,12 @@ public function __construct($input, $rules, $path, $random) * @param string $input name of the file to upload * @param string $rules laravel style validation rules string * @param string $path relative to /public/ to move the images if valid - * @param bool $random Whether or not to randomize the filename, the filename will be set to a 32 character string if true + * @param string $filename filename of the uploaded file. if null, original name is kept * @return Multup */ - public static function open($input, $rules, $path, $random = true) - { - return new Multup( $input, $rules, $path, $random ); - } - - /* - * Set the length of the randomized filename - * @param int $len - */ - public function set_length($len) + public static function open($input, $rules, $path, $filename = null) { - $this->random_length = $len; - - return $this; + return new Multup( $input, $rules, $path, $filename ); } /* @@ -185,35 +163,21 @@ private function upload_image() $errors = array(); $original_name = $this->image[$this->input]->getClientOriginalName(); $path = ''; - $filename = ''; $resizes = ''; if($validation->fails()){ /* use the messages object for the erros */ $errors = implode('. ', $validation->messages()->all()); } else { - - if($this->random){ - if(is_callable($this->random_cb)){ - $filename = call_user_func( $this->random_cb, $original_name ); - } else { - $ext = File::extension($original_name); - $filename = $this->generate_random_filename().'.'.$ext; - } - } else { - $filename = $original_name; - } - /* upload the file */ - $save = $this->image[$this->input]->move($this->path, $filename); - //$save = Input::upload($this->input, $this->path, $filename); + $save = $this->image[$this->input]->move($this->path, $this->filename); if($save){ - $path = $this->path.$filename; + $path = $this->path.$this->filename; if(is_array($this->image_sizes)){ $resizer = new Resize(); - $resizes = $resizer->create($save, $this->path, $filename, $this->image_sizes); + $resizes = $resizer->create($save, $this->path, $this->filename, $this->image_sizes); } } else { @@ -221,27 +185,13 @@ private function upload_image() } } - return compact('errors', 'path', 'filename', 'original_name', 'resizes' ); - } - - /* - * Default random filename generation - */ - private function generate_random_filename() - { - return Str::random($this->random_length); - } - - /* - * Default random filename generation - */ - public function filename_callback( $func ) - { - if(is_callable($func)){ - $this->random_cb = $func; - } - - return $this; + return [ + 'errors' => $errors, + 'path' => $path, + 'filename' => $this->filename, + 'original_name' => $original_name, + 'resizes' => $resizes + ]; } /* diff --git a/src/Frozennode/Administrator/Includes/Resize.php b/src/Frozennode/Administrator/Includes/Resize.php index 4241e9879..12ec55767 100644 --- a/src/Frozennode/Administrator/Includes/Resize.php +++ b/src/Frozennode/Administrator/Includes/Resize.php @@ -68,7 +68,6 @@ public function create($file, $path, $filename, $sizes ){ $resized = array(); foreach($sizes as $size){ - $this->new_width = $size[0]; //$new_width; $this->new_height = $size[1]; //$new_height; $this->option = $size[2]; //crop type @@ -79,7 +78,22 @@ public function create($file, $path, $filename, $sizes ){ mkdir($size[3]); } - $resized[] = $this->do_resize( $path.$filename, $size[3].$filename, $size[4] ); + $filePath = $size[3] . $filename; + $extension = $extension = strtolower(File::extension($filePath)); + $newFilePath = $size[3] . $filename; + + if (isset($size[5])) { + $extension = $size[5]; + $pathInfo = pathinfo($filename); + $newFilePath = $size[3] . $pathInfo['filename'] . '.' . $extension; + } + + $resized[] = $this->do_resize( + $path.$filename, + $newFilePath, + $size[4], + $extension + ); } } @@ -89,17 +103,27 @@ public function create($file, $path, $filename, $sizes ){ /** * Resizes and/or crops an image * @param mixed $image resource or filepath - * @param strung $save_path where to save the resized image + * @param string $save_path where to save the resized image * @param int (0-100) $quality + * @param string|null $extension * @return bool */ - private function do_resize( $image, $save_path, $image_quality ) + private function do_resize($image, $save_path, $image_quality, $extension) { $image = $this->open_image( $image ); $this->width = imagesx( $image ); $this->height = imagesy( $image ); + + if (!$this->new_height) { + $this->new_height = $this->height / $this->width * $this->new_width; + } + + if (!$this->new_width) { + $this->new_width = $this->width / $this->height * $this->new_height; + } + // Get optimal width and height - based on $option. $option_array = $this->get_dimensions( $this->new_width , $this->new_height , $this->option ); @@ -122,9 +146,6 @@ private function do_resize( $image, $save_path, $image_quality ) $this->crop( $optimal_width , $optimal_height , $this->new_width , $this->new_height ); } - // Get extension of the output file - $extension = strtolower( File::extension($save_path) ); - // Create and save an image based on it's extension switch( $extension ) { diff --git a/src/config/administrator.php b/src/config/administrator.php index 888dab320..254f0e281 100644 --- a/src/config/administrator.php +++ b/src/config/administrator.php @@ -101,11 +101,12 @@ 'home_page' => '', /** - * The route to which the user will be taken when they click the "back to site" button + * The route to which the user will be taken when they click the "back to site" button. + * Set to null, if no button should be displayed. * * @type string */ - 'back_to_site_path' => '/', + 'back_to_site_path' => null, /** * The login path is the path where Administrator will send the user if they fail a permission check diff --git a/src/controllers/AdminController.php b/src/controllers/AdminController.php index f069dd496..bf52b6bfd 100644 --- a/src/controllers/AdminController.php +++ b/src/controllers/AdminController.php @@ -125,7 +125,7 @@ public function save($modelName, $id = false) $config = app('itemconfig'); $fieldFactory = app('admin_field_factory'); $actionFactory = app('admin_action_factory'); - + if (array_key_exists('form_request', $config->getOptions()) && $this->formRequestErrors !== null) { return response()->json(array( 'success' => false, @@ -451,11 +451,41 @@ public function displayFile() * * @return JSON */ - public function fileUpload($modelName, $fieldName) + public function fileUpload($modelName, $fieldName, $id = false) { - $fieldFactory = app('admin_field_factory'); + $config = app('itemconfig'); + $columnFactory = app('admin_column_factory'); + $fieldFactory = app('admin_field_factory'); + $fields = $fieldFactory->getEditFields(); + $model = $config->getModel($id, $fields, $columnFactory->getIncludedColumns($fields)); + + if ($model) { + $config->setDataModel($model); + } + + return $this->executeFileUpload($fieldName); + } + + /** + * @param string $modelName + * @param string $fieldName + * + * @return JSON + */ + public function settingsFileUpload($modelName, $fieldName) + { + return $this->executeFileUpload($fieldName); + } + /** + * @param string $fieldName + * + * @return JSON + */ + protected function executeFileUpload($fieldName) + { //get the model and the field object + $fieldFactory = app('admin_field_factory'); $field = $fieldFactory->findField($fieldName); return response()->JSON($field->doUpload()); diff --git a/src/routes.php b/src/routes.php index dcd6b9332..c8c64f95c 100644 --- a/src/routes.php +++ b/src/routes.php @@ -2,19 +2,10 @@ use Illuminate\Support\Facades\Route; -/** - * Temperary solution for middleware in routes - * TODO: remove in favor of setting the config for middleware outside of the routes file - */ -$middleware_array = array('Frozennode\Administrator\Http\Middleware\ValidateAdmin'); -if(is_array(config('administrator.middleware'))) { - $middleware_array = array_merge(config('administrator.middleware'), $middleware_array); -} - /** * Routes */ -Route::group(array('domain' => config('administrator.domain'), 'prefix' => config('administrator.uri'), 'middleware' => $middleware_array), function() +Route::group(array('domain' => config('administrator.domain'), 'prefix' => config('administrator.uri'), 'middleware' => 'Frozennode\Administrator\Http\Middleware\ValidateAdmin'), function() { //Admin Dashboard Route::get('/', array( diff --git a/src/views/layouts/default.blade.php b/src/views/layouts/default.blade.php index ee2c27bb0..4d05d7895 100644 --- a/src/views/layouts/default.blade.php +++ b/src/views/layouts/default.blade.php @@ -5,6 +5,8 @@ {{ config('administrator.title') }} + + @foreach ($css as $url) @endforeach diff --git a/src/views/partials/header.blade.php b/src/views/partials/header.blade.php index af31c10c4..1ef615980 100644 --- a/src/views/partials/header.blade.php +++ b/src/views/partials/header.blade.php @@ -1,7 +1,9 @@
-

- {{config('administrator.title')}} -

+ @if (config('administrator.title')) +

+ {{config('administrator.title')}} +

+ @endif
@@ -38,9 +40,11 @@ @endif - {{trans('administrator::administrator.backtosite')}} + @if(config('administrator.back_to_site_path')) + {{trans('administrator::administrator.backtosite')}} + @endif @if(config('administrator.logout_path')) {{trans('administrator::administrator.logout')}} @endif -
\ No newline at end of file + diff --git a/src/views/settings.php b/src/views/settings.php index 077e923ba..6721c3216 100644 --- a/src/views/settings.php +++ b/src/views/settings.php @@ -3,7 +3,7 @@