<%
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
%>
<div id="variables">
<div class="clear">
<%=link_to '[clear constraints]', :action => 'clear'%>
</div>
<div>
Queries:
<div id="queries">
<% @flare.queries.each_with_index do |q,i| %>
<%=link_to q[:negative] ? "-" : '+', :action => :invert_query, :index => i%>
<span id="query_<%=i%>"><%=q[:query]%></span>
<%= in_place_editor "query_#{i}", :url=> url_for(:action=>"update_query", :index=>i) %>
<%=link_to image_tag("x-close.gif"), :action => :remove_query, :index => i %><br/>
<% end %>
</div>
</div>
<div>
Filters:
<div id="filters">
<% @flare.filters.each_with_index do |filter, i| %>
<%=link_to filter[:negative] ? "-" : "+", :action => :invert_filter, :index => i%>
<%=filter[:field]%>:<%=filter[:value]%>
<%=link_to image_tag("x-close.gif"), :action => :remove_filter, :index => i %>
<% end %>
</div>
</div>
<div class="clear">
<%=link_to '[clear constraints]', :action => 'clear'%>
</div>
</div>
<h1><%=params[:field]%></h1>
<% @facets.each do |f| %>
<% if f.name %>
<%= link_to f.name, :action => 'add_filter', :field => params[:field], :value => f.name %> (<%=f.value%>)
<% else %>
<%= link_to '---- NO VALUE ----', :action => 'add_filter', :field => params[:field], :value => "[* TO *]", :negative => true %> (<%=f.value%>)
<% end %>
<% end%>