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.

123 lines
4.7 KiB

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