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

Load stylesheets in the same order as when they were in the head #503

Merged
merged 1 commit into from
Aug 1, 2023
Merged
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
20 changes: 12 additions & 8 deletions docker-mods/lidarr/root/etc/cont-init.d/98-themepark
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '| Adding the stylesheets |'
echo '---------------------------'
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/lidarr\/lidarr-base.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/lidarr\/lidarr-base.css'> /g" "${LOGIN_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${LOGIN_FILEPATH}"

url_base="${TP_SCHEME}://${TP_DOMAIN}"
sheets="<link rel='stylesheet' href='${url_base}/css/base/lidarr/lidarr-base.css'>"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/${THEME_TYPE}/${TP_THEME}.css'>"
printf 'Stylesheet set to %s\n' "${TP_THEME}"

if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/lidarr\/${addon}\/${addon}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/lidarr\/${addon}\/${addon}.css'> /g" "${LOGIN_FILEPATH}"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/addons/lidarr/${addon}/${addon}.css'>"
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi
fi

sed -i "s!<body>!<body>${sheets}!g" "${APP_FILEPATH}"
sed -i "s!<body>!<body>${sheets}!g" "${LOGIN_FILEPATH}"
printf 'Stylesheets inserted.'
fi
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '| Adding the stylesheets |'
echo '---------------------------'
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/lidarr\/lidarr-base.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/lidarr\/lidarr-base.css'> /g" "${LOGIN_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${LOGIN_FILEPATH}"

url_base="${TP_SCHEME}://${TP_DOMAIN}"
sheets="<link rel='stylesheet' href='${url_base}/css/base/sonarr/sonarr-base.css'>"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/${THEME_TYPE}/${TP_THEME}.css'>"
printf 'Stylesheet set to %s\n' "${TP_THEME}"

if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/lidarr\/${addon}\/${addon}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/lidarr\/${addon}\/${addon}.css'> /g" "${LOGIN_FILEPATH}"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/addons/sonarr/${addon}/${addon}.css'>"
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi
fi

sed -i "s!<body>!<body>${sheets}!g" "${APP_FILEPATH}"
sed -i "s!<body>!<body>${sheets}!g" "${LOGIN_FILEPATH}"
printf 'Stylesheets inserted.'
fi
20 changes: 12 additions & 8 deletions docker-mods/prowlarr/root/etc/cont-init.d/98-themepark
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '| Adding the stylesheets |'
echo '---------------------------'
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/prowlarr\/prowlarr-base.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/prowlarr\/prowlarr-base.css'> /g" "${LOGIN_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${LOGIN_FILEPATH}"

url_base="${TP_SCHEME}://${TP_DOMAIN}"
sheets="<link rel='stylesheet' href='${url_base}/css/base/prowlarr/prowlarr-base.css'>"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/${THEME_TYPE}/${TP_THEME}.css'>"
printf 'Stylesheet set to %s\n' "${TP_THEME}"

if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/prowlarr\/${addon}\/${addon}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/prowlarr\/${addon}\/${addon}.css'> /g" "${LOGIN_FILEPATH}"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/addons/prowlarr/${addon}/${addon}.css'>"
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi
fi

sed -i "s!<body>!<body>${sheets}!g" "${APP_FILEPATH}"
sed -i "s!<body>!<body>${sheets}!g" "${LOGIN_FILEPATH}"
printf 'Stylesheets inserted.'
fi
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '| Adding the stylesheets |'
echo '---------------------------'
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/prowlarr\/prowlarr-base.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/prowlarr\/prowlarr-base.css'> /g" "${LOGIN_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${LOGIN_FILEPATH}"

url_base="${TP_SCHEME}://${TP_DOMAIN}"
sheets="<link rel='stylesheet' href='${url_base}/css/base/prowlarr/prowlarr-base.css'>"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/${THEME_TYPE}/${TP_THEME}.css'>"
printf 'Stylesheet set to %s\n' "${TP_THEME}"

if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/prowlarr\/${addon}\/${addon}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/prowlarr\/${addon}\/${addon}.css'> /g" "${LOGIN_FILEPATH}"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/addons/prowlarr/${addon}/${addon}.css'>"
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi
fi

sed -i "s!<body>!<body>${sheets}!g" "${APP_FILEPATH}"
sed -i "s!<body>!<body>${sheets}!g" "${LOGIN_FILEPATH}"
printf 'Stylesheets inserted.'
fi
20 changes: 12 additions & 8 deletions docker-mods/radarr/root/etc/cont-init.d/98-themepark
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '| Adding the stylesheets |'
echo '---------------------------'
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/radarr\/radarr-base.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/radarr\/radarr-base.css'> /g" "${LOGIN_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${LOGIN_FILEPATH}"

url_base="${TP_SCHEME}://${TP_DOMAIN}"
sheets="<link rel='stylesheet' href='${url_base}/css/base/radarr/radarr-base.css'>"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/${THEME_TYPE}/${TP_THEME}.css'>"
printf 'Stylesheet set to %s\n' "${TP_THEME}"

if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/radarr\/${addon}\/${addon}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/radarr\/${addon}\/${addon}.css'> /g" "${LOGIN_FILEPATH}"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/addons/radarr/${addon}/${addon}.css'>"
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi
fi

sed -i "s!<body>!<body>${sheets}!g" "${APP_FILEPATH}"
sed -i "s!<body>!<body>${sheets}!g" "${LOGIN_FILEPATH}"
printf 'Stylesheets inserted.'
fi
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '| Adding the stylesheets |'
echo '---------------------------'
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/radarr\/radarr-base.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/radarr\/radarr-base.css'> /g" "${LOGIN_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${LOGIN_FILEPATH}"

url_base="${TP_SCHEME}://${TP_DOMAIN}"
sheets="<link rel='stylesheet' href='${url_base}/css/base/radarr/radarr-base.css'>"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/${THEME_TYPE}/${TP_THEME}.css'>"
printf 'Stylesheet set to %s\n' "${TP_THEME}"

if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/radarr\/${addon}\/${addon}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/radarr\/${addon}\/${addon}.css'> /g" "${LOGIN_FILEPATH}"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/addons/radarr/${addon}/${addon}.css'>"
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi
fi

sed -i "s!<body>!<body>${sheets}!g" "${APP_FILEPATH}"
sed -i "s!<body>!<body>${sheets}!g" "${LOGIN_FILEPATH}"
printf 'Stylesheets inserted.'
fi
18 changes: 11 additions & 7 deletions docker-mods/readarr/root/etc/cont-init.d/98-themepark
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '| Adding the stylesheets |'
echo '---------------------------'
sed -i "s/<body>/<body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/readarr\/readarr-base.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/readarr\/readarr-base.css'> /g" "${LOGIN_FILEPATH}"
sed -i "s/<body>/<body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${LOGIN_FILEPATH}"

url_base="${TP_SCHEME}://${TP_DOMAIN}"
sheets="<link rel='stylesheet' href='${url_base}/css/base/readarr/readarr-base.css'>"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/${THEME_TYPE}/${TP_THEME}.css'>"
printf 'Stylesheet set to %s\n' "${TP_THEME}"

if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<body>/<body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/readarr\/${addon}\/${addon}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/readarr\/${addon}\/${addon}.css'> /g" "${LOGIN_FILEPATH}"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/addons/readarr/${addon}/${addon}.css'>"
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi

sed -i "s!<body>!<body>${sheets}!g" "${APP_FILEPATH}"
sed -i "s!<body>!<body>${sheets}!g" "${LOGIN_FILEPATH}"
printf 'Stylesheets inserted.'
fi
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '| Adding the stylesheets |'
echo '---------------------------'
sed -i "s/<body>/<body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/readarr\/readarr-base.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/readarr\/readarr-base.css'> /g" "${LOGIN_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${LOGIN_FILEPATH}"

url_base="${TP_SCHEME}://${TP_DOMAIN}"
sheets="<link rel='stylesheet' href='${url_base}/css/base/readarr/readarr-base.css'>"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/${THEME_TYPE}/${TP_THEME}.css'>"
printf 'Stylesheet set to %s\n' "${TP_THEME}"

if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/readarr\/${addon}\/${addon}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/readarr\/${addon}\/${addon}.css'> /g" "${LOGIN_FILEPATH}"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/addons/readarr/${addon}/${addon}.css'>"
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi

sed -i "s!<body>!<body>${sheets}!g" "${APP_FILEPATH}"
sed -i "s!<body>!<body>${sheets}!g" "${LOGIN_FILEPATH}"
printf 'Stylesheets inserted.'
fi
20 changes: 12 additions & 8 deletions docker-mods/sonarr/root/etc/cont-init.d/98-themepark
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '| Adding the stylesheets |'
echo '---------------------------'
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/sonarr\/sonarr-base.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/sonarr\/sonarr-base.css'> /g" "${LOGIN_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${LOGIN_FILEPATH}"

url_base="${TP_SCHEME}://${TP_DOMAIN}"
sheets="<link rel='stylesheet' href='${url_base}/css/base/sonarr/sonarr-base.css'>"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/${THEME_TYPE}/${TP_THEME}.css'>"
printf 'Stylesheet set to %s\n' "${TP_THEME}"

if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/sonarr\/${addon}\/${addon}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/sonarr\/${addon}\/${addon}.css'> /g" "${LOGIN_FILEPATH}"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/addons/sonarr/${addon}/${addon}.css'>"
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi
fi

sed -i "s!<body>!<body>${sheets}!g" "${APP_FILEPATH}"
sed -i "s!<body>!<body>${sheets}!g" "${LOGIN_FILEPATH}"
printf 'Stylesheets inserted.'
fi
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '| Adding the stylesheets |'
echo '---------------------------'
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/sonarr\/sonarr-base.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/sonarr\/sonarr-base.css'> /g" "${LOGIN_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'> /g" "${LOGIN_FILEPATH}"

url_base="${TP_SCHEME}://${TP_DOMAIN}"
sheets="<link rel='stylesheet' href='${url_base}/css/base/sonarr/sonarr-base.css'>"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/${THEME_TYPE}/${TP_THEME}.css'>"
printf 'Stylesheet set to %s\n' "${TP_THEME}"

if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/sonarr\/${addon}\/${addon}.css'> /g" "${APP_FILEPATH}"
sed -i "s/<body>/<body><link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/sonarr\/${addon}\/${addon}.css'> /g" "${LOGIN_FILEPATH}"
sheets="${sheets} <link rel='stylesheet' href='${url_base}/css/addons/sonarr/${addon}/${addon}.css'>"
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi
fi

sed -i "s!<body>!<body>${sheets}!g" "${APP_FILEPATH}"
sed -i "s!<body>!<body>${sheets}!g" "${LOGIN_FILEPATH}"
printf 'Stylesheets inserted.'
fi
Loading