checklists: add inline-checklists user preference, and hide inlines when

editing
This commit is contained in:
Tyler Renelle 2013-12-30 09:10:15 -07:00
parent bb3bec520e
commit 63541ad268
3 changed files with 8 additions and 3 deletions

View file

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

View file

@ -38,6 +38,10 @@ 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==true')
| 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,8 +67,8 @@ 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 && task.type=="todo"')
fieldset.option-group(ng-if='!$state.includes("options.social.challenges")')
div(ng-if='task.checklist && !$state.includes("options.social.challenges") && user.preferences.inlineChecklists && !task._editing')
fieldset.option-group
label.checkbox(ng-repeat='item in task.checklist')
input(type='checkbox',ng-model='item.completed',ng-change='checkChecklistItem(task)')
| {{item.text}}