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.

135 lines
4.7 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 'google'
  32. i.icon-google.is-blue
  33. | Google ID
  34. when 'facebook'
  35. i.icon-facebook.is-indigo
  36. | Facebook
  37. when 'github'
  38. i.icon-github.is-blue-grey
  39. | GitHub
  40. when 'slack'
  41. i.icon-slack.is-purple
  42. | Slack
  43. when 'ldap'
  44. i.icon-arrow-repeat-outline
  45. | LDAP / Active Directory
  46. default: i.icon-warning
  47. td.is-centered= userMoment(usr.createdAt).format('lll')
  48. td.is-centered= userMoment(usr.updatedAt).format('lll')
  49. .form-sections
  50. section
  51. label.label Email Address
  52. p.control.is-fullwidth
  53. input.input(type='text', placeholder='john.smith@example.com', v-model='email', disabled=!usrOpts.canChangeEmail)
  54. section
  55. label.label Display Name
  56. p.control.is-fullwidth
  57. input.input(type='text', placeholder='John Smith', v-model='name', disabled=!usrOpts.canChangeName)
  58. if usrOpts.canChangePassword
  59. section
  60. label.label Password
  61. p.control.is-fullwidth
  62. input.input(type='password', placeholder='Password', v-model='password', value='********')
  63. section
  64. label.label Access Rights
  65. table.table
  66. thead.is-teal
  67. tr
  68. th
  69. th(style={width: '200px'}) Permission(s)
  70. th Path
  71. th(style={width: '150px'}) Access
  72. th(style={width: '50px'})
  73. tbody
  74. tr(v-for='(right, idx) in rights', v-cloak)
  75. td.is-icon
  76. i.icon-marquee-plus.is-green(v-if='right.deny === false || right.deny === "false"')
  77. i.icon-marquee-minus.is-red(v-if='right.deny === true || right.deny === "true"')
  78. td
  79. p.control.is-fullwidth
  80. select(v-model='right.role')
  81. option(value='write') Read and Write
  82. option(value='read') Read Only
  83. td
  84. .columns
  85. .column.is-narrow
  86. p.control
  87. select(v-model='right.exact')
  88. option(value='false') Path starts with:
  89. option(value='true') Path match exactly:
  90. .column
  91. p.control.is-fullwidth
  92. input.input(type='text', placeholder='/', v-model='right.path')
  93. td
  94. p.control.is-fullwidth
  95. select(v-model='right.deny')
  96. option(value='false') Allow
  97. option(value='true') Deny
  98. td.is-centered.has-action-icons
  99. i.icon-delete.is-red(v-on:click='removeRightsRow(idx)')
  100. tr(v-if='rights.length < 1', v-cloak)
  101. td.is-icon
  102. td.is-centered(colspan='3'): em No additional access rights
  103. td.is-centered.has-action-icons
  104. .table-actions
  105. button.button.is-blue(v-on:click='addRightsRow')
  106. i.icon-plus
  107. span Add New Row
  108. section
  109. label.label Role Override
  110. p.control.is-fullwidth
  111. select(v-model='roleoverride', disabled=!usrOpts.canChangeRole)
  112. option(value='none') None
  113. option(value='admin') Global Administrator
  114. .columns.is-gapless
  115. .column
  116. section
  117. button.button.is-green(v-on:click='saveUser')
  118. i.icon-check
  119. span Save Changes
  120. a.button.button.is-grey.is-outlined(href='/admin/users')
  121. i.icon-cancel
  122. span Discard
  123. .column.is-narrow
  124. section
  125. if usrOpts.canBeDeleted
  126. button.button.is-red.btn-deluser-prompt
  127. i.icon-trash2
  128. span Delete Account
  129. include ../../modals/admin-deleteuser.pug
  130. script(type='text/javascript').
  131. var usrData = !{JSON.stringify(usr)};