diff options
-rw-r--r-- | data/global.pl | 1 | ||||
-rw-r--r-- | data/skingen/style.css | 1 | ||||
-rw-r--r-- | lib/ChangeLog | 2 | ||||
-rw-r--r-- | lib/VNDB/DB/Releases.pm | 6 | ||||
-rw-r--r-- | lib/VNDB/Handler/Releases.pm | 9 | ||||
-rw-r--r-- | lib/VNDB/Handler/VNPage.pm | 1 | ||||
-rw-r--r-- | util/dump.sql | 6 | ||||
-rw-r--r-- | util/updates/update_2.2.sql | 3 |
8 files changed, 21 insertions, 8 deletions
diff --git a/data/global.pl b/data/global.pl index a4f4e7ce..9cbff929 100644 --- a/data/global.pl +++ b/data/global.pl @@ -188,7 +188,6 @@ our %S = (%S, umd => [ 'UMD', 1 ], nod => [ 'Nintendo Optical Disk', 1 ], in => [ 'Internet download', 0 ], - pa => [ 'Patch', 0 ], otc => [ 'Other', 0 ], }, votes => [ diff --git a/data/skingen/style.css b/data/skingen/style.css index f4c561c9..fcae90b8 100644 --- a/data/skingen/style.css +++ b/data/skingen/style.css @@ -602,6 +602,7 @@ div.vndescription p { margin: 0 100px!important; } +b.patch { font-weight: normal; color: $grayedout$ } .releases table, #screenshots table { width: 100%; } diff --git a/lib/ChangeLog b/lib/ChangeLog index 95131d36..cc00aa08 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,6 +1,8 @@ 2.2 - ? - Additional custom CSS field to user profile - Search dropdown calls the return function automatically on select + - Revised the media list + - Added a checkbox to releases to indicate a patch 2.1 - 2008-12-29 - Skin support diff --git a/lib/VNDB/DB/Releases.pm b/lib/VNDB/DB/Releases.pm index 6af2f736..cf077d0e 100644 --- a/lib/VNDB/DB/Releases.pm +++ b/lib/VNDB/DB/Releases.pm @@ -41,7 +41,7 @@ sub dbReleaseGet { ); my @select = ( - qw|r.id r.locked r.hidden rr.title rr.original rr.gtin rr.language rr.website rr.released rr.notes rr.minage rr.type|, 'rr.id AS cid', + qw|r.id r.locked r.hidden rr.title rr.original rr.gtin rr.language rr.website rr.released rr.notes rr.minage rr.type rr.patch|, 'rr.id AS cid', $o{what} =~ /changes/ ? qw|c.added c.requester c.comments r.latest u.username c.rev| : (), ); @@ -135,9 +135,9 @@ sub insert_rev { my($self, $cid, $rid, $o) = @_; $self->dbExec(q| - INSERT INTO releases_rev (id, rid, title, original, gtin, language, website, released, notes, minage, type) + INSERT INTO releases_rev (id, rid, title, original, gtin, language, website, released, notes, minage, type, patch) VALUES (!l)|, - [ $cid, $rid, @$o{qw| title original gtin language website released notes minage type|} ]); + [ $cid, $rid, @$o{qw| title original gtin language website released notes minage type patch|} ]); $self->dbExec(q| INSERT INTO releases_producers (rid, pid) diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm index ff28c64b..93fae18f 100644 --- a/lib/VNDB/Handler/Releases.pm +++ b/lib/VNDB/Handler/Releases.pm @@ -40,6 +40,7 @@ sub page { map sprintf('<a href="/v%d" title="%s">%s</a>', $_->{vid}, $_->{original}||$_->{title}, shorten $_->{title}, 50), @{$_[0]}; } ], [ type => 'Type', serialize => sub { $self->{release_types}[$_[0]] } ], + [ patch => 'Patch', serialize => sub { $_[0] ? 'Patch' : 'Not a patch' } ], [ title => 'Title (romaji)', diff => 1 ], [ original => 'Original title', diff => 1 ], [ gtin => 'JAN/UPC/EAN', serialize => sub { $_[0]||'[none]' } ], @@ -104,6 +105,7 @@ sub _infotable { my $type = $self->{release_types}[$r->{type}]; cssicon lc(substr $type, 0, 3), $type; txt ' '.$type; + txt ' patch' if $r->{patch}; end; end; @@ -229,7 +231,7 @@ sub edit { my $vn = $rid ? $r->{vn} : [{ vid => $vid, title => $v->{title} }]; my %b4 = !$rid ? () : ( - (map { $_ => $r->{$_} } qw|type title original gtin language website notes minage platforms|), + (map { $_ => $r->{$_} } qw|type title original gtin language website notes minage platforms patch|), released => $r->{released} =~ /^([0-9]{4})([0-9]{2})([0-9]{2})$/ ? [ $1, $2, $3 ] : [ 0, 0, 0 ], media => join(',', sort map "$_->{medium} $_->{qty}", @{$r->{media}}), producers => join('|||', map "$_->{id},$_->{name}", sort { $a->{id} <=> $b->{id} } @{$r->{producers}}), @@ -240,6 +242,7 @@ sub edit { if($self->reqMethod eq 'POST') { $frm = $self->formValidate( { name => 'type', enum => [ 0..$#{$self->{release_types}} ] }, + { name => 'patch', required => 0, default => 0 }, { name => 'title', maxlength => 250 }, { name => 'original', required => 0, default => '', maxlength => 250 }, { name => 'gtin', required => 0, default => '0', @@ -263,6 +266,7 @@ sub edit { my $producers = [ map { /^([0-9]+)/ ? $1 : () } split /\|\|\|/, $frm->{producers} ]; my $new_vn = [ map { /^([0-9]+)/ ? $1 : () } split /\|\|\|/, $frm->{vn} ]; $frm->{platforms} = [ grep $_, @{$frm->{platforms}} ]; + $frm->{patch} = $frm->{patch} ? 1 : 0; return $self->resRedirect("/r$rid", 'post') if $rid && $released == $r->{released} && @@ -272,7 +276,7 @@ sub edit { !grep !/^(released|platforms|producers|vn)$/ && $frm->{$_} ne $b4{$_}, keys %b4; my %opts = ( - (map { $_ => $frm->{$_} } qw| type title original gtin language website notes minage platforms editsum|), + (map { $_ => $frm->{$_} } qw| type title original gtin language website notes minage platforms editsum patch|), vn => $new_vn, producers => $producers, media => $media, @@ -310,6 +314,7 @@ sub _form { "General info" => [ [ select => short => 'type', name => 'Type', options => [ map [ $_, $self->{release_types}[$_] ], 0..$#{$self->{release_types}} ] ], + [ check => short => 'patch', name => 'This release is a patch to an other release.' ], [ input => short => 'title', name => 'Title (romaji)', width => 300 ], [ input => short => 'original', name => 'Original title', width => 300 ], [ static => content => 'The original title of this release, leave blank if it already is in the Latin alphabet.' ], diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm index b53b60ee..516979df 100644 --- a/lib/VNDB/Handler/VNPage.pm +++ b/lib/VNDB/Handler/VNPage.pm @@ -395,6 +395,7 @@ sub _releases { end; td class => 'tc4'; a href => "/r$rel->{id}", title => $rel->{original}||$rel->{title}, $rel->{title}; + b class => 'patch', ' (patch)' if $rel->{patch}; end; td class => 'tc5'; if($self->authInfo->{id}) { diff --git a/util/dump.sql b/util/dump.sql index 719f0f75..6d7f1f26 100644 --- a/util/dump.sql +++ b/util/dump.sql @@ -103,7 +103,8 @@ CREATE TABLE releases_rev ( released integer NOT NULL, notes text NOT NULL DEFAULT '', minage smallint NOT NULL DEFAULT -1, - gtin bigint NOT NULL DEFAULT 0 + gtin bigint NOT NULL DEFAULT 0, + patch boolean NOT NULL DEFAULT FALSE ); -- releases_vn @@ -185,7 +186,8 @@ CREATE TABLE users ( show_list boolean NOT NULL DEFAULT TRUE, c_votes integer NOT NULL DEFAULT 0, c_changes integer NOT NULL DEFAULT 0, - skin varchar(128) NOT NULL DEFAULT '' + skin varchar(128) NOT NULL DEFAULT '', + customcss text NOT NULL DEFAULT '' ); -- vn diff --git a/util/updates/update_2.2.sql b/util/updates/update_2.2.sql index 6052eac5..50ca7471 100644 --- a/util/updates/update_2.2.sql +++ b/util/updates/update_2.2.sql @@ -2,3 +2,6 @@ -- custom CSS ALTER TABLE users ADD COLUMN customcss text NOT NULL DEFAULT ''; +-- patch flag +ALTER TABLE releases_rev ADD COLUMN patch BOOLEAN NOT NULL DEFAULT FALSE; + |