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

In Redmine version 6.0.0, the current theme appears to be broken. #284

Open
jaebokoh opened this issue Nov 12, 2024 · 16 comments
Open

In Redmine version 6.0.0, the current theme appears to be broken. #284

jaebokoh opened this issue Nov 12, 2024 · 16 comments

Comments

@jaebokoh
Copy link

In Redmine version 6.0.0, the current theme appears to be broken.

image
@Shanti9
Copy link

Shanti9 commented Nov 20, 2024

Yes, same here! I have returned to 5.1.4 until this is resolved. Is there a plan to make PurpleMine compatible with Redmine 6?

@Grovkillen
Copy link

Yeah, same for me. I guess the move from

-/public/themes/*
-!/public/themes/alternate
-!/public/themes/classic
-!/public/themes/README

to

+/app/assets/themes/*
+!/app/assets/themes/alternate
+!/app/assets/themes/classic
+!/app/assets/themes/README

Really messed things up. I tried to just change the path in the themes application.css file but it's not pointing to the correct path once deployed.

https://www.redmine.org/issues/39111

@Grovkillen
Copy link

I got it somewhat to work by adding this to my nginx.config file:

# Needed MIME-types
types {
	text/css css;
	application/javascript js;
}

# CSS files
location ~ ^/assets/themes/(.+?)/(.+?)\.css$ {
	alias /usr/share/redmine/themes/$1/stylesheets/$2.css;
	access_log off;
	expires max;
}

# JavaScript files
location ~ ^/assets/themes/(.+?)/(.+?)\.js$ {
	alias /usr/share/redmine/themes/$1/javascripts/$2.js;
	access_log off;
	expires max;
}

# favicon files
location ~ ^/assets/themes/(.+?)/favicon.ico$ {
	alias /usr/share/redmine/themes/$1/favicon/favicon.ico;
	access_log off;
	expires max;
}

# font files
location ~ ^/assets/themes/fonts/(.+?)\.([^?]+?)$ {
	alias /usr/share/redmine/themes/fonts/$1.$2;
	access_log off;
	expires max;
}

# images files
location ~ ^/assets/themes/(.+?)/images/(.+?)\.(.+?)$ {
	alias /usr/share/redmine/themes/$1/images/$2.$3;
	access_log off;
	expires max;
}

# svg files
location ~ ^/assets/themes/(.+?)/svg/(.+?)\.(.+?)$ {
	alias /usr/share/redmine/themes/$1/svg/$2.$3;
	access_log off;
	expires max;
}

And moved all the code from application.css into a theme.css file. All the default css code from the Redmine application.css file copied to a file I named default.css. The new application.css file have this inside:

@import url(./default.css);
@import url(./theme.css);

And lastly I moved the fonts folder directly under the themes folder.

image

@Shanti9
Copy link

Shanti9 commented Dec 2, 2024

That's a great hack @Grovkillen! But was it not simpler to just redistribute Purplemine assets so that file paths accommodate to Redmine 6 requirements? As not everyone has access or convenience of editing nginx conf...

@Grovkillen
Copy link

Yeah, I just wanted to get my installation working but I do agree that the Redmine team need to think about the way they intend this new structure.

@BFjimmy
Copy link

BFjimmy commented Dec 2, 2024

Just to add. The new Redmine interface uses SVG files for these elements. I had to remove them by adding this to the theme file:

a > svg,
span > svg,
legend > svg {
    display: none;
}

@BFjimmy
Copy link

BFjimmy commented Dec 3, 2024

Also added these:

a > svg,
span > svg,
legend > svg,
.icon > svg,
div > svg {
  display: none;
}

@fishermans
Copy link

This is my proxy config, running redmine on sub uri .../redmine on docker. It also needs further tuning like config.ru settings.

Not even the purple mine theme is looking as shown above but also the additional themes are broken. I told that to the redmine team before v6 came out but they have not change it, yet.


# the regex logic: after either /javascripts/ or /stylesheets/ find the suffixes we want, followed by one or more numbers 0-9
# This works because the files we want to cache always appear after one of those 2 directories:  but not the files we want to ignore
# /journals/edit/24174.js  and /uploads.js?attachment_id=1&filename=my-file-to-upload.png
location ~* /redmine(?<file>/(?:(?:plugin_assets|themes).+)?(?:javascripts|stylesheets|images|favicon).+(?:css|js|jpe?g|gif|ico|png|html)(\?[0-9]+)$) {

    expires 24h;
    gzip on;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript text/html;

    try_files $file @redmine;
    break;
}

location ^~ /redmine {
    ## Serve static files from defined root folder.
    ## @redmine is a named location for the upstream fallback, see below.
    try_files $uri index.html $uri.html @redmine;
}

# Fix for Redmine 6.0.0 since sub uri is not totally supported, yet.
location ^~ /assets/ {
    rewrite ^/assets/(.*)$ /redmine/assets/$1 break;
    try_files $uri index.html $uri.html @redmine;
}

## If a file, which is not found in the root folder is requested,
## then the proxy passes the request to the upsteam (redmine unicorn).
location @redmine {
    #Set backend server
    #set $redmine_back redmine:3000;
    set $redmine_back unix:/var/redmine/sockets/redmine.sock;

    # Enable proxy caching
    proxy_cache redmine_cache;
    proxy_cache_revalidate on;
    proxy_cache_min_uses 3;
    proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
    proxy_cache_background_update on;
    proxy_cache_lock on;
    proxy_cache_bypass $cookie_nocache $arg_nocache $http_pragma;

    # Cache valid responses
    proxy_cache_valid 301 999m;
    proxy_cache_key "$scheme://$host$request_uri";
    proxy_ignore_headers X-Accel-Expires Expires Cache-Control;

    ## If you use HTTPS make sure you disable gzip compression
    ## to be safe against BREACH attack.
    # gzip off;

    ## Some requests take more than 30 seconds.
    proxy_read_timeout      300;
    proxy_connect_timeout   300;
    proxy_redirect          off;

    proxy_pass http://$redmine_back;
}

@Grovkillen
Copy link

Yes, the Redmine team seems a bit off regarding this. But on the other hand, I haven't found any reports about it. And also, the sub-uri integration isn't very straight forward as you mention @fishermans

@Grovkillen
Copy link

I've found an issue report here: https://www.redmine.org/issues/41754

@Plinsboorg
Copy link

Hi all,
I'm not a programmer myself, but I can ask for external help.
But first I need to understand where the problem of these big icons comes from.
Is this something that can be fixed by modifying the theme repo itself?
Or is it not possible, and redmine maintainers need to change something on their end first?

@fishermans
Copy link

Hi all, I'm not a programmer myself, but I can ask for external help. But first I need to understand where the problem of these big icons comes from. Is this something that can be fixed by modifying the theme repo itself? Or is it not possible, and redmine maintainers need to change something on their end first?

The reason is that some data are not found by the browser. If you hit F12 in Chrome, you will see that some js / css files are not found. The location for themes and the way how it is handled has changed in v6.

As @Grovkillen pointed out there is an issue logged. I did not try it again since I am still on v5.1.

Maybe it needs some further modifications to your Apache / nginx configuration if your instance is behind a proxy. I am using nginx and added some lines (see above) to fix the missing data.

In short, if all data are found by the browser the icon will appear in the expected size.

@Grovkillen
Copy link

Grovkillen commented Jan 3, 2025 via email

@fishermans
Copy link

The patch attached to this ticket is only adding some information to the documentation.

@Plinsboorg
Copy link

I just run Redmine 6.0.2.stable in docker and I can still see this issue with PurpleMine theme.
But I only tested on localhost.

@alemeilleur
Copy link

Same pb (with Apache2) ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants