clone of github.com/decent-newsroom/newsroom
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

54 lines
2.0 KiB

<div {{ attributes }}>
{% if interactive %}
<form data-live-action-param="search"
data-action="live#action:prevent">
<label class="search">
<input type="search"
placeholder="{{ 'text.search'|trans }}"
data-model="norender|query"
value="{{ this.query }}"
data-controller="search-broadcast"
data-action="input->search-broadcast#onInput"
/>
<button type="submit"
{% if not is_granted('IS_AUTHENTICATED_FULLY') %}disabled{% endif %}
><twig:ux:icon name="iconoir:search" class="icon" /></button>
</label>
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<div style="text-align: right">
<small class="help-text">
<em>{{ 'credit.balance'|trans({'%count%': credits, 'count': credits}) }}</em>
</small>
</div>
{% endif %}
</form>
{% if not is_granted('IS_AUTHENTICATED_FULLY') %}
<div class="notice info mb-5">
<p>Log in to search articles.</p>
<small>Currently only available on desktop.</small>
</div>
{% endif %}
{% if is_granted('IS_AUTHENTICATED_FULLY') and credits == 0 %}
<div class="mb-5">
<twig:GetCreditsComponent />
</div>
{% endif %}
<!-- Loading Indicator -->
<div style="text-align: center">
<div class="spinner" data-loading>
<div class="lds-dual-ring"></div>
</div>
</div>
{% endif %}
<!-- Results -->
{% if this.results is not empty %}
<twig:Organisms:CardList :list="this.results" class="article-list" />
{% elseif this.query is not empty %}
<p><small>{{ 'text.noResults'|trans }}</small></p>
{% endif %}
</div>