mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 03:30:25 +00:00
tags: use explicit {#each users[_userId].tags} instead of model.ref private path {#each _user.tags}. fixed many tags issues. see https://github.com/codeparty/derby/issues/267
This commit is contained in:
parent
9ca9717387
commit
268157ca24
3 changed files with 10 additions and 12 deletions
|
|
@ -14,9 +14,7 @@ module.exports.app = (appExports, model) ->
|
|||
model.set '_newTag', ''
|
||||
|
||||
appExports.toggleEditingTags = ->
|
||||
before = model.get('_editingTags')
|
||||
model.set '_editingTags', !before, ->
|
||||
location.reload() if before is true #when they're done, refresh the page
|
||||
model.set '_editingTags', !model.get('_editingTags')
|
||||
|
||||
appExports.clearFilters = ->
|
||||
user.set 'filters', {}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
<li>
|
||||
<a rel=tooltip title='Edit Tags' x-bind="click:toggleEditingTags"><i class='{#if _editingTags}icon-ok{else}icon-pencil{/}'></i></a>
|
||||
</li>
|
||||
{#each _user.tags as :tag}
|
||||
<li class="{#if _user.filters[:tag.id]}active{/}" style='position:relative;'>
|
||||
{#each users[_userId].tags as :tag}
|
||||
<li class="{#if users[_userId].filters[:tag.id]}active{/}" style='position:relative;'>
|
||||
{#if _editingTags}
|
||||
<div class="input-append option-group tag-editing" >
|
||||
<input class="input input-small option-content tag-editing-pill" type="text" value='{:tag.name}' />
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
</form>
|
||||
{/}
|
||||
</li>
|
||||
<!--<li class="{#unless activeFilters(_user.filters)}hidden{/}">-->
|
||||
<!--<li class="{#unless activeFilters(users[_userId].filters)}hidden{/}">-->
|
||||
<li>
|
||||
<a rel=tooltip title='Clear Filters' x-bind="click:clearFilters"><i class='icon-remove-sign'></i></a>
|
||||
</li>
|
||||
|
|
@ -37,15 +37,15 @@
|
|||
</div>
|
||||
|
||||
<applied-filters:>
|
||||
<i rel=tooltip title="{appliedTags(_user.tags, :task.tags)}" class='{#if noTags(:task.tags)}hidden{/} icon-tags'></i>
|
||||
<i rel=tooltip title="{appliedTags(users[_userId].tags, :task.tags)}" class='{#if noTags(:task.tags)}hidden{/} icon-tags'></i>
|
||||
|
||||
<!-- At first we showed all applied tags, but it gets really cluttered: http://gyazo.com/fce50f91fd0f1d64cab9774f755e95c1 -->
|
||||
<!-- There's a very strange bug where live-bound #each here loses model.at reference on _{type}List alter -->
|
||||
<!--
|
||||
{{#each _user.tags as :tag}}
|
||||
{{#each users[_userId].tags as :tag}}
|
||||
<small>
|
||||
{#if :task.tags[:tag.id]}
|
||||
<small data-tag-id="{{:tag.id}}" x-bind="click:toggleFilterByTag" class="label tag-label {#if _user.filters[:tag.id]}label-info{/}">{:tag.name}</small>
|
||||
<small data-tag-id="{{:tag.id}}" x-bind="click:toggleFilterByTag" class="label tag-label {#if users[_userId].filters[:tag.id]}label-info{/}">{:tag.name}</small>
|
||||
{/}
|
||||
</small>
|
||||
{{/}}-->
|
||||
|
|
@ -53,9 +53,9 @@
|
|||
<filter-fieldgroup:>
|
||||
<fieldset class='option-group'>
|
||||
<legend class="option-title">Tags</legend>
|
||||
{{#each _user.tags as :tag}}
|
||||
{#each users[_userId].tags as :tag}
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" checked="{:task.tags[:tag.id]}"> {:tag.name}
|
||||
</label>
|
||||
{{/}}
|
||||
{/}
|
||||
</fieldset>
|
||||
|
|
@ -158,7 +158,7 @@
|
|||
|
||||
<!-- all the parts of a single task -->
|
||||
<task:>
|
||||
<li data-id={{:task.id}} class="task {taskClasses(:task, _user.filters, _user.preferences.dayStart, _user.lastCron, _showCompleted)}">
|
||||
<li data-id={{:task.id}} class="task {taskClasses(:task, users[_userId].filters, _user.preferences.dayStart, _user.lastCron, _showCompleted)}">
|
||||
|
||||
<!-- right-hand side control buttons -->
|
||||
<div class="task-meta-controls">
|
||||
|
|
|
|||
Loading…
Reference in a new issue