summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-01-27 15:42:53 +0100
committerYorhel <git@yorhel.nl>2011-01-27 15:43:03 +0100
commit007eed45f58817bc29443dd3b39d40ceceeadea4 (patch)
tree0e49cf94e70e0d891145dfebd7b7597f0c80f89a /lib
parent11ba55dfc97565ec17fd4828b407d477d2844147 (diff)
Order "all notifications" with new notifications first
That's more what you'd expect from a list that functions somewhat as a short-lived FIFO "archive".
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/DB/Users.pm6
-rw-r--r--lib/VNDB/Handler/Users.pm1
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm
index bd7db201..36ae02af 100644
--- a/lib/VNDB/DB/Users.pm
+++ b/lib/VNDB/DB/Users.pm
@@ -178,7 +178,7 @@ sub dbSessionUpdateLastUsed {
}
-# %options->{ uid id what results page }
+# %options->{ uid id what results page reverse }
# what: titles
sub dbNotifyGet {
my($s, %o) = @_;
@@ -210,8 +210,8 @@ sub dbNotifyGet {
FROM notifications n
!s
!W
- ORDER BY n.id
- |, join(', ', @select), join(' ', @join), \%where);
+ ORDER BY n.id !s
+ |, join(', ', @select), join(' ', @join), \%where, $o{reverse} ? 'DESC' : 'ASC');
return wantarray ? ($r, $np) : $r;
}
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index 44ffa60b..d46d6c22 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -586,6 +586,7 @@ sub notifies {
results => 25,
what => 'titles',
read => $f->{r} == 1 ? undef : 0,
+ reverse => $f->{r} == 1,
);
$self->htmlHeader(title => mt('_usern_title'), noindex => 1);