Changeset 372


Ignore:
Timestamp:
Apr 22, 2010, 3:45:22 PM (13 years ago)
Author:
duh
Message:
  • css changes
  • termEditor changes
  • templateEditor changes
  • etc
Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/application.properties

    r369 r372  
    99plugins.jquery=1.4.1.1
    1010plugins.mail=0.9
    11 #plugins.nadd-neutralizer=0.1
     11plugins.nadd-neutralizer=0.1
    1212plugins.nimble=0.3-SNAPSHOT
    1313plugins.searchable=0.5.5
  • trunk/grails-app/controllers/dbnp/studycapturing/TemplateEditorController.groovy

    r359 r372  
    1414 */
    1515package dbnp.studycapturing
     16import dbnp.data.*
     17import dbnp.studycapturing.*
    1618
    1719class TemplateEditorController {
     
    2022         */
    2123    def index = {
    22                 // got a template get parameter?
    23                 def template = (params.template) ? params.template : null
     24                // got a entity get parameter?
     25                def entity = null
     26                if (params.entity) {
     27                        // decode entity get parameter
     28                        entity = new String(params.entity.toString().decodeBase64())
     29                }
    2430
    25                 // enter the flow!
    26         redirect(action: 'pages', params:["template":template])
     31                // got with the flow!
     32        redirect(action: 'pages', params:["entity":entity])
    2733    }
    2834
     
    3339                // start the flow
    3440                onStart {
    35                         println "start template editor flow"
     41                        println params
     42                        if (params.entity) {
     43                                //def name = params.entity
     44                                //def name = "java.lang.Integer"
     45                                //println name.class
     46                                //def S = new dbnp.studycapturing.Study()
    3647
    37                         if (params.template) {
    38                                 flow.template = template
     48                                //def name = "dbnp.studycapturing.Study" as Class
     49                                //println name.newInstance()
     50                                println Class.forName(new GString("dbnp.studycapturing.Study"))
     51                                //flow.entity = (name as Class).newInstance()
     52                                //flow.templates = Template.findAllByEntity(flow.entity)
     53                        } else {
     54                                // all templates for all entities; note that normally
     55                                // this shouldn't happen as this flow is designed to
     56                                // launch in a jquery dialog, passing an encoded entity
     57                                flow.templates = Template.findAll()
    3958                        }
     59                        flow.templates = Template.findAll()
    4060                }
    4161
    4262                // main template editor page
    4363                templates {
    44                         render(view: "/templateEditor/templates", collection:[templates: Template.findAll()])
     64                        render(view: "/templateEditor/templates")
    4565                        onRender {
    4666                                println "render templates"
    47                                 println Template.findAll()
    4867                        }
    4968                        on("next").to "start"
  • trunk/grails-app/controllers/dbnp/studycapturing/TermEditorController.groovy

    r359 r372  
    5353                }
    5454
    55                 // main template editor page
    56                 templates {
     55                // main term editor page
     56                terms {
    5757                        render(view: "/termEditor/terms")
    5858                        onRender {
  • trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy

    r367 r372  
    563563        def templateSelect = {attrs ->
    564564                def entity = attrs.remove('entity')
     565
     566                // add the entity class name to the element as
     567                // a base64 encoded string.
     568                // TODO: encrypt this, instead of using base64!
     569                //       As this class is instantiated elsewhere
     570                //       this is a security hazard!
     571                //               @see TemplateEditorController
     572                attrs['entity'] = entity.toString().replaceAll(/^class /,'').bytes.encodeBase64()
    565573
    566574                // fetch templates
  • trunk/grails-app/views/layouts/dialog.gsp

    r359 r372  
    55 <head>
    66  <title><g:layoutTitle default="Grails"/></title>
     7  <link rel="stylesheet" href="${resource(dir: 'css', file: 'dialog.css')}"/>
    78  <g:javascript library="jquery"/>
    89  <script src="${createLinkTo(dir: 'js', file: 'jquery-ui-1.8rc3.custom.min.js')}" type="text/javascript"></script>
  • trunk/grails-app/views/templateEditor/templates.gsp

    r359 r372  
     1<%
     2        /**
     3         * Template Editor overview template
     4         *
     5         * @author Jeroen Wesbeek
     6         * @since 20100422
     7         * @package wizard
     8         * @see dbnp.studycapturing.TemplateEditorController
     9         *
     10         * Revision information:
     11         * $Rev$
     12         * $Author$
     13         * $Date$
     14         */
     15%>
    116<%@ page contentType="text/html;charset=UTF-8" %>
    217<html>
     
    621 </head>
    722 <body>
    8  hoi
     23 templates for entity: ${entity}<br/>
     24
     25 <g:if test="${templates}">
     26  <g:each in="${templates}">
     27     ${it}<br/>
     28  </g:each>
     29 </g:if>
    930 
    10  <g:each in="${templates}">
    11      ${it}<br/>
    12  </g:each>
    13 
    1431 </body>
    1532</html>
  • trunk/grails-app/views/termEditor/terms.gsp

    r359 r372  
     1<%
     2        /**
     3         * Term Editor overview template
     4         *
     5         * @author Jeroen Wesbeek
     6         * @since 20100422
     7         * @package wizard
     8         * @see dbnp.studycapturing.TermEditorController
     9         *
     10         * Revision information:
     11         * $Rev$
     12         * $Author$
     13         * $Date$
     14         */
     15%>
    116<%@ page contentType="text/html;charset=UTF-8" %>
    217<html>
    318 <head>
    4   <meta name="layout" content="dialog"/>
    5   <title>my bla</title>
     19  <meta name="layout" content="dialog"/><g:if env="production"></g:if>
     20  <script type="text/javascript" src="${resource(dir: 'js', file: 'ontology-chooser.min.js')}"></script>
     21</g:if><g:else>
     22  <script type="text/javascript" src="${resource(dir: 'js', file: 'ontology-chooser.js')}"></script>
     23</g:else>
    624 </head>
    725 <body>
  • trunk/web-app/js/SelectAddMore.js

    r371 r372  
    104104                    height  : height,
    105105                    modal   : true,
     106                    buttons : {
     107                                Ok  : function() { $(this).dialog('close'); }
     108                              },
    106109                    close   : function() {
    107110                        onClose(this);
  • trunk/web-app/js/wizard.js

    r367 r372  
    6363        rel     : 'template',
    6464        url     : '/gscf/templateEditor',
     65        vars    : 'entity',
    6566        label   : 'add / modify..',
    6667        class   : 'modify',
Note: See TracChangeset for help on using the changeset viewer.