Ignore:
Timestamp:
Jan 26, 2010, 4:46:01 PM (13 years ago)
Author:
duh
Message:
  • added development version of wizard subjects page and logic
  • modified some domain classes (again, who reverted them?) to implement Serializable
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy

    r107 r138  
    22
    33import org.codehaus.groovy.grails.plugins.web.taglib.JavascriptTagLib
     4import dbnp.data.Term
    45
    56/**
     
    9091
    9192                // replace double semi colons
    92                 button = button.replaceAll(/;{2,}/, '!!!')
     93                button = button.replaceAll(/;{2,}/, ';')
    9394               
    9495                // render button
     
    236237         */
    237238        def dateElement = { attrs, body ->
     239                // transform value?
     240                if (attrs.value instanceof Date) {
     241                        // transform date instance to formatted string (dd/mm/yyyy)
     242                        attrs.value = String.format('%td/%<tm/%<tY', attrs.value)
     243                }
     244               
    238245                // set some textfield values
    239246                attrs.maxlength = 10
     
    246253                out << '<script type="text/javascript">'
    247254                out << '$(document).ready(function() {'
    248                 out << '        $("#' + attrs.get('name') + '").datepicker({altField: \'#' + attrs.get('name') + 'Example\', altFormat: \'DD, d MM, yy\'});'
     255                out << '        $("#' + attrs.get('name') + '").datepicker({'
     256                out << '                dateFormat: \'dd/mm/yy\','
     257                out << '                altField: \'#' + attrs.get('name') + 'Example\', altFormat: \'DD, d MM, yy\''
     258                out << '        });'
    249259                out << '});'
    250260                out << '</script>'
    251261        }
     262
     263        /**
     264         * render a species select element
     265         * @param Map attrs
     266         * @param Closure body (help text)
     267         */
     268        def speciesSelect = { attrs, body ->
     269                // fetch all species
     270                attrs.from = Term.findAll()     // for now, all terms, should be refactored to be species ontology only!
     271
     272                // got a name?
     273                if (!attrs.name) {
     274                        attrs.name = 'species'
     275                }
     276
     277                out << select(attrs)
     278        }
    252279}
Note: See TracChangeset for help on using the changeset viewer.