1 | <%@ page import="dbnp.query.*" %> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
---|
5 | <meta name="layout" content="main"/> |
---|
6 | <title>Previous queries</title> |
---|
7 | <link rel="stylesheet" href="<g:resource dir="css" file="advancedQuery.css" />" type="text/css"/> |
---|
8 | <g:javascript src="advancedQueryResults.js" /> |
---|
9 | <script type="text/javascript"> |
---|
10 | function searchWithinResults( form ) { |
---|
11 | submitForm( form, '/advancedQuery/searchIn' ); |
---|
12 | } |
---|
13 | function discardResults( form ) { |
---|
14 | submitForm( form, '/advancedQuery/discard' ); |
---|
15 | } |
---|
16 | function combineResults( form ) { |
---|
17 | submitForm( form, '/advancedQuery/combine' ); |
---|
18 | } |
---|
19 | </script> |
---|
20 | |
---|
21 | </head> |
---|
22 | <body> |
---|
23 | |
---|
24 | <h1>Previous queries</h1> |
---|
25 | |
---|
26 | <g:if test="${flash.error}"> |
---|
27 | <div class="errormessage"> |
---|
28 | ${flash.error.toString().encodeAsHTML()} |
---|
29 | </div> |
---|
30 | </g:if> |
---|
31 | <g:if test="${flash.message}"> |
---|
32 | <div class="message"> |
---|
33 | ${flash.message.toString().encodeAsHTML()} |
---|
34 | </div> |
---|
35 | </g:if> |
---|
36 | |
---|
37 | <g:if test="${searches.size() > 0}"> |
---|
38 | <form id="searchform" method="post"> |
---|
39 | <table id="searchresults" class="paginate"> |
---|
40 | <thead> |
---|
41 | <tr> |
---|
42 | <th class="nonsortable"><input type="checkbox" id="checkAll" onClick="checkAllPaginated(this);" /></th> |
---|
43 | <th>#</th> |
---|
44 | <th>Type</th> |
---|
45 | <th>Criteria</th> |
---|
46 | <th># results</th> |
---|
47 | <th>time</th> |
---|
48 | <th class="nonsortable"></th> |
---|
49 | <th class="nonsortable"></th> |
---|
50 | </tr> |
---|
51 | </thead> |
---|
52 | <g:each in="${searches}" var="search"> |
---|
53 | <tr> |
---|
54 | <td><g:checkBox name="id" value="${search.id}" checked="${false}" onClick="updateCheckAll(this);" /></td> |
---|
55 | <td>${search.id}</td> |
---|
56 | <td>${search.entity}</td> |
---|
57 | <td> |
---|
58 | <g:each in="${search.getCriteria()}" var="criterion" status="j"> |
---|
59 | <g:if test="${j > 0}">, </g:if> |
---|
60 | <span class="entityfield">${criterion.entityField()}</span> |
---|
61 | <span class="operator">${criterion.operator}</span> |
---|
62 | <span class="value"> |
---|
63 | <g:if test="${criterion.value instanceof Search}"> |
---|
64 | <g:link action="show" id="${criterion.value.id}">${criterion.value}</g:link> |
---|
65 | </g:if> |
---|
66 | <g:else> |
---|
67 | ${criterion.value} |
---|
68 | </g:else> |
---|
69 | </span> |
---|
70 | </g:each> |
---|
71 | </td> |
---|
72 | <td>${search.getNumResults()}</td> |
---|
73 | <td><g:formatDate date="${search.executionDate}" format="HH:mm" /></td> |
---|
74 | <td><g:link action="show" id="${search.id}"><img border="0" src="${fam.icon(name: 'application_form_magnify')}" alt="Show" /></g:link> |
---|
75 | <td><g:link action="discard" id="${search.id}"><img border="0" src="${fam.icon(name: 'basket_remove')}" alt="Discard" /></g:link> |
---|
76 | </tr> |
---|
77 | </g:each> |
---|
78 | </table> |
---|
79 | </form> |
---|
80 | </g:if> |
---|
81 | |
---|
82 | <p class="options"> |
---|
83 | <a href="#" class="combine" onClick="combineResults( $( '#searchform' ) ); return false;">Combine results</a> |
---|
84 | <a href="#" class="searchIn" onClick="searchWithinResults( $( '#searchform' ) ); return false;">Search within results</a> |
---|
85 | <g:link class="search" action="index">Search again</g:link> |
---|
86 | <a href="#" class="discard" onClick="discardResults( $( '#searchform' ) ); return false;">Discard results</a> |
---|
87 | </p> |
---|
88 | <br clear="all" /> |
---|
89 | </body> |
---|
90 | </html> |
---|