Skip to content

Instantly share code, notes, and snippets.

@ghettocounselor
Created July 7, 2009 03:28
Show Gist options
  • Save ghettocounselor/141864 to your computer and use it in GitHub Desktop.
Save ghettocounselor/141864 to your computer and use it in GitHub Desktop.
[@main_template]
[#include "/assessment_macros"]
[#include "/pager_macros"]
[#include "/SearchForm_custom_header"]
[#include "/SearchForm_Results"]
[#include "/SearchForm_Mobile_Results"]
[#assign searchView = viewResolver.getView("Search")]
[#assign searchForm = context.componentStorage.getApplicationByIdentity("applicationTest").getChildByIdentity("SearchFormCustom")]
[#assign currentSearch = request.search!{}]
[#assign assessment = currentSearch]
[#assign isLocked = false]
<script type="text/javascript">
function refresh(){} // Stub refresh so components don't cause javascript errors. KERL is not supported on search forms (yet?) so this doesn't need to do anything
</script>
[#assign results = searchView.results] [#-- Executes the current search based on the request --]
[#assign mapping = searchForm.vocabComponentMapping]
[#assign pagerView = viewResolver.getView("Pager")]
[#assign pager = pagerView.getPager( results, 30 )]
<a name="results"/>
<form method="POST" action="${here.domainURL}/SearchForm_csv">
<input type="hidden" name="search_form_uid" value="${here.get('component').UID}"/>
[#list currentSearch?keys as key]
[#assign value = currentSearch[key]!]
[#if value?has_content]
[#if value?is_sequence]
[#list value as item]
<input type="hidden" name="search.${key?html}:record:list" value="${item?html}"/>
[/#list]
[#else]
<input type="hidden" name="search.${key?html}:record" value="${value?html}"/>
[/#if]
[/#if]
[/#list]
[#if ! isMobile]
<div class="field">
<input type="submit" value="Export as CSV"/>
</div>
[/#if]
</form>
[#if isMobile]
[@mobile_search_results results/]
[#else]
[@search_results results/]
[/#if]
<script type="text/javascript">location.hash="results"</script>
[/@main_template]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment