Project

General

Profile

« Previous | Next » 

Revision ec6065fa

Added by Andreas Kohlbecker about 3 years ago

ref #7599 ref #6866 specimen details tables - derivation tree nodes with links to specimen page

View differences:

modules/cdm_dataportal/includes/occurrences_new.inc
90 90
      ],
91 91
      'div-container' => [
92 92
        'root-item-and-sub-tree' => [
93
          markup_to_render_array('<div class="unit-header"><div class="unit-label">' . $sob_dto->label . '</div></div>'
93
          markup_to_render_array(derived_units_tree_node_header($sob_dto)
94 94
            . '<div class="unit-content-wrapper">' // allows to apply the borders between .derived-unit-tree-root and .unit-content
95 95
            . '<div class="unit-content">' . drupal_render($field_unit_dto_render_array) . '</div>'
96 96
            . '</div>'),
......
149 149
    // data" element of the array is used as the contents of the list item
150 150
    $item['data'] = [];
151 151
    $units_render_array = compose_cdm_specimen_or_observation_dto_details_grid($sob_dto);
152
    $item['data'] = '<div class="unit-header"><div class="unit-label">' . $sob_dto->label . '</div></div>'
152
    $item['data'] = derived_units_tree_node_header($sob_dto)
153 153
      . '<div class="unit-content">' . drupal_render($units_render_array) . '</div>';
154 154
    if (isset($sob_dto->derivatives) && sizeof($sob_dto->derivatives) > 0) {
155 155
      usort($sob_dto->derivatives, 'compare_specimen_or_observation_dtos');
......
162 162
  return $list_items;
163 163
}
164 164

  
165
/**
166
 * @param $sob_dto
167
 *
168
 * @return string
169
 */
170
function derived_units_tree_node_header($sob_dto) {
171
  $link =  cdm_internal_link(path_to_specimen($sob_dto->uuid), null);
172
  return '<div class="unit-header"><div class="unit-label">' . $sob_dto->label . '<span class="page-link">' . $link . '</span></div></div>';
173
}
174

  
165 175
/**
166 176
 * Compose grid of details tabled for a CDM SpecimenOrObservationDTO
167 177
 *
modules/cdm_dataportal/js/derivation-tree.js
33 33
        $element.find(".derived-unit-item").each(function () {
34 34
            var $listItem = $(this);
35 35
            var unitLabel = $listItem.children('.unit-header');
36
            unitLabel.find('.page-link').click(function(event){
37
                event.stopPropagation();
38
            });
36 39
            var unitContent = $listItem.children('.unit-content')
37 40
            if(unitContent.length == 0){
38 41
                // must be the root unit, we gonna dig one level deeper
modules/cdm_dataportal/theme/cdm_dataportal.references.theme
79 79
}
80 80

  
81 81
/**
82
 * Creates an internal link displayes as icon.
83
 *
82 84
 * @param $path
85
 * The drupal path to create the link for
86
 * @param string[] $class_attributes
87
 *   Class attributes for the link element. By default ['superscript'] is being used.
83 88
 *
84 89
 * @return string
85 90
 */
86
function cdm_internal_link($path) {
87
  return l(custom_icon_font_markup('icon-interal-link-alt-solid', array('class' => array('superscript'))), $path, array('html' => true));
91
function cdm_internal_link($path, $class_attributes = ['superscript']) {
92
  return l(custom_icon_font_markup('icon-interal-link-alt-solid', ['class' => $class_attributes]), $path, ['html' => true]);
88 93
}
89 94

  
90 95
/**
themes/zen_dataportal/css/cdm.css
335 335
  background-color: #dedede;
336 336
  padding-left: 5px;
337 337
}
338
/* line 253, ../sass/cdm.scss */
338
/* line 252, ../sass/cdm.scss */
339
div.derived-unit-tree .unit-header .unit-label .page-link,
340
ul.derived-unit-sub-tree .unit-header .unit-label .page-link,
341
ul.derived-unit-sub-tree ul .unit-header .unit-label .page-link {
342
  float: right;
343
}
344
/* line 256, ../sass/cdm.scss */
339 345
div.derived-unit-tree .unit-header .unit-label:hover,
340 346
ul.derived-unit-sub-tree .unit-header .unit-label:hover,
341 347
ul.derived-unit-sub-tree ul .unit-header .unit-label:hover {
342 348
  background-color: #f8f8f8;
343 349
}
344
/* line 257, ../sass/cdm.scss */
350
/* line 260, ../sass/cdm.scss */
345 351
div.derived-unit-tree .unit-content,
346 352
ul.derived-unit-sub-tree .unit-content,
347 353
ul.derived-unit-sub-tree ul .unit-content {
......
352 358
  grid-row-gap: 11.2px;
353 359
}
354 360
@media all and (max-width: 659px) {
355
  /* line 257, ../sass/cdm.scss */
361
  /* line 260, ../sass/cdm.scss */
356 362
  div.derived-unit-tree .unit-content,
357 363
  ul.derived-unit-sub-tree .unit-content,
358 364
  ul.derived-unit-sub-tree ul .unit-content {
......
360 366
  }
361 367
}
362 368
@media all and (min-width: 660px) {
363
  /* line 257, ../sass/cdm.scss */
369
  /* line 260, ../sass/cdm.scss */
364 370
  div.derived-unit-tree .unit-content,
365 371
  ul.derived-unit-sub-tree .unit-content,
366 372
  ul.derived-unit-sub-tree ul .unit-content {
367 373
    grid-template-columns: repeat(2, 1fr);
368 374
  }
369 375
}
370
/* line 270, ../sass/cdm.scss */
376
/* line 273, ../sass/cdm.scss */
371 377
div.derived-unit-tree .unit-content dl,
372 378
ul.derived-unit-sub-tree .unit-content dl,
373 379
ul.derived-unit-sub-tree ul .unit-content dl {
374 380
  margin: 0;
375 381
}
376 382

  
377
/* line 276, ../sass/cdm.scss */
383
/* line 279, ../sass/cdm.scss */
378 384
div.derived-unit-tree table.specimen-or-observation-details {
379 385
  margin: 0;
380 386
  width: 100%;
......
382 388
  font-size: smaller;
383 389
  background-color: white;
384 390
}
385
/* line 282, ../sass/cdm.scss */
391
/* line 285, ../sass/cdm.scss */
386 392
div.derived-unit-tree table.specimen-or-observation-details thead {
387 393
  border-bottom: thin solid #dedede;
388 394
}
389
/* line 285, ../sass/cdm.scss */
395
/* line 288, ../sass/cdm.scss */
390 396
div.derived-unit-tree table.specimen-or-observation-details tbody {
391 397
  background-color: white;
392 398
}
393
/* line 287, ../sass/cdm.scss */
399
/* line 290, ../sass/cdm.scss */
394 400
div.derived-unit-tree table.specimen-or-observation-details tbody .label {
395 401
  text-align: right;
396 402
  white-space: nowrap;
397 403
  border-right: thin solid #dedede;
398 404
  width: 50%;
399 405
}
400
/* line 294, ../sass/cdm.scss */
406
/* line 297, ../sass/cdm.scss */
401 407
div.derived-unit-tree table.specimen-or-observation-details td, div.derived-unit-tree table.specimen-or-observation-details th {
402 408
  padding-right: 11.2px;
403 409
  padding-left: 11.2px;
404 410
}
405 411

  
406
/* line 301, ../sass/cdm.scss */
412
/* line 304, ../sass/cdm.scss */
407 413
div.derived-unit-tree-root .unit-content-wrapper {
408 414
  border-left: 3px dotted #dedede;
409 415
  margin-left: 3.2px;
410 416
}
411 417

  
412
/* line 308, ../sass/cdm.scss */
418
/* line 311, ../sass/cdm.scss */
413 419
ul.derived-unit-sub-tree ul {
414 420
  margin-left: 1.0em;
415 421
}
416
/* line 311, ../sass/cdm.scss */
422
/* line 314, ../sass/cdm.scss */
417 423
ul.derived-unit-sub-tree li {
418 424
  position: relative;
419 425
  margin-left: 0;
......
422 428
  line-height: 22.4px;
423 429
  border-left: 3px dotted #dedede;
424 430
}
425
/* line 321, ../sass/cdm.scss */
431
/* line 324, ../sass/cdm.scss */
426 432
ul.derived-unit-sub-tree li:last-child {
427 433
  border-left: none;
428 434
}
429
/* line 323, ../sass/cdm.scss */
435
/* line 326, ../sass/cdm.scss */
430 436
ul.derived-unit-sub-tree li:last-child .unit-header, ul.derived-unit-sub-tree li:last-child .unit-content {
431 437
  margin-left: 3px;
432 438
}
433
/* line 327, ../sass/cdm.scss */
439
/* line 330, ../sass/cdm.scss */
434 440
ul.derived-unit-sub-tree li:before {
435 441
  position: absolute;
436 442
  top: 3.2px;
......
444 450
  content: "";
445 451
  display: inline-block;
446 452
}
447
/* line 339, ../sass/cdm.scss */
453
/* line 342, ../sass/cdm.scss */
448 454
ul.derived-unit-sub-tree li:last-child:before {
449 455
  border-left: 3px dotted #dedede;
450 456
}
......
452 458
/*
453 459
 * Map
454 460
 */
455
/* line 347, ../sass/cdm.scss */
461
/* line 350, ../sass/cdm.scss */
456 462
.openlayers-container {
457 463
  margin-top: 5px;
458 464
  margin-bottom: 5px;
......
461 467
/*
462 468
 * Registration page & items
463 469
 */
464
/* line 357, ../sass/cdm.scss */
470
/* line 360, ../sass/cdm.scss */
465 471
.registration .type-status {
466 472
  font-weight: bold;
467 473
}
468
/* line 361, ../sass/cdm.scss */
474
/* line 364, ../sass/cdm.scss */
469 475
.registration .registration-date-and-institute {
470 476
  color: #999;
471 477
}
472
/* line 367, ../sass/cdm.scss */
478
/* line 370, ../sass/cdm.scss */
473 479
.registration .published-name .TaxonName .name {
474 480
  font-weight: bold;
475 481
}
476
/* line 371, ../sass/cdm.scss */
482
/* line 374, ../sass/cdm.scss */
477 483
.registration .typified-name .cdm\:TaxonName {
478 484
  color: #999;
479 485
}
480
/* line 373, ../sass/cdm.scss */
486
/* line 376, ../sass/cdm.scss */
481 487
.registration .typified-name .cdm\:TaxonName a {
482 488
  color: #999;
483 489
}
484
/* line 376, ../sass/cdm.scss */
490
/* line 379, ../sass/cdm.scss */
485 491
.registration .typified-name .cdm\:TaxonName .TaxonName .name {
486 492
  font-weight: bold;
487 493
}
488
/* line 382, ../sass/cdm.scss */
494
/* line 385, ../sass/cdm.scss */
489 495
.registration .registration-summary .registered_name .name {
490 496
  font-weight: bold;
491 497
}
492
/* line 385, ../sass/cdm.scss */
498
/* line 388, ../sass/cdm.scss */
493 499
.registration .registration-summary .referenced_typified_name {
494 500
  color: #999;
495 501
}
496
/* line 388, ../sass/cdm.scss */
502
/* line 391, ../sass/cdm.scss */
497 503
.registration .registration-summary .label {
498 504
  font-weight: bold;
499 505
}
......
501 507
/*
502 508
 * Theme settings page
503 509
 */
504
/* line 399, ../sass/cdm.scss */
510
/* line 402, ../sass/cdm.scss */
505 511
#system-theme-settings .image-preview {
506 512
  width: 600px;
507 513
  max-height: 150px;
508 514
  overflow: auto;
509 515
}
510
/* line 403, ../sass/cdm.scss */
516
/* line 406, ../sass/cdm.scss */
511 517
#system-theme-settings .image-preview img {
512 518
  max-width: none;
513 519
  /* reset style in mormalize.scss */
......
518 524
 *
519 525
 * using the same media queries here as in layout/_responsive.scss
520 526
 *****************************************************************************************/
521
/* line 416, ../sass/cdm.scss */
527
/* line 419, ../sass/cdm.scss */
522 528
#classification-breadcrumbs {
523 529
  font-size: 1.5em;
524 530
  line-height: 1.5em;
525 531
}
526 532

  
527 533
@media all and (min-width: 960px) {
528
  /* line 427, ../sass/cdm.scss */
534
  /* line 430, ../sass/cdm.scss */
529 535
  #classification-breadcrumbs {
530 536
    font-size: 1em;
531 537
  }
......
533 539
/***************************
534 540
 * TESTING ONLY 2020-02-20
535 541
 */
536
/* line 435, ../sass/cdm.scss */
542
/* line 438, ../sass/cdm.scss */
537 543
.font-noto {
538 544
  font-family: "Noto Sans", sans-serif !important;
539 545
}
themes/zen_dataportal/css/styles.css
2396 2396
  background-color: #dedede;
2397 2397
  padding-left: 5px;
2398 2398
}
2399
/* line 253, ../sass/cdm.scss */
2399
/* line 252, ../sass/cdm.scss */
2400
div.derived-unit-tree .unit-header .unit-label .page-link,
2401
ul.derived-unit-sub-tree .unit-header .unit-label .page-link,
2402
ul.derived-unit-sub-tree ul .unit-header .unit-label .page-link {
2403
  float: right;
2404
}
2405
/* line 256, ../sass/cdm.scss */
2400 2406
div.derived-unit-tree .unit-header .unit-label:hover,
2401 2407
ul.derived-unit-sub-tree .unit-header .unit-label:hover,
2402 2408
ul.derived-unit-sub-tree ul .unit-header .unit-label:hover {
2403 2409
  background-color: #f8f8f8;
2404 2410
}
2405
/* line 257, ../sass/cdm.scss */
2411
/* line 260, ../sass/cdm.scss */
2406 2412
div.derived-unit-tree .unit-content,
2407 2413
ul.derived-unit-sub-tree .unit-content,
2408 2414
ul.derived-unit-sub-tree ul .unit-content {
......
2413 2419
  grid-row-gap: 11.2px;
2414 2420
}
2415 2421
@media all and (max-width: 659px) {
2416
  /* line 257, ../sass/cdm.scss */
2422
  /* line 260, ../sass/cdm.scss */
2417 2423
  div.derived-unit-tree .unit-content,
2418 2424
  ul.derived-unit-sub-tree .unit-content,
2419 2425
  ul.derived-unit-sub-tree ul .unit-content {
......
2421 2427
  }
2422 2428
}
2423 2429
@media all and (min-width: 660px) {
2424
  /* line 257, ../sass/cdm.scss */
2430
  /* line 260, ../sass/cdm.scss */
2425 2431
  div.derived-unit-tree .unit-content,
2426 2432
  ul.derived-unit-sub-tree .unit-content,
2427 2433
  ul.derived-unit-sub-tree ul .unit-content {
2428 2434
    grid-template-columns: repeat(2, 1fr);
2429 2435
  }
2430 2436
}
2431
/* line 270, ../sass/cdm.scss */
2437
/* line 273, ../sass/cdm.scss */
2432 2438
div.derived-unit-tree .unit-content dl,
2433 2439
ul.derived-unit-sub-tree .unit-content dl,
2434 2440
ul.derived-unit-sub-tree ul .unit-content dl {
2435 2441
  margin: 0;
2436 2442
}
2437 2443

  
2438
/* line 276, ../sass/cdm.scss */
2444
/* line 279, ../sass/cdm.scss */
2439 2445
div.derived-unit-tree table.specimen-or-observation-details {
2440 2446
  margin: 0;
2441 2447
  width: 100%;
......
2443 2449
  font-size: smaller;
2444 2450
  background-color: white;
2445 2451
}
2446
/* line 282, ../sass/cdm.scss */
2452
/* line 285, ../sass/cdm.scss */
2447 2453
div.derived-unit-tree table.specimen-or-observation-details thead {
2448 2454
  border-bottom: thin solid #dedede;
2449 2455
}
2450
/* line 285, ../sass/cdm.scss */
2456
/* line 288, ../sass/cdm.scss */
2451 2457
div.derived-unit-tree table.specimen-or-observation-details tbody {
2452 2458
  background-color: white;
2453 2459
}
2454
/* line 287, ../sass/cdm.scss */
2460
/* line 290, ../sass/cdm.scss */
2455 2461
div.derived-unit-tree table.specimen-or-observation-details tbody .label {
2456 2462
  text-align: right;
2457 2463
  white-space: nowrap;
2458 2464
  border-right: thin solid #dedede;
2459 2465
  width: 50%;
2460 2466
}
2461
/* line 294, ../sass/cdm.scss */
2467
/* line 297, ../sass/cdm.scss */
2462 2468
div.derived-unit-tree table.specimen-or-observation-details td, div.derived-unit-tree table.specimen-or-observation-details th {
2463 2469
  padding-right: 11.2px;
2464 2470
  padding-left: 11.2px;
2465 2471
}
2466 2472

  
2467
/* line 301, ../sass/cdm.scss */
2473
/* line 304, ../sass/cdm.scss */
2468 2474
div.derived-unit-tree-root .unit-content-wrapper {
2469 2475
  border-left: 3px dotted #dedede;
2470 2476
  margin-left: 3.2px;
2471 2477
}
2472 2478

  
2473
/* line 308, ../sass/cdm.scss */
2479
/* line 311, ../sass/cdm.scss */
2474 2480
ul.derived-unit-sub-tree ul {
2475 2481
  margin-left: 1.0em;
2476 2482
}
2477
/* line 311, ../sass/cdm.scss */
2483
/* line 314, ../sass/cdm.scss */
2478 2484
ul.derived-unit-sub-tree li {
2479 2485
  position: relative;
2480 2486
  margin-left: 0;
......
2483 2489
  line-height: 22.4px;
2484 2490
  border-left: 3px dotted #dedede;
2485 2491
}
2486
/* line 321, ../sass/cdm.scss */
2492
/* line 324, ../sass/cdm.scss */
2487 2493
ul.derived-unit-sub-tree li:last-child {
2488 2494
  border-left: none;
2489 2495
}
2490
/* line 323, ../sass/cdm.scss */
2496
/* line 326, ../sass/cdm.scss */
2491 2497
ul.derived-unit-sub-tree li:last-child .unit-header, ul.derived-unit-sub-tree li:last-child .unit-content {
2492 2498
  margin-left: 3px;
2493 2499
}
2494
/* line 327, ../sass/cdm.scss */
2500
/* line 330, ../sass/cdm.scss */
2495 2501
ul.derived-unit-sub-tree li:before {
2496 2502
  position: absolute;
2497 2503
  top: 3.2px;
......
2505 2511
  content: "";
2506 2512
  display: inline-block;
2507 2513
}
2508
/* line 339, ../sass/cdm.scss */
2514
/* line 342, ../sass/cdm.scss */
2509 2515
ul.derived-unit-sub-tree li:last-child:before {
2510 2516
  border-left: 3px dotted #dedede;
2511 2517
}
......
2513 2519
/*
2514 2520
 * Map
2515 2521
 */
2516
/* line 347, ../sass/cdm.scss */
2522
/* line 350, ../sass/cdm.scss */
2517 2523
.openlayers-container {
2518 2524
  margin-top: 10px;
2519 2525
  margin-bottom: 10px;
......
2522 2528
/*
2523 2529
 * Registration page & items
2524 2530
 */
2525
/* line 357, ../sass/cdm.scss */
2531
/* line 360, ../sass/cdm.scss */
2526 2532
.registration .type-status {
2527 2533
  font-weight: bold;
2528 2534
}
2529
/* line 361, ../sass/cdm.scss */
2535
/* line 364, ../sass/cdm.scss */
2530 2536
.registration .registration-date-and-institute {
2531 2537
  color: #999;
2532 2538
}
2533
/* line 367, ../sass/cdm.scss */
2539
/* line 370, ../sass/cdm.scss */
2534 2540
.registration .published-name .TaxonName .name {
2535 2541
  font-weight: bold;
2536 2542
}
2537
/* line 371, ../sass/cdm.scss */
2543
/* line 374, ../sass/cdm.scss */
2538 2544
.registration .typified-name .cdm\:TaxonName {
2539 2545
  color: #999;
2540 2546
}
2541
/* line 373, ../sass/cdm.scss */
2547
/* line 376, ../sass/cdm.scss */
2542 2548
.registration .typified-name .cdm\:TaxonName a {
2543 2549
  color: #999;
2544 2550
}
2545
/* line 376, ../sass/cdm.scss */
2551
/* line 379, ../sass/cdm.scss */
2546 2552
.registration .typified-name .cdm\:TaxonName .TaxonName .name {
2547 2553
  font-weight: bold;
2548 2554
}
2549
/* line 382, ../sass/cdm.scss */
2555
/* line 385, ../sass/cdm.scss */
2550 2556
.registration .registration-summary .registered_name .name {
2551 2557
  font-weight: bold;
2552 2558
}
2553
/* line 385, ../sass/cdm.scss */
2559
/* line 388, ../sass/cdm.scss */
2554 2560
.registration .registration-summary .referenced_typified_name {
2555 2561
  color: #999;
2556 2562
}
2557
/* line 388, ../sass/cdm.scss */
2563
/* line 391, ../sass/cdm.scss */
2558 2564
.registration .registration-summary .label {
2559 2565
  font-weight: bold;
2560 2566
}
......
2562 2568
/*
2563 2569
 * Theme settings page
2564 2570
 */
2565
/* line 399, ../sass/cdm.scss */
2571
/* line 402, ../sass/cdm.scss */
2566 2572
#system-theme-settings .image-preview {
2567 2573
  width: 600px;
2568 2574
  max-height: 150px;
2569 2575
  overflow: auto;
2570 2576
}
2571
/* line 403, ../sass/cdm.scss */
2577
/* line 406, ../sass/cdm.scss */
2572 2578
#system-theme-settings .image-preview img {
2573 2579
  max-width: none;
2574 2580
  /* reset style in mormalize.scss */
......
2579 2585
 *
2580 2586
 * using the same media queries here as in layout/_responsive.scss
2581 2587
 *****************************************************************************************/
2582
/* line 416, ../sass/cdm.scss */
2588
/* line 419, ../sass/cdm.scss */
2583 2589
#classification-breadcrumbs {
2584 2590
  font-size: 1.5em;
2585 2591
  line-height: 1.5em;
2586 2592
}
2587 2593

  
2588 2594
@media all and (min-width: 960px) {
2589
  /* line 427, ../sass/cdm.scss */
2595
  /* line 430, ../sass/cdm.scss */
2590 2596
  #classification-breadcrumbs {
2591 2597
    font-size: 1em;
2592 2598
  }
......
2594 2600
/***************************
2595 2601
 * TESTING ONLY 2020-02-20
2596 2602
 */
2597
/* line 435, ../sass/cdm.scss */
2603
/* line 438, ../sass/cdm.scss */
2598 2604
.font-noto {
2599 2605
  font-family: "Noto Sans", sans-serif !important;
2600 2606
}
themes/zen_dataportal/sass/cdm.scss
249 249
       cursor: pointer;
250 250
       background-color: $menu-bar-background-color;
251 251
       padding-left: 5px;
252
       .page-link {
253
         float: right;
254
       }
252 255
     }
253 256
      .unit-label:hover {
254 257
        background-color: lighten($menu-bar-background-color, 10%)

Also available in: Unified diff