EnVisageOnline/Beta/Source/EnVisage/Views/Scenarios/Details.cshtml

755 lines
39 KiB
Plaintext

@using EnVisage.Code
@using EnVisage.Code.HtmlHelpers
@using EnVisage.Models
@model ScenarioDetailModel
@{
ViewBag.Title = "Scenario Details";
}
@section stylesheets
{
<link href="~/Content/stylesheets/xeditable.css" rel="stylesheet" type="text/css">
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
<script src="~/Scripts/Angular/angular.min.js"></script>
<script src="~/Scripts/Angular/angular-route.min.js"></script>
<script src="~/Scripts/Angular/xeditable.min.js"></script>
<script src="~/Scripts/Angular/app.js"></script>
<script src="~/Scripts/Angular/controllers.js"></script>
<script type="text/javascript">
var changesMade = false;
var autoclick = false;
function onDataChanged() {
changesMade = true;
}
var uomSwitch = null;
function onDataSaved() {
changesMade = false;
}
function toggleUomMode() {
uomSwitch.switcher('toggle');
}
function setupUnload() {
$(window).on('beforeunload', function () {
if (changesMade) {
return 'Scenario calendar contains unsaved changes. Are you sure you want to leave the page?';
}
});
}
emulateNavUrl = "/Scenarios";
init.push(function() {
setupUnload();
$(".datepicker").datepicker();
$('.input-color').minicolors({
control: 'hue',
position: 'bottom left',
theme: 'bootstrap'
});
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
if (e.target.hash == "#scenarios") { // newly activated tab
//e.relatedTarget // previous active tab
resizeFreez();
}
});
@*$('#@Html.ClientIdFor(model => model.LaborSplitPercentage)_container').slider({
'range': 'min',
'min': 0,
'max': 100,
'value': $('#@Html.ClientIdFor(model => model.LaborSplitPercentage)_container .sliderValue').val(),
change: onDependentChange,
slide: onDependentSlide
});*@
@if (Model.Id != Guid.Empty)
{
@:StartEdit('Scenario', '@Model.Id', "#btnDelete", "#btnsave", "erorMsgPlaceholder");
}
$('#visibilitydropdown').click(function (event) {
if (event.target == null || event.target.nodeName == null || (event.target.nodeName != 'A' && event.target.parentNode.nodeName != 'A')) {
event.stopPropagation();
}
});
uomSwitch = $('#uomMode').switcher({
on_state_content: '# Hours',
off_state_content: '# Resources'
});
$('#uomMode').parent().css("width", "100px").css("float", "right");
$('#chMode').switcher({
on_state_content: 'Quantity',
off_state_content: 'Cost'
});
$('#chMode').parent().css("width", "90px").css("float", "right");
$('#monthWeekMode').switcher({
on_state_content: 'Month',
off_state_content: 'Week'
});
$('#monthWeekMode').parent().css("width", "80px").css("float", "right");
$('#btnsave').click(function () {
if (!changesMade || confirm('Scenario calendar contains unsaved changes that will be lost. Are you sure you want to proceed?')) {
if ($(this).parents('form').valid()) {
blockUI();
$(window).off('beforeunload');
}
return true;
}
else
return false;
});
$('#btnCopySubmit').click(function () {
if (!changesMade || confirm('Scenario calendar contains unsaved changes. Are you sure you want to leave the page?')) {
if ($(this).parents('form').valid()) {
blockUI();
$(window).off('beforeunload');
}
return true;
}
else
return false;
});
$('#btnNewTemplate').click(function () {
if (!changesMade || confirm('Scenario calendar contains unsaved changes that will be lost. Are you sure you want to proceed?')) {
if ($(this).parents('form').valid()) {
blockUI();
$(window).off('beforeunload');
}
return true;
}
else
return false;
});
$('.create').click(function () {
$('.divForCreate').load('@Url.Action("AddNote", "Scenarios", new { Id = Model.Id })', function() {
$(".innerForm input").removeData("validator");
$(".innerForm input").removeData("unobtrusiveValidation");
$.validator.unobtrusive.parseDynamicContent('.innerForm');
});
$('#modalAddNote').modal("show");
});
$('#btnNewNote').click(function () {
$('#divEditNote').load('@Url.Action("AddNote", "Scenarios", new { Id = Model.Id })', function () {
$('#btnSaveNote').click(function () {
if (!changesMade || confirm('Scenario calendar contains unsaved changes that will be lost. Are you sure you want to proceed?')) {
if ($(this).parents('form').valid()) {
blockUI();
$(window).off('beforeunload');
}
return true;
}
else
return false;
});
$(".innerForm input").removeData("validator");
$(".innerForm input").removeData("unobtrusiveValidation");
$.validator.unobtrusive.parseDynamicContent('.innerForm');
});
$('#modalAddNote').modal("show");
});
});
function onDependentSlide(event, ui) {
var value = ui.value;
$(this).children(".sliderValue").val(value);
$(this).children(".sliderTitle").html(value + '%');
}
function onDependentChange(event, ui) {
var value = ui.value;
$(this).children(".sliderValue").val(value);
$(this).children(".sliderTitle").html(value + '%');
}
function onCreateTemplateFailure(xhr) {
unblockUI();
$('#createTemplateModal').html(xhr.responseText);
}
function onCreateTemplateSuccess(data) {
unblockUI();
document.location.href = document.location.href;
}
function onCopyToFailure(xhr) {
//debugger;
$('#copyToModal').html(xhr.responseText);
unblockUI();
}
function onCopyToSuccess(data) {
//debugger;
//$('.validation-summary-errors').html('');
//$('.input-validation-error').removeClass('input-validation-error');
//$('.field-validation-error').remove();
unblockUI();
document.location.href = document.location.href;
}
function editNote(Id) {
if (Id == null || Id == "")
return "";
var text = "@Url.Action("EditNote", "Scenarios", new { Id = "JSVar" })";
text = text.replace("JSVar", Id);
$('#divEditNote').load(text, function () {
$('#btnSaveNote').click(function () {
if (!changesMade || confirm('Scenario calendar contains unsaved changes that will be lost. Are you sure you want to proceed?')) {
if ($(this).parents('form').valid()) {
blockUI();
$(window).off('beforeunload');
}
return true;
}
else
return false;
});
$(".innerForm input").removeData("validator");
$(".innerForm input").removeData("unobtrusiveValidation");
$.validator.unobtrusive.parseDynamicContent('.innerForm');
});
$('#modalAddNote').modal("show");
};
function deleteNote(Id) {
if (Id == null || Id == "")
return "";
if (!changesMade || confirm('Scenario calendar contains unsaved changes that will be lost. Are you sure you want to proceed?')) {
blockUI();
$(window).off('beforeunload');
}
else
return false;
bootbox.confirm({
message: "Are you sure you want to delete this note?",
callback: function (result) {
if (result) {
var text = "@Url.Action("DeleteNote", "Scenarios", new { Id = "JSVar" })";
text = text.replace("JSVar", Id);
blockUI();
$('#divEditNote').load(text, function (response, status, xhr) {
unblockUI();
if (status == "error") {
showErrorModal('Loading error', 'We are sorry but there was an error, please try again later.');
setupUnload();
}
else {
window.location.reload();
}
});
}
},
className: "bootbox-sm"
});
};
function showAdjustMagrinModal(id) {
var url = '@Url.Action("AdjustMargin", "Scenarios", new { id = "idval" })';
url = url.replace('idval', id);
$('#modalAdjustMargin .divForCreate').load(url, function () {
$(".innerForm input").removeData("validator");
$(".innerForm input").removeData("unobtrusiveValidation");
$.validator.unobtrusive.parseDynamicContent('.innerForm');
$('#modalAdjustMargin').modal('show');
$(".datepicker").datepicker({
autoclose: true
});
});
}
function saveMarginConfirmed() {
if (!changesMade || confirm('Scenario calendar contains unsaved changes. Are you sure you want to leave the page?')) {
blockUI();
$(window).off('beforeunload');
}
else
return false;
$('#saveLoader').show();
$('#saveButton').addClass('disabled');
var data = $('#adjustMarginForm').serialize();
var url = '@Url.Action("AdjustMargin", "Scenarios")';
$.post(url, data, function (responseData) {
unblockUI();
if (responseData != null) {
$('#saveLoader').hide();
$('#saveButton').removeClass('disabled');
if (responseData.Status == 'Ok') {
$('#modalAdjustMargin').modal('hide');
setTimeout(function () { window.location.href = window.location.href; }, 500);
} else if (responseData.Status == undefined) {
$('#modalAdjustMargin .divForCreate').html(responseData);
setupUnload();
}
}
});
}
var teamallocations = {};
var sliders = {};
var fired = false;
var othersliders = {};
</script>
}
<div id="erorMsgPlaceholder"></div>
<ul id="uidemo-tabs-default-demo" class="nav nav-tabs">
<li @(string.IsNullOrEmpty(Model.ActiveTab) || Model.ActiveTab == "general" ? "class=active" : string.Empty)>
<a href="#general" data-toggle="tab">Scenario Header<span class="badge badge-primary"></span></a>
</li>
<li @((Model.ActiveTab == "scenarios") ? "class=active" : string.Empty)>
<a href="#scenarios" data-toggle="tab">Scenario Details<span class="badge badge-primary"></span></a>
</li>
<li @((Model.ActiveTab == "rateTable") ? "class=active" : string.Empty)>
<a href="#rateTable" data-toggle="tab">Rates<span class="badge badge-primary"></span></a>
</li>
<li @((Model.ActiveTab == "notes") ? "class=active" : string.Empty)>
<a href="#notes" data-toggle="tab">Notes<span class="badge badge-primary"></span></a>
</li>
</ul>
<div class="tab-content tab-content-bordered">
<div class="tab-pane fade @(string.IsNullOrEmpty(Model.ActiveTab) || Model.ActiveTab == "general" ? "in active" : string.Empty)" id="general">
@using (Html.BeginForm("Details", "Scenarios", FormMethod.Post, new { @class = "panel form-horizontal", @style = "border:0;" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(t => t.Id)
@Html.HiddenFor(t => t.ParentId)
@Html.HiddenFor(t => t.BackUrl)
@Html.HiddenFor(t => t.BackName)
<div class="panel-body" style="border: 0;">
<fieldset id="fsHead">
<legend class="text-bold"></legend>
<div class="form-group">
@Html.LabelFor(model => model.Name, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.Name, new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.Name)
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.ProjectName, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.ProjectName, new { @class = "form-control", @disabled = "disabled" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.TemplateName, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.TemplateName, new { @class = "form-control", @disabled = "disabled" })
</div>
</div>
</fieldset>
<fieldset id="fsBasic">
<legend class="text-bold"></legend>
<div class="form-group">
@Html.LabelFor(model => model.FreezeResources, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 15px;">
@Html.CheckBoxFor(model => model.FreezeResources, new { @class = "form-control" })
</div>
@Html.ValidationMessageFor(model => model.FreezeResources)
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Type, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.DropDownListFor(model => model.Type, Utils.GetScenarioTypes4Wizard(), new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.Type)
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.IsActiveScenario, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 15px;">
@Html.CheckBoxFor(model => model.IsActiveScenario, new { @class = "form-control" })
</div>
@Html.ValidationMessageFor(model => model.IsActiveScenario)
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Color, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.Color, new { @class = "form-control input-color" })
@Html.ValidationMessageFor(model => model.Color)
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.MilestoneStartDate, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.EditorFor(t => t.MilestoneStartDate, new { @class = "datepicker" })
@Html.ValidationMessageFor(model => model.MilestoneStartDate)
</div>
</div>
</fieldset>
<fieldset id="fsNext">
<legend class="text-bold"></legend>
@*<div class="form-group">
@Html.LabelFor(model => model.LaborSplitPercentage, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9" style="width: 200px;">
@Html.EditorFor(model => model.LaborSplitPercentage, new { @class = "form-control", @style = "width:178px;", @disabled = "disabled" })
</div>
</div>*@
<div class="form-group">
@Html.LabelFor(model => model.StartDateStr, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.StartDateStr, new { @class = "form-control", @style = "width:178px;", @disabled = "disabled" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.EndDateStr, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.EndDateStr, new { @class = "form-control", @style = "width:178px;", @disabled = "disabled" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Duration, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.Duration, new { @class = "form-control", @style = "width:178px;", @disabled = "disabled" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.TotalMilestones, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.TotalMilestones, new { @class = "form-control", @style = "width:178px;", @disabled = "disabled" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.UseLMMargin, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 15px;">
@Html.CheckBoxFor(model => model.UseLMMargin, new { @class = "form-control", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.GrowthScenario, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 15px;">
@Html.CheckBoxFor(model => model.GrowthScenario, new { @class = "form-control", @disabled = "disabled" })
</div>
</div>
</div>
@if (!Model.IsRevenueGenerating)
{
<div class="form-group">
<label class="col-sm-3 control-label">Projected Expense</label>
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.TDDirectCosts, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
}
else
{
<div class="form-group">
@Html.LabelFor(model => model.ProjectedRevenue, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.ProjectedRevenue, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
}
@if (Model.CostSavings.HasValue && Model.CostSavingsDuration.HasValue)
{
<div class="form-group">
@Html.LabelFor(model => model.CostSavings, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.CostSavings, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.CostSavingsDuration, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.CostSavingsDuration, new { @class = "form-control", @style = "width:178px;", @disabled = "disabled" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.ROIDateStr, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.ROIDateStr, new { @class = "form-control", @style = "width:178px;", @disabled = "disabled" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.HardSoftSavings, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.HardSoftSavings, new { @class = "form-control", @style = "width:178px;", @disabled = "disabled" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.SavingsAfterCost, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.SavingsAfterCost, new { @class = "form-control", @style = "width:178px;", @disabled = "disabled" })
</div>
</div>
if(Model.IsRevenueGenerating)
{
<div class="form-group">
@Html.LabelFor(model => model.RevenueAfterCost, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.TextBoxFor(model => model.RevenueAfterCost, new { @class = "form-control", @style = "width:178px;", @disabled = "disabled" })
</div>
</div>
}
}
</fieldset>
<fieldset id="fsFin">
<legend class="text-bold"></legend>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<label class="col-sm-3 control-label" style="width: 200px; text-align: center;">Total</label>
<label class="col-sm-3 control-label" style="width: 40px; text-align: center;">|</label>
<label class="col-sm-3 control-label" style="width: 200px; text-align: center;">Labor & Materials</label>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.GrossMargin, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 200px; float: left; margin-right: 56px;">
<span class="input-group-addon">%</span>
@Html.TextBoxFor(model => model.GrossMargin, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
<div class="input-group">
<span class="input-group-addon">%</span>
@Html.TextBoxFor(model => model.LMMargin, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.CalculatedGrossMargin, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 200px; float: left; margin-right: 56px;">
<span class="input-group-addon">%</span>
@Html.TextBoxFor(model => model.CalculatedGrossMargin, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
<div class="input-group">
<span class="input-group-addon">%</span>
@Html.TextBoxFor(model => model.CalculatedGrossMarginLM, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.CalculatedGrossMarginActuals, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 200px; float: left; margin-right: 56px;">
<span class="input-group-addon">%</span>
@Html.TextBoxFor(model => model.CalculatedGrossMarginActuals, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
<div class="input-group">
<span class="input-group-addon">%</span>
@Html.TextBoxFor(model => model.CalculatedGrossMarginLMActuals, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.TDDirectCosts, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 200px; float: left; margin-right: 56px;">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.TDDirectCosts, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
<div class="input-group">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.TDDirectCostsLM, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.TDRevenuePerShot, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 200px; float: left; margin-right: 56px;">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.TDRevenuePerShot, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.LaborMaterialsSplit, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 200px; float: left; margin-right: 56px;">
<span class="input-group-addon">%</span>
@Html.TextBoxFor(model => model.LaborMaterialsSplit, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.BUDirectCosts, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 200px; float: left; margin-right: 56px;">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.BUDirectCosts, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
<div class="input-group">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.BUDirectCostsLM, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.BUDirectCostsActuals, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 200px; float: left; margin-right: 56px;">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.BUDirectCostsActuals, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
<div class="input-group">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.BUDirectCostsLMActuals, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.BUCostsShots, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 200px; float: left; margin-right: 56px;">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.BUCostsShots, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
<div class="input-group">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.BUCostsShotsLM, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.BUCostsShotsActuals, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
<div class="input-group" style="width: 200px; float: left; margin-right: 56px;">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.BUCostsShotsActuals, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
<div class="input-group">
<span class="input-group-addon">$</span>
@Html.TextBoxFor(model => model.BUCostsShotsLMActuals, new { @class = "form-control", @style = "width:138px;", @disabled = "disabled" })
</div>
</div>
</div>
</fieldset>
@Html.ValidationSummary(false, "The Scenario could not be saved due to the following errors:")
<div class="form-group" style="margin-bottom: 0;">
<div class="col-sm-offset-3 col-sm-9">
@if (string.IsNullOrEmpty(Model.BackUrl))
{
<a class="btn btn-primary" href="@(Request.QueryString["ref"] == null ? "/Project" : Convert.ToString(Request.QueryString["ref"]))"><i class="fa fa-backward"></i> Back to @(Request.QueryString["back"] == null ? "list" : Convert.ToString(Request.QueryString["back"]))</a>
}
else
{
<a class="btn btn-primary" href="@(Model.BackUrl)"><i class="fa fa-backward"></i> Back to @(Model.BackName)</a>
}
<button type="button" class="btn btn-primary lockable" data-toggle="modal" data-target="#copyTo">Copy</button>
<button type="button" class="btn btn-primary lockable" data-toggle="modal" data-target="#createTemplate">Create Template</button>
@if (string.IsNullOrEmpty(Model.BackUrl))
{
<a class="btn btn-primary lockable" href="@Url.Action("Edit", "Scenarios", new { @id = Model.Id, @BackUrl = (Request.QueryString["ref"] == null ? "/Project" : Convert.ToString(Request.QueryString["ref"])), @BackName = (Request.QueryString["back"] == null ? "list" : Convert.ToString(Request.QueryString["back"])) })"><i class="fa fa-edit"></i> Update</a>
}
else
{
<a class="btn btn-primary lockable" href="@Url.Action("Edit", "Scenarios", new { @id = Model.Id, @BackUrl = Model.BackUrl, @BackName = Model.BackName })"><i class="fa fa-edit"></i> Update</a>
}
<a onclick="showAdjustMagrinModal('@Model.Id')" data-toggle="popover" data-placement="left" class="btn btn-info popover-warning popover-dark lockable"><i class="fa fa-adjust"></i> Adjust Margin</a>
<button type="submit" class="btn btn-success" id="btnsave"><i class="fa fa-save"></i> Save</button>
</div>
</div>
</div>
}
</div>
<div class="tab-pane @(Model.ActiveTab == "scenarios" ? "in active" : string.Empty)" id="scenarios">
@Html.Partial("_scenarioCalendar", Model)
</div>
<div class="tab-pane fade @(Model.ActiveTab == "rateTable" ? "in active" : string.Empty)" id="rateTable">
@Html.Partial("_rates", Model.RatesModel)
</div>
<div class="tab-pane fade @(Model.ActiveTab == "notes" ? "in active" : string.Empty)" id="notes">
<button class="btn btn-primary lockable" id="btnNewNote"><i class="fa fa-plus"></i> Add Note</button>
<h1></h1>
<div class="table-light table-responsive no-margin" id="noteslist_@Model.Id">
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered no-margin">
<thead>
<tr>
<th>Date</th>
<th>Author</th>
<th>Title</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var note in Model.Notes)
{
<tr>
<td>@((note.DateAdded == null) ? "N/A" : note.DateAdded.ToString("d"))</td>
<td>@note.Author.UserName</td>
<td>@note.Title</td>
<td>
<a href="javascript:void(0)" onclick="editNote('@note.Id');" class="btn btn-primary lockable"><i class="fa fa-edit"></i> Edit</a>
<a href="javascript:void(0)" onclick="deleteNote('@note.Id');" class="btn btn-danger lockable"><i class="fa fa-trash-o"></i> Delete</a>
</td>
</tr>
}
</tbody>
</table>
</div>
<div id="modalAddNote" class="modal fade" tabindex="-1" role="dialog" style="display: none;">
<div class="modal-dialog" id="divEditNote">
@*@Html.Partial("_addNote", new NoteModel(Model.Id)) *@
</div> <!-- / .modal-dialog -->
</div> <!-- / .modal -->
</div>
</div>
<div id="createTemplate" class="modal fade" tabindex="-2" role="dialog" style="display: none;">
<div class="modal-dialog">
<div class="modal-content" id="createTemplateModal">
@Html.Partial("_createTemplateModal", new ScenarioTemplateCreationModel(Model))
</div> <!-- / .modal-content -->
</div> <!-- / .modal-dialog -->
</div> <!-- /.modal -->
<!-- / Modal -->
<div id="modalAdjustMargin" class="modal fade" tabindex="-1" role="dialog" style="display: none;">
<div class="modal-dialog divForCreate" style="width:900px;">
</div> <!-- / .modal-dialog -->
</div> <!-- / .modal -->
<!-- Modal -->
<div id="copyTo" class="modal fade" tabindex="-1" role="dialog" style="display: none;">
<div class="modal-dialog">
<div class="modal-content" id="copyToModal">
@Html.Partial("_copyToModal", Model)
</div> <!-- / .modal-content -->
</div> <!-- / .modal-dialog -->
</div> <!-- /.modal -->
<!-- / Modal -->