diff --git a/frappe/public/scss/variables.scss b/frappe/public/scss/variables.scss index 4c68441cf8..6165147e04 100644 --- a/frappe/public/scss/variables.scss +++ b/frappe/public/scss/variables.scss @@ -19,6 +19,25 @@ $text-muted: $gray-600 !default; $border-color: $gray-300 !default; $headings-color: $gray-900 !default; +$font-sizes: ( + "xs": 0.75rem, + "sm": 0.875rem, + "base": 1rem, + "lg": 1.125rem, + "xl": 1.25rem, + "2xl": 1.5rem, + "3xl": 1.875rem, + "4xl": 2.25rem, + "5xl": 3rem, + "6xl": 4rem +); + +@each $size, $value in $font-sizes { + .font-size-#{$size} { + font-size: $value; + } +} + $font-size-xs: 0.75rem !default; $font-size-sm: 0.875rem !default; $font-size-base: 1rem !default; @@ -60,12 +79,12 @@ $input-border-radius: 0.375rem; $custom-control-indicator-bg: white; $grid-breakpoints: ( - xs: 0, - sm: 576px, - md: 768px, - lg: 992px, - xl: 1200px, - 2xl: 1440px + xs: 0, + sm: 576px, + md: 768px, + lg: 992px, + xl: 1200px, + 2xl: 1440px ) !default; $spacers: ( @@ -93,11 +112,11 @@ $spacers: ( 48: 12rem, 52: 13rem, 56: 14rem, - 64: 16rem, + 64: 16rem ); -@import '~bootstrap/scss/functions'; -@import '~bootstrap/scss/variables'; +@import "~bootstrap/scss/functions"; +@import "~bootstrap/scss/variables"; @import "~bootstrap/scss/mixins"; $code-color: $purple; diff --git a/frappe/website/doctype/website_sidebar/website_sidebar.py b/frappe/website/doctype/website_sidebar/website_sidebar.py index 5065cd0196..87daf47680 100644 --- a/frappe/website/doctype/website_sidebar/website_sidebar.py +++ b/frappe/website/doctype/website_sidebar/website_sidebar.py @@ -6,5 +6,27 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document + class WebsiteSidebar(Document): - pass + def get_items(self): + items = frappe.get_all( + "Website Sidebar Item", + filters={'parent': self.name}, + fields=["title", "route", "group"], + order_by="idx asc", + ) + + items_by_group = {} + items_without_group = [] + for item in items: + if item.group: + items_by_group.setdefault(item.group, []).append(item) + else: + items_without_group.append(item) + + out = [] + for group, items in items_by_group.items(): + out.append({"group_title": group, "group_items": items}) + + out += items_without_group + return out diff --git a/frappe/website/js/website.js b/frappe/website/js/website.js index 113e04c5b7..785905e766 100644 --- a/frappe/website/js/website.js +++ b/frappe/website/js/website.js @@ -411,6 +411,9 @@ frappe.setup_search = function (target, search_scope) { let offsetIndex = 0; $(document).on('keypress', e => { + if ($(e.target).is('textarea, input, select')) { + return; + } if (e.key === '/') { e.preventDefault(); $input.focus();