mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
challenges: better lock-down on member's tasks (remove actionable items
except stats)
This commit is contained in:
@@ -45,7 +45,7 @@ habitrpg.controller("ChallengesCtrl", ['$scope', '$rootScope', 'User', 'Challeng
|
|||||||
} else {
|
} else {
|
||||||
// TODO figure out a more elegant way about this
|
// TODO figure out a more elegant way about this
|
||||||
//challenge._editing = false;
|
//challenge._editing = false;
|
||||||
$scope.locked = true;
|
challenge._locked = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
habitrpg-tasks(main=false, obj='newChallenge')
|
habitrpg-tasks(main=false, obj='newChallenge')
|
||||||
|
|
||||||
// Challenges list
|
// Challenges list
|
||||||
.accordion-group(ng-repeat='challenge in challenges | filter:search', ng-init='locked=true')
|
.accordion-group(ng-repeat='challenge in challenges | filter:search', ng-init='challenge._locked=true')
|
||||||
.accordion-heading
|
.accordion-heading
|
||||||
ul.pull-right.challenge-accordion-header-specs
|
ul.pull-right.challenge-accordion-header-specs
|
||||||
li {{challenge.members.length}} Subscribers
|
li {{challenge.members.length}} Subscribers
|
||||||
@@ -51,14 +51,14 @@
|
|||||||
.accordion-inner
|
.accordion-inner
|
||||||
// Edit button
|
// Edit button
|
||||||
ul.unstyled()
|
ul.unstyled()
|
||||||
li(ng-show='challenge.leader==user._id && locked')
|
li(ng-show='challenge.leader==user._id && challenge._locked')
|
||||||
button.btn.btn-default(ng-click='locked = false') Edit
|
button.btn.btn-default(ng-click='challenge._locked = false') Edit
|
||||||
li(ng-hide='locked')
|
li(ng-hide='challenge._locked')
|
||||||
button.btn.btn-primary(ng-click='save(challenge)') Save
|
button.btn.btn-primary(ng-click='save(challenge)') Save
|
||||||
button.btn.btn-danger(ng-click='delete(challenge)') Delete
|
button.btn.btn-danger(ng-click='delete(challenge)') Delete
|
||||||
button.btn.btn-default(ng-click='locked=true') Cancel
|
button.btn.btn-default(ng-click='challenge._locked=true') Cancel
|
||||||
|
|
||||||
div(ng-hide='locked')
|
div(ng-hide='challenge._locked')
|
||||||
.-options
|
.-options
|
||||||
input.option-content(type='text', ng-model='challenge.name')
|
input.option-content(type='text', ng-model='challenge.name')
|
||||||
textarea.option-content(cols='3', placeholder='Description', ng-model='challenge.description')
|
textarea.option-content(cols='3', placeholder='Description', ng-model='challenge.description')
|
||||||
@@ -68,6 +68,6 @@
|
|||||||
div(ng-if='challenge.description') {{challenge.description}}
|
div(ng-if='challenge.description') {{challenge.description}}
|
||||||
habitrpg-tasks(obj='challenge', main=false)
|
habitrpg-tasks(obj='challenge', main=false)
|
||||||
h3 Statistics
|
h3 Statistics
|
||||||
div(ng-repeat='member in challenge.members')
|
div(ng-repeat='member in challenge.members', ng-init='member._locked = true')
|
||||||
h4 {{member.profile.name}}
|
h4 {{member.profile.name}}
|
||||||
habitrpg-tasks(main=false, obj='member')
|
habitrpg-tasks(main=false, obj='member')
|
||||||
@@ -31,7 +31,7 @@ script(id='templates/habitrpg-tasks.html', type="text/ng-template")
|
|||||||
.todos-chart(ng-if='list.type == "todo"', ng-show='charts.todos')
|
.todos-chart(ng-if='list.type == "todo"', ng-show='charts.todos')
|
||||||
|
|
||||||
// Add New
|
// Add New
|
||||||
form.addtask-form.form-inline.new-task-form(name='new{{list.type}}form', ng-hide='locked || (list.showCompleted && list.type=="todo")', ng-submit='addTask(list)')
|
form.addtask-form.form-inline.new-task-form(name='new{{list.type}}form', ng-hide='obj._locked || (list.showCompleted && list.type=="todo")', ng-submit='addTask(list)')
|
||||||
span.addtask-field
|
span.addtask-field
|
||||||
input(type='text', ng-model='list.newTask', placeholder='{{list.placeHolder}}', required)
|
input(type='text', ng-model='list.newTask', placeholder='{{list.placeHolder}}', required)
|
||||||
input.addtask-btn(type='submit', value='+', ng-disabled='new{{list.type}}form.$invalid')
|
input.addtask-btn(type='submit', value='+', ng-disabled='new{{list.type}}form.$invalid')
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
li(ng-repeat='task in list.tasks', class='task {{taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', data-id='{{task.id}}')
|
li(ng-repeat='task in list.tasks', class='task {{taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', data-id='{{task.id}}')
|
||||||
// right-hand side control buttons
|
// right-hand side control buttons
|
||||||
.task-meta-controls
|
.task-meta-controls
|
||||||
|
|
||||||
// Due Date
|
// Due Date
|
||||||
span.task-date(ng-if='task.type=="todo" && task.date')
|
span.task-date(ng-if='task.type=="todo" && task.date')
|
||||||
| {{task.date}}
|
| {{task.date}}
|
||||||
@@ -9,26 +10,27 @@ li(ng-repeat='task in list.tasks', class='task {{taskClasses(task, user.filters,
|
|||||||
span(tooltip='Streak Counter')
|
span(tooltip='Streak Counter')
|
||||||
i.icon-forward
|
i.icon-forward
|
||||||
|
|
||||||
i.icon-tags(tooltip='{{appliedTags(user.tags, task.tags)}}', ng-hide='noTags(task.tags)')
|
// Icons only available if you own the tasks (aka, hidden from challenge stats)
|
||||||
|
span(ng-if='!obj._locked')
|
||||||
|
i.icon-tags(tooltip='{{appliedTags(user.tags, task.tags)}}', ng-hide='noTags(task.tags)')
|
||||||
|
// edit
|
||||||
|
a(ng-hide='task._editing', ng-click='editTask(task)', tooltip='Edit')
|
||||||
|
i.icon-pencil(ng-hide='task._editing')
|
||||||
|
// cancel
|
||||||
|
a(ng-hide='!task._editing', ng-click='editTask(task)', tooltip='Cancel')
|
||||||
|
i.icon-remove(ng-hide='!task._editing')
|
||||||
|
//challenges
|
||||||
|
span(ng-if='task.challenge.id')
|
||||||
|
span(ng-if='task.challenge.broken')
|
||||||
|
i.icon-bullhorn(style='background-color:red;', ng-click='task._edit=true', tooltip="Broken Challenge Link")
|
||||||
|
span(ng-if='!task.challenge.broken')
|
||||||
|
i.icon-bullhorn(tooltip="Challenge Task")
|
||||||
|
// delete
|
||||||
|
a(ng-if='!task.challenge.id', ng-click='removeTask(list.tasks, $index)', tooltip='Delete')
|
||||||
|
i.icon-trash
|
||||||
|
|
||||||
// edit
|
|
||||||
a(ng-hide='task._editing', ng-click='editTask(task)', tooltip='Edit')
|
|
||||||
i.icon-pencil(ng-hide='task._editing')
|
|
||||||
// cancel
|
|
||||||
a(ng-hide='!task._editing', ng-click='editTask(task)', tooltip='Cancel')
|
|
||||||
i.icon-remove(ng-hide='!task._editing')
|
|
||||||
//challenges
|
|
||||||
span(ng-if='task.challenge.id')
|
|
||||||
span(ng-if='task.challenge.broken')
|
|
||||||
i.icon-bullhorn(style='background-color:red;', ng-click='task._edit=true', tooltip="Broken Challenge Link")
|
|
||||||
span(ng-if='!task.challenge.broken')
|
|
||||||
i.icon-bullhorn(tooltip="Challenge Task")
|
|
||||||
|
|
||||||
// delete
|
|
||||||
a(ng-if='!task.challenge.id', ng-click='removeTask(list.tasks, $index)', tooltip='Delete')
|
|
||||||
i.icon-trash
|
|
||||||
// chart
|
// chart
|
||||||
a(ng-show='task.history', ng-click='toggleChart(task.id, task)', tooltip='Progress')
|
a(ng-show='task.history', ng-click='toggleChart(obj._id+task.id, task)', tooltip='Progress')
|
||||||
i.icon-signal
|
i.icon-signal
|
||||||
// notes
|
// notes
|
||||||
span.task-notes(ng-show='task.notes && !task._editing', popover-trigger='mouseenter', popover-placement='left', popover='{{task.notes}}', popover-title='{{task.text}}')
|
span.task-notes(ng-show='task.notes && !task._editing', popover-trigger='mouseenter', popover-placement='left', popover='{{task.notes}}', popover-title='{{task.text}}')
|
||||||
@@ -148,4 +150,4 @@ li(ng-repeat='task in list.tasks', class='task {{taskClasses(task, user.filters,
|
|||||||
input.option-content(type='number', ng-model='task.streak')
|
input.option-content(type='number', ng-model='task.streak')
|
||||||
button.task-action-btn.tile.spacious(type='submit') Save & Close
|
button.task-action-btn.tile.spacious(type='submit') Save & Close
|
||||||
|
|
||||||
div(class='{{task.id}}-chart', ng-show='charts[task.id]')
|
div(class='{{obj._id}}{{task.id}}-chart', ng-show='charts[obj._id+task.id]')
|
||||||
|
|||||||
Reference in New Issue
Block a user