<commit_before>package EnsEMBL::Admin::Component::Changelog::ListReleases;

### Module to display list of all releases

use strict;
use warnings;

use base qw(EnsEMBL::Web::Component);

sub content {
  my $self    = shift;
  my $hub     = $self->hub;
  my $object  = $self->object;
  my $is_pull = $hub->param('pull') ? 1 : 0;
  my $cur_rel = $object->current_release;

  my $list    = join '', map {
    $_ = $_->release_id;
    $is_pull && $_ >= $cur_rel ? () : sprintf('<li><a href="%s">%s release %s</a></li>',
      $hub->url({'action' => 'List', 'release' => $_, $is_pull ? ('pull' => 1) : ()}),
      $is_pull ? 'Copy declarations from ' : 'View all declarations for ',
      $_
    );
  } @{$object->rose_objects};

  return $list ? sprintf('<h2>%s releases</h2><ul>%s</ul>', $is_pull ? 'Previous' : 'All', $list) : '<h2>Releases not found</h2><p>No previous releases were found in the database</p>';

}

1;<commit_msg>u can not copy multiple declarations at once<commit_after>package EnsEMBL::Admin::Component::Changelog::ListReleases;

### Module to display list of all releases

use strict;
use warnings;

use base qw(EnsEMBL::Web::Component);

sub content {
  my $self    = shift;
  my $hub     = $self->hub;
  my $object  = $self->object;
  my $is_pull = $hub->param('pull') ? 1 : 0;
  my $cur_rel = $object->current_release;

  my $list    = join '', map {
    $_ = $_->release_id;
    $is_pull && $_ >= $cur_rel ? () : sprintf('<li><a href="%s">%s release %s</a></li>',
      $hub->url({'action' => 'List', 'release' => $_, $is_pull ? ('pull' => 1) : ()}),
      $is_pull ? 'Copy a declaration from ' : 'View all declarations for ',
      $_
    );
  } @{$object->rose_objects};

  return $list ? sprintf('<h2>%s releases</h2><ul>%s</ul>', $is_pull ? 'Previous' : 'All', $list) : '<h2>Releases not found</h2><p>No previous releases were found in the database</p>';

}

1;
{'fraction_non_alphanumeric': 0.20784729586426298, 'fraction_numerical': 0.008483563096500531, 'mean_word_length': 3.70573566084788, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 49, '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': '5011289', 'n_tokens_mistral': 691, 'n_tokens_neox': 683, 'n_words': 167}