phantasmobile/app/templates/item.html

85 lines
3.1 KiB
HTML
Raw Permalink Normal View History

2023-07-15 07:30:36 +00:00
{% extends "base.html" %}
2023-07-16 05:56:14 +00:00
{% load static sass_tags compress %}
2023-07-15 07:30:36 +00:00
{% block head %}
2023-08-17 10:27:49 +00:00
<title>{{ item.title }} - {{ settings.SITENAME }}</title>
<meta name="title" content="{{ item.title }}"/>
<meta property="og:title" content="{{ item.title }}"/>
{% if item.data.thumbnail %}
<meta content="{{ item.data.thumbnail }}" name="thumbnail"/>
<meta content="{{ item.data.thumbnail }}" name="image_src"/>
<meta property="og:image" content="{{ item.data.thumbnail }}"/>
{% endif %}
{% if url %}
<meta property="og:url" content="{{ url }}"/>
{% endif %}
<meta property="og:site_name" content="{{ settings.SITENAME }}"/>
2023-07-15 07:30:36 +00:00
{% endblock %}
{% block main %}
<div class="content">
</div>
2023-07-24 21:00:43 +00:00
<form class="add-comment" style="display: none">
<div class="comment-fields">
2023-07-16 05:56:14 +00:00
{% csrf_token %}
2023-07-24 21:00:43 +00:00
<textarea name="text" placeholder="your comment" required></textarea>
2023-07-24 11:05:45 +00:00
<div class="user">
{% if request.user.is_anonymous %}
2023-07-24 21:00:43 +00:00
<div class="user-info">
<input name="name" type="text" placeholder="your name" required></input>
<input name="email" type="email" placeholder="your email" required></input>
</div>
</div>
<div class="buttons guest active">
2023-07-16 05:56:14 +00:00
<button id="add-comment">Add comment as guest</button>
2023-07-24 21:00:43 +00:00
<button id="login">Login</button>
2023-07-16 05:56:14 +00:00
</div>
<div class="buttons login">
2023-07-24 21:00:43 +00:00
<input name="username" type="text" placeholder="your username" required></input>
<input name="password" type="password" placeholder="your password" required></input>
<input name="email" type="email" placeholder="your email" style="display: none"></input>
<button id="login">Login</button>
<button id="register">Register</button>
<div class="error"></div>
2023-07-16 05:56:14 +00:00
</div>
2023-07-24 11:05:45 +00:00
{% else %}
2023-07-24 21:00:43 +00:00
<div class="buttons active">
2023-07-24 11:05:45 +00:00
<button id="add-comment">Add comment</button>
</div>
{% endif %}
</div>
2023-07-24 21:00:43 +00:00
</form>
2023-07-15 07:30:36 +00:00
{% endblock %}
{% block end %}
<script>
2023-07-24 11:05:45 +00:00
var user = {{ user }};
2023-08-22 15:35:56 +00:00
var item = {
id: {{ item.id }},
title: '{{ item.title|escapejs }}',
next: '{{ next }}',
previous: '{{ previous }}',
2023-08-22 15:35:56 +00:00
};
var comments = JSON.parse("{{ comments|escapejs }}");
2023-07-15 07:30:36 +00:00
</script>
2023-07-16 05:56:14 +00:00
{% compress js file m %}
2023-07-15 07:30:36 +00:00
<script src="/static/js/utils.js"></script>
<script src="/static/js/api.js"></script>
<script src="/static/js/icons.js"></script>
<script src="/static/js/VideoElement.js"></script>
<script src="/static/js/VideoPlayer.js"></script>
<script src="/static/js/documents.js"></script>
<script src="/static/js/edits.js"></script>
<script src="/static/js/item.js"></script>
<script src="/static/js/render.js"></script>
2023-07-16 05:56:14 +00:00
{% endcompress %}
2023-07-15 07:30:36 +00:00
<script>
pandora.url = new URL('{{ item.url|escapejs }}');
pandora.comment = '{{ item.id | escapejs }}';
pandora.hostname = pandora.url.hostname
2023-07-25 19:03:54 +00:00
pandoraURL = `${pandora.url.protocol}//${pandora.hostname}`
2023-07-15 07:30:36 +00:00
</script>
<script src="/static/js/overwrite.js"></script>
<script src="/static/js/main.js"></script>
<script src="/static/js/comments.js"></script>
{% endblock %}