checklists: collapse individually

This commit is contained in:
Tyler Renelle 2013-12-31 13:48:53 -07:00
parent f6dec231f5
commit 77c6777506
4 changed files with 7 additions and 9 deletions

View file

@ -39,6 +39,7 @@ var HabitSchema = new Schema(
, { _id: false }
);
var collapseChecklist = {type:Boolean, 'default':false};
var checklist = [{
completed:{type:Boolean,'default':false},
text: String,
@ -60,6 +61,7 @@ var DailySchema = new Schema(
s: {type: Boolean, 'default': true},
su: {type: Boolean, 'default': true}
},
collapseChecklist:collapseChecklist,
checklist:checklist,
streak: {type: Number, 'default': 0}
}, TaskSchema)
@ -71,6 +73,7 @@ var TodoSchema = new Schema(
type: {type:String, 'default': 'todo'},
completed: {type: Boolean, 'default': false},
date: String, // due date for todos // FIXME we're getting parse errors, people have stored as "today" and "3/13". Need to run a migration & put this back to type: Date
collapseChecklist:collapseChecklist,
checklist:checklist
}, TaskSchema)
, { _id: false }

View file

@ -234,8 +234,7 @@ var UserSchema = new Schema({
costume: Boolean,
sleep: {type: Boolean, 'default': false},
stickyHeader: {type: Boolean, 'default': true},
disableClasses: {type: Boolean, 'default': false},
inlineChecklists: {type: Boolean, 'default': true}
disableClasses: {type: Boolean, 'default': false}
},
profile: {
blurb: String,

View file

@ -38,10 +38,6 @@ script(type='text/ng-template', id='partials/options.settings.settings.html')
input(type='checkbox', ng-click='toggleStickyHeader()', ng-checked='user.preferences.stickyHeader!==false')
| Sticky Header
i.icon-question-sign(popover-trigger='mouseenter', popover-placement='right', popover='Affix the header to the top of the screen. Unchecked means it scrolls out of view.')
label.checkbox
input(type='checkbox', ng-click='set({"preferences.inlineChecklists":user.preferences.inlineChecklists?false:true})', ng-checked='user.preferences.inlineChecklists!==false')
| Inline Checklists
i.icon-question-sign(popover-trigger='mouseenter', popover-placement='right', popover='Show Daily & To-Do Checklists on the task at all times, instead of only when editing.')
button.btn(ng-click='showTour()', popover-placement='right', popover-trigger='mouseenter', popover='Restart the introductory tour from when you first joined HabitRPG.') Show Tour
br
button.btn(ng-click='showBailey()', popover-trigger='mouseenter', popover-placement='right', popover='Bring Bailey the Town Crier out of hiding so you can review past news.') Show Bailey

View file

@ -67,7 +67,7 @@ li(bindonce='list', bo-id='"task-"+task.id', ng-repeat='task in obj[list.type+"s
markdown(ng-model='task.text',target='_blank')
//-| {{task.text}}
div(ng-if='task.checklist && !$state.includes("options.social.challenges") && user.preferences.inlineChecklists!==false && !task._editing')
div(ng-if='task.checklist && !$state.includes("options.social.challenges") && !task.collapseChecklist && !task._editing')
fieldset.option-group
label.checkbox(ng-repeat='item in task.checklist')
input(type='checkbox',ng-model='item.completed',ng-change='saveTask(task,true)')
@ -112,9 +112,9 @@ li(bindonce='list', bo-id='"task-"+task.id', ng-repeat='task in obj[list.type+"s
form.checklist-form(ng-if='task.checklist')
fieldset.option-group.task-checklist(ng-if='!$state.includes("options.social.challenges")')
legend.option-title
| Checklist 
a(ng-click='task.collapseChecklist = !task.collapseChecklist') Checklist 
i.icon.icon-question-sign(popover='For Dailies, partially-completed Dailies will cut damage (eg, a 4-item checklist with 3 completed, your Daily will hurt you 25% of the damage). For To-Dos, when completed, your points will be multiplied by the number of checklist-items (eg, a 4-item To-Do will be 4x the Exp & GP).',popover-trigger='mouseenter',popover-placement='bottom')
ul.unstyled
ul.unstyled(ng-if='!task.collapseChecklist')
li(ng-repeat='item in task.checklist')
a.pull-right.checklist-icons(ng-click='removeChecklistItem(task,$index,true)')
i.icon-trash(tooltip='Delete')