bugfix to feature page for features with multiple locations
[sgn.git] / mason / feature / feature_data.mas
blob59baefd3fdc4a71ef383b265a4052e05d650f43b
1 <%args>
2     $feature
3     $title   => 'Feature'
4     $species => undef
5     $description_from => [ $feature ]
6     $featurelocs
7 </%args>
8 <%once>
9     use SGN::View::Feature qw/
10         feature_link cvterm_link organism_link feature_length
11         get_description
12         location_list_html
13         /;
14     use CXGN::Page::FormattingHelpers qw/info_table_html/;
15     use CXGN::Tools::Text qw/commify_number/;
16 </%once>
17 <%init>
18     my $description  = join( '<hr />', grep $_, map get_description($_), @$description_from );
19     my ($length,$locations) = feature_length($feature);
20     my $feature_length      = commify_number($length) . " bases";
21     if ($locations) {
22         $feature_length .= " in $locations location" . ($locations > 1 ? 's' : '');
23     };
24 </%init>
26 <% info_table_html(
27     'Name'          => feature_link( $feature ),
28     'Type'          => cvterm_link( $feature->type, 'caps' ),
29     'Location(s)'   => join('', map "<div>$_</div>\n", location_list_html( $feature, $featurelocs )),
30     'Length'        => $feature_length,
32     'Organism' => organism_link($feature->organism),
33      __border => 0,
34      __multicol => 4
35    )
38 <% info_table_html(
39      'Description'   => $description || '<span class="ghosted">none</span>',
40      __border => 0,
41 )%>
43 <& /feature/dbxref.mas, dbxref => $feature->dbxref &>