Skip to main content

max / makenotwork

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