diff options
author | Yorhel <git@yorhel.nl> | 2009-02-22 13:46:03 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-02-22 13:46:03 +0100 |
commit | e0390c46122dd2d4d14b7b7f2eeee27b679c133e (patch) | |
tree | 1a6956d0dc14ebd907c00af99ef86da1b007f9fc | |
parent | 8e8bf25368ce0e8371e3aa45ce75c560819ed92b (diff) |
Renaming tags.aliases to tags.alias
Consistent with all other aliases field
-rw-r--r-- | lib/VNDB/DB/Tags.pm | 8 | ||||
-rw-r--r-- | lib/VNDB/Handler/Tags.pm | 8 | ||||
-rw-r--r-- | lib/VNDB/Util/FormHTML.pm | 1 | ||||
-rw-r--r-- | util/updates/update_2.3.sql | 2 |
4 files changed, 9 insertions, 10 deletions
diff --git a/lib/VNDB/DB/Tags.pm b/lib/VNDB/DB/Tags.pm index f7151431..fb8ebca5 100644 --- a/lib/VNDB/DB/Tags.pm +++ b/lib/VNDB/DB/Tags.pm @@ -28,7 +28,7 @@ sub dbTagGet { ); my($r, $np) = $self->dbPage(\%o, q| - SELECT t.id, t.meta, t.name, t.aliases, t.description + SELECT t.id, t.meta, t.name, t.alias, t.description FROM tags t !W ORDER BY !s|, @@ -58,7 +58,7 @@ sub dbTagEdit { my($self, $id, %o) = @_; $self->dbExec('UPDATE tags !H WHERE id = ?', - { map { +"$_ = ?" => $o{$_} } qw|name meta aliases description| }, $id); + { map { +"$_ = ?" => $o{$_} } qw|name meta alias description| }, $id); $self->dbExec('DELETE FROM tags_parents WHERE tag = ?', $id); $self->dbExec('INSERT INTO tags_parents (tag, parent) VALUES (?, ?)', $id, $_) for(@{$o{parents}}); $self->dbExec('DELETE FROM tags_vn WHERE tag = ?', $id) if $o{meta}; @@ -69,8 +69,8 @@ sub dbTagEdit { # returns the id of the new tag sub dbTagAdd { my($self, %o) = @_; - my $id = $self->dbRow('INSERT INTO tags (name, meta, aliases, description) VALUES (!l) RETURNING id', - [ map $o{$_}, qw|name meta aliases description| ] + my $id = $self->dbRow('INSERT INTO tags (name, meta, alias, description) VALUES (!l) RETURNING id', + [ map $o{$_}, qw|name meta alias description| ] )->{id}; $self->dbExec('INSERT INTO tags_parents (tag, parent) VALUES (?, ?)', $id, $_) for(@{$o{parents}}); return $id; diff --git a/lib/VNDB/Handler/Tags.pm b/lib/VNDB/Handler/Tags.pm index 93422113..3f18aa14 100644 --- a/lib/VNDB/Handler/Tags.pm +++ b/lib/VNDB/Handler/Tags.pm @@ -31,7 +31,7 @@ sub tagpage { div class => 'mainbox'; a class => 'addnew', href => "/g$tag/add", 'Create child tag' if $self->authCan('tagmod'); h1 $title; - h2 class => 'alttitle', 'a.k.a. '.join(', ', split /\n/, $t->{aliases}) if $t->{aliases}; + h2 class => 'alttitle', 'a.k.a. '.join(', ', split /\n/, $t->{alias}) if $t->{alias}; p; my @p = @{$t->{parents}}; @@ -136,7 +136,7 @@ sub tagedit { $frm = $self->formValidate( { name => 'name', required => 1, maxlength => 250 }, { name => 'meta', required => 0, default => 0 }, - { name => 'aliases', required => 0, maxlength => 1024, default => '' }, + { name => 'alias', required => 0, maxlength => 1024, default => '' }, { name => 'description', required => 0, maxlength => 1024, default => '' }, { name => 'parents', required => 0, regex => [ qr/^(\d+)(\s\d+)*$/, 'Parents must be a list of tag IDs' ], default => '' } ); @@ -154,7 +154,7 @@ sub tagedit { } if($tag) { - $frm->{$_} ||= $t->{$_} for (qw|name meta aliases description|); + $frm->{$_} ||= $t->{$_} for (qw|name meta alias description|); $frm->{parents} ||= join ' ', map $_->{tag}, @{$t->{parents}}; } @@ -166,7 +166,7 @@ sub tagedit { [ checkbox => short => 'meta', name => 'This is a meta-tag (only to be used as parent for other tags, not for linking to VN entries)' ], $tag ? [ static => content => 'WARNING: Checking this option will permanently delete all existing VN relations!' ] : (), - [ textarea => short => 'aliases', name => "Aliases\n(separated by newlines)", cols => 30, rows => 4 ], + [ textarea => short => 'alias', name => "Aliases\n(separated by newlines)", cols => 30, rows => 4 ], [ textarea => short => 'description', name => 'Description' ], [ static => content => 'What should the tag be used for? Having a good description helps users choose which tags to link to a VN.' ], [ input => short => 'parents', name => 'Parent tags' ], diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm index 05d67302..95b51553 100644 --- a/lib/VNDB/Util/FormHTML.pm +++ b/lib/VNDB/Util/FormHTML.pm @@ -12,7 +12,6 @@ our @EXPORT = qw| htmlFormError htmlFormPart htmlForm |; # form error messages my %formerr_names = ( alias => 'Aliases', - aliases => 'Aliases', anime => 'Anime', desc => 'Description', description => 'Description', diff --git a/util/updates/update_2.3.sql b/util/updates/update_2.3.sql index ce8ce966..249d1ef7 100644 --- a/util/updates/update_2.3.sql +++ b/util/updates/update_2.3.sql @@ -18,7 +18,7 @@ ALTER TABLE releases_rev ADD COLUMN catalog varchar(50) NOT NULL DEFAULT ''; CREATE TABLE tags ( id SERIAL NOT NULL PRIMARY KEY, name varchar(250) NOT NULL UNIQUE, - aliases text NOT NULL DEFAULT '', + alias text NOT NULL DEFAULT '', description text NOT NULL DEFAULT '', meta boolean NOT NULL DEFAULT FALSE ) WITHOUT OIDS; |