summaryrefslogtreecommitdiffstats
path: root/idrop-web/grails-app/views/rule
diff options
context:
space:
mode:
authormconway <michael_conway@unc.edu>2013-10-22 20:53:50 (GMT)
committer mconway <michael_conway@unc.edu>2013-10-22 20:53:50 (GMT)
commiteb972553a6f4f3ddbd7e1837b9e00e033a9ba5c7 (patch)
tree5906cc044be862bc7daf619d7c108fbb5068701f /idrop-web/grails-app/views/rule
parentf891433d0a168c8f8936360d43bfd3165ab16db0 (diff)
downloadQCG-Data-eb972553a6f4f3ddbd7e1837b9e00e033a9ba5c7.zip
QCG-Data-eb972553a6f4f3ddbd7e1837b9e00e033a9ba5c7.tar.gz
QCG-Data-eb972553a6f4f3ddbd7e1837b9e00e033a9ba5c7.tar.bz2
[#1458] rule edit panel
Diffstat (limited to 'idrop-web/grails-app/views/rule')
-rw-r--r--idrop-web/grails-app/views/rule/_ruleDetails.gsp54
-rwxr-xr-xidrop-web/grails-app/views/rule/index.gsp52
2 files changed, 79 insertions, 27 deletions
diff --git a/idrop-web/grails-app/views/rule/_ruleDetails.gsp b/idrop-web/grails-app/views/rule/_ruleDetails.gsp
new file mode 100644
index 0000000..cc1cc18
--- /dev/null
+++ b/idrop-web/grails-app/views/rule/_ruleDetails.gsp
@@ -0,0 +1,54 @@
+
+<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>
+
+<g:form name="ruleDetailsForm" id="ruleDetailsForm">
+ <fieldset>
+ <label><g:message code="text.rule.body" /></label>
+ <g:textArea id="ruleBody" name="ruleBody" value="${rule.ruleBody}" rows="40" cols="100"/>
+
+ <g:hiddenField name="ruleAbsPath" value="${absPath}" id="ruleAbsPath"/>
+
+ <table class="table">
+ <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.getValueAsStringWithQuotesStripped()}" size="80"/></td>
+ <td><i class='icon-remove' onclick='deleteInputParam(${it.uniqueName})'></i></td>
+ </tr>
+
+ </g:each>
+ </table>
+
+ <br/>
+ <table class="table">
+ <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>
+
+ </fieldset>
+</g:form>
+ \ No newline at end of file
diff --git a/idrop-web/grails-app/views/rule/index.gsp b/idrop-web/grails-app/views/rule/index.gsp
index d29a0c7..ef81d30 100755
--- a/idrop-web/grails-app/views/rule/index.gsp
+++ b/idrop-web/grails-app/views/rule/index.gsp
@@ -18,37 +18,35 @@
<div id="ruleDetailDiv">
<!-- div for audit table -->
-
-<g:form name="ruleDetailsForm" id="ruleDetailsForm">
- <fieldset>
- <label><g:message code="text.rule.body" /></label>
- <g:textArea name="ruleBody" value="${rule.ruleBody}" rows="40" cols="100"/>
-
-
- <table class="table">
-
- <g:each in="${rule.inputParameters}">
-
- <tr>
- <g:hiddenField name="paramName" value="${it.uniqueName}" id="paramName"/>
- <td>${it.uniqueName}</td>
- <td><g:textField name="parmValue" id="parmValue" value="${it.getValueAsStringWithQuotesStripped()}" size="80"/></td>
- <td><i class='icon-remove' onclick='deleteParam(${it.stringValue})'></i></td>
- </tr>
-
- </g:each>
-
- </table>
-
- </fieldset>
-</g:form>
-
+ <g:render template="/rule/ruleDetails" />
</div>
<script type="text/javascript">
- function deleteParam(param) {
- alert("param:" + param);
+ function deleteInputParam(param) {
+ alert("input param:" + param);
+ }
+
+
+ function deleteOutputParam(param) {
+ alert("output param:" + param);
+ }
+
+ function callSaveRule() {
+ var formData = $("#ruleDetailsForm").serializeArray();
+ var jqxhr = $.post(context + "/rule/updateRule", formData, "html").success(
+ function(returnedData, status, xhr) {
+ var continueReq = checkForSessionTimeout(returnedData, xhr);
+ if (!continueReq) {
+ return false;
+ }
+ setMessage("rule saved");
+ $("#ruleDetailDiv").html(returnedData);
+ }).error(function(xhr, status, error) {
+ setErrorMessage(xhr.responseText);
+ });
+
+
}