Admin fixes and design tweaks

This commit is contained in:
Thomas Sileo 2022-07-03 22:42:14 +02:00
parent 45dc57b538
commit fbaf40a6ac
6 changed files with 46 additions and 7 deletions

View file

@ -282,7 +282,9 @@ async def admin_outbox(
( (
await db_session.scalars( await db_session.scalars(
q.options( q.options(
joinedload(models.OutboxObject.relates_to_inbox_object), joinedload(models.OutboxObject.relates_to_inbox_object).options(
joinedload(models.InboxObject.actor),
),
joinedload(models.OutboxObject.relates_to_outbox_object), joinedload(models.OutboxObject.relates_to_outbox_object),
joinedload(models.OutboxObject.relates_to_actor), joinedload(models.OutboxObject.relates_to_actor),
joinedload(models.OutboxObject.outbox_object_attachments).options( joinedload(models.OutboxObject.outbox_object_attachments).options(

View file

@ -167,7 +167,15 @@ async def index(
q.options( q.options(
joinedload(models.OutboxObject.outbox_object_attachments).options( joinedload(models.OutboxObject.outbox_object_attachments).options(
joinedload(models.OutboxObjectAttachment.upload) joinedload(models.OutboxObjectAttachment.upload)
) ),
joinedload(models.OutboxObject.relates_to_inbox_object).options(
joinedload(models.InboxObject.actor),
),
joinedload(models.OutboxObject.relates_to_outbox_object).options(
joinedload(models.OutboxObject.outbox_object_attachments).options(
joinedload(models.OutboxObjectAttachment.upload)
),
),
) )
.order_by(models.OutboxObject.ap_published_at.desc()) .order_by(models.OutboxObject.ap_published_at.desc())
.offset(page_offset) .offset(page_offset)

View file

@ -26,6 +26,12 @@ body {
a { a {
text-decoration: none; text-decoration: none;
} }
.shared-header {
margin-left:60px;margin-top:30px;margin-bottom:-15px;
strong {
color: $primary-color;
}
}
.activity-main { .activity-main {
a { a {
@ -36,7 +42,7 @@ a {
} }
code, pre { code, pre {
color: $secondary-color; // #cb4b16; // #268bd2; // #2aa198; color: $secondary-color; // #cb4b16; // #268bd2; // #2aa198;
font-family: 'Inconsolata, monospace'; font-family: monospace;
} }
.form { .form {
input, select, textarea { input, select, textarea {
@ -118,6 +124,7 @@ footer {
} }
} }
nav {
input[type=submit], button { input[type=submit], button {
font-size: 20px; font-size: 20px;
line-height: 32px; line-height: 32px;
@ -131,6 +138,7 @@ input[type=submit], button {
color: $secondary-color; color: $secondary-color;
} }
} }
}
nav.flexbox { nav.flexbox {
ul { ul {
@ -184,7 +192,15 @@ nav.flexbox {
.actor-handle { .actor-handle {
color: $muted-color; color: $muted-color;
} }
.activity-date { float:right; } .activity-date {
float:right;
a {
color: $muted-color;
&:hover {
color: $secondary-color;
}
}
}
.object-visibility { float:right;color: $muted-color;margin-right:10px; } .object-visibility { float:right;color: $muted-color;margin-right:10px; }
} }
} }
@ -199,6 +215,13 @@ nav.flexbox {
.activity-bar { .activity-bar {
margin-left: 60px; margin-left: 60px;
margin-top: 10px; margin-top: 10px;
color: $muted-color;
a {
color: $muted-color;
&:hover {
color: $secondary-color;
}
}
} }
} }
.actor-action { .actor-action {

View file

@ -19,7 +19,12 @@
<div class="h-feed"> <div class="h-feed">
<data class="p-name" value="{{ local_actor.display_name}}'s notes"></data> <data class="p-name" value="{{ local_actor.display_name}}'s notes"></data>
{% for outbox_object in objects %} {% for outbox_object in objects %}
{% if outbox_object.ap_type in ["Note", "Article", "Video"] %}
{{ utils.display_object(outbox_object) }} {{ utils.display_object(outbox_object) }}
{% elif outbox_object.ap_type == "Announce" %}
<div class="shared-header"><strong>{{ local_actor.display_name }}</strong> shared</div>
{{ utils.display_object(outbox_object.relates_to_anybox_object) }}
{% endif %}
{% endfor %} {% endfor %}
</div> </div>

View file

@ -3,9 +3,9 @@
{% block content %} {% block content %}
<div style="display:grid;height:80%;"> <div style="display:grid;height:80%;">
<div style="margin:auto;"> <div style="margin:auto;">
<form action="/admin/login" method="POST"> <form class="form" action="/admin/login" method="POST">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<input type="password" name="password"> <input type="password" placeholder="password" name="password">
<input type="submit" value="Login"> <input type="submit" value="Login">
</form> </form>
</div> </div>

View file

@ -320,6 +320,7 @@
<nav class="flexbox activity-bar"> <nav class="flexbox activity-bar">
<ul> <ul>
{% if not is_admin or object.is_from_outbox %}<li><div><a href="{{ object.url }}"{% if object.is_from_inbox %} rel="nofollow"{% endif %}>permalink</a></div></li>{% endif %}
{% if object.is_from_outbox %} {% if object.is_from_outbox %}
<li> <li>
<div class="comment-count">{{ object.likes_count }} like{{ object.likes_count | pluralize }}</div> <div class="comment-count">{{ object.likes_count }} like{{ object.likes_count | pluralize }}</div>
@ -350,7 +351,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if object.is_from_inbox %} {% if object.is_from_inbox and is_admin %}
<li> <li>
{% if object.liked_via_outbox_object_ap_id %} {% if object.liked_via_outbox_object_ap_id %}
{{ admin_undo_button(object.liked_via_outbox_object_ap_id, "unlike") }} {{ admin_undo_button(object.liked_via_outbox_object_ap_id, "unlike") }}