Changeset 804
- Timestamp:
- Aug 12, 2010, 1:21:38 PM (9 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 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})" : '') -
trunk/grails-app/views/wizard/pages/_events.gsp
r778 r804 31 31 </wizard:radioElement> 32 32 <wizard:templateElement name="eventTemplate" elementId="eventTemplate" description="Event Template" value="${event?.template}" entity="${dbnp.studycapturing.Event}" addDummy="true" ajaxOnChange="switchTemplate" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" > 33 The template to use for this study33 The template to use for this event 34 34 </wizard:templateElement> 35 <wizard:templateElement name="sampleTemplate" elementId="sampleTemplate" description="Sampl eTemplate" value="${event?.template}" entity="${dbnp.studycapturing.SamplingEvent}" addDummy="true" ajaxOnChange="switchTemplate" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" >36 The template to use for this s tudy35 <wizard:templateElement name="sampleTemplate" elementId="sampleTemplate" description="Sampling Event Template" value="${event?.template}" entity="${dbnp.studycapturing.SamplingEvent}" addDummy="true" ajaxOnChange="switchTemplate" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" > 36 The template to use for this sampling event 37 37 </wizard:templateElement> 38 38 <g:if test="${event?.template}">
Note: See TracChangeset
for help on using the changeset viewer.