microblog/app/templates/header.html

73 lines
2.4 KiB
HTML
Raw Permalink Normal View History

2023-01-11 23:28:38 +00:00
<header id="header">
<div class="h-card p-author">
<data class="u-photo" value="{{ local_actor.icon_url }}"></data>
<a href="{{ local_actor.url }}" class="u-url u-uid no-hover title">
<span class="name">{{ local_actor.name }}</span>
<span class="p-name handle">{{ local_actor.handle }}</span>
</a>
<div class="p-note summary">
{{ local_actor.summary | safe }}
{% if TAGS %}
2023-01-11 23:30:30 +00:00
<nav class="flexbox">
2023-01-11 23:28:38 +00:00
<ul>
{% for tag in TAGS %}
<li><a href="{{BASE_URL}}/t/{{tag}}" {% if request.url.path == "/t/{{tag}}" %}class="active"{% endif %}>#{{tag}}</a></li>
{% endfor %}
</ul>
2023-01-11 23:30:30 +00:00
</nav>
2023-01-11 23:28:38 +00:00
{% endif %}
</div>
<div id="profile-props">
{% for prop in local_actor.attachments %}
<dl>
{% if prop.type == "PropertyValue" %}
<dt class="muted" title="{{ prop.name }}">{{ prop.name }}</dt>
<dd>{{ prop.value | clean_html(local_actor) | safe }}</dd>
{% endif %}
</dl>
{% endfor %}
</div>
</div>
{%- macro header_link(url, text) -%}
{% set url_for = BASE_URL + request.app.router.url_path_for(url) %}
<a href="{{ url_for }}" {% if BASE_URL + request.url.path == url_for %}class="active"{% endif %}>{{ text }}</a>
{% endmacro %}
{%- macro navbar_item_link(navbar_item) -%}
{% set url_for = BASE_URL + navbar_item[0] %}
<a href="{{ navbar_item[0] }}" {% if BASE_URL + request.url.path == url_for %}class="active"{% endif %}>{{ navbar_item[1] }}</a>
{% endmacro %}
<div class="public-top-menu">
<nav class="flexbox">
<ul>
{% if NAVBAR_ITEMS.INDEX_NAVBAR_ITEM %}
<li>{{ navbar_item_link(NAVBAR_ITEMS.INDEX_NAVBAR_ITEM) }}</li>
{% endif %}
<li>{{ header_link("index", "Notes") }}</li>
{% if articles_count %}
<li>{{ header_link("articles", "Articles") }}</li>
{% endif %}
{% if not HIDES_FOLLOWERS %}
<li>{{ header_link("followers", "Followers") }} <span class="counter">{{ followers_count }}</span></li>
{% endif %}
{% if not HIDES_FOLLOWING %}
<li>{{ header_link("following", "Following") }} <span class="counter">{{ following_count }}</span></li>
{% endif %}
2023-01-12 18:03:38 +00:00
<li>{{ header_link("serve_contact", "Contact") }}</li>
2023-01-11 23:28:38 +00:00
<li>{{ header_link("get_remote_follow", "Remote follow") }}</li>
{% for navbar_item in NAVBAR_ITEMS.EXTRA_NAVBAR_ITEMS %}
{{ navbar_item_link(navbar_item) }}
{% endfor %}
</ul>
</nav>
</div>
</header>