Improve template markup

This commit is contained in:
Thomas Sileo 2019-09-08 10:56:46 +02:00
parent 51ed481bb5
commit ab01fed24a
4 changed files with 17 additions and 17 deletions

View file

@ -89,7 +89,7 @@ a:hover {
} }
} }
} }
header { header#header {
margin-bottom: 70px; margin-bottom: 70px;
.title { .title {

View file

@ -1,5 +1,5 @@
{% if not request.path.startswith('/admin') %} {% if not request.path.startswith('/admin') %}
<header> <header id="header">
<div class="h-card p-author"> <div class="h-card p-author">
<data class="u-photo" value="{{ config.ME.icon.url }}"></data> <data class="u-photo" value="{{ config.ME.icon.url }}"></data>

View file

@ -27,7 +27,7 @@
</head> </head>
<body> <body>
{% if logged_in %} {% if logged_in %}
<div id="admin-menu-wrapper"> <nav id="admin-menu-wrapper">
<ul id="admin-menu"> <ul id="admin-menu">
<li class="left"><a href="/admin" class="admin-title{% if request.path.startswith("/admin") %} selected{% endif %}">Admin</a></li> <li class="left"><a href="/admin" class="admin-title{% if request.path.startswith("/admin") %} selected{% endif %}">Admin</a></li>
<li class="left"><a href="/" class="admin-title {% if not request.path.startswith("/admin") %} selected{% endif %}">Public</a></li> <li class="left"><a href="/" class="admin-title {% if not request.path.startswith("/admin") %} selected{% endif %}">Public</a></li>
@ -42,17 +42,17 @@
<li class="left"><a href="/admin/lookup"{% if request.path == "/admin/lookup" %} class="selected" {% endif %}>Lookup</a></li> <li class="left"><a href="/admin/lookup"{% if request.path == "/admin/lookup" %} class="selected" {% endif %}>Lookup</a></li>
<li class="left"><a href="/admin/logout">Logout</a></li> <li class="left"><a href="/admin/logout">Logout</a></li>
</ul> </ul>
</div> </nav>
{% endif %} {% endif %}
<div class="base-container"> <main class="base-container">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </main>
<div class="footer"> <footer class="footer">
<div> <div>
Powered by <a href="https://microblog.pub">microblog.pub</a> <small class="microblogpub-version"><code>{{ microblogpub_version }}</code></small> (<a href="https://github.com/tsileo/microblog.pub">source code</a>) and the <a href="https://activitypub.rocks/">ActivityPub</a> protocol Powered by <a href="https://microblog.pub">microblog.pub</a> <small class="microblogpub-version"><code>{{ microblogpub_version }}</code></small> (<a href="https://github.com/tsileo/microblog.pub">source code</a>) and the <a href="https://activitypub.rocks/">ActivityPub</a> protocol
</div> </div>
</div> </footer>
</body> </body>
</html> </html>

View file

@ -53,17 +53,17 @@
{% set real_end_time = obj.closed or obj.endTime %} {% set real_end_time = obj.closed or obj.endTime %}
<div class="note-box"> <article class="note-box">
<div class="note h-entry" id="activity-{{ obj.id | permalink_id }}"> <div class="note h-entry" id="activity-{{ obj.id | permalink_id }}">
<div class="h-card p-author"> <div class="h-card p-author">
<a class="u-url u-uid no-hover" href="{{ actor | url_or_id | get_url }}"><img class="u-photo" src="{% if not actor.icon %}/static/nopic.png{% else %}{{ actor.icon.url | get_actor_icon_url(50) }}{% endif %}"> <a class="u-url u-uid no-hover" rel="author" href="{{ actor | url_or_id | get_url }}"><img class="u-photo" src="{% if not actor.icon %}/static/nopic.png{% else %}{{ actor.icon.url | get_actor_icon_url(50) }}{% endif %}">
</a> </a>
<data class="p-name" value="{{ actor.name or actor.preferredUsername }}"></data> <data class="p-name" value="{{ actor.name or actor.preferredUsername }}"></data>
</div> </div>
<div class="note-wrapper"> <div class="note-wrapper">
<div style="clear:both;height:20px;"> <aside style="clear:both;height:20px;">
<a href="{{ actor | url_or_id | get_url }}" style="margin:0;text-decoration:none;margin: 0;text-decoration: none;display: block;width: 75%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float: left;" class="no-hover"> <a href="{{ actor | url_or_id | get_url }}" style="margin:0;text-decoration:none;margin: 0;text-decoration: none;display: block;width: 75%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float: left;" class="no-hover">
<strong>{{ (actor.name or actor.preferredUsername) | clean | replace_custom_emojis(actor) | safe }}</strong> <strong>{{ (actor.name or actor.preferredUsername) | clean | replace_custom_emojis(actor) | safe }}</strong>
<span class="l">@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}</span>{% else %}{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}{% endif %}@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor | url_or_id | get_url | domain }}</span>{% else %}{{ actor | url_or_id | get_url | domain }}{% endif %}</span></a> <span class="l">@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}</span>{% else %}{{ actor.preferredUsername | clean | replace_custom_emojis(actor) | safe }}{% endif %}@{% if not no_color and obj.id | is_from_outbox %}<span class="pcolor">{{ actor | url_or_id | get_url | domain }}</span>{% else %}{{ actor | url_or_id | get_url | domain }}{% endif %}</span></a>
@ -74,7 +74,7 @@
<time class="dt-published" title="{{ obj.published }}" datetime="{{ obj.published }}" {% if obj | url_or_id | get_url | is_from_outbox %}{%else%}rel="external noreferrer"{%endif%}>{{ obj.published | format_timeago }}</time></a> <time class="dt-published" title="{{ obj.published }}" datetime="{{ obj.published }}" {% if obj | url_or_id | get_url | is_from_outbox %}{%else%}rel="external noreferrer"{%endif%}>{{ obj.published | format_timeago }}</time></a>
</span> </span>
{% endif %} {% endif %}
</div> </aside>
{% if meta.in_reply_to_actor %} {% if meta.in_reply_to_actor %}
<div style="margin:10px 0 15px 0;padding:0;"> <div style="margin:10px 0 15px 0;padding:0;">
@ -244,7 +244,7 @@ self reply
<div class="bottom-bar"> <aside class="bottom-bar">
{% if perma %} {% if perma %}
<time class="perma-item dt-published" style="float:left;padding:5px;" title="{{ obj.published }}" datetime="{{ obj.published }}" {% if obj | url_or_id | get_url | is_from_outbox %}{%else%}rel="external noreferrer"{%endif%}>{{ obj.published | format_timeago }}</time></a> <time class="perma-item dt-published" style="float:left;padding:5px;" title="{{ obj.published }}" datetime="{{ obj.published }}" {% if obj | url_or_id | get_url | is_from_outbox %}{%else%}rel="external noreferrer"{%endif%}>{{ obj.published | format_timeago }}</time></a>
@ -362,10 +362,10 @@ self reply
{% endif %} {% endif %}
<a class="bar-item bar-item-no-border">{{ meta.object_visibility | visibility }}</a> <a class="bar-item bar-item-no-border">{{ meta.object_visibility | visibility }}</a>
</div> </aside>
{% if likes or shares %} {% if likes or shares %}
<div style="padding-top:20px;" class="pure-g"> <aside style="padding-top:20px;" class="pure-g">
{% if likes %} {% if likes %}
<div class="pure-u-1-2"> <div class="pure-u-1-2">
<h4 style="font-weight:normal"><strong>{{ likes|length }}</strong> likes</h4>{% for like in likes %} <h4 style="font-weight:normal"><strong>{{ likes|length }}</strong> likes</h4>{% for like in likes %}
@ -380,13 +380,13 @@ self reply
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
</div> </aside>
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div> </article>
{%- endmacro %} {%- endmacro %}