added attachment features to Notes.
This commit is contained in:
@@ -8,5 +8,6 @@
|
||||
public string NoteText { get; set; }
|
||||
public bool Pinned { get; set; }
|
||||
public List<string> Tags { get; set; } = new List<string>();
|
||||
public List<UploadedFiles> Files { get; set; } = new List<UploadedFiles>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,24 @@
|
||||
<label for="noteTextArea">@translator.Translate(userLanguage,"Notes")<a class="link-underline link-underline-opacity-0" onclick="showLinks(this)"><i class="bi bi-markdown ms-2"></i></a></label>
|
||||
<textarea class="form-control vehicleNoteContainer" id="noteTextArea">@Model.NoteText</textarea>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
@if (Model.Files.Any())
|
||||
{
|
||||
<div>
|
||||
@await Html.PartialAsync("_UploadedFiles", Model.Files)
|
||||
<label for="serviceRecordFiles">@translator.Translate(userLanguage, "Upload more documents")</label>
|
||||
<input onChange="uploadVehicleFilesAsync(this)" type="file" multiple accept=".png,.jpg,.jpeg,.pdf,.xls,.xlsx,.docx" class="form-control-file" id="noteFiles">
|
||||
<br /><small class="text-body-secondary">@translator.Translate(userLanguage, "Max File Size: 28.6MB")</small>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label for="serviceRecordFiles">@translator.Translate(userLanguage, "Upload documents(optional)")</label>
|
||||
<input onChange="uploadVehicleFilesAsync(this)" type="file" multiple accept=".png,.jpg,.jpeg,.pdf,.xls,.xlsx,.docx" class="form-control-file" id="noteFiles">
|
||||
<br />
|
||||
<small class="text-body-secondary">@translator.Translate(userLanguage, "Max File Size: 28.6MB")</small>
|
||||
}
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label for="noteRecordTag">@translator.Translate(userLanguage,"Tags(optional)")</label>
|
||||
<select multiple class="form-select" id="noteRecordTag">
|
||||
@@ -57,6 +75,14 @@
|
||||
}
|
||||
</div>
|
||||
<script>
|
||||
var uploadedFiles = [];
|
||||
getUploadedFilesFromModel();
|
||||
function getUploadedFilesFromModel() {
|
||||
@foreach (UploadedFiles filesUploaded in Model.Files)
|
||||
{
|
||||
@:uploadedFiles.push({ name: "@filesUploaded.Name", location: "@filesUploaded.Location" });
|
||||
}
|
||||
}
|
||||
function getNoteModelData(){
|
||||
return { id: @Model.Id}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,15 @@
|
||||
new Chart($("#donut-chart"), {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: ['@translator.Translate(userLanguage,"Not Urgent")', '@translator.Translate(userLanguage,"Urgent")', '@translator.Translate(userLanguage,"Very Urgent")', '@translator.Translate(userLanguage,"Past Due")'],
|
||||
labels: [
|
||||
decodeHTMLEntities('@translator.Translate(userLanguage, "Not Urgent")'),
|
||||
decodeHTMLEntities('@translator.Translate(userLanguage, "Urgent")'),
|
||||
decodeHTMLEntities('@translator.Translate(userLanguage, "Very Urgent")'),
|
||||
decodeHTMLEntities('@translator.Translate(userLanguage, "Past Due")')
|
||||
],
|
||||
datasets: [
|
||||
{
|
||||
label: '@translator.Translate(userLanguage,"Reminders by Category")',
|
||||
label: decodeHTMLEntities('@translator.Translate(userLanguage, "Reminders by Category")'),
|
||||
backgroundColor: ["#488f31", "#ffa600", "#de425b", "#cccccc"],
|
||||
data: [
|
||||
@Model.NotUrgentCount,
|
||||
@@ -40,7 +45,7 @@
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: '@translator.Translate(userLanguage,"Reminders by Urgency")',
|
||||
text: decodeHTMLEntities('@translator.Translate(userLanguage, "Reminders by Urgency")'),
|
||||
color: useDarkMode ? "#fff" : "#000"
|
||||
},
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@ function getAndValidateNoteValues() {
|
||||
vehicleId: vehicleId,
|
||||
description: noteDescription,
|
||||
noteText: noteText,
|
||||
files: uploadedFiles,
|
||||
pinned: noteIsPinned,
|
||||
tags: noteTags
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user