{% import "github.com/bakape/meguca/config" %} {% import "github.com/bakape/meguca/lang" %} OwnedBoard renders a form for selecting one of several boards owned by the user {% func OwnedBoard(boards config.BoardTitles) %}{% stripspace %} {% if len(boards) != 0 %}
{%= submit(true) %} {% else %} {%s= lang.Get().UI["ownNoBoards"] %}

{%= cancel() %}
{% endif %} {% endstripspace %}{% endfunc %} {% func formatTitle(id, title string) %}{% stripspace %} /{%s= id %}/{% space %}-{% space %}{%s title %} {% endstripspace %}{% endfunc %} BoardNavigation renders a board selection and search form {% func BoardNavigation() %}{% stripspace %} {% code ln := lang.Get().Common.UI %}
{%= submit(true) %}
{% for _, b := range config.GetBoardTitles() %} {% endfor %}
{% endstripspace %}{% endfunc %} CreateBoard renders a the form for creating new boards {% func CreateBoard() %}{% stripspace %} {%= table(specs["createBoard"]) %} {%= CaptchaConfirmation() %} {% endstripspace %}{% endfunc %} CaptchaConfirmation renders a confirmation form with an optional captcha {% func CaptchaConfirmation() %}{% stripspace %} {%= captcha("all") %} {%= submit(true) %} {% endstripspace %}{% endfunc %} {% func captcha(board string) %}{% stripspace %} {% if !config.Get().Captcha %} {% return %} {% endif %}
{% endstripspace %}{% endfunc %} Form for inputting key-value map-like data {% func keyValueForm(k, v string) %}{% stripspace %} [X]
{% endstripspace %}{% endfunc %} Form for inputting one array-like form item {% func arrayItemForm(v string) %}{% stripspace %} [X]
{% endstripspace %}{% endfunc %} Form formatted as a table, with cancel and submit buttons {% func tableForm(specs []inputSpec, needCaptcha bool) %}{% stripspace %} {%= table(specs) %} {% if needCaptcha %} {%= captcha("all") %} {% endif %} {%= submit(true) %} {% endstripspace %}{% endfunc %} Render a map form for inputting map-like data {% func renderMap(spec inputSpec) %}{% stripspace %} {% code ln := lang.Get() %}
{% for k, v := range spec.Val.(map[string]string) %} {%= keyValueForm(k, v) %} {% endfor %} {%s= ln.UI["add"] %}
{% endstripspace %}{% endfunc %} Render form for inputting array-like data {% func renderArray(spec inputSpec) %}{% stripspace %} {% code ln := lang.Get() %}
{% for _, v := range spec.Val.([]string) %} {%= arrayItemForm(v) %} {% endfor %} {%s= ln.UI["add"] %}
{% endstripspace %}{% endfunc %} Render submit and cancel buttons {% func submit(cancel bool) %}{% stripspace %} {% if cancel %} {%= cancel() %} {% endif %}
{% endstripspace %}{% endfunc %} Renders a cancel button {% func cancel() %}{% stripspace %} {% endstripspace %}{% endfunc %} Render link to request new noscript captcha {% func NoscriptCaptchaLink(board string) %}{% stripspace %} {%s= lang.Get().UI["loadCaptcha"] %} {% endstripspace %}{% endfunc %} {% func BannerForm() %}{% stripspace %}
{%s= lang.Get().UI["bannerSpecs"] %}


{%= captcha("all") %} {%= submit(true) %} {% endstripspace %}{% endfunc %} {% func LoadingAnimationForm() %}{% stripspace %}
{%s= lang.Get().UI["loadingSpecs"] %}


{%= captcha("all") %} {%= submit(true) %} {% endstripspace %}{% endfunc %}