mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-20 08:31:07 +00:00
Notifications
This commit is contained in:
parent
0bea615b82
commit
767190e012
5 changed files with 67 additions and 40 deletions
|
@ -1,9 +1,8 @@
|
|||
/* --- ICONS --- */
|
||||
.icon {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
font-size: 1.1rem;
|
||||
vertical-align: sub;
|
||||
vertical-align: super;
|
||||
}
|
||||
.hidden-text {
|
||||
height: 0;
|
||||
|
@ -11,16 +10,16 @@
|
|||
position: absolute;
|
||||
overflow: hidden;
|
||||
}
|
||||
.icon .bubble {
|
||||
.icon ~ .bubble {
|
||||
background-color: #FF1654;
|
||||
color: white;
|
||||
font-size: 0.85rem;
|
||||
font-size: 0.7rem;
|
||||
border-radius: 50%;
|
||||
display: block;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: -0.65rem;
|
||||
right: -0.5rem;
|
||||
top: 0.8rem;
|
||||
right: 0.3rem;
|
||||
height: 1rem;
|
||||
width: 1rem;
|
||||
}
|
||||
|
@ -111,3 +110,23 @@ input.toggle-control:checked ~ .toggle-content {
|
|||
vertical-align: middle;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
|
||||
/* --- QUOTES --- */
|
||||
.quote blockquote {
|
||||
position: relative;
|
||||
padding-left: 2em;
|
||||
}
|
||||
.quote blockquote:before, .quote blockquote:after {
|
||||
font-family: 'icomoon';
|
||||
position: absolute;
|
||||
}
|
||||
.quote blockquote:before {
|
||||
content: "\e904";
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.quote blockquote:after {
|
||||
content: "\e903";
|
||||
right: 0;
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div>
|
||||
<nav class="pagination" role="navigation" aria-label="pagination">
|
||||
{% if prev %}
|
||||
<p>
|
||||
<p class="pagination-previous">
|
||||
<a href="{{ prev }}">
|
||||
<span class="icon icon-arrow-left"></span>
|
||||
Previous
|
||||
|
@ -20,13 +20,13 @@
|
|||
{% endif %}
|
||||
|
||||
{% if next %}
|
||||
<p class="next">
|
||||
<p class="pagination-next">
|
||||
<a href="{{ next }}">
|
||||
Next
|
||||
<span class="icon icon-arrow-right"></span>
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -82,7 +82,9 @@
|
|||
<span class="icon icon-bell">
|
||||
<span class="hidden-text">Notitications</span>
|
||||
</span>
|
||||
{% if request.user|notification_count %}<span class="count">{{ request.user | notification_count }}</span>{% endif %}
|
||||
{% if request.user|notification_count %}
|
||||
<span class="bubble">{{ request.user | notification_count }}</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,46 +1,52 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load humanize %}l
|
||||
{% block content %}
|
||||
<div class="content-container">
|
||||
<h2>Notifications</h2>
|
||||
<div class="block">
|
||||
<h2 class="title">Notifications</h2>
|
||||
|
||||
<form name="clear" action="/clear-notifications" method="POST">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="secondary">Delete notifications</button>
|
||||
<button class="button is-danger" type="submit" class="secondary">Delete notifications</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="content-container">
|
||||
<div class="block">
|
||||
{% for notification in notifications %}
|
||||
<div class="notification{% if notification.id in unread %} unread{% endif %}">
|
||||
<small class="time-ago">{{ notification.created_date | naturaltime }}</small>
|
||||
{% if notification.related_user %}
|
||||
{% include 'snippets/username.html' with user=notification.related_user %}
|
||||
{% if notification.notification_type == 'FAVORITE' %}
|
||||
favorited your
|
||||
<a href="{{ notification.related_status.remote_id}}">status</a>
|
||||
<div class="notification level{% if notification.id in unread %} is-primary{% endif %}">
|
||||
<div class="level-left">
|
||||
<p>
|
||||
{% if notification.related_user %}
|
||||
{% include 'snippets/avatar.html' with user=notification.related_user %}
|
||||
{% include 'snippets/username.html' with user=notification.related_user %}
|
||||
{% if notification.notification_type == 'FAVORITE' %}
|
||||
favorited your
|
||||
<a href="{{ notification.related_status.remote_id}}">status</a>
|
||||
|
||||
{% elif notification.notification_type == 'REPLY' %}
|
||||
<a href="{{ notification.related_status.remote_id}}">replied</a>
|
||||
to your
|
||||
<a href="{{ notification.related_status.reply_parent.remote_id}}">status</a>
|
||||
{% elif notification.notification_type == 'REPLY' %}
|
||||
<a href="{{ notification.related_status.remote_id}}">replied</a>
|
||||
to your
|
||||
<a href="{{ notification.related_status.reply_parent.remote_id}}">status</a>
|
||||
|
||||
{% elif notification.notification_type == 'FOLLOW' %}
|
||||
followed you
|
||||
{% elif notification.notification_type == 'FOLLOW' %}
|
||||
followed you
|
||||
|
||||
{% elif notification.notification_type == 'FOLLOW_REQUEST' %}
|
||||
sent you a follow request
|
||||
<div class="row shrink">
|
||||
{% include 'snippets/follow_request_buttons.html' with user=notification.related_user %}
|
||||
</div>
|
||||
{% elif notification.notification_type == 'FOLLOW_REQUEST' %}
|
||||
sent you a follow request
|
||||
<div class="row shrink">
|
||||
{% include 'snippets/follow_request_buttons.html' with user=notification.related_user %}
|
||||
</div>
|
||||
|
||||
{% elif notification.notification_type == 'BOOST' %}
|
||||
boosted your <a href="{{ notification.related_status.remote_id}}">status</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
your <a href="/import_status/{{ notification.related_import.id }}">import</a> completed.
|
||||
{% elif notification.notification_type == 'BOOST' %}
|
||||
boosted your <a href="{{ notification.related_status.remote_id}}">status</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
your <a href="/import_status/{{ notification.related_import.id }}">import</a> completed.
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p class="level-right">{{ notification.created_date | naturaltime }}</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if not notifications %}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if status.quote %}
|
||||
<div class="quote">
|
||||
<div class="quote block">
|
||||
<blockquote>{{ status.quote }}</blockquote>
|
||||
|
||||
<p> — {% include 'snippets/book_titleby.html' with book=status.book %}</p>
|
||||
|
|
Loading…
Reference in a new issue