<commit_before>
package VNDB::Handler::Producers;

use strict;
use warnings;
use YAWF ':html';
use VNDB::Func;


YAWF::register(
  qr{p([1-9]\d*)(?:\.([1-9]\d*))?} => \&page,
  qr{p(?:([1-9]\d*)/edit|/new)}    => \&edit,
  qr{p([1-9]\d*)/(lock|hide)}      => \&mod,
);


sub page {
  my($self, $pid, $rev) = @_;

  my $p = $self->dbProducerGet(id => $pid, what => 'vn')->[0];
  return 404 if !$p->{id};

  $self->htmlHeader(title => $p->{name});
  $self->htmlMainTabs(p => $p);
  div class => 'mainbox producerpage';
   p class => 'locked', 'Locked for editing' if $p->{locked};
   h1 $p->{name};
   h2 class => 'alttitle', $p->{original} if $p->{original};
   p class => 'center';
    txt "$self->{languages}{$p->{lang}} \L$self->{producer_types}{$p->{type}}";
    if($p->{website}) {
      txt "\n";
      a href => $p->{website}, $p->{website};
    }
   end;

   if($p->{desc}) {
     p class => 'description';
      lit bb2html $p->{desc};
     end;
   }

  end;
  div class => 'mainbox producerpage';<commit_msg>Producer entries marked as hidden will not be shown<commit_after>
package VNDB::Handler::Producers;

use strict;
use warnings;
use YAWF ':html';
use VNDB::Func;


YAWF::register(
  qr{p([1-9]\d*)(?:\.([1-9]\d*))?} => \&page,
  qr{p(?:([1-9]\d*)/edit|/new)}    => \&edit,
  qr{p([1-9]\d*)/(lock|hide)}      => \&mod,
);


sub page {
  my($self, $pid, $rev) = @_;

  my $p = $self->dbProducerGet(id => $pid, what => 'vn')->[0];
  return 404 if !$p->{id};

  $self->htmlHeader(title => $p->{name});
  $self->htmlMainTabs(p => $p);

  if($p->{hidden}) {
    div class => 'mainbox';
     h1 $p->{name};
     div class => 'warning';
      h2 'Item deleted';
      p;
       lit qq|This item has been deleted from the database, File a request on the|
          .qq| <a href="/t/p$pid">discussion board</a> to undelete this page.|;
      end;
     end;
    end;
    return $self->htmlFooter if !$self->authCan('del');
  }

  div class => 'mainbox producerpage';
   p class => 'locked', 'Locked for editing' if $p->{locked};
   h1 $p->{name};
   h2 class => 'alttitle', $p->{original} if $p->{original};
   p class => 'center';
    txt "$self->{languages}{$p->{lang}} \L$self->{producer_types}{$p->{type}}";
    if($p->{website}) {
      txt "\n";
      a href => $p->{website}, $p->{website};
    }
   end;

   if($p->{desc}) {
     p class => 'description';
      lit bb2html $p->{desc};
     end;
   }

  end;
  div class => 'mainbox producerpage';
{'fraction_non_alphanumeric': 0.2509150061000407, 'fraction_numerical': 0.013013420089467263, 'mean_word_length': 2.967741935483871, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4306485', 'n_tokens_mistral': 1026, 'n_tokens_neox': 984, 'n_words': 219}