summaryrefslogtreecommitdiff
path: root/data/tpl
diff options
context:
space:
mode:
Diffstat (limited to 'data/tpl')
-rw-r--r--data/tpl/vnedit3
-rw-r--r--data/tpl/vnpage2
-rw-r--r--data/tpl/vnpage_scr16
3 files changed, 17 insertions, 4 deletions
diff --git a/data/tpl/vnedit b/data/tpl/vnedit
index 70bf09a5..eaddf8ed 100644
--- a/data/tpl/vnedit
+++ b/data/tpl/vnedit
@@ -105,6 +105,9 @@
<b style="float: none; display: inline; font-weight: bold">Make sure to submit the form after the upload has finished!</b>
</span><br />
<div id="scrfrm" class="$p{st}">...make sure to enable Javascript...</div>
+ <script type="text/javascript">
+ var scrRel = [|.join(', ', map { ($$_{title} = _hchar($$_{title})) =~ s/\\/\\\\/g; $$_{title}=~s/'/\\'/g; "[ $$_{id}, '$$_{language}', '$$_{title}' ]" } @{$d{rel}}).q|];
+ </script>
|},
{ type => 'sub', title => 'Edit summary', short => 'com' },
diff --git a/data/tpl/vnpage b/data/tpl/vnpage
index a773a3a1..2e9fc6aa 100644
--- a/data/tpl/vnpage
+++ b/data/tpl/vnpage
@@ -35,7 +35,7 @@
[ categories => 'Categories', sub { join(' ', map { my $l=$VNDB::CAT->{substr($_->[0],0,1)}[1]{substr($_->[0],1,2)}; $l?$l.'('.$_->[1].')':() } sort { $a->[0] cmp $b->[0] } @{$_[0]}) || 'No categories selected' }, 1 ],
[ relations => 'Relations', sub { join("<br />\n", map { $VNDB::VREL->[$_->{relation}].': '._hchar($_->{title}) } sort { $a->{id} <=> $b->{id} } @{$_[0]}) } ],
[ image => 'Image', sub { $_[0] > 0 ? sprintf '<img src="%s/cv/%02d/%d.jpg" />', $p{st}, $_[0]%100, $_[0] : $_[0] < 0 ? '[processing]' : 'No image'; } ],
- [ screenshots => 'Screenshots', sub { join "<br />\n", map sprintf('<a href="%s/sf/%02d/%d.jpg">%3$d</a> (%s)',$p{st},$$_{id}%100,$$_{id},$$_{nsfw}?'NSFW':'Safe'), @{$_[0]} } ],
+ [ screenshots => 'Screenshots', sub { join "<br />\n", map sprintf('[%s] <a href="%s/sf/%02d/%d.jpg">%4$d</a> (%s)',$$_{rid}?qq|<a href="/r$$_{rid}">r$$_{rid}</a>|:'no release',$p{st},$$_{id}%100,$$_{id},$$_{nsfw}?'NSFW':'Safe'), @{$_[0]} } ],
[ img_nsfw => 'NSFW', sub { $_[0] ? 'Not safe' : 'Safe' } ]
) ]]
[[ } ]]-
diff --git a/data/tpl/vnpage_scr b/data/tpl/vnpage_scr
index 0675d093..f0c4ae9f 100644
--- a/data/tpl/vnpage_scr
+++ b/data/tpl/vnpage_scr
@@ -7,15 +7,25 @@
]]-
<div id="screenshots">
-[[ for(@{$d{vn}{screenshots}}) { ]]
+[[ for my $r (undef, @{$d{rel}}) {
+ my @s = grep { !$r && !$_->{rid} || $r && $_->{rid} && $_->{rid} == $r->{id} } @{$d{vn}{screenshots}};
+ next if !@s;
+]]-
+[[ if($r) { ]]
+<b><acronym class="icons lang -[[= $r->{language} ]]" title="[[: $VNDB::LANG->{$r->{language}} ]]">&nbsp;</acronym>
+[[: $r->{title} ]]</b>
+[[ } ]]
+[[ for(@s) { ]]
<a href="[[= sprintf '%s/sf/%02d/%d.jpg', $p{st}, $$_{id}%100, $$_{id} ]]"
- [[= $$_{nsfw} ? ' class="scr_nsfw"'.(!$p{AuthNsfw}?' style="display: none"':'') : '' ]]-
+ class="shot [[= $$_{nsfw} ? ' scr_nsfw':'' ]]" [[= !$p{AuthNsfw}&&$$_{nsfw}?' style="display: none"':'' ]]-
rel="[[= $$_{width}.'x'.$$_{height} ]]"><img src="[[= sprintf '%s/st/%02d/%d.jpg', $p{st}, $$_{id}%100, $$_{id} ]]"
/><b>[[= $$_{nsfw} ? 'x' : '&nbsp;' ]]</b></a>
[[ } ]]-
+<br style="clear: left" /><br />
+[[ } ]]
+
</div>
[[ if($nsfw) { ]]-
-<br style="clear: left" /><br />
<p id="scrNsfwHid">&nbsp;</p>
<i style="font-size: 10px;">Items marked with a red X are flagged as NSFW.</i>
[[ } ]]-