feat(schedule): update view

This commit is contained in:
2026-04-16 23:05:41 +03:00
parent 29fa6435ce
commit a0e6f30e3b
11 changed files with 84 additions and 39 deletions

View File

@@ -89,6 +89,8 @@ app
ul.app-list {
list-style: none;
padding-left: 0;
width: 30rem;
margin: auto;
}
ul.app-list > li {
@@ -104,9 +106,9 @@ ul.app-list > li > a {
}
ul.app-list > li:hover {
border-color: blue;
border-color: rgb(125, 125, 255);
}
ul.app-list > li:hover > a {
color: blue;
color: rgb(125, 125, 255);
}

View File

@@ -44,11 +44,7 @@ def mount(app: FastAPI):
async def get_schedule_tag(request: AppRequest, tag: str, live: bool = False):
tag_value = TagUtil.parse_tag(tag)
schedule_api = request.app.state.api.schedule
channels = await schedule_api.get_channels()
responses = [
await schedule_api.get_channel_schedule(channel, tag_value.date)
for channel in channels
]
results = await schedule_api.get_all_schedules(tag_value.date)
return templates.TemplateResponse(
request=request,
name="schedule.html",
@@ -56,9 +52,8 @@ def mount(app: FastAPI):
"version": __version__,
"tag_util": TagUtil,
"datetime": datetime,
"channels": channels,
"response": responses[0],
"responses": responses,
"response": results[0],
"responses": results,
"live": live,
},
)

View File

@@ -1,18 +1,25 @@
tr {
table.schedule-table {
width: 60rem;
margin: auto;
table-layout: auto
}
table.schedule-table tr {
border-bottom: 1px solid lightgray;
}
td {
table.schedule-table td {
text-align: left;
}
tr.live {
table.schedule-table tr.live {
font-weight: bold;
}
.title {
table.schedule-table .title {
margin-top: 0.5rem;
font-style: italic;
font-weight: bold;
font-size: 120%;
background-color: lightgray;
}

View File

@@ -22,7 +22,7 @@
{% endblock %}
{% block content %}
<table>
<table class="schedule-table">
<thead>
<tr>
<td></td>

View File

@@ -23,7 +23,7 @@
{% block content %}
<div>
<table class="{{'live' if live else ''}}">
<table class="schedule-table {{'live' if live else ''}}">
<thead>
<tr>
<td></td>
@@ -35,9 +35,9 @@
{% for response in responses %}
{% set values = (response.values|selectattr('live') if live else response.values)|list %}
{% if values|length > 0 %}
<tr>
<tr class="title">
<td colspan="3">
<div class="title">{{response.channel.name}}</div>
<div>{{response.channel.name}}</div>
</td>
<td></td>
<td></td>