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:
commit
107ff988e8
@ -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 = {
|
||||
|
10
client/view/controls/password.js
Normal file
10
client/view/controls/password.js
Normal file
@ -0,0 +1,10 @@
|
||||
const BaseControl = require('./base');
|
||||
|
||||
class PasswordControl extends BaseControl {
|
||||
make() {
|
||||
super.make();
|
||||
this.input.setAttribute('type', 'password');
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = PasswordControl;
|
17
models/doctype/session/session.js
Normal file
17
models/doctype/session/session.js
Normal 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
|
||||
};
|
21
models/doctype/session/session.json
Normal file
21
models/doctype/session/session.json
Normal 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
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user