You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
4.8 KiB

  1. extends ./_layout.pug
  2. block rootNavRight
  3. i.nav-item#notifload
  4. .nav-item
  5. a.button(href='/admin/users')
  6. i.icon-reply
  7. span Return to Users
  8. block adminContent
  9. #page-type-admin-users-edit
  10. .hero
  11. h1.title#title Edit User
  12. h2.subtitle= usr.email
  13. table.table
  14. thead
  15. tr
  16. th Unique ID
  17. th Provider
  18. th Created On
  19. th Updated On
  20. tbody
  21. tr
  22. td.is-centered= usr._id
  23. td.is-centered.has-icons
  24. case usr.provider
  25. when 'local'
  26. i.icon-server.is-deep-orange
  27. | Local Database
  28. when 'windowslive'
  29. i.icon-windows2.is-blue
  30. | Microsoft Account
  31. when 'azure'
  32. i.icon-windows2.is-blue
  33. | Azure Active Directory
  34. when 'google'
  35. i.icon-google.is-blue
  36. | Google ID
  37. when 'facebook'
  38. i.icon-facebook.is-indigo
  39. | Facebook
  40. when 'github'
  41. i.icon-github.is-blue-grey
  42. | GitHub
  43. when 'slack'
  44. i.icon-slack.is-purple
  45. | Slack
  46. when 'ldap'
  47. i.icon-arrow-repeat-outline
  48. | LDAP / Active Directory
  49. default: i.icon-warning
  50. td.is-centered= userMoment(usr.createdAt).format('lll')
  51. td.is-centered= userMoment(usr.updatedAt).format('lll')
  52. .form-sections
  53. section
  54. label.label Email Address
  55. p.control.is-fullwidth
  56. input.input(type='text', placeholder='john.smith@example.com', v-model='email', disabled=!usrOpts.canChangeEmail)
  57. section
  58. label.label Display Name
  59. p.control.is-fullwidth
  60. input.input(type='text', placeholder='John Smith', v-model='name', disabled=!usrOpts.canChangeName)
  61. if usrOpts.canChangePassword
  62. section
  63. label.label Password
  64. p.control.is-fullwidth
  65. input.input(type='password', placeholder='Password', v-model='password', value='********')
  66. section
  67. label.label Access Rights
  68. table.table
  69. thead.is-teal
  70. tr
  71. th
  72. th(style={width: '200px'}) Permission(s)
  73. th Path
  74. th(style={width: '150px'}) Access
  75. th(style={width: '50px'})
  76. tbody
  77. tr(v-for='(right, idx) in rights', v-cloak)
  78. td.is-icon
  79. i.icon-marquee-plus.is-green(v-if='right.deny === false || right.deny === "false"')
  80. i.icon-marquee-minus.is-red(v-if='right.deny === true || right.deny === "true"')
  81. td
  82. p.control.is-fullwidth
  83. select(v-model='right.role')
  84. option(value='write') Read and Write
  85. option(value='read') Read Only
  86. td
  87. .columns
  88. .column.is-narrow
  89. p.control
  90. select(v-model='right.exact')
  91. option(value='false') Path starts with:
  92. option(value='true') Path match exactly:
  93. .column
  94. p.control.is-fullwidth
  95. input.input(type='text', placeholder='/', v-model='right.path')
  96. td
  97. p.control.is-fullwidth
  98. select(v-model='right.deny')
  99. option(value='false') Allow
  100. option(value='true') Deny
  101. td.is-centered.has-action-icons
  102. i.icon-delete.is-red(v-on:click='removeRightsRow(idx)')
  103. tr(v-if='rights.length < 1', v-cloak)
  104. td.is-icon
  105. td.is-centered(colspan='3'): em No additional access rights
  106. td.is-centered.has-action-icons
  107. .table-actions
  108. button.button.is-blue(v-on:click='addRightsRow')
  109. i.icon-plus
  110. span Add New Row
  111. section
  112. label.label Role Override
  113. p.control.is-fullwidth
  114. select(v-model='roleoverride', disabled=!usrOpts.canChangeRole)
  115. option(value='none') None
  116. option(value='admin') Global Administrator
  117. .columns.is-gapless
  118. .column
  119. section
  120. button.button.is-green(v-on:click='saveUser')
  121. i.icon-check
  122. span Save Changes
  123. a.button.button.is-grey.is-outlined(href='/admin/users')
  124. i.icon-cancel
  125. span Discard
  126. .column.is-narrow
  127. section
  128. if usrOpts.canBeDeleted
  129. button.button.is-red.btn-deluser-prompt
  130. i.icon-trash2
  131. span Delete Account
  132. include ../../modals/admin-deleteuser.pug
  133. script(type='text/javascript').
  134. var usrData = !{JSON.stringify(usr)};