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

<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.DevExpress().RenderScripts(Page, 
        new Script { ExtensionSuite = ExtensionSuite.Editors }); %>
    <% Html.DevExpress().RenderStyleSheets(Page,
            new StyleSheet { ExtensionSuite = ExtensionSuite.Editors }
        ); %>
    <script language="javascript" type="text/javascript">
        function loadPurgeArtifacts() {
            $.ajax({
                type: 'GET',
                url: '<%= Url.Action("GetPurgeArtifacts", "Project") %>',
                data: {
                    projectId: "<%= Model.CurrentProject.ExternalId %>",
                },
                cache: false,
                success: function (response) {
                    $("#modal-overlay").html(response);
                },
                complete: function () {
                    showModelDialog();
                }
            });
        }
    </script>
    <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 != null)
                                                                                  { %><%= 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">
	        <div class="left-floating-panel"><h1>Manage Artifacts</h1></div>
            <div class="right-floating-panel"><input type="button" value="Purge" class="button" onclick="loadPurgeArtifacts();" /></div>
            <div class="clear"></div>
            <% if (Model.ArtifactPathExists()) { %>
                <div id="ArtifactsViewContainer"><form><% Html.RenderPartial("Partials/EditArtifactsControl", Model.GetEditArtifactsControlViewModel()); %></form></div>
            <% } else { %>
                <div class="notice-container"><%= TextHelper.GetText("Unable to access this project's artifact directory") %></div>
            <% } %>
        </div>
    </div>
</asp:Content>