svn commit: r597034 - in /lenya/trunk/src/modules-core/administration/usecases: user.jx users.jx

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Wed Nov 21 03:04:25 2007
New Revision: 597034

URL: http://svn.apache.org/viewvc?rev=597034&view=rev
Log:
Sorting groups in user admin usecases

Modified:
    lenya/trunk/src/modules-core/administration/usecases/user.jx
    lenya/trunk/src/modules-core/administration/usecases/users.jx

Modified: lenya/trunk/src/modules-core/administration/usecases/user.jx
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/administration/usecases/user.jx?rev=597034&r1=597033&r2=597034&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/administration/usecases/user.jx (original)
+++ lenya/trunk/src/modules-core/administration/usecases/user.jx Wed Nov 21 03:04:25 2007
@@ -102,9 +102,19 @@
               <td class="lenya-entry-caption"><i18n:text>Groups</i18n:text>:</td>
               <td>
                 <jx:set var="groups" value="${user.getGroups()}"/>
-                <jx:if test="${groups.size() == 0}"><i18n:text>No groups assigned</i18n:text></jx:if>
-                <jx:forEach var="group" items="${groups}"><jx:if test="${group != groups[0]}">, </jx:if>
-                  <a href="${request.pathInfo}?lenya.usecase=admin.group&amp;groupId=${group.getId()}"><jx:out value="${group.getId()}"/></a></jx:forEach>
+                <jx:set var="groupIds" value="${java.util.TreeSet()}"/>
+                <jx:forEach var="group" items="${groups}">
+                  <jx:set var="ignore" value="${groupIds.add(group.getId())}"/>
+                </jx:forEach>
+                <jx:choose>
+                  <jx:when test="${groupIds.size() == 0}">
+                    <i18n:text>No groups assigned</i18n:text>
+                  </jx:when>
+                  <jx:otherwise>
+                    <jx:forEach var="group" items="${groupIds}"><jx:if test="${group != groupIds.first()}">, </jx:if>
+                      <a href="${request.pathInfo}?lenya.usecase=admin.group&amp;groupId=${group}"><jx:out value="${group}"/></a></jx:forEach>
+                  </jx:otherwise>
+                </jx:choose>
               </td>
             </tr>
             

Modified: lenya/trunk/src/modules-core/administration/usecases/users.jx
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/administration/usecases/users.jx?rev=597034&r1=597033&r2=597034&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/administration/usecases/users.jx (original)
+++ lenya/trunk/src/modules-core/administration/usecases/users.jx Wed Nov 21 03:04:25 2007
@@ -73,8 +73,12 @@
             </td>
             <td>
               <jx:set var="groups" value="${user.getGroups()}"/>
-              <jx:forEach var="group" items="${groups}"><jx:if test="${group != groups[0]}">, </jx:if>
-                <a href="${usecase.getSourceURL()}?lenya.usecase=admin.group&amp;groupId=${group.getId()}"><jx:out value="${group.getId()}"/></a></jx:forEach>
+              <jx:set var="groupIds" value="${java.util.TreeSet()}"/>
+              <jx:forEach var="group" items="${groups}">
+                <jx:set var="ignore" value="${groupIds.add(group.getId())}"/>
+              </jx:forEach>
+              <jx:forEach var="group" items="${groupIds}"><jx:if test="${group != groupIds.first()}">, </jx:if>
+                <a href="${usecase.getSourceURL()}?lenya.usecase=admin.group&amp;groupId=${group}"><jx:out value="${group}"/></a></jx:forEach>
             </td>
             <td style="vertical-align: middle">
               <form method="GET" id="form-delete_user">
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.