2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

Merge pull request #20 from achillesrasquinha/6

Added Session and Password Controller
This commit is contained in:
Achilles Rasquinha 2018-02-02 15:13:00 +05:30 committed by GitHub
commit 107ff988e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 1 deletions

View File

@ -4,7 +4,8 @@ const control_classes = {
Select: require('./select'),
Link: require('./link'),
Float: require('./float'),
Currency: require('./currency')
Currency: require('./currency'),
Password: require('./password')
}
module.exports = {

View File

@ -0,0 +1,10 @@
const BaseControl = require('./base');
class PasswordControl extends BaseControl {
make() {
super.make();
this.input.setAttribute('type', 'password');
}
};
module.exports = PasswordControl;

View File

@ -0,0 +1,17 @@
const BaseMeta = require('frappejs/model/meta');
const BaseDocument = require('frappejs/model/document');
class SessionMeta extends BaseMeta {
setup_meta() {
Object.assign(this, require('./session.json'));
}
}
class Session extends BaseDocument {
}
module.exports = {
Document: Session,
Meta: SessionMeta
};

View File

@ -0,0 +1,21 @@
{
"name": "Session",
"doctype": "DocType",
"is_single": 0,
"is_child": 0,
"keyword_fields": [],
"fields": [
{
"fieldname": "username",
"label": "Username",
"fieldtype": "Data",
"reqd": 1
},
{
"fieldname": "password",
"label": "Password",
"fieldtype": "Password",
"reqd": 1
}
]
}