summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-08-14 15:19:18 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-08-14 15:19:18 +0000
commit889e9b9c481170c94f0b5e773e7c39d27b921a43 (patch)
tree7515e85ee690916f7549fd27bd0a2879657d913b /data
parent99214c46848b3e4706552cfb87043861c1b5f140 (diff)
Added screenshots (not entirely finished, still needs some tweaking and polishing)
git-svn-id: svn://vndb.org/vndb@83 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'data')
-rw-r--r--data/tpl/defs.pl3
-rw-r--r--data/tpl/vnedit4
-rw-r--r--data/tpl/vnpage31
-rw-r--r--data/tpl/vnpage_scr34
4 files changed, 58 insertions, 14 deletions
diff --git a/data/tpl/defs.pl b/data/tpl/defs.pl
index e16da538..9135adb1 100644
--- a/data/tpl/defs.pl
+++ b/data/tpl/defs.pl
@@ -241,7 +241,8 @@ sub ttabs { # [vrpu], obj, sel
<li><a href="/v$$o{id}/edit?fh=info" rel="nofollow">General info</a></li>
<li><a href="/v$$o{id}/edit?fh=cat" rel="nofollow">Categories</a></li>
<li><a href="/v$$o{id}/edit?fh=rel" rel="nofollow">Relations</a></li>
- <li><a href="/v$$o{id}/edit?fh=img" rel="nofollow">Upload image</a></li>
+ <li><a href="/v$$o{id}/edit?fh=img" rel="nofollow">Image</a></li>
+ <li><a href="/v$$o{id}/edit?fh=scr" rel="nofollow">Screenshots</a></li>
<li><a href="/v$$o{id}/add" rel="nofollow">Add release</a></li>
</ul>
</div>| : $t eq 'r' ? qq|
diff --git a/data/tpl/vnedit b/data/tpl/vnedit
index 6412ad8f..c3573d7b 100644
--- a/data/tpl/vnedit
+++ b/data/tpl/vnedit
@@ -93,6 +93,10 @@
Kagetsu Tohya will automatically be added as a sequel for Tsukihime.
|},
+ { type => 'sub', title => 'Screenshots', short => 'scr' },
+ { type => 'hidden', short => 'screenshots' },
+ { type => 'static', raw => 1, text => '<div id="scrfrm" class="'.$p{st}.'">...make sure to enable Javascript...</div>' },
+
{ type => 'sub', title => 'Edit summary', short => 'com' },
{ type => 'textarea', name => 'Edit summary', short => 'comm', rows => 3, cols => 60 },
{ type => 'static', text => 'Please explain your modifications and cite all sources.' },
diff --git a/data/tpl/vnpage b/data/tpl/vnpage
index 39374ed8..d0651992 100644
--- a/data/tpl/vnpage
+++ b/data/tpl/vnpage
@@ -23,19 +23,20 @@
[[ if($d{change}) { ]]
[[= cdiff($d{prev}, $d{vn},
- [ title => 'Title', 1 ],
- [ alias => 'Alias', 1, 1 ],
- [ desc => 'Description', 1, 1 ],
- [ length => 'Length', sub { $VNDB::VNLEN->[$_[0] ][0] } ],
- [ l_wp => 'Wikipedia link', sub { $_[0] ? '<a href="http://en.wikipedia.org/wiki/'.$_[0].'">'.$_[0].'</a>' : 'No link' } ],
- [ l_encubed => 'Encubed tag', sub { $_[0] ? '<a href="http://novelnews.net/tag/'._huri($_[0]).'/">'.$_[0].'</a>' : 'No link' } ],
- [ l_renai => 'Renai.us link', sub { $_[0] ? '<a href="http://renai.us/game/'._huri($_[0]).'.shtml">'.$_[0].'</a>' : 'No link' } ],
- [ l_vnn => 'V-N.net link', sub { $_[0] ? '<a href="http://visual-novels.net/vn/index.php?option=com_content&amp;task=view&amp;id='.$_[0].'">'.$_[0].'</a>' : 'No link' } ],
- [ anime => 'Related anime', sub { join(' ', map qq|<a href="http://anidb.net/a$$_{id}">$$_{id}</a>|, sort { $a->{id} <=> $b->{id} } @{$_[0]}) } ],
- [ 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'; } ],
- [ img_nsfw => 'NSFW', sub { $_[0] ? 'Not safe' : 'Safe' } ]
+ [ title => 'Title', 1 ],
+ [ alias => 'Alias', 1, 1 ],
+ [ desc => 'Description', 1, 1 ],
+ [ length => 'Length', sub { $VNDB::VNLEN->[$_[0] ][0] } ],
+ [ l_wp => 'Wikipedia link', sub { $_[0] ? '<a href="http://en.wikipedia.org/wiki/'.$_[0].'">'.$_[0].'</a>' : 'No link' } ],
+ [ l_encubed => 'Encubed tag', sub { $_[0] ? '<a href="http://novelnews.net/tag/'._huri($_[0]).'/">'.$_[0].'</a>' : 'No link' } ],
+ [ l_renai => 'Renai.us link', sub { $_[0] ? '<a href="http://renai.us/game/'._huri($_[0]).'.shtml">'.$_[0].'</a>' : 'No link' } ],
+ [ l_vnn => 'V-N.net link', sub { $_[0] ? '<a href="http://visual-novels.net/vn/index.php?option=com_content&amp;task=view&amp;id='.$_[0].'">'.$_[0].'</a>' : 'No link' } ],
+ [ anime => 'Related anime', sub { join(' ', map qq|<a href="http://anidb.net/a$$_{id}">$$_{id}</a>|, sort { $a->{id} <=> $b->{id} } @{$_[0]}) } ],
+ [ 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">%2$d</a> (%s)',$p{st},$$_[0]%100,$$_[0],$$_[1]?'NSFW':'Safe'), @{$_[0]} } ],
+ [ img_nsfw => 'NSFW', sub { $_[0] ? 'Not safe' : 'Safe' } ]
) ]]
[[ } ]]-
@@ -157,6 +158,9 @@ if($d{vn}{length} || $d{vn}{alias} || @links || $prod) { ]]
my @lnks = (
!$d{page} ? '<b>description &amp; releases</b>' : '<a href="/v'.$d{vn}{id}.'">description &amp; releases</a>',
$d{page} eq 'stats' ? '<b>stats</b>' : '<a href="/v'.$d{vn}{id}.'/stats">stats</a>',
+ @{$d{vn}{screenshots}} ? (
+ $d{page} eq 'scr' ? '<b>screenshots</b>' : '<a href="/v'.$d{vn}{id}.'/scr">screenshots</a>',
+ ) : (),
$d{vn}{rgraph} ? (
$d{page} eq 'rg' ? '<b>relations</b>' : '<a href="/v'.$d{vn}{id}.'/rg">relations</a>',
) : (),
@@ -167,6 +171,7 @@ if($d{vn}{length} || $d{vn}{alias} || @links || $prod) { ]]
[[ if(!$d{page}) { ]][[+ vnpage_rel ]][[ } ]]
[[ if($d{page} eq 'stats') { ]][[+ vnpage_stats ]][[ } ]]
[[ if($d{page} eq 'rg') { ]][[+ vnpage_rg ]][[ } ]]
+[[ if($d{page} eq 'scr') { ]][[+ vnpage_scr ]][[ } ]]
[[ if($p{AuthLoggedin}) { ]]-
<div class="dropdown" id="voteDD">
diff --git a/data/tpl/vnpage_scr b/data/tpl/vnpage_scr
new file mode 100644
index 00000000..b12bbb14
--- /dev/null
+++ b/data/tpl/vnpage_scr
@@ -0,0 +1,34 @@
+<h3>Screenshots
+[[ if((!$d{vn}{locked} && $p{Authedit}) || $p{Authlock}) { ]]- <p class="actions">(<a href="/v[[= $d{vn}{id} ]]/edit?fh=scr">manage screenshots</a>)</p>[[ } ]]</h3>
+
+[[ if(@{$d{vn}{screenshots}}) {
+ my $tot = @{$d{vn}{screenshots}};
+ my $nsfw = grep $$_[1], @{$d{vn}{screenshots}};
+]]-
+
+<div id="screenshots">
+[[ for(@{$d{vn}{screenshots}}) { ]]
+ <a href="[[= sprintf '%s/sf/%02d/%d.jpg', $p{st}, $$_[0]%100, $$_[0] ]]"[[= $$_[1] ? ' class="scr_nsfw"'.(!$p{AuthNsfw}?' style="display: none"':'') : '' ]]
+ ><img src="[[= sprintf '%s/st/%02d/%d.jpg', $p{st}, $$_[0]%100, $$_[0] ]]"
+ /><b>[[= $$_[1] ? 'x' : '&nbsp;' ]]</b></a>
+[[ } ]]-
+</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>
+[[ } ]]-
+
+<div id="scrView">
+<b id="scrimg"></b><br />
+<a href="#" onclick="return scrClose()" id="scrclose">close</a>
+<a href="#" id="scrprev">&lt;- previous</a>
+<a href="#" id="scrnext">next -&gt;</a>
+</div>
+<img id="preload" onload="scrPosition()" />
+
+[[ } else { ]]-
+<p>
+ No screenshots have been uploaded yet for this visual novel.
+</p>
+[[ } ]]