github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/views/components/edit/Icon.html (about)

     1  <!-- Content managed by Project Forge, see [projectforge.md] for details. -->
     2  {% import (
     3    "github.com/kyleu/dbaudit/app/controller/cutil"
     4    "github.com/kyleu/dbaudit/app/util"
     5    "github.com/kyleu/dbaudit/views/components"
     6  ) %}
     7  
     8  {% func IconPicker(key string, selected string, ps *cutil.PageState, indent int) %}{% stripspace %}
     9    {%= components.Indent(true, indent) %}
    10    <div class="choice">
    11      {% for _, k := range util.SVGIconKeys %}
    12        {%= components.Indent(true, indent + 1) %}
    13        <label title="{%s k %}">
    14          {% if k == selected %}
    15            <input type="radio" name="{%s key %}" value="{%s k %}" checked="checked" />
    16          {% else %}
    17            <input type="radio" name="{%s key %}" value="{%s k %}" />
    18          {% endif %}
    19          {% space %}
    20          {%= components.SVGRef(k, 48, 48, "", ps) %}
    21        </label>
    22      {% endfor %}
    23      {%= components.Indent(true, indent + 1) %}
    24      <div class="clear"></div>
    25    {%= components.Indent(true, indent) %}
    26    </div>
    27  {% endstripspace %}{% endfunc %}
    28  
    29  {% func IconPickerVertical(key string, title string, value string, ps *cutil.PageState, indent int) %}{% stripspace %}
    30    <div class="mb expanded">
    31      {%= components.Indent(true, indent + 1) %}
    32      <em class="title">{%s title %}</em>
    33      {%= components.Indent(true, indent + 1) %}
    34      <div class="mt">{%= IconPicker(key, value, ps, indent) %}</div>
    35    {%= components.Indent(true, indent) %}
    36    </div>
    37  {% endstripspace %}{% endfunc %}
    38  
    39  {% func Icons(key string, title string, value string, ps *cutil.PageState, indent int) %}{% stripspace %}
    40    <div class="mb expanded">
    41      {%= components.Indent(true, indent + 1) %}
    42      <em class="title">{%s title %}</em>
    43      {%= components.Indent(true, indent + 1) %}
    44      <div class="mt">{%= IconPicker(key, value, ps, indent) %}</div>
    45    {%= components.Indent(true, indent) %}
    46    </div>
    47  {% endstripspace %}{% endfunc %}
    48  
    49  {% func IconsTable(key string, title string, value string, ps *cutil.PageState, indent int, help ...string) %}{% stripspace %}
    50    <tr>
    51      {%= components.Indent(true, indent + 1) %}
    52      <th class="shrink"><label>{%s title %}</label></th>
    53      {%= components.Indent(true, indent + 1) %}
    54      <td>{%= Icons(key, title, value, ps, indent + 2) %}
    55      </td>
    56    {%= components.Indent(true, indent) %}
    57    </tr>
    58  {% endstripspace %}{% endfunc %}