1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| {% import ( "strings"
"{{{ .Package }}}/app" "{{{ .Package }}}/app/controller/cutil" "{{{ .Package }}}/app/util" "{{{ .Package }}}/views/components" ) %}
{% func Help(as *app.State, ps *cutil.PageState) %}{% stripspace %} {%- if as.Services != nil && as.Services.Help != nil -%} {%- code hlp := as.Services.Help.Entry(ps.Action) -%} {%- if hlp == nil -%} <!-- no help file for [{%s ps.Action %}] --> {%- else -%} {%- code title := util.OrDefault(util.OrDefault(hlp.Title, ps.Title), util.AppName) -%} <a class="help-link" title="Help for this page" data-key="{%s strings.TrimSuffix(ps.Action, `.action`) %}" href="#help">{%= components.SVGSimple(`question`, 24, ps) %}</a> {%= components.Indent(true, 1) %} <div id="help" class="modal" style="display: none;"> {%= components.Indent(true, 2) %} <a class="backdrop" href="#"></a> {%= components.Indent(true, 2) %} <div class="modal-content"> {%= components.Indent(true, 3) %} <div class="modal-header"> <a href="#" class="modal-close">×</a> <h3>{%= components.SVGIcon(`question`, ps) %}{% space %}{%s title %}</h3> </div> {%= components.Indent(true, 3) %} <div class="modal-body"> {%= components.Indent(true, 4) %} {%s= hlp.HTML %} {%= components.Indent(true, 3) %} </div> {%= components.Indent(true, 2) %} </div> {%= components.Indent(true, 1) %} </div> {%- endif -%} {%- endif -%} {% endstripspace %}{% endfunc %}
|