diff --git a/assets/editor.less b/assets/editor.less
new file mode 100644
index 00000000..b7b8c975
--- /dev/null
+++ b/assets/editor.less
@@ -0,0 +1,61 @@
+
+.editor {
+ position: relative;
+ overflow-y: auto;
+ padding-top: 1.7em;
+ scrollbar-width: thin;
+
+ &.with-border {
+ border: 1px solid #ddd;
+ border-radius: 5px;
+ }
+
+ .content {
+ padding: 0px 5px 0px 5px;
+ flex: 1;
+ scrollbar-width: thin;
+ overflow-y: auto;
+ }
+
+ .menububble {
+ position: absolute;
+ display: flex;
+ overflow: hidden;
+ opacity: 0;
+ z-index: 1;
+ background: #dddddd;
+ transform: translateX(-50%);
+ border-radius: 3px;
+ padding: 0.07rem;
+ transition: opacity 0.2s, visibility 0.2s, left .2s, bottom .2s;
+ visibility: hidden;
+
+ &.is-active {
+ opacity: 1;
+ visibility: visible;
+ }
+ input {
+ padding: 0;
+ margin: 1px;
+ display: block;
+ border: 0;
+ color: #444;
+ font-size: .8em;
+ border-radius: 3px;
+ line-height: 100%;
+ transition: width .2s;
+ padding-left: 5px;
+ flex-grow: 1;
+ }
+
+ .fa-icon {
+ width: auto;
+ font-size: 10px;
+ height: 1.4em; /* or any other relative font sizes */
+ /* You would have to include the following two lines to make this work in Safari */
+ // max-width: 100%;
+ max-height: 100%;
+ }
+
+ }
+}
diff --git a/assets/event.less b/assets/event.less
new file mode 100644
index 00000000..85810fa6
--- /dev/null
+++ b/assets/event.less
@@ -0,0 +1,57 @@
+.event,
+.announcement {
+ width: 320px;
+ max-width: 450px;
+ flex-grow: 1;
+ margin: .2em;
+ background-color: #202020;
+ max-height: 400px;
+ overflow: hidden;
+
+ a:hover {
+ text-decoration: none;
+ .title {
+ border-bottom: 1px solid #888;
+ color: white;
+ }
+ }
+
+ .title {
+ margin-left: 1rem;
+ margin-top: 1rem;
+ margin-right: 1rem;
+ border-bottom: 1px solid #333;
+ transition: border-color .5s;
+ font-size: 1.2em;
+ max-height: 3em;
+ overflow: hidden;
+ color: #fea;
+ }
+
+ .card-footer {
+ max-height: 4.5em;
+ overflow: hidden;
+ padding: .25rem 0.5rem;
+ line-height: 1.8rem;
+ min-height: 2.2rem;
+ }
+
+ .card-body {
+ overflow: hidden;
+ }
+
+ .description {
+ color: #999;
+ font-size: 0.8em;
+ overflow: hidden;
+ max-height: 100%;
+ }
+
+ .el-image { width: 100% }
+ img {
+ width: 100%;
+ max-height: 250px;
+ object-fit: cover;
+ object-position: top;
+ }
+}
diff --git a/assets/style.less b/assets/style.less
index 09e5ed2d..2a30df46 100644
--- a/assets/style.less
+++ b/assets/style.less
@@ -30,10 +30,6 @@ html, body {
padding: 0 !important;
}
-p {
- margin-bottom: 0.5rem;
-}
-
#__nuxt, #__layout {
min-height: 100vh;
display: flex;
@@ -180,4 +176,8 @@ p {
// padding: 0px !important;
// border-radius: 0px;
// }
-// }
\ No newline at end of file
+// }
+
+
+@import './event.less';
+@import './editor.less';
\ No newline at end of file
diff --git a/components/Announcement.vue b/components/Announcement.vue
index b6dcb276..67c80cb3 100644
--- a/components/Announcement.vue
+++ b/components/Announcement.vue
@@ -1,5 +1,5 @@
- .card.announcement.event.mt-1.text-white(body-style='padding: 0px;')
+ .card.announcement.announcement.mt-1.text-white(body-style='padding: 0px;')
nuxt-link(:to='`/announcement/${announcement.id}`')
.title {{announcement.title}}
@@ -17,7 +17,7 @@ export default {
computed: {
...mapState(['announcements']),
description () {
- return this.announcement.announcement.slice(0, 500)
+ return this.announcement.announcement.replace(/(
)+/g, '
')
}
}
}
diff --git a/components/Editor.vue b/components/Editor.vue
index 74268355..264830d7 100644
--- a/components/Editor.vue
+++ b/components/Editor.vue
@@ -38,7 +38,7 @@
-
diff --git a/server/api/index.js b/server/api/index.js
index 00d423d8..cb1311fd 100644
--- a/server/api/index.js
+++ b/server/api/index.js
@@ -104,6 +104,7 @@ api.delete('/event/notification/:code', eventController.delNotification)
api.get('/settings', settingsController.getAllRequest)
api.post('/settings', isAdmin, settingsController.setRequest)
+api.get('/event/:event_id.:format?', cors, eventController.get)
api.post('/settings/favicon', isAdmin, multer({ dest: path.resolve(config.upload_path, 'thumb/') }).single('favicon'), settingsController.setFavicon)
// confirm event
diff --git a/server/helpers.js b/server/helpers.js
index a41ceab5..163e0f35 100644
--- a/server/helpers.js
+++ b/server/helpers.js
@@ -40,7 +40,7 @@ domPurify.addHook('beforeSanitizeElements', node => {
module.exports = {
sanitizeHTML (html) {
return domPurify.sanitize(html, {
- ALLOWED_TAGS: ['p', 'h1', 'h2', 'h3', 'h4', 'h5',
+ ALLOWED_TAGS: ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'br',
'h6', 'b', 'a', 'li', 'ul', 'ol', 'code', 'blockquote', 'u', 's', 'strong'],
ALLOWED_ATTR: ['href']
})