<%@ page import="com.atlassian.jira.ComponentManager"%>
<%@ page import="com.atlassian.jira.plugin.webfragment.model.JiraHelper"%>
<%@ page import="com.atlassian.jira.web.component.webfragment.WebFragmentWebComponent"%>
<%@ page import="com.atlassian.util.profiling.UtilTimerStack"%>
<%@ page import="webwork.action.Action"%>
<%@ page import="org.ofbiz.core.entity.GenericValue"%>
<%@ taglib uri="webwork" prefix="webwork" %>
<%@ taglib uri="jiratags" prefix="jira" %>
<webwork:action name="'util.UserAction'" id="user" />
<html>
<head>
	<title><webwork:text name="'browseproject.title'" /></title>
	<meta name="decorator" content="navigator">
</head>
<body>
<webwork:property value="project" id="project">
<table cellpadding="4" cellspacing="0" border="0" width="100%" bgcolor="bbbbbb" style="border-bottom: 1px solid #bbb;">
<tr>
	<td bgcolor="f0f0f0" colspan="2">
		<h3 class="formtitle"><a href="<%= request.getContextPath() %>/secure/BrowseProjects.jspa" title="<webwork:text name="'browseprojects.all.projects.title'" />"><webwork:text name="'browseprojects.all.projects'" /></a> : <webwork:property value="string('name')" /> <font size="1">(<webwork:text name="'common.concepts.key'" />: <webwork:property value="string('key')" />)</font></h3>
	</td>
</tr>
</table>

<table cellpadding="10" cellspacing="0" border="0" width="100%" bgcolor="ffffff">
<tr>
	<td bgcolor="ffffff" width="70%" valign="top">
		<p>

			<b><webwork:text name="'common.concepts.projectlead'" />:</b>
			<a href="<webwork:url page="/secure/ViewProfile.jspa"><webwork:param name="'name'" value="./string('lead')" /></webwork:url>"><webwork:property value="@user/user(string('lead'))/fullName" /></a>

            <webwork:if test="string('url') != null && string('url')/length > 0">
                <br>
                <b><webwork:text name="'common.concepts.url'" />:</b> <a href="<webwork:property value="string('url')" />" ><webwork:property value="string('url')" /></a>
            </webwork:if>
            <webwork:if test="string('description') != null && string('description')/length > 0">
                <br>
                <b><webwork:text name="'common.concepts.description'" />:</b><br>
                <webwork:property value="string('description')" escape="false" />
            </webwork:if>
        </p>
        <%
            UtilTimerStack.push("Rendering browse project operations");
            GenericValue project = (GenericValue) pageContext.getAttribute("project");
            WebFragmentWebComponent webFragment = (WebFragmentWebComponent) ComponentManager.getComponentInstanceOfType(WebFragmentWebComponent.class);
            JiraHelper jiraHelper = new JiraHelper(request, project);
        %>
        <%= webFragment.getHtml("templates/plugins/webfragments/system-browse-project-operations.vm", "system.browse.project.operations", jiraHelper) %>
        <%
            UtilTimerStack.pop("Rendering browse project operations");
        %>

		<jsp:include page="/includes/panels/browser/tabpanels.jsp"/>
	</td>

	<td bgcolor="fffff0" width="30%" valign="top" nowrap style="border-left: 1px solid #bbb;">

        <webwork:if test="reports/empty == false">
            <h3 class="formtitle"><webwork:text name="'common.concepts.reports'" /></h3>

            <webwork:iterator value="reports">
            <a href="<%= request.getContextPath() %>/secure/ConfigureReport!default.jspa?selectedProjectId=<webwork:property value="/project/long('id')" />&reportKey=<webwork:property value="completeKey" />" title="<webwork:property value="./text(./description)" />"><webwork:property value="label" /></a><br>
            </webwork:iterator>
            <p>
        </webwork:if>

        <%-- these styles are used by the webfragment below --%>
        <style type="text/css">
            .presetfiltertable { width: 90%}
            .presetfilter {}
        </style>
        <%
            UtilTimerStack.push("Rendering Preset Filters for browse project");
            if (webFragment.hasDisplayableItems("system.preset.filters", jiraHelper))
            {
        %>
        <p><h3 class="formtitle"><webwork:text name="'common.concepts.presetfilters'" /></h3>
        <%= webFragment.getHtml("templates/plugins/webfragments/system-preset-filters.vm", "system.preset.filters", jiraHelper) %>
        <%
            }
            UtilTimerStack.pop("Rendering Preset Filters for browse project");
        %>

        <jsp:include page="/includes/panels/browser/openissues.jsp" />
	</td>
</webwork:property>
</tr></table>
</body>
</html>