This commit is contained in:
rebane2001 2023-05-11 16:42:41 +03:00
parent a9d8a750b8
commit 39e18a42a9
7 changed files with 52 additions and 12 deletions

4
hobune.py Normal file
View File

@ -0,0 +1,4 @@
import hobune.__main__
if __name__ == '__main__':
hobune.__main__.main()

View File

@ -1,5 +1,3 @@
import os
from hobune.assets import init_assets, update_templates
from hobune.channels import initialize_channels, create_channel_pages
from hobune.logger import logger
@ -8,9 +6,6 @@ from hobune.videos import create_video_pages
def main():
# TODO: Remove
os.chdir("..")
config = load_config()
if not config:
exit()

View File

@ -112,6 +112,8 @@ def get_channel_search_string(channel: HobuneChannel):
def get_channel_aka(channel: HobuneChannel):
if channel.id == "other":
return ""
escaped_id = html.escape(channel.id)
aka_string = f'<a href="https://www.youtube.com/channel/{escaped_id}">{escaped_id}</a>'
if channel.username:

View File

@ -1,4 +1,4 @@
<div class="ui yellow message">
<div class="yellow note">
<div class="title">Example note!</div>
<p>This note will appear on the channel page of a channel whose ID is "example".</p>
</div>

View File

@ -3,7 +3,6 @@
<div class="title">
<h1 style="display: inline-block;">{channel}</h1>
{subtitle}
{note}
</div>
<div>
<div>
@ -19,6 +18,7 @@
</div>
</div>
</div>
{note}
<div class="channels flex-grid">
{cards}
</div>

View File

@ -302,6 +302,45 @@ a {
color: rgba(0,0,0,.9);
}
/* Note */
.note {
margin: 14px;
padding: 14px 14px 0 14px;
color: rgba(0,0,0,.87);
border: solid rgba(0,0,0,.87) 1px;
background-color: #f8f8f9;
border-radius: 4px;
}
.note.yellow {
color: #b58105;
border: solid #b58105 1px;
background-color: #fff8db;
}
.note.red {
color: #db2828;
border: solid #db2828 1px;
background-color: #ffe8e6;
}
.note.green {
color: #1ebc30;
border: solid #1ebc30 1px;
background-color: #e5f9e7;
}
.note.blue {
color: #276f86;
border: solid #276f86 1px;
background-color: #f8ffff;
}
.note .title {
font-weight: 700;
font-size: 18px;
}
/* Other */
.sort, .search {
border: 1px solid rgba(34,36,38,.15);
@ -335,15 +374,15 @@ a {
}
.removed {
background-color: #ffb4df!important;
background-color: #ffb4df;
}
.unlisted {
background-color: #fff1b4!important;
background-color: #fff1b4;
}
.removed.unlisted {
background-color: #ffa1a1!important;
background-color: #ffa1a1;
}
.thumbnail {

View File

@ -55,10 +55,10 @@ function channelSearch() {
document.querySelectorAll('.searchable').forEach((e) => {
let filtered = false;
for (const c of allowedClasses) {
if (!e.classList.contains(c)) filtered = true;
if (!e.querySelector(`.${c}`)) filtered = true;
}
for (const c of filteredClasses) {
if (e.classList.contains(c)) filtered = true;
if (e.querySelector(`.${c}`)) filtered = true;
}
if (!filtered && (searchTerm === "" || e.dataset.search.toLowerCase().includes(searchTerm))) {