Skip to content

Commit

Permalink
#550 hide the Not Supplied result from the collections list
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Collins committed Jan 30, 2024
1 parent 349d487 commit 7f4e680
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions grails-app/views/home/_advanced.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,24 @@
<select class="institution_uid collection_uid form-control" name="institution_collection" id="institution_collection">
<option value=""><g:message code="advancedsearch.table05col01.option01.label" default="-- select an institution or collection --"/></option>
<g:each var="inst" in="${request.getAttribute("institution_uid")}">
<optgroup label="${inst.value}">
<option value="${inst.key}"><g:message code="advancedsearch.table05col01.option02.label" default="All records from"/> ${inst.value}</option>
<g:each var="coll" in="${request.getAttribute("collection_uid")}">
<g:if test="${inst.key == 'in13' && StringUtils.startsWith(coll.value, inst.value)}">
<option value="${coll.key}">${StringUtils.replace(StringUtils.replace(coll.value, inst.value, ""), " - " ,"")} <g:message code="advancedsearch.table05col01.option03.label" default="Collection"/></option>
</g:if>
<g:elseif test="${inst.key == 'in6' && StringUtils.startsWith(coll.value, 'Australian National')}">
<%-- <option value="${coll.key}">${fn:replace(coll.value,"Australian National ", "")}</option> --%>
<option value="${coll.key}">${coll.value}</option>
</g:elseif>
<g:elseif test="${StringUtils.startsWith(coll.value, inst.value)}">
<option value="${coll.key}">${StringUtils.replace(coll.value, inst.value, "")}</option>
</g:elseif>
</g:each>
</optgroup>
%{-- Stops 'Not Supplied' institution from being rendered --}%
<g:if test="${inst.key != "*"}">
<optgroup label="${inst.value}">
<option value="${inst.key}"><g:message code="advancedsearch.table05col01.option02.label" default="All records from"/> ${inst.value}</option>
<g:each var="coll" in="${request.getAttribute("collection_uid")}">
<g:if test="${inst.key == 'in13' && StringUtils.startsWith(coll.value, inst.value)}">
<option value="${coll.key}">${StringUtils.replace(StringUtils.replace(coll.value, inst.value, ""), " - " ,"")} <g:message code="advancedsearch.table05col01.option03.label" default="Collection"/></option>
</g:if>
<g:elseif test="${inst.key == 'in6' && StringUtils.startsWith(coll.value, 'Australian National')}">
<%-- <option value="${coll.key}">${fn:replace(coll.value,"Australian National ", "")}</option> --%>
<option value="${coll.key}">${coll.value}</option>
</g:elseif>
<g:elseif test="${StringUtils.startsWith(coll.value, inst.value)}">
<option value="${coll.key}">${StringUtils.replace(coll.value, inst.value, "")}</option>
</g:elseif>
</g:each>
</optgroup>
</g:if>
</g:each>
</select>
</div>
Expand Down Expand Up @@ -251,4 +254,4 @@
}
})
}
</asset:script>
</asset:script>

0 comments on commit 7f4e680

Please sign in to comment.