Added a few "pretty" enhacements...

This commit is contained in:
Adolfo Gómez García 2017-06-08 11:31:47 +02:00
parent 3e87c90c67
commit de5e7380c4
5 changed files with 9 additions and 9 deletions

View File

@ -70,7 +70,7 @@ class ServicesUsage(DetailHandler):
'user_id': '' 'user_id': ''
} }
else: else:
owner = item.user.fullUsername owner = item.user.pretty_name
owner_info = { owner_info = {
'auth_id': item.user.manager.uuid, 'auth_id': item.user.manager.uuid,
'user_id': item.user.uuid 'user_id': item.user.uuid

View File

@ -91,7 +91,7 @@ class AssignedService(DetailHandler):
'user_id': '' 'user_id': ''
} }
else: else:
owner = item.user.fullUsername owner = item.user.pretty_name
owner_info = { owner_info = {
'auth_id': item.user.manager.uuid, 'auth_id': item.user.manager.uuid,
'user_id': item.user.uuid 'user_id': item.user.uuid

View File

@ -88,6 +88,10 @@ class User(UUIDModel):
''' '''
return self.getManager().getForAuth(self.name) return self.getManager().getForAuth(self.name)
@property
def pretty_name(self):
return self.name + '@' + self.manager.name
def getManager(self): def getManager(self):
''' '''
Returns the authenticator object that owns this user. Returns the authenticator object that owns this user.
@ -168,10 +172,6 @@ class User(UUIDModel):
# This group matches # This group matches
yield g yield g
@property
def fullUsername(self):
return self.manager.name + "\\" + self.name
def __str__(self): def __str__(self):
return u"User {0}(id:{1}) from auth {2}".format(self.name, self.id, self.manager.name) return u"User {0}(id:{1}) from auth {2}".format(self.name, self.id, self.manager.name)

View File

@ -226,7 +226,7 @@ gui.providers.link = (event) ->
onData: (data) -> onData: (data) ->
$.each data, (index, value) -> $.each data, (index, value) ->
value.owner = gui.fastLink(value.owner, "#{value.owner_info.auth_id},u#{value.owner_info.user_id}", 'gui.providers.fastLink', 'goAuthLink') value.owner = gui.fastLink(value.owner.replace /@/, '<span class="text-danger">@</span>', "#{value.owner_info.auth_id},u#{value.owner_info.user_id}", 'gui.providers.fastLink', 'goAuthLink')
value.pool = gui.fastLink(value.pool, value.pool_id, 'gui.providers.fastLink', 'goPoolLink') value.pool = gui.fastLink(value.pool, value.pool_id, 'gui.providers.fastLink', 'goPoolLink')
buttons: [ buttons: [

View File

@ -360,7 +360,7 @@ gui.servicesPools.link = (event) ->
onData: (data) -> onData: (data) ->
$.each data, (undefined_, value) -> $.each data, (undefined_, value) ->
value.group_name = gui.fastLink("#{value.auth_name}\\#{value.name}", "#{value.auth_id},g#{value.id}", 'gui.servicesPools.fastLink', 'goAuthLink') value.group_name = gui.fastLink("#{value.name}<span class='text-danger'>@</span>#{value.auth_name}", "#{value.auth_id},g#{value.id}", 'gui.servicesPools.fastLink', 'goAuthLink')
return return
return return
@ -407,7 +407,7 @@ gui.servicesPools.link = (event) ->
value.in_use = gettext('Yes') value.in_use = gettext('Yes')
else else
value.in_use = gettext('No') value.in_use = gettext('No')
value.owner = gui.fastLink(value.owner, "#{value.owner_info.auth_id},u#{value.owner_info.user_id}", 'gui.servicesPools.fastLink', 'goAuthLink') value.owner = gui.fastLink(value.owner.replace /@/, '<span class="text-danger">@</span>', "#{value.owner_info.auth_id},u#{value.owner_info.user_id}", 'gui.servicesPools.fastLink', 'goAuthLink')
return return