mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 03:30:25 +00:00
Add task.history = [], updated on cron. this will be used for charts later
This commit is contained in:
parent
d4aee014b0
commit
18e8472099
2 changed files with 12 additions and 4 deletions
|
|
@ -125,6 +125,8 @@ endOfDayTally = (model) ->
|
|||
unless completed
|
||||
value += if (value < 0) then (( -0.1 * value + 1 ) * -1) else (( Math.pow(0.9,value) ) * -1)
|
||||
task.set('value', value)
|
||||
task.setNull 'history', []
|
||||
task.push "history", { date: new Date(), value: value }
|
||||
# Deduct experience for missed Daily tasks,
|
||||
# but not for Todos (just increase todo's value)
|
||||
if (type == 'daily')
|
||||
|
|
|
|||
|
|
@ -156,9 +156,17 @@
|
|||
</label>
|
||||
</div>
|
||||
{/}
|
||||
<button type=submit class="btn">Save</a>
|
||||
<button x-bind=click:del class="btn btn-danger">Delete</a>
|
||||
<button type=submit class="btn">Save</button>
|
||||
<button x-bind=click:del class="btn btn-danger">Delete</button>
|
||||
</form>
|
||||
|
||||
<div id="{:task.id}-chart">
|
||||
{#each :task.history}
|
||||
Date:<div>{date}</div>
|
||||
Value:<div>{value}</div>
|
||||
{/}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<Footer:>
|
||||
|
|
@ -174,5 +182,3 @@
|
|||
<script src=/jquery.min.js></script>
|
||||
<script src=/jquery-ui.min.js></script>
|
||||
<script src=/bootstrap.min.js></script>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue