mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
optional uid
Make the uid field optional
This commit is contained in:
@@ -188,6 +188,23 @@ IPA.dialog = function(spec) {
|
||||
|
||||
var span = $('<span/>', { 'name': field.name }).appendTo(td);
|
||||
field.create(span);
|
||||
field.field_span = span;
|
||||
|
||||
if (field.optional){
|
||||
span.css('display','none');
|
||||
td.append(
|
||||
$('<a/>',{
|
||||
text: IPA.messages.widget.optional,
|
||||
href:'',
|
||||
click: function(){
|
||||
var span = $(this).prev();
|
||||
span.css('display','inline');
|
||||
$(this).css('display','none');
|
||||
return false;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var sections = that.sections.values;
|
||||
@@ -327,6 +344,8 @@ IPA.dialog = function(spec) {
|
||||
var factory = field_spec.factory || IPA.text_widget;
|
||||
field = factory(field_spec);
|
||||
|
||||
field.optional = field_spec.optional || false;
|
||||
|
||||
/* This is a bit of a hack, and is here to support ACI
|
||||
permissions. The target section is a group of several
|
||||
widgets together. It makes more sense to do them as a
|
||||
|
@@ -15609,6 +15609,7 @@
|
||||
"sudo": "Sudo"
|
||||
},
|
||||
"widget": {
|
||||
"optional": "Optional field: click to show",
|
||||
"validation_error": "Text does not match field pattern"
|
||||
}
|
||||
}
|
||||
|
@@ -119,7 +119,14 @@ IPA.entity_factories.user = function() {
|
||||
link: link
|
||||
}).
|
||||
adder_dialog({
|
||||
fields: ['uid', 'givenname', 'sn']
|
||||
fields: [
|
||||
{
|
||||
factory : IPA.text_widget,
|
||||
undo: false,
|
||||
optional: true,
|
||||
name:'uid'
|
||||
},
|
||||
'givenname', 'sn']
|
||||
});
|
||||
|
||||
return builder.build();
|
||||
|
@@ -365,6 +365,7 @@ class i18n_messages(Command):
|
||||
"remove":_("Remove ${other_entity} from ${entity} ${primary_key}"),
|
||||
},
|
||||
"widget":{
|
||||
"optional":_("Optional field: click to show"),
|
||||
"validation_error":_("Text does not match field pattern"),
|
||||
},
|
||||
"ajax":{
|
||||
|
Reference in New Issue
Block a user