diff options
Diffstat (limited to 'html/browser_action/views/edit_credential.html')
-rw-r--r-- | html/browser_action/views/edit_credential.html | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/html/browser_action/views/edit_credential.html b/html/browser_action/views/edit_credential.html index ae0cd33..8e9f44d 100644 --- a/html/browser_action/views/edit_credential.html +++ b/html/browser_action/views/edit_credential.html @@ -6,21 +6,21 @@ <div class="tab-content" ng-class="{'active': tabActive === 1}"> <div class="group"> <copy-text text="credential.label"></copy-text> - <input type="text" ng-model="credential.label" required> + <input type="text" ng-model="credential.label" ng-disabled="!canEdit" required> <span class="highlight"></span> <span class="bar"></span> <label>{{'label' | translate}}</label> </div> <div class="group"> <copy-text text="credential.username"></copy-text> - <input type="text" ng-model="credential.username"> + <input type="text" ng-model="credential.username" ng-disabled="!canEdit"> <span class="highlight"></span> <span class="bar"></span> <label>{{'username' | translate}}</label> </div> <div class="group"> <copy-text text="credential.email"></copy-text> - <input type="text" ng-model="credential.email"> + <input type="text" ng-model="credential.email" ng-disabled="!canEdit"> <span class="highlight"></span> <span class="bar"></span> <label>{{ 'email' | translate}}</label> @@ -30,25 +30,31 @@ <i class="mdi mdi-refresh pointer" ng-click="generatePassword()"></i> <i class="pointer mdi" ng-class="{'mdi-eye': !pwFieldShown, 'mdi-eye-off': pwFieldShown}" ng-click="togglePwField()"></i> - <input type="text" ng-model="credential.password" ng-if="pwFieldShown"> - <input type="password" ng-model="credential.password" ng-if="!pwFieldShown"> + <input type="text" ng-model="credential.password" ng-if="pwFieldShown" ng-disabled="!canEdit"> + <input type="password" ng-model="credential.password" ng-if="!pwFieldShown" ng-disabled="!canEdit"> <span class="highlight"></span> <span class="bar"></span> <label>{{'password' | translate}}</label> </div> <div class="group"> - <input type="password" ng-model="credential.password_repeat"> + <input type="password" ng-model="credential.password_repeat" ng-disabled="!canEdit"> <span class="highlight"></span> <span class="bar"></span> <label>{{'password_repeat' | translate}}</label> </div> <div class="group"> <copy-text text="credential.url"></copy-text> - <input type="text" ng-model="credential.url"> + <input type="text" ng-model="credential.url" ng-disabled="!canEdit"> <span class="highlight"></span> <span class="bar"></span> <label>{{'url' | translate}}</label> </div> + + <div ng-show="!canEdit" class="alert alert-info"> + {{ 'edit_insufficient_permissions' | translate }} + + </div> + <div style="margin-left: -15px;" ng-include="'save_btn.html'"></div> </div> </div> @@ -60,7 +66,7 @@ <div class="custom_field" ng-repeat="custom_field in credential.custom_fields" ng-if="custom_field.field_type !== 'file'"> <div class="field"> <div class="group"> - <input type="text" ng-model="custom_field.label"> + <input type="text" ng-model="custom_field.label" ng-disabled="!canEdit"> <span class="highlight"></span> <span class="bar"></span> </div> @@ -68,8 +74,8 @@ <div class="field"> <div class="group"> <i class="mdi mdi-delete"></i> - <input type="password" ng-model="custom_field.value" ng-if="custom_field.field_type === 'password'"> - <input type="text" ng-model="custom_field.value" ng-if="custom_field.field_type === 'text'"> + <input type="password" ng-model="custom_field.value" ng-if="custom_field.field_type === 'password'" ng-disabled="!canEdit"> + <input type="text" ng-model="custom_field.value" ng-if="custom_field.field_type === 'text'" ng-disabled="!canEdit"> <span class="highlight"></span> <span class="bar"></span> </div> @@ -78,7 +84,7 @@ <h4 style="margin-left: 5px; margin-bottom: 30px;">Add custom field</h4> <div class="col33" style="padding-left: 0"> <div class="group"> - <input type="text" ng-model="new_custom_field.label" placeholder="Label"> + <input type="text" ng-model="new_custom_field.label" placeholder="Label" ng-disabled="!canEdit"> <span class="highlight"></span> <span class="bar"></span> <label>{{'label' | translate}}</label> @@ -87,7 +93,7 @@ <div class="col33"> <div class="group"> <input type="password" ng-model="new_custom_field.value" ng-if="new_custom_field.field_type === 'password'"> - <input type="text" ng-model="new_custom_field.value" ng-if="new_custom_field.field_type === 'text'" placeholder="Value"> + <input type="text" ng-model="new_custom_field.value" ng-if="new_custom_field.field_type === 'text'" placeholder="Value" ng-disabled="!canEdit"> <span class="highlight"></span> <span class="bar"></span> <label>{{'value' | translate}}</label> @@ -95,7 +101,7 @@ </div> <div class="col33"> <div class="group"> - <select class="input-md" name="type" ng-model="new_custom_field.field_type"> + <select class="input-md" name="type" ng-model="new_custom_field.field_type" ng-disabled="!canEdit"> <option value="text">Text</option> <option value="password">Password</option> </select> @@ -119,7 +125,7 @@ <div class="clearfix"></div> <script type="text/ng-template" id="save_btn.html"> - <button class="md-btn default" ng-click="saveCredential()" ng-disabled="saving"> + <button class="md-btn default" ng-click="saveCredential()" ng-disabled="saving || !canEdit"> <span> <i ng-show="saving" ng-class="{'fa-spinner fa-spin': saving}" |