Sort users by last name. Make labeleduri a link.

This commit is contained in:
Kevin McCarthy 2007-10-17 13:42:45 -07:00
parent 0b2b499e42
commit f8a9d2021a
2 changed files with 7 additions and 5 deletions

View File

@ -32,19 +32,19 @@ class IPAController(controllers.Controller):
def sort_group_member(self, a, b): def sort_group_member(self, a, b):
"""Comparator function used for sorting group members.""" """Comparator function used for sorting group members."""
if a.getValue('uid') and b.getValue('uid'): if a.getValue('uid') and b.getValue('uid'):
if a.getValue('givenname') == b.getValue('givenname'): if a.getValue('sn') == b.getValue('sn'):
if a.getValue('sn') == b.getValue('sn'): if a.getValue('givenName') == b.getValue('givenName'):
if a.getValue('uid') == b.getValue('uid'): if a.getValue('uid') == b.getValue('uid'):
return 0 return 0
elif a.getValue('uid') < b.getValue('uid'): elif a.getValue('uid') < b.getValue('uid'):
return -1 return -1
else: else:
return 1 return 1
elif a.getValue('sn') < b.getValue('sn'): elif a.getValue('givenName') < b.getValue('givenName'):
return -1 return -1
else: else:
return 1 return 1
elif a.getValue('givenname') < b.getValue('givenname'): elif a.getValue('sn') < b.getValue('sn'):
return -1 return -1
else: else:
return 1 return 1

View File

@ -248,7 +248,9 @@ else:
<th> <th>
<label class="fieldlabel" py:content="fields.labeleduri.label" />: <label class="fieldlabel" py:content="fields.labeleduri.label" />:
</th> </th>
<td>${user.get("labeleduri")}</td> <td>
<a href="${user.get('labeleduri')}">${user.get('labeleduri')}</a>
</td>
</tr> </tr>
</table> </table>