Changeset 1782 for trunk/grails-app


Ignore:
Timestamp:
Apr 20, 2011, 2:27:00 PM (10 years ago)
Author:
work@…
Message:
  • resolved #93, improved seperation of events / sampling events in events page of the wizard
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/studyWizard/pages/_events.gsp

    r1558 r1782  
    1616%>
    1717<af:page>
    18         <g:if env="development">
    19                 <af:ajaxButtonElement description="Development feature (clear events)" name="clear" value="clear events" afterSuccess="onPage()">
    20                         This functionality is only available in development mode for debugging purposes and will not show in test and production environments
    21                 </af:ajaxButtonElement>
    22         </g:if>
    23 
    2418        <span class="info">
    2519                <span class="title">Define all events that occur in your study</span>
     
    2721        </span>
    2822
    29         <af:radioElement name="eventType" description="Type" elements="['event','sample']" value="${values?.eventType}">
    30                 Type of event
     23        <af:radioElement name="eventType" description="Choose the type of event" elements="[event:'treatment, challenge, etc.',sample:'sampling event']" class="eventradio" elementclass="label_radio" value="${values?.eventType}">
     24                The type of event can be either a sampling event (e.g. taking a sample) or anything that acts upon a subject (e.g. a treatment or a challenge)
    3125        </af:radioElement>
    32         <af:templateElement name="eventTemplate" elementId="eventTemplate" description="Event Template" value="${event?.template}" entity="${dbnp.studycapturing.Event}" addDummy="true" ajaxOnChange="switchTemplate" afterSuccess="onPage()" >
     26        <af:templateElement required="true" name="eventTemplate" elementId="eventTemplate" description="Event Template" value="${event?.template}" entity="${dbnp.studycapturing.Event}" addDummy="true" ajaxOnChange="switchTemplate" afterSuccess="onPage()" >
    3327                The template to use for this event
    3428        </af:templateElement>
    35         <af:templateElement name="sampleTemplate" elementId="sampleTemplate" description="Sampling Event Template" value="${event?.template}" entity="${dbnp.studycapturing.SamplingEvent}" addDummy="true" ajaxOnChange="switchTemplate" afterSuccess="onPage()" >
     29        <af:templateElement  required="true" name="sampleTemplate" elementId="sampleTemplate" description="Sampling Event Template" value="${event?.template}" entity="${dbnp.studycapturing.SamplingEvent}" addDummy="true" ajaxOnChange="switchTemplate" afterSuccess="onPage()" >
    3630                The template to use for this sampling event
    3731        </af:templateElement>
     
    7266                  return (event.keyCode != 13);
    7367                });
     68
     69                $('body').addClass('has-js');
     70                $('.label_check, .label_radio').click(function(){
     71                        setupLabel();
     72                });
     73                setupLabel();
    7474        });
     75
     76    function setupLabel() {
     77        if ($('.label_check input').length) {
     78            $('.label_check').each(function(){
     79                $(this).removeClass('c_on');
     80            });
     81            $('.label_check input:checked').each(function(){
     82                $(this).parent('label').addClass('c_on');
     83            });
     84        }
     85        if ($('.label_radio input').length) {
     86            $('.label_radio').each(function(){
     87                $(this).removeClass('r_on');
     88            });
     89            $('.label_radio input:checked').each(function(){
     90                $(this).parent('label').addClass('r_on');
     91            });
     92        }
     93    }
    7594        </script>
    7695
Note: See TracChangeset for help on using the changeset viewer.