Permalink
Browse files

Added default class to admin form fields

  • Loading branch information...
1 parent 2fa2100 commit bd3558163e74494bcbdbdeab76b42eb43c845c7a @mgiagnoni committed Sep 3, 2012
Showing with 4 additions and 3 deletions.
  1. +2 −1 DependencyInjection/LyraAdminExtension.php
  2. +2 −2 Resources/public/css/form.css
@@ -398,7 +398,8 @@ private function setFieldsDefaultsFromMetadata(ContainerBuilder $container)
if (!isset($attrs['get_method'])) {
$fields[$field]['get_method'] = 'get'.Util::camelize($field);
}
-
+ $class = isset($attrs['options']['attr']['class']) ? $attrs['options']['attr']['class'].' ' : '';
+ $fields[$field]['options']['attr']['class'] = $class.'widget-'.$attrs['widget'];
$fields[$field]['tag'] = Util::underscore($field);
}
}
@@ -58,10 +58,10 @@
margin: 0 0 2px 139px;
padding: 0;
}
-.ly-form input[type="text"], .ly-form select {
+.ly-form .widget-text, .ly-form .widget-entity {
width: 230px;
}
-.ly-form textarea {
+.ly-form .widget-textarea {
width: 230px;
height: 120px;
}

0 comments on commit bd35581

Please sign in to comment.