Bring back tag search

Closes #369

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-08-10 18:54:25 +02:00
parent e4e316b42b
commit 1ed83e463b
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
3 changed files with 25 additions and 6 deletions

View File

@ -333,7 +333,6 @@
"Save draft": "Save draft", "Save draft": "Save draft",
"Save": "Save", "Save": "Save",
"Search events, groups, etc.": "Search events, groups, etc.", "Search events, groups, etc.": "Search events, groups, etc.",
"Search results: \"{search}\"": "Search results: \"{search}\"",
"Search": "Search", "Search": "Search",
"Searching…": "Searching…", "Searching…": "Searching…",
"Send email": "Send email", "Send email": "Send email",
@ -743,5 +742,12 @@
"Next month": "Next month", "Next month": "Next month",
"Any day": "Any day", "Any day": "Any day",
"{nb} km": "{nb} km", "{nb} km": "{nb} km",
"any distance": "any distance" "any distance": "any distance",
"Group visibility": "Group visibility",
"The group will be publicly listed in search results and may be suggested in the explore section. Only public informations will be shown on it's page.": "The group will be publicly listed in search results and may be suggested in the explore section. Only public informations will be shown on it's page.",
"You'll need to transmit the group URL so people may access the group's profile.": "You'll need to transmit the group URL so people may access the group's profile.",
"Group address": "Group address",
"Events tagged with {tag}": "Events tagged with {tag}",
"Explore events": "Explore events",
"#{tag}": "#{tag}"
} }

View File

@ -492,7 +492,6 @@
"Save draft": "Enregistrer le brouillon", "Save draft": "Enregistrer le brouillon",
"Search": "Rechercher", "Search": "Rechercher",
"Search events, groups, etc.": "Rechercher des évènements, des groupes, etc.", "Search events, groups, etc.": "Rechercher des évènements, des groupes, etc.",
"Search results: \"{search}\"": "Résultats de recherche : « {search} »",
"Searching…": "Recherche en cours…", "Searching…": "Recherche en cours…",
"Select a language": "Choisissez une langue", "Select a language": "Choisissez une langue",
"Select a timezone": "Selectionnez un fuseau horaire", "Select a timezone": "Selectionnez un fuseau horaire",
@ -743,5 +742,12 @@
"Next month": "Le mois-prochain", "Next month": "Le mois-prochain",
"Any day": "N'importe quand", "Any day": "N'importe quand",
"{nb} km": "{nb} km", "{nb} km": "{nb} km",
"any distance": "peu importe" "any distance": "peu importe",
"Group visibility": "Visibility du groupe",
"The group will be publicly listed in search results and may be suggested in the explore section. Only public informations will be shown on it's page.": "Le groupe sera listé publiquement dans les résultats de recherche et pourra être suggéré sur la page « Explorer ». Seules les informations publiques seront affichées sur sa page.",
"You'll need to transmit the group URL so people may access the group's profile.": "Vous aurez besoin de transmettre l'URL du groupe pour que d'autres personnes accèdent au profil du groupe.",
"Group address": "Adresse du groupe",
"Events tagged with {tag}": "Événements taggés avec {tag}",
"Explore events": "Explorer les événements",
"#{tag}": "#{tag}"
} }

View File

@ -1,7 +1,12 @@
<template> <template>
<div class="section container"> <div class="section container">
<h1 class="title">{{ $t("Explore") }}</h1> <h1 class="title">{{ $t("Explore") }}</h1>
<section class="hero is-light"> <section v-if="actualTag">
<i18n path="Events tagged with {tag}">
<b-tag slot="tag" type="is-light">{{ $t("#{tag}", { tag: actualTag }) }}</b-tag>
</i18n>
</section>
<section class="hero is-light" v-else>
<div class="hero-body"> <div class="hero-body">
<form @submit.prevent="submit()"> <form @submit.prevent="submit()">
<b-field :label="$t('Key words')" label-for="search" expanded> <b-field :label="$t('Key words')" label-for="search" expanded>
@ -44,7 +49,7 @@
</form> </form>
</div> </div>
</section> </section>
<section class="events-featured" v-if="searchEvents.initial"> <section class="events-featured" v-if="!actualTag && searchEvents.initial">
<b-loading :active.sync="$apollo.loading"></b-loading> <b-loading :active.sync="$apollo.loading"></b-loading>
<h2 class="title">{{ $t("Featured events") }}</h2> <h2 class="title">{{ $t("Featured events") }}</h2>
<div v-if="events.length > 0" class="columns is-multiline"> <div v-if="events.length > 0" class="columns is-multiline">
@ -197,6 +202,7 @@ const tabsName: { events: number; groups: number } = {
}, },
}) })
export default class Search extends Vue { export default class Search extends Vue {
@Prop({ type: String, required: false }) tag!: string;
events: IEvent[] = []; events: IEvent[] = [];
searchEvents: Paginate<IEvent> & { initial: boolean } = { total: 0, elements: [], initial: true }; searchEvents: Paginate<IEvent> & { initial: boolean } = { total: 0, elements: [], initial: true };
@ -207,6 +213,7 @@ export default class Search extends Vue {
activeTab: SearchTabs = tabsName[this.$route.query.searchType as "events" | "groups"] || 0; activeTab: SearchTabs = tabsName[this.$route.query.searchType as "events" | "groups"] || 0;
location: IAddress = new Address(); location: IAddress = new Address();
actualTag: string = this.tag;
options: ISearchTimeOption[] = [ options: ISearchTimeOption[] = [
{ {