From 8d132e82f8eba93e5057e1b68037231dd14d3140 Mon Sep 17 00:00:00 2001 From: rocketdebris Date: Thu, 16 Oct 2025 17:11:18 -0400 Subject: [PATCH] Initial commit. --- snw_ui/snw_ui/doctype/__init__.py | 0 snw_ui/snw_ui/doctype/lmn_dash/__init__.py | 0 snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.js | 8 +++ snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.json | 55 ++++++++++++++ snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.py | 9 +++ .../snw_ui/doctype/lmn_dash/test_lmn_dash.py | 9 +++ .../doctype/lmncustomertableitem/__init__.py | 0 .../lmncustomertableitem.json | 72 +++++++++++++++++++ .../lmncustomertableitem.py | 9 +++ snw_ui/snw_ui/home_page_utils.py | 6 ++ snw_ui/snw_ui/page/__init__.py | 0 snw_ui/snw_ui/page/install/__init__.py | 0 snw_ui/snw_ui/page/install/install.html | 6 ++ snw_ui/snw_ui/page/install/install.js | 53 ++++++++++++++ snw_ui/snw_ui/page/install/install.json | 18 +++++ snw_ui/snw_ui/page/snw_home/__init__.py | 0 snw_ui/snw_ui/page/snw_home/snw_home.js | 49 +++++++++++++ snw_ui/snw_ui/page/snw_home/snw_home.json | 19 +++++ 18 files changed, 313 insertions(+) create mode 100644 snw_ui/snw_ui/doctype/__init__.py create mode 100644 snw_ui/snw_ui/doctype/lmn_dash/__init__.py create mode 100644 snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.js create mode 100644 snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.json create mode 100644 snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.py create mode 100644 snw_ui/snw_ui/doctype/lmn_dash/test_lmn_dash.py create mode 100644 snw_ui/snw_ui/doctype/lmncustomertableitem/__init__.py create mode 100644 snw_ui/snw_ui/doctype/lmncustomertableitem/lmncustomertableitem.json create mode 100644 snw_ui/snw_ui/doctype/lmncustomertableitem/lmncustomertableitem.py create mode 100644 snw_ui/snw_ui/home_page_utils.py create mode 100644 snw_ui/snw_ui/page/__init__.py create mode 100644 snw_ui/snw_ui/page/install/__init__.py create mode 100644 snw_ui/snw_ui/page/install/install.html create mode 100644 snw_ui/snw_ui/page/install/install.js create mode 100644 snw_ui/snw_ui/page/install/install.json create mode 100644 snw_ui/snw_ui/page/snw_home/__init__.py create mode 100644 snw_ui/snw_ui/page/snw_home/snw_home.js create mode 100644 snw_ui/snw_ui/page/snw_home/snw_home.json diff --git a/snw_ui/snw_ui/doctype/__init__.py b/snw_ui/snw_ui/doctype/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/snw_ui/snw_ui/doctype/lmn_dash/__init__.py b/snw_ui/snw_ui/doctype/lmn_dash/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.js b/snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.js new file mode 100644 index 0000000..4b15e47 --- /dev/null +++ b/snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.js @@ -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) { + +// }, +// }); diff --git a/snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.json b/snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.json new file mode 100644 index 0000000..be641b4 --- /dev/null +++ b/snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.json @@ -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": [] +} \ No newline at end of file diff --git a/snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.py b/snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.py new file mode 100644 index 0000000..6c0d9f0 --- /dev/null +++ b/snw_ui/snw_ui/doctype/lmn_dash/lmn_dash.py @@ -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 diff --git a/snw_ui/snw_ui/doctype/lmn_dash/test_lmn_dash.py b/snw_ui/snw_ui/doctype/lmn_dash/test_lmn_dash.py new file mode 100644 index 0000000..e4dfd1a --- /dev/null +++ b/snw_ui/snw_ui/doctype/lmn_dash/test_lmn_dash.py @@ -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 diff --git a/snw_ui/snw_ui/doctype/lmncustomertableitem/__init__.py b/snw_ui/snw_ui/doctype/lmncustomertableitem/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/snw_ui/snw_ui/doctype/lmncustomertableitem/lmncustomertableitem.json b/snw_ui/snw_ui/doctype/lmncustomertableitem/lmncustomertableitem.json new file mode 100644 index 0000000..bfd3256 --- /dev/null +++ b/snw_ui/snw_ui/doctype/lmncustomertableitem/lmncustomertableitem.json @@ -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": [] +} \ No newline at end of file diff --git a/snw_ui/snw_ui/doctype/lmncustomertableitem/lmncustomertableitem.py b/snw_ui/snw_ui/doctype/lmncustomertableitem/lmncustomertableitem.py new file mode 100644 index 0000000..75d19cc --- /dev/null +++ b/snw_ui/snw_ui/doctype/lmncustomertableitem/lmncustomertableitem.py @@ -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 diff --git a/snw_ui/snw_ui/home_page_utils.py b/snw_ui/snw_ui/home_page_utils.py new file mode 100644 index 0000000..5909533 --- /dev/null +++ b/snw_ui/snw_ui/home_page_utils.py @@ -0,0 +1,6 @@ +import frappe + + +@frappe.whitelist() +def hello_world(): + return "Hello, World!" diff --git a/snw_ui/snw_ui/page/__init__.py b/snw_ui/snw_ui/page/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/snw_ui/snw_ui/page/install/__init__.py b/snw_ui/snw_ui/page/install/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/snw_ui/snw_ui/page/install/install.html b/snw_ui/snw_ui/page/install/install.html new file mode 100644 index 0000000..f86bf30 --- /dev/null +++ b/snw_ui/snw_ui/page/install/install.html @@ -0,0 +1,6 @@ + +
+

Hello, World!

+
diff --git a/snw_ui/snw_ui/page/install/install.js b/snw_ui/snw_ui/page/install/install.js new file mode 100644 index 0000000..1c7fc59 --- /dev/null +++ b/snw_ui/snw_ui/page/install/install.js @@ -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.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); + } +} + diff --git a/snw_ui/snw_ui/page/install/install.json b/snw_ui/snw_ui/page/install/install.json new file mode 100644 index 0000000..5f54dd7 --- /dev/null +++ b/snw_ui/snw_ui/page/install/install.json @@ -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 +} \ No newline at end of file diff --git a/snw_ui/snw_ui/page/snw_home/__init__.py b/snw_ui/snw_ui/page/snw_home/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/snw_ui/snw_ui/page/snw_home/snw_home.js b/snw_ui/snw_ui/page/snw_home/snw_home.js new file mode 100644 index 0000000..7c9109f --- /dev/null +++ b/snw_ui/snw_ui/page/snw_home/snw_home.js @@ -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 +} + diff --git a/snw_ui/snw_ui/page/snw_home/snw_home.json b/snw_ui/snw_ui/page/snw_home/snw_home.json new file mode 100644 index 0000000..831c48e --- /dev/null +++ b/snw_ui/snw_ui/page/snw_home/snw_home.json @@ -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" +} \ No newline at end of file