Skip to content

Commit

Permalink
small tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoestner committed Nov 25, 2024
1 parent 9a3ab9a commit 03c8df7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
1 change: 0 additions & 1 deletion folioflex/configs/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ config:
smtp_password: None
smtp_server: None
smtp_port: 587
matomo: None
# only postgres is supported
# used in dashboard to connecto to budget
database:
Expand Down
35 changes: 2 additions & 33 deletions folioflex/dashboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from dash import Input, Output, callback, dcc, html

from folioflex.dashboard.components import auth
from folioflex.utils import config_helper, custom_logger
from folioflex.utils import custom_logger

# _ ____ ____
# / \ | _ \| _ \
Expand All @@ -43,35 +43,8 @@
app.title = "FolioFlex"
app._favicon = "folioflex_logo.ico"

# adding shortcut icons and google analytics
MATOMO = config_helper.MATOMO
if MATOMO:
analytics_script = (
"""
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
""" # noqa: ISC003
+ f"""
var u="//{MATOMO}/";
"""
+ """
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
"""
)
else:
analytics_script = ""

app.index_string = (
"""
app.index_string = """
<!DOCTYPE html>
<html>
<head>
Expand All @@ -80,9 +53,6 @@
<link rel="manifest" href="/assets/manifest.json">
{%favicon%}
{%css%}
"""
+ analytics_script
+ """
</head>
<body>
{%app_entry%}
Expand All @@ -94,7 +64,6 @@
</body>
</html>
"""
)

# creating the navbar
page_links = [
Expand Down
1 change: 0 additions & 1 deletion folioflex/utils/config_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,3 @@ def _config_reference(config, value, *sections):
SMTP_PASSWORD = _other_config.get("smtp_password", None)
SMTP_SERVER = _other_config.get("smtp_server", None)
SMTP_PORT = _other_config.get("smtp_port", None)
MATOMO = _other_config.get("matomo", None)

0 comments on commit 03c8df7

Please sign in to comment.