From 63f5ac85787b55b7e25b236d605c7878a7cde57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Van=C3=AD=C4=8Dek?= Date: Tue, 28 Mar 2023 22:42:47 +0200 Subject: [PATCH] Favicon revert to standard. Logo and login bg fixes. --- Dockerfile | 2 ++ patches/uxupgrade_logo.patch | 56 ++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 patches/uxupgrade_logo.patch diff --git a/Dockerfile b/Dockerfile index a216faf..bc27c58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN set -eux; \ # Apply patches git apply project_identifier.patch; \ git apply uxupgrade_cleanstartup.patch; \ + git apply uxupgrade_logo.patch; \ git apply workload_sql.patch; \ git apply workload_style.patch; \ git apply workload_module.patch; \ @@ -44,6 +45,7 @@ RUN set -eux; \ mv /pre-entrypoint.sh /docker-entrypoint.sh; \ # Copy themes cp -r plugins/000_redmine_x_ux_upgrade/assets/themes/redminex_theme public/themes/; \ + chown -R 999:999 public/themes/redminex_theme; \ # Clean-up apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/patches/uxupgrade_logo.patch b/patches/uxupgrade_logo.patch new file mode 100644 index 0000000..627315a --- /dev/null +++ b/patches/uxupgrade_logo.patch @@ -0,0 +1,56 @@ +--- a/plugins/000_redmine_x_ux_upgrade/lib/redmine_x_ux_upgrade.rb ++++ b/plugins/000_redmine_x_ux_upgrade/lib/redmine_x_ux_upgrade.rb +@@ -41,7 +41,7 @@ module RedmineXUxUpgrade + + logo = settings.attachments.where(description: 'logo')&.last + redmine_x_ux_theme_path = File.join(Rails.root, 'public', 'themes', 'redminex_theme', 'images') +- path_to_logo = "#{redmine_x_ux_theme_path}/#{logo.disk_filename}" if logo ++ path_to_logo = "#{redmine_x_ux_theme_path}/logo.png" if logo + + if path_to_logo && File.exist?(path_to_logo) + return ActionController::Base.helpers.asset_path("#{Redmine::Utils::relative_url_root}/themes/redminex_theme/images/#{logo.disk_filename}", :plugin => '000_redmine_x_ux_upgrade') +--- a/plugins/000_redmine_x_ux_upgrade/lib/redmine_x_ux_upgrade/ux_upgrade_attachments.rb ++++ b/plugins/000_redmine_x_ux_upgrade/lib/redmine_x_ux_upgrade/ux_upgrade_attachments.rb +@@ -13,6 +13,7 @@ module RedmineXUxUpgrade + LOGIN_NAME = 'login' + LOGIN_DESKTOP_NAME = 'login_desktop' + LOGIN_MOBILE_NAME = 'login_mobile' ++ LOGO_FILE = 'logo.png' + LOGIN_DESKTOP_FILE = 'login-2k.jpg' + LOGIN_MOBILE_FILE = 'login.jpg' + +@@ -153,10 +154,8 @@ module RedmineXUxUpgrade + # @param [String | nil] filename - name of the filename of the logo file + # @return [String] - path to file corresponding to the given name + def self.image_path(name, filename=nil) +- if name == LOGO_NAME && filename +- File.join(Rails.root, 'public', 'themes', 'redminex_theme', 'images', filename) +- elsif name == LOGO_NAME && filename.nil? +- File.join(Rails.root, 'public', 'themes', 'redminex_theme', 'images') ++ if name == LOGO_NAME ++ File.join(Rails.root, 'public', 'themes', 'redminex_theme', 'images', LOGO_FILE) + elsif name == LOGIN_DESKTOP_NAME + File.join(Rails.root, 'public', 'themes', 'redminex_theme', 'images', LOGIN_DESKTOP_FILE) + elsif name == LOGIN_MOBILE_NAME +--- a/plugins/000_redmine_x_ux_upgrade/lib/redmine_x_ux_upgrade/application_helper_patch.rb ++++ b/plugins/000_redmine_x_ux_upgrade/lib/redmine_x_ux_upgrade/application_helper_patch.rb +@@ -70,19 +70,6 @@ module RedmineXUxUpgrade + super *sources, options + end + +- # Redefined - line 1723 +- def favicon +- favicon_path = "#{Redmine::Utils::relative_url_root}/themes/redminex_theme/images/favicon" +- +- " +- +- +- +- +- +- ".html_safe +- end +- + # *************** + # * New methods * + # *************** \ No newline at end of file