Author: thomas.heute(a)jboss.com
Date: 2007-01-26 11:27:18 -0500 (Fri, 26 Jan 2007)
New Revision: 6104
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/listUsers.jsp
Log:
Fix:
JBPORTAL-1218: Listing users will always display an even number of lines
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-01-26
14:22:05 UTC (rev 6103)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-01-26
16:27:18 UTC (rev 6104)
@@ -361,22 +361,25 @@
DelegateContext rowCtx = null;
for (int i = 0; i < Math.min(usersArray.length, usersPerPage); i++)
{
- int oddeven = i % 2;
User user = usersArray[i];
- if (oddeven == 0)
+ rowCtx = ctx.next("row");
+ rowCtx.put("firstname", getFirstName(bundle, user));
+ rowCtx.put("lastname", getLastName(bundle, user));
+ rowCtx.put("username", user.getUserName());
+ if (i % 2 == 0)
{
- rowCtx = ctx.next("row");
+ rowCtx.put("css-class",
"portlet-table-text");
}
-
- rowCtx.put("firstname" + oddeven, getFirstName(bundle,
user));
- rowCtx.put("lastname" + oddeven, getLastName(bundle,
user));
- rowCtx.put("username" + oddeven, user.getUserName());
-
+ else
+ {
+ rowCtx.put("cssClass",
"portlet-table-alternate");
+ }
+
//
Iterator itRoles = membershipModule.getRoles(user).iterator();
while (itRoles.hasNext())
{
- DelegateContext rolesCtx = rowCtx.next("roles" +
oddeven);
+ DelegateContext rolesCtx = rowCtx.next("roles");
rolesCtx.put("name",
((Role)itRoles.next()).getDisplayName());
}
@@ -392,9 +395,9 @@
deleteUrl.setParameter(getOperationName(), OP_DELETEUSER);
deleteUrl.setParameter("userid", "" +
user.getId());
- rowCtx.put("editURL" + oddeven, editURL.toString());
- rowCtx.put("rolesURL" + oddeven, rolesURL.toString());
- rowCtx.put("deleteURL" + oddeven, deleteUrl.toString());
+ rowCtx.put("editURL", editURL.toString());
+ rowCtx.put("rolesURL", rolesURL.toString());
+ rowCtx.put("deleteURL", deleteUrl.toString());
}
if (offset != 0)
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/listUsers.jsp
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/listUsers.jsp 2007-01-26
14:22:05 UTC (rev 6103)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/listUsers.jsp 2007-01-26
16:27:18 UTC (rev 6104)
@@ -19,30 +19,17 @@
</tr>
<n:iterate ctx="row">
<tr>
- <td nowrap="nowrap"
class="portlet-table-alternate">${n:out("row.username0")}</td>
- <td nowrap="nowrap"
class="portlet-table-alternate">${n:out("row.firstname0")}</td>
- <td nowrap="nowrap"
class="portlet-table-alternate">${n:out("row.lastname0")}</td>
- <td nowrap="nowrap" class="portlet-table-alternate">
- <n:iterate
ctx="roles0">${n:out("row.roles0.name")}<br/></n:iterate>
+ <td nowrap="nowrap"
class="${n:out("row.cssClass")}">${n:out("row.username")}</td>
+ <td nowrap="nowrap"
class="${n:out("row.cssClass")}">${n:out("row.firstname")}</td>
+ <td nowrap="nowrap"
class="${n:out("row.cssClass")}">${n:out("row.lastname")}</td>
+ <td nowrap="nowrap"
class="${n:out("row.cssClass")}">
+ <n:iterate
ctx="roles0">${n:out("row.roles.name")}<br/></n:iterate>
</td>
- <td nowrap="nowrap"
class="portlet-table-alternate"><a
-
href="${n:out("row.editURL0")}">${n:i18n("LIST_ACTIONSSHOWPROFILE")}</a>
<a
-
href="${n:out("row.rolesURL0")}">${n:i18n("LIST_ACTIONADDROLESTOUSER")}</a>
<a
-
href="${n:out("row.deleteURL0")}">${n:i18n("LIST_ACTIONDELETEUSER")}</a></td>
+ <td nowrap="nowrap"
class="${n:out("row.cssClass")}"><a
+
href="${n:out("row.editURL")}">${n:i18n("LIST_ACTIONSSHOWPROFILE")}</a>
<a
+
href="${n:out("row.rolesURL")}">${n:i18n("LIST_ACTIONADDROLESTOUSER")}</a>
<a
+
href="${n:out("row.deleteURL")}">${n:i18n("LIST_ACTIONDELETEUSER")}</a></td>
</tr>
- <tr>
- <td nowrap="nowrap"
class="portlet-table-text">${n:out("row.username1")}</td>
- <td nowrap="nowrap"
class="portlet-table-text">${n:out("row.firstname1")}</td>
- <td nowrap="nowrap"
class="portlet-table-text">${n:out("row.lastname1")}</td>
-
- <td nowrap="nowrap" class="portlet-table-text">
- <n:iterate
ctx="roles1">${n:out("row.roles1.name")}<br/></n:iterate>
- </td>
- <td nowrap="nowrap" class="portlet-table-text"><a
-
href="${n:out("row.editURL1")}">${n:i18n("LIST_ACTIONSSHOWPROFILE")}</a>
<a
-
href="${n:out("row.rolesURL1")}">${n:i18n("LIST_ACTIONADDROLESTOUSER")}</a>
<a
-
href="${n:out("row.deleteURL1")}">${n:i18n("LIST_ACTIONDELETEUSER")}</a></td>
- </tr>
</n:iterate>
</table>
Show replies by date