Skip to content

Commit

Permalink
Merge pull request #1156 from WaYdotNET/final-admin
Browse files Browse the repository at this point in the history
Custom error - I18n these!
  • Loading branch information
Darío Javier Cravero committed Mar 20, 2013
2 parents d9ece42 + d39e566 commit 318eea3
Show file tree
Hide file tree
Showing 45 changed files with 415 additions and 143 deletions.
18 changes: 18 additions & 0 deletions padrino-admin/lib/padrino-admin/bootstrap-less/alerts.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
hr {
border-top-color: darken(@state-warning-border, 5%);
}
// Inherit color for immediate links and bolden them some
> a,
> p > a {
font-weight: 500;
color: darken(@state-warning-text, 10%);
}
}

// Adjust close link position
Expand All @@ -45,6 +51,10 @@
hr {
border-top-color: darken(@state-success-border, 5%);
}
> a,
> p > a {
color: darken(@state-success-text, 10%);
}
}
.alert-danger,
.alert-error {
Expand All @@ -54,6 +64,10 @@
hr {
border-top-color: darken(@state-error-border, 5%);
}
> a,
> p > a {
color: darken(@state-error-text, 10%);
}
}
.alert-info {
background-color: @state-info-background;
Expand All @@ -62,6 +76,10 @@
hr {
border-top-color: darken(@state-info-border, 5%);
}
> a,
> p > a {
color: darken(@state-info-text, 10%);
}
}

// Block alerts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
.btn-group-vertical > .btn {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.btn-group-vertical .btn:first-child {
Expand Down Expand Up @@ -156,3 +157,10 @@
width: 1%;
}
}


// Checkbox and radio options
.btn-group[data-toggle="buttons-radio"] > .btn > input[type="radio"],
.btn-group[data-toggle="buttons-checkbox"] > .btn > input[type="checkbox"] {
display: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
&[disabled],
fieldset[disabled] & {
cursor: default;
pointer-events: none; // Future-proof disabling of clicks
.opacity(.65);
.box-shadow(none);
}
Expand Down
2 changes: 1 addition & 1 deletion padrino-admin/lib/padrino-admin/bootstrap-less/code.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
code,
pre {
padding: 0 3px 2px;
#font > #family > .monospace;
font-family: @font-family-monospace;
font-size: (@font-size-base - 2);
color: @grayDark;
border-radius: 4px;
Expand Down
114 changes: 55 additions & 59 deletions padrino-admin/lib/padrino-admin/bootstrap-less/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -79,63 +79,6 @@
}


// FONTS
// --------------------------------------------------

#font {
#family {
.serif() {
font-family: @font-family-serif;
}
.sans-serif() {
font-family: @font-family-sans-serif;
}
.monospace() {
font-family: @font-family-monospace;
}
}
.shorthand(@size: @font-size-base, @weight: normal, @lineHeight: @line-height-base) {
font-size: @size;
font-weight: @weight;
line-height: @lineHeight;
}
.serif(@size: @font-size-base, @weight: normal, @lineHeight: @line-height-base) {
#font > #family > .serif;
#font > .shorthand(@size, @weight, @lineHeight);
}
.sans-serif(@size: @font-size-base, @weight: normal, @lineHeight: @line-height-base) {
#font > #family > .sans-serif;
#font > .shorthand(@size, @weight, @lineHeight);
}
.monospace(@size: @font-size-base, @weight: normal, @lineHeight: @line-height-base) {
#font > #family > .monospace;
#font > .shorthand(@size, @weight, @lineHeight);
}
}


// FORMS
// --------------------------------------------------

.formFieldState(@text-color: #555, @border-color: #ccc, @background-color: #f5f5f5) {
// Color the label text
.control-label {
color: @text-color;
}
// Set the border and box shadow on specific inputs to match
.input-with-feedback {
padding-right: 32px; // to account for the feedback icon
border-color: @border-color;
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
&:focus {
border-color: darken(@border-color, 10%);
@shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
.box-shadow(@shadow);
}
}
}



// CSS3 PROPERTIES
// --------------------------------------------------
Expand Down Expand Up @@ -376,6 +319,25 @@
}


// RETINA IMAGE SUPPORT
// --------------------------------------------------

// Short retina mixin for setting background-image and -size
.retina-image(@file-1x, @file-2x, @width-1x, @height-1x) {
background-image: url("@{file-1x}");

@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
background-image: url("@{file-2x}");
background-size: @width-1x @height-1x;
}
}


