2
0

users-edit.pug 3.7 KB

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