Skip to content

Commit

Permalink
Merge branch 'release/v1.26.1-3'
Browse files Browse the repository at this point in the history
  • Loading branch information
kahoona77 authored and cesmarvin committed Aug 6, 2024
2 parents c6218a0 + 58a46e2 commit 8161532
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v1.26.1-3] - 2024-08-06
### Added
- Default CSS Styles and Whitelabeling CSS Styles are being loaded now (#96)
- similarly to the already existing warp-menu script and styles

## [v1.26.1-2] - 2024-07-01
### Changed
- Update base image to Version 3.20.1-2 (#92)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RUN wget --progress=bar:force:noscroll -O /tmp/theme.zip https://github.com/clou
FROM registry.cloudogu.com/official/base:3.20.1-2
LABEL maintainer="[email protected]" \
NAME="official/nginx" \
VERSION="1.26.1-2"
VERSION="1.26.1-3"

ENV CES_MAINTENANCE_MODE=false

Expand Down
2 changes: 1 addition & 1 deletion dogu.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "official/nginx",
"Version": "1.26.1-2",
"Version": "1.26.1-3",
"DisplayName": "Nginx",
"Description": "Nginx WebServer.",
"Logo": "https://cloudogu.com/images/dogus/nginx.png",
Expand Down
15 changes: 14 additions & 1 deletion resources/etc/nginx/include.d/subfilters.conf.tpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# warp menu
set $scripts '<script type="text/javascript" src="/warpmenu/add-warp-menu.js"></script></body>';
set $scripts '<script type="text/javascript" src="/warpmenu/add-warp-menu.js"></script>';

# Include google analytics scripts if a tracking id is set
{{ if .Config.Exists "google_tracking_id" }}
set $analytics '<script> var disableStr = "ga-disable-{{ .Config.Get "google_tracking_id" }}"; if (document.cookie.indexOf(disableStr + "=true") > -1) { window[disableStr] = true; }; function gaOptout() { document.cookie = disableStr + "=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/"; window[disableStr] = true; }</script><!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id={{ .Config.Get "google_tracking_id" }}"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag("js", new Date()); gtag("config", "{{ .Config.Get "google_tracking_id" }}", { "anonymize_ip": true }); </script> <link rel="stylesheet" type="text/css" href="https://cloudogu.com/css/cookieconsent.min.css" /> <script src="https://cloudogu.com/javascripts/cookieconsent.min.js"></script> <script> window.addEventListener("load", function(){ window.cookieconsent.initialise({ "palette": { "popup": { "background": "#23a3dd", "text": "#ffffff" }, "button": { "background": "#878787", "text": "#ffffff" } }, "content": { "message": "This website uses cookies to ensure you get the best experience on our website. By continuing to use our websites, you consent to the use of cookies.", "href": "/info/privacyPolicy", "link": "Our Privacy Policy", "dismiss": "Got it!" } })}); </script> ';
set $scripts '$analytics $scripts';
{{ end }}

# include whitelabeling
set $whitelabeling '<script type="text/javascript" src="/styles/add-whitelabeling-styles.js"></script>';
set $scripts '$scripts $whitelabeling';

# add closing body-tag
set $scripts '$scripts </body>';

# apply scripts only on GET or POST requests
set $allowed_method 0;
if ($request_method = GET){
Expand All @@ -26,9 +33,15 @@ if ($http_x_requested_with ~ XMLHttpRequest) {

# replace </body> with $scripts for html pages
sub_filter '</body>' $scripts;

sub_filter_once on;

# warp menu
location /warp {
root /var/www/html;
}

# default styles
location /styles {
root /var/www/html;
}
23 changes: 23 additions & 0 deletions resources/var/www/html/styles/add-whitelabeling-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const addWhitelabelClassToRoot = function () {
document.documentElement.classList.add("ces-whitelabel")
}

const addDefaultStyles = function () {
const link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = "/styles/default.css"
document.head.appendChild(link);
}

const addWhitelabelingStyles = function(){
const link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = "/whitelabeling/main.css"
document.head.appendChild(link);
}

addWhitelabelClassToRoot();
addDefaultStyles();
addWhitelabelingStyles();
37 changes: 37 additions & 0 deletions resources/var/www/html/styles/default.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
:root {
--ces-brand-stronger: #003250;
--ces-brand-strong: #00426B;
--ces-brand: #00629E;
--ces-brand-weak: #9EDAFF;
--ces-brand-weaker: #D4EDFC;

--ces-success-stronger: #0A2913;
--ces-success-strong: #145226;
--ces-success: #1F7A38;
--ces-success-weak: #85E09E;
--ces-success-weaker: #EBFAEF;

--ces-danger-stronger: #521414;
--ces-danger-strong: #7A1F1F;
--ces-danger: #CC3333;
--ces-danger-weak: #EBADAD;
--ces-danger-weaker: #F8EDED;

--ces-warning-stronger: #3D3700;
--ces-warning-strong: #574E00;
--ces-warning: #707600;
--ces-warning-weak: #FFE500;
--ces-warning-weaker: #FFFACC;

--ces-neutral-stronger: #333333;
--ces-neutral-strong: #4D4D4D;
--ces-neutral: #666666;
--ces-neutral-weak: #CCCCCC;
--ces-neutral-weaker: #F5F5F5;

--ces-default-background: #FFFFFF;
--ces-default-focus-inner: #FFFFFF;
--ces-default-focus-outer: #CC14CC;
--ces-default-text: #0D1C26;
--ces-inverted-text: #FCFCFD;
}

0 comments on commit 8161532

Please sign in to comment.