<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Project.Master" Inherits="System.Web.Mvc.ViewPage<AdministratorConsole.Models.ProjectController.AllProjectsViewModel>" %>

<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    <div id="content-wrap">
        <% Html.RenderPartial("Navigation/ProjectMain", new Dictionary<String, String>() {
                                                        { "Location", "AllProjects" },
                                                        { "IsAdministrator", ((((RevitUser)ViewData["ClarityUser"]).IsAdministrator) || (((RevitUser)ViewData["ClarityUser"]).IsProjectCoordinator)).ToString() }
           }); %>
        <div id="content">
	        <h1><%= TextHelper.GetText("All Projects") %></h1>
            <% if (Model.AllRemoteProjects.Count > 0)
                { %>
                <% foreach (RemoteProject project in Model.AllRemoteProjects)
                    { %>
                    <div class="project-card-container">
                        <a style="display:block" href="http://<% if (project.CentralServerName.Trim().ToLower() != Model.CurrentServer.ToString().Trim().ToLower()) { %><%= project.CentralServerName %><% } else { %><%= HttpContext.Current.Request.Url.Host %><% } %>/CentralAdministrator/Project/Main/<%= project.ExternalId %>">
				            <div class="project-card">
					            <div class="name"><%= project.Name %></div>
			                    <div class="type">Type: <%= Html.Encode(ProjectTypeHelper.GetProjectTypeName(project.RevitServerVersion))%></div>
			                    <div class="created">Central Server: <%= Html.Encode(project.CentralServerName)%></div>
				            </div>
                        </a>
                    </div>
                <% } %>
                <div class="clear"></div>
            <% }
                else
                { %>
                <% if (((RevitUser)ViewData["ClarityUser"]).IsAdministrator)
                    { %><%= TextHelper.GetText("No projects exist. To create a project, click \"Add Project\".")%><% }
                    else
                    { %><%= TextHelper.GetText("Not assigned to any projects, contact your admin to be able to get access to the projects")%><% } %>
            <% } %>		
        </div>
    </div>
</asp:Content>