84 lines
3.1 KiB
HTML
84 lines
3.1 KiB
HTML
{% extends "base.html" %}
|
|
{% load static sass_tags compress %}
|
|
{% block head %}
|
|
<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 }}"/>
|
|
{% endblock %}
|
|
{% block main %}
|
|
<div class="content">
|
|
</div>
|
|
<form class="add-comment" style="display: none">
|
|
<div class="comment-fields">
|
|
{% csrf_token %}
|
|
<textarea name="text" placeholder="your comment" required></textarea>
|
|
<div class="user">
|
|
{% if request.user.is_anonymous %}
|
|
<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">
|
|
<button id="add-comment">Add comment as guest</button>
|
|
<button id="login">Login</button>
|
|
</div>
|
|
<div class="buttons login">
|
|
<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>
|
|
</div>
|
|
{% else %}
|
|
<div class="buttons active">
|
|
<button id="add-comment">Add comment</button>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</form>
|
|
{% endblock %}
|
|
{% block end %}
|
|
<script>
|
|
var user = {{ user }};
|
|
var item = {
|
|
id: {{ item.id }},
|
|
title: '{{ item.title|escapejs }}',
|
|
next: '{{ next }}',
|
|
previous: '{{ previous }}',
|
|
};
|
|
var comments = JSON.parse("{{ comments|escapejs }}");
|
|
</script>
|
|
{% compress js file m %}
|
|
<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>
|
|
{% endcompress %}
|
|
|
|
<script>
|
|
pandora.url = new URL('{{ item.url|escapejs }}');
|
|
pandora.comment = '{{ item.id | escapejs }}';
|
|
pandora.hostname = pandora.url.hostname
|
|
pandoraURL = `${pandora.url.protocol}//${pandora.hostname}`
|
|
</script>
|
|
<script src="/static/js/overwrite.js"></script>
|
|
|
|
<script src="/static/js/main.js"></script>
|
|
<script src="/static/js/comments.js"></script>
|
|
{% endblock %}
|