<%@ taglib uri="sitemesh-page" prefix="page" %>
<%@ taglib uri="webwork" prefix="webwork" %>
<%@ page import="com.atlassian.core.util.WebRequestUtils"%>
<webwork:property value="/browseableProjectsInCategory(.)">
<webwork:if test="./empty == false">
<page:applyDecorator name="portletpanel">
    <page:param name="header">
        <% if (WebRequestUtils.isGoodBrowser(request)) { %> <span class="switch actionLinks subText" id="projectCategory_<webwork:property value="../id"/>_<webwork:property value="long('id')" />-switch" onclick="CookieUtil.toggleVisibility('projectCategory_<webwork:property value="../id"/>_<webwork:property value="long('id')" />', '<webwork:property value="/text('displaypane.show')" />', '<webwork:property value="/text('displaypane.hide')" />')"><webwork:property value="text('displaypane.hide')" /></span> <% } %>
        <webwork:text name="'common.concepts.category'" /> : <b><webwork:property value="string('name')" /></b>
    </page:param>
</page:applyDecorator>

<%-- only show the 'span' if it is a good browser --%>
<% if (WebRequestUtils.isGoodBrowser(request)) { %>
<table class="projectCategoryGroup maxWidth" id="projectCategory_<webwork:property value="../id"/>_<webwork:property value="long('id')" />" border="0" cellpadding="0" cellspacing="0">
    <tr><td>
        <webwork:iterator value="." status="'status'" >
            <jsp:include page="/includes/dashboard/project.jsp"/>
            <webwork:if test="@status/last == false"><p /></webwork:if>
        </webwork:iterator>
    </td></tr>
</table>
<% } else { %>
    <webwork:iterator value=".">
        <jsp:include page="/includes/dashboard/project.jsp"/>
    </webwork:iterator>
<% } %>

<script>
<!-- //this script shows or hides the project category based on a cookie
var id = "projectCategory_<webwork:property value="../id"/>_<webwork:property value="long('id')" />";
<%-- Not using WebWork Text tag so that the code works when i18n highlighting is switched on --%>
cookieHide(id, '<webwork:property value="/text('displaypane.show')" escape="false" />');
//-->
</script>
</webwork:if>
</webwork:property>