// COMPONENT MIXINS
// --------------------------------------------------
Expand All @@ -401,7 +363,8 @@

&:hover,
&:focus,
&:active {
&:active,
&.active {
background-color: darken(@background, 5%);
border-color: darken(@border, 10%);
}
Expand All @@ -411,7 +374,8 @@
fieldset[disabled] & {
&:hover,
&:focus,
&:active {
&:active,
&.active {
background-color: @background;
border-color: @border
}
Expand Down Expand Up @@ -532,3 +496,35 @@
.pushX(@grid-columns);
.pullX(@grid-columns);
}



// Framework mixins
// --------------------------------------------------

// Generate rem font-sizes with pixel fallbacks
// By default uses `@font-size-base` with an initial value of 14 (1.4rem or 14px)
.font-size(@font-size: @font-size-base) {
@rem-size: (@font-size / 10);
font-size: ~"@{font-size}px";
font-size: ~"@{rem-size}rem";
}

// Generate form validation states
.formFieldState(@text-color: #555, @border-color: #ccc, @background-color: #f5f5f5) {
// Color the label text
.control-label {
color: @text-color;
}
// Set the border and box shadow on specific inputs to match
.input-with-feedback {
padding-right: 32px; // to account for the feedback icon
border-color: @border-color;
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
&:focus {
border-color: darken(@border-color, 10%);
@shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
.box-shadow(@shadow);
}
}
}
5 changes: 5 additions & 0 deletions padrino-admin/lib/padrino-admin/bootstrap-less/print.less
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,9 @@
h3 {
page-break-after: avoid;
}

// Bootstrap components
.navbar-toggle {
display: none;
}
}
11 changes: 2 additions & 9 deletions padrino-admin/lib/padrino-admin/bootstrap-less/scaffolding.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
// -------------------------

* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
.box-sizing(border-box);
}


Expand All @@ -32,12 +30,7 @@ html {
}

body {
margin: 0;
color: @text-color;
font-family: @font-family-base;
font-size: 14px;
font-size: 1.4rem;
line-height: 1.5;
background-color: @body-background;
}

Expand All @@ -48,7 +41,7 @@ button,
select,
textarea {
font-family: @font-family-base;
font-size: @font-size-base;
.font-size();
line-height: @line-height-base;
}

Expand Down
12 changes: 12 additions & 0 deletions padrino-admin/lib/padrino-admin/bootstrap-less/tables.less
Original file line number Diff line number Diff line change
Expand Up @@ -194,25 +194,37 @@ table th[class^="span"] {
// Exact selectors below required to override .table-striped

.table > tbody > tr {
> td.success,
> th.success,
&.success > td {
background-color: @state-success-background;
}
> td.error,
> th.error,
&.error > td {
background-color: @state-error-background;
}
> td.warning,
> th.warning,
&.warning > td {
background-color: @state-warning-background;
}
}

// Hover states for .table-hover
.table-hover > tbody > tr {
> td.success:hover,
> th.success:hover,
&.success:hover > td {
background-color: darken(@state-success-background, 5%);
}
> td.error:hover,
> th.error:hover,
&.error:hover > td {
background-color: darken(@state-error-background, 5%);
}
> td.warning:hover,
> th.warning:hover,
&.warning:hover > td {
background-color: darken(@state-warning-background, 5%);
}
Expand Down
2 changes: 1 addition & 1 deletion padrino-admin/lib/padrino-admin/bootstrap-less/type.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ p {
}
.lead {
margin-bottom: @line-height-base;
font-size: (@font-size-base * 1.5);
.font-size((@font-size-base * 1.5));
font-weight: 200;
line-height: 1.25;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@font-family-monospace: Monaco, Menlo, Consolas, "Courier New", monospace;
@font-family-base: @font-family-sans-serif;

@font-size-base: 14px;
@font-size-base: 14;
@font-size-large: (@font-size-base * 1.25); // ~18px
@font-size-small: (@font-size-base * 0.85); // ~12px
@font-size-mini: (@font-size-base * 0.75); // ~11px
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ footer p {
border-bottom: 1px solid #e5e5e5;
padding : 30px 0;
}
.custom-error-body i{
color: #c43c35;
}
.custom-error-go-back {
font-size: 1.2em;
padding: 6px 24px;
Expand Down
Loading

0 comments on commit 318eea3

Please sign in to comment.