Skip to main content

max / makenotwork

5.6 KB · 134 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="video.other">
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::Video 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": "VideoObject",
30 "name": "{{ item.title_json()|safe }}",
31 "description": "{{ item.description_json()|safe }}",
32 "url": "{{ host_url }}/i/{{ item.id }}",
33 "author": {
34 "@type": "Person",
35 "name": "{{ creator_username }}",
36 "url": "{{ host_url }}/u/{{ creator_username }}"
37 }{% match item.content %}{% when crate::types::ItemContent::Video with { cover_url, duration, .. } %}{% if let Some(img) = cover_url %},
38 "thumbnailUrl": "{{ img }}"{% endif %}{% if let Some(dur) = duration %},
39 "duration": "{{ dur }}"{% endif %}{% when _ %}{% endmatch %}{% if let Some(pt) = project_title %},
40 "isPartOf": {
41 "@type": "CreativeWork",
42 "name": "{{ pt }}",
43 "url": "{{ host_url }}/p/{{ project_slug }}"
44 }{% endif %}
45 }
46 </script>
47 {% call sheet::sheet("media-player.css") %}{% endcall %}
48 {% endblock %}
49
50 {% block content %}
51 {% include "partials/site_header.html" %}
52
53 <article class="media-container">
54 <header class="author-header">
55 <div class="author-avatar">{{ creator_avatar_initials }}</div>
56 <div class="author-info">
57 <div class="author-name"><a href="/u/{{ creator_username }}">{% if let Some(name) = creator_display_name %}{{ name }}{% else %}{{ creator_username }}{% endif %}</a></div>
58 <div class="media-meta">{{ item.release_date }}{% match item.content %}{% when crate::types::ItemContent::Video with { duration, .. } %}{% if let Some(dur) = duration %} | {{ dur }}{% endif %}{% when _ %}{% endmatch %}</div>
59 </div>
60 </header>
61
62 <h1 class="media-title">{{ item.title }}</h1>
63
64 {% if let Some(project_title) = project_title %}
65 <p class="media-series">
66 <a href="/p/{{ project_slug }}">{{ project_title }}</a>
67 </p>
68 {% endif %}
69
70 <div class="video-display">
71 {% match item.content %}
72 {% when crate::types::ItemContent::Video with { cover_url, .. } %}
73 {% if let Some(url) = cover_url %}
74 <img src="{{ url }}" alt="{{ item.title }} cover" class="video-cover-img">
75 {% else %}
76 <div class="video-cover-placeholder">[Video cover]</div>
77 {% endif %}
78 {% when _ %}
79 {% endmatch %}
80 </div>
81
82 {% if !item.description.is_empty() %}
83 <div class="media-description">
84 <p>{{ item.description }}</p>
85 </div>
86 {% endif %}
87
88 <div class="store-cta video-store-cta">
89 {% if has_access %}
90 <p class="video-cta-lead">You have access to this item.</p>
91 <a href="/l/{{ item.id }}" class="btn-primary">Watch in library &rarr;</a>
92 {% else if item.is_free %}
93 {% if let Some(_user) = session_user %}
94 {% if in_library %}
95 <span class="library-status video-library-status">In your library &middot; <a href="/l/{{ item.id }}">Watch now &rarr;</a></span>
96 {% else %}
97 <button class="add-to-library-btn btn-primary"
98 hx-post="/api/library/add/{{ item.id }}"
99 hx-swap="outerHTML">Add to Library - Free</button>
100 {% endif %}
101 {% else %}
102 <a href="/login?redirect=/l/{{ item.id }}" class="btn-primary">Log in to watch - Free</a>
103 {% endif %}
104 {% else %}
105 <p class="video-cta-price">{{ item.price }}</p>
106 {% if let Some(_user) = session_user %}
107 <a href="/purchase/{{ item.id }}" class="btn-primary">{% if item.pwyw_enabled %}Pay What You Want{% else %}Buy Once{% endif %} - {{ item.price }}</a>
108 {% else %}
109 <a href="/login?redirect=/i/{{ item.id }}" class="btn-primary">Log in to purchase</a>
110 {% endif %}
111 <p class="video-cta-fineprint">Support {{ creator_username }} directly, 0% platform fee.</p>
112 {% endif %}
113 </div>
114
115 {% if !item.tags.is_empty() %}
116 <div class="media-tags">
117 {% for tag in item.tags %}
118 <a href="/discover?tag={{ tag.slug }}" class="tag unstyled-link">{{ tag.name }}</a>
119 {% endfor %}
120 </div>
121 {% endif %}
122
123 </article>
124
125 {% include "partials/discussion_section.html" %}
126
127 <footer class="media-player-footer">
128 <a href="/i/{{ item.id }}" data-copy-link>Copy link</a> &middot;
129 <a href="/">Makenot<span class="dot">.</span>work</a> | Fair distribution for creatives of all kinds
130 </footer>
131 {% endblock %}
132
133 {% block scripts %}{% endblock %}
134