EnVisageOnline/Main-RMO/Source/EnVisage/Views/Shared/EditorTemplates/ProjectPartModel.cshtml

193 lines
9.9 KiB
Plaintext

@using EnVisage.Code
@model EnVisage.Models.ProjectPartModel
@{
var attributes = ViewData["htmlAttributes"];
}
<div class="panel pm-container" @(!Model.Id.Equals(Guid.Empty) ? "id=p_" + Model.Id.ToString("N") : "" ) >
@Html.HiddenFor(t=>t.Id)
@Html.HiddenFor(t=>t.DeletedPart)
@Html.HiddenFor(t=>t.ParentProjectId)
@Html.HiddenFor(t=>t.CompanyId)
<div class="panel-heading">
<span class="panel-title ui-expander">
<a data-toggle="collapse" data-target="#@Html.IdFor(t=>t.Id)_projectPart">
<i class="panel-title-icon fa fa-tasks"></i><span class="partTitle">Part Details</span>
</a>
</span>
<span class="pull-right">&nbsp;&nbsp;</span>
<div class="btn-group btn-group-xs pull-right pm-delete">
<button onclick="return removePart(this)" class="btn btn-xs btn-danger" href="javascript:void(0)" title="Delete"><i class="fa fa-trash-o"></i></button>
</div>
</div>
<div id="@Html.IdFor(t=>t.Id)_projectPart" class="panel-collapse collapse in">
<div class="panel-body padding-sm">
<div class="row pm-partName">
<div class="col-sm-7 col-lg-5">
<div class="form-group no-margin-hr switcher-block">
@Html.LabelFor(model => model.Name, new { @class = "control-label" })
@Html.TextBoxFor(model => model.Name, new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.Name)
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4 pm-type">
<div class="form-group no-margin-hr">
@Html.LabelFor(model => model.TypeId, new { @class = "control-label" })
@{
ViewBag.TypeSelected = false;
}
<select class="form-control forselect2 type" data-val="true" data-val-required="The Type field is required." id="@Html.IdFor(m => m.TypeId)" name="@EnVisage.Code.HtmlHelpers.HtmlExtensions.NameFor(Html, m => m.TypeId)">
<option value=""></option>
@foreach (var kvp in Utils.GetTypesWithGroups())
{
<optgroup label="@kvp.Key">
@foreach (var opt in kvp.Value)
{
if (Model != null && Model.TypeId == opt.Id && !ViewBag.TypeSelected)
{
<option value="@opt.Id" data-green="0" data-yellow="@opt.PerformanceYellowThreshold" data-red="@opt.PerformanceRedThreshold" selected>@opt.Name</option>
ViewBag.TypeSelected = true;
}
else
{
<option value="@opt.Id" data-green="0" data-yellow="@opt.PerformanceYellowThreshold" data-red="@opt.PerformanceRedThreshold">@opt.Name</option>
}
}
</optgroup>
}
</select>
@Html.ValidationMessageFor(model => model.TypeId)
</div>
</div>
<div class="col-sm-4">
<div class="form-group no-margin-hr">
@Html.LabelFor(model => model.ClientId, new { @class = "control-label" })
@Html.DropDownListFor(model => model.ClientId, Utils.GetClients(true), new { @class = "form-control forselect2 pm-clientId" })
@Html.ValidationMessageFor(model => model.ClientId)
</div>
</div>
<div class="col-sm-4 pm-deadline">
<div class="form-group no-margin-hr">
@Html.LabelFor(model => model.Deadline, new { @class = "control-label" })
@Html.EditorFor(model => model.Deadline, new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.Deadline)
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group no-margin-hr">
@Html.LabelFor(model => model.StatusId, new { @class = "control-label" })
@Html.DropDownListFor(model => model.StatusId, Utils.GetStatuses(true), new { @class = "form-control forselect2 pm-status" })
@Html.ValidationMessageFor(model => model.StatusId)
</div>
</div>
<div class="col-sm-8 pm-probability">
<div class="form-group no-margin-hr">
@Html.LabelFor(model => model.Probability, new { @class = "control-label" })
@Html.EditorFor(model => model.Probability)
@Html.ValidationMessageFor(model => model.Probability)
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4 pm-revenue">
<div class="form-group no-margin-hr switcher-block">
@Html.LabelFor(model => model.IsRevenueGenerating, new { @class = "control-label" })
@Html.CheckBoxFor(model => model.IsRevenueGenerating, new { @class = "switcher form-control" })
@Html.ValidationMessageFor(model => model.IsRevenueGenerating)
</div>
</div>
<div class="col-sm-3 pm-priority">
<div class="form-group no-margin-hr">
@Html.LabelFor(model => model.Priority, new { @class = "control-label" })
@Html.TextBoxFor(model => model.Priority, new { @class = "form-control", @data_val_integer = "Your priority must be a whole number from 1 to 25" })
@Html.ValidationMessageFor(model => model.Priority)
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 pm-details">
<div class="form-group no-margin-hr">
@Html.LabelFor(model => model.Details, new { @class = "control-label" })
@Html.TextAreaFor(model => model.Details, new { @class = "form-control", @rows = "4" })
@Html.ValidationMessageFor(model => model.Details)
</div>
</div>
</div>
<fieldset>
<div class="row">
<div class="col-sm-12 pm-threshold">
<div class="form-group" style="margin:0px 5px 10px 5px;">
<div class="form-group no-margin-hr switcher-block">
@Html.LabelFor(model => model.UseThreshold, new { @class = "control-label" })
@Html.CheckBoxFor(model => model.UseThreshold, new { @class = "switcher form-control" })
<i>(**Performance indicators assume deviation of ACTUALS above or below the PROJECTED amount.)</i>
</div>
<div class="threshold-container" @(Model.UseThreshold ? string.Empty : "style=display:none;")>
<span class="sliderTitle amount" style="color: #ffd800;"><span class="sliderTitle amount-yellow" ></span> - <span class="sliderTitle amount-red" style="color: red;"></span></span>
<div class="slider-range"></div>
@Html.HiddenFor(model => model.PerformanceRedThreshold)
@Html.HiddenFor(model => model.PerformanceYellowThreshold)
</div>
</div>
</div>
</div>
</fieldset>
<fieldset>
<div class="row">
<div class="col-sm-12">
<div class="form-group no-margin-hr select2-primary">
@Html.LabelFor(model => model.AssignedTeams, new { @class = "control-label" })
@Html.ListBoxFor(model => model.AssignedTeams, EnVisage.Code.Utils.GetTeams(false), new { @class = "pm-teams form-control" })
@Html.ValidationMessageFor(model => model.AssignedTeams)
</div>
</div>
</div>
</fieldset>
<fieldset>
<div class="row">
<div class="col-sm-12">
<div class="form-group no-margin-hr select2-primary">
@Html.LabelFor(model => model.StrategicGoals, new { @class = "control-label" })
@Html.ListBoxFor(model => model.StrategicGoals, EnVisage.Code.Utils.GetStrategicGoals(Model.CompanyId, false), new { @class = "pm-goals form-control forselect2" })
@Html.ValidationMessageFor(model => model.StrategicGoals)
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend class="text-bold">Contacts</legend>
<div class="row">
<div class="col-sm-6">
<div class="form-group no-margin-hr select2-primary">
@Html.LabelFor(model => model.InternalContacts, new { @class = "control-label" })
@Html.ListBoxFor(model => model.InternalContacts, EnVisage.Code.Utils.GetProjectInternalContacts(Model.CompanyId), new { @class = "int-contacts form-control forselect2" })
@Html.ValidationMessageFor(model => model.InternalContacts)
</div>
</div>
<div class="col-sm-6">
<div class="form-group no-margin-hr select2-primary">
@Html.LabelFor(model => model.ExternalContacts, new { @class = "control-label" })
@Html.ListBoxFor(model => model.ExternalContacts, EnVisage.Code.Utils.GetProjectExternalContacts(Model.ClientId), new { @class = "ext-contacts form-control forselect2" })
@Html.ValidationMessageFor(model => model.ExternalContacts)
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend class="text-bold">Attachments</legend>
<div class="row">
<div class="col-md-12">
<div class="form-group no-margin-hr attachments">
@Html.EditorFor(model => model.Attachments)
@Html.ValidationMessageFor(model => model.Attachments)
</div>
</div>
</div>
</fieldset>
</div>
</div>
<!-- / .panel-body -->
</div>