mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Merge branch 'develop' of https://github.com/HabitRPG/habitrpg into develop
This commit is contained in:
@@ -35,6 +35,8 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
|
|||||||
if (gid == 'habitrpg') $scope.newChallenge.prize = 1;
|
if (gid == 'habitrpg') $scope.newChallenge.prize = 1;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// override score() for tasks listed in challenges-editing pages, so that nothing happens
|
||||||
|
$scope.score = function(){}
|
||||||
|
|
||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
// Challenge
|
// Challenge
|
||||||
|
|||||||
@@ -39,6 +39,11 @@ ChallengeSchema.methods.toJSON = function(){
|
|||||||
var doc = this.toObject();
|
var doc = this.toObject();
|
||||||
doc.memberCount = doc.members ? _.size(doc.members) : doc.memberCount; // @see pre('save') comment above
|
doc.memberCount = doc.members ? _.size(doc.members) : doc.memberCount; // @see pre('save') comment above
|
||||||
doc._isMember = this._isMember;
|
doc._isMember = this._isMember;
|
||||||
|
_.each(['habits','dailys','todos','rewards'], function(type){
|
||||||
|
_.each(doc[type],function(task){
|
||||||
|
task.id = task._id;
|
||||||
|
})
|
||||||
|
})
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ var TaskSchema = new Schema({
|
|||||||
minimize: 'false'
|
minimize: 'false'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FIXME why is this function is never called? Instead we're doing a _.each(obj.tasks) in challenges & user
|
||||||
|
*/
|
||||||
TaskSchema.methods.toJSON = function() {
|
TaskSchema.methods.toJSON = function() {
|
||||||
var doc = this.toObject();
|
var doc = this.toObject();
|
||||||
doc.id = doc._id;
|
doc.id = doc._id;
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ li(ng-repeat='task in obj[list.type+"s"]', class='task {{taskClasses(task, user.
|
|||||||
|
|
||||||
// Habits
|
// Habits
|
||||||
span(ng-if='task.type=="habit"')
|
span(ng-if='task.type=="habit"')
|
||||||
|
// score() is overridden in challengesCtrl to do nothing
|
||||||
a.task-action-btn(ng-if='task.up', ng-click='score(task,"up")') +
|
a.task-action-btn(ng-if='task.up', ng-click='score(task,"up")') +
|
||||||
a.task-action-btn(ng-if='task.down', ng-click='score(task,"down")') -
|
a.task-action-btn(ng-if='task.down', ng-click='score(task,"down")') -
|
||||||
|
|
||||||
@@ -52,8 +53,9 @@ li(ng-repeat='task in obj[list.type+"s"]', class='task {{taskClasses(task, user.
|
|||||||
|
|
||||||
// Daily & Todos
|
// Daily & Todos
|
||||||
span.task-checker.action-yesno(ng-if='task.type=="daily" || task.type=="todo"')
|
span.task-checker.action-yesno(ng-if='task.type=="daily" || task.type=="todo"')
|
||||||
input.visuallyhidden.focusable(id='box-{{task.id}}', type='checkbox', ng-model='task.completed', ng-change='changeCheck(task)')
|
input.visuallyhidden.focusable(ng-if='$state.includes("tasks")', id='box-{{obj._id}}_{{task.id}}', type='checkbox', ng-model='task.completed', ng-change='changeCheck(task)')
|
||||||
label(for='box-{{task.id}}')
|
input.visuallyhidden.focusable(ng-if='!$state.includes("tasks")', id='box-{{obj._id}}_{{task.id}}', type='checkbox')
|
||||||
|
label(for='box-{{obj._id}}_{{task.id}}')
|
||||||
// main content
|
// main content
|
||||||
p.task-text
|
p.task-text
|
||||||
| {{task.text}}
|
| {{task.text}}
|
||||||
@@ -102,11 +104,11 @@ li(ng-repeat='task in obj[list.type+"s"]', class='task {{taskClasses(task, user.
|
|||||||
fieldset.option-group(ng-if='task.type=="habit" && !task.challenge.id')
|
fieldset.option-group(ng-if='task.type=="habit" && !task.challenge.id')
|
||||||
legend.option-title Direction/Actions
|
legend.option-title Direction/Actions
|
||||||
span.task-checker.action-plusminus.select-toggle
|
span.task-checker.action-plusminus.select-toggle
|
||||||
input.visuallyhidden.focusable(id='{{task.id}}-option-plus', type='checkbox', ng-model='task.up')
|
input.visuallyhidden.focusable(id='{{obj._id}}_{{task.id}}-option-plus', type='checkbox', ng-model='task.up')
|
||||||
label(for='{{task.id}}-option-plus')
|
label(for='{{obj._id}}_{{task.id}}-option-plus')
|
||||||
span.task-checker.action-plusminus.select-toggle
|
span.task-checker.action-plusminus.select-toggle
|
||||||
input.visuallyhidden.focusable(id='{{task.id}}-option-minus', type='checkbox', ng-model='task.down')
|
input.visuallyhidden.focusable(id='{{obj._id}}_{{task.id}}-option-minus', type='checkbox', ng-model='task.down')
|
||||||
label(for='{{task.id}}-option-minus')
|
label(for='{{obj._id}}_{{task.id}}-option-minus')
|
||||||
|
|
||||||
// if Daily, calendar
|
// if Daily, calendar
|
||||||
// FIXME display, but disable for challenge tasks
|
// FIXME display, but disable for challenge tasks
|
||||||
@@ -134,7 +136,7 @@ li(ng-repeat='task in obj[list.type+"s"]', class='task {{taskClasses(task, user.
|
|||||||
legend.option-title Due Date
|
legend.option-title Due Date
|
||||||
input.option-content.datepicker(type='text', data-date-format='mm/dd/yyyy', ng-model='task.date')
|
input.option-content.datepicker(type='text', data-date-format='mm/dd/yyyy', ng-model='task.date')
|
||||||
|
|
||||||
fieldset.option-group(ng-if='!task.challenge.id')
|
fieldset.option-group(ng-if='!task.challenge.id && !$state.includes("options.social.challenges")')
|
||||||
legend.option-title Tags
|
legend.option-title Tags
|
||||||
label.checkbox(ng-repeat='tag in user.tags')
|
label.checkbox(ng-repeat='tag in user.tags')
|
||||||
input(type='checkbox', ng-model='task.tags[tag.id]')
|
input(type='checkbox', ng-model='task.tags[tag.id]')
|
||||||
@@ -148,7 +150,7 @@ li(ng-repeat='task in obj[list.type+"s"]', class='task {{taskClasses(task, user.
|
|||||||
a.priority-multiplier-help(href='https://trello.com/card/priority-multiplier/50e5d3684fe3a7266b0036d6/17', target='_blank', popover-title='How difficult is this task?', popover-trigger='mouseenter', popover="This multiplies its point value. Use sparingly, rely instead on our organic value-adjustment algorithms. But some tasks are grossly more valuable (Write Thesis vs Floss Teeth). Click for more info.")
|
a.priority-multiplier-help(href='https://trello.com/card/priority-multiplier/50e5d3684fe3a7266b0036d6/17', target='_blank', popover-title='How difficult is this task?', popover-trigger='mouseenter', popover="This multiplies its point value. Use sparingly, rely instead on our organic value-adjustment algorithms. But some tasks are grossly more valuable (Write Thesis vs Floss Teeth). Click for more info.")
|
||||||
i.icon-question-sign
|
i.icon-question-sign
|
||||||
| Difficulty
|
| Difficulty
|
||||||
.task-controls.tile-group.priority-multiplier(data-id='{{task.id}}')
|
.task-controls.tile-group.priority-multiplier
|
||||||
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!" || !task.priority}', ng-click='task.priority="!"') Easy
|
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!" || !task.priority}', ng-click='task.priority="!"') Easy
|
||||||
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!"}', ng-click='task.priority="!!"') Medium
|
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!"}', ng-click='task.priority="!!"') Medium
|
||||||
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!!"}', ng-click='task.priority="!!!"') Hard
|
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!!"}', ng-click='task.priority="!!!"') Hard
|
||||||
|
|||||||
Reference in New Issue
Block a user