farend / redmine_theme_farend_bleuclair

Custom theme for Redmine. Compatible with: Redmine 3.4 - 6.0
GNU General Public License v2.0
113 stars 19 forks source link

Broken in Redmine 6.0.1 #99

Open Grovkillen opened 3 days ago

Grovkillen commented 3 days ago

I've installed Redmine 6 and the theme is broken. Please see image below:

image

Grovkillen commented 3 days ago

Ok, I got it working by making a bit of a hack since the new file structure for themes in Redmine isn't 100% bullet proof.

First I needed to do some redirect in the nginx.config:

# 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;
}

After that I needed to add the default.css into the themes folder (just copied the standard css code into default.css), and then made the application.css file look like this:

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

image

peter-hank commented 14 hours ago

I have the same problem, it doesn't load the theme.

After that I needed to add the default.css into the themes folder (just copied the standard css code into default.css), and then made the application.css file look like this:

Better to create a symlink to the default theme stylesheet, this will help to keep it up-to-date when new Redmine updates arrive.

Redmine tries to load the theme from /themes/<themename>/application.css. Which is weird because the Redmine Wiki says that it should load /themes/<themename>/stylesheets/application.css.

ishikawa999 commented 13 hours ago

@Grovkillen @peter-hank Thanks for the feedback.

screenshot 2024-12-04 8 38 27

I am able to use a combination of Redmine 6.0.1 and Bleuclair 1.0.2 in my environment and cannot reproduce the problem. Could you please give me some information to reproduce the problem?

Information that would be nice to get:

Just the information you can provide is fine.

Grovkillen commented 7 hours ago

Yes, I installed the theme in the root/themes folder as per the information I got for the 6 version. I will try to get you a step by step procedure of how I set the server up.

ishikawa999 commented 7 hours ago

Yes, I installed the theme in the root/themes folder as per the information I got for the 6 version. I will try to get you a step by step procedure of how I set the server up.

Thanks for your support. The directory where you have the theme installed looks fine.

peter-hank commented 4 hours ago

@ishikawa999

Using the latest Docker image of Redmine (6.0.1) you can reproduce the issue.

Just run the image, use git clone https://github.com/farend/redmine_theme_farend_bleuclair.git themes/bleuclair to clone the theme, set it in the admin and you should see it.

Their default Docker Compose config file is broken, use this one:

version: '3.1'

services:

  redmine:
    image: redmine
    restart: always
    ports:
      - 8080:3000
    environment:
      REDMINE_DB_MYSQL: db
      REDMINE_DB_PASSWORD: example

  db:
    image: mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example
      MYSQL_DATABASE: redmine

It will be on 8080, then admin/admin to login to the admin panel.

peter-hank commented 3 hours ago

Adding the themes folder to the assets pipeline seems to help.

https://github.com/redmine/redmine/blob/master/config/initializers/30-redmine.rb#L29

So instead of:

default_paths << Rails.root.join("app/assets/stylesheets")
Rails.application.config.assets.redmine_default_asset_path = Redmine::AssetPath.new(Rails.root.join('app/assets'), default_paths)

we need:

default_paths << Rails.root.join("app/assets/stylesheets")
default_paths << Rails.root.join("themes")
Rails.application.config.assets.redmine_default_asset_path = Redmine::AssetPath.new(Rails.root.join('app/assets'), default_paths)

Looks like an issue with Redmine, not the theme itself and it's interesting that it works on your setup @ishikawa999.