Permalink
Browse files

Add database param to search result links

  • Loading branch information...
nicklangridge committed Mar 6, 2014
1 parent 3d4043d commit 2b7661510607792d268c547c7a4432773292e049
Showing with 5 additions and 4 deletions.
  1. +3 −2 modules/EBeyeSearch.pm
  2. +2 −2 modules/EnsEMBL/Web/Component/Search/Results.pm
View
@@ -238,7 +238,7 @@ sub get_gene_hits {
my $domain = $unit eq 'ensembl' ? "ensembl_$index" : "ensemblGenomes_$index";
my $ws = $self->ws;
my $pager = $self->pager;
- my $fields = ['id','name','description','species','featuretype','location','gene_synonym','genomic_unit','system_name','transcript'];
+ my $fields = ['id','name','description','species','featuretype','location','gene_synonym','genomic_unit','system_name','transcript','database'];
my $query = $self->ebeye_query;
$query .= " AND genomic_unit:$unit" if $unit ne 'ensembl';
@@ -414,7 +414,8 @@ sub feature2url {
my $transcript = ref $hit->{transcript} eq 'ARRAY' ? $hit->{transcript}->[0] : (split /\n/, $hit->{transcript})[0];
my $url = "$hit->{species_path}/Gene/Summary?g=$hit->{id}";
$url .= ";r=$hit->{location}" if $hit->{location};
- $url .= ";t=$transcript" if $transcript;
+ $url .= ";t=$transcript" if $transcript;
+ $url .= ";db=$hit->{database}" if $hit->{database};
return $url;
},
#...we only have genes for now...
@@ -290,7 +290,7 @@ sub render_hit {
$table->add_row("Coordinate system", $hit->{coord_system});
$table->add_row("Species", sprintf '<em><a href="%s">%s</a></em>', $hit->{species_path}, $self->highlight($species));
- $table->add_row("Location", qq{<a href="$hit->{species_path}/Location/View?r=$hit->{location};g=$hit->{id}">$hit->{location}</a>});
+ $table->add_row("Location", qq{<a href="$hit->{species_path}/Location/View?r=$hit->{location};g=$hit->{id};db=$hit->{database}">$hit->{location}</a>});
$name = "<strong>$name</strong>";
} else {
@@ -300,7 +300,7 @@ sub render_hit {
$table->add_row("Species", sprintf '<em><a href="%s">%s</a></em>', $hit->{species_path}, $self->highlight($species));
if ($hit->{location}) {
- $table->add_row("Location", sprintf '<a href="%s/Location/View?r=%s;g=%s">%s</a>', $hit->{species_path}, $self->zoom_location($hit->{location}), $hit->{id}, $hit->{location});
+ $table->add_row("Location", sprintf '<a href="%s/Location/View?r=%s;g=%s;db=">%s</a>', $hit->{species_path}, $self->zoom_location($hit->{location}), $hit->{id}, $hit->{location}, $hit->{database});
}
if ($hit->{gene_synonym}) {

0 comments on commit 2b76615

Please sign in to comment.