From bece353366850d92187579c90e8f0c8b14931fc7 Mon Sep 17 00:00:00 2001 From: rocketdebris Date: Mon, 20 Oct 2025 18:25:05 -0400 Subject: [PATCH] Added the ability to create a doctype from our page. --- snw_ui/public/css/snw_ui.css | 14 +++++++++++--- snw_ui/snw_ui/page/install/clients.html | 2 +- snw_ui/snw_ui/page/install/install.js | 9 +++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/snw_ui/public/css/snw_ui.css b/snw_ui/public/css/snw_ui.css index eb2788b..fb7dc1e 100644 --- a/snw_ui/public/css/snw_ui.css +++ b/snw_ui/public/css/snw_ui.css @@ -1,16 +1,23 @@ #sidebar { display: flex; flex-direction: column; - width: 100px; + width: 150px; align-self: flex-start; gap: 10px; - background-color: rgb(54, 54, 58); + background-color: #f3f3f3; + padding: 10px; + border-radius: 5px; } .sidebar-button { border-radius: 5px; border: none; - background-color: skyblue; + background-color: rgb(69, 112, 101); + color: white; +} + +.sidebar-button:hover { + background-color: rgb(82, 132, 119) } #snw-ui { @@ -60,6 +67,7 @@ #filter-container { display: flex; flex-direction: row; + gap: 5px 5px; } #paging-controls { diff --git a/snw_ui/snw_ui/page/install/clients.html b/snw_ui/snw_ui/page/install/clients.html index 0459644..e947a52 100644 --- a/snw_ui/snw_ui/page/install/clients.html +++ b/snw_ui/snw_ui/page/install/clients.html @@ -3,7 +3,7 @@

Type:

- +
diff --git a/snw_ui/snw_ui/page/install/install.js b/snw_ui/snw_ui/page/install/install.js index 903739c..a72552f 100644 --- a/snw_ui/snw_ui/page/install/install.js +++ b/snw_ui/snw_ui/page/install/install.js @@ -54,6 +54,7 @@ class View { constructor(page) { this.$sidebar = $("#sidebar", page); this.$displayContent = $("#display-content", page); + this.$newCustomerButton; } setSidebarCategories(categories, click_handler) { @@ -69,6 +70,14 @@ class View { setDisplayTemplate(template) { this.$displayContent.html(frappe.render_template(template, this.$displayContent)); + if (template == "clients") { + this.$newCustomerButton = $("#new-customer-button", this.$displayContent); + this.$newCustomerButton.on("click", this.handleNewButton); + } + } + + handleNewButton() { + frappe.new_doc('Customer'); } setDisplayContent(content) {