summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-06-30 18:38:42 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-06-30 18:38:42 +0000
commit65c9483112ca4a7c5887cd8331326a0e42e49800 (patch)
tree3263a06fc3517eb4d7595054dd882b0863bbd28a /data
parent5fd0fb77b025faf71946df483296f24e756e3657 (diff)
Revision numers are now local to their item ID and better integrated into VNDBIDs
git-svn-id: svn://vndb.org/vndb@48 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'data')
-rw-r--r--data/tpl/defs.pl13
-rw-r--r--data/tpl/hist11
-rw-r--r--data/tpl/home2
3 files changed, 13 insertions, 13 deletions
diff --git a/data/tpl/defs.pl b/data/tpl/defs.pl
index d3e84b8a..fcc1c443 100644
--- a/data/tpl/defs.pl
+++ b/data/tpl/defs.pl
@@ -87,12 +87,12 @@ sub cdiff { # obj1, obj2, @items->[ short, name, serialise, diff, [parsed_x, par
my $type = defined $$y{minage} ? 'r' : defined $$y{length} ? 'v' : 'p';
my $pre = '<div id="revbrowse">'.
- ($$y{next} ? qq|<a href="/$type$$y{id}?rev=$$y{next}" id="revnext">later revision -&gt;</a>| : '').
- ($x ? qq|<a href="/$type$$y{id}?rev=$$x{cid}" id="revprev">&lt;- earlier revision</a>| : '').
+ ($$y{next} ? qq|<a href="/$type$$y{id}.$$y{next}" id="revnext">later revision -&gt;</a>| : '').
+ ($x ? qq|<a href="/$type$$y{id}.$$x{rev}" id="revprev">&lt;- earlier revision</a>| : '').
qq|<a href="/$type$$y{id}" id="revmain">$type$$y{id}</a>&nbsp;</div>|;
if(!$x) { # just show info about the revision if there is no previous edit
- return $pre.qq|<div id="tmc"><b>Revision $$y{cid}</b> (<a href="/$type$$y{id}/edit?rev=$$y{cid}">edit</a>)<br />By <a href="/u$$y{requester}">$$y{username}</a> on |.
+ return $pre.qq|<div id="tmc"><b>Revision $$y{rev}</b> (<a href="/$type$$y{id}/edit?rev=$$y{rev}">edit</a>)<br />By <a href="/u$$y{requester}">$$y{username}</a> on |.
formatdate('%Y-%m-%d at %R', $$y{added}).'<br /><b>Edit summary:</b><br /><br />'.
summary($$y{comments}, 0, '[no summary]').'</div>';
}
@@ -120,9 +120,9 @@ sub cdiff { # obj1, obj2, @items->[ short, name, serialise, diff, [parsed_x, par
}
}
return $pre.'<table id="tmc"><thead><tr><td class="tc1">&nbsp;</td>'.
- qq|<td class="tc2"><b>Revision $$x{cid}</b> (<a href="/$type$$y{id}/edit?rev=$$x{cid}">edit</a>)<br />By <a href="/u$$x{requester}">$$x{username}</a> on |.formatdate('%Y-%m-%d at %R', $$x{added}).'</td>'.
- qq|<td class="tc3"><b>Revision $$y{cid}</b> (<a href="/$type$$y{id}/edit?rev=$$y{cid}">edit</a>)<br />By <a href="/u$$y{requester}">$$y{username}</a> on |.formatdate('%Y-%m-%d at %R', $$y{added}).'</td>'.
- '</tr><tr></tr><tr><td>&nbsp;</td><td colspan="2"><b>Edit summary of revision '.$$y{cid}.'</b><br /><br />'.summary($$y{comments}, 0, '[no summary]').'<br /><br /></td></tr></thead>'.
+ qq|<td class="tc2"><b>Revision $$x{rev}</b> (<a href="/$type$$y{id}/edit?rev=$$x{rev}">edit</a>)<br />By <a href="/u$$x{requester}">$$x{username}</a> on |.formatdate('%Y-%m-%d at %R', $$x{added}).'</td>'.
+ qq|<td class="tc3"><b>Revision $$y{rev}</b> (<a href="/$type$$y{id}/edit?rev=$$y{rev}">edit</a>)<br />By <a href="/u$$y{requester}">$$y{username}</a> on |.formatdate('%Y-%m-%d at %R', $$y{added}).'</td>'.
+ '</tr><tr></tr><tr><td>&nbsp;</td><td colspan="2"><b>Edit summary of revision '.$$y{rev}.'</b><br /><br />'.summary($$y{comments}, 0, '[no summary]').'<br /><br /></td></tr></thead>'.
join('',map{
'<tr><td class="tc1">'.$_->[1].'</td><td class="tc2">'.$_->[4].'</td><td class="tc3">'.$_->[5].'</td></tr>'
} @c).'</table>';
@@ -148,6 +148,7 @@ sub summary { # cmd, len, def
if(!$as && s/(http|https):\/\/(.+[0-9a-zA-Z=\/])/<a href="$1:\/\/$2" rel="nofollow">link<\/a>/) {
$l = 4;
} elsif(!$as) {
+ s/^(.*[^\w]|)([dvpr][0-9]+)\.([0-9]+)([^\w].*|)$/$1<a href="\/$2.$3">$2.$3<\/a>$4/ ||
s/^(.*[^\w]|)([duvpr][0-9]+)([^\w].*|)$/$1<a href="\/$2">$2<\/a>$3/;
}
while(s/\[\/url\]/<\/a>/i) {
diff --git a/data/tpl/hist b/data/tpl/hist
index 4160ef52..b578d1f5 100644
--- a/data/tpl/hist
+++ b/data/tpl/hist
@@ -62,11 +62,11 @@
[[ } ]]
<table id="thi">
<thead><tr>
- <td class="tc1">Rev.</td>
+ <td class="tc1" colspan="2">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})) { ]]-
+ [[ if(!$d{type} || $d{type} eq 'u' || $d{act}) { ]]-
<td class="tc4">Page</td>[[ } ]]-
[[ if($d{type} && !$d{act}) { ]]-
<td class="tc5">Summary</td>[[ } ]]-
@@ -78,14 +78,13 @@
[[ 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="tc1_1"><a href="/[[= $t.$_->{iid}.'.'.$_->{rev} ]]">[[= $t.$_->{iid} ]]</td>
+ <td class="tc1_2"><a href="/[[= $t.$_->{iid}.'.'.$_->{rev} ]]">.[[= $_->{rev} == 1 ? '<b>'.$_->{rev}.'</b>' : $_->{rev} ]]</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>[[ } ]]-
+ <td class="tc4"><a href="/[[= $t.$_->{iid} ]].[[= $_->{rev} ]]" title="[[: $_->{ititle} ]]">[[: shorten $_->{ititle}, 30 ]]</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') { ]]-
diff --git a/data/tpl/home b/data/tpl/home
index b9d19456..f796f8b6 100644
--- a/data/tpl/home
+++ b/data/tpl/home
@@ -25,7 +25,7 @@
<ul class="home">
<li><b>Recent changes</b></li>
[[ for (@{$d{recentedits}}) { my $t = (qw|v r p|)[$_->{type}]; ]]-
- <li>[[= $t ]]:<a href="/[[= $t.$_->{iid}.'?rev='.$_->{id} ]]" title="[[: $_->{ititle} ]]">[[: shorten $_->{ititle}, 30 ]]</a></li>
+ <li>[[= $t ]]:<a href="/[[= $t.$_->{iid}.'.'.$_->{rev} ]]" title="[[: $_->{ititle} ]]">[[: shorten $_->{ititle}, 30 ]]</a></li>
[[ } ]]-
</ul>