Files
kredits-web/app/components/contribution-list/template.hbs
T
raucao f7ee864071 Fix Ember not re-using DOM elements on block updates
Causing serious performance issues without the stable key
2026-07-26 16:40:54 +02:00

106 lines
4.5 KiB
Handlebars

{{#if @showQuickFilter}}
<div class="quick-filter">
<p>
<label class="filter-contributor">
Contributor:
<select onchange={{action (mut this.contributorId) value="target.value"}}>
<option value="" selected>all</option>
{{#each this.contributorsActive as |contributor|}}
<option value={{contributor.id}} selected={{eq this.contributorId contributor.id}}>{{contributor.name}}</option>
{{/each}}
</select>
</label>
<label class="filter-contribution-kind">
Kind:
<select onchange={{action (mut this.contributionKind) value="target.value"}}>
<option value="" selected>all</option>
{{#each this.contributionKinds as |kind|}}
<option value={{kind}} selected={{eq this.contributionKind kind}}>{{capitalize-string kind}}</option>
{{/each}}
</select>
</label>
<label class="filter-contribution-size">
<Input @type="checkbox" @checked={{this.hideSmallContributions}} />
Hide small contributions
</label>
</p>
</div>
{{/if}}
<ul class="item-list contribution-list {{if @loading 'loading'}}">
{{#each this.groupedContributions key="key" as |group|}}
{{#if group.isGrouped}}
<li role="button" data-group-id={{group.groupId}}
{{action "toggleGroup" group}}
class="grouped {{if (eq this.expandedGroup group.groupId) "expanded"}}">
<p class="meta">
<span class="avatars">
{{#each group.visibleContributors as |contributor|}}
<UserAvatar @contributor={{contributor}} />
{{/each}}
{{#if group.extraContributorCount}}
<span class="avatar-overflow">+{{group.extraContributorCount}}</span>
{{/if}}
</span>
<span class="category {{group.kind}}">({{group.kind}})</span>
<span class="title">{{group.description}}</span>
</p>
<p class="kredits-amount">
<span class="amount">{{group.amount}}</span><span class="symbol">₭S</span>
</p>
</li>
{{#if (eq this.expandedGroup group.groupId)}}
{{#each group.items key="id" as |contribution|}}
<li role="button" data-contribution-id={{contribution.id}}
{{action "openContributionDetails" contribution}}
class="group-item {{item-status contribution}}{{if (eq contribution.id @selectedContributionId) " selected"}}">
<p class="meta">
<span class="recipient"><UserAvatar @contributor={{contribution.contributor}} /></span>
<span class="category {{contribution.kind}}">({{contribution.kind}})</span>
<span class="title">{{contribution.description}}</span>
</p>
<p class="kredits-amount">
<span class="amount">{{contribution.amount}}</span><span class="symbol">₭S</span>
</p>
{{#unless contribution.vetoed}}
{{#unless (is-confirmed-contribution contribution)}}
<p class="voting">
{{input type="button" class="button small danger" value="veto"
click=(action "veto" contribution.id)
disabled=contribution.hasPendingChanges}}
</p>
{{/unless}}
{{/unless}}
</li>
{{/each}}
{{/if}}
{{else}}
{{#each group.items key="id" as |contribution|}}
<li role="button" data-contribution-id={{contribution.id}}
{{action "openContributionDetails" contribution}}
class="{{item-status contribution}}{{if (eq contribution.id @selectedContributionId) " selected"}}">
<p class="meta">
<span class="recipient"><UserAvatar @contributor={{contribution.contributor}} /></span>
<span class="category {{contribution.kind}}">({{contribution.kind}})</span>
<span class="title">{{contribution.description}}</span>
</p>
<p class="kredits-amount">
<span class="amount">{{contribution.amount}}</span><span class="symbol">₭S</span>
</p>
{{#unless contribution.vetoed}}
{{#unless (is-confirmed-contribution contribution)}}
<p class="voting">
{{input type="button" class="button small danger" value="veto"
click=(action "veto" contribution.id)
disabled=contribution.hasPendingChanges}}
</p>
{{/unless}}
{{/unless}}
</li>
{{/each}}
{{/if}}
{{/each}}
</ul>