mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix the UI indicators for mandatory fields.
The source and target groups weren't highlighted but the entire block of checkboxes was and it looked absolutely horrible.
This commit is contained in:
@@ -65,8 +65,9 @@ class DelegateValidator(validators.Schema):
|
||||
messages = { 'empty': _("Please choose a group"), })
|
||||
dest_group_dn = validators.String(not_empty=True,
|
||||
messages = { 'empty': _("Please choose a group"), })
|
||||
attrs = validators.NotEmpty(
|
||||
messages = { 'empty': _("Please select at least one value"), })
|
||||
# There is no attrs validator here because then it shows as one
|
||||
# huge block of color in the form. The validation is done in
|
||||
# the subcontroller.
|
||||
|
||||
class DelegateForm(widgets.Form):
|
||||
params = ['delegate_fields', 'attr_list']
|
||||
|
||||
@@ -292,4 +292,11 @@ class DelegationController(IPAController):
|
||||
@validate(form=delegate_form)
|
||||
@identity.require(identity.not_anonymous())
|
||||
def delegatevalidate(self, tg_errors=None, **kw):
|
||||
# We are faking this because otherwise it shows up as one huge
|
||||
# block of color in the UI when it has a not empty validator.
|
||||
if not kw.get('attrs'):
|
||||
if not tg_errors:
|
||||
tg_errors = {}
|
||||
tg_errors['attrs'] = _("Please select at least one value")
|
||||
cherrypy.request.validation_errors = tg_errors
|
||||
return tg_errors, kw
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
py:content="tg.errors.get('source_group_dn')" />
|
||||
</div>
|
||||
<div id="source_searcharea" style="display:none">
|
||||
<input id="source_criteria" type="text"
|
||||
<input class="requiredfield" id="source_criteria" type="text"
|
||||
onkeypress="return enterDoSearch(event, 'source');" />
|
||||
<input class="searchbutton" type="button" value="Find"
|
||||
onclick="return doSearch('source');"
|
||||
@@ -142,7 +142,7 @@
|
||||
</div>
|
||||
<div id="dest_searcharea" style="display:none">
|
||||
<div>
|
||||
<input id="dest_criteria" type="text"
|
||||
<input class="requiredfield" id="dest_criteria" type="text"
|
||||
onkeypress="return enterDoSearch(event, 'dest');" />
|
||||
<input class="searchbutton" type="button" value="Find"
|
||||
onclick="return doSearch('dest');"
|
||||
|
||||
Reference in New Issue
Block a user