summaryrefslogtreecommitdiff
path: root/data/tpl/hist
blob: e02a149fa810015f73be61f3879a0a58f2fd68fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
[[= $d{type} && $d{type} ne 'u' ? ttabs($d{type}, $d{obj}, 'hist') : '' ]]-
<h2 class="rss">[[: $p{PageTitle} ]]</h2>
[[ if($d{type} eq 'u' && $#{$d{hist}} < 0) { ]]
<p>
 You haven't made any changes yet.
</p>
[[ } ]]
<br /><br />

[[
  my $url = !$d{type} ? '/hist' : '/'.$d{type}.$d{id}.'/hist';
  my $furl = $url.'?e='.$d{sele}.';t=';
  my $eurl = $url.'?t='.$d{selt}.';e=';
  my $purl = !$d{type}?$eurl.$d{sele}:$d{type} eq 'v' && $d{seli} ? $url.'?i=1' : $url;
  my $rurl = $url.'/rss'.(!$d{type}?'?t='.$d{selt}.';e='.$d{sele}:$d{type} eq 'v' && $d{seli} ? '?i=1' : '');
  local $_ = $d{selt};
  my @fil = (
    /a/ ? 'all items' : '<a href="%sa">all items</a>',
    /v/ ? 'visual novels' : '<a href="%sv">visual novels</a>',
    /r/ ? 'releases' : '<a href="%sr">releases</a>',
    /p/ ? 'producers' : '<a href="%sp">producers</a>',
  );
  local $_ = $d{sele};
  my @edi = (
    /0/ ? 'all changes' : '<a href="%s0">all changes</a>',
    /2/ ? 'edits only' : '<a href="%s2">edits only</a>',
    /1/ ? 'newly created pages only' : '<a href="%s1">newly created pages only</a>',
  );
  local $_ = $d{seli};
  my @inc = (
    /0/ ? 'exclude' : '<a href="'.$url.'">exclude</a>',
    /1/ ? 'include' : '<a href="'.$url.'?i=1">include</a>',
  );
]]

[[ if(!$d{type}) { ]]-
<p class="browse">
 [[= join(' | ', map { sprintf $_, $furl } @fil) ]]<br />
 [[= join(' | ', map { sprintf $_, $eurl } @edi) ]]<br /><br /><br />
</p>
[[ } if($d{type} eq 'v') { ]]-
<p class="browse">
 ([[= join(' | ', @inc) ]]) edits of releases.
</p>
[[ } ]]

[[ if($d{act} eq 'r') { ]]
<span class="msg">
 Performed the mass-revert, please see the following list for details.
</span>
[[ } elsif($d{act} eq 'd') { ]]
<span class="msg">
 The following edits have been completely deleted.
</span>
[[ } ]]-


<a class="rss" href="[[= $rurl ]]">RSS</a>
[[= pagebut($purl) ]]
[[ if(0 and $p{Authmod} || $p{Authdel}) { ]]
<form method="post" action="[[= $purl ]]" class="tblf">
[[ } ]]
<table id="thi">
 <thead><tr>
  <td class="tc1">Rev.</td>
  <td class="tc2">Date</td>
 [[ if($d{type} ne 'u' || $d{act}) { ]]-
  <td class="tc3">User</td>[[ } ]]-
 [[ if(!$d{type} || $d{type} eq 'u' || $d{act} || ($d{type} eq 'v' && $d{seli})) { ]]-
  <td class="tc4">Page</td>[[ } ]]-
 [[ if($d{type} && !$d{act}) { ]]-
  <td class="tc5">Summary</td>[[ } ]]-
 [[ if($d{act} eq 'r') { ]]-
  <td class="tc5">Action</td>[[ } ]]-
 [[ if(0 and $p{Authmod}) { ]]-
  <td class="tc6"><input type="checkbox" id="checkall" name="sel" value="all" /></td>[[ } ]]-
 </tr></thead>

 [[ for (@{$d{hist}}) { my $t = (qw|v r p|)[$_->{type}]; ]]-
 <tr>
  <td class="tc1"><a href="/[[= $t.$_->{iid} ]]?rev=[[= $_->{id} ]]">[[= $_->{id} ]]</a></td>
  <td class="tc2">[[= formatdate('%Y-%m-%d %R', $_->{added}, 'dh') ]]</td>
 [[ if($d{type} ne 'u' || $d{act}) { ]]-
  <td class="tc3"><a href="/u[[= $_->{requester} ]]">[[: $_->{username} ]]</a></td>[[ } ]]-
 [[ if(!$d{type} || $d{type} eq 'u' || $d{act}) { ]]-
  <td class="tc4">[[= $_->{prev} ? $t.$_->{iid} : '<b>'.$t.$_->{iid}.'</b>' ]]:<a href="/[[= $t.$_->{iid} ]]?rev=[[= $_->{id} ]]" title="[[: $_->{ititle} ]]">[[: length($_->{ititle}) > 30 ? substr($_->{ititle},0,27).'...' : $_->{ititle} ]]</a></td>[[ } ]]-
 [[ if($d{type} eq 'v' && $d{seli}) { ]]-
  <td class="tc4"><a href="/[[= $t.$_->{iid} ]]" title="[[: $_->{ititle} ]]">[[= $_->{prev} ? $t.$_->{iid} : '<b>'.$t.$_->{iid}.'</b>' ]]</a></td>[[ } ]]-
 [[ if($d{type} && !$d{act}) { ]]-
  <td class="tc5">[[= summary($_->{comments}, $d{type} eq 'u' ? 40 : 60)||'[empty]' ]]</td>[[ } ]]-
 [[ if($d{act} eq 'r') { ]]-
  <td class="tc5">[[: $_->{_status} ]]</td>[[ } ]]-
 [[ if(0 and $p{Authmod} && !$d{act}) { ]]-
  <td class="tc6"><input type="checkbox" name="sel" value="[[= $_->{id} ]]" /></td>[[ } ]]-
 </tr>
 [[ } ]]

</table>
[[ if(0 and $p{Authmod}) { ]]<input type="submit" class="right" name="post" value="Mass revert" />[[ } ]]
[[ if(0 and $p{Authdel}) { ]]<input type="submit" class="right" name="post" value="Mass delete" id="massdel" />[[ } ]]
[[ if(0 and $p{Authmod} || $p{Authdel}) { ]]</form>[[ } ]]
[[= pagebut($purl) ]]