Merge pull request #36 from ViossaDiskordServer/minor-fixes

fix: page styling, search page
This commit is contained in:
Sheldon Cooper 2026-01-17 16:21:15 -05:00 committed by GitHub
commit 3940146f3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 54 additions and 34 deletions

View file

@ -59,17 +59,13 @@ function initExpress() {
await Lemma.find({ relations: { word_forms: { lect: true } } }) await Lemma.find({ relations: { word_forms: { lect: true } } })
).filter((e) => { ).filter((e) => {
for (const wf of e.word_forms) { for (const wf of e.word_forms) {
if (wf.word_form.includes(search_term)) { return wf.word_form.includes(search_term);
return true;
}
} }
}); });
const lects = await Lect.find();
res.status(200).send({ res.status(200).send({
terms: lemmas.length, terms: lemmas.length,
results: lemmas, results: lemmas
lects: lects,
}); });
}); });
@ -101,6 +97,8 @@ function initExpress() {
}); });
} }
//todo: redo this without using google sheets; instead, use a local CSV or like.
/** /**
* @param auth The authenticated Google OAuth client. * @param auth The authenticated Google OAuth client.
*/ */

View file

@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="en" class="has-background-black has-navbar-fixed-top"> <html lang="en" class="has-navbar-fixed-top">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/viossa_circle.svg"/> <link rel="icon" type="image/svg+xml" href="/viossa_circle.svg"/>

View file

@ -56,7 +56,7 @@ const closeBurger = (): void => {
<RouterLink class="navbar-item" to="/kotoba"> <RouterLink class="navbar-item" to="/kotoba">
Kotoba Kotoba
</RouterLink> </RouterLink>
<LocalePicker /> <LocalePicker class="navbar-item"/>
</div> </div>
</div> </div>
</nav> </nav>

View file

@ -13,7 +13,7 @@ defineProps<{
<template v-if="reverse"> <template v-if="reverse">
<div class="column"> <div class="column">
<h2 class="title is-4">{{ title }}</h2> <h2 class="title is-4">{{ title }}</h2>
<p class="has-text-white">{{ text }}</p> <p>{{ text }}</p>
</div> </div>
<div class="column is-one-quarter" v-if="image"> <div class="column is-one-quarter" v-if="image">
<figure class="image"> <figure class="image">
@ -30,7 +30,7 @@ defineProps<{
</div> </div>
<div class="column"> <div class="column">
<h2 class="title is-4">{{ title }}</h2> <h2 class="title is-4">{{ title }}</h2>
<p class="has-text-white">{{ text }}</p> <p>{{ text }}</p>
</div> </div>
</template> </template>
</div> </div>

View file

@ -5,13 +5,13 @@
</section> </section>
<section class="section container"> <section class="section container">
<input type="text" name="text" id="aaa"> <p class="notification">
under construction :3
</p>
</section> </section>
</div> </div>
</template> </template>
<!-- --> <script lang="ts">
<script setup lang="ts">
</script> </script>

View file

@ -0,0 +1,12 @@
import axios from "axios";
import SERVER_URL from "./web.service"
import type { SearchResult } from "@repo/common/dto";
export default class KotobaService {
public static search(search_term:string){
return axios.get<SearchResult>(`${SERVER_URL}/search`,
{params:{ search_term }});
}
}

View file

@ -0,0 +1,4 @@
/* Establish constants here */
export default class WebConstants {
static SERVER_URL: string = "http://localhost:1225"
}

View file

@ -1,51 +1,57 @@
export interface SearchResult {
terms: number;
results: LemmaDto[];
lects: LectDto[];
}
export interface LemmaDto { export interface LemmaDto {
lemma_name: string; lemma_name: string;
word_forms: WordFormDto[]; word_forms: WordFormDto[];
examples: ExampleDto[]; examples: ExampleDto[];
definitions: DefinitionDto[]; definitions: DefinitionDto[];
comments: CommentDto[]; comments: CommentDto[];
media: MediaDto[]; media: MediaDto[];
parts_of_speech: PartOfSpeechDto[]; parts_of_speech: PartOfSpeechDto[];
} }
export interface LectDto { export interface LectDto {
name: string; name: string;
word_forms: WordFormDto[]; word_forms: WordFormDto[];
} }
export interface WordFormDto { export interface WordFormDto {
word_form_id: number; word_form_id: number;
word_form: string; word_form: string;
lemma: LemmaDto; lemma: LemmaDto;
lect: LectDto; lect: LectDto;
} }
export interface ExampleDto { export interface ExampleDto {
example_id: number; example_id: number;
example_text: string; example_text: string;
lemma: LemmaDto; lemma: LemmaDto;
} }
export interface MediaDto { export interface MediaDto {
media_id: number; media_id: number;
media_url: string; media_url: string;
lemma: LemmaDto; lemma: LemmaDto;
} }
export interface DefinitionDto { export interface DefinitionDto {
definition_id: number; definition_id: number;
definition_text: string; definition_text: string;
lemma: LemmaDto; lemma: LemmaDto;
} }
export interface CommentDto { export interface CommentDto {
comment_id: number; comment_id: number;
comment_text: string; comment_text: string;
lemma: LemmaDto; lemma: LemmaDto;
} }
export interface PartOfSpeechDto { export interface PartOfSpeechDto {
long_form: string; long_form: string;
short_form: string; short_form: string;
} }