Skip to content

Commit b26950c

Browse files
committed
Add new subscription list table to the subscriber edit UI modal.
1 parent a628519 commit b26950c

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed

Diff for: frontend/src/assets/style.scss

+7-2
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,14 @@ section.lists {
657657
.toggle-advanced {
658658
margin-top: 10px;
659659
}
660+
}
660661

661-
.b-table {
662-
margin-top: 25px;
662+
.b-table.subscriptions {
663+
overflow-y: scroll;
664+
max-height: 250px;
665+
666+
thead th, tbody td {
667+
padding: 10px;
663668
}
664669
}
665670

Diff for: frontend/src/views/SubscriberForm.vue

+37-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
:selected="form.lists"
4848
:all="lists.results"
4949
></list-selector>
50-
5150
<div class="columns mb-5">
5251
<div class="column is-7">
5352
<b-field :message="$t('subscribers.preconfirmHelp')">
@@ -65,9 +64,9 @@
6564
</div>
6665
</div>
6766

68-
<b-field :label="$t('subscribers.attribs')" label-position="on-border"
69-
:message="$t('subscribers.attribsHelp') + ' ' + egAttribs">
67+
<b-field :message="$t('subscribers.attribsHelp') + ' ' + egAttribs" class="mb-5">
7068
<div>
69+
<h5>{{ $t('subscribers.attribs') }}</h5>
7170
<b-input v-model="form.strAttribs" name="attribs" type="textarea" />
7271
<a href="https://listmonk.app/docs/concepts"
7372
target="_blank" rel="noopener noreferrer" class="is-size-7">
@@ -76,6 +75,41 @@
7675
</div>
7776
</b-field>
7877

78+
<div>
79+
<h5>{{ $tc('globals.terms.subscriptions', 2) }} ({{ data.lists.length }})</h5>
80+
<div class="mb-5">
81+
<b-table :data="data.lists" hoverable default-sort="createdAt" class="subscriptions"
82+
>
83+
<b-table-column v-slot="props" field="name"
84+
:label="$tc('globals.terms.list', 1)">
85+
<div>
86+
<router-link :to="`/lists/${props.row.id}`">
87+
{{ props.row.name }}
88+
</router-link>
89+
<br />
90+
<b-tag :class="props.row.optin" :data-cy="`optin-${props.row.optin}`">
91+
<b-icon :icon="props.row.optin === 'double' ?
92+
'account-check-outline' : 'account-off-outline'" size="is-small" />
93+
{{ ' ' }}
94+
{{ $t(`lists.optins.${props.row.optin}`) }}
95+
</b-tag>{{ ' ' }}
96+
</div>
97+
</b-table-column>
98+
<b-table-column v-slot="props" field="status" :label="$t('globals.fields.status')">
99+
{{ props.row.optin === 'double' ? props.row.subscriptionStatus : '-' }}
100+
</b-table-column>
101+
<b-table-column v-slot="props" field="createdAt"
102+
:label="$t('globals.fields.createdAt')">
103+
{{ $utils.niceDate(props.row.subscriptionCreatedAt, true) }}
104+
</b-table-column>
105+
<b-table-column v-slot="props" field="updatedAt"
106+
:label="$t('globals.fields.updatedAt')">
107+
{{ $utils.niceDate(props.row.subscriptionCreatedAt, true) }}
108+
</b-table-column>
109+
</b-table>
110+
</div>
111+
</div>
112+
79113
<div class="bounces" v-show="bounces.length > 0">
80114
<a href="#" class="is-size-6" disabed="true"
81115
@click.prevent="toggleBounces">

Diff for: frontend/src/views/Subscribers.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
</div>
7272
</section><!-- control -->
7373

74+
<br />
7475
<b-table
7576
:data="subscribers.results"
7677
:loading="loading.subscribers"
@@ -200,7 +201,7 @@
200201
</b-modal>
201202

202203
<!-- Add / edit form modal -->
203-
<b-modal scroll="keep" :aria-modal="true" :active.sync="isFormVisible" :width="600"
204+
<b-modal scroll="keep" :aria-modal="true" :active.sync="isFormVisible" :width="800"
204205
@close="onFormClose">
205206
<subscriber-form :data="curItem" :isEditing="isEditing"
206207
@finished="querySubscribers"></subscriber-form>

0 commit comments

Comments
 (0)