<!DOCTYPE html>
<html lang="en">

## adminedit.html - When an administrator enters edit mode

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Edit</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<link rel="stylesheet" href="/static/w3.css">
<link rel="stylesheet" href="/static/w3-colors-flat.css">
<link rel="stylesheet" href="/static/indipyweb.css">
<script src="/static/htmx.min.js"></script>
<script src="/static/sse.js"></script>
<script src="/static/indipyweb.js"></script>


<body class="w3-flat-clouds">

  <header class="w3-container w3-flat-silver w3-block">
    <%include file="../max_header.html"/>
  </header>



<div id="editoptions">
<%include file="editoptions.html"/>
</div>


## Create setup button

<div class="w3-content" style="max-width:400px;margin-top:5vh">
 <a href="/setup" class="w3-button w3-black w3-ripple w3-round" style="width:100%">System Setup</a>
</div>

## Create new user form

<div class="w3-content" style="max-width:400px;margin-top:5vh;margin-bottom:5vh;">

  <div>
    <button onclick="btntogglenhide(this, 'Close','Add a new User', 'addnewuser', 'newuserconfirm')" class="w3-button w3-black w3-ripple w3-round" style="width:100%">Add a new User</button>
  </div>

  <div id="addnewuser" class="w3-container w3-card" style="margin-top:5vh; display:none">
    <form hx-post="/edit/newuser" hx-target="#newuserconfirm" hx-swap="outerHTML" hx-on::after-request="if(event.detail.successful) this.reset()">
      <p><label for="username">New Username:</label>
        <input class="w3-input" type="text" id="username" name="username" required /></p>
      <p><label for="password">New Password:</label>
        <input class="w3-input" type="password" id="password" name="password" required /></p>
      <p>Admin or User:</p>
      <div style="margin-left:20%">
      <p><input class="w3-radio" type="radio" id="adminauth" name="authlevel" value="Admin" />
         <label for="adminauth">Admin</label></p>
      <p><input class="w3-radio" type="radio" id="userauth" name="authlevel" value="User" checked />
         <label for="userauth">User</label></p>
      </div>
      <p><label for="fullname">Full name:</label>
        <input class="w3-input" type="text" id="fullname" name="fullname" required /></p>
      <p class="w3-center">
        <button class="w3-button w3-black w3-ripple w3-round" type="submit">Submit</button></p>
    </form>

    <p id="newuserconfirm"></p>
  </div>

</div>

<div id = "userlist" hx-ext="sse" sse-connect="/edit/tablechange">
<%include file="listusers.html"/>
</div>

</body>
</html>
