<commit_before>=head1 LICENSE

Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

package EnsEMBL::Web::Component::Tools::Blast::TicketDetails;

use strict;
use warnings;

use parent qw(
  EnsEMBL::Web::Component::Tools::Blast
  EnsEMBL::Web::Component::Tools::TicketDetails
);

sub content_ticket {
  my ($self, $ticket, $jobs) = @_;
  my $hub     = $self->hub;
  my $div     = $self->dom->create_element('div');
  my $is_view = ($hub->function || '') eq 'View';

  $div->set_attribute('class', $is_view ? 'plain-box' : '_ticket_details hidden toggleable');

  $div->append_child($self->job_details_table($_, $is_view ? [qw(status edit delete), $_->result_count ? 'results' : ()] : [qw(edit delete)])) for @$jobs;

  return $div->render;
}

sub allowed_url_functions {
  return qw(View Results);
}

1;<commit_msg>In job details, keep top two rows always on screen<commit_after>=head1 LICENSE

Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

package EnsEMBL::Web::Component::Tools::Blast::TicketDetails;

use strict;
use warnings;

use parent qw(
  EnsEMBL::Web::Component::Tools::Blast
  EnsEMBL::Web::Component::Tools::TicketDetails
);

sub content_ticket {
  my ($self, $ticket, $jobs) = @_;
  my $hub     = $self->hub;
  my $div     = $self->dom->create_element('div');
  my $is_view = ($hub->function || '') eq 'View';

  $div->set_attribute('class', 'plain-box') if $is_view;

  for (@$jobs) {
    my $job_table = $self->job_details_table($_, $is_view ? [qw(status edit delete), $_->result_count ? 'results' : ()] : [qw(edit delete)]);
    if (!$is_view) {
      $job_table->append_child('div', {
        'class'     => [qw(_ticket_details hidden toggleable)], # this div is hidden by default
        'children'  => [ splice @{$job_table->child_nodes}, 2 ] # first two rows should always stay on
      });
    }
    $div->append_child($job_table);
  }

  return $div->render;
}

sub allowed_url_functions {
  return qw(View Results);
}

1;
{'fraction_non_alphanumeric': 0.1252408477842004, 'fraction_numerical': 0.009312780989081566, 'mean_word_length': 4.493827160493828, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6078961', 'n_tokens_mistral': 1002, 'n_tokens_neox': 942, 'n_words': 323}