diff --git a/controllers/albumsController.js b/controllers/albumsController.js index 07d4743..1832350 100644 --- a/controllers/albumsController.js +++ b/controllers/albumsController.js @@ -128,6 +128,9 @@ self.list = async (req, res, next) => { album.uploads = 0 album.size = 0 album.zipSize = null + album.descriptionHtml = album.description + ? utils.md.instance.render(album.description) + : '' // Map by IDs albumids[album.id] = album diff --git a/src/css/sweetalert.scss b/src/css/sweetalert.scss index 8827251..1e3d3fd 100644 --- a/src/css/sweetalert.scss +++ b/src/css/sweetalert.scss @@ -158,3 +158,13 @@ $swal-modal-background: $grey-darker; align-items: 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 + } +} diff --git a/src/js/dashboard.js b/src/js/dashboard.js index 07f1fd0..9da4332 100644 --- a/src/js/dashboard.js +++ b/src/js/dashboard.js @@ -1797,6 +1797,7 @@ page.getAlbums = (params = {}) => { download: album.download, public: album.public, description: album.description, + descriptionHtml: album.descriptionHtml, enabled, homeDomain, urlPath, @@ -1895,8 +1896,16 @@ page.editAlbum = id => {
Max length is ${page.albumDescMaxLength} characters.
+Markdown supported. Max length is ${page.albumDescMaxLength} characters.
+ ${album.descriptionHtml + ? `Save changes then re-open this Edit prompt to refresh this preview.
+