feature: #158 adds job preference option to include all attachments on lodgment

This commit is contained in:
Gary Sharp
2024-12-11 17:01:42 +11:00
parent 25e3a8e1f1
commit 90c709c4c1
17 changed files with 352 additions and 7 deletions
@@ -0,0 +1,45 @@
@model Disco.Web.Areas.Config.Models.JobPreferences.IndexModel
@{
Authorization.Require(Claims.Config.JobPreferences.Show);
var canConfig = Authorization.Has(Claims.Config.JobPreferences.Configure);
}
<div id="Config_Lodgment" class="form" style="width: 530px;">
<h2>Job Lodgment</h2>
<table>
<tr>
<th style="width: 200px">
&nbsp;
</th>
<td>
@if (canConfig)
{
@Html.CheckBoxFor(model => model.LodgmentIncludeAllAttachmentsByDefault)
<label for="LodgmentIncludeAllAttachmentsByDefault">Include All Attachments by Default</label>
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<div class="info-box">
<p class="fa-p">
<i class="fa fa-info-circle"></i>If enabled, all attachments will be selected by default when lodging a job.
</p>
</div>
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#LodgmentIncludeAllAttachmentsByDefault'),
null,
'@(Url.Action(MVC.API.JobPreferences.UpdateLodgmentIncludeAllAttachmentsByDefault()))',
'includeAllAttachmentsByDefault');
});
</script>
}
else
{
<span>
@(Model.LodgmentIncludeAllAttachmentsByDefault ? "Yes" : "No")
</span>
}
</td>
</tr>
</table>
</div>