mirror of https://github.com/onweru/compose.git

weru
13.03.2023 450840b51131b926b1a24362641bf67b73c03e4b
fix placeholder bug #107

Signed-off-by: weru <fromweru@gmail.com>
2 files modified
38 ■■■■ changed files
i18n/en.toml 2 ●●● patch | view | raw | blame | history
layouts/partials/search.html 36 ●●●● patch | view | raw | blame | history
i18n/en.toml
@@ -13,7 +13,7 @@
[quick_links]
  other = "Quick links"
[search_field_placeholder]
  other = "Search {{ .section }}"
  other = "Search"
[search_results_label]
  other = "Search Results"
[short_search_query]
layouts/partials/search.html
@@ -1,18 +1,20 @@
{{ $searchEnabled := partialCached "functions/getSearchConfig" . }}
{{ if $searchEnabled }}
<div class="search">
  <label for="find" class="search_label">
    {{- partial "sprite" (dict "icon" "search") }}
  </label>
  {{ $placeholder := T "search_field_placeholder" (dict "section" .Section) }}
  {{ if .Section }}
  {{ else }}
    {{ $placeholder =  printf "%s%s" $placeholder (T "site") }}
  {{ end }}
  <input type="search" class="search_field  standardize-input" placeholder="{{ $placeholder }}" id="find" autocomplete="off"  data-scope='{{ .Section }}'>
  {{- if ne .Params.searchPage true }}
  <div class="search_results results"></div>
{{- $searchEnabled := partialCached "functions/getSearchConfig" . }}
{{- if $searchEnabled }}
  {{- $section := .Section }}
  {{- $config := site.Params }}
  {{- $default := T "search_field_placeholder" }}
  {{- $scope := T "site" }}
  {{- if and $section (eq $config.search.global false) }}
    {{- $scope = $section }}
  {{- end }}
</div>
{{ end }}
  <div class="search">
    <label for="find" class="search_label">
      {{- partial "sprite" (dict "icon" "search") }}
    </label>
    {{ $placeholder := printf "%s %s" $default $scope }}
    <input type="search" class="search_field  standardize-input" placeholder="{{ $placeholder }}" id="find" autocomplete="off" data-scope='{{ $section }}'>
    {{- if ne .Params.searchPage true }}
    <div class="search_results results"></div>
    {{- end }}
  </div>
{{- end }}