Skip to content

Commit 1f86219

Browse files
author
SM_SAYEED
committed
"Fix Drive clip rendering and download logic"
1 parent 2c7b8ee commit 1f86219

File tree

1 file changed

+50
-41
lines changed

1 file changed

+50
-41
lines changed

templates/clips.html

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,71 +12,80 @@
1212
box-shadow: 0 1px 6px #2224;
1313
color: #f1f1f1;
1414
}
15-
.admin-link a {
16-
color: #fff;
17-
text-decoration: none;
18-
margin-left: 1em;
19-
font-weight: bold;
20-
}
21-
.admin-link a:hover {
22-
text-decoration: underline;
15+
iframe, video, audio {
16+
margin-top: 0.7em;
17+
width: 380px;
18+
border: none;
2319
}
2420
.download-link {
2521
color: #6af;
2622
font-weight: bold;
2723
}
28-
iframe {
29-
margin-top: 0.7em;
30-
width: 380px;
31-
height: 240px;
32-
border: none;
24+
.admin-link a {
25+
color: #fff;
26+
text-decoration: none;
27+
margin-left: 1em;
28+
font-weight: bold;
3329
}
30+
.admin-link a:hover { text-decoration: underline; }
3431
</style>
3532
</head>
3633
<body>
37-
<div class="container">
38-
<!-- Admin Login/Logout -->
39-
<div class="admin-link" style="text-align: right; margin-bottom: 1em;">
40-
{% if session.admin %}
41-
<a href="{{ url_for('logout') }}">Logout</a>
42-
{% else %}
43-
<a href="{{ url_for('login') }}">Admin Login</a>
44-
{% endif %}
45-
</div>
34+
<div class="container">
35+
<!-- Admin Login/Logout -->
36+
<div class="admin-link" style="text-align: right; margin-bottom: 1em;">
37+
{% if session.admin %}
38+
<a href="{{ url_for('logout') }}">Logout</a>
39+
{% else %}
40+
<a href="{{ url_for('login') }}">Admin Login</a>
41+
{% endif %}
42+
</div>
4643

47-
<h1>Music & Guitar Clips</h1>
44+
<h1>Music & Guitar Clips</h1>
4845

49-
{% if admin %}
50-
<p style="margin-top: 1em;">
51-
<a href="{{ url_for('add_drive_clip') }}" style="color: #6af; font-weight:bold;">
52-
➕ Add Drive Clip via Form
53-
</a>
54-
</p>
55-
{% endif %}
46+
{% if admin %}
47+
<p style="margin-top: 1em;">
48+
<a href="{{ url_for('add_drive_clip') }}" style="color: #6af; font-weight:bold;">
49+
➕ Add Drive Clip via Form
50+
</a>
51+
</p>
52+
{% endif %}
5653

57-
{% if clips %}
58-
{% for preview, download, title, description in clips %}
54+
{% if clips %}
55+
{% for preview, download, title, description in clips %}
5956
<div class="section">
6057
<b>{{ title }}</b><br>
6158
<small>{{ description }}</small><br>
6259

63-
{% if preview %}
60+
{% if 'drive.google.com' in preview %}
6461
<iframe src="{{ preview }}" allow="autoplay" allowfullscreen></iframe>
62+
{% elif preview.endswith('.mp4') %}
63+
<video controls>
64+
<source src="{{ preview }}">
65+
Your browser does not support the video tag.
66+
</video>
67+
{% elif preview.endswith('.mp3') or preview.endswith('.wav') %}
68+
<audio controls>
69+
<source src="{{ preview }}">
70+
Your browser does not support the audio element.
71+
</audio>
72+
{% else %}
73+
<a href="{{ preview }}" target="_blank">{{ preview }}</a>
6574
{% endif %}
6675

6776
{% if download %}
6877
<br><a class="download-link" href="{{ download }}" target="_blank">Download</a>
6978
{% endif %}
7079
</div>
71-
{% endfor %}
72-
{% else %}
73-
<p>No music clips listed in <code>drive_music.csv</code></p>
74-
{% endif %}
80+
{% endfor %}
81+
{% else %}
82+
<p>No music clips found.</p>
83+
{% endif %}
7584

76-
<div style="margin-top: 2em;">
77-
<a href="{{ url_for('public_home') }}">Home</a> |
78-
<a href="{{ url_for('materials_portal') }}">Materials Database</a>
79-
</div>
85+
<div style="margin-top: 2em;">
86+
<a href="{{ url_for('public_home') }}">Home</a> |
87+
<a href="{{ url_for('materials_portal') }}">Materials Database</a>
8088
</div>
89+
</div>
8190
</body>
8291
</html>

0 commit comments

Comments
 (0)