Merge pull request #4272 from solgenomics/topic/fix-vcf-download
[sgn.git] / mason / tools / blast / dbinfo.mas
blobfc156a9a9e728d429648e70a9a426a35564d2a06
2 <%doc>
3 </%doc>
5 <%args>
6 @groups => ()
7 </%args>
9 <%perl>
11 #print Data::Dumper::Dumper(\@groups);
13 </%perl>
15 <& /page/page_title.mas, title=>"BLAST db details" &>
17 <div >This page provides details for each of the BLAST sequence sets available at SGN.</div>
19 % foreach my $g (@groups) { 
21 <&| /page/info_section.mas, title=>$g->[1] &>
23 %   foreach my $d (@{$g->[2]}) { 
25    <%perl>
26      my $needs_update ="";
27      if ($d->{needs_update}) { $needs_update = $d->{needs_update} ? qq|<span style="background: #c22; padding: 3px; color: white">needs update</span>| : qq|<span style="background: #2c2; padding: 3ppx; color: white">up to date</span>|;
29      my $source_url = "";
30      if (exists($d->{source_url}) && $d->{source_url} =~ m/^http|^ftp/) { 
31        $source_url = qq | <a href="$source_url">$source_url</a> |;
32      }
33    </%perl>
34       
35 <&| /page/info_section.mas, title=> $d->{title}, is_subsection=>1 &>
36   <& /page/info_table.mas, data => [
37     'Type'    => $d->{sequence_type}, 
38     'Seq count'   => $d->{sequence_count},
39                                     'Current as of'    => $d->{current_as_of},
40                                     'Updates' => $d->{update_freq},
41                                     ' '     => $needs_update,
42                                    ],
43     'multicol'=>5 &>
44     <& /page/info_table.mas, data => [ 
45                                       'Source URL'       => $source_url,
46                                      ],
47       &>
48       <& /page/info_table.mas, data => [
49         'Description'      => $d->{description} 
50                                        ],
51                                          &>
52 </&>
53 %   }
55 </&>
59 <%perl>
64 #print Data::Dumper::Dumper(\@groups);
67 # sub info_html {
68 #  my ($db,$groupname) = @_;
70 #  my $timestamp = $db->file_modtime
71 #    or return;
73 #  my $timestamp_str = strftime('%m-%d-%y %R GMT',gmtime $db->file_modtime);
74 #  if( $db->needs_update ) {
75 #    $timestamp_str = qq|<span style="background: #c22; padding: 3px; color: white">$timestamp_str (needs update)</span>|;
76 #  }
77 ##  my $update_freq = $db->update_freq;
79 #  return info_section_html( title => $db->title.'<a name="'.$db->file_base.'"></a>',
80 #                           subtitle => "<b>Category:</b> $groupname",
81 #                           is_subsection => 0,
82 #                           contents =>
83 #                           info_table_html(
84 #                                           'Sequence Type' => $db->type,
85 #                                           'Sequence Count' => commify_number($db->sequences_count),
86 #                                           'Current as of ' => $timestamp_str,
87 #                                           'Update Frequency' => $update_freq,
88 #                                            __multicol => 5,
89 #                                            __border => 0,
90 #                                          )
91 #                           .info_table_html(
92 #                                            $db->info_url ? ('Source Information' => '<a href="'.$db->info_url.'">'.truncate_string($db->info_url,40).'</a>') : (),
93 #                                            $db->source_url ? ('FASTA Sequences' => '<a href="'.$db->source_url.'">'.truncate_string($db->source_url,40).'</a>') : (),
94 #                                            __multicol => 2,
95 #                                           __border => 0,
96 #                                          )
97 #                           .info_table_html(
98 #                                            'Description' => $db->description || '<span class="ghosted">Not available</span>',
99 #                                           __border => 0,
100 #                                          ),
102 #                         );
104 </%perl>