mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 22:54:42 -04:00
Add delete user UI
This provides the UI for the delete user feature introduced in
4229084c62
Placing of the user delete button is not perfect, but can be moved to an
own user tab later on.
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
parent
e31d204d74
commit
9fd09a8dfb
3 changed files with 44 additions and 16 deletions
|
@ -39,7 +39,7 @@ const options = {
|
|||
'<a href="#">' +
|
||||
'<div class="item">' +
|
||||
'<div class="ui-history-pin fa fa-thumb-tack fa-fw"></div>' +
|
||||
'<div class="ui-history-close fa fa-close fa-fw" data-toggle="modal" data-target=".delete-modal"></div>' +
|
||||
'<div class="ui-history-close fa fa-close fa-fw" data-toggle="modal" data-target=".delete-history-modal"></div>' +
|
||||
'<div class="content">' +
|
||||
'<h4 class="text"></h4>' +
|
||||
'<p>' +
|
||||
|
@ -208,8 +208,8 @@ function historyCloseClick (e) {
|
|||
e.preventDefault()
|
||||
const id = $(this).closest('a').siblings('span').html()
|
||||
const value = historyList.get('id', id)[0]._values
|
||||
$('.ui-delete-modal-msg').text('Do you really want to delete below history?')
|
||||
$('.ui-delete-modal-item').html(`<i class="fa fa-file-text"></i> ${value.text}<br><i class="fa fa-clock-o"></i> ${value.time}`)
|
||||
$('.ui-delete-history-modal-msg').text('Do you really want to delete below history?')
|
||||
$('.ui-delete-history-modal-item').html(`<i class="fa fa-file-text"></i> ${value.text}<br><i class="fa fa-clock-o"></i> ${value.time}`)
|
||||
clearHistory = false
|
||||
deleteId = id
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ function deleteHistory () {
|
|||
checkHistoryList()
|
||||
}
|
||||
}
|
||||
$('.delete-modal').modal('hide')
|
||||
$('.delete-history-modal').modal('hide')
|
||||
deleteId = null
|
||||
clearHistory = false
|
||||
})
|
||||
|
@ -297,12 +297,12 @@ function deleteHistory () {
|
|||
deleteId = null
|
||||
})
|
||||
}
|
||||
$('.delete-modal').modal('hide')
|
||||
$('.delete-history-modal').modal('hide')
|
||||
clearHistory = false
|
||||
})
|
||||
}
|
||||
|
||||
$('.ui-delete-modal-confirm').click(() => {
|
||||
$('.ui-delete-history-modal-confirm').click(() => {
|
||||
deleteHistory()
|
||||
})
|
||||
|
||||
|
@ -342,8 +342,8 @@ $('.ui-open-history').bind('change', e => {
|
|||
})
|
||||
|
||||
$('.ui-clear-history').click(() => {
|
||||
$('.ui-delete-modal-msg').text('Do you really want to clear all history?')
|
||||
$('.ui-delete-modal-item').html('There is no turning back.')
|
||||
$('.ui-delete-history-modal-msg').text('Do you really want to clear all history?')
|
||||
$('.ui-delete-history-modal-item').html('There is no turning back.')
|
||||
clearHistory = true
|
||||
deleteId = null
|
||||
})
|
||||
|
@ -371,6 +371,10 @@ $('.ui-refresh-history').click(() => {
|
|||
})
|
||||
})
|
||||
|
||||
$('.ui-delete-user-modal-cancel').click(() => {
|
||||
$('.ui-delete-user').parent().removeClass('active')
|
||||
})
|
||||
|
||||
$('.ui-logout').click(() => {
|
||||
clearLoginState()
|
||||
location.href = `${serverurl}/logout`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue