Merge branch 'develop' of https://github.com/lefnire/habitrpg into develop

This commit is contained in:
Slappybag 2013-05-12 12:30:34 +01:00
commit 7986464132
23 changed files with 177 additions and 198 deletions

View file

@ -83,7 +83,7 @@
"Delete": "Изтрий",
"Progress": "Прогрес",
"Score": "Точки",
"Daily": "Ежедневни задачи",
"Dailies": "Ежедневни задачи",
"NewDaily": "Нова задача",
"Repeat": "Повтаряй",
"Su": "Нед",

View file

@ -55,7 +55,7 @@
"Delete": "Delete",
"Progress": "Progress",
"Score": "Score",
"Daily": "Dailys",
"Dailies": "Dailies",
"NewDaily": "New Daily",
"Repeat": "Repeat",
"Su": "Su",

View file

@ -38,7 +38,7 @@ module.exports.app = (appExports, model) ->
taskTypes = ['habit', 'daily', 'todo', 'reward']
batch.set 'tasks', {}
_.each taskTypes, (type) -> batch.set "#{type}Ids", []
batch.set 'balance', 1 if user.get('balance') < 1 #only if they haven't manually bought tokens
batch.set 'balance', 1 if user.get('balance') < 1 #only if they haven't manually bought gems
# Reset stats
batch.set 'stats.hp', 50

View file

@ -24,16 +24,18 @@ module.exports.app = (appExports, model) ->
appExports.filtersDeleteTag = (e, el) ->
tags = user.get('tags')
tagId = $(el).attr('data-tag-id')
tag = e.at "_user.tags." + $(el).attr('data-index')
tagId = tag.get('id')
#something got corrupted, let's clear the corrupt tags
unless tagId
user.set 'tags', _.filter( tags, ((t)-> t?.id) )
user.set 'filters', {}
return
model.del "_user.filters.#{tagId}"
_.each tags, (tag, i) ->
if tag.id is tagId
tags.splice(i,1)
model.del "_user.filters.#{tag.id}"
tag.remove()
# remove tag from all tasks
_.each user.get("tasks"), (task) ->
user.del "tasks.#{task.id}.tags.#{tagId}"
model.set "_user.tags", tags , -> browser.resetDom(model)
_.each user.get("tasks"), (task) -> user.del "tasks.#{task.id}.tags.#{tagId}"

View file

@ -58,7 +58,7 @@ viewHelpers = (view) ->
view.fn "truarr", (num) -> num-1
view.fn 'count', (arr) -> arr?.length or 0
view.fn "tokens", (gp) -> return gp/0.25
view.fn "gems", (gp) -> return gp/0.25
view.fn "encodeiCalLink", (uid, apiToken) ->
loc = window?.location.host or process.env.BASE_URL
@ -125,14 +125,17 @@ viewHelpers = (view) ->
###
Tasks
###
view.fn 'taskClasses', (task, filters, dayStart, lastCron) ->
view.fn 'taskClasses', (task, filters, dayStart, lastCron, showCompleted=false) ->
return unless task
{type, completed, value, repeat} = task
# completed / remaining toggle
return 'hidden' if (type is 'todo') and (completed != showCompleted)
for filter, enabled of filters
if enabled and not task.tags?[filter]
# All the other classes don't matter
return 'hide'
return 'hidden'
classes = type
@ -150,6 +153,8 @@ viewHelpers = (view) ->
classes += " completed"
else
classes += " uncompleted"
else if type is 'habit'
classes += ' habit-wide' if task.down and task.up
if value < -20
classes += ' color-worst'
@ -187,6 +192,7 @@ viewHelpers = (view) ->
view.fn 'appliedTags', (userTags, taskTags) ->
arr = []
_.each userTags, (t) ->
return unless t?
arr.push(t.name) if taskTags?[t.id]
arr.join(', ')

View file

