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

<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    <div id="banner-space">
        <div id="banner-detail-container">
            <div class="left-floating-panel">
	            <div id="project-title"><span><%= Html.Encode(Model.CurrentProject.Name) %></span><span id="project-number"><%= Html.Encode(Model.CurrentProject.Number) %></span></div>
                <div id="project-database-export"><b>Last Database Export:</b> <% if (Model.CurrentProject.LastDatabaseExport.HasValue)
                                                                                  { %><%= DateTimeHelper.ToString(Model.CurrentProject.LastDatabaseExport.Value) %><% } else { %>No Exports<% } %></div>
	        </div>
            <% if (Model.LicenseType != LicenseType.ODP)
               { %>
                <div class="right-floating-panel total-time-container-outer">
                    <div id="total-time-container">
				        <div class="header">Total Time Saved</div>
			            <div class="value"><%= (Math.Ceiling(Model.CurrentProject.CompletedTasksTime.TotalHours)).ToString("000") %> hrs</div>
                    </div>
                </div> 
            <% } %>
            <% Html.RenderPartial("Partials/LaunchableTasks", new LaunchableTasksModel(Model.CurrentProject, Model.TaskSchedules, Model.CurrentUser)); %>
            <div class="clear"></div>
        </div>
    </div>
    <div id="content-wrap">
        <% Html.RenderPartial("Navigation/_SideNavigation", Model.MenuNavigationModel); %>
	    <div id="content">
	        <h1><%= TextHelper.GetText("Delete Project")%></h1>
            <% if ((Model.CurrentProject.DatabaseReady) || ((Model.CurrentProject.DateCreated.HasValue) && ((DateTime.Now - Model.CurrentProject.DateCreated.Value).TotalMinutes > 10))) { %>
			    <h2><%= TextHelper.GetText("Are you sure you want to delete this project?")%></h2>
                <div>
                    <%= TextHelper.GetText("This will delete:") %>
                    <ul>
                        <% if (ProjectTypeHelper.GetIsRevitServerProject(Model.CurrentProject.RevitServerVersion)) { %><li><%= TextHelper.GetText("all files under the project folder") %></li><% } %>
                        <li><%= TextHelper.GetText("all artifacts (PDFs, DWFs, etc)") %></li>
                        <li><%= TextHelper.GetText("the project database") %></li>
                        <% if (Model.AdditionalDatabaseExists) { %><li><%= TextHelper.GetText("the additional database") %></li><% } %>
                        <li><%= TextHelper.GetText("all related task definitions") %></li>
                    </ul>
                </div>
                <div class="right-floating-panel"><input type="button" value="<%= TextHelper.GetText("Delete this project") %>" onclick="window.location='<%= Url.Action("DeleteConfirmed/" + Model.CurrentProject.ExternalId, "Project") %>'" class="button" /></div>
                <div class="clear"></div>
            <% } else { %>
                <div><%= TextHelper.GetText("The project database is currently unavailable and therefore the project cannot be deleted, please try again in several minutes") %></div>
            <% } %>
        </div>
    </div>
</asp:Content>
