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 42 43 44 45
| {% import ( "{{{ .Package }}}/app/controller/cutil" "{{{ .Package }}}/app/lib/theme" "{{{ .Package }}}/views/vutil" ) %}
{% func ChoicePanel(themes theme.Themes, icon string, indent int, ps *cutil.PageState) %}{% stripspace %} {%= vutil.Indent(true, indent) %} <tr> {%= vutil.Indent(true, indent + 1) %} <th class="shrink"><label>Theme</label></th> {%= vutil.Indent(true, indent + 1) %} <td> {%= vutil.Indent(true, indent + 2) %} <div class="right"><a href="/theme">Edit Themes</a></div> <div class="clear"></div> {% code sel := ps.Profile.Theme if sel == "" { sel = "default" } %} {%= Choice(themes, sel, icon, indent + 2, ps) %} </td> {%= vutil.Indent(true, indent) %} </tr> {% endstripspace %}{% endfunc %}
{% func Choice(themes theme.Themes, selected string, icon string, indent int, ps *cutil.PageState) %}{% stripspace %} {%= vutil.Indent(true, indent) %} <div class="choice"> {% for _, t := range themes %} {%= vutil.Indent(true, indent + 1) %} <label title="{%s t.Key %}"> {% if t.Key == selected %} <input type="radio" name="theme" value="{%s t.Key %}" checked="checked" /> {% else %} <input type="radio" name="theme" value="{%s t.Key %}" /> {% endif %} {%= MockupTheme(t, true, icon, indent + 2, ps) %} </label> {% endfor %} {%= vutil.Indent(true, indent) %} </div> {% endstripspace %}{% endfunc %}
|