Skip to content

Commit

Permalink
Merge pull request #8 from sebastianbarry/places-survey-place-card-de…
Browse files Browse the repository at this point in the history
…tails

Add start time, end time, and date to each Place card
  • Loading branch information
sebastianbarry authored Mar 29, 2023
2 parents a6ed0af + e521390 commit 1796319
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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>

0 comments on commit 1796319

Please sign in to comment.