diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/activities/_boost.html | 28 | ||||
| -rw-r--r-- | templates/activities/_event.html | 20 | ||||
| -rw-r--r-- | templates/activities/_home_menu.html | 4 | ||||
| -rw-r--r-- | templates/activities/_post.html | 4 | ||||
| -rw-r--r-- | templates/activities/federated.html | 2 | ||||
| -rw-r--r-- | templates/activities/home.html | 15 | ||||
| -rw-r--r-- | templates/activities/local.html | 21 | ||||
| -rw-r--r-- | templates/activities/notifications.html | 22 | 
8 files changed, 108 insertions, 8 deletions
| diff --git a/templates/activities/_boost.html b/templates/activities/_boost.html new file mode 100644 index 0000000..601466e --- /dev/null +++ b/templates/activities/_boost.html @@ -0,0 +1,28 @@ +{% load static %} +{% load activity_tags %} +<div class="post"> + +    {% if post.author.icon_uri %} +        <img src="{{post.author.icon_uri}}" class="icon"> +    {% else %} +        <img src="{% static "img/unknown-icon-128.png" %}" class="icon"> +    {% endif %} + +    <time> +        <a href="{{ post.url }}"> +            {% if post.published %} +                {{ post.published | timedeltashort }} +            {% else %} +                {{ post.created | timedeltashort }} +            {% endif %} +        </a> +    </time> + +    <a href="{{ post.author.urls.view }}" class="handle"> +        {{ post.author.name_or_handle }} <small>@{{ post.author.handle }}</small> +    </a> + +    <div class="content"> +        {{ post.safe_content }} +    </div> +</div> diff --git a/templates/activities/_event.html b/templates/activities/_event.html new file mode 100644 index 0000000..bbe0ae5 --- /dev/null +++ b/templates/activities/_event.html @@ -0,0 +1,20 @@ +{% load static %} +{% load activity_tags %} +<div class="post"> + +    <time> +        {% if event.published %} +            {{ event.published | timedeltashort }} +        {% else %} +            {{ event.created | timedeltashort }} +        {% endif %} +    </time> + +    {% if event.type == "follow" %} +        {{ event.subject_identity.name_or_handle }} followed you +    {% elif event.type == "like" %} +        {{ event.subject_identity.name_or_handle }} liked {{ event.subject_post }} +    {% else %} +        Unknown event type {{event.type}} +    {% endif %} +</div> diff --git a/templates/activities/_home_menu.html b/templates/activities/_home_menu.html index 29d19e9..c88a1d7 100644 --- a/templates/activities/_home_menu.html +++ b/templates/activities/_home_menu.html @@ -1,6 +1,6 @@  <nav>      <a href="/" {% if current_page == "home" %}class="selected"{% endif %}>Home</a> -    <a href="/" {% if current_page == "mentions" %}class="selected"{% endif %}>Mentions</a> -    <a href="/" {% if current_page == "public" %}class="selected"{% endif %}>Public</a> +    <a href="/notifications/" {% if current_page == "notifications" %}class="selected"{% endif %}>Notifications</a> +    <a href="/local/" {% if current_page == "local" %}class="selected"{% endif %}>Local</a>      <a href="/federated/" {% if current_page == "federated" %}class="selected"{% endif %}>Federated</a>  </nav> diff --git a/templates/activities/_post.html b/templates/activities/_post.html index 38022a7..601466e 100644 --- a/templates/activities/_post.html +++ b/templates/activities/_post.html @@ -10,8 +10,8 @@      <time>          <a href="{{ post.url }}"> -            {% if post.authored %} -                {{ post.authored | timedeltashort }} +            {% if post.published %} +                {{ post.published | timedeltashort }}              {% else %}                  {{ post.created | timedeltashort }}              {% endif %} diff --git a/templates/activities/federated.html b/templates/activities/federated.html index 8d8297b..b6143c3 100644 --- a/templates/activities/federated.html +++ b/templates/activities/federated.html @@ -7,7 +7,7 @@      <section class="columns">          <div class="left-column"> -            {% for post in timeline_posts %} +            {% for post in posts %}                  {% include "activities/_post.html" %}              {% empty %}                  No posts yet. diff --git a/templates/activities/home.html b/templates/activities/home.html index c777ce8..2cdaaea 100644 --- a/templates/activities/home.html +++ b/templates/activities/home.html @@ -8,10 +8,19 @@      <section class="columns">          <div class="left-column"> -            {% for post in timeline_posts %} -                {% include "activities/_post.html" %} +            {% for event in events %} +                {% if event.type == "post" %} +                    {% include "activities/_post.html" with post=event.subject_post %} +                {% elif event.type == "boost" %} +                    <div class="boost-banner"> +                        <a href="{{ event.subject_identity.urls.view }}"> +                            {{ event.subject_identity.name_or_handle }} +                        </a> boosted +                    </div> +                    {% include "activities/_post.html" with post=event.subject_post %} +                {% endif %}              {% empty %} -                No posts yet. +                Nothing to show yet.              {% endfor %}          </div> diff --git a/templates/activities/local.html b/templates/activities/local.html new file mode 100644 index 0000000..520a0ce --- /dev/null +++ b/templates/activities/local.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} + +{% block title %}Local Timeline{% endblock %} + +{% block content %} +    {% include "activities/_home_menu.html" %} + +    <section class="columns"> +        <div class="left-column"> +            {% for post in posts %} +                {% include "activities/_post.html" %} +            {% empty %} +                No posts yet. +            {% endfor %} +        </div> +        <div class="right-column"> +            <h2>?</h2> +        </div> + +    </section> +{% endblock %} diff --git a/templates/activities/notifications.html b/templates/activities/notifications.html new file mode 100644 index 0000000..c071a49 --- /dev/null +++ b/templates/activities/notifications.html @@ -0,0 +1,22 @@ +{% extends "base.html" %} + +{% block title %}Notifications{% endblock %} + +{% block content %} +    {% include "activities/_home_menu.html" %} + +    <section class="columns"> +        <div class="left-column"> +            {% for event in events %} +                {% include "activities/_event.html" %} +            {% empty %} +                No events yet. +            {% endfor %} +        </div> + +        <div class="right-column"> +            <h2>?</h2> +        </div> + +    </section> +{% endblock %} | 
