<%@ page import="com.atlassian.license.License,
                 com.atlassian.jira.web.action.util.JiraLicenseUtils,
                 com.atlassian.license.LicenseManager"%>
<%@ taglib uri="webwork" prefix="webwork" %>

<webwork:action name="'util.UserAction'" id="user" />

<table width="100%" bgcolor="#bbbbbb" border="0" cellpadding="0" cellspacing="0"><tr><td>
<table border="0" cellpadding="3" cellspacing="1" width="100%">
	<tr bgcolor="#f0f0f0">
        <td class="colHeaderLink" width="50%">
			<b><webwork:text name="'managefilters.viewable'"/></b>
		</td>
		<td class="colHeaderLink" width="5%">
			<b><webwork:text name="'common.concepts.issues'"/></b>
		</td>
		<td class="colHeaderLink" width="10%">
			<b><webwork:text name="'managefilters.sharing'"/></b>
		</td>
        <webwork:if test="remoteUser != null">
            <td class="colHeaderLink" width="15%">
                <b><webwork:text name="'managefilters.subscription'"/></b>
            </td>
        </webwork:if>
        <td class="colHeaderLink" width="20%">
			<b><webwork:text name="'managefilters.author'"/></b>
		</td>
    </tr>

    <webwork:if test="otherFilters != null && otherFilters/size > 0">
        <webwork:iterator value="otherFilters" status="'otherStatus'">
        <tr bgcolor="#<webwork:if test="@otherStatus/odd == true">ffffff</webwork:if><webwork:else>fffff0</webwork:else>">
            <td><a href="<webwork:url value="'IssueNavigator.jspa?mode=hide'"><webwork:param name="'requestId'" value="long('id')" /></webwork:url>"><webwork:property value="string('name')"/></a>
            <webwork:if test="string('description') != null && string('description')/length > 0">
                <br>
                <font size=1>
                    <webwork:property value="string('description')"/>
                </font>
            </webwork:if>
            </td>
            <td width="1%">
                &nbsp;<a href="<webwork:url value="'IssueNavigator.jspa?mode=hide'"><webwork:param name="'requestId'" value="long('id')" /></webwork:url>"><webwork:property value="/countsForFilter(.)" /></a>
            </td>
            <td>
                <table cellpadding="0" cellspacing="0" border="0"><tr>
                <td><%@ include file="/includes/icons/shared.jsp" %></td>
                <td>
                    <webwork:if test="string('author') == string('user')" ><webwork:text name="'managefilters.private'"/></webwork:if>
                    <webwork:elseIf test="string('group') == null" ><webwork:text name="'managefilters.global'"/></webwork:elseIf>
                    <webwork:else><webwork:text name="'managefilters.group'"/>:<webwork:property value="string('group')"/></webwork:else>
                </td>
                </tr></table>
            </td>
            <webwork:if test="remoteUser != null">
                <td nowrap>
                        <%-- The license is required to pass into the include --%>
                    <% License license = LicenseManager.getInstance().getLicense(JiraLicenseUtils.JIRA_LICENSE_KEY);%>
                            <%@ include file="/includes/panels/managefilters_subscription.jsp" %>
                </td>
            </webwork:if>
            <td nowrap>
                <webwork:property value="@user/user(string('author'))/fullName" />
            </td>
        </tr>
        </webwork:iterator>
    </webwork:if>
    <webwork:else>
        <tr>
            <td colspan="5" bgcolor="#ffffff">
                <webwork:text name="'managefilters.noshared'"/>
            </td>
        </tr>
    </webwork:else>
    </table>
</td></tr></table>
<span class="subText"><webwork:text name="'managefilters.note'"/></span>

