Add segment support to triggers frontend

This commit is contained in:
Jonas Düver 2018-04-25 18:15:14 +02:00
parent ae7a8eb72d
commit 006e4aa116
5 changed files with 132 additions and 74 deletions

View file

@ -17,9 +17,19 @@
<select class="form-control" name="list" required>
<option value=""> {{#translate}}Select{{/translate}} </option>
{{#each listItems}}
<option value="{{id}}">
<option value="{{id}}:0">
{{name}} <span class="text-muted"> &mdash; {{subscribers}} {{#translate}}subscribers{{/translate}}</span>
</option>
{{#if segments}}
<optgroup label="{{name}} segments">
{{#each segments}}
<option value="{{../id}}:{{id}}" {{#if selected}} selected {{/if}}>
{{../name}}: {{name}}
</option>
{{/each}}
</optgroup>
{{/if}}
{{/each}}
</select>
</div>

View file

@ -30,7 +30,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">{{#translate}}List{{/translate}}</label>
<div class="col-sm-10">
<p class="form-control-static"><a href="/lists/view/{{list.id}}">{{list.name}}</a> <span class="text-muted"> {{list.subscribers}} {{#translate}}subscribers{{/translate}}</span></p>
<p class="form-control-static"><a href="/lists/view/{{list.id}}">{{list.name}}</a> <span class="text-muted"> {{#if segment.id}} <a href="/lists/view/{{list.id}}?segment={{segment.id}}">{{segment.name}}</a>{{/if}} <span class="text-muted"> {{#if segment.id}} {{segmentSubscribers}} {{else}} {{list.subscribers}} {{/if}} {{#translate}}subscribers{{/translate}}</span><input id="segmentId" name="segmentId" type="hidden" value="{{segment.id}}"></p>
</div>
</div>

View file

@ -43,7 +43,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">{{#translate}}List{{/translate}}</label>
<div class="col-sm-10">
<p class="form-control-static"><a href="/lists/view/{{list.id}}">{{list.name}}</a> <span class="text-muted"> {{list.subscribers}} {{#translate}}subscribers{{/translate}}</span></p>
<p class="form-control-static"><a href="/lists/view/{{list.id}}">{{list.name}}</a> <span class="text-muted"> {{#if segment.id}} <a href="/lists/view/{{list.id}}?segment={{segment.id}}">{{segment.name}}</a>{{/if}} <span class="text-muted"> {{#if segment.id}} {{segmentSubscribers}} {{else}} {{list.subscribers}} {{/if}} {{#translate}}subscribers{{/translate}}</span><input id="segmentId" name="segmentId" type="hidden" value="{{segment.id}}"></p>
</div>
</div>

View file

@ -64,7 +64,7 @@
{{description}}
</td>
<td class="text-info">
<a href="/lists/view/{{list}}">{{listName}}</a>
<a href="/lists/view/{{list}}">{{listName}}</a>{{#if segment}} - <a href="/lists/view/{{list}}?segment={{segment}}">{{segmentName}}</a>{{/if}}
</td>
<td class="text-info">
{{{formatted}}}