1 <& /util/import_javascript.mas, classes=>["CXGN.Effects"] &>
3 <style type="text/css">
15 margin-bottom: 0.75em;
21 <script type="text/javascript">
22 function get_author_elements( id_base ) {
24 fewer_link: document.getElementById( "fewer_" + id_base ),
25 all_link: document.getElementById( "all_" + id_base ),
26 authors: document.getElementById( "extra_" + id_base )
29 function authors_on( id_base ) {
30 var stuff = get_author_elements( id_base );
32 stuff.fewer_link.style.display = "inline";
33 stuff.all_link.style.display = "none";
34 stuff.authors.style.display = "inline";
36 function authors_off( id_base ) {
37 var stuff = get_author_elements( id_base );
39 stuff.fewer_link.style.display = "none";
40 stuff.all_link.style.display = "inline";
41 stuff.authors.style.display = "none";
46 <& /page/page_title.mas, title => "Tomato Genome Publications" &>
52 use CXGN::Page::FormattingHelpers;
53 use List::MoreUtils qw/uniq/;
57 my $pubmed = $schema->resultset('General::Db')
58 ->find({ name => 'PMID' });
60 ### get all publications from pubprop database, then index them by pub year
62 $schema->resultset('Cv::Cvterm')
63 ->search({name => 'tomato genome publication'})
64 ->search_related('pubprops', {})
65 ->search_related('pub', {},
66 { prefetch => { pub_dbxrefs => 'dbxref' },
70 # index the publications in a hash by year
73 push @{ $pubs_by_year{ $pub->pyear } }, $pub;
77 <&| /page/info_section.mas, title=>'Publications', collapsible => 0, empty_message => 'temporarily unavailable' &>
79 % # for each year, print out the pubs associated with it
80 % my @sorted_years = sort {$b <=> $a} keys %pubs_by_year;
81 % for my $year ( @sorted_years ) {
82 % my $pubs = $pubs_by_year{$year};
83 <&| /page/info_section.mas, title => $year,
84 subtitle => @$pubs.' publication'.(@$pubs > 1 ? 's' : ''),
86 collapsed => ($year == $sorted_years[0] || $year == $sorted_years[1] ? 0 : 1),
90 % # render each of the publications for this year
91 % for my $pub ( @$pubs ) {
92 <& .publication, pub => $pub, pubmed => $pubmed &>
99 % ############ SUBCOMPONENTS #################
100 % # subcomponent that displays a publication
109 #---getting authors - if the list is too long, only show the first 10,
110 #---the rest of the authors are shown once a link is clicked
111 my @authors = $pub->search_related('pubauthors', {}, { order_by => 'rank' });
114 map $_->givennames." ".$_->surname,
120 map $_->givennames." ".$_->surname,
122 @authors[ 10..$#authors ];
124 $names .= ', ' if $extra_names;
128 <table class="publication">
130 <td><a style="color:black"
132 href="/publication/<% $pub->pub_id %>/view">
133 <b><% $pub->title | h %></b>
141 <td class="width">Author(s):</td>
143 % if( $extra_names ){
144 % my $id = $pub->pub_id;
145 <span style="display: none" id="extra_<% $id %>"><% $extra_names |h %></span>
146 <a style="display: none" id="fewer_<% $id %>" href="javascript:authors_off(<% $id %>)">show fewer</a>
147 <a id="all_<% $id %>" href="javascript:authors_on(<% $id %>)">show all</a>
152 <td class="width">Journal:</td>
153 <td><% $pub->series_name | h %></td>
156 <td class="width">Volume:</td>
157 <td><% $pub->volume | h %></td>
159 % if( $pub->issue ) {
161 <td class="width">Issue:</td>
162 <td><% $pub->issue | h %></td>
166 <td class="width">Pages:</td>
167 <td><% $pub->pages | h %></td>
170 % and my $pm_dbx = $pub->search_related('pub_dbxrefs', {})
171 % ->search_related('dbxref', { db_id => $pubmed->db_id } )
175 <td class="width">Pubmed:</td>
176 <td><a target="_blank"
177 href="http://www.ncbi.nlm.nih.gov/sites/pubmed/<% $pm_dbx->accession %>">
178 Pubmed ID <% $pm_dbx->accession %>