[neutratywy] fix admin panel issues

This commit is contained in:
Avris 2020-08-06 16:56:39 +02:00
parent aa47d2a904
commit a72966c428
1 changed files with 15 additions and 15 deletions

View File

@ -70,8 +70,8 @@
<section v-if="secret"> <section v-if="secret">
<div class="alert alert-info"> <div class="alert alert-info">
<strong>{{ nounsCountApproved }}</strong> wpisów zatwierdzonych, <strong>{{ nounsCountApproved() }}</strong> wpisów zatwierdzonych,
<strong>{{ nounsCountPending }}</strong> oczekuje na moderację. <strong>{{ nounsCountPending() }}</strong> oczekuje na moderację.
</div> </div>
</section> </section>
@ -111,8 +111,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<template v-if="visibleNouns.length"> <template v-if="visibleNouns().length">
<tr v-for="noun in visibleNouns" :class="{'mark-left': !noun.approved}"> <tr v-for="noun in visibleNouns()" :class="{'mark-left': !noun.approved}">
<td> <td>
<ul class="list-singular"> <ul class="list-singular">
<li v-for="w in noun.masc">{{ w }}</li> <li v-for="w in noun.masc">{{ w }}</li>
@ -239,11 +239,11 @@
}, },
mounted() { mounted() {
if (process.client && window.location.hash) { if (process.client && window.location.hash) {
console.log(window.location.hash, this.$refs.filter)
this.filter = window.location.hash.substr(1); this.filter = window.location.hash.substr(1);
this.$refs.filter.focus();
this.$refs.filter.scrollIntoView();
setTimeout(_ => { setTimeout(_ => {
this.$refs.filter.scrollIntoView(); this.$refs.filter.scrollIntoView();
this.$refs.filter.focus();
}, 1000); }, 1000);
} }
}, },
@ -273,15 +273,6 @@
delete this.nouns[noun.id]; delete this.nouns[noun.id];
this.$forceUpdate(); this.$forceUpdate();
}, },
},
computed: {
nouns() {
return buildDict(function* (that) {
for (let w of that.nounsRaw) {
yield [w.id, new Noun(w)];
}
}, this);
},
visibleNouns() { visibleNouns() {
return Object.values(this.nouns).filter(n => n.matches(this.filter)); return Object.values(this.nouns).filter(n => n.matches(this.filter));
}, },
@ -292,6 +283,15 @@
return Object.values(this.nouns).filter(n => !n.approved).length; return Object.values(this.nouns).filter(n => !n.approved).length;
}, },
}, },
computed: {
nouns() {
return buildDict(function* (that) {
for (let w of that.nounsRaw) {
yield [w.id, new Noun(w)];
}
}, this);
},
},
watch: { watch: {
filter() { filter() {
if (process.client) { if (process.client) {