-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve filters and fix dailyDone button
- Loading branch information
Guillermo
committed
Aug 30, 2018
1 parent
bb70a9d
commit 56fd907
Showing
5 changed files
with
46 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
created: 20180826045249890 | ||
gold: 270 | ||
modified: 20180828072357213 | ||
tags: habito-display | ||
gold: 110 | ||
modified: 20180830232446552 | ||
title: Habito | ||
type: application/x-tiddler | ||
xp: 17 | ||
xp: -4 | ||
|
||
<div class="habito-coimage"> <span class="amount"> {{!!gold}} </span> <span>{{$:/plugins/Guitlle/habito/images/coin.png}}</span> </div> | ||
<div class="habito-coimage"> <span class="amount"> {{!!xp}} </span> <span> experience</span> </div> | ||
|
||
|
||
|
||
<div class="habito-display"> | ||
<$macrocall $name="tabs" tabsList="$:/plugins/Guitlle/habito/habitsView $:/plugins/Guitlle/habito/dailiesView $:/plugins/Guitlle/habito/rewardsView" default="$:/plugins/Guitlle/habito/dailiesView" state="$:/state/tab/habito" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
created: 20180824222515632 | ||
list-before: $:/core/ui/ViewTemplate/title | ||
modified: 20180828065243613 | ||
modified: 20180830232136117 | ||
tags: $:/tags/ViewTemplate | ||
title: $:/plugins/Guitlle/habito/dailyDone | ||
type: application/x-tiddler | ||
|
||
<$list filter="[all[current]tag[Daily]]" variable="tag_name"> | ||
<$wikify name="dateEntry" text="""<$macrocall $name="now" format="YYYY-MM-DD"/>"""> | ||
<$wikify name="dateEntry_brackets" text="""<$text text='[['/><<dateEntry>><$text text=']]'/>"""> | ||
<$wikify name="widget_class" text="""<$list filter="[list[!!days_done]titledate:toOffsetFromDate[]!compare:greater{!!days_repeat}count[]compare:equal[0]]">habito-daily-missed </$list><$list filter="[list[!!days_done]titledate:toOffsetFromDate[]!compare:greater{!!days_warn}count[]compare:equal[0]]">habito-daily-warn </$list>habito-btn-wrapper"""> | ||
<$list filter="[all[current]tag[Daily]]" variable="tag_name"> | ||
<$wikify name="today" text="""<$macrocall $name="now" format="YYYY-MM-DD"/>"""> | ||
<$wikify name="todayBrackets" text="""<$text text='[['/><<today>><$text text=']]'/>"""> | ||
<$wikify name="lastDate" text="""<$list filter="[list[!!days_done]last[]]"><$text text='[['/><<currentTiddler>><$text text=']]'/></$list>"""> | ||
<$wikify name="widget_class" text="""<$list filter="[title<lastDate>titledate:toOffsetFromDate[]!compare:greater{!!days_repeat}count[]compare:equal[0]]">habito-daily-missed </$list><$list filter="[title<lastDate>titledate:toOffsetFromDate[]!compare:greater{!!days_warn}count[]compare:equal[0]]">habito-daily-warn </$list>habito-btn-wrapper"""> | ||
<div class=<<widget_class>> title="Task done today."> | ||
<$list filter="[list[!!days_done]titledate:toOffsetFromDate[]!compare:greater{!!days_checked}last[]]" variable="i" emptyMessage=""" | ||
<$list filter="[title<lastDate>titledate:toOffsetFromDate[]!compare:greater{!!days_checked}]" variable="i" emptyMessage=""" | ||
<$button class="habito-btn daily-btn"> | ||
<$action-listops $field="days_done" $subfilter= | ||
<<dateEntry_brackets>>/> | ||
<$action-listops $field="days_done" $subfilter="+[append<todayBrackets>]" /> | ||
<$action-setfield-mathjs $tiddler="Habito" $field="gold" $eval="reward+gold" reward={{!!gold_reward}} /> | ||
<$action-setfield-mathjs $tiddler="Habito" $field="xp" $eval="xp+1" reward={{!!xp_reward}} /> | ||
{{$:/core/images/close-button}} | ||
</$button> | ||
"""> | ||
<$button class="habito-btn success daily-btn"> | ||
<$action-listops $field="days_done" $subfilter="+[remove<dateEntry_brackets>]"/> | ||
<$action-listops $field="days_done" $subfilter="+[remove<lastDate>]"/> | ||
<$action-setfield-mathjs $tiddler="Habito" $field="gold" $eval="gold-reward" reward={{!!gold_reward}} /> | ||
<$action-setfield-mathjs $tiddler="Habito" $field="xp" $eval="xp-1" /> | ||
{{$:/core/images/done-button}} | ||
</$button> | ||
</$list> | ||
<$list filter=[list[!!days_done]titledate:toOffsetFromDate[]last[]!compare:equal[NaN]]><span class="habito-btn-caption"><<currentTiddler>></span> </$list> | ||
<$list filter="[title<lastDate>titledate:toOffsetFromDate[]!compare:equal[NaN]]"> | ||
<span class="habito-btn-caption"><<currentTiddler>></span> </$list> | ||
</div> | ||
</$wikify></$wikify></$wikify></$list> | ||
</$wikify></$wikify></$wikify></$wikify></$list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
created: 20180826065511097 | ||
list-before: $:/core/ui/ViewTemplate/title | ||
modified: 20180828074341563 | ||
modified: 20180830231421596 | ||
tags: $:/tags/ViewTemplate | ||
title: $:/plugins/Guitlle/habito/getReward | ||
type: application/x-tiddler | ||
|
||
<$list filter="[all[current]tag[Reward]]" variable="tag_name"> | ||
<$wikify name="dateEntry" text="""<$macrocall $name="now" format="YYYY-0MM-DD 0hh:0mm:0ss"/>"""> | ||
<$wikify name="dateEntry_brackets" text="""<$text text='[['/><<dateEntry>><$text text=']]'/>"""> | ||
<$wikify name="cooldown" text="""{{{[list[!!days_rewarded]titledate:toOffsetFromDate[]!compare:greater{!!days_cooldown}first[]count[]]}}}"""> | ||
<$wikify name="nofunds" text="""{{{[{Habito!!gold}!compare:greater{!!gold_price}count[]]}}}"""> | ||
<$wikify name="dateEntry" text="""<$text text='[['/><$macrocall $name="now" format="YYYY-0MM-DD 0hh:0mm:0ss"/><$text text=']]'/>"""> | ||
<$wikify name="cooldown" text="""{{{[list[!!days_rewarded]last[]titledate:toOffsetFromDate[]!compare:greater{!!days_cooldown}first[]count[]]}}}"""> | ||
<$wikify name="nofunds" text="""{{{[{Habito!!gold}!compare:greater{!!gold_price}count[]]}}}"""> | ||
<$wikify name="price" text="""<$calc>((<<cooldown>>==1?2:1)*(<<nofunds>>==1?2:1)*{{!!gold_price}})</$calc>"""> | ||
<$wikify name="price_tag" text="""Get this reward by $<<price>>."""> | ||
<$wikify name="widget_class" text="""<$list filter="[<cooldown>compare:equal[1]]">habito-reward-cooldown </$list><$list filter="[<nofunds>compare:equal[1]]"> habito-reward-no-funds</$list> habito-btn-wrapper"""> | ||
<div class=<<widget_class>> title=<<price_tag>>> | ||
<$button class="habito-btn reward-btn"> | ||
<$action-listops $field="days_rewarded" $subfilter=<<dateEntry_brackets>>/> | ||
<$action-listops $field="days_rewarded" $subfilter=<<dateEntry>>/> | ||
<$action-setfield-mathjs $tiddler="Habito" $field="gold" $eval="gold - price" price=<<price>> /> | ||
$ | ||
</$button> | ||
</div> | ||
</$wikify></$wikify></$wikify></$wikify></$wikify></$wikify></$wikify></$list> | ||
</$wikify></$wikify></$wikify></$wikify></$wikify></$wikify></$list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters