2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00

add new model, account

This commit is contained in:
Rushabh Mehta 2018-01-23 13:30:08 +05:30
parent 5c15ed23f0
commit 55e4a350e3
6 changed files with 212 additions and 174 deletions

View File

@ -7,13 +7,16 @@ client.start({
server: 'localhost:8000',
container: document.querySelector('.wrapper'),
}).then(() => {
const todo = require('frappejs/models/doctype/todo/todo.js');
frappe.init_controller('todo', todo);
frappe.todo_module = require('frappejs/models/doctype/todo/todo.js');
frappe.account_module = require('./models/doctype/account/account.js');
frappe.desk.add_sidebar_item('Home', '#');
frappe.desk.add_sidebar_item('New ToDo', '#new/todo');
frappe.init_controller('account', frappe.account_module);
frappe.init_controller('todo', frappe.todo_module);
frappe.router.default = '/list/todo';
frappe.desk.add_sidebar_item('ToDo', '#list/todo');
frappe.desk.add_sidebar_item('Accounts', '#list/account');
frappe.router.default = '#list/todo';
frappe.router.show(window.location.hash);
});

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@
"dependencies": {
"autoprefixer": "^7.2.4",
"body-parser": "^1.18.2",
"bootstrap": "4.0.0-beta.3",
"bootstrap": "^4.0.0",
"css-loader": "^0.28.8",
"express": "^4.16.2",
"node-fetch": "^1.7.3",
@ -19,5 +19,8 @@
"walk": "^2.3.9",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.9.7"
},
"devDependencies": {
"extract-text-webpack-plugin": "^3.0.2"
}
}

View File

@ -1,7 +1,9 @@
const server = require('frappejs/server');
const path = require('path');
server.start({
backend: 'sqlite',
connection_params: {db_path: 'test.db'},
static: './'
static: './',
models_path: path.resolve(__dirname, './models')
});

View File

@ -11,29 +11,26 @@ module.exports = {
rules: [{
test: /\.scss$/,
use: [
{
loader: "style-loader" // creates style nodes from JS strings
},
{
loader: "css-loader" // translates CSS into CommonJS
},
{
loader: 'postcss-loader', // Run post css actions
options: {
plugins: function () { // post css plugins, can be exported to postcss.config.js
return [
require('precss'),
require('autoprefixer')
];
}
{
loader: 'style-loader'
},
},
{
loader: "sass-loader", // compiles Sass to CSS
options: {
includePaths: ["node_modules", "./client/scss"]
}
}]
{
loader: 'postcss-loader', // Run post css actions
options: {
plugins: function () { // post css plugins, can be exported to postcss.config.js
return [
require('precss'),
require('autoprefixer')
];
}
},
},
{
loader: "sass-loader", // compiles Sass to CSS
options: {
includePaths: ["node_modules", "./client/scss"]
}
}]
}]
}
};

View File

@ -213,7 +213,7 @@ async@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
async@^2.1.2, async@^2.1.5:
async@^2.1.2, async@^2.1.5, async@^2.4.1:
version "2.6.0"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4"
dependencies:
@ -369,9 +369,9 @@ boom@5.x.x:
dependencies:
hoek "4.x.x"
bootstrap@4.0.0-beta.3:
version "4.0.0-beta.3"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0-beta.3.tgz#60f0660bc3d121176514b361f6f83201c7ff8874"
bootstrap@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0.tgz#ceb03842c145fcc1b9b4e15da2a05656ba68469a"
brace-expansion@^1.1.7:
version "1.1.8"
@ -1445,6 +1445,15 @@ extglob@^2.0.2:
snapdragon "^0.8.1"
to-regex "^3.0.1"
extract-text-webpack-plugin@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/extract-text-webpack-plugin/-/extract-text-webpack-plugin-3.0.2.tgz#5f043eaa02f9750a9258b78c0a6e0dc1408fb2f7"
dependencies:
async "^2.4.1"
loader-utils "^1.1.0"
schema-utils "^0.3.0"
webpack-sources "^1.0.1"
extsprintf@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"