Browse Source

Merge pull request #54 from tripal/issue51

Make analysis a link and switch to "Sequence Assembly"
Lacey-Anne Sanderson 5 years ago
parent
commit
0d0b29bd91

+ 3 - 3
tripal_jbrowse_mgmt/includes/tripal_jbrowse_mgmt_add.form.inc

@@ -48,14 +48,14 @@ function tripal_jbrowse_mgmt_add_form($form, &$form_state) {
     'vocabulary'=>'operation',
     'accession'=>'2945',
   ]);
-  
+
   $analysis_bundle_entity = tripal_load_bundle_entity([
     'term_id'=>$analysis_term_entity->id,
   ]);
 
   $form['analysis'] = [
-    '#title' => t('Analysis'),
-    '#description' => 'Select the analysis to which this instance will be related. Analysis can be created in '.l('Add Tripal Content', 'bio_data/add/' . $analysis_bundle_entity->id).' if wanted analysis is not available.<br><strong>Please choose analysis carefully</strong> since it can not change once instance is created.',
+    '#title' => t('Sequence Assembly'),
+    '#description' => 'Select the analysis which describes the sequence assembly used as the backbone for this JBrowse instance. An analysis can be created in '.l('Add Tripal Content', 'bio_data/add/' . $analysis_bundle_entity->id).' if it is not already available.<br><strong>Please choose analysis carefully</strong> since it can not change once instance is created.',
     '#type' => 'textfield',
     '#autocomplete_path' => 'admin/tripal/extension/tripal_jbrowse/management/instances/analysis/autocomplete',
     '#weight' => -6,

+ 1 - 1
tripal_jbrowse_mgmt/includes/tripal_jbrowse_mgmt_instance.page.inc

@@ -36,7 +36,7 @@ function tripal_jbrowse_mgmt_instance_page($instance_id) {
         'header' => ['Key', 'Value'],
         'rows' => [
           ['Instance Name', $instance->title],
-          ['Analysis Name', $instance->analysis->name ?? 'Not provided'],
+          ['Sequence Assembly', $instance->analysis->name ?? 'Not provided'],
           ['Created At', date('m/d/Y', $instance->created_at)],
           [
             'Organism',

+ 1 - 1
tripal_jbrowse_mgmt/includes/tripal_jbrowse_mgmt_list.page.inc

@@ -29,7 +29,7 @@ function tripal_jbrowse_mgmt_instances_page() {
 
   $header = [
     'Organism',
-    'Analysis',
+    'Sequence Assembly',
     'Submitter',
     'Description',
     'Tracks',

+ 6 - 1
tripal_jbrowse_page/theme/jbrowse-instance--public-listing.tpl.php

@@ -8,7 +8,12 @@
       <h3><?php print l($instance->title, $instance->url); ?></h3>
       <p><?php
       if(property_exists($instance, 'analysis')) {
-        print 'Analysis: ' . $instance->analysis->name . "<br>";
+        if ($instance->analysis->url) {
+          print 'Sequence Assembly: ' . l($instance->analysis->name, $instance->analysis->url) . "<br>";
+        }
+        else {
+          print 'Sequence Assembly: ' . $instance->analysis->name . "<br>";
+        }
       }
       print $instance->description; ?></p>
       <span class="jbrowse-launch-link"><?php print l('Launch JBrowse', $instance->url); ?></span>