Skip to content

Commit

Permalink
Fix approve/reject button in admin UI on non-entries
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Jun 4, 2023
1 parent cbf0d1d commit 397fc57
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions admin/pending.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ <h3>
</h3>
<sup class="lang meta" x-text="config.languages[e.lang].name"></sup>

<template x-if="e.id in comments">
<template x-for="(c, n) in comments[e.id]" :key="c.id">
<template x-if="e.id in comments && 'null' in comments[e.id]">
<template x-for="(c, n) in comments[e.id]['null']" :key="c.id">
<div class="comments">
<div x-text="c.comments"></div>
<button class="button-outline button-small" @click.prevent="onClearComments(c.id)">Clear</button>
Expand All @@ -50,8 +50,8 @@ <h3>
<span class="meta lang" x-text="config.languages[r.lang].name"></span>
<span class="meta types" x-text="r.relation.types"></span> <span x-text="r.content" class="content"></span>
</p>
<template x-if="`${e.id}-${r.id}` in comments">
<template x-for="(c, n) in comments[`${e.id}-${r.id}`]" :key="c.id">
<template x-if="e.id in comments && r.id in comments[e.id]">
<template x-for="(c, n) in comments[e.id][r.id]" :key="c.id">
<div class="comments">
<pre x-text="c.comments"></pre>
<button class="button-outline button-small" @click.prevent="onClearComments(c.id)">Clear</button>
Expand Down Expand Up @@ -79,10 +79,12 @@ <h3>
</div>
</template>
<div class="clearfix"></div>
<div class="buttons">
<button @click.prevent="onApproveSubmission(e.id)">Approve all</button>
<button @click.prevent="onRejectSubmission(e.id)" class="button-outline">Reject all</button>
</div>
<template x-if="!(e.id in comments)">
<div class="buttons">
<button @click.prevent="onApproveSubmission(e.id)">Approve all</button>
<button @click.prevent="onRejectSubmission(e.id)" class="button-outline">Reject all</button>
</div>
</template>
</li>
</template>
</ol>
Expand Down

0 comments on commit 397fc57

Please sign in to comment.