Improve Trombi again with pictures, notifs, and style!

This commit is contained in:
Skia
2017-05-10 23:03:49 +02:00
parent f2b2ff533d
commit 35f983131f
9 changed files with 122 additions and 15 deletions

View File

@ -0,0 +1,31 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Comment{% endtrans %}
{% endblock %}
{% block content %}
<h2>{% trans %}Comment{% endtrans %}</h2>
<div style="width: 400px; margin: auto; border: solid 1px grey; text-align: center">
{% set file = None %}
{% if target.profile_pict %}
{% set file = target.profile_pict.url %}
{% else %}
{% set file = static('core/img/na.gif') %}
{% endif %}
<div style="max-width: 300px; margin: auto;">
<img src="{{ file }}" alt="" style="max-width: 300px">
</div>
<div>
{{ target.user.get_display_name() }}
</div>
</div>
<form action="" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
</form>
{% endblock %}

View File

@ -10,10 +10,22 @@
<p>Subscription deadline: {{ object.subscription_deadline|date(DATETIME_FORMAT) }}</p>
<p>Comment deadline: {{ object.comments_deadline|date(DATETIME_FORMAT) }}</p>
<a href="#">Export</a>
<p>People:</p>
<ul>
{% for u in object.users.all() %}
<li>{{ u.user.get_display_name() }} - <a href="{{ url('trombi:delete_user', trombi_id=object.id, user_id=u.id) }}">Delete</a></li>
{% endfor %}
</ul>
<hr>
<div>
{% for u in object.users.all() %}
<div class="ib" style="border: solid 1px grey; text-align: center">
{% set file = None %}
{% if u.profile_pict %}
{% set file = u.profile_pict.url %}
{% else %}
{% set file = static('core/img/na.gif') %}
{% endif %}
<div style="max-width: 100px; margin: auto;">
<img src="{{ file }}" alt="" style="max-width: 100px">
</div>
<div>{{ u.user.get_display_name() }}</div>
<div><a href="{{ url('trombi:delete_user', trombi_id=object.id, user_id=u.id) }}">Delete</a></div>
</div>
{% endfor %}
</div>
{% endblock %}

View File

@ -15,10 +15,20 @@
{% else %}
<p>{% trans trombi = user.trombi_user.trombi %}You are subscribed to the Trombi {{ trombi }}{% endtrans %}</p>
<p><a href="{{ url("trombi:profile") }}">Edit my profile</a></p>
<p><a href="{{ url("trombi:pictures") }}">Edit my pictures</a></p>
<hr>
<div>
{% for u in user.trombi_user.trombi.users.exclude(id=user.trombi_user.id) %}
<div class="ib">
<div class="ib" style="border: solid 1px grey; text-align: center">
{% set file = None %}
{% if u.profile_pict %}
{% set file = u.profile_pict.url %}
{% else %}
{% set file = static('core/img/na.gif') %}
{% endif %}
<div style="max-width: 100px; margin: auto;">
<img src="{{ file }}" alt="" style="max-width: 100px">
</div>
<div>{{ u.user.get_display_name() }}</div>
{% set comment = u.received_comments.filter(author__id=user.trombi_user.id).first() %}
{% if comment %}