Skip to main content

max / makenotwork

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