@ -82,16 +82,20 @@ setupSubscriptions = (page, model, params, next, cb) ->
return page.redirect('/logout') #delete model.session.userId
return cb()
party = party.get()
# (1) Solo player
return finished([selfQ, 'tavern'], ['_user', '_tavern']) unless party
return finished([selfQ, 'tavern'], ['_user', '_tavern']) unless party.get()
## (2) Party has members, subscribe to those users too
membersQ = model.query('users').party(party.members)
# Note - selfQ *must* come after membersQ in subscribe, otherwise _user will only get the fields restricted by party-members in
# store.coffee. Strang bug, but easy to get around
return finished [partyQ, membersQ, selfQ, 'tavern'], ['_party', '_partyMembers', '_user', '_tavern']
membersQ = model.query('users').party(party.get('members'))
# Fetch instead of subscribe. There's nothing dynamic we need from members just yet, they'll update _party instead.
# This may change in the future.
membersQ.fetch (err, members) ->
return next(err) if err
model.ref '_partyMembers', members
# Note - selfQ *must* come after membersQ in subscribe, otherwise _user will only get the fields restricted by party-members in store.coffee. Strang bug, but easy to get around
return finished([partyQ, selfQ, 'tavern'], ['_party', '_user', '_tavern'])
# ========== ROUTES ==========

View file

@ -90,6 +90,7 @@ module.exports.app = (appExports, model, app) ->
text = model.get input
# Check for non-whitespace characters
return unless /\S/.test text
model.set(input, '')
message =
id: model.id()
@ -100,17 +101,20 @@ module.exports.app = (appExports, model, app) ->
user: helpers.username(model.get('_user.auth'), model.get('_user.profile.name'))
timestamp: +new Date
# FIXME - used to be we used chat.unshift(message) (see code before this commit, cd6a7fb), but seemed Racer
# would queue the unshift, and keep trying to send when connection detected. But each send would go through, so we'd
# get tons of duplicates. To avoid that, we're just doing a model.set now, but that has the problem of clobbering
# other senders if sent at the same time
messages = chat.get() || []
messages =_.uniq messages, true, ((m) -> m?.id) # get rid of dupes
messages.unshift message
messages.splice(200)
model.set path, messages
model.set(input, '')
# FIXME - sometimes racer will send many duplicates via chat.unshift. I think because it can't make connection, keeps
# trying, but all attempts go through. Unfortunately we can't do chat.set without potentially clobbering other chatters,
# and we can't make chat an object without using refLists. hack solution for now is to unshift, and if there are dupes
# after we set to unique
chat.unshift message, ->
messages = chat.get() || []
count = messages.length
messages =_.uniq messages, true, ((m) -> m?.id) # get rid of dupes
#There were a bunch of duplicates, let's clean it up
if messages.length != count
messages.splice(200)
chat.set messages
else
chat.remove(200)
model.on 'unshift', '_party.chat', -> $('.chat-message').tooltip()
model.on 'unshift', '_tavern.chat.messages', -> $('.chat-message').tooltip()

View file

@ -54,21 +54,21 @@ module.exports.app = (appExports, model) ->
appExports.buyHatchingPotion = (e, el) ->
name = $(el).attr 'data-hatchingPotion'
newHatchingPotion = _.findWhere hatchingPotions, name: name
tokens = user.get('balance') * 4
if tokens >= newHatchingPotion.value
if confirm "Buy this hatching potion with #{newHatchingPotion.value} of your #{tokens} Gems?"
gems = user.get('balance') * 4
if gems >= newHatchingPotion.value
if confirm "Buy this hatching potion with #{newHatchingPotion.value} of your #{gems} Gems?"
user.push 'items.hatchingPotions', newHatchingPotion.name
user.set 'balance', (tokens - newHatchingPotion.value) / 4
user.set 'balance', (gems - newHatchingPotion.value) / 4
else
$('#more-tokens-modal').modal 'show'
$('#more-gems-modal').modal 'show'
appExports.buyEgg = (e, el) ->
name = $(el).attr 'data-egg'
newEgg = _.findWhere pets, name: name
tokens = user.get('balance') * 4
if tokens >= newEgg.value
if confirm "Buy this egg with #{newEgg.value} of your #{tokens} Gems?"
gems = user.get('balance') * 4
if gems >= newEgg.value
if confirm "Buy this egg with #{newEgg.value} of your #{gems} Gems?"
user.push 'items.eggs', newEgg
user.set 'balance', (tokens - newEgg.value) / 4
user.set 'balance', (gems - newEgg.value) / 4
else
$('#more-tokens-modal').modal 'show'
$('#more-gems-modal').modal 'show'

