add chosen to forms

This commit is contained in:
Sanj 2012-05-15 03:00:54 +05:30
parent 7a74dfff43
commit 7f51b19f89
8 changed files with 629 additions and 0 deletions

10
itf/static/js/chosen.jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,149 @@
/* ------------------------------------------------------------------------------
UNI-FORM BLUE by DRAGAN BABIC (v2) | Wed, 31 Mar 10
------------------------------------------------------------------------------
Copyright (c) 2010, Dragan Babic
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------ */
.uniForm{ background: #dde8ec; }
.uniForm legend{ font-weight: bold; font-size: 100%; margin: 0; padding: 1.5em 0; }
.uniForm .ctrlHolder{ padding: 1em; border-bottom: 1px solid #c4ced1; }
.uniForm .ctrlHolder.focused{ background: #e1f0f6; }
.uniForm .buttonHolder{ background: #c4ced1; text-align: right; margin: 1.5em 0 0 0; padding: 1.5em;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm .buttonHolder .primaryAction{ padding: 10px 22px; line-height: 1; background: #254a86; border: 1px solid #163362; font-size: 12px; font-weight: bold; color: #fff;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
box-shadow: 1px 1px 0 #d5e2e7;
-webkit-box-shadow: 1px 1px 0 #d5e2e7;
-moz-box-shadow: 1px 1px 0 #d5e2e7;
text-shadow: -1px -1px 0 rgba(0,0,0,.25);
}
.uniForm .buttonHolder .primaryAction:active{ position: relative; top: 1px; }
.uniForm .secondaryAction { text-align: left; }
.uniForm button.secondaryAction { background: transparent; border: none; color: #777; margin: 1.25em 0 0 0; padding: 0; }
.uniForm .inlineLabels label em,
.uniForm .inlineLabels .label em{ font-style: normal; font-weight: bold; }
.uniForm label small{ font-size: .75em; color: #777; }
.uniForm .textInput,
.uniForm textarea { padding: 4px 2px; border: 1px solid #b2babe; background: #fff;
/* CSS3 */
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-o-border-radius: 3px;
-khtml-border-radius: 3px;
}
.uniForm textarea { height: 12em; }
.uniForm .ctrlHolder ul li label{ font-size: .85em; }
/* Get rid of the 'glow' effect in WebKit, optional */
.uniForm .ctrlHolder .textInput:focus,
.uniForm .ctrlHolder textarea:focus{ outline: none; }
.uniForm .formHint { font-size: .85em; color: #777; }
.uniForm .inlineLabels .formHint { padding-top: .5em; }
.uniForm .ctrlHolder.focused .formHint{ color: #333; }
/* ----------------------------------------------------------------------------- */
/* ############################### Messages #################################### */
/* ----------------------------------------------------------------------------- */
/* Error message at the top of the form */
.uniForm #errorMsg{ background: #c20f2e; color: #fff; margin: 0 0 1.5em 0; padding: 1px 1.5em;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
box-shadow: 0 0 14px rgba(0,0,0,.25);
-webkit-box-shadow: 0 0 14px rgba(0,0,0,.25);
-moz-box-shadow: 0 0 14px rgba(0,0,0,.25);
}
.uniForm #errorMsg ol{ margin: 0 0 1.5em 0; padding: 0; }
.uniForm #errorMsg ol li{ margin: 0 0 3px 1.5em; padding: 7px; background: #a20d27; position: relative; font-size: .85em;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm .ctrlHolder.error,
.uniForm .ctrlHolder.focused.error{ color: #c20f2e;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm .ctrlHolder.error input.error,
.uniForm .ctrlHolder.error select.error,
.uniForm .ctrlHolder.error textarea.error{ border-color: #c20f2e; }
/* Success messages at the top of the form */
.uniForm #okMsg{ background: #59a20e; color: #343434; margin: 0 0 1.5em 0; padding: 1.5em; text-align: center;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
box-shadow: 0 0 14px rgba(0,0,0,.25);
-webkit-box-shadow: 0 0 14px rgba(0,0,0,.25);
-moz-box-shadow: 0 0 14px rgba(0,0,0,.25);
text-shadow: 1px 1px 0 rgba(255,255,255,.25);
}
.uniForm #okMsg p{ margin: 0; }
/* ----------------------------------------------------------------------------- */
/* ############################### Columns ##################################### */
/* ----------------------------------------------------------------------------- */
.uniForm .col{ margin-bottom: 1.5em; }
/* Use .first and .last classes to control the layout/spacing of your columns */
.uniForm .col.first{ width: 49%; float: left; clear: none; }
.uniForm .col.last { width: 49%; float: right; clear: none; margin-right: 0; }

View File

@ -0,0 +1,137 @@
/* ------------------------------------------------------------------------------
UNI-FORM DARK by DRAGAN BABIC (v2) | Wed, 31 Mar 10
------------------------------------------------------------------------------
Copyright (c) 2010, Dragan Babic
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------ */
.uniForm{ background: #343434; color: #ccc; }
.uniForm legend{ font-weight: bold; font-size: 100%; margin: 0; padding: 1.5em 0; }
.uniForm .ctrlHolder{ padding: 1em; border-bottom: 1px solid #232323; }
.uniForm .ctrlHolder.focused{ background: #232323; }
.uniForm .buttonHolder{ background: #232323; text-align: right; margin: 1.5em 0 0 0; padding: 1.5em;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm .buttonHolder .primaryAction{ padding: 10px 22px; line-height: 1; background: #59a20e; border: 1px solid #232323; font-size: 12px; font-weight: bold; color: #fff;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
box-shadow: 1px 1px 0 #232323;
-webkit-box-shadow: 1px 1px 0 #232323;
-moz-box-shadow: 1px 1px 0 #232323;
text-shadow: -1px -1px 0 rgba(0,0,0,.25);
}
.uniForm .buttonHolder .primaryAction:active{ position: relative; top: 1px; }
.uniForm .secondaryAction { text-align: left; }
.uniForm button.secondaryAction { background: transparent; border: none; color: #777; margin: 1.25em 0 0 0; padding: 0; }
.uniForm .inlineLabels label em,
.uniForm .inlineLabels .label em{ font-style: normal; font-weight: bold; }
.uniForm label small{ font-size: .75em; color: #777; }
.uniForm .textInput,
.uniForm textarea { padding: 4px 2px; border: 1px solid #232323; background: #555; color: #dfdfdf; }
.uniForm textarea { height: 12em; }
.uniForm .textInput:focused,
.uniForm textarea:focused{ border-color: #fff; }
/* Get rid of the 'glow' effect in WebKit, optional */
.uniForm .ctrlHolder .textInput:focus,
.uniForm .ctrlHolder textarea:focus{ outline: none; }
.uniForm .formHint { font-size: .85em; color: #777; }
.uniForm .inlineLabels .formHint { padding-top: .5em; }
.uniForm .ctrlHolder.focused .formHint{ color: #fff; }
/* ----------------------------------------------------------------------------- */
/* ############################### Messages #################################### */
/* ----------------------------------------------------------------------------- */
/* Error message at the top of the form */
.uniForm #errorMsg{ background: #c20f2e; border: 1px solid #232323; color: #fff; margin: 0 0 1.5em 0; padding: 0 1.5em;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm #errorMsg ol{ margin: 0 0 1.5em 0; padding: 0; }
.uniForm #errorMsg ol li{ margin: 0 0 3px 1.5em; padding: 7px; background: #a20d27; position: relative; font-size: .85em;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm .ctrlHolder.error,
.uniForm .ctrlHolder.focused.error{ background: #c20f2e; border: 1px solid #232323; color: #fff;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm .ctrlHolder.error input.error,
.uniForm .ctrlHolder.error select.error,
.uniForm .ctrlHolder.error textarea.error{ color: #af4c4c; margin: 0 0 6px 0; padding: 4px; background: #ffbfbf; }
.uniForm .ctrlHolder.error .formHint{ color: #fff; }
/* Success messages at the top of the form */
.uniForm #okMsg{ background: #59a20e; border: 1px solid #232323; color: #fff; margin: 0 0 1.5em 0; padding: 1.5em; text-align: center;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm #okMsg p{ margin: 0; }
/* ----------------------------------------------------------------------------- */
/* ############################### Columns ##################################### */
/* ----------------------------------------------------------------------------- */
.uniForm .col{ margin-bottom: 1.5em; }
/* Use .first and .last classes to control the layout/spacing of your columns */
.uniForm .col.first{ width: 49%; float: left; clear: none; }
.uniForm .col.last { width: 49%; float: right; clear: none; margin-right: 0; }

View File

@ -0,0 +1,153 @@
/* ------------------------------------------------------------------------------
UNI-FORM DEFAULT by DRAGAN BABIC (v2) | Wed, 31 Mar 10
------------------------------------------------------------------------------
Copyright (c) 2010, Dragan Babic
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------ */
.uniForm{}
.uniForm legend{ font-weight: bold; font-size: 100%; margin: 0; padding: 1.5em 0; }
.uniForm .ctrlHolder{ padding: 1em; border-bottom: 1px solid #efefef; }
.uniForm .ctrlHolder.focused{ background: #fffcdf; }
.uniForm .inlineLabels .noLabel{}
.uniForm .buttonHolder{ background: #efefef; text-align: right; margin: 1.5em 0 0 0; padding: 1.5em;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm .buttonHolder .primaryAction{ padding: 10px 22px; line-height: 1; background: #254a86; border: 1px solid #163362; font-size: 12px; font-weight: bold; color: #fff;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
box-shadow: 1px 1px 0 #fff;
-webkit-box-shadow: 1px 1px 0 #fff;
-moz-box-shadow: 1px 1px 0 #fff;
text-shadow: -1px -1px 0 rgba(0,0,0,.25);
}
.uniForm .buttonHolder .primaryAction:active{ position: relative; top: 1px; }
.uniForm .secondaryAction { text-align: left; }
.uniForm button.secondaryAction { background: transparent; border: none; color: #777; margin: 1.25em 0 0 0; padding: 0; }
.uniForm .inlineLabels label em,
.uniForm .inlineLabels .label em{ font-style: normal; font-weight: bold; }
.uniForm label small{ font-size: .75em; color: #777; }
.uniForm .textInput,
.uniForm textarea { padding: 4px 2px; border: 1px solid #aaa; background: #fff; }
.uniForm textarea { height: 12em; }
.uniForm select {}
.uniForm .fileUpload {}
.uniForm ul{}
.uniForm li{}
.uniForm ul li label{ font-size: .85em; }
.uniForm .small {}
.uniForm .medium{}
.uniForm .large {} /* Large is default and should match the value you set for .textInput, textarea or select */
.uniForm .auto {}
.uniForm .small,
.uniForm .medium,
.uniForm .auto{}
/* Get rid of the 'glow' effect in WebKit, optional */
.uniForm .ctrlHolder .textInput:focus,
.uniForm .ctrlHolder textarea:focus{ outline: none; }
.uniForm .formHint { font-size: .85em; color: #777; }
.uniForm .inlineLabels .formHint { padding-top: .5em; }
.uniForm .ctrlHolder.focused .formHint{ color: #333; }
/* ----------------------------------------------------------------------------- */
/* ############################### Messages #################################### */
/* ----------------------------------------------------------------------------- */
/* Error message at the top of the form */
.uniForm #errorMsg{ background: #ffdfdf; border: 1px solid #f3afb5; margin: 0 0 1.5em 0; padding: 0 1.5em;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm #errorMsg h3{} /* Feel free to use a heading level suitable to your page structure */
.uniForm #errorMsg ol{ margin: 0 0 1.5em 0; padding: 0; }
.uniForm #errorMsg ol li{ margin: 0 0 3px 1.5em; padding: 7px; background: #f6bec1; position: relative; font-size: .85em;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm .ctrlHolder.error,
.uniForm .ctrlHolder.focused.error{ background: #ffdfdf; border: 1px solid #f3afb5;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm .ctrlHolder.error input.error,
.uniForm .ctrlHolder.error select.error,
.uniForm .ctrlHolder.error textarea.error{ color: #af4c4c; margin: 0 0 6px 0; padding: 4px; }
/* Success messages at the top of the form */
.uniForm #okMsg{ background: #c8ffbf; border: 1px solid #a2ef95; margin: 0 0 1.5em 0; padding: 1.5em; text-align: center;
/* CSS3 */
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-khtml-border-radius: 4px;
}
.uniForm #okMsg p{ margin: 0; }
/* ----------------------------------------------------------------------------- */
/* ############################### Columns ##################################### */
/* ----------------------------------------------------------------------------- */
.uniForm .col{}
.uniForm .col.first{}
.uniForm .col.last{}
.uniForm .col{ margin-bottom: 1.5em; }
/* Use .first and .last classes to control the layout/spacing of your columns */
.uniForm .col.first{ width: 49%; float: left; clear: none; }
.uniForm .col.last { width: 49%; float: right; clear: none; margin-right: 0; }

1
itf/static/uni_form/jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,164 @@
/* ------------------------------------------------------------------------------
Copyright (c) 2010, Dragan Babic
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------ */
/* ############################# GENERALS ################################### */
/* ------------------------------------------------------------------------------ */
.uniForm{ margin: 0; padding: 0; position: relative; z-index: 1; } /* reset stuff */
/* Some generals and more resets */
.uniForm fieldset{ border: none; margin: 0; padding: 0; }
.uniForm fieldset legend{ margin: 0; padding: 0; }
/* This are the main units that contain form elements */
.uniForm .ctrlHolder,
.uniForm .buttonHolder{ margin: 0; padding: 0; clear: both; }
/* Clear all floats */
.uniForm:after,
.uniForm .buttonHolder:after,
.uniForm .ctrlHolder:after,
.uniForm .ctrlHolder .multiField:after,
.uniForm .inlineLabel:after{ content: "."; display: block; height: 0; line-height: 0; font-size: 0; clear: both; min-height: 0; visibility: hidden; }
.uniForm label,
.uniForm button{ cursor: pointer; }
/* ------------------------------------------------------------------------------ */
/* ########################## DEFAULT LAYOUT ################################ */
/* ------------------------------------------------------------------------------ */
/* Styles for form controls where labels are above the input elements */
/* ------------------------------------------------------------------------------ */
.uniForm label,
.uniForm .label{ display: block; float: none; margin: 0 0 .5em 0; padding: 0; line-height: 100%; width: auto; }
/* Float the input elements */
.uniForm .textInput,
.uniForm .fileUpload,
.uniForm .selectInput,
.uniForm select,
.uniForm textarea{ float: left; width: 53%; margin: 0; }
/* Read-Only output */
.uniForm .readOnlyLabel{ margin: 0; font-size: 1em; font-weight: bold; }
.uniForm .readOnly{ font-size: .85em; }
.uniForm .readOnly .choiceLabel{ color: #777; text-transform: uppercase; font-size: .75em; letter-spacing: .15em; }
/* Postition the hints */
.uniForm .formHint{ float: right; width: 43%; margin: 0; clear: none; }
/* Position the elements inside combo boxes (multiple inputs/selects/checkboxes/radio buttons per unit) */
.uniForm ul{ float: left; width: 53%; margin: 0; padding: 0; }
.uniForm ul li{ margin: 0 0 .5em 0; list-style: none; }
.uniForm ul li label{ margin: 0; float: none; display: block; overflow: visible; }
/* Alternate layout */
.uniForm ul.alternate li{ float: left; width: 30%; margin-right: 3%; }
.uniForm ul.alternate li label{ float: none; display: block; width: 98%; }
.uniForm ul .textInput,
.uniForm ul .selectInput,
.uniForm ul select,
.uniForm ul.alternate .textInput,
.uniForm ul.alternate .selectInput,
.uniForm ul.alternate select{ width: 98%; margin-top: .5em; display: block; float: none; }
/* Required fields asterisk styling */
.uniForm label em,
.uniForm .label em{ float: left; width: 1em; margin: 0 0 0 -1em; }
/* ------------------------------------------------------------------------------ */
/* ######################### ALTERNATE LAYOUT ############################### */
/* ------------------------------------------------------------------------------ */
/* Styles for form controls where labels are in line with the input elements */
/* Set the class of the parent (preferably to a fieldset) to .inlineLabels */
/* ------------------------------------------------------------------------------ */
.uniForm .inlineLabels label,
.uniForm .inlineLabels .label,
.uniForm .inlineLabels .readOnlyLabel{ float: left; margin: .3em 2% 0 0; padding: 0; line-height: 1; position: relative; width: 32%; }
.uniForm .inlineLabels .readOnlyLabel{ margin: 0; }
/* Float the input elements */
.uniForm .inlineLabels .textInput,
.uniForm .inlineLabels .fileUpload,
.uniForm .inlineLabels .selectInput,
.uniForm .inlineLabels select,
.uniForm .inlineLabels textarea{ float: left; width: 64%; }
/* Postition the hints */
.uniForm .inlineLabels .formHint{ clear: both; float: none; width: auto; margin-left: 34%; position: static; }
/* Position the elements inside combo boxes (multiple inputs/selects/checkboxes/radio buttons per unit) */
.uniForm .inlineLabels ul{ float: left; width: 66%; }
.uniForm .inlineLabels ul li{ margin: .5em 0; }
.uniForm .inlineLabels ul li label{ float: none; display: block; width: 100%; }
/* Alternate layout */
.uniForm .inlineLabels ul.alternate li{ margin-right: 3%; margin-top: .25em; }
.uniForm .inlineLabels ul li label .textInput,
.uniForm .inlineLabels ul li label textarea,
.uniForm .inlineLabels ul li label select{ float: none; display: block; width: 98%; }
.uniForm .inlineLabels .readOnly{ float: right; width: 66%; }
/* Required fields asterisk styling */
.uniForm .inlineLabels label em,
.uniForm .inlineLabels .label em{ display: block; float: none; margin: 0; position: absolute; right: 0; }
/* ----------------------------------------------------------------------------- */
/* ########################### Additional Stuff ################################ */
/* ----------------------------------------------------------------------------- */
/* Generals */
.uniForm legend{ color: inherit; }
.uniForm .secondaryAction{ float: left; }
/* .inlineLabel is used for inputs within labels - checkboxes and radio buttons */
.uniForm .inlineLabel input,
.uniForm .inlineLabels .inlineLabel input,
.uniForm .blockLabels .inlineLabel input,
/* class .inlineLabel is depreciated */
.uniForm label input{ float: none; display: inline; margin: 0; padding: 0; border: none; }
.uniForm .buttonHolder .inlineLabel,
.uniForm .buttonHolder label{ float: left; margin: .5em 0 0 0; width: auto; max-width: 60%; text-align: left; }
/* When you don't want to use a label */
.uniForm .inlineLabels .noLabel ul{ margin-left: 34%; /* Match to width of label + gap to field */ }
/* Classes for control of the widths of the fields */
.uniForm .small { width: 30% !important; }
.uniForm .medium{ width: 45% !important; }
.uniForm .large { } /* Large is default and should match the value you set for .textInput, textarea or select */
.uniForm .auto { width: auto !important; height: auto !important; }
.uniForm .small,
.uniForm .medium,
.uniForm .auto{ margin-right: 4px; }
/* Columns */
.uniForm .col{ float: left; }
.uniForm .col{ width: 50%; }

View File

@ -0,0 +1,11 @@
/**
* Uni-Form jQuery Plugin without Validation
*
* @see http://sprawsm.com/uni-form/
* @license MIT http://www.opensource.org/licenses/mit-license.php
*/
jQuery.fn.uniform=function(settings){settings=jQuery.extend({valid_class:'valid',invalid_class:'invalid',error_class:'error',focused_class:'focused',holder_class:'ctrlHolder',field_selector:'input, textarea, select',default_value_color:"#AFAFAF"},settings);return this.each(function(){var form=jQuery(this),validate=function($input,valid,text){var $p=$input.closest('div.'+settings.holder_class).andSelf().toggleClass(settings.invalid_class,!valid).toggleClass(settings.error_class,!valid).toggleClass(settings.valid_class,valid).find('p.formHint');if(!valid&&!$p.data('info-text')){$p.data('info-text',$p.html());}else if(valid){text=$p.data('info-text');}
if(text){$p.html(text);}};form.submit(function(){form.find(settings.field_selector).each(function(){if($(this).val()==$(this).data('default-value'))$(this).val("");});})
form.find(settings.field_selector).each(function(){var $input=$(this),value=$input.val();$input.data('default-color',$input.css('color'));if(value==$input.data('default-value')||!value){$input.not('select').css("color",settings.default_value_color);$input.val($input.data('default-value'));}})
form.delegate(settings.field_selector,'focus',function(){form.find('.'+settings.focused_class).removeClass(settings.focused_class);var $input=$(this);$input.parents().filter('.'+settings.holder_class+':first').addClass(settings.focused_class);if($input.val()==$input.data('default-value')){$input.val("");}
$input.not('select').css('color',$input.data('default-color'));});form.delegate(settings.field_selector,'blur',function(){var $input=$(this);form.find('.'+settings.focused_class).removeClass(settings.focused_class);if($input.val()==""||$input.val()==$input.data('default-value')){$input.not('select').css("color",settings.default_value_color);$input.val($input.data('default-value'));}else{$input.css('color',$input.data('default-color'));}});form.delegate(settings.field_selector,'error',function(e,text){validate($(this),false,text);});form.delegate(settings.field_selector,'success',function(e,text){validate($(this),true);});});};

View File

@ -7,11 +7,15 @@
<!-- note that there's also blue.uni-form.css and dark.uni-form.css available if you want to try changing defaults up --> <!-- note that there's also blue.uni-form.css and dark.uni-form.css available if you want to try changing defaults up -->
<link rel="stylesheet" href="/static/uni_form/uni-form.css" type="text/css" /> <link rel="stylesheet" href="/static/uni_form/uni-form.css" type="text/css" />
<link rel="stylesheet" href="/static/uni_form/default.uni-form.css" type="text/css" /> <link rel="stylesheet" href="/static/uni_form/default.uni-form.css" type="text/css" />
<link rel="stylesheet" href="/static/css/chosen.css" />
<!-- uni-form JS library, optional --> <!-- uni-form JS library, optional -->
<script src="/static/uni_form/uni-form.jquery.js" type="text/javascript"></script> <script src="/static/uni_form/uni-form.jquery.js" type="text/javascript"></script>
<script src="/static/js/chosen.jquery.min.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$('form.uniForm').uniform(); $('form.uniForm').uniform();
$('select').chosen();
}); });
</script> </script>
{% endblock %} {% endblock %}