wikijs-fork/views/pages/admin/users-edit.pug

139 lines
4.8 KiB
Plaintext
Raw Normal View History

2017-01-04 05:07:15 +00:00
extends ./_layout.pug
block rootNavRight
2017-02-10 02:35:37 +00:00
i.nav-item#notifload
.nav-item
a.button(href='/admin/users')
i.icon-reply
span Return to Users
2017-01-04 05:07:15 +00:00
block adminContent
2017-02-10 02:35:37 +00:00
#page-type-admin-users-edit
.hero
h1.title#title Edit User
h2.subtitle= usr.email
table.table
thead
tr
th Unique ID
th Provider
th Created On
th Updated On
tbody
tr
td.is-centered= usr._id
td.is-centered.has-icons
case usr.provider
when 'local'
i.icon-server.is-deep-orange
| Local Database
when 'windowslive'
i.icon-windows2.is-blue
| Microsoft Account
when 'azure'
i.icon-windows2.is-blue
| Azure Active Directory
2017-02-10 02:35:37 +00:00
when 'google'
i.icon-google.is-blue
| Google ID
when 'facebook'
i.icon-facebook.is-indigo
2017-02-10 02:35:37 +00:00
| Facebook
when 'github'
i.icon-github.is-blue-grey
| GitHub
when 'slack'
i.icon-slack.is-purple
| Slack
2017-03-12 04:38:47 +00:00
when 'ldap'
i.icon-arrow-repeat-outline
| LDAP / Active Directory
2017-02-10 02:35:37 +00:00
default: i.icon-warning
td.is-centered= userMoment(usr.createdAt).format('lll')
td.is-centered= userMoment(usr.updatedAt).format('lll')
.form-sections
section
label.label Email Address
p.control.is-fullwidth
input.input(type='text', placeholder='john.smith@example.com', v-model='email', disabled=!usrOpts.canChangeEmail)
section
label.label Display Name
p.control.is-fullwidth
input.input(type='text', placeholder='John Smith', v-model='name', disabled=!usrOpts.canChangeName)
if usrOpts.canChangePassword
section
label.label Password
p.control.is-fullwidth
input.input(type='password', placeholder='Password', v-model='password', value='********')
section
label.label Access Rights
table.table
thead.is-teal
tr
th
th(style={width: '200px'}) Permission(s)
th Path
th(style={width: '150px'}) Access
th(style={width: '50px'})
tbody
tr(v-for='(right, idx) in rights', v-cloak)
td.is-icon
i.icon-marquee-plus.is-green(v-if='right.deny === false || right.deny === "false"')
i.icon-marquee-minus.is-red(v-if='right.deny === true || right.deny === "true"')
td
p.control.is-fullwidth
select(v-model='right.role')
option(value='write') Read and Write
option(value='read') Read Only
td
.columns
.column.is-narrow
p.control
select(v-model='right.exact')
option(value='false') Path starts with:
option(value='true') Path match exactly:
.column
p.control.is-fullwidth
input.input(type='text', placeholder='/', v-model='right.path')
td
p.control.is-fullwidth
select(v-model='right.deny')
option(value='false') Allow
option(value='true') Deny
td.is-centered.has-action-icons
i.icon-delete.is-red(v-on:click='removeRightsRow(idx)')
tr(v-if='rights.length < 1', v-cloak)
td.is-icon
td.is-centered(colspan='3'): em No additional access rights
td.is-centered.has-action-icons
.table-actions
button.button.is-blue(v-on:click='addRightsRow')
i.icon-plus
span Add New Row
section
label.label Role Override
p.control.is-fullwidth
select(v-model='roleoverride', disabled=!usrOpts.canChangeRole)
option(value='none') None
option(value='admin') Global Administrator
.columns.is-gapless
.column
section
button.button.is-green(v-on:click='saveUser')
i.icon-check
span Save Changes
a.button.button.is-grey.is-outlined(href='/admin/users')
i.icon-cancel
span Discard
.column.is-narrow
section
if usrOpts.canBeDeleted
button.button.is-red.btn-deluser-prompt
i.icon-trash2
span Delete Account
2017-02-10 02:35:37 +00:00
include ../../modals/admin-deleteuser.pug
2017-02-10 02:35:37 +00:00
script(type='text/javascript').
var usrData = !{JSON.stringify(usr)};