View file

@ -275,17 +275,17 @@ cron = (model) ->
today = +new Date
daysPassed = helpers.daysBetween(user.get('lastCron'), today, user.get('preferences.dayStart'))
if daysPassed > 0
# User is resting at the inn. Used to be we un-checked each daily without performing calculation (see commits before fb29e35)
# but to prevent abusing the inn (http://goo.gl/GDb9x) we now do *not* calculate dailies, and simply set lastCron to today
if user.get('flags.rest') is true
return user.set('lastCron', today)
batch = new character.BatchUpdate(model)
batch.startTransaction()
obj = batch.obj()
batch.set 'lastCron', today
if user.get('flags.rest') is true
_.each model.get('_dailyList'), (daily) -> batch.set("tasks.#{daily.id}.completed", false)
browser.resetDom(model)
batch.commit()
return
hpBefore = obj.stats.hp #we'll use this later so we can animate hp loss
# Tally each task
todoTally = 0

View file

@ -7,14 +7,15 @@ character = require './character'
module.exports.app = (appExports, model) ->
user = model.at('_user')
appExports.addTask = (e, el, next) ->
appExports.addTask = (e, el) ->
type = $(el).attr('data-task-type')
newModel = model.at('_new' + type.charAt(0).toUpperCase() + type.slice(1))
text = newModel.get()
# Don't add a blank task; 20/02/13 Added a check for undefined value, more at issue #463 -lancemanfv
return if /^(\s)*$/.test(text) || text == undefined
newTask = {id: model.id(), type: type, text: text, notes: '', value: 0}
activeFilters = _.reduce user.get('filters'), ((memo,v,k) -> memo[k]=v if v;memo), {}
newTask = {id: model.id(), type: type, text: text, notes: '', value: 0, tags: activeFilters}
switch type
when 'habit'
newTask = _.defaults {up: true, down: true}, newTask
@ -98,28 +99,8 @@ module.exports.app = (appExports, model) ->
chart = new google.visualization.LineChart(document.getElementById( chartSelector ))
chart.draw(data, options)
appExports.changeContext = (e, el) ->
# Get the data from the element
targetSelector = $(el).attr('data-target')
newContext = $(el).attr('data-context')
newActiveNav = $(el).parent('li')
# If the clicked nav is already active, do nothing
if newActiveNav.hasClass('active')
return
# Find the old active nav and context
oldActiveNav = $(el).closest('ul').find('> .active')
oldContext = oldActiveNav.find('a').attr('data-context')
# Set the new active nav
oldActiveNav.removeClass('active')
newActiveNav.addClass('active')
# Set the new context on the target
target = $(targetSelector)
target.removeClass(oldContext)
target.addClass(newContext)
appExports.todosShowRemaining = -> model.set '_showCompleted', false
appExports.todosShowCompleted = -> model.set '_showCompleted', true
setUndo = (stats, task) ->
previousUndo = model.get('_undo')

View file

@ -28,7 +28,7 @@ translate = (req, res, next) ->
model = req.getModel()
# Set locale to bg on dev
model.set '_i18n.locale', 'bg' if process.env.NODE_ENV is "development"
#model.set '_i18n.locale', 'bg' if process.env.NODE_ENV is "development"
next()

View file

@ -13,7 +13,7 @@
.tavern-pane
position relative
height 300px
height 250px
.tavern-chat, .party-chat

View file

@ -82,11 +82,11 @@ hr
}
}
/* Tokens
/* Gems
-------------------------------------------------- */
/* Adaptation of GH's social-count for Tokens */
/* Adaptation of GH's social-count for Gems */
.token-cost
.gem-cost
border: 1px solid #D4D4D4;
font-size: 11px;
font-weight: bold;
@ -98,7 +98,7 @@ hr
background-color: #FAFAFA;
position: relative;
.token-cost::before
.gem-cost::before
content: "";
display: block;
width: 0;
@ -111,7 +111,7 @@ hr
top: 50%;
margin-top: -6px;
.token-cost::after
.gem-cost::after
content: "";
display: block;
width: 0;

