mailtrain/views/campaigns/edit.hbs

236 lines
12 KiB
Handlebars
Raw Normal View History

2016-04-04 12:36:30 +00:00
<ol class="breadcrumb">
2017-03-07 14:30:56 +00:00
<li><a href="/">{{#translate}}Home{{/translate}}</a></li>
<li><a href="/campaigns">{{#translate}}Campaigns{{/translate}}</a></li>
{{#if parent}}
<li><a href="/campaigns/view/{{parent.id}}">{{parent.name}}</a></li>
{{/if}}
2016-04-04 12:36:30 +00:00
<li><a href="/campaigns/view/{{id}}">{{name}}</a></li>
2017-03-07 14:30:56 +00:00
<li class="active">{{#translate}}Edit Campaign{{/translate}}</li>
2016-04-04 12:36:30 +00:00
</ol>
2017-03-07 14:30:56 +00:00
<h2>{{#translate}}Edit Campaign{{/translate}} <a class="btn btn-default btn-xs" href="/campaigns/view/{{id}}" role="button"><span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> {{#translate}}View campaign{{/translate}}</a></h2>
2016-04-04 12:36:30 +00:00
<hr>
<form method="post" class="delete-form" id="campaigns-delete" action="/campaigns/delete">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
<input type="hidden" name="id" value="{{id}}" />
</form>
2016-09-09 19:12:03 +00:00
{{#each attachments}}
<form method="post" id="attachment-download-{{id}}" action="/campaigns/attachment/download">
<input type="hidden" name="_csrf" value="{{../csrfToken}}">
<input type="hidden" name="id" value="{{../id}}" />
<input type="hidden" name="attachment" value="{{id}}" />
</form>
<form method="post" class="delete-form" id="attachment-delete-{{id}}" action="/campaigns/attachment/delete">
<input type="hidden" name="_csrf" value="{{../csrfToken}}">
<input type="hidden" name="id" value="{{../id}}" />
<input type="hidden" name="attachment" value="{{id}}" />
</form>
{{/each}}
2016-04-04 12:36:30 +00:00
<form class="form-horizontal" method="post" action="/campaigns/edit">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
<input type="hidden" name="id" value="{{id}}" />
<div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
2017-03-07 14:30:56 +00:00
<li role="presentation" class="{{#if showGeneral}}active{{/if}}"><a href="#general" aria-controls="general" role="tab" data-toggle="tab">{{#translate}}General{{/translate}}</a></li>
<li role="presentation" class="{{#if showTemplate}}active{{/if}}"><a href="#template" aria-controls="template" role="tab" data-toggle="tab">{{#translate}}Template{{/translate}}</a></li>
<li role="presentation" class="{{#if showAttachments}}active{{/if}}"><a href="#attachments" aria-controls="attachments" role="tab" data-toggle="tab">{{#translate}}Attachments{{/translate}}{{#if attachments}} <span class="badge">{{attachments.length}}</span>{{/if}}</a></li>
2016-04-04 12:36:30 +00:00
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane {{#if showGeneral}}active{{/if}}" id="general">
<p></p>
<fieldset>
<legend>
2017-03-07 14:30:56 +00:00
{{#translate}}General Settings{{/translate}}
2016-04-04 12:36:30 +00:00
</legend>
<div class="form-group">
2017-03-07 14:30:56 +00:00
<label for="name" class="col-sm-2 control-label">{{#translate}}Name{{/translate}}</label>
2016-04-04 12:36:30 +00:00
<div class="col-sm-10">
2017-03-07 14:30:56 +00:00
<input type="text" class="form-control input-lg" name="name" id="name" value="{{name}}" placeholder="{{#translate}}Campaign Name{{/translate}}" autofocus required>
2016-04-04 12:36:30 +00:00
</div>
</div>
<div class="form-group">
2017-03-07 14:30:56 +00:00
<label for="description" class="col-sm-2 control-label">{{#translate}}Description{{/translate}}</label>
2016-04-04 12:36:30 +00:00
<div class="col-sm-10">
<textarea class="form-control" rows="3" name="description" id="description">{{description}}</textarea>
2017-03-07 14:30:56 +00:00
<span class="help-block">{{#translate}}HTML is allowed{{/translate}}</span>
2016-04-04 12:36:30 +00:00
</div>
</div>
<div class="form-group">
2017-03-07 14:30:56 +00:00
<label for="list" class="col-sm-2 control-label">{{#translate}}List{{/translate}}</label>
2016-04-04 12:36:30 +00:00
<div class="col-sm-10">
<select class="form-control" id="list" name="list" required>
2017-03-07 14:30:56 +00:00
<option value=""> {{#translate}}Select{{/translate}} </option>
2016-04-04 12:36:30 +00:00
{{#each listItems}}
<option value="{{id}}" {{#if selected}} selected {{/if}}>
2017-03-07 14:30:56 +00:00
{{name}} <span class="text-muted"> &mdash; {{subscribers}} {{#translate}}subscribers{{/translate}}</span>
2016-04-04 12:36:30 +00:00
</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>
</div>
<hr />
<div class="form-group">
2017-03-07 14:30:56 +00:00
<label for="from" class="col-sm-2 control-label">{{#translate}}Email "from name"{{/translate}}</label>
2016-04-04 12:36:30 +00:00
<div class="col-sm-10">
2017-03-07 14:30:56 +00:00
<input type="text" class="form-control" name="from" id="from" value="{{from}}" placeholder="{{#translate}}This is the name your emails will come from{{/translate}}" required>
2016-04-04 12:36:30 +00:00
</div>
</div>
<div class="form-group">
2017-03-07 14:30:56 +00:00
<label for="address" class="col-sm-2 control-label">{{#translate}}Email "from" address{{/translate}}</label>
2016-04-04 12:36:30 +00:00
<div class="col-sm-10">
2017-03-07 14:30:56 +00:00
<input type="email" class="form-control" name="address" id="address" value="{{address}}" placeholder="{{#translate}}This is the address people will send replies to unless reply-to address is set{{/translate}}" required>
</div>
</div>
<div class="form-group">
2017-03-07 14:30:56 +00:00
<label for="reply-to" class="col-sm-2 control-label">{{#translate}}Email "reply-to" address{{/translate}}</label>
<div class="col-sm-10">
2017-03-07 14:30:56 +00:00
<input type="email" class="form-control" name="reply-to" id="reply-to" value="{{replyTo}}" placeholder="{{#translate}}If set, this is the address people will send replies to{{/translate}}">
2016-04-04 12:36:30 +00:00
</div>
</div>
<div class="form-group">
2017-03-07 14:30:56 +00:00
<label for="subject" class="col-sm-2 control-label">{{#translate}}Email "subject line"{{/translate}}</label>
2016-04-04 12:36:30 +00:00
<div class="col-sm-10">
2017-03-07 14:30:56 +00:00
<input type="text" class="form-control" name="subject" id="subject" value="{{subject}}" placeholder="{{#translate}}Keep it relevant and non-spammy{{/translate}}" required>
2016-04-04 12:36:30 +00:00
</div>
</div>
2016-09-08 11:39:41 +00:00
<div class="col-sm-offset-2">
<div class="checkbox">
<label>
2017-03-07 14:30:56 +00:00
<input type="checkbox" name="tracking-disabled" value="1" {{#if trackingDisabled}} checked {{/if}}> {{#translate}}Disable clicked/opened tracking{{/translate}}
2016-09-08 11:39:41 +00:00
</label>
</div>
</div>
2016-04-04 12:36:30 +00:00
</fieldset>
</div>
<div role="tabpanel" class="tab-pane {{#if showTemplate}}active{{/if}}" id="template">
<p></p>
<fieldset>
<legend>
2017-03-07 14:30:56 +00:00
{{#translate}}Template Settings{{/translate}}
2016-04-04 12:36:30 +00:00
</legend>
2016-04-30 15:19:48 +00:00
{{#if sourceUrl}}
<div class="form-group">
2017-03-07 14:30:56 +00:00
<label for="source-url" class="col-sm-2 control-label">{{#translate}}Template URL{{/translate}}</label>
<div class="col-sm-10">
2016-04-30 15:19:48 +00:00
<input type="url" class="form-control" name="source-url" id="source-url" value="{{sourceUrl}}" placeholder="http://example.com/message-render.php">
2017-03-07 14:30:56 +00:00
<span class="help-block">{{#translate}}If a message is sent then this URL will be POSTed to using Merge Tags as POST body. Use this if you want to generate the HTML message yourself{{/translate}}</span>
</div>
</div>
{{else}}
{{> merge_tag_reference}}
2016-04-04 12:36:30 +00:00
2017-03-05 00:54:09 +00:00
{{> plaintext}}
2016-04-04 12:36:30 +00:00
2017-03-02 17:52:40 +00:00
{{#if disableWysiwyg}}
2017-03-05 00:54:09 +00:00
{{> codeeditor}}
2017-03-02 17:52:40 +00:00
{{else}}
2017-03-05 00:54:09 +00:00
{{> (lookup . 'editorName') }}
2017-03-02 17:52:40 +00:00
{{/if}}
{{/if}}
2016-04-04 12:36:30 +00:00
</fieldset>
</div>
2016-09-09 19:12:03 +00:00
<div role="tabpanel" class="tab-pane {{#if showAttachments}}active{{/if}}" id="attachments">
<p></p>
<fieldset>
<legend>
2017-03-07 14:30:56 +00:00
{{#translate}}Attachments{{/translate}}
2016-09-09 19:12:03 +00:00
</legend>
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<th class="col-md-1">
#
</th>
<th>
2017-03-07 14:30:56 +00:00
{{#translate}}File{{/translate}}
2016-09-09 19:12:03 +00:00
</th>
<th class="col-md-1">
2017-03-07 14:30:56 +00:00
{{#translate}}Size{{/translate}}
2016-09-09 19:12:03 +00:00
</th>
<th class="col-md-1">
&nbsp;
</th>
</thead>
<tbody>
{{#if attachments}}
{{#each attachments}}
<tr>
<td>
{{index}}
</td>
<td>
<button type="submit" form="attachment-download-{{id}}" class="btn btn-link btn-xs"><i class="glyphicon glyphicon-cloud-download"></i> {{filename}}</button>
</td>
<td>
{{size}}
</td>
<td>
<button type="submit" form="attachment-delete-{{id}}" class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-remove"></i> Delete</button>
</td>
</tr>
{{/each}}
{{else}}
<tr>
<td colspan="4">
2017-03-07 14:30:56 +00:00
{{#translate}}No data available in table{{/translate}}
2016-09-09 19:12:03 +00:00
</td>
</tr>
{{/if}}
</tbody>
</table>
</div>
<div class="pull-right">
2017-03-07 14:30:56 +00:00
<a class="btn btn-info btn-sm" href="/campaigns/attachment/{{id}}" role="button"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> {{#translate}}Add Attachment{{/translate}}</a>
2016-09-09 19:12:03 +00:00
</div>
</fieldset>
</div>
2016-04-04 12:36:30 +00:00
</div>
2016-09-09 19:12:03 +00:00
<hr/>
2016-04-04 12:36:30 +00:00
2016-09-09 19:12:03 +00:00
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="pull-right">
2017-03-07 14:30:56 +00:00
<button type="submit" form="campaigns-delete" class="btn btn-danger"><i class="glyphicon glyphicon-remove"></i> {{#translate}}Delete Campaign{{/translate}}</button>
2016-09-09 19:12:03 +00:00
</div>
2017-03-07 14:30:56 +00:00
<button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-ok"></i> {{#translate}}Update{{/translate}}</button>
2016-04-04 12:36:30 +00:00
</div>
</div>
</div>
</form>