move search logic to frontend
This commit is contained in:
parent
783ac823ba
commit
98f50a2b6f
18 changed files with 330 additions and 76 deletions
63
resources/views/frontend/partials/simpleSearchForm.blade.php
Normal file
63
resources/views/frontend/partials/simpleSearchForm.blade.php
Normal file
|
@ -0,0 +1,63 @@
|
|||
<div class="sidebar-simplesearch">
|
||||
{!! Form::open(array('route' => 'frontend.queries','method' => 'POST', 'class'=>'pure-form')) !!}
|
||||
|
||||
|
||||
|
||||
{!! Form::text('query', null, array('class'=>'pure-input-1', 'placeholder'=>'Search for a dataset...')) !!}
|
||||
|
||||
<!--<div id="edit-submit-search-wrapper" class="form-item">
|
||||
<span class="form-submit-wrapper">
|
||||
<input type="submit" id="edit-submit-search" class="form-submit" value="Search" />
|
||||
</span>
|
||||
</div>-->
|
||||
<button type="submit">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
|
||||
<p class="footer-link">
|
||||
<?php
|
||||
$searchAllDocsText = Illuminate\Support\Facades\Lang::get('resources.solrsearch_title_alldocs');
|
||||
if (isset($totalNumOfDocs))
|
||||
{
|
||||
$searchAllDocsText = $searchAllDocsText . ' (<span id="solrsearch-totalnumofdocs">' . $totalNumOfDocs . '</span>)';
|
||||
}
|
||||
?>
|
||||
|
||||
<a id="link-solrsearch-all-documents" class="link" href="{{ URL::route('frontend.queries1',['searchtype' => 'all']) }}"><?= $searchAllDocsText; ?>
|
||||
</a>
|
||||
<!--<a class="link" href="">'resources.solrsearch_title_latest'</a>-->
|
||||
|
||||
<a href="" class="rss" type="application/rss+xml">
|
||||
<img src="{{ URL::asset('/img/feed_small.png' )}}" width="12" height="12" alt="{{ Lang::get('resources.rss_icon')}}" title="@lang('resources.rss_title')" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<input type="hidden" name="searchtype" id="searchtype" value="simple" />
|
||||
<input type="hidden" name="start" id="start" value="0" />
|
||||
<input type="hidden" name="sortfield" id="sortfield" value="score" />
|
||||
<input type="hidden" name="sordorder" id="sortorder" value="desc" />
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.sidebar-simplesearch {
|
||||
position: relative;
|
||||
margin-bottom: 2.5em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.sidebar-simplesearch input[type=text] {
|
||||
padding: 0.25em 0.3em;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.sidebar-simplesearch button {
|
||||
padding: 0.25em 0.3em;
|
||||
border: none;
|
||||
background: none;
|
||||
position: absolute;
|
||||
right: 0.25em;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
75
resources/views/frontend/solrsearch/index.blade.php
Normal file
75
resources/views/frontend/solrsearch/index.blade.php
Normal file
|
@ -0,0 +1,75 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('title', Lang::get('resources.solrsearch_title_simple'))
|
||||
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="pure-g">
|
||||
|
||||
<div class="pure-u-1 pure-u-md-2-3">
|
||||
<div class="content">
|
||||
<h1>Suche</h1>
|
||||
@include('frontend.partials.simpleSearchForm')
|
||||
|
||||
<div id="searchbar">
|
||||
@if (isset($results))
|
||||
<div id="search_results" class="plugin-simplesearch-result search_results">
|
||||
@foreach($results as $result)
|
||||
<div class="result">
|
||||
<dt class="results_title">
|
||||
@if (!is_null($result->getAsset( 'abstract_output' )))
|
||||
<img src="../img/theme/icon-on-off.png" alt="results_hideabstract_alt" onclick="$(function(){$('#abstractText_{{ $result->getId() }}').toggle();});" />
|
||||
@endif
|
||||
|
||||
@if (!is_null($result->getAsset('title_output')))
|
||||
<a href="{{ route('frontend.dataset.show', $result->getId()) }}">
|
||||
{{ $result->getAsset('title_output') }}
|
||||
</a>
|
||||
@else
|
||||
<a>results_missingtitle</a>
|
||||
@endif
|
||||
|
||||
@if ($result->getAsset('year'))
|
||||
<span>( {{ $result->getAsset('year') }} )</span>
|
||||
@endif
|
||||
</dt>
|
||||
|
||||
|
||||
@if (!is_null($result->getAsset('author')))
|
||||
<dt class="results_author">
|
||||
@foreach($result->getAsset('author') as $authorIndex => $author)
|
||||
<a>{{ htmlspecialchars($author)}}</a>
|
||||
@endforeach
|
||||
</dt>
|
||||
@endif
|
||||
|
||||
<dt class="abstractText" id="abstractText_{{ $result->getId() }}">
|
||||
{{ htmlspecialchars($result->getAsset('abstract_output')) }}
|
||||
</dt>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('frontend.solrsearch.pagination')
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('.abstractText').hide();
|
||||
});
|
||||
</script>
|
||||
@endsection
|
21
resources/views/frontend/solrsearch/pagination.blade.php
Normal file
21
resources/views/frontend/solrsearch/pagination.blade.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* pagnination short summary.
|
||||
*
|
||||
* pagnination description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author kaiarn
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="results_pagination">
|
||||
<?php if(isset($numOfHits)): ?>
|
||||
<p class="info_small">
|
||||
<strong>
|
||||
<?php echo($numOfHits) ?>
|
||||
</strong>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue