This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
barkshark-web/barkshark_web/localweb/page/password-edit.haml

43 lines
1.7 KiB
Plaintext

-if password
-set page = 'Edit Password: ' + password.label
-set action = var.local + '/passwords/update/' + str(password.id)
-else
-set page = 'New Password'
-set action = var.local + '/passwords/update'
-extends 'base.haml'
-block meta
%link rel='stylesheet' type='text/css' href='{{var.local}}/css/passwords.css'
-block content
%form#password-edit action='{{action}}' method='GET'
%input type='hidden' name='redir' value='/passwords'
.grid-container
%label.grid-item for='label' << Label
%input.grid-item id='label' class='full-width' type='text' name='label' placeholder='label' value='{{password.label or ""}}'
%label.grid-item for='username' << Username
%input.grid-item id='username' class='full-width' type='text' name='username' placeholder='username' value='{{password.username}}'
%label.grid-item for='password' << Password
%input#password.grid-item id='password' class='full-width' type='password' name='password' placeholder='password' value='{{password.password}}'
%label.grid-item for='url' << Url
%input.grid-item id='url' class='full-width' type='text' name='url' placeholder='url' value='{{password.url or ""}}'
%label.grid-item for='note' << Note
%textarea.grid-item id='note', class='full-width', name='note', placeholder='note' << {{password.note or ""}}
.buttons.edit
%a.button onclick='javascript:document.getElementsByTagName("form")[0].submit();' << Save
-if password.id
%a.button onclick='window.location="{{var.local}}/passwords/delete/{{password.id}}?redir=/passwords"' << Delete
%a.button onclick='window.location.href="{{var.local}}/passwords"' << Cancel
%script type='application/javascript'
setup_password_handlers()