Skip to main content

max / makenotwork

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