forked from gergely/calendar-social
Create a macro for profile links and use it on the welcome and profile display pages
This commit is contained in:
parent
3e5d8ee4d5
commit
5996ae7079
@ -18,3 +18,13 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro profile_link(profile) %}
|
||||
<a href="{% if profile %}{{ url_for('display_profile', username=profile.user.username) }}{% else %}#{% endif %}" class="ui profile">
|
||||
{% if profile and profile.builtin_avatar %}
|
||||
<img src="{{ url_for('static', filename='avatars/' + profile.builtin_avatar + '.svg') }}" alt="" class="ui circular avatar image">
|
||||
{% endif %}
|
||||
<div class="display name">{{ profile.display_name }}</div>
|
||||
<div class="handle">{{ profile }}</div>
|
||||
</a>
|
||||
{% endmacro %}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{% extends 'base.html' %}
|
||||
{% from '_macros.html' import profile_link %}
|
||||
|
||||
{% block content %}
|
||||
<h2 class="ui header">
|
||||
@ -21,7 +22,7 @@
|
||||
</h2>
|
||||
|
||||
{% for followed in profile.followed_list %}
|
||||
{{ followed }}
|
||||
{{ profile_link(followed) }}
|
||||
{% endfor %}
|
||||
|
||||
<h2>
|
||||
@ -29,6 +30,6 @@
|
||||
</h2>
|
||||
|
||||
{% for follower in profile.follower_list %}
|
||||
{{ follower }}
|
||||
{{ profile_link(follower) }}
|
||||
{% endfor %}
|
||||
{% endblock content %}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{% extends 'base.html' %}
|
||||
{% from '_macros.html' import profile_link %}
|
||||
|
||||
{% block content %}
|
||||
<div class="ui grid">
|
||||
@ -73,11 +74,7 @@
|
||||
|
||||
<div class="four wide column">
|
||||
<h2>{% trans %}Administered by{% endtrans %}</h2>
|
||||
<a href="#" class="ui profile">
|
||||
<div class="avatar"></div>
|
||||
<div class="display name">Your Admin here</div>
|
||||
<div class="handle">@admin@he.re</div>
|
||||
</a>
|
||||
{{ profile_link(none) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user