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.

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