summaryrefslogtreecommitdiffstats
path: root/idrop-web/grails-app/views/rule/_ruleDetails.gsp
blob: 96c526da96ff0d62568f4f7bf010415a500218dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

<g:if test="${flash.error}">
                <script>
                $(function() { setErrorMessage("${flash.error}"); });
                </script>
              </g:if>

              <g:if test="${flash.message}">
                <script>
                $(function() { setMessage("${flash.message}");});
                </script>
              </g:if>
              
              
<div id="addParamDialogDiv">
<!--  area for hanging dialogs -->
</div>
              
<g:form name="ruleDetailsForm" id="ruleDetailsForm">
  <fieldset>
    <label></label>
   <g:textArea id="ruleBody" name="ruleBody" value="${rule.ruleBody}" rows="80" cols="100"/>
  
  <g:hiddenField name="ruleAbsPath" value="${absPath}" id="ruleAbsPath"/>
   	
   	<table class="table alert alert-info">
   	 <caption><g:message code="text.input.parameters"/></caption>
   	
	<g:each in="${rule.inputParameters}">
	
		<tr>
			<g:hiddenField name="inputParamName" value="${it.uniqueName}" id="inputParamName"/>
			<td>${it.uniqueName}</td>
			<td><g:textField name="inputParamValue" id="inputParamValue" value="${it.getStringValue()}" size="80"/></td>
			<td><i class='icon-remove' onclick='deleteInputParam(${"\"" + it.uniqueName + "\""})'></i></td>	
		</tr>
	
	</g:each>   
   </table>
   <div id="inputParamsToolbar" >
			<button type="button" id="addInputParameterButton" 
				value="addInputParameter"
				onclick="callAddInputParameter()">
				<i class="icon-plus"></i><g:message code="text.add.input.parm" />
			</button>
	</div>
	
   
   <br/>
   	<table class="table alert alert-info">
   	 <caption><g:message code="text.output.parameters"/></caption>
   	
	<g:each in="${rule.outputParameters}">
		<tr>
			<g:hiddenField name="outputParamName" value="${it.uniqueName}" id="outputParamName"/>
			<td>${it.uniqueName}</td>
			<td><i class='icon-remove' onclick='deleteOutputParam(${"\"" + it.uniqueName + "\""})'></i></td>	
		</tr>
	
	</g:each>   
   
   </table>
    <div id="outputParamsToolbar" >
			<button type="button" id="addOutputParameterButton" 
				value="addOutputParameter"
				onclick="callAddOutputParameter()">
				<i class="icon-plus"></i><g:message code="text.add.output.parm" />
			</button>
	</div>
   
  </fieldset>
</g:form>
<script type="text/javascript">

var editor = null;
$(function() {
   /* var myCodeMirror = CodeMirror.fromTextArea(document.getElementById('ruleBody'),{
        mode: 'clike',
        lineNumbers: true,
        theme: "blackboard"
      }); */

	var uiOptions = { path : 'js/', searchMode: 'popup' }
	var codeMirrorOptions = {
    		    mode: 'text/x-rule',
    	        lineNumbers: true,
    	        theme: "eclipse"
	}

	//then create the editor
	editor = new CodeMirrorUI(document.getElementById('ruleBody'),uiOptions,codeMirrorOptions);

});
</script>