2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00

Added Session and Password Controller

This commit is contained in:
Achilles Rasquinha 2018-02-02 14:51:20 +05:30
parent 3c5e257554
commit aeb5d8c584
4 changed files with 56 additions and 1 deletions

View File

@ -4,7 +4,8 @@ const control_classes = {
Select: require('./select'), Select: require('./select'),
Link: require('./link'), Link: require('./link'),
Float: require('./float'), Float: require('./float'),
Currency: require('./currency') Currency: require('./currency'),
Password: require('./password')
} }
module.exports = { 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,27 @@
{
"name": "Session",
"doctype": "DocType",
"is_single": 0,
"is_child": 0,
"keyword_fields": [],
"fields": [
{
"fieldname": "name",
"label": "Name",
"fieldtype": "Data",
"reqd": 1
},
{
"fieldname": "username",
"label": "Username",
"fieldtype": "Data",
"reqd": 1
},
{
"fieldname": "password",
"label": "Password",
"fieldtype": "Password",
"reqd": 1
}
]
}