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

Survey refactor expansion UI changes #933

Merged
Show file tree
Hide file tree
Changes from 3 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
11 changes: 8 additions & 3 deletions www/css/main.diary.css
Original file line number Diff line number Diff line change
Expand Up @@ -494,19 +494,24 @@ enketo-notes-list, .notes-list {
}

.notes-list {
padding: 0 5px 5px 5px;
padding: 0 15px 5px 15px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, this puts the trash can a little too far in. How about 15 on the left and 10 on the right?

Suggested change
padding: 0 15px 5px 15px;
padding: 0 10px 5px 15px;

Here's what that looks like
image

text-align: center;
}

.notes-list-entry {
display: grid;
grid-template-columns: 10fr 9fr 1fr;
place-items: center;
align-items: center;
overflow: hidden;
font-size: 13px;
height: 40px;
}

.notes-list-entry .icon {
font-size: 24px;
}
}

/* the note's label will be left-aligned */
.notes-list-entry b {
text-align: left;
}
22 changes: 21 additions & 1 deletion www/js/survey/enketo/enketo-notes-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ angular.module('emission.survey.enketo.notes-list',
};
})

.controller("NotesListCtrl", function ($scope, $state, $element, $window, EnketoSurveyLaunch) {
.controller("NotesListCtrl", function ($scope, $state, $element, $window, EnketoSurveyLaunch, $ionicPopup) {
console.log("Notes List Controller called");

const getScrollElement = function() {
Expand All @@ -41,6 +41,26 @@ angular.module('emission.survey.enketo.notes-list',
return entry.displayTime = begin + " - " + stop;
}

$scope.confirmDeleteEntry = (entry) => {
$scope.currEntry = entry;
$ionicPopup.show({title: 'Delete entry',
templateUrl: `templates/survey/enketo/delete-entry.html`,
scope: $scope,
buttons: [{
text: 'Delete',
type: 'button-cancel',
onTap: function(e) {
return $scope.deleteEntry(entry);
}
},{
text: 'Cancel',
type: 'button-stable',
}]
});

return;
}

$scope.deleteEntry = (entry) => {
console.log("Deleting entry", entry);

Expand Down
2 changes: 1 addition & 1 deletion www/templates/diary/place_list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Start Time Tag -->
<!-- <div class="start-time-tag">{{trip.display_end_time}}</div> -->
<div class="diary-card short" style="padding-top: 10px;">
<div style="width: 100%; margin: auto; padding: 5px">
Copy link
Collaborator

@JGreenlee JGreenlee Mar 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this padding removed?
We can do without it - but if we do remove it, then we have to update the card height values in infinite_scroll_list.js > getTripHeight()

Copy link
Contributor

@shankari shankari Mar 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting. @sebastianbarry please address @JGreenlee's related comment on Monday

<div style="width: 100%;">
shankari marked this conversation as resolved.
Show resolved Hide resolved
<div class="row place-title">
<!-- Place (Destination of Prev. Trip) -->
<i class="icon ion-location"></i>
Expand Down
4 changes: 4 additions & 0 deletions www/templates/survey/enketo/delete-entry.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div style="color:#6e6e6e;">
<p style="font-weight: 700;color:#6e6e6e;margin: 0px;">Are you sure you wish to delete this entry?</p>
<p>{{currEntry.data.label}}<br />{{currEntry.displayTime || setDisplayTime(entry)}}</p>
</div>
2 changes: 1 addition & 1 deletion www/templates/survey/enketo/notes_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<li class="notes-list-entry" ng-repeat="entry in additionEntries | orderBy: 'data.start_ts'">
<b class="two-lines" ng-click="editEntry(entry)">{{entry.data.label}}</b>
<i ng-click="editEntry(entry)">{{entry.displayTime || setDisplayTime(entry)}}</i>
<i class="icon ion-trash-a" ng-click="deleteEntry(entry)"></i>
<i class="icon ion-trash-a" ng-click="confirmDeleteEntry(entry)"></i>
</li>
</ul>
</ion-item>
Expand Down