fix: website fixes
-move modal and icon styles to common primary navbar theme
This commit is contained in:
parent
788df6327d
commit
f363863b8c
14 changed files with 94 additions and 12 deletions
|
|
@ -25,7 +25,7 @@ body {
|
|||
|
||||
&.full-width {
|
||||
@include media-breakpoint-up(md) {
|
||||
.container {
|
||||
.container {
|
||||
width: 90%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
@import "css_variables";
|
||||
@import "../common/mixins.scss";
|
||||
@import "../common/global.scss";
|
||||
@import "../common/icons.scss";
|
||||
|
||||
@import "~bootstrap/scss/bootstrap";
|
||||
@import "global";
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
@import "print_preview";
|
||||
@import "list";
|
||||
@import "navbar";
|
||||
@import "modal";
|
||||
@import "../common/modal";
|
||||
@import "slides";
|
||||
@import "toast";
|
||||
@import "breadcrumb";
|
||||
|
|
@ -20,7 +21,6 @@
|
|||
@import "page";
|
||||
@import "timeline";
|
||||
@import "avatar";
|
||||
@import "icons";
|
||||
@import "notification";
|
||||
@import "global_search";
|
||||
@import "desktop";
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@
|
|||
@import '~bootstrap/scss/bootstrap';
|
||||
@import "../common/mixins.scss";
|
||||
@import "../common/global.scss";
|
||||
@import "../common/icons.scss";
|
||||
@import 'base';
|
||||
@import "../common/buttons";
|
||||
@import "../common/modal";
|
||||
@import 'multilevel_dropdown';
|
||||
@import 'website_image';
|
||||
@import 'website_avatar';
|
||||
|
|
@ -187,12 +189,13 @@ h5.modal-title {
|
|||
}
|
||||
|
||||
.form-section {
|
||||
margin-right: -45px;
|
||||
// margin-right: -45px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.form-section .section-body {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
margin: 0;
|
||||
@extend .row;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,33 @@
|
|||
border-bottom: 1px solid $border-color;
|
||||
}
|
||||
|
||||
.navbar-primary {
|
||||
background-color: var(--blue-500);
|
||||
|
||||
.nav-item {
|
||||
.nav-link {
|
||||
color: white;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-search {
|
||||
background-color: var(--blue-400);
|
||||
width: 300px;
|
||||
margin-right: 10px;
|
||||
color: white;
|
||||
|
||||
&::placeholder {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
svg use {
|
||||
--icon-stroke: white;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
img {
|
||||
display: inline-block;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
</script>
|
||||
</head>
|
||||
<body frappe-session-status="{{ 'logged-in' if frappe.session.user != 'Guest' else 'logged-out'}}" data-path="{{ path | e }}" {%- if template and template.endswith('.md') %} frappe-content-type="markdown" {% endif -%} class="bg-light">
|
||||
{% include "public/icons/timeless/symbol-defs.svg" %}
|
||||
{%- block banner -%}
|
||||
{% include "templates/includes/banner_extension.html" ignore missing %}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
</ul>
|
||||
{%- endif %}
|
||||
<ul class="ml-auto navbar-nav">
|
||||
{% include "templates/includes/navbar/navbar_search.html" %}
|
||||
{%- for item in top_bar_items -%}
|
||||
{% if not item.parent_label and item.right -%}
|
||||
{{ render_item(item, parent=True) }}
|
||||
|
|
@ -85,7 +86,6 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% include "templates/includes/navbar/navbar_search.html" %}
|
||||
{% include "templates/includes/navbar/navbar_login.html" %}
|
||||
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -178,6 +178,14 @@ def nowdate():
|
|||
def today():
|
||||
return nowdate()
|
||||
|
||||
def get_abbr(string, max_len=2):
|
||||
abbr=''
|
||||
for part in string.split(' '):
|
||||
if len(abbr) < max_len:
|
||||
abbr += part[0]
|
||||
|
||||
return abbr or '?'
|
||||
|
||||
def nowtime():
|
||||
"""return current time in hh:mm"""
|
||||
return now_datetime().strftime(TIME_FORMAT)
|
||||
|
|
@ -370,7 +378,7 @@ def format_duration(seconds, hide_days=False):
|
|||
|
||||
example: converts 12885 to '3h 34m 45s' where 12885 = seconds in float
|
||||
"""
|
||||
|
||||
|
||||
seconds = cint(seconds)
|
||||
|
||||
total_duration = {
|
||||
|
|
@ -1401,4 +1409,4 @@ def validate_json_string(string):
|
|||
try:
|
||||
json.loads(string)
|
||||
except (TypeError, ValueError):
|
||||
raise frappe.ValidationError
|
||||
raise frappe.ValidationError
|
||||
|
|
@ -290,5 +290,6 @@ VALID_UTILS = (
|
|||
"md_to_html",
|
||||
"is_subset",
|
||||
"generate_hash",
|
||||
"formatdate"
|
||||
"formatdate",
|
||||
"get_abbr"
|
||||
)
|
||||
6
frappe/website/js/bootstrap-4.js
vendored
6
frappe/website/js/bootstrap-4.js
vendored
|
|
@ -21,15 +21,15 @@ $('.dropdown-menu a.dropdown-toggle').on('click', function (e) {
|
|||
frappe.get_modal = function(title, content) {
|
||||
return $(
|
||||
`<div class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">${title}</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
${frappe.utils.icon('close-alt', 'sm', 'close-alt')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body py-4">
|
||||
<div class="modal-body">
|
||||
${content}
|
||||
</div>
|
||||
<div class="modal-footer hidden">
|
||||
|
|
|
|||
0
frappe/website/web_template/primary_navbar/__init__.py
Normal file
0
frappe/website/web_template/primary_navbar/__init__.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<nav class="navbar navbar-primary navbar-expand-lg">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{{ url_prefix }}{{ home_page or "/" }}">
|
||||
{%- if brand_html -%}
|
||||
{{ brand_html }}
|
||||
{%- elif banner_image -%}
|
||||
<img src='{{ banner_image }}'>
|
||||
{%- else -%}
|
||||
<span>{{ (frappe.get_hooks("brand_html") or [_("Home")])[0] }}</span>
|
||||
{%- endif -%}
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button"
|
||||
data-toggle="collapse"
|
||||
data-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
{% include "templates/includes/navbar/navbar_items.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"__islocal": true,
|
||||
"__unsaved": 1,
|
||||
"creation": "2021-01-20 13:20:46.147656",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Template",
|
||||
"fields": [],
|
||||
"idx": 0,
|
||||
"modified": "2021-01-20 13:20:46.147656",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Website",
|
||||
"name": "Primary Navbar",
|
||||
"owner": "Administrator",
|
||||
"standard": 1,
|
||||
"template": "",
|
||||
"type": "Navbar"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue