<div class="card" id="sodar-user-settings-card">
  <div class="card-header">
    <h4>
      <i class="iconify" data-icon="mdi:tune"></i> Settings
      {% if request.user.is_superuser or not site_read_only %}
        <span class="sodar-header-input-group pull-right">
          <a role="button"
             class="btn btn-primary {% if not user_settings or user_settings|length == 0 %}disabled{% endif %}"
             href="{% url 'userprofile:settings_update' %}"
             id="sodar-user-btn-settings">
            <i class="iconify" data-icon="mdi:lead-pencil"></i> Update Settings
          </a>
        </span>
      {% endif %}
    </h4>
  </div>
  <div class="card-body">
    <dl class="row">
      {% for setting in user_settings %}
        <dt class="col-md-5 font-weight-bold">
          {% if setting.description %}
            <span title="{{ setting.description }}"
                  data-toggle="tooltip" data-placement="top">
          {% else %}
            <span>
          {% endif %}
          {{ setting.label }}
          </span>
        </dt>
        <dd class="col-md-7">
          {% if setting.value == None or setting.value == '' %}
            <span class="text-muted">N/A</span>
          {% else %}
            {{ setting.value }}
          {% endif %}
        </dd>
      {% empty %}
        <dd class="col-12 text-center text-muted font-italic">
          No user settings available.
        </dd>
      {% endfor %}
    </dl>
  </div>
</div>