View file

@ -1,11 +1,11 @@
.token-wallet
.gem-wallet
cursor: pointer
.tile
background-color: darken($neutral, 10%)
.add-token-btn
.add-gems-btn
opacity: 0
&:hover, &:focus
.add-token-btn
.add-gems-btn
opacity: 1
background-color: $good
.tile

View file

@ -383,21 +383,6 @@ form
// todos ui
// --------
// context switching
.context-enabled
.display-context-dependant,
.task-list > li
display: none
&.context-completed
.show-for-completed, .completed
display: block
&.context-uncompleted
.show-for-uncompleted, .uncompleted
display: block
// nav tabs
.nav-tabs
margin-top: 1.5em

View file

@ -14,6 +14,11 @@
<p>
<h4>5/12/2013</h4>
<ul>
<li>Renamed "Tokens" to "Gems". Tokens caused confusion.</li>
</ul>
<h4>5/10/2013</h4>
<ul>
<li>Less harsh death: Used to be you lose everything, now you lose GP & one random gear piece, 1 level. We're working on a <a _target='blank' href="https://trello.com/card/death-mechanic/50e5d3684fe3a7266b0036d6/204">really cool death mechanic here.</a>, but this is a stop-gap so people don't lose heart presently.</li>

View file

@ -10,9 +10,9 @@
{#each _user.tags as :tag}
<li class="{#if _user.filters[:tag.id]}active{/}" style='position:relative;'>
{#if _editingTags}
<div class="input-append option-group tag-editing" >
<div class="input-append option-group tag-editing" >
<input class="input input-small option-content tag-editing-pill" type="text" value='{:tag.name}' />
<span class="add-on tag-editing-pill"><a class='pull-right' x-bind=click:filtersDeleteTag data-tag-id={{:tag.id}}><i class='icon-trash'></i></a></span>
<span class="add-on tag-editing-pill"><a class='pull-right' x-bind=click:filtersDeleteTag data-index="{$index}"><i class='icon-trash'></i></a></span>
</div>
{else}
<a data-tag-id="{{:tag.id}}" x-bind="click:toggleFilterByTag">{:tag.name}</a>

View file

@ -2,7 +2,7 @@
<div class="module full-width">
<span class='option-box pull-right wallet'>
<app:rewards:userTokens />
<app:rewards:userGems />
</span>
<ul class="nav nav-tabs game-tabs">
@ -12,7 +12,7 @@
<li><a data-toggle='tab' data-target="#profileInventory"><i class='icon-gift'></i> Inventory</a></li>
<li><a data-toggle='tab' data-target="#profileStable"><i class='icon-leaf'></i> Stable</a></li>
{/if}
<li><a data-toggle='tab' data-target="#profileTavern"><i class='icon-glass'></i> Tavern</a></li>
<li><a data-toggle='tab' data-target="#profileTavern"><i class='icon-eye-close'></i> Tavern</a></li>
<li><a data-toggle='tab' data-target="#profileAchievements"><i class='icon-certificate'></i> Achievements</a></li>
{{#if _loggedIn}}
<li><a data-toggle='tab' data-target="#profileSettings"><i class='icon-wrench'></i> Settings</a></li>
@ -75,18 +75,35 @@
<tavern:>
<div class='row-fluid'>
<div class='span6 border-right'>
<div class='span4 border-right'>
<div class='tavern-pane'>
<img src='/img/npcs/daniel.png' />
<div class="popover fade right in" style="top: 0px; left: 135px; display: block;">
<div class="arrow"></div>
<h3 class="popover-title">Daniel Johansson</h3>
<div class="popover-content">Welcome to the Tavern! I'm <a target="_blank" href="http://www.kickstarter.com/profile/2014640723">Daniel</a>, the bar keep. If you want to rest a while (going on vacation?), I'll set you up at the inn - dailies won't hurt you while you're resting. The minimum stay is 24h, but you can check out any time. Stay a while & meet the clientele.</div>
<div class="popover-content">
Welcome to the Tavern! I'm <a target="_blank" href="http://www.kickstarter.com/profile/2014640723">Daniel</a>, the bar keep. If you want to rest a while (going on vacation? sudden illness?), I'll set you up at the inn - dailies won't hurt you while you're resting. Stay a while & meet the locals.
<div><button x-bind="click:toggleResting" class='btn btn-large btn-success {#if _user.flags.rest}active{/}'>{#if _user.flags.rest}Check Out of Inn{else}Rest In The Inn{/}</button></div>
</div>
</div>
</div>
<button x-bind="click:toggleResting" class='btn btn-large btn-success {#if _user.flags.rest}active{/}'>{#if _user.flags.rest}Check Out of Inn{else}Rest In The Inn{/}</button>
<div class='alert alert-info {#unless _user.flags.rest}hidden{/}'>While you're resting, your dailies aren't calculated. <span class='label label-warning'>Warning:</span> this means that if you check in today, do some dailies, and check out tomorrow - they won't get un-checked until the day <strong>after</strong> tomorrow. You start where you left off before vacation / illness, and it prevents abusing the inn. See <a _target='blank' href='https://trello.com/card/rest-in-tavern/50e5d3684fe3a7266b0036d6/14'><strong>Trello</strong></a> for more information.</div>
<div class=well>
<h3>Resources</h3>
<ul class=unstyled>
<li><h4><a _target=blank href="http://community.habitrpg.com/forums/lfg">LFG Posts</a></h4></li>
<li><h4><a _target=blank href="http://www.youtube.com/watch?feature=player_embedded&v=cT5ghzZFfao">Tutorial</a></h4></li>
<li><h4><a _target=blank href="http://community.habitrpg.com/faq-page">FAQ</a></h4></li>
<li><h4><a _target=blank href="https://github.com/lefnire/habitrpg/issues?state=open">Submit a Bug</a></h4></li>
<li><h4><a _target=blank href="https://trello.com/board/habitrpg/50e5d3684fe3a7266b0036d6">Request a Feature</a></h4></li>
<li><h4><a _target=blank href="http://community.habitrpg.com/forum">Community Forum</a></h4></li>
</ul>
</div>
</div>
<div class='span6'>
<div class='span8'>
<h3>Tavern Talk & LFG</h3>
<form x-bind='submit:tavernSendChat'>
<textarea class="span6" rows="3"x-bind='keyup:tavernMessageKeyup'>{_tavernMessage}</textarea><br/>

View file

@ -42,7 +42,7 @@
<div id="exp-chart" style="display:none;"></div>
<div id=main class="grid">
<div class='{#if _gamePane}hidden{/}'><app:tasks:taskLists /></div>
<div class='{#if _gamePane}hidden{/}'><app:tasks:task-lists /></div>
<div class='{#unless _gamePane}hidden{/}'><app:game-pane:main /></div>
</div>
</div>

View file

@ -34,23 +34,23 @@
<!-- Re-Roll modal -->
<app:modals:modal modalId='reroll-modal' header="Reset Your Tasks">
<app:rewards:userTokens/>
<app:rewards:userGems />
<p>Highly discouraged because red tasks provide good incentive to improve (<a target="_blank" href="https://github.com/lefnire/habitrpg#all-my-tasks-are-red-im-dying-too-fast">read more</a>). However, this becomes necessary after long bouts of bad habits.</p>
<@footer>
{#if lt(_user.balance,1)}
<a data-dismiss="modal" x-bind="click:showStripe" class="btn btn-success btn-large">Buy More Gems</a><span class='token-cost'>Not enough Gems</span>
<a data-dismiss="modal" x-bind="click:showStripe" class="btn btn-success btn-large">Buy More Gems</a><span class='gem-cost'>Not enough Gems</span>
{else}
<a data-dismiss="modal" x-bind=click:buyReroll class="btn btn-danger btn-large">Re-Roll</a><span class='token-cost'>4 Gems</span>
<a data-dismiss="modal" x-bind=click:buyReroll class="btn btn-danger btn-large">Re-Roll</a><span class='gem-cost'>4 Gems</span>
{/}
</@footer>
</app:modals:modal>
<!-- Buy more Gems modal -->
<app:modals:modal modalId='more-tokens-modal' header="Out Of Gems">
<app:rewards:userTokens/>
<app:modals:modal modalId='more-gems-modal' header="Out Of Gems">
<app:rewards:userGems />
<p>Oops, out of Gems, which are used to buy special items! Habit is an open source project, and can use all the help it can get - buy more Gems to receive this pet, and consider it a donation to the contributors</p>
<@footer>
<a data-dismiss="modal" x-bind="click:showStripe" class="btn btn-success btn-large">Buy More Gems</a><span class='token-cost'>Not enough Gems</span>
<a data-dismiss="modal" x-bind="click:showStripe" class="btn btn-success btn-large">Buy More Gems</a><span class='gem-cost'>Not enough Gems</span>
</@footer>
</app:modals:modal>

View file

@ -27,7 +27,7 @@
<pet:>
<td class="{#if _user.items.pets[.name]}active-pet{/}">
<img rel=tooltip title="{.text} - {.value} Tokens" x-bind="click:selectPet" data-pet='{.name}' src='img/sprites/{.icon}'/>
<img rel=tooltip title="{.text} - {.value} Gems" x-bind="click:selectPet" data-pet='{.name}' src='img/sprites/{.icon}'/>
</td>
<hatchingPotion:>

View file

@ -9,7 +9,7 @@
</app:modals:modal>
<rewardsColumn:>
<rewards-column:>
<div class="module rewards-module">
<div class="task-column rewards">
<!-- cash or gems -->
@ -24,38 +24,29 @@
</div>
</span>
<h2 class="task-column_title">Rewards</h2>
<!-- add new reward -->
<app:tasks:newTask type="reward" inputValue="{_newReward}" placeHolder="New Reward" />
<!-- Custom Rewards -->
<ul class='rewards' style="{#unless _rewardList}display:none{/}">
{#each _rewardList as :task}<app:tasks:task />{/}
</ul>
<!-- Static Rewards -->
<ul class='items' style="{#unless _user.flags.itemsEnabled}display:none{/}">
<app:rewards:item item={_items.next.weapon} />
<app:rewards:item item={_items.next.armor} />
<app:rewards:item item={_items.next.head} />
<app:rewards:item item={_items.next.shield} />
<app:rewards:item item={_items.potion} />
<app:rewards:item item={_items.reroll} />
</ul>
<app:tasks:ads>
<a href="http://www.amazon.com/gp/product/1594484805/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1594484805&linkCode=as2&tag=ha0d2-20">Drive: The Surprising Truth About What Motivates Us</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=1594484805" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</app:tasks:ads>
<app:tasks:task-list header="Rewards" type="reward" inputValue="{_newReward}" placeHolder="New Reward" list={_rewardList} >
<@extra>
<!-- Static Rewards -->
<ul class='items {#unless _user.flags.itemsEnabled}hidden{/}'>
<app:rewards:item item={_items.next.weapon} />
<app:rewards:item item={_items.next.armor} />
<app:rewards:item item={_items.next.head} />
<app:rewards:item item={_items.next.shield} />
<app:rewards:item item={_items.potion} />
<app:rewards:item item={_items.reroll} />
</ul>
</@extra>
<@ads><a href="http://www.amazon.com/gp/product/1594484805/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1594484805&linkCode=as2&tag=ha0d2-20">Drive: The Surprising Truth About What Motivates Us</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=1594484805" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></@ads>
</app:tasks:task-list>
</div>
</div>
<userTokens:>
<a class="pull-right token-wallet" rel='popover' data-trigger='hover' data-title='Gems' data-content="Used for buying special items (reroll, eggs, hatching potions, etc). You'll need to unlock those features before being able to use Gems." data-placement='bottom'>
<span class="task-action-btn tile flush bright add-token-btn" x-bind="click:showStripe"></span>
<span class="task-action-btn tile flush neutral"><div class="Gems"></div> {tokens(_user.balance)} Gems
<userGems:>
<a class="pull-right gem-wallet" rel='popover' data-trigger='hover' data-title='Gems' data-content="Used for buying special items (reroll, eggs, hatching potions, etc). You'll need to unlock those features before being able to use Gems." data-placement='bottom'>
<span class="task-action-btn tile flush bright add-gems-btn" x-bind="click:showStripe"></span>
<span class="task-action-btn tile flush neutral"><div class="Gems"></div> {gems(_user.balance)} Gems
</a>
@ -69,7 +60,7 @@
<!-- left-hand size commands -->
<div class="task-controls">
{#if equal(@item.type),'reroll')}
{#if equal(@item.type,'reroll')}
<a class="task-action-btn btn-reroll" data-toggle="modal" data-target="#reroll-modal"><i class='icon-repeat'></i></a>
{else}
<a class="money btn-buy item-btn" x-bind=click:buyItem data-type={@item.type} data-value={@item.value} data-index={@item.index}>

View file

@ -8,53 +8,30 @@
</@footer>
</app:modals:modal>
<ads: nonvoid>
{{#if and( _loggedIn, notEqual(_user.flags.ads,'hide') )}}
<span class='pull-right'>
<a x-bind="click:showStripe" rel='tooltip' title='Remove Ads'><i class='icon-remove'></i></a><br/>
<a href="#" data-target="#why-ads-modal" data-toggle="modal" rel='tooltip' title='Why Ads?'><i class='icon-question-sign'></i></a>
</span>
{{@content}}
{{/}}
<taskLists:>
<task-lists:>
<!--helpTitle & helpContent moved to tour -->
<!-- Habits Column -->
<div class="module">
<div class="task-column habits">
<h2 class="task-column_title">{{t("Habits")}}</h2>
<app:tasks:newTask type="habit" inputValue="{_newHabit}" placeHolder="New Habit" />
<ul class="habits">
{#each _habitList as :task}<app:tasks:task />{/}
</ul>
<br/>
<app:tasks:ads>
<a href="http://www.amazon.com/gp/product/1400069289/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1400069289&linkCode=as2&tag=ha0d2-20">The Power of Habit: Why We Do What We Do in Life and Business</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=1400069289" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</app:tasks:ads>
<app:tasks:task-list header="Habits" type="habit" inputValue="{_newHabit}" placeHolder="New Habit" list={_habitList} >
<@ads><a href="http://www.amazon.com/gp/product/1400069289/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1400069289&linkCode=as2&tag=ha0d2-20">The Power of Habit: Why We Do What We Do in Life and Business</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=1400069289" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></@ads>
</app:tasks:task-list>
</div>
</div>
<!-- Dailys Column -->
<div class="module">
<div class="task-column dailys">
<h2 class="task-column_title">Dailies</h2>
<app:tasks:newTask type="daily" inputValue="{_newDaily}" placeHolder="New Daily" />
<ul class='dailys'>
{#each _dailyList as :task}<app:tasks:task />{/}
</ul>
<br/>
<app:tasks:ads>
<a href="http://www.amazon.com/gp/product/0142000280/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0142000280&linkCode=as2&tag=ha0d2-20">Getting Things Done: The Art of Stress-Free Productivity</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=0142000280" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</app:tasks:ads>
<app:tasks:task-list header="Dailies" type="daily" inputValue="{_newDaily}" placeHolder="New Daily" list={_dailyList} >
<@ads><a href="http://www.amazon.com/gp/product/0142000280/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0142000280&linkCode=as2&tag=ha0d2-20">Getting Things Done: The Art of Stress-Free Productivity</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=0142000280" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></@ads>
</app:tasks:task-list>
</div>
</div>
<!-- Todos Column -->
<div class="module">
<div class="task-column todos context-enabled context-uncompleted tabbable tabs-below" id="todo-well">
<div class="task-column todos tabbable tabs-below">
<!-- todo export/graph options -->
<span class='option-box pull-right'>
{#if _user.history.todos}
@ -63,47 +40,54 @@
<a class="option-action" href="/v1/users/{{_user.id}}/calendar.ics?apiToken={{_user.apiToken}}" rel=tooltip title="iCal"><i class=icon-calendar></i></a>
<!-- <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> -->
</span>
<h2 class="task-column_title">Todos</h2>
<div id="todos-chart" style="display:none;"></div>
<!-- create new todo -->
<div class="display-context-dependant show-for-uncompleted">
<app:tasks:newTask type="todo" inputValue="{_newTodo}" placeHolder="New Todo" />
</div>
<!-- list of all the todos -->
<ul class='todos task-list'>
{#each _todoList as :task}<app:tasks:task />{/}
</ul>
<br/>
<app:tasks:ads>
<a href="http://www.amazon.com/gp/product/0312430000/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0312430000&linkCode=as2&tag=ha0d2-20">The Checklist Manifesto: How to Get Things Right</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=0312430000" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</app:tasks:ads>
<app:tasks:task-list header="Todos" type="todo" inputValue="{_newTodo}" placeHolder="New Todo" list={_todoList} >
<@ads><a href="http://www.amazon.com/gp/product/0312430000/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0312430000&linkCode=as2&tag=ha0d2-20">The Checklist Manifesto: How to Get Things Right</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=0312430000" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></@ads>
</app:tasks:task-list>
<button class='task-action-btn tile spacious bright display-context-dependant show-for-completed' x-bind=click:clearCompleted>Clear Completed</button>
<button class='task-action-btn tile spacious bright {#unless _showCompleted}hidden{/}' x-bind=click:clearCompleted>Clear Completed</button>
<!-- remaining/completed tabs -->
<ul class="todo-status-toggler nav nav-tabs">
<li class="active"><a x-bind=click:changeContext data-target="#todo-well" data-context="context-uncompleted">Remaining</a></li>
<li><a x-bind=click:changeContext data-target="#todo-well" data-context="context-completed">Complete</a></li>
<ul class="nav nav-tabs">
<li class="{#unless _showCompleted}active{/}"><a x-bind="click:todosShowRemaining">Remaining</a></li>
<li class="{#if _showCompleted}active{/}"><a x-bind="click:todosShowCompleted">Complete</a></li>
</ul>
</div>
</div>
<!-- Rewards Column -->
<app:rewards:rewardsColumn />
<app:rewards:rewards-column/>
<!-- Templates -->
<newTask:>
<form class="addtask-form form-inline new-task-form" id="new-{@type}" data-task-type="{@type}" x-bind="submit:addTask">
<span class="addtask-field"><input value="{@inputValue}" type="text" name="new-task" placeholder="{@placeHolder}"/></span>
<task-list: nonvoid>
<h2 class="task-column_title">{{t(@header)}}</h2>
{{#if equal(@type,'todo')}}<div id="todos-chart" class="hidden"></div>{{/}}
<form class="addtask-form form-inline new-task-form {#if and(_showCompleted,equal(@type,'todo'))}hidden{/}" id="new-{{@type}}" data-task-type="{{@type}}" x-bind="submit:addTask">
<span class="addtask-field"><input value="{@inputValue}" type="text" placeholder="{{@placeHolder}}"/></span>
<input class="addtask-btn" type="submit" value="">
</form>
<hr>
<ul class="{{@type}}s {#unless @list}hidden{/}">
{#each @list as :task}<app:tasks:task />{/}
</ul>
{{@extra}}
<br/>
<!-- ads -->
{{#if and( _loggedIn, notEqual(_user.flags.ads,'hide') )}}
<span class='pull-right'>
<a x-bind="click:showStripe" rel='tooltip' title='Remove Ads'><i class='icon-remove'></i></a><br/>
<a href="#" data-target="#why-ads-modal" data-toggle="modal" rel='tooltip' title='Why Ads?'><i class='icon-question-sign'></i></a>
</span>
{{@ads}}
{{/}}
<!-- all the parts of a single task -->
<task:>
<li data-id={{:task.id}} class="task {taskClasses(:task, _user.filters, _user.preferences.dayStart, _user.lastCron)} {#if :task.down}{#if :task.up}habit-wide{/}{/}">
<li data-id={{:task.id}} class="task {taskClasses(:task, _user.filters, _user.preferences.dayStart, _user.lastCron, _showCompleted)}">
<!-- right-hand side control buttons -->
<div class="task-meta-controls">
@ -238,4 +222,4 @@
</form>
</div>
<div style="display:none;" id={{:task.id}}-chart></div>
<div style="display:none;" id={{:task.id}}-chart></div>