Changeset 138 for trunk/grails-app/taglib/dbnp
- Timestamp:
- Jan 26, 2010, 4:46:01 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r107 r138 2 2 3 3 import org.codehaus.groovy.grails.plugins.web.taglib.JavascriptTagLib 4 import dbnp.data.Term 4 5 5 6 /** … … 90 91 91 92 // replace double semi colons 92 button = button.replaceAll(/;{2,}/, ' !!!')93 button = button.replaceAll(/;{2,}/, ';') 93 94 94 95 // render button … … 236 237 */ 237 238 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 238 245 // set some textfield values 239 246 attrs.maxlength = 10 … … 246 253 out << '<script type="text/javascript">' 247 254 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 << ' });' 249 259 out << '});' 250 260 out << '</script>' 251 261 } 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 } 252 279 }
Note: See TracChangeset
for help on using the changeset viewer.