Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linked the two locations for Flat Menu settings #1448

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions home/migrations/0050_auto_20221031_1147.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.14 on 2022-10-31 11:47

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('home', '0049_auto_20221018_0943'),
]

operations = [
migrations.RenameField(
model_name='themesettings',
old_name='navbar_font_color',
new_name='flat_menus_navbar_font_color',
),
]
4 changes: 2 additions & 2 deletions home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ def get_background_color(self):

def get_font_color(self):
theme_settings = globals_.theme_settings
return self.font_color or theme_settings.navbar_font_color
return self.font_color or theme_settings.flat_menus_navbar_font_color

def get_single_column_view(self):
return 'single-column-view' if self.display_only_in_single_column_view else ''
Expand Down Expand Up @@ -1072,7 +1072,7 @@ class ThemeSettings(BaseSetting):
navbar_background_color = models.CharField(
null=True, blank=True, help_text='The background color of the navbar as a HEX code', max_length=8,
default='#0094F4')
navbar_font_color = models.CharField(
flat_menus_navbar_font_color = models.CharField(
null=True, blank=True, help_text='The font color of the navbar as a HEX code', max_length=8,
default='#FFFFFF')

Expand Down
6 changes: 6 additions & 0 deletions home/static/js/global/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ $(document).ready(function () {
'them getting displayed.'
).css({'color': 'red'});

$('#id_heading').parent().siblings('p[class=help]')
.append('<br>' +
'<a href="http://127.0.0.1:8000/admin/settings/home/themesettings/" target="_blank"> ' +
"Click here to edit the background color for all Flat Menus in Theme Settings." +
'</a>')

$('#tab-content:contains("Download PO file and input translations offline")')
.find('>:first-child')
.prepend('<p style="margin-left: 50px; color: red; font-weight: bold;">' +
Expand Down