aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Digitigrade/Model.php6
-rw-r--r--Digitigrade/Model/Note.php2
-rw-r--r--static/style.css29
-rw-r--r--templates/note.php5
-rw-r--r--templates/skeleton.php2
5 files changed, 40 insertions, 4 deletions
diff --git a/Digitigrade/Model.php b/Digitigrade/Model.php
index dca1484..4a206a6 100644
--- a/Digitigrade/Model.php
+++ b/Digitigrade/Model.php
@@ -157,13 +157,17 @@ abstract class Model {
string $whereClause,
array $parameters,
?int $limit = null,
- int $offset = 0
+ int $offset = 0,
+ ?string $orderByClause = null
): array {
$classNameParts = explode('\\', static::class);
$className = $classNameParts[count($classNameParts) - 1];
$tableName = self::mangleName($className);
$query = "SELECT * FROM $tableName WHERE $whereClause";
+ if ($orderByClause != null) {
+ $query .= " ORDER BY $orderByClause";
+ }
if ($limit != null) {
$query .= " LIMIT $limit OFFSET $offset";
}
diff --git a/Digitigrade/Model/Note.php b/Digitigrade/Model/Note.php
index 37ddff3..3c0c690 100644
--- a/Digitigrade/Model/Note.php
+++ b/Digitigrade/Model/Note.php
@@ -103,7 +103,7 @@ class Note extends PushableModel {
}
public static function findAllWithAuthor(Actor $author, ?int $limit = null, int $offset = 0): array {
- return self::findAllWhere('author = ?', [$author->id], $limit, $offset);
+ return self::findAllWhere('author = ?', [$author->id], $limit, $offset, 'created DESC');
}
public function getInteractions(): array {
diff --git a/static/style.css b/static/style.css
index fc548fc..c94a011 100644
--- a/static/style.css
+++ b/static/style.css
@@ -1,5 +1,3 @@
-@import url(https://fonts.bunny.net/css?family=dm-sans:400,400i,800,800i);
-
html,
body {
background: #fdf5ff;
@@ -67,6 +65,7 @@ h1 {
hr {
border: none;
border-top: 1px solid #5554;
+ margin: 0px 16px;
}
article.note {
@@ -102,6 +101,21 @@ article.note {
overflow: hidden;
}
}
+
+ .buttons {
+ margin-top: 8px;
+ padding: 0;
+ display: grid;
+ grid-auto-flow: column;
+ gap: 16px;
+ width: max-content;
+
+ button {
+ width: 24px;
+ font-size: 24px;
+ color: #3b005e44;
+ }
+ }
}
.alertbox {
@@ -119,6 +133,17 @@ article.note {
}
}
+button.icon {
+ border: none;
+ background: none;
+ aspect-ratio: 1;
+ margin: 0;
+ padding: 0;
+ &.active {
+ font-variation-settings: "FILL" 1;
+ }
+}
+
.fullProfile {
border-radius: 8px;
margin: 16px;
diff --git a/templates/note.php b/templates/note.php
index 4f11d83..31795e4 100644
--- a/templates/note.php
+++ b/templates/note.php
@@ -19,5 +19,10 @@
<div class="content">
<?= $note->getFormattedContent('text/html') ?? htmlspecialchars($note->plainContent) ?>
</div>
+ <div class="buttons">
+ <button title="Like" class="icon material-symbols-outlined">favorite</button>
+ <button title="Dislike" class="icon material-symbols-outlined">heart_broken</button>
+ <button title="Reshare" class="icon material-symbols-outlined">repeat</button>
+ </div>
</div>
</article> \ No newline at end of file
diff --git a/templates/skeleton.php b/templates/skeleton.php
index 8ed04ee..9cc4636 100644
--- a/templates/skeleton.php
+++ b/templates/skeleton.php
@@ -4,6 +4,8 @@
<head>
<title><?= $pageTitle ?></title>
<link rel="stylesheet" href="/static/style.css">
+ <link rel="stylesheet" href="https://fonts.bunny.net/css?family=dm-sans:400,400i,800,800i">
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
</head>