passman/templates/views/partials/forms/edit_credential/custom_fields.html

76 lines
3 KiB
HTML
Raw Normal View History

2016-09-13 22:31:07 +08:00
<div class="row">
<div class="col-xs-12 col-md-4">
2016-12-20 06:51:15 +08:00
<label>{{ 'field.label' | translate}}</label>
2016-09-13 22:31:07 +08:00
<input type="text" ng-model="new_custom_field.label">
</div>
<div class="col-xs-10 col-md-6 field-value">
<div class="row">
<div class="col-xs-12">
2016-12-20 06:51:15 +08:00
<label>{{ 'field.value' | translate}}</label>
</div>
</div>
<div class="row">
<div class="col-xs-8 valueInput">
<input type="text" ng-model="new_custom_field.value" ng-show="new_custom_field.field_type === 'text'">
<password-gen ng-model="new_custom_field.value" ng-show="new_custom_field.field_type ==='password'"
settings="{generateOnCreate: false }" ></password-gen>
<span ng-show="new_custom_field.field_type ==='file'">
<input id="custom_field_file" class="inputfile" type="file" file-select success="addFileToCustomField" error="fileLoadError" progress="fileSelectProgress">
2016-12-20 06:51:15 +08:00
<label for="custom_field_file"><i class="fa fa-upload" aria-hidden="true"></i> {{ new_custom_field.value.filename || 'select.file' | translate}}</label>
</span>
</div>
<div class="col-xs-4 selectType">
<select class="form-control" ng-model="new_custom_field.field_type">
2016-12-20 06:51:15 +08:00
<option value="text">{{ 'text' | translate}}</option>
<option value="password">{{ 'password' | translate}}</option>
<option value="file">{{ 'file' | translate}}</option>
</select>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<ng-password-meter ng-if="new_custom_field.field_type ==='password'"
password="new_custom_field.value"></ng-password-meter>
</div>
</div>
2016-09-13 22:31:07 +08:00
</div>
<div class="col-xs-2 col-md-2">
2016-12-20 06:51:15 +08:00
<label class="invisible">{{'add' | translate}}</label>
2016-09-13 22:31:07 +08:00
<button ng-click="addCustomField()">+</button>
</div>
</div>
<div class="row custom_fields" ng-if="storedCredential.custom_fields.length > 0">
2016-09-14 05:03:12 +08:00
<div class="col-xs-12 table">
2016-09-13 22:31:07 +08:00
<table>
<thead>
2016-09-14 21:09:55 +08:00
<tr use-theme>
<td class="dragger"></td>
2016-12-20 06:51:15 +08:00
<th class="field_label">{{ 'label' | translate}}</th>
<th class="field_value">{{ 'value' | translate}}</th>
<th class="field_secret">{{ 'type' | translate}}</th>
<th class="field_actions">{{ 'actions' | translate}}</th>
2016-09-13 22:31:07 +08:00
</tr>
</thead>
<tbody ui-sortable ng-model="storedCredential.custom_fields">
2016-09-13 22:31:07 +08:00
<tr ng-repeat="field in storedCredential.custom_fields">
<td class="dragger">
<i class="fa fa-arrows-v"></i>
</td>
2016-09-13 22:31:07 +08:00
<td>
2016-09-14 05:03:12 +08:00
<a href="#" editable-text="field.label">{{ field.label || "empty" }}</a>
2016-09-13 22:31:07 +08:00
</td>
<td>
2016-12-20 06:51:15 +08:00
<span ng-if="field.field_type === 'text'"><a href="#" editable-text="field.value">{{ field.value || 'empty' | translate }}</a></span>
<span ng-if="field.field_type === 'password'"><a href="#" editable-password="field.value"><span ng-repeat="n in [] | range:field.value.length">*</span></a></span>
<span ng-if="field.field_type === 'file'">{{field.value.filename}} ({{field.value.size | bytes}})</span>
2016-09-13 22:31:07 +08:00
</td>
<td>{{ field.field_type }}</td>
2016-09-13 22:31:07 +08:00
<td class="field_actions">
2016-09-14 05:03:12 +08:00
<i class="fa fa-trash" ng-click="deleteCustomField(field)"></i>
2016-09-13 22:31:07 +08:00
</td>
</tr>
</tbody>
2016-09-13 22:31:07 +08:00
</table>
</div>
</div>