mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-01 23:40:25 +00:00
Static rewards in content.coffee. displayed as such in index.html & index.coffee
This commit is contained in:
parent
b558422a80
commit
74513509bb
3 changed files with 13 additions and 5 deletions
|
|
@ -113,4 +113,11 @@ module.exports = {
|
|||
placement: "right"
|
||||
}
|
||||
]
|
||||
|
||||
staticRewards: [
|
||||
{ text: "Re-Roll", notes: "Reset your task values to 0. Do this only if you're floundering.", value: 100, icon:"icon-retweet" }
|
||||
{ text: "Re-Roll", notes: "Reset your task values to 0. Do this only if you're floundering.", value: 100 }
|
||||
]
|
||||
staticRewardIds: [0] #stupid, but necessary for refList
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ getRoom = (page, model, userId) ->
|
|||
model.refList "_dailyList", "_user.tasks", "_user.dailyIds"
|
||||
model.refList "_todoList", "_user.tasks", "_user.todoIds"
|
||||
model.refList "_rewardList", "_user.tasks", "_user.rewardIds"
|
||||
model.set '_staticRewards', content.staticRewards
|
||||
unless model.get('_user.tasks')
|
||||
model.push '_habitList', task for task in content.defaultTasks.habits
|
||||
model.push '_dailyList', task for task in content.defaultTasks.dailys
|
||||
|
|
@ -75,7 +76,7 @@ view.fn "silver", (num) ->
|
|||
## CONTROLLER FUNCTIONS ##
|
||||
|
||||
ready (model) ->
|
||||
|
||||
|
||||
# Note: Set 12am daily cron for this
|
||||
# At end of day, add value to all incomplete Daily & Todo tasks (further incentive)
|
||||
# For incomplete Dailys, deduct experience
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@
|
|||
{#each _rewardList as :task}<app:task />{/}
|
||||
</ul>
|
||||
<ul class='static-rewards'>
|
||||
<app:staticReward text="Re-Roll" notes="Reset your task values to 0. Do this only if you're floundering." icon="icon-retweet" value="100" />
|
||||
{#each _staticRewards as :reward}<app:staticReward />{/}
|
||||
</ul>
|
||||
<app:newTask type=reward><input value={_newReward} type="text" /></app:newTask>
|
||||
</app:taskColumn>
|
||||
|
|
@ -209,12 +209,12 @@
|
|||
<li class="task reward">
|
||||
<pre>
|
||||
<div class="task-meta-controls">
|
||||
<span data-placement="left" data-content="{{{notes}}}" data-original-title="{{{text}}}" class='task-notes'><i class="icon-comment"></i></span>
|
||||
<span data-placement="left" data-content="{:reward.notes}" data-original-title="{:reward.text}" class='task-notes'><i class="icon-comment"></i></span>
|
||||
</div>
|
||||
<div class="task-controls">
|
||||
<a x-bind=click:vote class="static-buy-link" data-direction=down>{{{value}}}<img src="img/coin_single_gold.png"/></a>
|
||||
<a x-bind=click:vote class="static-buy-link" data-direction=down>{:reward.value}<img src="img/coin_single_gold.png"/></a>
|
||||
</div>
|
||||
<div class="task-text"><i class={{{icon}}}></i> {{{text}}}</div>
|
||||
<div class="task-text"><i class="{:reward.icon}"></i> {:reward.text}</div>
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue