Author: soh...@jb... Date: 2006-05-09 17:23:49 -0400 (Tue, 09 May 2006) New Revision: 4162 Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml Log: http://jira.jboss.com/jira/browse/JBFORUMS-72 - Display a Category of Forums Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java 2006-05-09 20:36:08 UTC (rev 4161) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java 2006-05-09 21:23:49 UTC (rev 4162) @@ -22,6 +22,7 @@ package org.jboss.portlet.forums.ui; import java.text.DecimalFormat; +import java.util.Date; import javax.portlet.ActionRequest; @@ -75,4 +76,21 @@ return percent; } + + /** + * + * + */ + public static String getDateStr(Date date) + { + String dateStr = ""; + + if(date!=null) + { + dateStr = PortalUtil.getSDF().format(date); + } + + + return dateStr; + } } Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2006-05-09 20:36:08 UTC (rev 4161) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2006-05-09 21:23:49 UTC (rev 4162) @@ -61,7 +61,15 @@ <function-signature>java.lang.String getPercentStr(double)</function-signature> </function> + <!-- + --> + <function> + <function-name>dateStr</function-name> + <function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class> + <function-signature>java.lang.String getDateStr(java.util.Date)</function-signature> + </function> + <!-- application specific functions --> <!-- function calculates the vote percent for the specified poll option Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml 2006-05-09 20:36:08 UTC (rev 4161) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml 2006-05-09 21:23:49 UTC (rev 4162) @@ -90,21 +90,32 @@ <!-- display last post information for this forum --> <td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall"> - <c:if test="#{forumrow.lastPost!=null}"> - <!-- TODO: hookup real data here...need to extract out the hardcoded html code from the original portlet --> - ${forumrow.lastPost.createDate}<br/> - <c:if test="#{category.anonymous}"> - POSTER_INFO - </c:if> - <c:if test="#{!category.anonymous}"> - ${forumrow.lastPost.poster.user.userName} - </c:if> - <!-- TODO: LINK TO LAST POST NEEDED --> - <a href="link to lastPost"><img border="0" src="#{forums:themeURL('resourceIconLatestReplyURL')}"/></a> - </c:if> - <c:if test="#{forumrow.lastPost==null}"> - #{resource.No_Posts} - </c:if> + <c:choose> + <c:when test="#{forumrow.lastPost!=null}"> + #{forums:dateStr(forumrow.lastPost.createDate)} + <br/> + <c:choose> + <c:when test="#{category.anonymous}"> + ${forumrow.lastPost.poster.user.userName} + </c:when> + <c:otherwise> + <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}"> + <f:param name="uid" value="#{forumrow.lastPost.poster.user.id}"/> + <h:outputText value="${forumrow.lastPost.poster.user.userName}"/> + </h:outputLink> + </c:otherwise> + </c:choose> + <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}" style="text-decoration: none;"> + <f:param name="t" value="#{forumrow.lastPost.topic.id}"/> + <f:verbatim> + <img border="0" src="#{forums:themeURL('resourceIconLatestReplyURL')}"/> + </f:verbatim> + </h:outputLink> + </c:when> + <c:otherwise> + #{resource.No_Posts} + </c:otherwise> + </c:choose> </span> </td> </tr> |