mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-31 07:11:33 +00:00
feat: static preview of album description markdown
in dashboard's edit album prompt
This commit is contained in:
parent
7dd4f50e9e
commit
39b7d96b8f
@ -128,6 +128,9 @@ self.list = async (req, res, next) => {
|
|||||||
album.uploads = 0
|
album.uploads = 0
|
||||||
album.size = 0
|
album.size = 0
|
||||||
album.zipSize = null
|
album.zipSize = null
|
||||||
|
album.descriptionHtml = album.description
|
||||||
|
? utils.md.instance.render(album.description)
|
||||||
|
: ''
|
||||||
|
|
||||||
// Map by IDs
|
// Map by IDs
|
||||||
albumids[album.id] = album
|
albumids[album.id] = album
|
||||||
|
@ -158,3 +158,13 @@ $swal-modal-background: $grey-darker;
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center
|
justify-content: center
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.swal-display-description-preview {
|
||||||
|
background-color: $scheme-main;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: calc(0.5em - 1px) calc(0.75em - 1px) calc(0.5em - 1px) calc(0.75em - 1px);
|
||||||
|
|
||||||
|
&.content {
|
||||||
|
margin-bottom: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1797,6 +1797,7 @@ page.getAlbums = (params = {}) => {
|
|||||||
download: album.download,
|
download: album.download,
|
||||||
public: album.public,
|
public: album.public,
|
||||||
description: album.description,
|
description: album.description,
|
||||||
|
descriptionHtml: album.descriptionHtml,
|
||||||
enabled,
|
enabled,
|
||||||
homeDomain,
|
homeDomain,
|
||||||
urlPath,
|
urlPath,
|
||||||
@ -1895,8 +1896,16 @@ page.editAlbum = id => {
|
|||||||
<div class="control">
|
<div class="control">
|
||||||
<textarea id="swalDescription" class="textarea" placeholder="Description" rows="2" maxlength="${page.albumDescMaxLength}">${(album.description || '').substring(0, page.albumDescMaxLength)}</textarea>
|
<textarea id="swalDescription" class="textarea" placeholder="Description" rows="2" maxlength="${page.albumDescMaxLength}">${(album.description || '').substring(0, page.albumDescMaxLength)}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<p class="help">Max length is ${page.albumDescMaxLength} characters.</p>
|
<p class="help"><b>Markdown supported.</b> Max length is ${page.albumDescMaxLength} characters.</p>
|
||||||
</div>
|
</div>
|
||||||
|
${album.descriptionHtml
|
||||||
|
? `<div class="field">
|
||||||
|
<div class="content swal-display-description-preview">
|
||||||
|
${album.descriptionHtml}
|
||||||
|
</div>
|
||||||
|
<p class="help">Save changes then re-open this Edit prompt to refresh this preview.</p>
|
||||||
|
</div>`
|
||||||
|
: ''}
|
||||||
${page.currentView === 'albumsAll' && page.permissions.moderator
|
${page.currentView === 'albumsAll' && page.permissions.moderator
|
||||||
? `<div class="field">
|
? `<div class="field">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
@ -2668,7 +2677,7 @@ page.editUser = id => {
|
|||||||
${isHigher
|
${isHigher
|
||||||
? ''
|
? ''
|
||||||
: `<div class="notification is-danger">
|
: `<div class="notification is-danger">
|
||||||
You <strong>cannot</strong> modify user in the same or higher group as you.
|
You <b>cannot</b> modify user in the same or higher group as you.
|
||||||
</div>`
|
</div>`
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
Loading…
Reference in New Issue
Block a user