From 9666733a73781547c59dfbf930878444a4d6abd0 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Fri, 1 Jun 2012 21:46:48 +0200 Subject: [PATCH] Many changes related to forms and CSS --- .../modules/company/templates/_form.php | 73 ++++++++++++++++--- .../modules/office/templates/_formCustomOffice.php | 37 ++++++---- .../modules/sfGuardAuth/templates/_signin_form.php | 44 +++++++----- .../sfGuardAuth/templates/signinSuccess.php | 4 ++ apps/companyfront/modules/user/templates/_form.php | 34 +++++---- .../userfront/modules/register/templates/_form.php | 31 ++++++-- .../modules/register/templates/indexSuccess.php | 2 +- .../modules/sfGuardAuth/templates/_signin_form.php | 44 +++++++----- .../sfGuardAuth/templates/signinSuccess.php | 4 ++ apps/userfront/modules/user/templates/_form.php | 33 +++++---- .../sfGuardUserForm.class.php | 1 + .../WidgetFormSchemaFormatterCustom.class.php | 36 ++++++++++ web/css/inadminpanel/niceforms-default.css | 10 +-- web/css/inadminpanel/style.css | 83 ++++++++++++++++++++++ 14 files changed, 342 insertions(+), 94 deletions(-) create mode 100644 apps/companyfront/modules/sfGuardAuth/templates/signinSuccess.php create mode 100644 apps/userfront/modules/sfGuardAuth/templates/signinSuccess.php create mode 100644 lib/widget/WidgetFormSchemaFormatterCustom.class.php diff --git a/apps/companyfront/modules/company/templates/_form.php b/apps/companyfront/modules/company/templates/_form.php index 9b6d065..66cb305 100644 --- a/apps/companyfront/modules/company/templates/_form.php +++ b/apps/companyfront/modules/company/templates/_form.php @@ -5,19 +5,70 @@ getObject()->isNew()): ?> +
+ - - - - - - renderGlobalErrors(false) ?> - + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?>
- renderHiddenFields(false) ?> -   - /> -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ render(array('class' => 'validate-selection')) ?> + + render(array('class' => 'required')) ?> + + +
+ render(array('class' => 'validate-selection')) ?> + + render(array('class' => 'required')) ?> + + + +
+ renderHiddenFields(false) ?> +
+
+ + + + + + + +
+ + + +
diff --git a/apps/companyfront/modules/office/templates/_formCustomOffice.php b/apps/companyfront/modules/office/templates/_formCustomOffice.php index b4110bc..c887f9e 100644 --- a/apps/companyfront/modules/office/templates/_formCustomOffice.php +++ b/apps/companyfront/modules/office/templates/_formCustomOffice.php @@ -5,21 +5,30 @@ getObject()->isNew()): ?> +
+ - - - - - + + renderGlobalErrors() ?> + renderHiddenFields(false) ?> + renderRow(array('class' => 'validate-selection')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> - -
- renderHiddenFields(false) ?> -   - getObject()->isNew()): ?> -  getObject()->getId().'&page='.$page.'&sort='.$sort, array('method' => 'delete', 'confirm' => 'Are you sure?')) ?> - - /> -
+
+ + + + + + + +
+ + + +
diff --git a/apps/companyfront/modules/sfGuardAuth/templates/_signin_form.php b/apps/companyfront/modules/sfGuardAuth/templates/_signin_form.php index b13e241..536c623 100644 --- a/apps/companyfront/modules/sfGuardAuth/templates/_signin_form.php +++ b/apps/companyfront/modules/sfGuardAuth/templates/_signin_form.php @@ -1,25 +1,37 @@
+
+ SIGN IN - + renderGlobalErrors() ?> + renderHiddenFields(false) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow()?> - - -
- - - getRouting()->getRoutes() ?> - - - +
+
+ + + + + + + - -   - - - -
+ + + getRouting()->getRoutes() ?> + + + + + +   + +
+
diff --git a/apps/companyfront/modules/sfGuardAuth/templates/signinSuccess.php b/apps/companyfront/modules/sfGuardAuth/templates/signinSuccess.php new file mode 100644 index 0000000..58d4ad9 --- /dev/null +++ b/apps/companyfront/modules/sfGuardAuth/templates/signinSuccess.php @@ -0,0 +1,4 @@ + +

