habitica/views/shared/tasks/lists.jade
2013-11-23 09:26:39 -08:00

93 lines
No EOL
4.6 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Note here, we need this part of Habit to be a directive since we're going to be passing it variables from various
// parts of the app. The alternative would be to create new scopes for different containing sections, but that
// started to get unwieldy
script(id='templates/habitrpg-tasks.html', type="text/ng-template")
.grid
// todo test
.module(bindonce='lists', ng-repeat='list in lists', bo-class='{"rewards-module": list.type==="reward"}')
.task-column(class='{{list.type}}s')
// Todos export/graph options
// todo test
span.option-box.pull-right(bo-if='main && list.type=="todo"')
a.option-action(ng-show='obj.history.todos', ng-click='toggleChart("todos")', tooltip='Progress')
i.icon-signal
//a.option-action(ng-href='/v1/users/{{user.id}}/calendar.ics?apiToken={{user.apiToken}}', tooltip='iCal')
a.option-action(ng-click='notPorted()', tooltip='iCal', ng-show='false')
i.icon-calendar
// <a href="https://www.google.com/calendar/render?cid={{encodeiCalLink(_user.id, _user.apiToken)}}" rel=tooltip title="Google Calendar"><i class=icon-calendar></i></a>
// Gold & Gems
// todo test
span.option-box.pull-right.wallet(bo-if='main && list.type=="reward"')
.money
| {{gold(user.stats.gp)}}
span.shop_gold(tooltip='Gold')
.money
| {{silver(user.stats.gp)}}
span.shop_silver(tooltip='Silver')
// Header
h2.task-column_title {{list.header}}
// Todo Chart
// todo test
.todos-chart(bo-if='list.type == "todo"', ng-show='charts.todos')
// Add New
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(obj[list.type+"s"],list)')
span.addtask-field
input(type='text', ng-model='list.newTask', placeholder='{{list.placeHolder}}', required)
input.addtask-btn(type='submit', value='', ng-disabled='new{{list.type}}form.$invalid')
hr
.alert.alert-warning(ng-if='list.type=="todo" && obj[list.type+"s"].length > 100')
| Clear completed To-Dos&nbsp;
i.icon-question-sign(popover="You have a lot of To-Dos, which can cause performance issues. Be sure to clear them periodically (see \"Completed\" tab at the bottom).", popover-trigger='mouseenter', popover-placement='left')
// Actual List
ul(class='{{list.type}}s', ng-show='obj[list.type + "s"].length > 0', habitrpg-sortable)
include ./task
// Static Rewards
// todo test
ul.items(bo-if='main && list.type=="reward" && user.flags.itemsEnabled')
li.task.reward-item(ng-hide='item.hide', ng-repeat='item in itemStore')
// right-hand side control buttons
.task-meta-controls
span.task-notes(popover-trigger='mouseenter', popover-placement='left', popover='{{item.notes}}', popover-title='{{item.text}}')
i.icon-comment
//left-hand size commands
.task-controls
// todo test
a.task-action-btn.btn-reroll(bo-if='item.type=="reroll"', ng-click='modals.reroll = true')
i.icon-repeat
// todo test
a.money.btn-buy.item-btn(bo-if='item.type!="reroll"', ng-click='buy(item.type)')
span.reward-cost {{item.value}}
span.shop_gold
// main content
// todo test
span(bo-class='{"shop_{{item.classes}} shop-sprite item-img": true}')
p.task-text {{item.text}}
br
// Ads
// todo test
div(bo-if='main && !user.purchased.ads && list.type!="reward"')
span.pull-right
a(ng-click='modals.buyGems=true', tooltip=env.t('removeAds'))
i.icon-remove
// Habit3
ins.adsbygoogle(ng-init='initAds()', style='display: inline-block; width: 234px; height: 60px;', data-ad-client='ca-pub-3242350243827794', data-ad-slot='9529624576')
// Todo Tabs
// todo test
div(bo-if='main && list.type=="todo"', bo-class='{"tabbable tabs-below": list.type=="todo"}')
button.task-action-btn.tile.spacious.bright(ng-show='list.showCompleted', ng-click='clearCompleted()') Clear Completed
// remaining/completed tabs
ul.nav.nav-tabs
li(ng-class='{active: !list.showCompleted}')
a(ng-click='list.showCompleted = false') Remaining
li(ng-class='{active: list.showCompleted}')
a(ng-click='list.showCompleted= true') Complete