Fix notification read all

FossilOrigin-Name: e2f99021b7def56f6fbe347ecec3c1b5310d4b36c09261298054b462499e591c
This commit is contained in:
nekobit 2022-08-13 06:55:22 +00:00
parent 15804cdf61
commit 0504203df1
3 changed files with 16 additions and 2 deletions

10
dist/treebird.css vendored
View File

@ -32,6 +32,11 @@ body
height: 100%;
}
form
{
display: inline;
}
/* Basic elements */
h1, h2, h3, h4
{
@ -853,6 +858,7 @@ input[type=checkbox].hidden:not(:checked) + .reply-form
{
content:"";
position: absolute;
z-index: 0;
top: 0px;
left: 0px;
width: 15px;
@ -864,6 +870,7 @@ input[type=checkbox].hidden:not(:checked) + .reply-form
{
content:"";
position: absolute;
z-index: 0;
top: 0px;
left: 0px;
width: 65px;
@ -971,9 +978,11 @@ input[type=checkbox].hidden:not(:checked) + .reply-form
.pfp-td
{
position: relative;
width: 52px;
border-collapse: collapse !important;
padding: 6px;
z-index: 1;
}
.pfp-td img
@ -982,6 +991,7 @@ input[type=checkbox].hidden:not(:checked) + .reply-form
width: 52px;
height: 52px;
object-fit: cover;
z-index: 1;
}
.status table tr

View File

@ -365,7 +365,8 @@ void content_notifications_read(PATH_ARGS)
mastodont_notifications_read(api, &m_args, &args, &storage, NULL);
}
else {
mastodont_notifications_read(api, &m_args, NULL, &storage, NULL);
struct mstdnt_notifications_args args = { .max_id = keystr(ssn->post.max_id) };
mastodont_notifications_read(api, &m_args, &args, &storage, NULL);
}
mastodont_storage_cleanup(&storage);

View File

@ -3,7 +3,10 @@
<div class="menubar">
[% IF notifs %]
<a class="btn btn-single btn-small" href="/notifications/clear">Clear notifications</a>
<a class="btn btn-single btn-small" href="/notifications/read">Mark as read</a>
<form action="/notifications/read" method="post">
<input type="hidden" name="max_id" value="[% notifs.0.id %]">
<input type="submit" class="btn btn-single btn-small" value="Mark as read">
</form>
[% ELSE %]
<span class="btn btn-single btn-small btn-disabled">Clear notifications</span>
<span class="btn btn-single btn-small btn-disabled">Mark as read</span>