瀏覽代碼

Fix blank UI on forms pages when there are no public lists

Kailash Nadh 4 年之前
父節點
當前提交
ee46b3d3d8
共有 2 個文件被更改,包括 11 次插入4 次删除
  1. 6 0
      frontend/src/views/Forms.vue
  2. 5 4
      i18n/en.json

+ 6 - 0
frontend/src/views/Forms.vue

@@ -2,7 +2,13 @@
   <section class="forms content relative">
   <section class="forms content relative">
     <h1 class="title is-4">{{ $t('forms.title') }}</h1>
     <h1 class="title is-4">{{ $t('forms.title') }}</h1>
     <hr />
     <hr />
+
     <b-loading v-if="loading.lists" :active="loading.lists" :is-full-page="false" />
     <b-loading v-if="loading.lists" :active="loading.lists" :is-full-page="false" />
+    <p v-else-if="publicLists.length === 0">
+      {{ $t('forms.noPublicLists') }}
+    </p>
+
+
     <div class="columns" v-else-if="publicLists.length > 0">
     <div class="columns" v-else-if="publicLists.length > 0">
       <div class="column is-4">
       <div class="column is-4">
         <h4>{{ $t('forms.publicLists') }}</h4>
         <h4>{{ $t('forms.publicLists') }}</h4>

+ 5 - 4
i18n/en.json

@@ -92,6 +92,7 @@
     "email.unsubHelp": "Don't want to receive these e-mails?",
     "email.unsubHelp": "Don't want to receive these e-mails?",
     "forms.formHTML": "Form HTML",
     "forms.formHTML": "Form HTML",
     "forms.formHTMLHelp": "Use the following HTML to show a subscription form on an external webpage. The form should have the email field and one or more `l` (list UUID) fields. The name field is optional.",
     "forms.formHTMLHelp": "Use the following HTML to show a subscription form on an external webpage. The form should have the email field and one or more `l` (list UUID) fields. The name field is optional.",
+    "forms.noPublicLists": "There are no public lists to generate a forms.",
     "forms.publicLists": "Public lists",
     "forms.publicLists": "Public lists",
     "forms.publicSubPage": "Public subscription page",
     "forms.publicSubPage": "Public subscription page",
     "forms.selectHelp": "Select lists to add to the form.",
     "forms.selectHelp": "Select lists to add to the form.",
@@ -257,12 +258,12 @@
     "public.privacyWipe": "Wipe your data",
     "public.privacyWipe": "Wipe your data",
     "public.privacyWipeHelp": "Delete all your subscriptions and related data from the database permanently.",
     "public.privacyWipeHelp": "Delete all your subscriptions and related data from the database permanently.",
     "public.sub": "Subscribe",
     "public.sub": "Subscribe",
-    "public.subTitle": "Subscribe",
-    "public.subName": "Name (optional)",
     "public.subConfirmed": "Subscribed successfully.",
     "public.subConfirmed": "Subscribed successfully.",
     "public.subConfirmedTitle": "Confirmed",
     "public.subConfirmedTitle": "Confirmed",
+    "public.subName": "Name (optional)",
     "public.subNotFound": "Subscription not found.",
     "public.subNotFound": "Subscription not found.",
     "public.subPrivateList": "Private list",
     "public.subPrivateList": "Private list",
+    "public.subTitle": "Subscribe",
     "public.unsub": "Unsubscribe",
     "public.unsub": "Unsubscribe",
     "public.unsubFull": "Also unsubscribe from all future e-mails.",
     "public.unsubFull": "Also unsubscribe from all future e-mails.",
     "public.unsubHelp": "Do you want to unsubscribe from this mailing list?",
     "public.unsubHelp": "Do you want to unsubscribe from this mailing list?",
@@ -273,10 +274,10 @@
     "settings.duplicateMessengerName": "Duplicate messenger name: {name}",
     "settings.duplicateMessengerName": "Duplicate messenger name: {name}",
     "settings.errorEncoding": "Error encoding settings: {error}",
     "settings.errorEncoding": "Error encoding settings: {error}",
     "settings.errorNoSMTP": "At least one SMTP block should be enabled",
     "settings.errorNoSMTP": "At least one SMTP block should be enabled",
-    "settings.general.enablePublicSubPage": "Enable public subscription page",
-    "settings.general.enablePublicSubPageHelp": "Show a public subscription page with all the public lists for people to subscribe.",
     "settings.general.adminNotifEmails": "Admin notification e-mails",
     "settings.general.adminNotifEmails": "Admin notification e-mails",
     "settings.general.adminNotifEmailsHelp": "Comma separated list of e-mail addresses to which admin notifications such as import updates, campaign completion, failure etc. should be sent.",
     "settings.general.adminNotifEmailsHelp": "Comma separated list of e-mail addresses to which admin notifications such as import updates, campaign completion, failure etc. should be sent.",
+    "settings.general.enablePublicSubPage": "Enable public subscription page",
+    "settings.general.enablePublicSubPageHelp": "Show a public subscription page with all the public lists for people to subscribe.",
     "settings.general.faviconURL": "Favicon URL",
     "settings.general.faviconURL": "Favicon URL",
     "settings.general.faviconURLHelp": "(Optional) full URL to the static favicon to be displayed on user facing view such as the unsubscription page.",
     "settings.general.faviconURLHelp": "(Optional) full URL to the static favicon to be displayed on user facing view such as the unsubscription page.",
     "settings.general.fromEmail": "Default `from` email",
     "settings.general.fromEmail": "Default `from` email",