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

RECOMMIT Left align enketo-notes-list labels #7

Open
wants to merge 2 commits into
base: places-survey
Choose a base branch
from
Open
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
7 changes: 5 additions & 2 deletions www/css/main.diary.css
Original file line number Diff line number Diff line change
Expand Up @@ -494,19 +494,22 @@ enketo-notes-list, .notes-list {
}

.notes-list {
padding: 0 5px 5px 5px;
padding: 0 15px 5px 15px;
text-align: center;
}

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

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

.notes-list-label {
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 @@ -42,6 +42,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">{{place.display_enter_time}}</div> -->
<div class="diary-card short" style="padding-top: 10px;">
<div style="width: 100%; margin: auto; padding: 5px">
<div style="width: 100%;">
<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>
4 changes: 2 additions & 2 deletions www/templates/survey/enketo/notes_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<ion-item class="notes-list" style="background-color: transparent">
<ul>
<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>
<b class="two-lines notes-list-label" 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