Skip to content

Commit

Permalink
Merge branch 'release/v6.3.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
artistro08 committed Feb 18, 2023
2 parents ea9938b + 009beee commit c3f01f6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 47 deletions.
40 changes: 1 addition & 39 deletions pages/page.htm
Original file line number Diff line number Diff line change
Expand Up @@ -72,45 +72,7 @@ <h1>{{ page.title }}</h1>
{% if page.entry_type == 'search' %}
{% if settings.enable_search == true %}
{% set searchTerms = get() %}
<header class="hero bg-dark overflow-hidden d-flex align-items-center text-light position-relative py-4 mb-4">
<div class="container position-relative" style="z-index: 1">
<div class="row">
<div class="col-12 text-center">
<h1 class="mb-4">Search Results for "{{ searchTerms.term }}"</h1>
</div>
<div class="row">
<div class="col-12 col-lg-6 mx-auto">
<form action="{{ searchPage }}" method="get">
<div class="input-group mb-3">
<input type="text" name="term" class="form-control" placeholder="{{ section.search_field_placeholder }}" aria-label="{{ section.search_field_placeholder }}" value="{{ searchTerms.term }}">
{% for searchTerm,searchValue in searchTerms %}
{% if searchTerm != "term" %}
<input type="hidden" name="{{ searchTerm }}" value="true">
{% endif %}
{% endfor %}
<input type="hidden" name="global" value="{{ searchTerms.global == "true" ? "true" : "false" }}">
<button class="btn btn-primary d-flex align-items-center justify-content-center" type="submit">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% if page.image|length %}
<div class="hero-media position-absolute bg-dark position-absolute top-0 start-0 bottom-0 end-0 w-100 opacity-50" style="z-index: 0">
<img src="{{ page.image|media|resize(1920) }}" alt="{{ page.title }}" class="w-100 h-100" style="object-fit: cover; ">
</div>
{% endif %}
</header>
<section>
<div class="container">
{% partial 'search/search_results' section=section searchTerms=searchTerms %}
</div>
</section>
{% partial 'search/content' searchTerms=searchTerms %}
{% else %}
{% do abort('404') %}
{% endif %}
Expand Down
39 changes: 39 additions & 0 deletions partials/search/content.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<header class="hero bg-dark overflow-hidden d-flex align-items-center text-light position-relative py-4 mb-4">
<div class="container position-relative" style="z-index: 1">
<div class="row">
<div class="col-12 text-center">
<h1 class="mb-4">Search Results for "{{ searchTerms.term }}"</h1>
</div>
<div class="row">
<div class="col-12 col-lg-6 mx-auto">
<form action="{{ searchPage }}" method="get">
<div class="input-group mb-3">
<input type="text" name="term" class="form-control" placeholder="{{ section.search_field_placeholder }}" aria-label="{{ section.search_field_placeholder }}" value="{{ searchTerms.term }}">
{% for searchTerm,searchValue in searchTerms %}
{% if searchTerm != "term" %}
<input type="hidden" name="{{ searchTerm }}" value="true">
{% endif %}
{% endfor %}
<input type="hidden" name="global" value="{{ searchTerms.global == "true" ? "true" : "false" }}">
<button class="btn btn-primary d-flex align-items-center justify-content-center" type="submit">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% if page.image|length %}
<div class="hero-media position-absolute bg-dark position-absolute top-0 start-0 bottom-0 end-0 w-100 opacity-50" style="z-index: 0">
<img src="{{ page.image|media|resize(1920) }}" alt="{{ page.title }}" class="w-100 h-100" style="object-fit: cover; ">
</div>
{% endif %}
</header>
<section>
<div class="container">
{% partial 'search/search_results' section=section searchTerms=searchTerms %}
</div>
</section>
14 changes: 7 additions & 7 deletions partials/tailor_modules/form.htm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{{ field.label }}
{% set index_required = 0 %}
{% for validation in field.validation_rules %}
{% if (validation.attributes.type == "required" and index_required == 0) %}
{% if (validation.validation_type == "required" and index_required == 0) %}
<span class="text-danger">*</span>
{% set index_required = index_required+1 %}
{% endif %}
Expand All @@ -48,7 +48,7 @@
{% set index_number = 0 %}
{% set field_type = "text" %}
{% for validation in field.validation_rules %}
{% if (validation.attributes.type == "numeric" and index_number == 0) %}
{% if (validation.validation_type == "numeric" and index_number == 0) %}
{% set field_type = "number" %}
{% set index_number = index_number+1 %}
{% endif %}
Expand All @@ -65,7 +65,7 @@
{{ field.label }}
{% set index = 0 %}
{% for validation in field.validation_rules %}
{% if (validation.attributes.type == "required" and index == 0) %}
{% if (validation.validation_type == "required" and index == 0) %}
<span class="text-danger">*</span>
{% set index = index+1 %}
{% endif %}
Expand Down Expand Up @@ -93,7 +93,7 @@
{{ field.label }}
{% set index = 0 %}
{% for validation in field.validation_rules %}
{% if (validation.attributes.type == "required" and index == 0) %}
{% if (validation.validation_type == "required" and index == 0) %}
<span class="text-danger">*</span>
{% set index = index+1 %}
{% endif %}
Expand All @@ -106,7 +106,7 @@
{{ field.label }}
{% set index = 0 %}
{% for validation in field.validation_rules %}
{% if (validation.attributes.type == "required" and index == 0) %}
{% if (validation.validation_type == "required" and index == 0) %}
<span class="text-danger">*</span>
{% set index = index+1 %}
{% endif %}
Expand All @@ -130,7 +130,7 @@
{{ field.label }}
{% set index_required = 0 %}
{% for validation in field.validation_rules %}
{% if (validation.attributes.type == "required" and index_required == 0) %}
{% if (validation.validation_type == "required" and index_required == 0) %}
<span class="text-danger">*</span>
{% set index_required = index_required+1 %}
{% endif %}
Expand All @@ -140,7 +140,7 @@
{% set index_number = 0 %}
{% set field_type = "file" %}
{% for validation in field.validation_rules %}
{% if (validation.attributes.type == "numeric" and index_number == 0) %}
{% if (validation.validation_type == "numeric" and index_number == 0) %}
{% set field_type = "number" %}
{% set index_number = index_number+1 %}
{% endif %}
Expand Down
3 changes: 2 additions & 1 deletion version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ v6.3.2: Added global element configuration support.
v6.3.3: Adds custom validation and regex validation to form fields. Also fixes reading form field validation from the backend.
v6.3.4: Extend search to builder blocks with rich editor content
v6.3.5: Added support for file uploads in forms.
v6.3.6: Fix asterisk not appearing for fields that are required
v6.3.6: Fix asterisk not appearing for fields that are required
v6.3.7: Move search content to own partial for easier editing of the content

0 comments on commit c3f01f6

Please sign in to comment.