diff --git a/api/app/Models/Forms/Form.php b/api/app/Models/Forms/Form.php index 42b6f2ec..afecd4b2 100644 --- a/api/app/Models/Forms/Form.php +++ b/api/app/Models/Forms/Form.php @@ -223,7 +223,7 @@ class Form extends Model implements CachableAttributes public function getIsClosedAttribute() { - return $this->closes_at && now()->gt($this->closes_at); + return $this->visibility === 'closed' || ($this->closes_at && now()->gt($this->closes_at)); } public function getFormPendingSubmissionKeyAttribute() diff --git a/client/components/forms/components/QuillyEditor.vue b/client/components/forms/components/QuillyEditor.vue index 94978277..1d0a43f7 100644 --- a/client/components/forms/components/QuillyEditor.vue +++ b/client/components/forms/components/QuillyEditor.vue @@ -8,6 +8,7 @@ \ No newline at end of file diff --git a/client/lib/quill/quillPatches.js b/client/lib/quill/quillPatches.js new file mode 100644 index 00000000..3811237b --- /dev/null +++ b/client/lib/quill/quillPatches.js @@ -0,0 +1,22 @@ +import Quill from 'quill' + +// Self-executing function to patch Quill's prototype +;(function installQuillFixes() { + // Store the original method + const originalGetSemanticHTML = Quill.prototype.getSemanticHTML + + // Override the getSemanticHTML method + Quill.prototype.getSemanticHTML = function(index = 0, length) { + // Call the original method + const html = originalGetSemanticHTML.call(this, index, length || this.getLength()) + + // Apply fixes: + return html + // 1. Replace   with regular spaces + .replace(/ /g, ' ') + // 2. Fix line breaks by replacing empty paragraphs with paragraphs containing
+ .replace(/

<\/p>/g, '


') + } +})() + +export default {} \ No newline at end of file diff --git a/client/pages/forms/[slug]/show.vue b/client/pages/forms/[slug]/show.vue index 3d4d6c24..fc44bdf9 100644 --- a/client/pages/forms/[slug]/show.vue +++ b/client/pages/forms/[slug]/show.vue @@ -78,60 +78,11 @@ - Edited {{ form.last_edited_human }}

-
- - Draft - not publicly accessible - - - Closed - won't accept new submissions - - - {{ tag }} - -
- -

- - This form stopped accepting submissions on the - {{ displayClosesDate }} - - - This form will stop accepting submissions on the - {{ displayClosesDate }} - -

-

- - The form is now closed because it reached its limit of - {{ form.max_submissions_count }} submissions. - - - This form will stop accepting submissions after - {{ form.max_submissions_count }} submissions. - -

+ + formsStore.getByKey(slug)) const workspace = computed(() => workspacesStore.getCurrent) const loading = computed(() => formsStore.loading || workspacesStore.loading) -const displayClosesDate = computed(() => { - if (form.value && form.value.closes_at) { - const dateObj = new Date(form.value.closes_at) - return ( - dateObj.getFullYear() + - "-" + - String(dateObj.getMonth() + 1).padStart(2, "0") + - "-" + - String(dateObj.getDate()).padStart(2, "0") + - " " + - String(dateObj.getHours()).padStart(2, "0") + - ":" + - String(dateObj.getMinutes()).padStart(2, "0") - ) - } - return "" -}) const tabsList = [ { diff --git a/client/pages/home.vue b/client/pages/home.vue index 5d155aae..d3e148f9 100644 --- a/client/pages/home.vue +++ b/client/pages/home.vue @@ -153,30 +153,13 @@ {{ form?.creator?.name }} -
- - Draft - - - Closed - - - {{ tag }} - -
+ + +