freeipa/install/ui/less/forms-override.less
Petr Vobornik 0d05a50e19 webui: field and widget binding refactoring
This is a Web UI wide change. Fields and Widgets binding was refactored
to enable proper two-way binding between them. This should allow to have
one source of truth (field) for multiple consumers - widgets or something
else. One of the goal is to have fields and widget implementations
independent on each other. So that one could use a widget without field
or use one field for multiple widgets, etc..

Basically a fields logic was split into separate components:
- adapters
- parsers & formatters
- binder

Adapters
- extract data from data source (FreeIPA RPC command result)
- prepares them for commands.

Parsers
- parse extracted data to format expected by field
- parse widget value to format expected by field

Formatters
- format field value to format suitable for widgets
- format field value to format suitable for adapter

Binder
- is a communication bridge between field and widget
- listens to field's and widget's events and call appropriate methods

Some side benefits:
- better validation reporting in multivalued widget

Reviewed-By: Adam Misnyovszki <amisnyov@redhat.com>
2014-04-03 12:40:37 +02:00

209 lines
4.5 KiB
Plaintext

/* Authors:
* UXD team
* Petr Vobornik <pvoborni@redhat.com>
*
* Copyright (C) 2013 Red Hat
* see file 'COPYING' for use and warranty information
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// This file contains overrides of reference RCUE implementation to comply
// with IPA design
// variables
@checkbox-color: darken(#b7b7b7, 20%);
@checkbox-disabled-color: #d2d2d2;
@checkbox-hover-color: #64b0db;
@checkbox-selected-color: darken(@checkbox-hover-color, 20%);
/* Checkboxes and Radios */
.radio, .checkbox {
position: relative;
padding: 0;
}
input[type="checkbox"],
input[type="radio"] {
display: inline;
position: absolute;
overflow: hidden;
margin:0;
padding:0;
border:0;
outline:0;
opacity:0;
}
input[type="checkbox"]:focus + label:before,
input[type="radio"]:focus + label:before {
outline: thin dotted @checkbox-selected-color;
}
input[type="checkbox"] + label,
input[type="radio"] + label {
display: inline-block;
padding: 0;
margin: 0;
&:before {
.fa;
font-size: 125%;
vertical-align: -7%;
margin-right: 5px;
}
}
input[type="checkbox"].standalone + label,
input[type="radio"].standalone + label {
width: 13px;
&:before {
margin-right: 0px;
}
}
input[type="radio"] + label,
input[type="checkbox"] + label {
&:before {
color: @checkbox-color;
}
&:hover:before {
color: @checkbox-hover-color;
}
}
input[type="radio"]:disabled + label,
input[type="checkbox"]:disabled + label {
color: @checkbox-disabled-color;
&:before,
&:hover:before {
color: @checkbox-disabled-color;
}
}
input[type="radio"]:disabled:checked + label,
input[type="checkbox"]:disabled:checked + label {
color: @checkbox-color;
&:before,
&:hover:before {
color: @checkbox-color;
}
}
input[type="checkbox"] + label:before {
content: @fa-var-square-o;
}
input[type="checkbox"]:checked + label:before {
content: @fa-var-check-square-o;
color: @checkbox-selected-color;
}
input[type="radio"] + label:before {
content: @fa-var-circle-o;
}
input[type="radio"]:checked + label:before {
content: @fa-var-dot-circle-o;
color: @checkbox-selected-color;
}
.form-horizontal {
.controls {
.link-btn {
display: inline-block;
}
a, label {
padding-top: 3px;
margin-bottom: 3px;
}
// disable previous in combobox
.combobox-widget a {
padding: 0px;
margin: 0px;
}
}
}
// this style directly negates the same in forms.less
.help-inline {
margin-top: 0;
}
.control-group .control-label {
position: relative;
label {
margin-bottom: 0;
}
}
// implicit required indicator
.control-group.required .control-label label:after {
display: inline-block;
position: absolute;
right: -11px;
top: 0px;
font-size: 125%;
font-weight: bold;
content: '*';
color: #1d85d9;
}
.row-fluid .control-group.required .control-label label:after {
position: relative;
right: -2px;
}
@media (max-width: 480px) {
.control-group.required .control-label label:after {
position: relative;
right: -2px;
}
}
// do not show error hint for valid value in multivalued widget if some
// other value is invalid
.control-group.error .valid .help-inline {
display: none;
}
// only type text for now - it should be replaced when we adopt Bootstrap 3
// based RCUE (patternfly)
.control-group.error .valid input[type=text] {
border-color: #62afdb !important;
&:focus {
border-color: rgba(82, 168, 236, 0.8);
outline: 0;
outline: thin dotted \9;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
}
}