Skip to content

Commit 142ff7c

Browse files
committed
document params for shared templates
1 parent d9b35e3 commit 142ff7c

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

templates/shared/search/button.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
<!-- Disable (optional) - if search button has to be disabled -->
2+
<!-- Tooltip (optional) - a tooltip to be displayed on hover -->
13
<button class="ui small primary icon button" aria-label="{{ctx.Locale.Tr "search.search"}}" {{with .Tooltip}}data-tooltip-content="{{.}}"{{end}}{{if .Disabled}} disabled{{end}}>{{svg "octicon-search"}}</button>

templates/shared/search/combo.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!-- Value - value of the search field (for search results page) -->
2+
<!-- Disabled (optional) - if search field/button has to be disabled -->
3+
<!-- Placeholder (optional) - placeholder text to be used -->
4+
<!-- Tooltip (optional) - a tooltip to be displayed on button hover -->
15
<div class="ui fluid action input">
26
{{template "shared/search/input" dict "Value" .Value "Disabled" .Disabled "Placeholder" .Placeholder}}
37
{{template "shared/search/button" dict "Disabled" .Disabled "Tooltip" .Tooltip}}

templates/shared/search/combo_fuzzy.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<!-- Value - value of the search field (for search results page) -->
2+
<!-- Disabled (optional) - if search field/button has to be disabled -->
3+
<!-- Placeholder (optional) - placeholder text to be used -->
4+
<!-- IsFuzzy - state of the fuzzy search toggle -->
5+
<!-- Tooltip (optional) - a tooltip to be displayed on button hover -->
16
<div class="ui fluid action input">
27
{{template "shared/search/input" dict "Value" .Value "Disabled" .Disabled "Placeholder" .Placeholder}}
38
{{template "shared/search/fuzzy" dict "Disabled" .Disabled "IsFuzzy" .IsFuzzy}}

templates/shared/search/fuzzy.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- Disabled (optional) - if dropdown has to be disabled -->
2+
<!-- IsFuzzy - state of the fuzzy search toggle -->
13
<div class="ui small dropdown selection {{if .Disabled}} disabled{{end}}" data-tooltip-content="{{ctx.Locale.Tr "search.type_tooltip"}}">
24
<input name="fuzzy" type="hidden"{{if .Disabled}} disabled{{end}} value="{{.IsFuzzy}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}}
35
<div class="text">{{if .IsFuzzy}}{{ctx.Locale.Tr "search.fuzzy"}}{{else}}{{ctx.Locale.Tr "search.match"}}{{end}}</div>

templates/shared/search/input.tmpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
<input type="search" spellcheck="false" name="q" maxlength="255" placeholder="{{if .Placeholder}}{{.Placeholder}}{{else}}{{ctx.Locale.Tr "search.search"}}…{{end}}"{{if .Value}} value="{{.Value}}"{{end}}{{if .Disabled}} disabled{{end}} {{if .Autofocus}}autofocus{{end}}>
1+
<!-- Value - value of the search field (for search results page) -->
2+
<!-- Disabled (optional) - if search field has to be disabled -->
3+
<!-- Placeholder (optional) - placeholder text to be used -->
4+
<input type="search" spellcheck="false" name="q" maxlength="255" placeholder="{{if .Placeholder}}{{.Placeholder}}{{else}}{{ctx.Locale.Tr "search.search"}}…{{end}}"{{if .Value}} value="{{.Value}}"{{end}}{{if .Disabled}} disabled{{end}} autofocus>

0 commit comments

Comments
 (0)