mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
Compare commits
9 Commits
83f1a25057
...
b42527f15d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b42527f15d | ||
|
|
cb432d92a6 | ||
|
|
300edd8c4e | ||
|
|
cb77d6675e | ||
|
|
d29b20b16b | ||
|
|
f3999650bd | ||
|
|
bd47ef41f0 | ||
|
|
0c4ccea9ec | ||
|
|
18243ec779 |
@ -742,6 +742,10 @@ namespace CarCareTracker.Helper
|
||||
{
|
||||
return (!fileLocation.StartsWith("/documents") && !fileLocation.StartsWith("documents") && !fileLocation.StartsWith("/temp") && !fileLocation.StartsWith("temp"));
|
||||
}
|
||||
public static bool GetAttachmentIsInTemp(string fileLocation)
|
||||
{
|
||||
return (fileLocation.StartsWith("/temp") || fileLocation.StartsWith("temp"));
|
||||
}
|
||||
public static string GetAttachmentOriginalName(string fileLocation, string originalName)
|
||||
{
|
||||
var fileExt = Path.GetExtension(fileLocation);
|
||||
|
||||
@ -25,7 +25,13 @@
|
||||
<span class="link-body-emphasis"><i class="bi bi-download"></i></span>
|
||||
</a>
|
||||
}
|
||||
<h5 class="modal-title" id="updateAccountModalLabel">@Model.Name</h5>
|
||||
@if (StaticHelper.GetAttachmentIsInTemp(Model.Location))
|
||||
{
|
||||
<h5 class="modal-title" id="updateAccountModalLabel">@Model.Name</h5>
|
||||
} else
|
||||
{
|
||||
<h5 class="modal-title" id="updateAccountModalLabel" data-link="@Model.Location" onclick="handleAttachmentCopyLink(this)" style="cursor:pointer;">@Model.Name</h5>
|
||||
}
|
||||
<a style="cursor:pointer;" onclick="closeAttachmentPreview()"><span class="link-body-emphasis"><i class="bi bi-x-lg"></i></span></a>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@ -38,8 +44,9 @@
|
||||
}
|
||||
else if (StaticHelper.GetAttachmentIsLink(Model.Location))
|
||||
{
|
||||
<div class="align-self-center">
|
||||
<div class="d-flex align-self-center flex-column">
|
||||
<a href="@Model.Location" target="_blank" onclick="noPropagation()" class="btn btn-primary"><span class="me-2">@translator.Translate(userLanguage, "Open Link in New Tab")</span><span><i class="bi bi-box-arrow-up-right"></i></span></a>
|
||||
<a data-link="@Model.Location" href="#" onclick="handleAttachmentCopyLink(this)" class="mt-2 btn btn-secondary"><span class="me-2">@translator.Translate(userLanguage, "Copy Link Address")</span><span><i class="bi bi-link-45deg"></i></span></a>
|
||||
</div>
|
||||
}
|
||||
else if (StaticHelper.GetAttachmentIsImage(Model.Location))
|
||||
@ -51,6 +58,10 @@
|
||||
<div class="d-flex align-self-center flex-column">
|
||||
<a href="@Model.Location" download="@StaticHelper.GetAttachmentOriginalName(Model.Location, Model.Name)" onclick="noPropagation()" class="btn btn-primary"><span class="me-2">@translator.Translate(userLanguage, "Download File")</span><span><i class="bi bi-download"></i></span></a>
|
||||
<a href="@Model.Location" target="_blank" onclick="noPropagation()" class="mt-2 btn btn-secondary"><span class="me-2">@translator.Translate(userLanguage, "Open Link in New Tab")</span><span><i class="bi bi-box-arrow-up-right"></i></span></a>
|
||||
@if (!StaticHelper.GetAttachmentIsInTemp(Model.Location))
|
||||
{
|
||||
<a data-link="@Model.Location" href="#" onclick="handleAttachmentCopyLink(this)" class="mt-2 btn btn-secondary"><span class="me-2">@translator.Translate(userLanguage, "Copy Link Address")</span><span><i class="bi bi-link-45deg"></i></span></a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -184,7 +184,6 @@ function saveInspectionRecordTemplateToVehicle(isEdit) {
|
||||
if (data) {
|
||||
successToast(isEdit ? "Inspection Record Template Updated" : "Inspection Record Template Added.");
|
||||
hideInspectionRecordTemplateModal();
|
||||
getVehicleCollisionRecords(formValues.vehicleId);
|
||||
} else {
|
||||
errorToast(genericErrorMessage());
|
||||
}
|
||||
|
||||
@ -1805,4 +1805,11 @@ function clearModalContentOnHide(modalElem) {
|
||||
modalElem.off('hidden.bs.modal').on('hidden.bs.modal', () => {
|
||||
modalElem.find('.modal-content').html('');
|
||||
});
|
||||
}
|
||||
function handleAttachmentCopyLink(e) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
let textToCopy = $(e).attr('data-link');
|
||||
navigator.clipboard.writeText(textToCopy);
|
||||
successToast("Copied Link to Clipboard");
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user