119 lines
7.2 KiB
Handlebars
119 lines
7.2 KiB
Handlebars
<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}}Edit Field{{/translate}}</li>
|
||
</ol>
|
||
|
||
<h2>{{list.name}} <small>{{#translate}}Edit Custom Field{{/translate}}</small> <a class="btn btn-default btn-xs" href="/fields/{{list.id}}" role="button"><span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> {{#translate}}Back to fields{{/translate}}</a></h2>
|
||
|
||
<hr>
|
||
|
||
<form method="post" class="delete-form" id="fields-delete" action="/fields/{{list.id}}/delete">
|
||
<input type="hidden" name="_csrf" value="{{csrfToken}}">
|
||
<input type="hidden" name="id" value="{{field.id}}" />
|
||
</form>
|
||
|
||
<form class="form-horizontal" method="post" action="/fields/{{list.id}}/edit">
|
||
<input type="hidden" name="_csrf" value="{{csrfToken}}">
|
||
<input type="hidden" name="id" value="{{field.id}}" />
|
||
|
||
<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="{{field.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" disabled>
|
||
<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>
|
||
|
||
{{#if groups}}
|
||
|
||
<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>
|
||
|
||
{{/if}}
|
||
|
||
<div class="form-group">
|
||
<label for="key" class="col-sm-2 control-label">{{#translate}}Merge tag{{/translate}}</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control text-uppercase" name="key" id="key" value="{{field.key}}" placeholder="{{#translate}}Merge Tag{{/translate}}">
|
||
<span class="help-block">{{#translate}}Put this tag in your content:{{/translate}} <strong>[{{#if field.key}}{{field.key}}{{else}}TAG_VALUE{{/if}}]</strong></span>
|
||
</div>
|
||
</div>
|
||
|
||
{{#if field.isGroup}}
|
||
|
||
<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="description">{{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>
|
||
|
||
{{else}}
|
||
<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>
|
||
{{/if}}
|
||
|
||
<div class="form-group">
|
||
<div class="col-sm-offset-2 col-xs-4">
|
||
<div class="checkbox">
|
||
<label>
|
||
<input type="checkbox" name="visible" {{#if field.visible}} checked {{/if}}> {{#translate}}Visible{{/translate}}
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="col-sm-offset-2 col-sm-10">
|
||
<div class="pull-right">
|
||
<button type="submit" form="fields-delete" class="btn btn-danger"><i class="glyphicon glyphicon-remove"></i> {{#translate}}Delete Field{{/translate}}</button>
|
||
</div>
|
||
<button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-ok"></i> {{#translate}}Update{{/translate}}</button>
|
||
</div>
|
||
</div>
|
||
</form>
|