✨ Added pagination to pixabay importer
This commit is contained in:
@@ -96,7 +96,7 @@ async def import_quiz(quiz_id: str, user: User) -> Quiz | str:
|
|||||||
cover = img_obj.id.hex
|
cover = img_obj.id.hex
|
||||||
quiz_data = Quiz(
|
quiz_data = Quiz(
|
||||||
id=quiz_id,
|
id=quiz_id,
|
||||||
public=True,
|
public=False,
|
||||||
title=html.unescape(bleach.clean(quiz.kahoot.title, tags=ALLOWED_TAGS_FOR_QUIZ, strip=True)),
|
title=html.unescape(bleach.clean(quiz.kahoot.title, tags=ALLOWED_TAGS_FOR_QUIZ, strip=True)),
|
||||||
description=html.unescape(bleach.clean(quiz.kahoot.description, tags=ALLOWED_TAGS_FOR_QUIZ, strip=True)),
|
description=html.unescape(bleach.clean(quiz.kahoot.description, tags=ALLOWED_TAGS_FOR_QUIZ, strip=True)),
|
||||||
created_at=datetime.now(),
|
created_at=datetime.now(),
|
||||||
|
|||||||
@@ -93,6 +93,22 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<BrownButton
|
||||||
|
disabled={page < 2}
|
||||||
|
on:click={() => {
|
||||||
|
page -= 1;
|
||||||
|
fetched_data = fetch_data();
|
||||||
|
}}
|
||||||
|
>{$t('uploader.previous_page')}
|
||||||
|
</BrownButton>
|
||||||
|
<BrownButton
|
||||||
|
on:click={() => {
|
||||||
|
page += 1;
|
||||||
|
fetched_data = fetch_data();
|
||||||
|
}}>{$t('uploader.next_page')}</BrownButton
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -300,7 +300,9 @@
|
|||||||
"upload_video": "Upload Video",
|
"upload_video": "Upload Video",
|
||||||
"visit_pixabay": "Visit Pixabay",
|
"visit_pixabay": "Visit Pixabay",
|
||||||
"images_by_pixabay": "Images provided by Pixabay",
|
"images_by_pixabay": "Images provided by Pixabay",
|
||||||
"search_english_only": "The search works in English only"
|
"search_english_only": "The search works in English only",
|
||||||
|
"next_page": "Next page",
|
||||||
|
"previous_page": "Previous page"
|
||||||
},
|
},
|
||||||
"avatar_settings": {
|
"avatar_settings": {
|
||||||
"skin_color": "Skin color",
|
"skin_color": "Skin color",
|
||||||
|
|||||||
Reference in New Issue
Block a user