diff --git a/.eslintrc b/.eslintrc index d6c22bc..262d6e5 100755 --- a/.eslintrc +++ b/.eslintrc @@ -27,6 +27,7 @@ "vue/no-reserved-component-names": 0, "no-tabs": "off", "no-unused-vars": ["error", {"argsIgnorePattern": "^_"}], + "prefer-destructuring": 0, "template-curly-spacing": "off", "vue/html-indent": ["error", "tab"], "vue/multiline-html-element-content-newline": 0, diff --git a/assets/css/theme.css b/assets/css/theme.css index 42b2d5c..3819b75 100644 --- a/assets/css/theme.css +++ b/assets/css/theme.css @@ -49,7 +49,6 @@ --text-light: #fff; --link: #48f; - --error: #f66; --male: #0af; --female: #f0a; @@ -59,4 +58,10 @@ --disabled: #c20; --disabled-background: rgba(255, 0, 0, .1); --disabled-handle: var(--grey-light-10); + + --error: #f66; + --alert: #f00; + --warn: #fa0; + --success: #5c2; + --notice: #25c; } diff --git a/assets/img/icons/genders.svg b/assets/img/icons/genders.svg new file mode 100644 index 0000000..a2acfce --- /dev/null +++ b/assets/img/icons/genders.svg @@ -0,0 +1,53 @@ + + + + + + + male + + + + + male + + + + diff --git a/assets/img/icons/sort-numberic-desc.svg b/assets/img/icons/sort-numeric-desc.svg similarity index 100% rename from assets/img/icons/sort-numberic-desc.svg rename to assets/img/icons/sort-numeric-desc.svg diff --git a/components/filters/actors.vue b/components/filters/actors.vue new file mode 100644 index 0000000..a3d966d --- /dev/null +++ b/components/filters/actors.vue @@ -0,0 +1,257 @@ + + + + + diff --git a/components/filters/country.vue b/components/filters/country.vue index 3acbfa9..5577194 100644 --- a/components/filters/country.vue +++ b/components/filters/country.vue @@ -7,7 +7,7 @@ v-if="!filters.country" v-model="countryQuery" type="search" - placeholder="Filter country" + placeholder="Filter countries" class="input input-inline countries-search" > diff --git a/components/filters/filters.vue b/components/filters/filters.vue index be02942..f9fb7de 100644 --- a/components/filters/filters.vue +++ b/components/filters/filters.vue @@ -67,6 +67,120 @@ function toggleFilters(state) { } + + diff --git a/pages/updates/+Page.vue b/pages/updates/+Page.vue index 6745856..21efa06 100644 --- a/pages/updates/+Page.vue +++ b/pages/updates/+Page.vue @@ -3,6 +3,7 @@ diff --git a/src/actors.js b/src/actors.js index 6c63538..541fab0 100644 --- a/src/actors.js +++ b/src/actors.js @@ -31,6 +31,7 @@ export function curateActor(actor, context = {}) { isS3: actor.avatar.is_s3, }, likes: actor.stashed, + ...context.append?.[actor.id], }; } @@ -58,7 +59,7 @@ export async function fetchActorsById(actorIds, options = {}) { ]); if (options.order) { - return actors.map((actorEntry) => curateActor(actorEntry)); + return actors.map((actorEntry) => curateActor(actorEntry, { append: options.append })); } const curatedActors = actorIds.map((actorId) => { @@ -69,7 +70,7 @@ export async function fetchActorsById(actorIds, options = {}) { return null; } - return curateActor(actor); + return curateActor(actor, { append: options.append }); }).filter(Boolean); return curatedActors; diff --git a/src/scenes.js b/src/scenes.js index 8e6fc83..e4ba950 100644 --- a/src/scenes.js +++ b/src/scenes.js @@ -238,8 +238,10 @@ export async function fetchScenes(filters, rawOptions) { }), }); + const actorCounts = result.aggregations?.actorIds && Object.fromEntries(result.aggregations?.actorIds?.buckets.map((bucket) => [bucket.key, { count: bucket.doc_count }])); + const [actors] = await Promise.all([ - options.aggregate ? fetchActorsById(result.aggregations.actorIds.buckets.map((bucket) => bucket.key), { order: ['name', 'asc'] }) : [], + result.aggregations?.actorIds ? fetchActorsById(result.aggregations.actorIds.buckets.map((bucket) => bucket.key), { order: ['name', 'asc'], append: actorCounts }) : [], ]); const sceneIds = result.hits.hits.map((hit) => Number(hit._id));