EnVisageOnline/Beta/Source/EnVisage/Views/Shared/EditorTemplates/ProjectPartModel.cshtml

152 lines
7.2 KiB
Plaintext

@using EnVisage.Code
@model EnVisage.Models.ProjectPartModel
@{
var attributes = ViewData["htmlAttributes"];
}
<div class="panel pm-container">
@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>Part Details
</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" 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 (KeyValuePair<string, List<SelectListItem>> kvp in EnVisage.Code.Utils.GetTypesWithGroups())
{
<optgroup label="@kvp.Key">
@foreach (SelectListItem opt in kvp.Value)
{
if (Model != null && Model.TypeId.ToString() == opt.Value && !ViewBag.TypeSelected)
{
<option value="@opt.Value" selected>@opt.Text</option>
ViewBag.TypeSelected = true;
}
else
{
<option value="@opt.Value">@opt.Text</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" })
@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>
<legend class="text-bold">Teams</legend>
<div class="row">
<div class="col-sm-12">
<div class="form-group no-margin-hr select2-primary">
@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>
<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>
</div>
</div>
<!-- / .panel-body -->
</div>