mailtrain/views/lists/fields/create.hbs
2017-03-07 16:30:56 +02:00

93 lines
5.8 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<ol class="breadcrumb">
<li><a href="/">{{#translate}}Home{{/translate}}</a></li>
<li><a href="/lists/">{{#translate}}Lists{{/translate}}</a></li>
<li><a href="/lists/view/{{list.id}}">{{list.name}}</a></li>
<li><a href="/fields/{{list.id}}">{{#translate}}Custom Fields{{/translate}}</a></li>
<li class="active">{{#translate}}Create Field{{/translate}}</li>
</ol>
<h2>{{list.name}} <small>{{#translate}}Create Custom Field{{/translate}}</small></h2>
<hr>
<form class="form-horizontal" method="post" action="/fields/{{list.id}}/create">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
<div class="form-group">
<label for="name" class="col-sm-2 control-label">{{#translate}}Field Name{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control input-lg" name="name" id="name" value="{{name}}" placeholder="{{#translate}}Field Name{{/translate}}" required>
</div>
</div>
<div class="form-group">
<label for="type" class="col-sm-2 control-label">{{#translate}}Field Type{{/translate}}</label>
<div class="col-sm-10">
<select class="form-control" name="type">
<option value="text" {{#if selectedText}} selected {{/if}}>{{#translate}}Text{{/translate}}</option>
<option value="number" {{#if selectedNumber}} selected {{/if}}>{{#translate}}Number{{/translate}}</option>
<option value="website" {{#if selectedWebsite}} selected {{/if}}>{{#translate}}Website{{/translate}}</option>
<option value="gpg" {{#if selectedGpg}} selected {{/if}}>{{#translate}}GPG Public Key{{/translate}}</option>
<option value="longtext" {{#if selectedLongtext}} selected {{/if}}>{{#translate}}Multi-line text{{/translate}}</option>
<option value="json" {{#if selectedJson}} selected {{/if}}>{{#translate}}JSON{{/translate}}</option>
<optgroup label="{{#translate}}Date{{/translate}}">
<option value="date-us" {{#if selectedDateUs}} selected {{/if}}>{{#translate}}Date (MM/DD/YYYY){{/translate}}</option>
<option value="date-eur" {{#if selectedDateEur}} selected {{/if}}>{{#translate}}Date (DD/MM/YYYY){{/translate}}</option>
</optgroup>
<optgroup label="{{#translate}}Birthday{{/translate}}">
<option value="birthday-us" {{#if selectedBirthdayUs}} selected {{/if}}>{{#translate}}Birthday (MM/DD){{/translate}}</option>
<option value="birthday-eur" {{#if selectedBirthdayEur}} selected {{/if}}>{{#translate}}Birthday (DD/MM){{/translate}}</option>
</optgroup>
<optgroup label="{{#translate}}Grouped{{/translate}}">
<option value="dropdown" {{#if selectedDropdown}} selected {{/if}}>{{#translate}}Drop Downs{{/translate}}</option>
<option value="radio" {{#if selectedRadio}} selected {{/if}}>{{#translate}}Radio Buttons{{/translate}}</option>
<option value="checkbox" {{#if selectedCheckbox}} selected {{/if}}>{{#translate}}Checkboxes{{/translate}}</option>
</optgroup>
<option value="option" {{#if selectedOption}} selected {{/if}}>{{#translate}}Option for a group value{{/translate}}</option>
</select>
</div>
</div>
<div class="form-group">
<label for="group" class="col-sm-2 control-label">{{#translate}}Group{{/translate}}</label>
<div class="col-sm-10">
<select class="form-control" name="group">
<option value=""> {{#translate}}Select{{/translate}} </option>
{{#each groups}}
<option value="{{id}}" {{#if selected}} selected {{/if}}>{{name}}</option>
{{/each}}
</select>
<span class="help-block">{{#translate}}Required for group options{{/translate}}</span>
</div>
</div>
<div class="form-group">
<label for="default-value" class="col-sm-2 control-label">{{#translate}}Default merge tag value{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="default-value" id="default-value" value="{{field.defaultValue}}" placeholder="{{#translate}}Default merge tag value{{/translate}}">
</div>
</div>
<div class="form-group">
<label for="group-template" class="col-sm-2 control-label">{{#translate}}Template{{/translate}}</label>
<div class="col-sm-10">
<textarea class="form-control gpg-text" rows="3" name="group-template" id="group-template">{{field.groupTemplate}}</textarea>
<span class="help-block">{{#translate}}For group elements like checkboxes you can control the appearance of the merge tag with an optional template. The template uses handlebars syntax and you can find all values from <code>\{{values}}</code> array, for example <code>\{{#each values}} \{{this}} \{{/each}}</code>. If template is not defined then multiple values are joined with commas. You can also use this template to render JSON values (if the JSON is an array then the array is exposed as <code>values</code>, otherwise you can access the JSON keys directly).{{/translate}}</span>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-xs-4">
<div class="checkbox">
<label>
<input type="checkbox" name="visible" {{#if visible}} checked {{/if}}> {{#translate}}Visible{{/translate}}
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> {{#translate}}Add Field{{/translate}}</button>
</div>
</div>
</form>