From f075b76ffeb52906e0b8828de22db1a3326569f9 Mon Sep 17 00:00:00 2001 From: rocketdebris Date: Fri, 17 Oct 2025 13:12:37 -0400 Subject: [PATCH] Custom CSS and route stuff --- snw_ui/hooks.py | 116 +++++++++++++++++------------------ snw_ui/public/css/snw_ui.css | 3 + 2 files changed, 61 insertions(+), 58 deletions(-) create mode 100644 snw_ui/public/css/snw_ui.css diff --git a/snw_ui/hooks.py b/snw_ui/hooks.py index 58b1b21..f5b5a3f 100644 --- a/snw_ui/hooks.py +++ b/snw_ui/hooks.py @@ -11,21 +11,21 @@ app_license = "mit" # required_apps = [] # Each item in the list will be shown as an app in the apps page -# add_to_apps_screen = [ -# { -# "name": "snw_ui", -# "logo": "/assets/snw_ui/logo.png", -# "title": "SNW UI", -# "route": "/snw_ui", -# "has_permission": "snw_ui.api.permission.has_app_permission" -# } -# ] +add_to_apps_screen = [ + { + "name": "snw_ui", + "logo": "/assets/snw_ui/logo.png", + "title": "SNW UI", + "route": "/app/install", + # "has_permission": "snw_ui.api.permission.has_app_permission" + } +] # Includes in # ------------------ # include js, css files in header of desk.html -# app_include_css = "/assets/snw_ui/css/snw_ui.css" +app_include_css = "/assets/snw_ui/css/snw_ui.css" # app_include_js = "/assets/snw_ui/js/snw_ui.js" # include js, css files in header of web template @@ -61,7 +61,7 @@ app_license = "mit" # website user home page (by Role) # role_home_page = { -# "Role": "home_page" +# "Role": "home_page" # } # Generators @@ -75,8 +75,8 @@ app_license = "mit" # add methods and filters to jinja environment # jinja = { -# "methods": "snw_ui.utils.jinja_methods", -# "filters": "snw_ui.utils.jinja_filters" +# "methods": "snw_ui.utils.jinja_methods", +# "filters": "snw_ui.utils.jinja_filters" # } # Installation @@ -118,11 +118,11 @@ app_license = "mit" # Permissions evaluated in scripted ways # permission_query_conditions = { -# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions", +# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions", # } # # has_permission = { -# "Event": "frappe.desk.doctype.event.event.has_permission", +# "Event": "frappe.desk.doctype.event.event.has_permission", # } # DocType Class @@ -130,7 +130,7 @@ app_license = "mit" # Override standard doctype classes # override_doctype_class = { -# "ToDo": "custom_app.overrides.CustomToDo" +# "ToDo": "custom_app.overrides.CustomToDo" # } # Document Events @@ -138,32 +138,32 @@ app_license = "mit" # Hook on document methods and events # doc_events = { -# "*": { -# "on_update": "method", -# "on_cancel": "method", -# "on_trash": "method" -# } +# "*": { +# "on_update": "method", +# "on_cancel": "method", +# "on_trash": "method" +# } # } # Scheduled Tasks # --------------- # scheduler_events = { -# "all": [ -# "snw_ui.tasks.all" -# ], -# "daily": [ -# "snw_ui.tasks.daily" -# ], -# "hourly": [ -# "snw_ui.tasks.hourly" -# ], -# "weekly": [ -# "snw_ui.tasks.weekly" -# ], -# "monthly": [ -# "snw_ui.tasks.monthly" -# ], +# "all": [ +# "snw_ui.tasks.all" +# ], +# "daily": [ +# "snw_ui.tasks.daily" +# ], +# "hourly": [ +# "snw_ui.tasks.hourly" +# ], +# "weekly": [ +# "snw_ui.tasks.weekly" +# ], +# "monthly": [ +# "snw_ui.tasks.monthly" +# ], # } # Testing @@ -175,14 +175,14 @@ app_license = "mit" # ------------------------------ # # override_whitelisted_methods = { -# "frappe.desk.doctype.event.event.get_events": "snw_ui.event.get_events" +# "frappe.desk.doctype.event.event.get_events": "snw_ui.event.get_events" # } # # each overriding function accepts a `data` argument; # generated from the base implementation of the doctype dashboard, # along with any modifications made in other Frappe apps # override_doctype_dashboards = { -# "Task": "snw_ui.task.get_dashboard_data" +# "Task": "snw_ui.task.get_dashboard_data" # } # exempt linked doctypes from being automatically cancelled @@ -208,37 +208,37 @@ app_license = "mit" # -------------------- # user_data_fields = [ -# { -# "doctype": "{doctype_1}", -# "filter_by": "{filter_by}", -# "redact_fields": ["{field_1}", "{field_2}"], -# "partial": 1, -# }, -# { -# "doctype": "{doctype_2}", -# "filter_by": "{filter_by}", -# "partial": 1, -# }, -# { -# "doctype": "{doctype_3}", -# "strict": False, -# }, -# { -# "doctype": "{doctype_4}" -# } +# { +# "doctype": "{doctype_1}", +# "filter_by": "{filter_by}", +# "redact_fields": ["{field_1}", "{field_2}"], +# "partial": 1, +# }, +# { +# "doctype": "{doctype_2}", +# "filter_by": "{filter_by}", +# "partial": 1, +# }, +# { +# "doctype": "{doctype_3}", +# "strict": False, +# }, +# { +# "doctype": "{doctype_4}" +# } # ] # Authentication and authorization # -------------------------------- # auth_hooks = [ -# "snw_ui.auth.validate" +# "snw_ui.auth.validate" # ] # Automatically update python controller files with type annotations for this app. # export_python_type_annotations = True # default_log_clearing_doctypes = { -# "Logging DocType Name": 30 # days to retain logs +# "Logging DocType Name": 30 # days to retain logs # } diff --git a/snw_ui/public/css/snw_ui.css b/snw_ui/public/css/snw_ui.css new file mode 100644 index 0000000..667cfa3 --- /dev/null +++ b/snw_ui/public/css/snw_ui.css @@ -0,0 +1,3 @@ +.sidebar-button { + border-radius: 30px; +}