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.

122 lines
5.0 KiB

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