Skip to content

Commit

Permalink
fix(wiki-space): dark mode logo for wiki space
Browse files Browse the repository at this point in the history
  • Loading branch information
BreadGenie committed Apr 5, 2024
1 parent e5deab0 commit 6f61545
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion wiki/public/js/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ window.Wiki = class Wiki {
const altSrc = $(".navbar-brand img").data("alt-src");
const src = $(".navbar-brand img").attr("src");
if (
!["{{ light_mode_logo }}", "{{ dark_mode_logo }}", "None"].includes(
!["{{ light_mode_logo }}", "{{ dark_mode_logo }}", "None", ""].includes(
altSrc,
)
) {
Expand Down
7 changes: 5 additions & 2 deletions wiki/wiki/doctype/wiki_page/wiki_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,11 @@ def get_context(self, context):

context.navbar_search = wiki_settings.add_search_bar
context.add_dark_mode = wiki_settings.add_dark_mode
context.light_mode_logo = wiki_space.wiki_space_logo or wiki_settings.logo
context.dark_mode_logo = wiki_space.wiki_space_logo or wiki_settings.dark_mode_logo
context.light_mode_logo = wiki_space.light_mode_logo or wiki_settings.logo
context.dark_mode_logo = wiki_space.dark_mode_logo or wiki_settings.dark_mode_logo
context.home_page = (
wiki_space.route if wiki_space.light_mode_logo or wiki_space.dark_mode_logo else "/"
)
context.script = wiki_settings.javascript
context.show_feedback = wiki_settings.enable_feedback
context.ask_for_contact_details = wiki_settings.ask_for_contact_details
Expand Down
31 changes: 24 additions & 7 deletions wiki/wiki/doctype/wiki_space/wiki_space.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"route",
"wiki_sidebars",
"navbar_tab",
"wiki_space_logo",
"logo_section",
"light_mode_logo",
"dark_mode_logo",
"section_break_fhui",
"navbar_items"
],
"fields": [
Expand Down Expand Up @@ -40,21 +43,35 @@
"fieldtype": "Tab Break",
"label": "Navbar"
},
{
"fieldname": "wiki_space_logo",
"fieldtype": "Attach Image",
"label": "Wiki Space Logo"
},
{
"fieldname": "navbar_items",
"fieldtype": "Table",
"label": "Navbar Items",
"options": "Top Bar Item"
},
{
"fieldname": "logo_section",
"fieldtype": "Section Break",
"label": "Logo"
},
{
"fieldname": "light_mode_logo",
"fieldtype": "Attach Image",
"label": "Light Mode Logo"
},
{
"fieldname": "dark_mode_logo",
"fieldtype": "Attach Image",
"label": "Dark Mode Logo"
},
{
"fieldname": "section_break_fhui",
"fieldtype": "Section Break"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-04-05 13:36:07.517135",
"modified": "2024-04-05 21:21:29.535486",
"modified_by": "Administrator",
"module": "Wiki",
"name": "Wiki Space",
Expand Down

0 comments on commit 6f61545

Please sign in to comment.