Changeset 804 for trunk/grails-app/taglib
- Timestamp:
- Aug 12, 2010, 1:21:38 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r803 r804 237 237 238 238 // render a form element 239 if (attrs.get('elementId')) { 240 out << '<div class="element" id="'+ attrs.remove('elementId') +'">' 241 } else { 242 out << '<div class="element">' 243 } 239 out << '<div class="element"'+ ((attrs.get('elementId')) ? 'id="'+attrs.remove('elementId')+'"': '') + '>' 244 240 out << ' <div class="description">' 245 out << description241 out << ((description) ? description.replaceAll(/[a-z][A-Z][a-z]/) { it[0] + ' ' + it[1..2] }.replaceAll(/\w+/) { it[0].toUpperCase() + ((it.size() > 1) ? it[1..-1] : '') } : '') 246 242 out << ' </div>' 247 243 out << ' <div class="input">' 248 244 out << renderedElement 249 if (helpText.size() > 0) { 250 out << ' <div class="helpIcon"></div>' 251 } 245 out << ((helpText.size() > 0) ? ' <div class="helpIcon"></div>' : '') 252 246 253 247 // add an disabled input box for feedback purposes … … 850 844 // render template fields 851 845 entity.giveFields().each() { 852 def ucName = it.name[0].toUpperCase() + it.name.substring(1) 846 // Format the column name by: 847 // - separating combined names (SampleName --> Sample Name) 848 // - capitalizing every seperate word 849 def ucName = it.name.replaceAll(/[a-z][A-Z][a-z]/) { 850 it[0] + ' ' + it[1..2] 851 }.replaceAll(/\w+/) { 852 it[0].toUpperCase() + ((it.size() > 1) ? it[1..-1] : '') 853 } 853 854 854 855 out << '<div class="' + attrs.get('class') + '">' + ucName + (it.unit ? " (${it.unit})" : '')
Note: See TracChangeset
for help on using the changeset viewer.