{#-
 This file is part of Supysonic.
 Supysonic is a Python implementation of the Subsonic server API.

 Copyright (C) 2013-2018 Alban 'spl0k' Féron
                    2017 Óscar García Amor

 Distributed under terms of the GNU AGPLv3 license.
-#}
{% extends "layout.html" %}
{% block navbar_users %}
<a class="nav-link active" aria-current="page" href="{{ url_for('frontend.user_index') }}">Users</a>
{% endblock %}
{% block body %}
<h2 class="mt-4 pb-2 border-bottom">{{ user.name }}</h2>
<form method="post">
  <div class="input-group mb-3">
    <span class="input-group-text" id="username">
      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-person" aria-label="Username" viewBox="0 0 16 16">
        <path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"/>
      </svg>
    </span>
    <input type="text" class="form-control" id="user" name="user" value="{{ user.name }}" placeholder="Username" aria-label="Username" aria-describedby="username">
    <span class="input-group-text">
      <label for="admin" class="me-2">Admin</label>
      <div class="form-switch"><input type="checkbox" class="form-check-input" role="switch" id="admin" name="admin" {{ 'checked="checked"' if user.admin }} /></div>
    </span>
  </div>
  <button class="btn btn-light" type="submit">Update</button>
</form>
{% endblock %}

