Changeset 558 for trunk/grails-app/views/templateEditor/template.gsp
- Timestamp:
- Jun 11, 2010, 4:00:10 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/views/templateEditor/template.gsp
r556 r558 21 21 <script src="${createLinkTo(dir: 'js', file: 'templateEditor.js')}" type="text/javascript"></script> 22 22 <link rel="stylesheet" href="${createLinkTo(dir: 'css', file: 'templateEditor.css')}" /> 23 <g:if env="production"> 24 <script type="text/javascript" src="${resource(dir: 'js', file: 'ontology-chooser.min.js')}"></script> 25 </g:if><g:else> 26 <script type="text/javascript" src="${resource(dir: 'js', file: 'ontology-chooser.js')}"></script> 27 </g:else> 23 28 </head> 24 29 <body> … … 29 34 $("#selectedTemplateFields").sortable({ 30 35 placeholder: 'ui-state-highlight', 36 items: 'li:not(.domain)', 31 37 cancel: '.empty, input, select, button, textarea, form, label', 32 38 connectWith: '.templateFields', 33 39 update: updateTemplateFieldPosition, 40 receive: addTemplateFieldEvent, 34 41 remove: removeTemplateFieldEvent, 35 receive: addTemplateFieldEvent42 start: savePosition 36 43 }).disableSelection(); 37 44 … … 40 47 placeholder: 'ui-state-highlight', 41 48 cancel: '.empty, input, select, button, textarea, form, label', 42 connectWith: '.templateFields' 49 connectWith: '.templateFields', 50 start: savePosition 43 51 }).disableSelection(); 44 52 53 54 $("#ontologyDialog").dialog({ 55 autoOpen: false, 56 title: 'Search for ontology', 57 height: 290, 58 width: 350, 59 modal: true, 60 buttons: { 61 'Add': addOntology, 62 Cancel: function() { 63 $(this).dialog('close'); 64 } 65 }, 66 close: function() { 67 } 68 69 }); 70 45 71 }); 46 72 </script> … … 56 82 57 83 <p>Currently, this template contains the following fields. Drag fields to reorder. Drag fields to the list of available fields to remove the field from the template.</p> 58 <ol id="selectedTemplateFields" class="templateFields"> 84 <ol id="domainFields" class="templateFields <g:if test="${template.inUse()}">inUse</g:if>"> 85 <g:render template="elements/domainField" var="domainField" collection="${domainFields}" model="['template':template]"/> 86 </ol> 87 <ol id="selectedTemplateFields" class="templateFields <g:if test="${template.inUse()}">inUse</g:if>"> 88 <g:render template="elements/selected" var="templateField" collection="${template.fields}" model="['template':template]"/> 59 89 <li class="empty ui-state-default" <g:if test="${template.fields?.size() > 0 }">style='display: none;'</g:if>>This template does not yet contain any fields. Drag a field to this list or use the 'Add field button'.</li> 60 <g:render template="elements/selected" collection="${template.fields}" model="['template':template]"/>61 90 </ol> 62 91 </div> … … 67 96 <ol id="availableTemplateFields" class="templateFields"> 68 97 <li class="empty ui-state-default" <g:if test="${allFields.size() > template.fields.size()}">style='display: none;'</g:if>>There are no additional fields that can be added. Use the 'Create new field' button to create new fields.</li> 69 <g:render template="elements/available" collection="${allFields - template.fields}" />98 <g:render template="elements/available" var="templateField" collection="${allFields - template.fields}" /> 70 99 </ol> 71 100 … … 87 116 </g:if> 88 117 118 <div id="ontologyDialog"> 119 <g:render template="ontologyDialog" /> 120 </div> 89 121 90 122 </body>
Note: See TracChangeset
for help on using the changeset viewer.