Changeset 341


Ignore:
Timestamp:
Apr 14, 2010, 11:36:53 AM (13 years ago)
Author:
duh
Message:
  • refactored wizard start page so that the big green buttons actually work
  • added a new page to load and modify a study, however this page is not yet functional
  • removed obsolete images
Location:
trunk
Files:
2 added
4 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy

    r335 r341  
    7777                                flow.page = 1
    7878                        }
     79                        on("next").to "study"
     80                        on("modify").to "modify"
     81                }
     82
     83                // load a study to modify
     84                modify {
     85                        render(view: "_modify")
     86                        onRender {
     87                                flow.page = 1
     88                                flash.cancel = true
     89                        }
     90                        on("cancel").to "start"
    7991                        on("next") {
    80                                 // NOTE: this action is called by an Ajax
    81                                 //       request rendered in the _start
    82                                 //       template. So for the end user the
    83                                 //       webflow actually starts in the
    84                                 //       study logic...
    85                                 //       This ajax call is required to make
    86                                 //       the ajax flow work correctly
    87                         }.to "study"
     92                                // TODO: loading a study is not yet implemented
     93                                //       create a error stating this feature is
     94                                //       not yet implemented
     95                                flash.errors = [:]
     96                                this.appendErrorMap(
     97                                        ['study': 'Loading a study and modifying it has not yet been implemented. Please press \'cancel\' to go back to the initial page...'],
     98                                        flash.errors
     99                                )
     100                        }.to "modify"
    88101                }
    89102
  • trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy

    r299 r341  
    434434
    435435                out << select(attrs)
     436        }
     437
     438
     439        /**
     440         * Study form element
     441         * @param Map attributes
     442         * @param Closure help content
     443         */
     444        def studyElement = { attrs, body ->
     445                // render study element
     446                baseElement.call(
     447                        'studySelect',
     448                        attrs,
     449                        body
     450                )
     451        }
     452
     453
     454        /**
     455         * render a study select element
     456         * @param Map attrs
     457         */
     458        def studySelect = { attrs ->
     459                // for now, just fetch all studies
     460                attrs.from = Study.findAll()
     461
     462                // got a name?
     463                if (!attrs.name) {
     464                        attrs.name = "study"
     465                }
     466
     467                // got result?
     468                if (attrs.from.size() > 0) {
     469                        out << select(attrs)
     470                } else {
     471                        // no, return false to make sure this element
     472                        // is not rendered in the template
     473                        return false
     474                }
    436475        }
    437476
  • trunk/grails-app/views/wizard/common/_navigation.gsp

    r299 r341  
    1616    <div class="navigation">
    1717      <g:if test="${page>1 && page<pages.size}"><wizard:ajaxButton name="previous" value="&laquo; prev" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" class="prevnext" /></g:if>
    18       <g:if test="${page>1 && page<pages.size}"> | </g:if>
    19       <g:if test="${page<pages.size}"><wizard:ajaxButton name="next" value="next &raquo;" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" class="prevnext" /></g:if>
     18          <g:if test="${cancel}">
     19                [ <wizard:ajaxButton name="cancel" value="cancel" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" class="prevnext" /> ]
     20          </g:if>
     21      <g:elseif test="${page>1 && page<pages.size}">
     22                  |               
     23          </g:elseif>
     24          <g:if test="${page<pages.size}"><wizard:ajaxButton name="next" value="next &raquo;" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" class="prevnext" /></g:if>
    2025    </div>
  • trunk/grails-app/views/wizard/pages/_start.gsp

    r299 r341  
    1717<wizard:pageContent>
    1818
    19         <img src="../images/wizard/wizard-chooser.png" />
     19        <span class="bigtext">What would you like to do?</span>
    2020
    21         <span class="info">
    22                 <span class="todo">TODO</span>
    23                 <ul>
    24                         <li>the buttons above actually do not yet work, it's just a mockup. In this prototype you can only create
    25                             a study; modifying a study will be implemented later. Click 'next' to continue...</li>
    26                 </ul>
    27         </span>
     21        <wizard:ajaxButton name="next" class="bigbutton" value="Create a new study" alt="Create a new study" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" />
     22
     23        <wizard:ajaxButton name="modify" class="bigbutton" value="Modify an existing study" alt="Modify an existing study" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" />
    2824
    2925        <span class="info">
  • trunk/web-app/css/wizard.css

    r262 r341  
    262262}
    263263/* END :: TABLE */
     264
     265/* START :: BIG BUTTONS and BIG TEXT */
     266.wizard .bigbutton {
     267    background: url(../images/wizard/big-button.jpg) no-repeat left top;
     268    border: 0px;
     269    width: 454px;
     270    height: 53px;
     271    color: #fff;
     272    font-size: 18pt;
     273}
     274.wizard .bigbutton:hover {
     275    color: #000;
     276}
     277.wizard .bigtext {
     278    color: #006dba;
     279    font-weight: normal;
     280    font-size: 24px;
     281    margin: .8em 0 .3em 0;
     282    display: block;
     283    width: 100%;
     284    text-align: center;
     285}
     286/* END :: BIG BUTTONS and BIG TEXT */
Note: See TracChangeset for help on using the changeset viewer.