Added singular entity labels.

A new attribute label_singular has been added to all entities which
contains the singular form of the entity label in lower cases except
for acronyms (e.g. HBAC) or proper nouns (e.g. Kerberos). In the Web
UI, this label can be capitalized using CSS text-transform.

The existing 'label' attribute is intentionally left unchanged due to
inconsistencies in the current values. It contains mostly the plural
form of capitalized entity label, but some are singular. Also, it
seems currently there is no comparable capitalization method on the
server-side. So more work is needed before the label can be changed.

Ticket #1249
This commit is contained in:
Endi S. Dewata 2011-06-23 19:48:50 -05:00 committed by Adam Young
parent d49bf3871b
commit 8d9575605d
25 changed files with 57 additions and 4 deletions

View File

@ -7719,6 +7719,7 @@
"aci"
],
"label": "Automount Keys",
"label_singular": "automount key",
"methods": [
"add",
"del",
@ -7863,6 +7864,7 @@
"aci"
],
"label": "Automount Locations",
"label_singular": "automount location",
"methods": [
"add",
"del",
@ -7951,6 +7953,7 @@
"aci"
],
"label": "Automount Maps",
"label_singular": "automount map",
"methods": [
"add",
"add_indirect",
@ -8070,6 +8073,7 @@
"aci"
],
"label": "Configuration",
"label_singular": "configuration",
"methods": [
"mod",
"show"
@ -9336,6 +9340,7 @@
"aci"
],
"label": "Entry",
"label_singular": "entry",
"methods": [
"add",
"del",
@ -9460,6 +9465,7 @@
"delegation": {
"bindable": false,
"label": "Delegation",
"label_singular": "delegation",
"methods": [
"add",
"del",
@ -9681,6 +9687,7 @@
"aci"
],
"label": "DNS resource record",
"label_singular": "DNS resource record",
"methods": [
"add",
"add_record",
@ -9898,6 +9905,7 @@
"aci"
],
"label": "DNS",
"label_singular": "DNS zone",
"methods": [
"add",
"del",
@ -10297,6 +10305,7 @@
"aci"
],
"label": "Entitlements",
"label_singular": "entitlement",
"methods": [
"consume",
"find",
@ -10399,6 +10408,7 @@
"aci"
],
"label": "User Groups",
"label_singular": "user group",
"methods": [
"add",
"add_member",
@ -10579,6 +10589,7 @@
"aci"
],
"label": "HBAC Rule",
"label_singular": "HBAC rule",
"methods": [
"add",
"add_host",
@ -11102,6 +11113,7 @@
"aci"
],
"label": "HBAC Services",
"label_singular": "HBAC service",
"methods": [
"add",
"del",
@ -11228,6 +11240,7 @@
"aci"
],
"label": "HBAC service Groups",
"label_singular": "HBAC service group",
"methods": [
"add",
"add_member",
@ -11392,6 +11405,7 @@
"aci"
],
"label": "Hosts",
"label_singular": "host",
"methods": [
"add",
"add_managedby",
@ -11793,6 +11807,7 @@
"aci"
],
"label": "Host Groups",
"label_singular": "host group",
"methods": [
"add",
"add_member",
@ -11905,6 +11920,7 @@
"aci"
],
"label": "Kerberos Ticket Policy",
"label_singular": "Kerberos ticket policy",
"methods": [
"mod",
"reset",
@ -12070,6 +12086,7 @@
"aci"
],
"label": "Netgroups",
"label_singular": "netgroup",
"methods": [
"add",
"add_member",
@ -12309,6 +12326,7 @@
"aci"
],
"label": "Permissions",
"label_singular": "permission",
"methods": [
"add",
"add_member",
@ -12621,6 +12639,7 @@
"aci"
],
"label": "Privileges",
"label_singular": "privilege",
"methods": [
"add",
"add_member",
@ -12754,6 +12773,7 @@
"aci"
],
"label": "Password Policy",
"label_singular": "password policy",
"methods": [
"add",
"del",
@ -13071,6 +13091,7 @@
"aci"
],
"label": "Role",
"label_singular": "role",
"methods": [
"add",
"add_member",
@ -13174,6 +13195,7 @@
"selfservice": {
"bindable": false,
"label": "Self Service Permissions",
"label_singular": "self service permission",
"methods": [
"add",
"del",
@ -13311,6 +13333,7 @@
"aci"
],
"label": "Services",
"label_singular": "service",
"methods": [
"add",
"add_host",
@ -13426,6 +13449,7 @@
"aci"
],
"label": "Sudo Commands",
"label_singular": "sudo command",
"methods": [
"add",
"del",
@ -13552,6 +13576,7 @@
"aci"
],
"label": "Sudo Command Groups",
"label_singular": "sudo command group",
"methods": [
"add",
"add_member",
@ -13779,6 +13804,7 @@
"aci"
],
"label": "Sudo Rule",
"label_singular": "sudo rule",
"methods": [
"add",
"add_allow_command",
@ -14547,6 +14573,7 @@
"aci"
],
"label": "Users",
"label_singular": "user",
"methods": [
"add",
"del",

View File

@ -188,7 +188,7 @@ class automountlocation(LDAPObject):
object_class = ['nscontainer']
default_attributes = ['cn']
label = _('Automount Locations')
label_singular = _('automount location')
takes_params = (
Str('cn',
@ -513,6 +513,7 @@ class automountmap(LDAPObject):
)
label = _('Automount Maps')
label_singular = _('automount map')
api.register(automountmap)
@ -604,6 +605,7 @@ class automountkey(LDAPObject):
num_parents = 2
label = _('Automount Keys')
label_singular = _('automount key')
already_exists_msg = _('The key,info pair must be unique. A key named %(key)s with info %(info)s already exists')
key_already_exists_msg = _('key named %(key)s already exists')
object_not_found_msg = _('The automount key %(key)s with info %(info)s does not exist')

View File

@ -280,6 +280,7 @@ class LDAPObject(Object):
),
}
label = _('Entry')
label_singular = _('entry')
container_not_found_msg = _('container entry (%(container)s) not found')
parent_not_found_msg = _('%(parent)s: %(oname)s not found')
@ -376,7 +377,7 @@ class LDAPObject(Object):
# list of attributes we want exported to JSON
json_friendly_attributes = (
'parent_object', 'container_dn', 'object_name', 'object_name_plural',
'object_class', 'object_class_config', 'default_attributes', 'label',
'object_class', 'object_class_config', 'default_attributes', 'label', 'label_singular',
'hidden_attributes', 'uuid_attribute', 'attribute_members', 'name',
'takes_params', 'rdn_attribute', 'bindable', 'relationships',
)

View File

@ -89,6 +89,7 @@ class config(LDAPObject):
]
label = _('Configuration')
label_singular = _('configuration')
takes_params = (
Int('ipamaxusernamelength?',

View File

@ -100,6 +100,7 @@ class delegation(Object):
object_name = 'delegation',
object_name_plural = 'delegation',
label = _('Delegation')
label_singular = _('delegation')
takes_params = (
Str('aciname',
@ -134,7 +135,7 @@ class delegation(Object):
def __json__(self):
json_friendly_attributes = (
'label', 'takes_params', 'bindable', 'name',
'label', 'label_singular', 'takes_params', 'bindable', 'name',
'object_name', 'object_name_plural',
)
json_dict = dict(

View File

@ -283,6 +283,7 @@ class dnszone(LDAPObject):
'idnssoaminimum'
] + _record_attributes
label = _('DNS')
label_singular = _('DNS zone')
takes_params = (
Str('idnsname',
@ -521,6 +522,7 @@ class dnsrecord(LDAPObject):
default_attributes = _record_attributes + ['idnsname']
label = _('DNS resource record')
label_singular = _('DNS resource record')
takes_params = (
Str('idnsname',

View File

@ -187,6 +187,7 @@ class entitle(LDAPObject):
uuid_attribute = 'ipaentitlementid'
label = _('Entitlements')
label_singular = _('entitlement')
"""
def get_dn(self, *keys, **kwargs):

View File

@ -98,6 +98,7 @@ class group(LDAPObject):
rdnattr = 'cn'
label = _('User Groups')
label_singular = _('user group')
takes_params = (
Str('cn',

View File

@ -124,6 +124,7 @@ class hbacrule(LDAPObject):
}
label = _('HBAC Rule')
label_singular = _('HBAC rule')
takes_params = (
Str('cn',

View File

@ -59,6 +59,7 @@ class hbacsvc(LDAPObject):
uuid_attribute = 'ipauniqueid'
label = _('HBAC Services')
label_singular = _('HBAC service')
takes_params = (
Str('cn',

View File

@ -62,6 +62,7 @@ class hbacsvcgroup(LDAPObject):
}
label = _('HBAC service Groups')
label_singular = _('HBAC service group')
takes_params = (
Str('cn',

View File

@ -244,6 +244,7 @@ class host(LDAPObject):
}
label = _('Hosts')
label_singular = _('host')
takes_params = (
Str('fqdn', validate_host,

View File

@ -71,6 +71,7 @@ class hostgroup(LDAPObject):
}
label = _('Host Groups')
label_singular = _('host group')
takes_params = (
Str('cn',

View File

@ -77,6 +77,7 @@ class krbtpolicy(LDAPObject):
limit_object_classes = ['krbticketpolicyaux']
label=_('Kerberos Ticket Policy')
label_singular = _('Kerberos ticket policy')
takes_params = (
Str('uid?',

View File

@ -96,6 +96,7 @@ class netgroup(LDAPObject):
}
label = _('Netgroups')
label_singular = _('netgroup')
takes_params = (
Str('cn',

View File

@ -105,6 +105,7 @@ class permission(LDAPObject):
rdnattr='cn'
label = _('Permissions')
label_singular = _('permission')
takes_params = (
Str('cn',

View File

@ -63,6 +63,7 @@ class privilege(LDAPObject):
rdnattr='cn'
label = _('Privileges')
label_singular = _('privilege')
takes_params = (
Str('cn',

View File

@ -217,6 +217,7 @@ class pwpolicy(LDAPObject):
)
label = _('Password Policy')
label_singular = _('password policy')
takes_params = (
Str('cn?',

View File

@ -79,6 +79,7 @@ class role(LDAPObject):
rdnattr='cn'
label = _('Role')
label_singular = _('role')
takes_params = (
Str('cn',

View File

@ -73,6 +73,7 @@ class selfservice(Object):
object_name = 'selfservice',
object_name_plural = 'selfservice',
label = _('Self Service Permissions')
label_singular = _('self service permission')
takes_params = (
Str('aciname',
@ -97,7 +98,7 @@ class selfservice(Object):
def __json__(self):
json_friendly_attributes = (
'label', 'takes_params', 'bindable', 'name',
'label', 'label_singular', 'takes_params', 'bindable', 'name',
'object_name', 'object_name_plural',
)
json_dict = dict(

View File

@ -218,6 +218,7 @@ class service(LDAPObject):
}
label = _('Services')
label_singular = _('service')
takes_params = (
Str('krbprincipalname', validate_principal,

View File

@ -62,6 +62,7 @@ class sudocmd(LDAPObject):
}
uuid_attribute = 'ipauniqueid'
label = _('Sudo Commands')
label_singular = _('sudo command')
takes_params = (
Str('sudocmd',

View File

@ -63,6 +63,7 @@ class sudocmdgroup(LDAPObject):
}
label = _('Sudo Command Groups')
label_singular = _('sudo command group')
takes_params = (
Str('cn',

View File

@ -66,6 +66,7 @@ class sudorule(LDAPObject):
}
label = _('Sudo Rule')
label_singular = _('sudo rule')
takes_params = (
Str('cn',

View File

@ -106,6 +106,7 @@ class user(LDAPObject):
rdnattr = 'uid'
bindable = True
label_singular = _('user')
label = _('Users')
takes_params = (