Ignore:
Timestamp:
Jun 1, 2011, 4:05:21 PM (9 years ago)
Author:
robert@…
Message:

Improvements in querying in order to be able to refine searches in a module.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/advancedQuery/_resultbuttons.gsp

    r1798 r1908  
     1<%
     2        def refineActions = actions.findAll { it.type == "refine" };
     3        def otherActions = actions.findAll { it.type != "refine" };
     4%>
    15<p class="options multiple">
    26        <g:if test="${search.getNumResults() == 0}">
     
    812        <br />
    913       
     14        <g:each in="${refineActions}" var="action">
     15                <g:if test="${search.getNumResults() == 0}">
     16                        <a href="#" onClick="return false;" class="refineSearch ${action.name} disabled">${action.description}</a>
     17                </g:if>
     18                <g:else>
     19                        <a class="refineSearch ${action.name}" href="${action.url}" onClick="performAction( $('form#results'), '${action.name.encodeAsJavaScript()}', '${action.module.encodeAsJavaScript()}', '${action.submitUrl.encodeAsJavaScript()}', true ); return false;">${action.description}</a>
     20                </g:else>
     21                <br />
     22        </g:each>
     23       
    1024        <g:link class="search" action="index">Search again</g:link><br />
    1125        <g:link class="discard" action="discard" id="${queryId}">Discard results</g:link><br />
     
    1327</p>
    1428<p class="options multiple">
    15         <g:each in="${actions}" var="action">
     29        <g:each in="${otherActions}" var="action">
    1630                <g:if test="${search.getNumResults() == 0}">
    1731                        <a href="#" onClick="return false;" class="performAction ${action.name} disabled">${action.description}</a>
    1832                </g:if>
    1933                <g:else>
    20                         <a class="performAction ${action.name}" href="${action.url}" onClick="performAction( $('form#results'), '${action.name}', '${action.module}', '${action.submitUrl}' ); return false;">${action.description}</a>
     34                        <a class="performAction ${action.name}" href="${action.url}" onClick="performAction( $('form#results'), '${action.name.encodeAsJavaScript()}', '${action.module.encodeAsJavaScript()}', '${action.submitUrl.encodeAsJavaScript()}' ); return false;">${action.description}</a>
    2135                </g:else>
    2236                <br />
Note: See TracChangeset for help on using the changeset viewer.