From c015bbe8b5269814d6ae0214a1ca5a5a1c8bf01d Mon Sep 17 00:00:00 2001 From: mespeche Date: Fri, 6 Sep 2013 12:12:27 +0200 Subject: [PATCH] Working : - Refactor to bootstrap3 - Label information in Form files --- core/lib/Thelia/Form/BaseDescForm.php | 25 ++++++- core/lib/Thelia/Form/ConfigCreationForm.php | 4 +- .../Thelia/Form/ConfigModificationForm.php | 15 ++++- .../default/assets/less/thelia/variables.less | 8 ++- .../standard-description-form-fields.html | 53 +++++---------- templates/admin/default/variable-edit.html | 65 ++++++------------- 6 files changed, 83 insertions(+), 87 deletions(-) diff --git a/core/lib/Thelia/Form/BaseDescForm.php b/core/lib/Thelia/Form/BaseDescForm.php index c4f4f90c3..2b35f3e6e 100644 --- a/core/lib/Thelia/Form/BaseDescForm.php +++ b/core/lib/Thelia/Form/BaseDescForm.php @@ -43,12 +43,31 @@ abstract class BaseDescForm extends BaseForm ->add("title", "text", array( "constraints" => array( new NotBlank() + ), + "label" => "Title", + "label_attr" => array( + "for" => "title" ) ) ) - ->add("chapo", "text", array()) - ->add("description", "text", array()) - ->add("postscriptum", "text", array()) + ->add("chapo", "text", array( + "label" => "Summary", + "label_attr" => array( + "for" => "summary" + ) + )) + ->add("description", "text", array( + "label" => "Detailed description", + "label_attr" => array( + "for" => "detailed_description" + ) + )) + ->add("postscriptum", "text", array( + "label" => "Conclusion", + "label_attr" => array( + "for" => "conclusion" + ) + )) ; } } \ No newline at end of file diff --git a/core/lib/Thelia/Form/ConfigCreationForm.php b/core/lib/Thelia/Form/ConfigCreationForm.php index fc65d3d44..b2a0c11bb 100644 --- a/core/lib/Thelia/Form/ConfigCreationForm.php +++ b/core/lib/Thelia/Form/ConfigCreationForm.php @@ -67,7 +67,9 @@ class ConfigCreationForm extends BaseForm ) )) ->add("hidden", "hidden", array()) - ->add("secured", "hidden", array()) + ->add("secured", "hidden", array( + "label" => "Prevent variable modification or deletion, except for super-admin" + )) ; } diff --git a/core/lib/Thelia/Form/ConfigModificationForm.php b/core/lib/Thelia/Form/ConfigModificationForm.php index dd0a0e42f..295c0403d 100644 --- a/core/lib/Thelia/Form/ConfigModificationForm.php +++ b/core/lib/Thelia/Form/ConfigModificationForm.php @@ -44,11 +44,22 @@ class ConfigModificationForm extends BaseDescForm ->add("name", "text", array( "constraints" => array( new NotBlank() + ), + "label" => "Name", + "label_attr" => array( + "for" => "name" + ) + )) + ->add("value", "text", array( + "label" => "Value", + "label_attr" => array( + "for" => "value" ) )) - ->add("value", "text", array()) ->add("hidden", "hidden", array()) - ->add("secured", "hidden", array()) + ->add("secured", "hidden", array( + "label" => "Prevent variable modification or deletion, except for super-admin" + )) ; } diff --git a/templates/admin/default/assets/less/thelia/variables.less b/templates/admin/default/assets/less/thelia/variables.less index dec523afc..35bc931b5 100755 --- a/templates/admin/default/assets/less/thelia/variables.less +++ b/templates/admin/default/assets/less/thelia/variables.less @@ -44,4 +44,10 @@ // Used for a bird's eye view of components dependent on the z-axis // Try to avoid customizing these :) -@zindex-dropdown: 1005; \ No newline at end of file +@zindex-dropdown: 1005; + +// Forms +// ------------------------- + + +@input-border-focus: @link-color; \ No newline at end of file diff --git a/templates/admin/default/includes/standard-description-form-fields.html b/templates/admin/default/includes/standard-description-form-fields.html index e70092316..0030af54f 100644 --- a/templates/admin/default/includes/standard-description-form-fields.html +++ b/templates/admin/default/includes/standard-description-form-fields.html @@ -1,60 +1,41 @@ {* The standard description fields, used by many Thelia objects *} {form_field form=$form field='title'} -
- - -
- - - -
+
+ +
{/form_field} {form_field form=$form field='chapo'} -
-