-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from kougen/feat/error-support-and-better-templ…
…ating feat: working error handling and templates
- Loading branch information
Showing
6 changed files
with
64 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,3 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<script src="https://unpkg.com/htmx.org@1.9.2"></script> | ||
<script src="https://cdn.tailwindcss.com"></script> | ||
<title>Flashcard Generator - Error</title> | ||
</head> | ||
<body> | ||
<h1 class="text-2xl font-bold mb-4 text-red-500">Something went wrong!</h1> | ||
<p>{{ error }}</p> | ||
<a href="/">Back to home</a> | ||
</body> | ||
</html> | ||
<h1 class="text-xl font-bold mb-4 text-red-500">Something went wrong!</h1> | ||
<p class="border border-red p-4 rounded-md mb-2 bg-red-200">{{ error_message }}</p> | ||
<a class="px-6 py-2 bg-black text-white rounded-lg font-bold transform hover:-translate-y-1 transition duration-400" href="/">Back to home</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="relative"> | ||
<h1 class="text-xl font-bold mb-4 text-red-500">Uh oh...</h1> | ||
<p class="border border-red p-4 rounded-md mb-4 bg-red-200">File <span class="font-mono">{{ file_name }}</span> not found!</p> | ||
<a class="px-6 py-2 bg-black text-white rounded-lg font-bold transform hover:-translate-y-1 transition duration-400" href="/">Back to home</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<h1 class="text-2xl font-bold mb-4">Flashcard Generator</h1> | ||
<form id="flashcard-form" hx-post="/generate-pdf" hx-target="#pdf-link" enctype="multipart/form-data"> | ||
<table class="w-full border-collapse border border-gray-300" id="flashcard-table"> | ||
<thead> | ||
<tr> | ||
<th class="border p-2">Image</th> | ||
<th class="border p-2">Word</th> | ||
<th class="border p-2">Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr hx-get="/add-row" hx-trigger="load"></tr> | ||
</tbody> | ||
</table> | ||
<button type="button" class="mt-4 bg-blue-500 text-white px-4 py-2" | ||
hx-post="/add-row" hx-target="#flashcard-table tbody" hx-swap="beforeend"> | ||
Add Row | ||
</button> | ||
<button type="submit" class="mt-4 bg-green-500 text-white px-4 py-2">Generate PDF</button> | ||
</form> | ||
<div id="pdf-link" class="mt-4"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters