UI update requirements updated
This commit is contained in:
@@ -129,7 +129,15 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3">
|
||||
@Html.TextBoxFor(x => x.ApprovedBy, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@{
|
||||
var approver = Model.ApprovedBy;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(approver))
|
||||
{
|
||||
approver = "---";
|
||||
}
|
||||
}
|
||||
@Html.TextBoxFor(x => approver, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.LabelFor(x => x.ApprovedBy, UITranslations.Requirement_Approver)
|
||||
@Html.PopoverFor(x => x.ApprovedBy)
|
||||
@Html.ValidationMessageFor(x => x.ApprovedBy, null, new { @class = "small text-danger" })
|
||||
@@ -148,15 +156,15 @@
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3">
|
||||
@{
|
||||
var approveDate = default(string);
|
||||
var date = this.Model.ApprovedDate?.ToString("dd.MM.yyyy hh:mm");
|
||||
|
||||
if (this.Model.ApprovedDate != default(DateTime))
|
||||
if (string.IsNullOrWhiteSpace(date))
|
||||
{
|
||||
approveDate = this.Model.ApprovedDate?.ToString("dd.MM.yyyy hh:mm");
|
||||
date = "---";
|
||||
}
|
||||
}
|
||||
@Html.TextBoxFor(x => approveDate, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.LabelFor(x => approveDate, $"{UITranslations.Today} - {DateTime.Now:dd.MM.yyyy hh:mm}")
|
||||
@Html.TextBoxFor(x => date, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.LabelFor(x => x.ApprovedDate, UITranslations.Requirements_ApprovedBy_Date)
|
||||
@Html.PopoverFor(x => x.ApprovedDate)
|
||||
@Html.ValidationMessageFor(x => x.ApprovedDate, null, new { @class = "small text-danger" })
|
||||
</div>
|
||||
@@ -386,7 +394,15 @@ else
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3">
|
||||
@Html.TextBoxFor(x => x.ApprovedBy, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly" })
|
||||
@{
|
||||
var approver = Model.ApprovedBy;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(approver))
|
||||
{
|
||||
approver = "---";
|
||||
}
|
||||
}
|
||||
@Html.TextBoxFor(x => approver, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly" })
|
||||
@Html.LabelFor(x => x.ApprovedBy)
|
||||
@Html.PopoverFor(x => x.ApprovedBy)
|
||||
@Html.ValidationMessageFor(x => x.ApprovedBy, null, new { @class = "small text-danger" })
|
||||
@@ -405,15 +421,15 @@ else
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3">
|
||||
@{
|
||||
var approveDate = default(DateTime?);
|
||||
var date = this.Model.ApprovedDate?.ToString("dd.MM.yyyy hh:mm");
|
||||
|
||||
if (this.Model.ApprovedDate != default(DateTime))
|
||||
if (string.IsNullOrWhiteSpace(date))
|
||||
{
|
||||
approveDate = this.Model.ApprovedDate;
|
||||
date = "---";
|
||||
}
|
||||
}
|
||||
@Html.TextBoxFor(x => approveDate, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly" })
|
||||
@Html.LabelFor(x => approveDate)
|
||||
@Html.TextBoxFor(x => date, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly" })
|
||||
@Html.LabelFor(x => x.ApprovedDate)
|
||||
@Html.PopoverFor(x => x.ApprovedDate)
|
||||
@Html.ValidationMessageFor(x => x.ApprovedDate, null, new { @class = "small text-danger" })
|
||||
</div>
|
||||
|
||||
@@ -157,11 +157,6 @@
|
||||
.then(setModalInnerHTML);
|
||||
}
|
||||
|
||||
function updateModalInnerHTML(innerHTML) {
|
||||
let content = modal.querySelector('.modal-content');
|
||||
content.innerHTML = innerHTML;
|
||||
}
|
||||
|
||||
function approveRequirement() {
|
||||
if (modal) {
|
||||
let id = modal.querySelector('input[id="@nameof(CordonelStandardRequirement.Id)"]').value;
|
||||
@@ -174,7 +169,7 @@
|
||||
method: 'post'
|
||||
})
|
||||
.then(response2Text)
|
||||
.then(updateModalInnerHTML)
|
||||
.then(setModalInnerHTML)
|
||||
.then(reloadStandardRequirements);
|
||||
}
|
||||
}
|
||||
@@ -191,7 +186,7 @@
|
||||
method: 'post'
|
||||
})
|
||||
.then(response2Text)
|
||||
.then(updateModalInnerHTML)
|
||||
.then(setModalInnerHTML)
|
||||
.then(reloadStandardRequirements);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,8 +149,16 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3">
|
||||
@Html.TextBoxFor(x => x.ApprovedBy, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.LabelFor(x => x.ApprovedBy, $"{UITranslations.ApproveAs} - {this.User.FullName()}")
|
||||
@{
|
||||
var approver = Model.ApprovedBy;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(approver))
|
||||
{
|
||||
approver = "---";
|
||||
}
|
||||
}
|
||||
@Html.TextBoxFor(x => approver, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.LabelFor(x => x.ApprovedBy, UITranslations.Requirement_Approver)
|
||||
@Html.PopoverFor(x => x.ApprovedBy)
|
||||
@Html.ValidationMessageFor(x => x.ApprovedBy, null, new { @class = "small text-danger" })
|
||||
</div>
|
||||
@@ -167,8 +175,16 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3">
|
||||
@Html.TextBoxFor(x => x.ApprovedDate, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.LabelFor(x => x.ApprovedDate, $"{UITranslations.Today} - {DateTime.Now:dd.MM.yyyy hh:mm}")
|
||||
@{
|
||||
var today = Model.ApprovedDate?.ToString("dd.MM.yyyy hh:mm");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(today))
|
||||
{
|
||||
today = "---";
|
||||
}
|
||||
}
|
||||
@Html.TextBoxFor(x => today, new { @class = "form-control bg-light", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.LabelFor(x => x.ApprovedDate, UITranslations.Requirements_ApprovedBy_Date)
|
||||
@Html.PopoverFor(x => x.ApprovedDate)
|
||||
@Html.ValidationMessageFor(x => x.ApprovedDate, null, new { @class = "small text-danger" })
|
||||
</div>
|
||||
@@ -263,7 +279,7 @@
|
||||
}
|
||||
else if (this.ViewData["CanUnapprove"] is bool canUnapprove && canUnapprove)
|
||||
{
|
||||
<button type="button" class="btn btn-primary" onclick="unapproveRequirement();">
|
||||
<button type="button" class="btn btn-danger" onclick="unapproveRequirement();">
|
||||
<i class="bi bi-x"></i> @UITranslations.Requirements_Unapprove
|
||||
</button>
|
||||
}
|
||||
@@ -394,10 +410,6 @@ else
|
||||
<div class="row">
|
||||
<div class="col pe-0">
|
||||
<div class="form-floating mb-3">
|
||||
@if (string.IsNullOrWhiteSpace(Model.CreatedBy))
|
||||
{
|
||||
Model.CreatedBy = "Nicht vorhanden";
|
||||
}
|
||||
@Html.TextBoxFor(x => x.CreatedBy, new { @class = "form-control", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.LabelFor(x => x.CreatedBy)
|
||||
@Html.PopoverFor(x => x.CreatedBy)
|
||||
@@ -406,11 +418,15 @@ else
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3">
|
||||
@if (string.IsNullOrWhiteSpace(Model.ApprovedBy))
|
||||
{
|
||||
Model.ApprovedBy = "Nicht vorhanden";
|
||||
@{
|
||||
var approver = Model.ApprovedBy;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(approver))
|
||||
{
|
||||
approver = "---";
|
||||
}
|
||||
}
|
||||
@Html.TextBoxFor(x => x.ApprovedBy, new { @class = "form-control", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.TextBoxFor(x => approver, new { @class = "form-control", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.LabelFor(x => x.ApprovedBy)
|
||||
@Html.PopoverFor(x => x.ApprovedBy)
|
||||
@Html.ValidationMessageFor(x => x.ApprovedBy, null, new { @class = "small text-danger" })
|
||||
@@ -428,11 +444,15 @@ else
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3">
|
||||
@if (Model.ApprovedDate is null)
|
||||
{
|
||||
Model.ApprovedDate = DateTime.Now;
|
||||
@{
|
||||
var date = Model.ApprovedDate?.ToString("");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(date))
|
||||
{
|
||||
date = "---";
|
||||
}
|
||||
}
|
||||
@Html.TextBoxFor(x => x.ApprovedDate, new { @class = "form-control", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.TextBoxFor(x => date, new { @class = "form-control", placeholder = "...", @readonly = "readonly", autocomplete = "off" })
|
||||
@Html.LabelFor(x => x.ApprovedDate)
|
||||
@Html.PopoverFor(x => x.ApprovedDate)
|
||||
@Html.ValidationMessageFor(x => x.ApprovedDate, null, new { @class = "small text-danger" })
|
||||
@@ -496,6 +516,7 @@ else
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-floating mb-3">
|
||||
@Html.LabelFor(x => x.Comment, new { @class = "comment opacity-75", style = "top: -15px;" })
|
||||
<textarea autocomplete="off"
|
||||
class="form-control"
|
||||
id="@nameof(Model.Comment)"
|
||||
|
||||
Reference in New Issue
Block a user