Raw content of EnsEMBL::Web::Component::Website::Declarations
package EnsEMBL::Web::Component::Website::Declarations;
### Module to display all declarations in full
use strict;
use warnings;
no warnings "uninitialized";
use base qw(EnsEMBL::Web::Component);
use EnsEMBL::Web::Data::NewsItem;
sub _init {
my $self = shift;
$self->cacheable( 0 );
$self->ajaxable( 0 );
}
sub caption {
my $self = shift;
return '';
}
sub content {
my $self = shift;
my $object = $self->object;
my $html = 'Declarations in Full
';
my @declarations = EnsEMBL::Web::Data::NewsItem->search('release_id' => $object->species_defs->ENSEMBL_VERSION);
my @sorted = sort {$a->team cmp $b->team} @declarations;
my $previous;
foreach my $item (@sorted) {
if ($item->team ne $previous) {
$html .= ''.$item->team.'
';
}
my $title = $item->title || '(No title)';
my $user = EnsEMBL::Web::Data::User->new($item->created_by);
my $name = 'not logged';
if ($user) {
$name = $user->name;
}
$html .= sprintf(qq(
%s
%s
Declared by: %s
Status: %s
),
$title, $item->declaration, $name, $item->status
);
if ($item->team eq 'Genebuild') {
$html .= sprintf(qq(
- New assembly? %s
- New gene set? %s
- Repeat masking? %s
- Stable ID mapping? %s
- Affy mapping? %s
),
$item->assembly, $item->gene_set, $item->repeat_masking, $item->stable_id_mapping, $item->affy_mapping,
);
}
$html .= '
';
$previous = $item->team;
}
return $html;
}
1;