div
  h1.tcenter Admin Panel
  nav
    ul.button-container
      li
        a.button href="#users" = "Users"
      li
        a.button href="#roles" = "Roles"
      li
        a.button href="#auctions" = "Auctions"
      li
        a.button href="#categories" = "Categories"

#admin-panel

  h2#users User Management
  .management-container
    article.card.border
      h2 Manage User 
      ul.list-container
        - data[:users].each do |user|
            li
              | #{user.name} (id=#{user.id})
              a.inlbutton href="/admin/users/#{user.id}/edit"
                | [MANAGE]
              - if session_user.admin?
                - if user.banned?
                  a.green.inlbutton href="/admin/users/#{user.id}/unban"
                    | [UNBAN USER]
                - else
                  a.red.inlbutton href="/admin/users/#{user.id}/ban"
                    | [BAN USER]

  h2#roles Role Management
  .management-container
    article.card.border
      h2 Create Role

      .form-container
        form action="/admin/roles" method="post"
          label Role name
          input type="text" name="name" pattern="#{NAME_REGEX_STR}" maxlength="#{MAX_NAME_LEN}" oninput="this.reportValidity()" title="#{REGISTER_ERRORS[:name_desc]}"

          label Role color 
          input type="color" name="color" value="#fa0f01"

          label Role flags int
          input type="number" name="flags" value="0"

          input type="submit" value="Create role"
        

    article.card.border
      h2 Manage Roles 
      ul.list-container
        - data[:roles].each do |role|
            - if not ROLE_IDS.include? role.id
              li
                | #{role.name}
                a.inlbutton href="/admin/roles/#{role.id}/edit"
                  | [EDIT]
                a.inlbutton href="/admin/roles/#{role.id}/delete"
                  | [DELETE]

  h2#categories Category Management
  .management-container
    article.card.border
      h2 Create Category

      .form-container
        form action="/admin/categories" method="post"
          label Category name
          input type="text" name="name" pattern="#{NAME_REGEX_STR}" maxlength="#{MAX_NAME_LEN}" oninput="this.reportValidity()" title="#{REGISTER_ERRORS[:name_desc]}"

          label Category color 
          input type="color" name="color" value="#ffffff"

          input type="submit" value="Create category"
        

    article.card.border
      h2 Manage Categories 
      ul.list-container
        - data[:categories].each do |category|
            li
              | #{category.name}
              a.inlbutton href="/admin/categories/#{category.id}/edit"
                | [EDIT]
              a.inlbutton href="/admin/categories/#{category.id}/delete"
                | [DELETE]
