Changeset 367


Ignore:
Timestamp:
Apr 21, 2010, 5:26:21 PM (14 years ago)
Author:
duh
Message:
  • commented buggy bootstrap code
  • refactored wizard subject page
  • removed wizard:speciesElement from taglibrary
  • changed speciesElement to termElement
  • used SelectAddMore?.js to add dialog functionality to template select elements
  • changed bug report icon
  • added more famfamfam icons
Location:
trunk
Files:
52 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r366 r367  
    303303
    304304                        // Human sample template
     305/* COMMENTED OUT AS IT BREAKS THE WHOLE LOT
    305306                        def humanSampleTemplate = new Template(
    306307                                name: 'Human tissue sample', entity: dbnp.studycapturing.Sample)
     
    362363
    363364
    364                         /*
    365365                        //events
    366366                        def eventDiet = new EventDescription(
     
    403403
    404404                        println('Adding PPS3 study...')
    405                         */
     405
    406406                        // studies
    407407                        def exampleStudy = new Study(
     
    425425                        ).with { if (!validate()) { errors.each { println it} } else save()}
    426426
    427                         /*def evLF = new Event(
     427                        def evLF = new Event(
    428428                                startTime: Date.parse('yyyy-MM-dd','2008-01-07'),
    429429                                endTime: Date.parse('yyyy-MM-dd','2008-01-14'),
  • trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy

    r359 r367  
    155155                        }.to "subjects"
    156156                        on("add") {
    157                                 println params
    158157                                flash.values = params
    159 /*
    160                                 // fetch species by name (as posted by the form)
    161                                 def speciesTerm = Term.findByName(params.addSpecies)
    162                                 def subjectTemplateName = params.get('template')
    163                                 def subjectTemplate     = Template.findByName(subjectTemplateName)
     158                                def speciesTerm = Term.findByName(params.species);
     159                                def subjectTemplateName = params.get('template');
     160                                def subjectTemplate = Template.findByName(subjectTemplateName);
    164161
    165162                                // add this subject template to the subject template array
     
    172169                                }
    173170
    174                                 // add x subject of species y
     171                                // add x subjects of species y
    175172                                (params.addNumber as int).times {
    176173                                        def increment = flow.subjects.size()
     
    188185                                        flow.subjectTemplates[ subjectTemplateName ]['subjects'][ subjectsSize ] = increment
    189186                                }
    190 */
    191187                        }.to "subjects"
    192188                        on("next") {
  • trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy

    r359 r367  
    472472
    473473        /**
    474          * Template form element
    475          * @param Map attributes
    476          * @param Closure help content
    477          */
    478         def speciesElement = {attrs, body ->
    479                 // render template element
    480                 baseElement.call(
    481                         'speciesSelect',
    482                         attrs,
    483                         body
    484                 )
    485         }
    486 
    487         /**
    488          * render a species select element
    489          * @param Map attrs
    490          */
    491         def speciesSelect = {attrs ->
    492                 // fetch the speciesOntology
    493                 // note that this is a bit nasty, probably the ontologyName should
    494                 // be configured in a configuration file... --> TODO: centralize species configuration
    495                 def speciesOntology = Ontology.findByName('NCBI Taxonomy')
    496 
    497                 // fetch all species
    498                 attrs.from = Term.findAllByOntology(speciesOntology)
    499 
    500                 // got a name?
    501                 if (!attrs.name) {
    502                         // nope, use a default name
    503                         attrs.name = 'species'
    504                 }
    505 
    506                 out << select(attrs)
    507         }
    508 
    509         /**
    510474         * Ontology form element
    511475         * @param Map attributes
     
    551515        }
    552516
    553 
    554517        /**
    555518         * render a study select element
     
    581544         */
    582545        def templateElement = {attrs, body ->
     546                // add a rel element if it does not exist
     547                if (!attrs.rel) {
     548                        attrs.rel = 'template'
     549                }
     550               
    583551                // render template element
    584552                baseElement.call(
  • trunk/grails-app/views/common/_feedback.gsp

    r359 r367  
    1616        });
    1717</script>
    18         <img id="add_feedback" src="${resource(dir: 'images', file: 'icons/famfamfam/comment_add.png')}" style="cursor: pointer;" alt="submit feedback for this page" />
     18        <img id="add_feedback" src="${resource(dir: 'images', file: 'icons/famfamfam/bug_add.png')}" style="cursor: pointer;" alt="submit feedback for this page" />
    1919        <div class="feedback" id="feedback">
    2020          <form>
  • trunk/grails-app/views/wizard/pages/_subjects.gsp

    r359 r367  
    5555                                <div class="column"><g:textField name="subject_${subjectId}_name" value="${subjects[ subjectId ].name}" size="12" maxlength="12" /></div>
    5656                                <div class="column">
    57                                         <wizard:speciesSelect value="${subjects[ subjectId ].species}" name="subject_${subjectId}_species" />
     57                                        <wizard:termSelect value="${subjects[ subjectId ].species}" name="subject_${subjectId}_species" ontology="1132" />
    5858                                </div>
    5959                                <wizard:templateColumns id="${subjectId}" template="${subjects[ subjectId ].template}" name="subject_${subjectId}" class="column" subject="${subjects[ subjectId ]}" />                         
  • trunk/web-app/css/default_style.css

    r365 r367  
    260260    font-weight: bold;
    261261}
     262option.modify {
     263    background: url(../images/icons/famfamfam/layout_add.png) no-repeat left top;
     264    background-color: #333;
     265    padding-left: 18px;
     266    height: 16px;
     267    color: #fff;
     268    font-weight: bold;   
     269}
    262270option.locked {
    263271    background: url(../images/icons/famfamfam/lock.png) no-repeat left top;
  • trunk/web-app/js/wizard.js

    r365 r367  
    5454        label   : 'add more...',
    5555        class   : 'addMore',
     56        onClose : function(scope) {
     57            refreshWebFlow();
     58        }
     59    });
     60
     61    // handle template selects
     62    new SelectAddMore().init({
     63        rel     : 'template',
     64        url     : '/gscf/templateEditor',
     65        label   : 'add / modify..',
     66        class   : 'modify',
    5667        onClose : function(scope) {
    5768            refreshWebFlow();
Note: See TracChangeset for help on using the changeset viewer.