<%@ taglib uri="webwork" prefix="webwork" %>
<script type="text/javascript">
function toggle(mode, elementId)
{
    var hideElement;
    var showElement;

    if (mode == "hide")
    {
        hideElement = document.getElementById('long_' + elementId);
        showElement = document.getElementById('short_' + elementId);
    }
    else
    {
        hideElement = document.getElementById('short_' + elementId);
        showElement = document.getElementById('long_' + elementId);
    }

    if (hideElement && showElement)
    {
        hideElement.style.display = 'none';
        showElement.style.display = '';
    }
}
</script>

<ui:component label="text('admin.deleteuser.filters.created')" template="textlabel.jsp">
    <webwork:param name="'texthtml'"><webwork:property value="numberOfFilters"/></webwork:param>
</ui:component>
<ui:component label="text('admin.deleteuser.assigned.issues')" template="textlabel.jsp">
    <webwork:param name="'texthtml'"><a href="<webwork:url page="/secure/IssueNavigator.jspa"><webwork:param name="'reset'" value="'true'"/><webwork:param name="'mode'" value="'hide'"/><webwork:param name="'sorter/order'" value="'ASC'"/><webwork:param name="'sorter/field'" value="'priority'"/><webwork:param name="'pid'" value=".././long('id')"/><webwork:param name="'assigneeSelect'" value="'specificuser'"/><webwork:param name="'assignee'" value="name" /></webwork:url>"><webwork:property value="numberOfAssignedIssues"/></a></webwork:param>
</ui:component>
<ui:component label="text('admin.deleteuser.reported.issues')" template="textlabel.jsp">
    <webwork:param name="'texthtml'"><a href="<webwork:url page="/secure/IssueNavigator.jspa"><webwork:param name="'reset'" value="'true'"/><webwork:param name="'mode'" value="'hide'"/><webwork:param name="'sorter/order'" value="'ASC'"/><webwork:param name="'sorter/field'" value="'priority'"/><webwork:param name="'pid'" value=".././long('id')"/><webwork:param name="'reporterSelect'" value="'specificuser'"/><webwork:param name="'reporter'" value="name" /></webwork:url>"><webwork:property value="numberOfReportedIssues"/></a></webwork:param>
</ui:component>

<webwork:if test="numberOfProjectsUserLeads > 0">
<ui:component label="text('admin.deleteuser.project.lead')" template="textlabel.jsp">
    <webwork:param name="'texthtml'">
        <div id="short_projects" onclick="toggle('expand', 'projects');">
            <webwork:property value="projectsUserLeads(5)">
                <webwork:iterator value="." status="'status'">
                    <a href="<webwork:url page="/secure/project/ViewProject.jspa"><webwork:param name="'pid'" value="./long('id')"/></webwork:url>"><webwork:property value="./string('name')"/></a>
                    <webwork:if test="@status/last == false">,&nbsp;</webwork:if>
                </webwork:iterator>
                <webwork:if test="/numberOfProjectsUserLeads > 5"><span style="cursor:pointer;" class="smallgrey" >...&nbsp(<webwork:text name="'admin.deleteuser.projects.lead'"><webwork:param  name="'value0'"><webwork:property value="numberOfProjectsUserLeads" /></webwork:param></webwork:text>)</span></webwork:if>
            </webwork:property>
        </div>
        <webwork:if test="numberOfProjectsUserLeads > 5">
            <div style="display:none; cursor:pointer;" id="long_projects" onclick="toggle('hide', 'projects');">
                <webwork:property value="projectsUserLeads">
                    <webwork:iterator value="." status="'status'">
                        <a href="<webwork:url page="/secure/project/ViewProject.jspa"><webwork:param name="'pid'" value="./long('id')"/></webwork:url>"><webwork:property value="./string('name')"/></a>
                        <webwork:if test="@status/last == false">,&nbsp;</webwork:if>
                    </webwork:iterator>
                </webwork:property>
                <span class="smallgrey">[<webwork:text name="'admin.deleteuser.hide'" />]</span>
            </div>
        </webwork:if>
    </webwork:param>
</ui:component>
</webwork:if>
<webwork:if test="numberOfComponentsUserLeads > 0">
<ui:component label="text('admin.deleteuser.component.lead')" template="textlabel.jsp">
    <webwork:param name="'texthtml'">
        <div id="short_comps" onclick="toggle('expand', 'comps');">
            <webwork:property value="/componentsUserLeads(5)">
                <webwork:iterator value="." status="'status'">
                    <a href="<webwork:url page="/secure/project/ViewProject.jspa"><webwork:param name="'pid'" value="./long('project')"/></webwork:url>"><webwork:property value="./string('name')"/></a><webwork:if test="@status/last == false">,&nbsp;</webwork:if>
                </webwork:iterator>
                <webwork:if test="/numberOfComponentsUserLeads > 5"><span style="cursor:pointer;" class="smallgrey" >...&nbsp(<webwork:text name="'admin.deleteuser.components.lead'"><webwork:param  name="'value0'"><webwork:property value="numberOfComponentsUserLeads" /></webwork:param></webwork:text>)</span></webwork:if>
            </webwork:property>
        </div>
        <webwork:if test="numberOfComponentsUserLeads > 5">
        <div style="display:none; cursor:pointer;" id="long_comps" onclick="toggle('hide', 'comps');">
            <webwork:property value="/componentsUserLeads()">
                <webwork:iterator value="." status="'status'">
                    <a href="<webwork:url page="/secure/project/ViewProject.jspa"><webwork:param name="'pid'" value="./long('project')"/></webwork:url>"><webwork:property value="./string('name')"/></a><webwork:if test="@status/last == false">,&nbsp;</webwork:if>
                </webwork:iterator>
            </webwork:property>
            <span class="smallgrey">[<webwork:text name="'admin.deleteuser.hide'" />]</span>
        </div>
        </webwork:if>
    </webwork:param>
</ui:component>
</webwork:if>