summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Users.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-08-08 02:26:35 +0200
committerYorhel <git@yorhel.nl>2015-08-08 02:26:35 +0200
commit1e7b29358b3dbc5a7869d91bc61c6a62431b3e8e (patch)
tree493e917b7263273d88dcda13878275adafdcc2a5 /lib/VNDB/Handler/Users.pm
parent6c46c3bd553734944847193a3356176efc3416e7 (diff)
Hide sexual traits by default + Add profile option to change default
Diffstat (limited to 'lib/VNDB/Handler/Users.pm')
-rw-r--r--lib/VNDB/Handler/Users.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index 293a91b5..954923b4 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -374,6 +374,7 @@ sub edit {
{ post => 'usrpass2', required => 0, minlength => 4, maxlength => 64, template => 'asciiprint' },
{ post => 'hide_list', required => 0, default => 0, enum => [0,1] },
{ post => 'show_nsfw', required => 0, default => 0, enum => [0,1] },
+ { post => 'traits_sexual', required => 0, default => 0, enum => [0,1] },
{ post => 'tags_all', required => 0, default => 0, enum => [0,1] },
{ post => 'tags_cat', required => 0, multi => 1, enum => [qw|cont ero tech|] },
{ post => 'spoilers', required => 0, default => 0, enum => [0..2] },
@@ -384,7 +385,7 @@ sub edit {
if ($frm->{usrpass} || $frm->{usrpass2}) && (!$frm->{usrpass} || !$frm->{usrpass2} || $frm->{usrpass} ne $frm->{usrpass2});
if(!$frm->{_err}) {
$frm->{skin} = '' if $frm->{skin} eq $self->{skin_default};
- $self->dbUserPrefSet($uid, $_ => $frm->{$_}) for (qw|skin customcss show_nsfw tags_all hide_list spoilers|);
+ $self->dbUserPrefSet($uid, $_ => $frm->{$_}) for (qw|skin customcss show_nsfw traits_sexual tags_all hide_list spoilers|);
my $tags_cat = join(',', sort @{$frm->{tags_cat}}) || 'none';
$self->dbUserPrefSet($uid, tags_cat => $tags_cat eq $self->{default_tags_cat} ? '' : $tags_cat);
@@ -406,7 +407,7 @@ sub edit {
$frm->{usrname} ||= $u->{username};
$frm->{mail} ||= $u->{mail};
$frm->{perms} ||= [ grep $u->{perm} & $self->{permissions}{$_}, keys %{$self->{permissions}} ];
- $frm->{$_} //= $u->{prefs}{$_} for(qw|skin customcss show_nsfw tags_all hide_list spoilers|);
+ $frm->{$_} //= $u->{prefs}{$_} for(qw|skin customcss show_nsfw traits_sexual tags_all hide_list spoilers|);
$frm->{tags_cat} ||= [ split /,/, $u->{prefs}{tags_cat}||$self->{default_tags_cat} ];
$frm->{ign_votes} = $u->{ign_votes} if !defined $frm->{ign_votes};
$frm->{skin} ||= $self->{skin_default};
@@ -442,6 +443,7 @@ sub edit {
[ part => title => mt '_usere_options' ],
[ check => short => 'hide_list', name => mt '_usere_flist', "/u$uid/list", "/u$uid/votes", "/u$uid/wish" ],
[ check => short => 'show_nsfw', name => mt '_usere_fnsfw' ],
+ [ check => short => 'traits_sexual', name => mt '_usere_fsextraits' ],
[ check => short => 'tags_all', name => mt '_usere_ftags' ],
[ select => short => 'tags_cat', name => mt('_usere_tagcats'), multi => 1, size => 3, options => [ map [ $_, mt '_tagcat_'.$_ ], qw|cont ero tech| ] ],
[ select => short => 'spoilers', name => mt('_usere_spoilers'), options => [ map [ $_, mt '_spoilset_'.$_ ], 0..2 ] ],