summaryrefslogtreecommitdiffstats
path: root/idrop-web/grails-app/views/metadataSearch/index.gsp
blob: 734b9d6ab8a7f0034e1a41492465cb14379d486c (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<head>
  <meta name="layout" content="mainNoSidebar" />
<g:javascript library="mydrop/metadata"/>
<g:javascript library="mydrop/metaFiltering"/>
<g:javascript library="mydrop/search" />
<g:javascript library="mydrop/tag" />
<g:javascript library="mydrop/home" />

</head>



<ul class="nav nav-tabs" id="searchTabs">
  <li><a href="#metaQueryTab">Query</a></li>
  <li><a href="#resultsTab">Results</a></li>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="metaQueryTab">
    <div class="row-fluid">
      <div class="span2">
        <div class="nav-header">Help</div>
        <div class="metaHelp">
          <p>
            To search by metadata please enter some conditions to inputs. One table limited by the lines is one condition node.
            In this node you can enter as much queries as you want to. Additionaly, you can connect them by option choosing suitable 
            radiobutton. The nodes of conditions can also be connected, by "AND" - then the result will have to fulfill EVERY conditions
            node according to the chosen option - or "OR" - at least one node. To add new query, press "ADD CONDITION", to delete it 
            "DELETE" , to add new node "New condition node", to delete node press the "X" button in the right corner of chosen table. 
            Eventually, to search by entered queries press "SEARCH" and be satisfied by results!
          </p>
        </div>

      </div>
      <div class="span9">
        <g:form id="avuQuery" method="post" controller="metadataSearch"
                action="search" class="">
          <table class="filterMetaTable" id="filterTab1">
            <thead>
              <tr>
                <th colspan="2">

                </th>
                <th colspan="3">
                  <input type="button" class="deleteNodeBtn" id="del" disabled value="X">
                </th>
              </tr>
              <tr>
                <th colspan="2">
                  <input type="radio" value="Every" name="AVUNodes[0].andOr" checked>
                  <label class="labelRadio"> Every condition fulfilled </label>
                </th>
                <th colspan="3">
                  <input type="radio" value="One" name="AVUNodes[0].andOr">
                  <label class="labelRadio"> At least one condition fulfilled</label>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr id="filterRow0">
                <!-- <td colspan="2">
                <!--   <form class="formMeta">
                     <div class="singleFilter"> -->
                <td> <div class="meta-header"> Attribute </div>
                  <input name="attr" type="text" autocomplete="off">
                </td>
                <!-- </div>
                 <div class="singleFilter"> -->
                <td>
                  <div class="meta-header"> Operator</div>
                  <select name="op" class="metaOperator"> 
                    <option> = </option> 
                    <option> > </option>
                    <option> < </option>
                    <option> >= </option>
                    <option> <= </option>
                    <option> <> </option>
                    <option> like </option>
                    <option> not like </option>
                  </select> 
                </td>
                <!--</div>
                 <div class="singleFilter"> -->
                <td> <div class="meta-header"> Value </div>
                  <input name="val" type="text" autocomplete="off">
                </td>
                <td> <div class="meta-header"> Unit </div>
                  <input name="unit" type="text" autocomplete="off">
                </td>
                <!--</div>
                 <div class="singleFilter">-->
                <td>
                  <br>
                  <input type='button' class="delConditionBtn"  value='DELETE' disabled>
                </td>
                <!--</div>
               </form>-->
                <!--  </td> -->
              </tr>
            </tbody>
            <tfoot>
              <tr>
                <td colspan ="2">
                  <input type="button" class="addConditionBtn" value="ADD CONDITION">
                </td>
              </tr>
            </tfoot>
          </table>

          <div><input type="button" id="newNodeBtn" value="New conditions node"></div>
        </g:form>
        <div><button id="searchBtn" onclick="processMetadataQuery()">SEARCH</button></div>


      </div>
    </div>
  </div>  
  <div class="tab-pane" id="resultsTab">
    <div id="resultsTabInner">Search Results here</div>

  </div>

</div>

<script>
        $(document).ready(function() {

                $.ajaxSetup({
                        cache : false
                });
                $("#topbarSearch").addClass("active");

                $('#searchTabs a').click(function (e) {

                          e.preventDefault();
                          $(this).tab('show');
                          var state = {};
                          var tabId = this.hash
                          state["tab"] = tabId;
                          $.bbq.pushState(state);
                });

                 $(window).bind( 'hashchange', function(e) {
             processTagSearchStateChange( $.bbq.getState());
                });

                  $(window).trigger( 'hashchange' );

			
        });


        //function addAVUTriplet() {
		
		
        //}
	
</script>