Skip to main content

max / makenotwork

5.9 KB · 139 lines History Blame Raw
1 {% extends "base.html" %}
2
3 {% block title %}{{ item.title }} - Makenotwork{% endblock %}
4
5 {% block head %}
6 <meta property="og:title" content="{{ item.title }} - {{ creator_username }}">
7 <meta property="og:description" content="{{ item.description }}">
8 <meta property="og:type" content="music.song">
9 <meta property="og:url" content="{{ host_url }}/i/{{ item.id }}">
10 <meta property="og:site_name" content="Makenot.work">
11 {% match item.content %}
12 {% when crate::types::ItemContent::Audio with { cover_url, .. } %}
13 {% if let Some(img) = cover_url %}
14 <meta property="og:image" content="{{ img }}">
15 <meta name="twitter:card" content="summary_large_image">
16 <meta name="twitter:image" content="{{ img }}">
17 {% else %}
18 <meta name="twitter:card" content="summary">
19 {% endif %}
20 {% when _ %}
21 <meta name="twitter:card" content="summary">
22 {% endmatch %}
23 <meta name="twitter:title" content="{{ item.title }} - {{ creator_username }}">
24 <meta name="twitter:description" content="{{ item.description }}">
25 <script type="application/ld+json">
26 {
27 "@context": "https://schema.org",
28 "@type": "MusicRecording",
29 "name": "{{ item.title_json()|safe }}",
30 "description": "{{ item.description_json()|safe }}",
31 "url": "{{ host_url }}/i/{{ item.id }}",
32 "byArtist": {
33 "@type": "Person",
34 "name": "{{ creator_username }}",
35 "url": "{{ host_url }}/u/{{ creator_username }}"
36 }{% match item.content %}{% when crate::types::ItemContent::Audio with { cover_url, duration, .. } %}{% if let Some(img) = cover_url %},
37 "image": "{{ img }}"{% endif %}{% if let Some(dur) = duration %},
38 "duration": "{{ dur }}"{% endif %}{% when _ %}{% endmatch %}{% if let Some(pt) = project_title %},
39 "inAlbum": {
40 "@type": "MusicAlbum",
41 "name": "{{ pt }}",
42 "url": "{{ host_url }}/p/{{ project_slug }}"
43 }{% endif %},
44 "isPartOf": {
45 "@type": "WebSite",
46 "name": "Makenot.work",
47 "url": "{{ host_url }}"
48 }
49 }
50 </script>
51 <link rel="stylesheet" href="/static/media-player.css">
52 {% endblock %}
53
54 {% block content %}
55 {% include "partials/site_header.html" %}
56
57 <article class="media-container">
58 <header class="author-header">
59 <div class="author-avatar">{{ creator_avatar_initials }}</div>
60 <div class="author-info">
61 <div class="author-name"><a href="/u/{{ creator_username }}">{% if let Some(name) = creator_display_name %}{{ name }}{% else %}{{ creator_username }}{% endif %}</a></div>
62 <div class="media-meta">{{ item.release_date }}{% match item.content %}{% when crate::types::ItemContent::Audio with { duration, .. } %}{% if let Some(dur) = duration %} | {{ dur }}{% endif %}{% when _ %}{% endmatch %}</div>
63 </div>
64 </header>
65
66 <h1 class="media-title">{{ item.title }}</h1>
67
68 {% if let Some(project_title) = project_title %}
69 <p class="media-series">
70 <a href="/p/{{ project_slug }}">{{ project_title }}</a>{% match item.content %}{% when crate::types::ItemContent::Audio with { episode_number, .. } %}{% if let Some(episode) = episode_number %} | Episode {{ episode }}{% endif %}{% when _ %}{% endmatch %}
71 </p>
72 {% endif %}
73
74 <div class="cover-art">
75 {% match item.content %}
76 {% when crate::types::ItemContent::Audio with { cover_url, .. } %}
77 {% if let Some(url) = cover_url %}
78 <img src="{{ url }}" alt="{{ item.title }} cover art">
79 {% else %}
80 [Cover Art]
81 {% endif %}
82 {% when _ %}
83 [Cover Art]
84 {% endmatch %}
85 </div>
86
87 {% if !item.description.is_empty() %}
88 <div class="media-description">
89 <p>{{ item.description }}</p>
90 </div>
91 {% endif %}
92
93 <div class="store-cta audio-store-cta">
94 {% if has_access %}
95 <p class="audio-access-msg">You have access to this item.</p>
96 <a href="/l/{{ item.id }}" class="btn-primary">View in library &rarr;</a>
97 {% else if item.is_free %}
98 {% if let Some(_user) = session_user %}
99 {% if in_library %}
100 <span class="library-status audio-library-status">In your library &middot; <a href="/l/{{ item.id }}">Listen now &rarr;</a></span>
101 {% else %}
102 <button class="add-to-library-btn btn-primary"
103 hx-post="/api/library/add/{{ item.id }}"
104 hx-swap="outerHTML">Add to Library - Free</button>
105 {% endif %}
106 {% else %}
107 <a href="/login?redirect=/l/{{ item.id }}" class="btn-primary">Log in to listen - Free</a>
108 {% endif %}
109 {% else %}
110 <p class="audio-price">{{ item.price }}</p>
111 {% if let Some(_user) = session_user %}
112 <a href="/purchase/{{ item.id }}" class="btn-primary">{% if item.pwyw_enabled %}Pay What You Want{% else %}Buy Once{% endif %} - {{ item.price }}</a>
113 {% else %}
114 <a href="/login?redirect=/i/{{ item.id }}" class="btn-primary">Log in to purchase</a>
115 {% endif %}
116 <p class="audio-fee-note">Support {{ creator_username }} directly &mdash; 0% platform fee.</p>
117 {% endif %}
118 </div>
119
120 {% if !item.tags.is_empty() %}
121 <div class="media-tags">
122 {% for tag in item.tags %}
123 <a href="/discover?tag={{ tag.slug }}" class="tag audio-tag-link">{{ tag.name }}</a>
124 {% endfor %}
125 </div>
126 {% endif %}
127
128 </article>
129
130 {% include "partials/discussion_section.html" %}
131
132 <footer class="media-player-footer">
133 <a href="/i/{{ item.id }}" data-copy-link>Copy link</a> &middot;
134 <a href="/">Makenot<span class="dot">.</span>work</a> | Fair distribution for creatives of all kinds
135 </footer>
136 {% endblock %}
137
138 {% block scripts %}{% endblock %}
139