1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| {% import ( "strings"
"{{{ .Package }}}/app/controller/cutil" "{{{ .Package }}}/views/components" ) %}
{% func Form(act string, q string, placeholder string, currTags []string, ps *cutil.PageState) %} {%- code if placeholder == "" { placeholder = "Search" } -%} <form action="{%s act %}" method="get"> {%- if len(currTags) > 0 -%} <input type="hidden" name="tags" value="{%s strings.Join(currTags, `,`) %}" /> {%- endif -%} <div class="right"> <button class="right" type="submit">{%= components.SVGRef("search", 22, 22, `icon`, ps) %}</button> <input class="right br0" type="text" name="q" value="{%s q %}" placeholder="{%s placeholder %}" /> </div> </form> {% endfunc %}
|