Project

General

Profile

Revision e27e3ff2

IDe27e3ff221e30308f9b5071032604f6ff6588a17
Parent cd1003b3
Child 36386216

Added by Andreas Kohlbecker 10 months ago

ref #8388 UTIS search block: linking to taxon urls

View differences:

modules/cdm_dataportal/cdm_dataportal.module
347 347
  drupal_add_js('jQuery(document).ready(function() {
348 348
        jQuery( "' . $jquery_selector . '" ).utis_client(
349 349
        {
350
          spinnerIcon: \'' . font_awesome_icon_markup('fa-sync', array('class' => array('fa-3x',  'fa-spin'), 'style' => array('opacity: 0.3;'))) . '\'
350
          spinnerIcon: \'' . font_awesome_icon_markup('fa-sync', array('class' => array('fa-3x',  'fa-spin'), 'style' => array('opacity: 0.3;'))) . '\',
351
          externalLinkIcon: \'' . font_awesome_icon_markup('fa-external-link-alt') . '\'
351 352
        });
352 353
      });',
353 354
    array('type' => 'inline')
......
969 970
  }
970 971
}
971 972

  
973

  
972 974
/**
973 975
 * Provides the uuid of the taxon for pages with the path ./taxon/{taxon_uuid}
974 976
 *
modules/cdm_dataportal/js/utis-client/utis-client.js
14 14
  var defaults = {
15 15
    providers: {'bgbm-phycobank': 'PhycoBank', 'diatombase' : 'DiatomBase', 'worms': 'WoRMS'},
16 16
    // webserviceUrl : 'https://cybertaxonomy.eu/eu-bon/utis/1.3',
17
    webserviceUrl : 'http://test.e-taxonomy.eu/eubon-utis',
17
    // webserviceUrl : 'http://test.e-taxonomy.eu/eubon-utis',
18
    webserviceUrl : 'http://localhost:8081/',
18 19
    pageSize: 20,
19 20
    spinnerIcon: null
20 21
  };
......
30 31
    this.spinnerContainer = null;
31 32
    this.pageIndex = 0;
32 33
    this.autoLoadTolerance = 20; // start autoloading x pixels before the bottom of the result container
34
    this.externalLinkIconMarkup = '[open]';
33 35

  
34 36
    // firebug console stub (avoids errors if firebug is not active)
35 37
    if (typeof console === "undefined") {
......
159 161
        var icon = $(this.options.spinnerIcon);
160 162
        this.spinnerContainer.append(icon);
161 163
      }
164
      if(this.options.externalLinkIcon !== undefined){
165
        this.externalLinkIconMarkup = this.options.externalLinkIcon;
166
      }
162 167
    },
163 168

  
164 169
  /**
......
220 225
            count++;
221 226
          }
222 227
        });
223
        if(count === 0){
228
        if(count === 0 && plugin.pageIndex === 0){
224 229
          plugin.spinnerContainer.before($('<div/>', {'class': 'no-results', style: 'height: 100%; text-align: center; v-align: middle;'}).text("No results."))
225 230
        }
226 231
        plugin.spinnerContainer.hide();
......
230 235
  makeResultEntry: function (record) {
231 236

  
232 237
    var resultEntry = $('<div/>', {'class': 'result-entry'});
233
    resultEntry.append($('<div/>', {'class': 'matching-name', style: 'font-weight: bold;'}).text(record.matchingNameString));
238
    var taxonContainer = $('<div/>');
239
    taxonContainer.append($('<span/>', {'class': 'matching-name', style: 'font-weight: bold; padding-right: 0.3em;'}).text(record.matchingNameString));
240
    if(record.taxon.url){
241
      taxonContainer.append($('<a/>', {href: record.taxon.url, target: 'provider'}).append($(this.externalLinkIconMarkup)));
242
    }
243
    resultEntry.append(taxonContainer);
234 244

  
235 245
    var relation = record.matchingNameType;
236 246
    var taxonName = record.taxon.taxonName.scientificName;
......
242 252
          .append($('<span/>', {'class': 'taxon'}).text(taxonName));
243 253
      }
244 254
      resultEntry.append($('<div/>', {'class': 'checklist', style: 'opacity: 0.5; '}).text('Checklist: ') // text-align: right?
245
          .append($('<a/>', { href: record.checklistUrl, target: 'checklist'}).text(record.checklist)
255
          .append($('<a/>', { href: record.checklistUrl, target: 'provider'}).text(record.checklist)
246 256
          )
247 257
      );
248 258
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)