Skip to content

Commit

Permalink
remove unsude code
Browse files Browse the repository at this point in the history
  • Loading branch information
VovaStelmashchuk committed Dec 8, 2024
1 parent 2dfe76c commit cba9622
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 108 deletions.
67 changes: 43 additions & 24 deletions src/templates/pages/admin/login.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
<div class="container mx-auto p-4">
<form hx-post="/login" hx-target="#login-form-error" class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="username">
Username
</label>
<input class="input-field focus:outline-none focus:shadow-outline"
id="username" name="username" type="text" placeholder="Username" required>
</div>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2" for="password">
Password
</label>
<input class="input-field focus:outline-none focus:shadow-outline"
id="password" name="password" type="password" placeholder="******************" required>
</div>
<div id="login-form-error"></div>
<div class="flex items-center justify-between">
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
type="submit">
Sign In
</button>
</div>
</form>
</div>
<form
hx-post="/login"
hx-target="#login-form-error"
class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4"
>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="username">
Username
</label>
<input
class="input-field focus:outline-none focus:shadow-outline"
id="username"
name="username"
type="text"
placeholder="Username"
required
/>
</div>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2" for="password">
Password
</label>
<input
class="input-field focus:outline-none focus:shadow-outline"
id="password"
name="password"
type="password"
placeholder="******************"
required
/>
</div>
<div id="login-form-error"></div>
<div class="flex items-center justify-between">
<button
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
type="submit"
>
Sign In
</button>
</div>
</form>
</div>

10 changes: 0 additions & 10 deletions src/templates/pages/admin/youtube_text.html

This file was deleted.

1 change: 0 additions & 1 deletion src/templates/pages/edit_podcast_time_code_wrapper.html

This file was deleted.

51 changes: 34 additions & 17 deletions src/templates/pages/home.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
<div class="flex justify-center">
<div id="tabs" hx-target="#tab-contents" role="tablist">
<button role="tab" aria-controls="tab-contents" aria-selected="true" hx-get="/tab-podcast-list"
class="px-4 py-2 font-semibold text-black bg-gray-200 rounded-t-md focus:outline-none selected">
<button
role="tab"
aria-controls="tab-contents"
aria-selected="true"
hx-get="/tab-podcast-list"
class="px-4 py-2 font-semibold text-black bg-gray-200 rounded-t-md focus:outline-none selected"
>
Podcasts
</button>
<button role="tab" aria-controls="tab-contents" aria-selected="false" hx-get="/tab-about"
class="px-4 py-2 font-semibold text-black bg-gray-200 rounded-t-md focus:outline-none">
<button
role="tab"
aria-controls="tab-contents"
aria-selected="false"
hx-get="/tab-about"
class="px-4 py-2 font-semibold text-black bg-gray-200 rounded-t-md focus:outline-none"
>
About
</button>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('tabs').addEventListener('click', function (event) {
if (event.target.tagName !== 'BUTTON') return
let currentTab = document.querySelector('[aria-selected=true]');
currentTab.setAttribute('aria-selected', 'false')
currentTab.classList.remove('selected')
let newTab = event.target
newTab.setAttribute('aria-selected', 'true')
newTab.classList.add('selected')
})
})
document.addEventListener("DOMContentLoaded", function () {
document
.getElementById("tabs")
.addEventListener("click", function (event) {
if (event.target.tagName !== "BUTTON") return;
let currentTab = document.querySelector("[aria-selected=true]");
currentTab.setAttribute("aria-selected", "false");
currentTab.classList.remove("selected");
let newTab = event.target;
newTab.setAttribute("aria-selected", "true");
newTab.classList.add("selected");
});
});
</script>
</div>
<div id="tab-contents" role="tabpanel" hx-get="/tab-podcast-list" hx-trigger="load" class="p-4">
</div>
<div
id="tab-contents"
role="tabpanel"
hx-get="/tab-podcast-list"
hx-trigger="load"
class="p-4"
></div>
5 changes: 0 additions & 5 deletions src/templates/pages/progress.html

This file was deleted.

20 changes: 11 additions & 9 deletions src/templates/partials/admin_head.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<div>
<div class="bg-gray-200 p-6 rounded-lg text-center cursor-pointer" id="header">
<h1 class="text-3xl md:text-4xl font-bold mb-4">Podcast admin</h1>
</div>
<script>
document.getElementById('header')
.addEventListener('click', function () {
window.location.href = '/admin/dashboard';
});
</script>
<div
class="bg-gray-200 p-6 rounded-lg text-center cursor-pointer"
id="header"
>
<h1 class="text-3xl md:text-4xl font-bold mb-4">Podcast admin</h1>
</div>
<script>
document.getElementById("header").addEventListener("click", function () {
window.location.href = "/admin/dashboard";
});
</script>
</div>
5 changes: 0 additions & 5 deletions src/templates/partials/buttons/build_audio.html

This file was deleted.

4 changes: 0 additions & 4 deletions src/templates/partials/buttons/publish_button.html

This file was deleted.

9 changes: 0 additions & 9 deletions src/templates/partials/editable_link.html

This file was deleted.

17 changes: 0 additions & 17 deletions src/templates/partials/editable_time_code.html

This file was deleted.

22 changes: 15 additions & 7 deletions src/templates/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
<div>
<div class="bg-gray-200 p-6 rounded-lg mb-8 text-center cursor-pointer" id="header">
<div
class="bg-gray-200 p-6 rounded-lg mb-8 text-center cursor-pointer"
id="header"
>
<h1 class="text-3xl md:text-4xl font-bold mb-4">{{showName}}</h1>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 container max-w-screen-xl mx-auto">
<div
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 container max-w-screen-xl mx-auto"
>
{{#each header_links}}
<a href="{{link}}">
<button class="bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded w-full">{{text}}</button>
<button
class="bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded w-full"
>
{{text}}
</button>
</a>
{{/each}}
</div>
</div>
<script>
document.getElementById('header')
.addEventListener('click', function () {
window.location.href = '/';
});
document.getElementById("header").addEventListener("click", function () {
window.location.href = "/";
});
</script>
</div>

0 comments on commit cba9622

Please sign in to comment.