Unpacking modules

This commit is contained in:
Yusur 2019-10-23 21:09:51 +02:00
parent 1e7787e24e
commit a9006bf1bc
36 changed files with 971 additions and 822 deletions

View file

@ -0,0 +1,35 @@
{% set profile = user.profile %}
<div class="infobox">
<h3>{{ profile.full_name }}</h3>
<p>{{ profile.biography|enrich }}</p>
{% if profile.location %}
<p><span class="weak">Location:</span> {{ profile.location|locationdata }}</p>
{% endif %}
{% if profile.year %}
<p><span class="weak">Year:</span> {{ profile.year }}</p>
{% endif %}
{% if profile.website %}
{% set website = profile.website %}
{% set website = website if website.startswith(('http://', 'https://')) else 'http://' + website %}
<p><span class="weak">Website:</span> {{ profile.website|urlize }}</p>
{% endif %}
{% if profile.instagram %}
<p><span class="weak">Instagram:</span> <a href="https://www.instagram.com/{{ profile.instagram }}">{{ profile.instagram }}</a></p>
{% endif %}
{% if profile.facebook %}
<p><span class="weak">Facebook:</span> <a href="https://facebook.com/{{ profile.facebook }}">{{ profile.facebook }}</a></p>
{% endif %}
{% if profile.telegram %}
<p><span class="weak">Telegram:</span> <a href="https://t.me/{{ profile.facebook }}">{{ profile.telegram }}</a></p>
{% endif %}
<p>
<strong>{{ user.messages|count }}</strong> messages
-
<a href="{{ url_for('website.user_followers', username=user.username) }}"><strong>{{ user.followers()|count }}</strong></a> followers
-
<a href="{{ url_for('website.user_following', username=user.username) }}"><strong>{{ user.following()|count }}</strong></a> following
</p>
{% if user == current_user %}
<p><a href="/edit_profile/">Edit profile</a></p>
{% endif %}
</div>

View file

@ -0,0 +1,6 @@
<select name="location">
<option value="0">Not Applicable</option>
{% for k, v in locations.items() %}
<option value="{{ k }}">{{ v }}</option>
{% endfor %}
</select>

View file

@ -0,0 +1,27 @@
<p class="message-content">{{ message.text|enrich }}</p>
{% if message.uploads %}
<div class="message-visual">
<img src="/uploads/{{ message.uploads[0].filename() }}">
</div>
{% endif %}
<p class="message-footer">
<a href="{{ url_for('website.user_detail', username=message.user.username) }}">{{ message.user.username }}</a>
-
{% set message_privacy = message.privacy %}
{% if message.privacy in (0, 1) %} Public
{% elif message.privacy == 2 %} Friends
{% elif message.privacy == 3 %} Only me
{% endif %}
-
<time datetime="{{ message.pub_date.isoformat() }}" title="{{ message.pub_date.ctime() }}">{{ message.pub_date | human_date }}</time>
-
<a href="javascript:void(0);" onclick="showHideMessageOptions({{ message.id }});" class="message-options-showhide"></a>
</p>
<ul class="message-options">
{% if message.user == current_user %}
<li><a href="/edit/{{ message.id }}">Edit or change privacy</a></li>
<!--li><a href="/confirm_delete/{{ message.id }}">Delete</a></li-->
{% else %}
<!--li><a href="/report/{{ message.id }}">Report</a></li-->
{% endif %}
</ul>

View file

@ -0,0 +1,13 @@
{% set detail = json.loads(notification.detail) %}
{% if notification.type == 'follow' %}
{% set user = User[detail['user']] %}
<p><a href="/+{{ user.username }}">{{ user.username }}</a> started following you.</p>
{% elif notification.type == 'mention' %}
{% set user = User[detail['user']] %}
<p><a href="/+{{ user.username }}">{{ user.username }}</a> mentioned you in a message.</p>
{% else %}
<p>Unknown Notification</p>
{% endif %}
<small>{{ notification.pub_date | human_date }}</small>

View file

@ -0,0 +1,6 @@
{% if page > 1 %}
<a class="prev" href="?page={{ page - 1 }}">Previous</a>
{% endif %}
{% if page < pages %}
<a class="next" href="?page={{ page + 1 }}">Next</a>
{% endif %}