Skip to content

Commit

Permalink
Merge branch 'main' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
Natsume-197 committed Sep 9, 2024
2 parents b8457c4 + e435ecd commit 937a45b
Show file tree
Hide file tree
Showing 14 changed files with 334 additions and 202 deletions.
15 changes: 15 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: BrigadaSOS
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
2 changes: 1 addition & 1 deletion backend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ services:
- elasticsearch

pgsync:
image: natsume197/pgsync:3.1.0
image: natsume197/pgsync:3.2.1
networks:
- nadedb-network
depends_on:
Expand Down
266 changes: 208 additions & 58 deletions frontend_v2/components/search/modal/ModalAnkiNotes.vue

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions frontend_v2/components/search/modal/ModalBatch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,14 @@ watch(inputText, (newValue) => {
<tr v-for="(item, index) in sortedWordsMatch">
<td
class="y-4 whitespace-nowrap text-base text-center font-medium text-gray-800 dark:text-gray-200">
<a v-if="item.is_match" :href="'search/sentence?query=' + item.word + '&exact_match=true'"
<NuxtLink v-if="item.is_match"
:to="{
path: '/search/sentence',
query: { query: item.word }
}"
class="text-blue-500 underline-offset-2 underline" target="_blank">
{{ item.word }}
</a>
</NuxtLink>
<span v-else>
{{ item.word }}
</span>
Expand Down
17 changes: 6 additions & 11 deletions frontend_v2/components/search/segment/SegmentActionsContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,12 @@ const openAnkiModal = () => {
<template #content>
<SearchDropdownContent>
<!-- Anki by last added -->
<SearchDropdownItem
text="Añadir a Anki (Ultima carta añadida)"
:iconPath="mdiStarShootingOutline"
@click="addSentenceToAnki(content)"
/>
<SearchDropdownItem text="Añadir a Anki (Ultima carta añadida)" :iconPath="mdiStarShootingOutline"
@click="addSentenceToAnki(content)" />

<!-- Anki by ID -->
<SearchDropdownItem
text="Añadir a Anki (Busca en tu collección)"
:iconPath="mdiStarShootingOutline"
@click="openAnkiModal"
/>
<SearchDropdownItem text="Añadir a Anki (Busca en tu colección)" @click="openAnkiModal()"
:iconPath="mdiStarShootingOutline" data-hs-overlay="#hs-vertically-centered-scrollable-anki-collection" />
</SearchDropdownContent>
</template>
</SearchDropdownContainer>
Expand Down Expand Up @@ -111,7 +105,8 @@ const openAnkiModal = () => {
</template>
<template #content>
<SearchDropdownContent>
<SearchDropdownItem :text="$t('searchpage.main.buttons.share')" :iconPath="mdiShare" @click="getSharingURL(content.segment_info.uuid)" />
<SearchDropdownItem :text="$t('searchpage.main.buttons.share')" :iconPath="mdiShare"
@click="getSharingURL(content.segment_info.uuid)" />
</SearchDropdownContent>
</template>
</SearchDropdownContainer>
Expand Down
10 changes: 3 additions & 7 deletions frontend_v2/components/search/segment/SegmentContainer.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { mdiTranslate, mdiVolumeHigh } from '@mdi/js'
import ModalAnkiNotes from '../modal/ModalAnkiNotes.vue';
type Props = {
searchData: any;
Expand All @@ -13,7 +12,6 @@ const props = defineProps<Props>();
let locale = ref('en');
let selectedSentence = ref(null);
let showNotesSearch = ref(false);
let searchNoteSentence: Ref<Sentence | null> = ref(null);
// Order segment according to website language
Expand All @@ -40,26 +38,24 @@ const orderedSegments = computed(() => {
// @ts-ignore
const openModal = (content) => {
selectedSentence.value = content;
console.log(content);
};
const openAnkiModal = (sentence: Sentence) => {
showNotesSearch.value = true;
searchNoteSentence.value = sentence;
};
</script>
<template>
<div v-if="searchData?.sentences?.length > 0 && searchData">
<SearchModalContext :sentence="selectedSentence" />
<ModalAnkiNotes v-if="showNotesSearch" :sentence="searchNoteSentence" :onClose="() => showNotesSearch = false"
<SearchModalAnkiNotes :sentence="searchNoteSentence"
:onClick="(sentence: Sentence, id: number) => addSentenceToAnki(sentence, id)" />
<GeneralLazy v-for="(sentence, index) in searchData.sentences" :key="sentence.segment_info.position"
:id="sentence.segment_info.position" :unrender="true" :min-height="300"
:id="sentence.segment_info.position" :unrender="true" :min-height="300"
class="hover:bg-neutral-800/20 items-center b-2 transition-all rounded-lg flex flex-col lg:flex-row py-2"
:class="{ 'bg-neutral-800 hover:bg-neutral-800': sentence.segment_info.position === currentSentenceIndex }">
<!-- Image -->
Expand Down
Loading

0 comments on commit 937a45b

Please sign in to comment.