Merge pull request #2754 from solgenomics/topic/fix_homepage_add_accessions_dialog
[sgn.git] / mason / locus / history.mas
blob02cd0f54f6645da903be1e1a8e2a7f156114ff93
3 <%doc>
5 =head1 NAME
7 /locus/edits_info.mas - a component for printing locus edit dates and person
9 =head1 DESCRIPTION
12 Parameters:
14 =over 1
16 =item locus
18 a locus object
21 =back
23 =head1 AUTHOR
25 Naama Menda <nm249@cornell.edu>
27 =cut 
29 </%doc>
31 <%args>
33 $locus
36 </%args>
38 <%perl>
40 use CXGN::People::Person;
41 use CXGN::Page::FormattingHelpers qw /columnar_table_html  / ;
42 my @history;
43 my $history_data;
45 my @history_objs = $locus->show_history();   #array of locus_history objects
47 foreach my $h (@history_objs) {
48   my $created_date = $h->get_create_date();
49   $created_date = substr $created_date, 0, 10;
50   my $history_id    = $h->{locus_history_id};
51   my $updated_by_id = $h->{updated_by};
52   my $updated =
53     CXGN::People::Person->new( $locus->get_dbh(), $updated_by_id );
54   my $u_first_name = $updated->get_first_name();
55   my $u_last_name  = $updated->get_last_name();
56   my $up_person_link =
57     qq |<a href="/solpeople/personal-info.pl?sp_person_id=$updated_by_id">$u_first_name $u_last_name</a> ($created_date)|;
58   push @history,
59     [
60      map { $_ } (
61                  $h->get_locus_symbol,  $h->get_locus_name,
62                  $h->get_gene_activity, $h->get_description,
63                  $h->get_linkage_group, $h->get_lg_arm,
64                  $up_person_link,
65                 )
66     ];
69 if (@history) {
71   $history_data .= columnar_table_html(
72             headings => [
73                 'Symbol',     'Name', 'Activity', 'Description',
74                 'Chromosome', 'Arm',  'Updated by',
75             ],
76             data         => \@history,
77             __alt_freq   => 2,
78             __alt_width  => 1,
79             __alt_offset => 3,
80             );
83 </%perl>
85 <% $history_data %>