feat: Show notifications on profile
This commit is contained in:
parent
198fb88bfd
commit
63f542da81
@ -457,7 +457,7 @@ select, button {
|
||||
}
|
||||
}
|
||||
|
||||
.container-comments {
|
||||
.container-comments, .container-cards {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
background: var(--background-two);
|
||||
@ -465,7 +465,7 @@ select, button {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.comment {
|
||||
.comment, .notification {
|
||||
flex: 1 100%;
|
||||
margin: 10px;
|
||||
border-radius: 8px;
|
||||
|
@ -14,7 +14,11 @@
|
||||
{% endif %}
|
||||
|
||||
{% if user.id is request.user.id %}
|
||||
|
||||
<h2>{% translate 'Benachrichtigungen' %}</h2>
|
||||
{% include "fellchensammlung/lists/list-notifications.html" %}
|
||||
<h2>{% translate 'Meine Vermittlungen' %}</h2>
|
||||
{% include "fellchensammlung/lists/list-adoption-notices.html" %}
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
@ -0,0 +1,5 @@
|
||||
<div class="container-cards">
|
||||
{% for notification in notifications %}
|
||||
{% include "fellchensammlung/partials/partial-notification.html" %}
|
||||
{% endfor %}
|
||||
</div>
|
@ -0,0 +1,12 @@
|
||||
{% load i18n %}
|
||||
{% load custom_tags %}
|
||||
<div class="notification">
|
||||
<div class="notification-header">
|
||||
<b>{{ notification.title }}</b>
|
||||
{{ notification.created_at }}
|
||||
<a class="adoption-card-report-link" href=""><i class="fa-solid fa-check"></i></a>
|
||||
</div>
|
||||
<p>
|
||||
{{ notification.text | render_markdown }}
|
||||
</p>
|
||||
</div>
|
@ -12,7 +12,7 @@ from notfellchen import settings
|
||||
|
||||
from fellchensammlung import logger
|
||||
from .models import AdoptionNotice, Text, Animal, Rule, Image, Report, ModerationAction, \
|
||||
User, Location, AdoptionNoticeStatus, Subscriptions, CommentNotification
|
||||
User, Location, AdoptionNoticeStatus, Subscriptions, CommentNotification, BaseNotification
|
||||
from .forms import AdoptionNoticeForm, AdoptionNoticeFormWithDateWidget, ImageForm, ReportAdoptionNoticeForm, \
|
||||
CommentForm, ReportCommentForm, AnimalForm, \
|
||||
AdoptionNoticeSearchForm, AnimalFormWithDateWidget
|
||||
@ -316,7 +316,9 @@ def report_detail_success(request, report_id):
|
||||
|
||||
def user_detail(request, user_id):
|
||||
user = User.objects.get(id=user_id)
|
||||
context = {"user": user, "adoption_notices": AdoptionNotice.objects.filter(created_by=user)}
|
||||
context = {"user": user,
|
||||
"adoption_notices": AdoptionNotice.objects.filter(created_by=user),
|
||||
"notifications": BaseNotification.objects.filter(user=user, read=False)}
|
||||
return render(request, 'fellchensammlung/details/detail-user.html', context=context)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user