SylowTech/sylow

View on GitHub
admin/views/entities.pug

Summary

Maintainability
Test Coverage
extends includes/dash.pug

block dashboard
  h1(class="ui header")= "Entities"
  div(class="ui four cards")
    each entity in entities
      div(class="ui card")
        div(class="content")
          a(class="header" href=`/entities/${entity._id}`)= entity.entityName
          div(class="description")= "Entity"
        a(class="ui bottom attached negative button" data-action="showDeleteModal" data-params=entity._id)= "Delete"
  div(class="ui hidden divider")
  h2(class="ui header")= "Create New Entity"
  form(class="ui form" id="register-form" method="POST")
    input(type="hidden" id="passwordHash" name="passwordHash")
    input(type="hidden" id="passwordSalt" name="passwordSalt")
    div(class="field")
      label= "Username"
      input(type="text" id="username" name="username" placeholder="Username")
    div(class="field")
      label= "Password"
      input(type="password" id="password" placeholder="Password")
    div(class="field")
      label= "Confirm Password"
      input(type="password" id="confirm" placeholder="Confirm Password")
    div(class="field")
      div(class="ui checkbox")
        input(type="checkbox" class="hidden" name="admin")
        label= "Admin User"
    div(class="ui hidden divider")
    button(type="submit" class="ui large basic positive button") Register
    div(class="ui error message")

  div(id="delete-entity-modal" class="ui basic modal")
    div(class="ui icon header")
      i(class="remove user icon")
      | Delete Entity
    div(class="content")
      p= "Are you sure you wish to delete this entity?"
    div(class="actions")
      div(class="ui basic inverted button" data-action="hideModal")
        i(class="remove icon")
        | Cancel
      div(class="ui red basic inverted button" data-action="deleteEntity")
        i(class="checkmark icon")
        | Delete