Skip to content

Commit

Permalink
Merge pull request #937 from sebastianbarry/place-card-details
Browse files Browse the repository at this point in the history
Add start time, end time, and date to each Place card
  • Loading branch information
shankari authored Mar 29, 2023
2 parents 70013dd + cb57c44 commit d388252
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 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 @@ -317,6 +317,8 @@ angular.module('emission.main.diary.infscrolllist',['ui-leaflet',
const place = cTrip.confirmed_place;
$scope.data.displayTimelineEntries.push(cTrip);
if ($scope.showPlaces && place) {
// if a place (such as the last place) does not have a display_end_time, make the display_end_time be the end of the day
!place.display_end_time ? place.display_end_time = moment(place.enter_fmt_time).parseZone().endOf('day').format("h:mm A") : place.display_end_time = place.display_end_time;
$scope.data.displayTimelineEntries.push(place);
}
});
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>

0 comments on commit d388252

Please sign in to comment.