summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Misc/History.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-10-04 18:45:15 +0200
committerYorhel <git@yorhel.nl>2019-10-04 18:45:16 +0200
commite94aef50e3f57a8c58656840f3a35b74906b86ab (patch)
tree13461f3946ef5dd7db3bee8e5490539adb7b3750 /lib/VNWeb/Misc/History.pm
parent625e0b6e80fc4ab15b880217aac794a2720989bf (diff)
v2rw: Convert user pages
Pretty simple conversion, not much special. Did change a few minor display thingies to be more consistent.
Diffstat (limited to 'lib/VNWeb/Misc/History.pm')
-rw-r--r--lib/VNWeb/Misc/History.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/VNWeb/Misc/History.pm b/lib/VNWeb/Misc/History.pm
index 401a77aa..9d814644 100644
--- a/lib/VNWeb/Misc/History.pm
+++ b/lib/VNWeb/Misc/History.pm
@@ -4,7 +4,7 @@ use VNWeb::Prelude;
sub fetch {
- my($type, $id, $filt) = @_;
+ my($type, $id, $filt, $opt) = @_;
my $where = sql_and
!$type ? ()
@@ -28,7 +28,7 @@ sub fetch {
WHERE c_i.type = c.type AND c_i.itemid = c.itemid AND c_i.ihid
AND c_i.rev = (SELECT MAX(c_ii.rev) FROM changes c_ii WHERE c_ii.type = c.type AND c_ii.itemid = c.itemid))' : ();
- my($lst, $np) = tuwf->dbPagei({ page => $filt->{p}, results => 50 }, q{
+ my($lst, $np) = tuwf->dbPagei({ page => $filt->{p}, results => $opt->{results}||50 }, q{
SELECT c.id, c.type, c.itemid, c.comments, c.rev,}, sql_totime('c.added'), q{ AS added
, c.requester, u.username
FROM changes c
@@ -61,14 +61,16 @@ sub _filturl {
}
+# Also used by User::Page.
+# %opt: nopage => 1/0, results => $num
sub tablebox_ {
- my($type, $id, $filt) = @_;
+ my($type, $id, $filt, %opt) = @_;
- my($lst, $np) = fetch $type, $id, $filt;
+ my($lst, $np) = fetch $type, $id, $filt, \%opt;
my sub url { _filturl {%$filt, p => $_} }
- paginate_ \&url, $filt->{p}, $np, 't';
+ paginate_ \&url, $filt->{p}, $np, 't' unless $opt{nopage};
div_ class => 'mainbox browse history', sub {
table_ class => 'stripe', sub {
thead_ sub { tr_ sub {
@@ -93,7 +95,7 @@ sub tablebox_ {
} for @$lst;
};
};
- paginate_ \&url, $filt->{p}, $np, 'b';
+ paginate_ \&url, $filt->{p}, $np, 'b' unless $opt{nopage};
}