Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add start time, end time, and date to each Place card #8

Merged
merged 3 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion www/js/diary/infinite_scroll_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ angular.module('emission.main.diary.infscrolllist',['ui-leaflet',
const numButtons = entry.INPUTS?.length || 1;
height = 272 + (54 * numButtons)
} else if (entry.enter_ts) { // entry is a place
height = 106;
height = 188;
}
if (entry.additionsList) {
height += 40 * entry.additionsList.length; // for each trip/place addition object, we need to increase the card height
Expand Down Expand Up @@ -320,6 +320,12 @@ angular.module('emission.main.diary.infscrolllist',['ui-leaflet',
$scope.data.displayTimelineEntries.push(place);
}
});

// if we are showing places and the last place does not have a display_end_time,
// then we will use the display_start_time + 1 hour for display_end_time
if (!$scope.data.displayTimelineEntries[$scope.data.displayTimelineEntries.length-1].display_end_time && $scope.showPlaces) {
$scope.data.displayTimelineEntries[$scope.data.displayTimelineEntries.length-1].display_end_time = moment($scope.data.displayTimelineEntries[$scope.data.displayTimelineEntries.length-1].enter_fmt_time).parseZone().endOf('day').format("h:mm A");
}
}

angular.extend($scope, {
Expand Down
5 changes: 5 additions & 0 deletions www/templates/diary/place_list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<!-- Place Item Template -->
<ion-item class="unified-diary-item" style="background-color: transparent;" class="list-item">
<!-- Start Time Tag -->
<div class="start-time-tag">{{place.display_start_time}}</div>
<!-- <div class="start-time-tag">{{place.display_enter_time}}</div> -->
<div class="diary-card short" style="padding-top: 10px;">
<div style="width: 100%; margin: auto; padding-block: 5px">
<div class="row" style="font-size: 12px; place-content: center; padding: 8px">
<b><u>{{place.display_date}}</u></b>
</div>
<div class="row place-title">
<!-- Place (Destination of Prev. Trip) -->
<i class="icon ion-location"></i>
Expand All @@ -19,6 +23,7 @@
</div>
</div>
<!-- End Time Tag -->
<div class="stop-time-tag">{{place.display_end_time}}</div>
<!-- <div class="stop-time-tag">{{place.display_exit_time}}</div> -->
</ion-item>
</div>