+ + $form)) ?> diff --git a/apps/companyfront/modules/user/templates/_form.php b/apps/companyfront/modules/user/templates/_form.php index 926b112..dcc849f 100644 --- a/apps/companyfront/modules/user/templates/_form.php +++ b/apps/companyfront/modules/user/templates/_form.php @@ -5,21 +5,29 @@ getObject()->isNew()): ?> +
+ - - - - - - renderGlobalErrors() ?> - - - + renderGlobalErrors() ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'validate-selection')) ?> + renderHiddenFields(false) ?>
- renderHiddenFields(false) ?> -   - -
+
+ + + + + + + +
+ + + +
diff --git a/apps/userfront/modules/register/templates/_form.php b/apps/userfront/modules/register/templates/_form.php index b4f9ba0..addfecf 100644 --- a/apps/userfront/modules/register/templates/_form.php +++ b/apps/userfront/modules/register/templates/_form.php @@ -1,14 +1,31 @@
+
+ - - - - + renderGlobalErrors() ?> + renderHiddenFields(false) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'validate-selection')) ?> + RenderRow() ?> + +
- +
+
+ + + + - - + +
+
+ diff --git a/apps/userfront/modules/register/templates/indexSuccess.php b/apps/userfront/modules/register/templates/indexSuccess.php index f756829..8072abc 100644 --- a/apps/userfront/modules/register/templates/indexSuccess.php +++ b/apps/userfront/modules/register/templates/indexSuccess.php @@ -1,4 +1,4 @@ -

+

$form)) ?> diff --git a/apps/userfront/modules/sfGuardAuth/templates/_signin_form.php b/apps/userfront/modules/sfGuardAuth/templates/_signin_form.php index b13e241..536c623 100644 --- a/apps/userfront/modules/sfGuardAuth/templates/_signin_form.php +++ b/apps/userfront/modules/sfGuardAuth/templates/_signin_form.php @@ -1,25 +1,37 @@
+
+ SIGN IN - + renderGlobalErrors() ?> + renderHiddenFields(false) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow()?> - - -
- - - getRouting()->getRoutes() ?> - - - +
+
+ + + + + + + - -   - - - -
+ + + getRouting()->getRoutes() ?> + + + + + +   + +
+
diff --git a/apps/userfront/modules/sfGuardAuth/templates/signinSuccess.php b/apps/userfront/modules/sfGuardAuth/templates/signinSuccess.php new file mode 100644 index 0000000..58d4ad9 --- /dev/null +++ b/apps/userfront/modules/sfGuardAuth/templates/signinSuccess.php @@ -0,0 +1,4 @@ + +

+ + $form)) ?> diff --git a/apps/userfront/modules/user/templates/_form.php b/apps/userfront/modules/user/templates/_form.php index 926b112..cdae39c 100644 --- a/apps/userfront/modules/user/templates/_form.php +++ b/apps/userfront/modules/user/templates/_form.php @@ -5,21 +5,30 @@ getObject()->isNew()): ?> +
+ - - - - - renderGlobalErrors() ?> - - - + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'validate-selection')) ?>
- renderHiddenFields(false) ?> -   - -
+
+ renderHiddenFields(false) ?> +   + + + + + + + +
+ + + +
diff --git a/lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardUserForm.class.php b/lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardUserForm.class.php index 79cd4a7..ed0d748 100644 --- a/lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardUserForm.class.php +++ b/lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardUserForm.class.php @@ -21,5 +21,6 @@ class sfGuardUserForm extends PluginsfGuardUserForm $this->validatorSchema['language_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Language'), 'required' => true)); + } } diff --git a/lib/widget/WidgetFormSchemaFormatterCustom.class.php b/lib/widget/WidgetFormSchemaFormatterCustom.class.php new file mode 100644 index 0000000..e4fc07d --- /dev/null +++ b/lib/widget/WidgetFormSchemaFormatterCustom.class.php @@ -0,0 +1,36 @@ + + %error% + %label%%field% + %help% + %hidden_fields% + ", + // this defines the exact format of the above %help%. This says to wrap it in a div of class form_helper. + // The %help% in this case defines that actual help text (if any) that's given + $helpFormat = '
%help%
', + // Certain errors do not pertain to any specific widget. In these cases, the errors are printed on their own row + // This defines the format of how to set up that row + $errorRowFormat = "
%errors%
", + // this is the wrapper always uses around errors. + $errorListFormatInARow = " ", + // This defines how to print the actual error in normal situations + $errorRowFormatInARow = "
  • %error%
  • ", + // This defines how to print the actual error in situations where the error does not belong to a specific widget - is printed at the top of the form + $namedErrorRowFormatInARow = "
  • %name%: %error%
  • ", + // We didn't cover it, but you can embed forms inside other forms. + // When you do, the following is used to "wrap" your form. In the table example, this is a
    value. + $decoratorFormat = "
    %content%
    ";*/ + protected + $rowFormat = "\n %label%\n %error%%field%%help%%hidden_fields%\n\n", + $errorRowFormat = "\n%errors%\n", + $helpFormat = '
    %help%', + $decoratorFormat = "\n %content%
    "; +} diff --git a/web/css/inadminpanel/niceforms-default.css b/web/css/inadminpanel/niceforms-default.css index 87cf912..d7498c1 100644 --- a/web/css/inadminpanel/niceforms-default.css +++ b/web/css/inadminpanel/niceforms-default.css @@ -11,9 +11,7 @@ width:600px; float:left; clear:both; } -fieldset { border:none; clear:both;} -label {font-size:11px; font-weight:bold; color:#666;} -label a{font-size:11px; font-weight:bold; color:#666;} +label a{font-size:11px; font-weight:bold; color:#666666;} dl {clear:both; width:600px;} dl.submit {clear:both; width:500px; text-align:center; padding:0 0 0 90px;} @@ -95,4 +93,8 @@ line-height:32px; /*Hidden*/ .NFhidden {opacity:0; z-index:-1; position:relative;} /*Safari*/ -select, input, textarea, button {outline:none; resize:none;} +/*select, input, textarea, button { +outline:none; +background:url(/images/inadminpanel/img/input.gif) repeat-x scroll 0 0; +resize:none; +}*/ diff --git a/web/css/inadminpanel/style.css b/web/css/inadminpanel/style.css index 87da282..e254b8e 100644 --- a/web/css/inadminpanel/style.css +++ b/web/css/inadminpanel/style.css @@ -456,3 +456,86 @@ margin-right: 2px; border: 1px solid #f3f3f3; color: #ccc; } +.form-row +{ + clear: both; + padding: 10px; + border-bottom: 1px solid #bbf; + background-color: #fff; +} +label +{ + float: left; + color: #666666; + padding: 8px; + line-height: 25px; + font-size: 12px; + width: 150px; + font-weight: normal; +} +div.form_helper { + clear: both; + color: #333; + font-style: italic; +} +.error_list { + color: #ff0000; +} +#rounded-cornergus +{ +margin:0px; +width:550px; +text-align: left; +border-collapse: collapse; +} +#rounded-cornergus thead th.rounded-companygus +{ +border: 1px solid #95E0EF; +} +#rounded-cornergus thead th.rounded-q4gus +{ +border: 1px solid #95E0EF; +} +#rounded-cornergus th +{ +padding: 8px; +font-weight: normal; +font-size: 13px; +color: #666666; +border: 1px solid #95E0EF; +} +#rounded-cornergus td +{ +padding: 8px; +border: 1px solid #95E0EF; +color: #666666; +} +input.required { +background-color: #F3FCFE; +border-color: #95E0EF; +border-style: solid; +border-width: 1px 1px 1px 2px; +float: left; +height: 28px; +padding: 5px 0 0 2px; +width: 300px; +} +select.validate-selection{ +width:90px; +height:28px; +border: 1px solid #95E0EF; +background-color:#f3fcfe; +border-left-width:2px; +padding:4px 2px 3px 2px; +float:left; +} +fieldset{ +border: 1px solid #EBEBEB; +margin: 0 10px 10px; +padding: 15px 10px; +} +legend{ +background-color: #0FCDF6; +color: #FFFFFF; +padding: 2px 5px; +} -- 2.1.4