Changeset 367 for trunk/grails-app/taglib
- Timestamp:
- Apr 21, 2010, 5:26:21 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r359 r367 472 472 473 473 /** 474 * Template form element475 * @param Map attributes476 * @param Closure help content477 */478 def speciesElement = {attrs, body ->479 // render template element480 baseElement.call(481 'speciesSelect',482 attrs,483 body484 )485 }486 487 /**488 * render a species select element489 * @param Map attrs490 */491 def speciesSelect = {attrs ->492 // fetch the speciesOntology493 // note that this is a bit nasty, probably the ontologyName should494 // be configured in a configuration file... --> TODO: centralize species configuration495 def speciesOntology = Ontology.findByName('NCBI Taxonomy')496 497 // fetch all species498 attrs.from = Term.findAllByOntology(speciesOntology)499 500 // got a name?501 if (!attrs.name) {502 // nope, use a default name503 attrs.name = 'species'504 }505 506 out << select(attrs)507 }508 509 /**510 474 * Ontology form element 511 475 * @param Map attributes … … 551 515 } 552 516 553 554 517 /** 555 518 * render a study select element … … 581 544 */ 582 545 def templateElement = {attrs, body -> 546 // add a rel element if it does not exist 547 if (!attrs.rel) { 548 attrs.rel = 'template' 549 } 550 583 551 // render template element 584 552 baseElement.call(
Note: See TracChangeset
for help on using the changeset viewer.