mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
Merge pull request #818 from hargata/Hargata/tag.bug.fix
Fix count labels for odometer and reminder records when filtered by tags
This commit is contained in:
commit
2aa19f4f3b
@ -131,7 +131,7 @@
|
||||
<tr class="d-flex user-select-none" style="cursor:pointer;" onmouseup="stopEvent()" ontouchstart="detectRowLongTouch(this)" ontouchend="detectRowTouchEndPremature(this)" data-rowId="@odometerRecord.Id" oncontextmenu="showTableContextMenu(this)" onmousemove="rangeMouseMove(this)" onclick="handleTableRowClick(this, showEditOdometerRecordModal,@odometerRecord.Id)" data-tags='@string.Join(" ", odometerRecord.Tags)'>
|
||||
<td class="col-2 col-xl-1 flex-grow-1 text-truncate" data-column="date">@odometerRecord.Date.ToShortDateString()</td>
|
||||
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="initialodometer">@odometerRecord.InitialMileage</td>
|
||||
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer">@odometerRecord.Mileage</td>
|
||||
<td class="col-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="odometer" data-record-type="cost">@odometerRecord.Mileage</td>
|
||||
<td class="col-2 flex-grow-1 flex-shrink-1 text-truncate" data-column="distance" data-record-type="distance">@(odometerRecord.DistanceTraveled == default ? "---" : odometerRecord.DistanceTraveled)</td>
|
||||
<td class="col-2 col-xl-3 flex-grow-1 flex-shrink-1 text-truncate" data-column="notes">@StaticHelper.TruncateStrings(odometerRecord.Notes, 75)</td>
|
||||
@foreach (string extraFieldColumn in extraFields)
|
||||
|
||||
@ -140,7 +140,7 @@
|
||||
<span class="badge text-bg-success">@translator.Translate(userLanguage, "Not Urgent")</span>
|
||||
}
|
||||
</td>
|
||||
<td class="col-2 text-truncate flex-grow-1 flex-shrink-1" data-column="metric">
|
||||
<td class="col-2 text-truncate flex-grow-1 flex-shrink-1" data-column="metric" data-record-type="cost">
|
||||
@if (reminderRecord.Metric == ReminderMetric.Date)
|
||||
{
|
||||
@reminderRecord.Date.ToShortDateString()
|
||||
|
||||
@ -139,7 +139,7 @@ function getAndValidateOdometerRecordValues() {
|
||||
|
||||
function recalculateDistance() {
|
||||
//force distance recalculation
|
||||
//reserved for when data is incoherent with negative distances due to non-chronologica order of odometer records.
|
||||
//reserved for when data is incoherent with negative distances due to non-chronological order of odometer records.
|
||||
var vehicleId = GetVehicleId().vehicleId
|
||||
$.post(`/Vehicle/ForceRecalculateDistanceByVehicleId?vehicleId=${vehicleId}`, function (data) {
|
||||
if (data) {
|
||||
@ -362,15 +362,16 @@ function getRecordedOdometer() {
|
||||
return parseFloat(`${recordedOdometer}.${recordedSubOdometer}`);
|
||||
}
|
||||
function saveRecordedOdometer() {
|
||||
//update current odometer value
|
||||
$("#odometerRecordMileage").val(parseInt(getRecordedOdometer()).toString());
|
||||
//save coordinates into a CSV file and upload
|
||||
if (tripCoordinates.length > 0) {
|
||||
if (tripCoordinates.length > 1) {
|
||||
//update current odometer value
|
||||
$("#odometerRecordMileage").val(parseInt(getRecordedOdometer()).toString());
|
||||
//generate attachment
|
||||
$.post('/Files/UploadCoordinates', { coordinates: tripCoordinates }, function (response) {
|
||||
uploadedFiles.push(response);
|
||||
$.post('/Vehicle/GetFilesPendingUpload', { uploadedFiles: uploadedFiles }, function (viewData) {
|
||||
$("#filesPendingUpload").html(viewData);
|
||||
tripCoordinates = [];
|
||||
tripCoordinates = ["Latitude,Longitude"];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -1449,7 +1449,7 @@ function handleModalPaste(e, recordType) {
|
||||
}
|
||||
function handleEnter(e) {
|
||||
if ((event.ctrlKey || event.metaKey) && event.which == 13) {
|
||||
var saveButton = $(e).parent().find(".modal-footer .btn-primary");
|
||||
var saveButton = $(e).parent().find(".modal-footer .btn-primary:not('.d-none')");
|
||||
if (saveButton.length > 0) {
|
||||
saveButton.first().trigger('click');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user