Initial commit.
This commit is contained in:
parent
dd39a84313
commit
8d132e82f8
0
snw_ui/snw_ui/doctype/__init__.py
Normal file
0
snw_ui/snw_ui/doctype/__init__.py
Normal file
0
snw_ui/snw_ui/doctype/lmn_dash/__init__.py
Normal file
0
snw_ui/snw_ui/doctype/lmn_dash/__init__.py
Normal file
8
snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.js
Normal file
8
snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.js
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2025, Shiloh Code LLC and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
// frappe.ui.form.on("LMN Dash", {
|
||||
// refresh(frm) {
|
||||
|
||||
// },
|
||||
// });
|
||||
55
snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.json
Normal file
55
snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.json
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"creation": "2025-10-13 11:09:16.946429",
|
||||
"doctype": "DocType",
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"contacts_section",
|
||||
"customer_search",
|
||||
"add"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "contacts_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Contacts"
|
||||
},
|
||||
{
|
||||
"fieldname": "customer_search",
|
||||
"fieldtype": "Data",
|
||||
"placeholder": "Type to Search"
|
||||
},
|
||||
{
|
||||
"fieldname": "add",
|
||||
"fieldtype": "Button",
|
||||
"label": "Add"
|
||||
}
|
||||
],
|
||||
"grid_page_length": 50,
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2025-10-13 11:29:30.937296",
|
||||
"modified_by": "Administrator",
|
||||
"module": "SNW UI",
|
||||
"name": "LMN Dash",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"row_format": "Dynamic",
|
||||
"rows_threshold_for_grid_search": 20,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
}
|
||||
9
snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.py
Normal file
9
snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.py
Normal file
@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2025, Shiloh Code LLC and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class LMNDash(Document):
|
||||
pass
|
||||
9
snw_ui/snw_ui/doctype/lmn_dash/test_lmn_dash.py
Normal file
9
snw_ui/snw_ui/doctype/lmn_dash/test_lmn_dash.py
Normal file
@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2025, Shiloh Code LLC and Contributors
|
||||
# See license.txt
|
||||
|
||||
# import frappe
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
|
||||
|
||||
class TestLMNDash(FrappeTestCase):
|
||||
pass
|
||||
@ -0,0 +1,72 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"creation": "2025-10-16 12:16:32.154268",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"name1",
|
||||
"location",
|
||||
"type",
|
||||
"contact",
|
||||
"email",
|
||||
"phone",
|
||||
"parent1"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "name1",
|
||||
"fieldtype": "Data",
|
||||
"label": "Name"
|
||||
},
|
||||
{
|
||||
"fieldname": "location",
|
||||
"fieldtype": "Data",
|
||||
"label": "Location"
|
||||
},
|
||||
{
|
||||
"fieldname": "type",
|
||||
"fieldtype": "Data",
|
||||
"label": "Type"
|
||||
},
|
||||
{
|
||||
"fieldname": "contact",
|
||||
"fieldtype": "Link",
|
||||
"label": "Contact",
|
||||
"options": "Employee"
|
||||
},
|
||||
{
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"label": "Email"
|
||||
},
|
||||
{
|
||||
"fieldname": "phone",
|
||||
"fieldtype": "Phone",
|
||||
"label": "Phone"
|
||||
},
|
||||
{
|
||||
"fieldname": "parent1",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
"label": "Parent",
|
||||
"options": "Customer"
|
||||
}
|
||||
],
|
||||
"grid_page_length": 50,
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2025-10-16 13:44:28.060815",
|
||||
"modified_by": "Administrator",
|
||||
"module": "SNW UI",
|
||||
"name": "LMNCustomerTableItem",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"row_format": "Dynamic",
|
||||
"rows_threshold_for_grid_search": 20,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2025, Shiloh Code LLC and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class LMNCustomerTableItem(Document):
|
||||
pass
|
||||
6
snw_ui/snw_ui/home_page_utils.py
Normal file
6
snw_ui/snw_ui/home_page_utils.py
Normal file
@ -0,0 +1,6 @@
|
||||
import frappe
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def hello_world():
|
||||
return "Hello, World!"
|
||||
0
snw_ui/snw_ui/page/__init__.py
Normal file
0
snw_ui/snw_ui/page/__init__.py
Normal file
0
snw_ui/snw_ui/page/install/__init__.py
Normal file
0
snw_ui/snw_ui/page/install/__init__.py
Normal file
6
snw_ui/snw_ui/page/install/install.html
Normal file
6
snw_ui/snw_ui/page/install/install.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="sidebar">
|
||||
<p>Contacts</p>
|
||||
</div>
|
||||
<div class="page">
|
||||
<p>Hello, World!</p>
|
||||
</div>
|
||||
53
snw_ui/snw_ui/page/install/install.js
Normal file
53
snw_ui/snw_ui/page/install/install.js
Normal file
@ -0,0 +1,53 @@
|
||||
frappe.pages['install'].on_page_load = function(wrapper) {
|
||||
new InstallPage(wrapper);
|
||||
new Controller(new Model(), new View());
|
||||
}
|
||||
|
||||
InstallPage = Class.extend({
|
||||
init: function(wrapper) {
|
||||
this.page = frappe.ui.make_app_page({
|
||||
parent: wrapper,
|
||||
title: 'Sprinklers Northwest Install',
|
||||
single_column: true
|
||||
});
|
||||
this.make();
|
||||
},
|
||||
make: function() {
|
||||
$(frappe.render_template("install", this)).appendTo(this.page.main);
|
||||
}
|
||||
})
|
||||
|
||||
class Model {
|
||||
constructor() {
|
||||
this.categories = ['Calendar', 'Clients', 'Job', 'Routes', 'Create', 'Timesheets', 'Warranties'];
|
||||
}
|
||||
|
||||
get_sidebar_categories() {
|
||||
this.categories
|
||||
}
|
||||
}
|
||||
|
||||
class View {
|
||||
constructor() {
|
||||
this.$sidebar = $("#sidebar");
|
||||
this.$page = $("#page");
|
||||
}
|
||||
|
||||
set_sidebar_categories(categories) {
|
||||
$.each(categories, function(category) {
|
||||
const $button = $("<button></button>");
|
||||
$button.text(category);
|
||||
$button.addClass("sidebar-button");
|
||||
this.$sidebar.append($button);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Controller {
|
||||
constructor(model, view) {
|
||||
this.model = model
|
||||
this.view = view
|
||||
this.view.set_sidebar_categories(this.model.categories);
|
||||
}
|
||||
}
|
||||
|
||||
18
snw_ui/snw_ui/page/install/install.json
Normal file
18
snw_ui/snw_ui/page/install/install.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"content": null,
|
||||
"creation": "2025-10-16 14:55:12.463057",
|
||||
"docstatus": 0,
|
||||
"doctype": "Page",
|
||||
"idx": 0,
|
||||
"modified": "2025-10-16 14:55:12.463057",
|
||||
"modified_by": "Administrator",
|
||||
"module": "SNW UI",
|
||||
"name": "install",
|
||||
"owner": "Administrator",
|
||||
"page_name": "install",
|
||||
"roles": [],
|
||||
"script": null,
|
||||
"standard": "Yes",
|
||||
"style": null,
|
||||
"system_page": 0
|
||||
}
|
||||
0
snw_ui/snw_ui/page/snw_home/__init__.py
Normal file
0
snw_ui/snw_ui/page/snw_home/__init__.py
Normal file
49
snw_ui/snw_ui/page/snw_home/snw_home.js
Normal file
49
snw_ui/snw_ui/page/snw_home/snw_home.js
Normal file
@ -0,0 +1,49 @@
|
||||
frappe.provide("frappe.snw_ui");
|
||||
|
||||
const setup = function (wrapper, filters) {
|
||||
this.page = frappe.ui.make_app_page({
|
||||
parent: wrapper,
|
||||
title: "Sprinklers Northwest Front Office",
|
||||
single_column: false,
|
||||
});
|
||||
this.page.docfields = ['Customer'];
|
||||
this.wrapper = $(wrapper);
|
||||
frappe.call({
|
||||
method: "snw_ui.snw_ui.home_page_utils.hello_world",
|
||||
callback: (data) => {
|
||||
frappe.msgprint(data.message);
|
||||
}
|
||||
});
|
||||
console.log("Setting up the page.");
|
||||
let field = this.page.add_field({
|
||||
label: 'Customer Table',
|
||||
fieldtype: 'Table',
|
||||
fieldname: 'customers_table',
|
||||
options: "Customer",
|
||||
//docfields: ["Customer"],
|
||||
});
|
||||
};
|
||||
|
||||
const refresh = function() {
|
||||
};
|
||||
|
||||
|
||||
frappe.pages['snw-home'].on_page_load = function(wrapper) {
|
||||
var page = frappe.snw_ui.home_page;
|
||||
page.setup(wrapper);
|
||||
$(wrapper).bind("show", () => {
|
||||
page.refresh();
|
||||
});
|
||||
//var page = frappe.ui.make_app_page({
|
||||
// parent: wrapper,
|
||||
// title: 'Sprinklers Northwest',
|
||||
// single_column: false
|
||||
//});
|
||||
};
|
||||
|
||||
frappe.snw_ui.home_page = {
|
||||
//addfilters : function() { ...},
|
||||
setup : setup,
|
||||
refresh : refresh
|
||||
}
|
||||
|
||||
19
snw_ui/snw_ui/page/snw_home/snw_home.json
Normal file
19
snw_ui/snw_ui/page/snw_home/snw_home.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"content": null,
|
||||
"creation": "2025-10-10 15:02:02.584542",
|
||||
"docstatus": 0,
|
||||
"doctype": "Page",
|
||||
"idx": 0,
|
||||
"modified": "2025-10-10 15:02:32.782850",
|
||||
"modified_by": "Administrator",
|
||||
"module": "SNW UI",
|
||||
"name": "snw-home",
|
||||
"owner": "Administrator",
|
||||
"page_name": "snw-home",
|
||||
"roles": [],
|
||||
"script": null,
|
||||
"standard": "Yes",
|
||||
"style": null,
|
||||
"system_page": 0,
|
||||
"title": "Home"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user