microblog.pub/app/templates/object.html

57 lines
2.1 KiB
HTML
Raw Normal View History

2022-06-22 18:11:22 +00:00
{%- import "utils.html" as utils with context -%}
{% extends "layout.html" %}
2022-06-26 19:54:07 +00:00
{% block head %}
2022-07-01 17:35:34 +00:00
{% if outbox_object %}
{% if outbox_object.content %}
{% set excerpt = outbox_object.content | html2text | trim | truncate(50) %}
{% else %}
{% set excerpt = outbox_object.summary | html2text | trim | truncate(50) %}
{% endif %}
2022-07-25 20:51:53 +00:00
<title>{% if outbox_object.name %}{{ outbox_object.name }}{% else %}{{ local_actor.display_name }}: "{{ excerpt }}"{% endif %}</title>
2022-07-10 17:19:55 +00:00
<link rel="webmention" href="{{ url_for("webmention_endpoint") }}">
2022-06-26 19:54:07 +00:00
<link rel="alternate" href="{{ request.url }}" type="application/activity+json">
2022-07-15 18:01:55 +00:00
<meta name="description" content="{{ excerpt }}">
2022-06-26 19:54:07 +00:00
<meta content="article" property="og:type" />
<meta content="{{ outbox_object.url }}" property="og:url" />
<meta content="{{ local_actor.display_name }}'s microblog" property="og:site_name" />
2022-07-25 20:51:53 +00:00
<meta content="{% if outbox_object.name %}{{ name }}{% else %}Note{% endif %}" property="og:title" />
2022-07-15 18:01:55 +00:00
<meta content="{{ excerpt }}" property="og:description" />
2022-06-26 19:54:07 +00:00
<meta content="{{ local_actor.icon_url }}" property="og:image" />
<meta content="summary" property="twitter:card" />
2022-07-01 17:35:34 +00:00
{% endif %}
2022-06-26 19:54:07 +00:00
{% endblock %}
2022-06-22 18:11:22 +00:00
{% block content %}
2022-08-02 18:40:43 +00:00
{% if outbox_object %}
2022-06-22 18:11:22 +00:00
{% include "header.html" %}
2022-08-02 18:40:43 +00:00
{% endif %}
2022-06-22 18:11:22 +00:00
2022-06-24 21:09:37 +00:00
{% macro display_replies_tree(replies_tree_node) %}
2022-06-25 08:20:07 +00:00
{% if replies_tree_node.is_requested %}
2022-11-20 10:12:34 +00:00
{{ utils.display_object(replies_tree_node.ap_object, likes=likes, shares=shares, webmentions=webmentions, expanded=not replies_tree_node.is_root, is_object_page=True, is_h_entry=False) }}
2022-06-25 08:20:07 +00:00
{% else %}
{% if replies_tree_node.wm_reply %}
2022-11-20 10:12:34 +00:00
{# u-comment h-cite is displayed by default for webmention #}
{{ utils.display_webmention_reply(replies_tree_node.wm_reply) }}
{% else %}
2022-11-20 10:12:34 +00:00
<div class="u-comment h-cite">
{{ utils.display_object(replies_tree_node.ap_object, is_h_entry=False) }}
</div>
{% endif %}
2022-06-25 08:20:07 +00:00
{% endif %}
2022-06-24 21:09:37 +00:00
{% for child in replies_tree_node.children %}
{{ display_replies_tree(child) }}
{% endfor %}
{% endmacro %}
2022-11-20 10:12:34 +00:00
<div class="h-entry">
2022-06-24 21:09:37 +00:00
{{ display_replies_tree(replies_tree) }}
2022-11-20 10:12:34 +00:00
</div>
2022-06-22 18:11:22 +00:00
{% endblock %}