comments
This commit is contained in:
parent
100fe79b1d
commit
4b157ed1d1
15 changed files with 305 additions and 133 deletions
|
|
@ -1,25 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
{% for item in items %}
|
||||
<div class="item">
|
||||
<a href="{{ item.url }}">
|
||||
<h1>{{ item.title }}</h1>
|
||||
<figure>
|
||||
<img src={{ item.icon }}>
|
||||
<figcaption>
|
||||
{{ item.data.title }}
|
||||
{% if item.data.description %}
|
||||
<br>
|
||||
{{ item.data.description }}
|
||||
{% endif %}
|
||||
</figcaption>
|
||||
</figure>
|
||||
</a>
|
||||
<div class="description">
|
||||
{{ item.description | safe}}
|
||||
</div>
|
||||
<a href="{{ item.get_absolute_url }}">{{ item.public_comments.count }} comments</a>
|
||||
</div>
|
||||
{% include "listitem.html" with item=item %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<!DOCTYPE html>{% load static sass_tags compress %}
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
{% compress css file site %}
|
||||
<link rel="stylesheet" href="/static/css/reset.css"></link>
|
||||
<link rel="stylesheet" href="{% sass_src 'css/site.scss' %}"></link>
|
||||
<link rel="stylesheet" href="/static/css/style.css"></link>
|
||||
<link rel="stylesheet" href="{% sass_src 'css/comments.scss' %}"></link>
|
||||
{% endcompress %}
|
||||
{% block head %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block header %}
|
||||
<header>
|
||||
<a href="/">phantas.ma</a>
|
||||
</header>
|
||||
{% endblock %}
|
||||
{% block main %}
|
||||
<div class="content">
|
||||
|
|
@ -11,5 +26,7 @@
|
|||
{% endblock %}
|
||||
{% block end %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block footer %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,44 +1,15 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<style>
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
h1 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
figure {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.content {
|
||||
max-width: 1000px;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
<div class="index">
|
||||
{% for item in items %}
|
||||
<div class="item">
|
||||
<a href="{{ item.get_absolute_url }}">
|
||||
<h1>{{ item.title }}</h1>
|
||||
<figure>
|
||||
<img src={{ item.icon }}>
|
||||
<figcaption>
|
||||
{{ item.data.title }}
|
||||
{% if item.data.description %}
|
||||
<br>
|
||||
{{ item.data.description }}
|
||||
{% endif %}
|
||||
</figcaption>
|
||||
</figure>
|
||||
</a>
|
||||
<div class="description">
|
||||
{{ item.description | safe }}
|
||||
</div>
|
||||
<a href="{{ item.get_absolute_url }}">{{ item.public_comments.count }} comments</a>
|
||||
</div>
|
||||
{% include "listitem.html" with item=item %}
|
||||
{% endfor %}
|
||||
{% if archive %}
|
||||
<div class="archive">
|
||||
<a href="/archive/">older items</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,36 @@
|
|||
{% extends "base.html" %}
|
||||
{% load static sass_tags compress %}
|
||||
{% block head %}
|
||||
<link rel="stylesheet" href="/static/css/reset.css"></link>
|
||||
<link rel="stylesheet" href="/static/css/style.css"></link>
|
||||
<link rel="stylesheet" href="/static/css/comments.css"></link>
|
||||
{% endblock %}
|
||||
{% block main %}
|
||||
<div class="content">
|
||||
</div>
|
||||
<div class="add-comment" style="display: none">
|
||||
{% if request.user.is_anonymous %}
|
||||
{% csrf_token %}
|
||||
<textarea name="text" placeholder="your comment"></textarea>
|
||||
{% if false and request.user.is_anonymous %}
|
||||
|
||||
<input name="name" type="text" placeholder="your name"></input>
|
||||
<input name="email" type="email" placeholder="your email"></input>
|
||||
<br>
|
||||
{% endif %}
|
||||
{% csrf_token %}
|
||||
<textarea name="text" placeholder="your comment"></textarea>
|
||||
<button id="add-comment">Add comment</button>
|
||||
<div class="buttons">
|
||||
<button id="add-comment">Add comment as guest</button>
|
||||
<button>Login</button>
|
||||
</div>
|
||||
<div class="buttons login">
|
||||
<input name="username" type="text" placeholder="your username"></input>
|
||||
<input name="password" type="password" placeholder="your password"></input>
|
||||
<button>Login</button>
|
||||
<button>Register</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block end %}
|
||||
<script>
|
||||
var comments = {{ item.public_comments_json|safe }};
|
||||
</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>
|
||||
|
|
@ -31,6 +40,7 @@
|
|||
<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 }}');
|
||||
|
|
|
|||
15
app/templates/listitem.html
Normal file
15
app/templates/listitem.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<div class="item">
|
||||
<a href="{{ item.get_absolute_url }}">
|
||||
<h1>{{ item.title }}</h1>
|
||||
<div class="info">
|
||||
{{ item.data.title }}
|
||||
</div>
|
||||
<div class="image">
|
||||
<img src={{ item.data.thumbnail }}>
|
||||
</div>
|
||||
</a>
|
||||
<div class="comments">
|
||||
<a href="{{ item.get_absolute_url }}">{{ item.public_comments.count }} comments</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue