diff options
author | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-06-09 15:46:20 +0000 |
---|---|---|
committer | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-06-09 15:46:20 +0000 |
commit | 9c45fc9e59c76e9976afafaaa09d154d2d24894b (patch) | |
tree | 61d37ca4fce0692f4f7ad95b2fadac775229c323 /data | |
parent | ed35983a0f7850ee8381a9f6f3e58783913e559b (diff) |
Added GTIN field to releases and fixed a very old bug with form validation (this fix may break existing forms, will need a lot of testing)
git-svn-id: svn://vndb.org/vndb@26 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'data')
-rw-r--r-- | data/docs/3 | 5 | ||||
-rw-r--r-- | data/tpl/defs.pl | 7 | ||||
-rw-r--r-- | data/tpl/redit | 1 | ||||
-rw-r--r-- | data/tpl/rpage | 3 |
4 files changed, 14 insertions, 2 deletions
diff --git a/data/docs/3 b/data/docs/3 index 5aeff68c..2a0b577a 100644 --- a/data/docs/3 +++ b/data/docs/3 @@ -24,6 +24,11 @@ character sets), put the original title here. </dd><dt>*Language</dt><dd> What language is this release? Use the language that the majority of the game is in. + </dd><dt>JAN/UPC/EAN</dt><dd> + The <a href="http://en.wikipedia.org/wiki/Global_Trade_Item_Number">GTIN</a> code + of the product. Often called "JAN" for Japanese releases, "UPC" for USA and Canada + and "EAN" for Europe. The system will automatically detect the type from the code and + use the appropriate term on the release page. </dd><dt>Official website</dt><dd> .. </dd><dt>Release date</dt><dd> diff --git a/data/tpl/defs.pl b/data/tpl/defs.pl index 0845fab7..3982028e 100644 --- a/data/tpl/defs.pl +++ b/data/tpl/defs.pl @@ -269,6 +269,7 @@ sub gettitle{$p{$_}&&($p{PageTitle}=ref($pagetitles{$_}) eq 'CODE' ? &{$pagetitl # F O R M E R R O R H A N D L I N G # my %formerr_names = ( + # this list is rather incomplete... mail => 'Email', username => 'Username', userpass => 'Password', @@ -285,6 +286,7 @@ my %formerr_names = ( media => 'Media', name => 'Name', vn => 'Visual novel relations', + l_vnn => 'Visual-novels.net link', ); my @formerr_msgs = ( sub { return sprintf 'Field "%s" is required.', @_ }, @@ -295,7 +297,8 @@ my @formerr_msgs = ( $_[1] eq 'url' ? 'Invalid URL' : $_[1] eq 'pname' ? sprintf('%s can only contain alfanumeric characters!', $_[0]) : $_[1] eq 'asciiprint' ? sprintf('Only ASCII characters are allowed at %s', $_[0]) : - $_[1] eq 'int' ? sprintf('%s should be a number!', $_[0]) : ''; + $_[1] eq 'int' ? sprintf('%s should be a number!', $_[0]) : + $_[1] eq 'gtin' ? 'Not a valid JAN, UPC or EAN code!' : ''; }, sub { return sprintf '%s: invalid item selected', @_ }, sub { return 'Invalid unicode, are you sure your browser works fine?' }, @@ -316,7 +319,7 @@ sub formerr { my $ret = '<span class="warning"> Error:<ul>'; $ret .= sprintf " <li>%s</li>\n", - /^([a-z0-9]+)_([0-9]+)_?(.*)$/ ? &{$formerr_msgs[$2-1]}($formerr_names{$1}, $3?$3:'') : $formerr_exeptions{$_} + /^([a-z0-9_]+)_([0-9]+)_?(.*)$/ ? &{$formerr_msgs[$2-1]}($formerr_names{$1}||$1, $3||'') : $formerr_exeptions{$_} foreach (@err); $ret .= "</ul>\n</span>\n"; } diff --git a/data/tpl/redit b/data/tpl/redit index 4bac5e24..163bf5b6 100644 --- a/data/tpl/redit +++ b/data/tpl/redit @@ -30,6 +30,7 @@ { type => 'select', name => 'Language', short => 'language', r=>1, options => [ map { ({ short => $_, name => sprintf '%s (%s)', $_, $VNDB::LANG->{$_} }) } sort keys %{$VNDB::LANG} ] }, + { type => 'input', name => 'JAN/UPC/EAN', short => 'gtin' }, { type => 'input', name => 'Official website', short => 'website' }, { type => 'date', name => 'Release date', short => 'released' }, { type => 'static', text => 'Leave month or day blank if they are unknown<br /><br />' }, diff --git a/data/tpl/rpage b/data/tpl/rpage index ac5eaa11..11432f80 100644 --- a/data/tpl/rpage +++ b/data/tpl/rpage @@ -18,6 +18,7 @@ [ type => 'Type', sub { $VNDB::RTYP->[$_[0] ] } ], [ title => 'Title', 1 ], [ original => 'Orig. title', 1 ], + [ gtin => 'JAN/UPC/EAN', 1 ], [ language => 'Language', sub { $VNDB::LANG->{$_[0]} } ], [ website => 'Website', \&summary ], [ released => 'Release date', \&datestr ], @@ -37,6 +38,8 @@ <dt>Original Title</dt><dd>[[: $d{rel}{original} ]]</dd>[[ } ]]- <dt>Language</dt><dd>[[: $VNDB::LANG->{$d{rel}{language}} ]]</dd> <dt>Release date</dt><dd>[[= datestr($d{rel}{released}) ]]</dd> +[[ if($d{rel}{gtin}) { ]]- + <dt>[[: VNDB::GTINType($d{rel}{gtin}) ]]- code</dt><dd>[[= $d{rel}{gtin} ]]</dd>[[ } ]]- [[ if($d{rel}{minage} >= 0) { ]]- <dt>Age rating</dt><dd>[[: $VNDB::VRAGES->{$d{rel}{minage}} ]]</dd>[[ } ]]- [[ if($#{$d{rel}{producers}} >= 0) { ]]- |