Display components priorities in list and views

This commit is contained in:
Francis Lachapelle
2016-04-21 17:02:07 -04:00
parent 6e1369e6b1
commit 0b7485228c
11 changed files with 108 additions and 22 deletions
@@ -179,6 +179,7 @@
vm.addAttendee = addAttendee;
vm.removeAttendee = removeAttendee;
vm.addAttachUrl = addAttachUrl;
vm.priorityLevel = priorityLevel;
vm.cancel = cancel;
vm.save = save;
vm.attendeeConflictError = false;
@@ -243,6 +244,17 @@
vm.showAttendeesEditor = false;
}
function priorityLevel() {
if (vm.component.priority) {
if (vm.component.priority > 5)
return l('low');
else if (vm.component.priority > 4)
return l('normal');
else
return l('high');
}
}
function save(form, options) {
if (form.$valid) {
vm.component.$save(options)
@@ -38,7 +38,9 @@
' <div class="sg-category" ng-repeat="category in block.component.categories"',
' ng-class="\'bg-category\' + category"',
' ng-style="{ right: ($index * 3) + \'px\' }"></div>',
' <div class="text">{{ block.component.summary }}',
' <div class="text">',
' <span ng-show="block.component.c_priority" class="sg-priority">{{block.component.c_priority}}</span>',
' {{ block.component.summary }}',
' <span class="icons">',
// Component is reccurent
' <md-icon ng-if="block.component.occurrenceId" class="material-icons icon-repeat"></md-icon>',