This is a maintained fork of Akiko Takano's Redmine Banner plugin.
Original repository: https://github.com/akiko-pusu/redmine_banner Original author: Akiko Takano (@akiko_pusu)
Plugin to show site-wide message from site administrator, such as maintenance information or notifications.
本リポジトリは「Redmine Banner」プラグインのメンテナンスフォークです。 Redmine 4 / 5 / 6 向けの動作確認と、ロール別プロジェクトバナーなどの拡張を追加しています。
This repository is a fork that keeps the original behaviour while adding some features and Redmine 6 support.
- Based on original 0.3.4
- Plugin version: 0.4.2
- Main additions in this fork:
- Redmine 4 / 5 / 6 support
- Role-based project banners (
project_id+role_id) - Force display option for the default project banner
- Colored role labels (“badges”) based on role priority
- Banner macros for countdowns, date/time, environment and user info
- Locales from the original plugin are kept; new strings are provided in English and Japanese (other languages fall back to English)
- Behaviour when you do not configure any role-specific banner:
- Stays the same as original: “one project – one banner”
Tested with:
- Redmine 4.2.x
- Redmine 5.1.x
- Redmine 6.0.x / 6.1.x
Fork maintainer:
- Seraph (@seraph3000)
-
Copy the plugin directory into the $REDMINE_ROOT/plugins directory. Please note that plugin's folder name should be "redmine_banner". If changed, some migration task will be failed.
-
Do migration task.
rake redmine:plugins:migrate NAME=redmine_banner RAILS_ENV=production
-
(Re)Start Redmine.
If you are already using Akiko's original plugin:
- Stop Redmine.
- Replace the old plugin directory with this fork (keeping the directory name
redmine_banner):
cd $REDMINE_ROOT/plugins
rm -rf redmine_banner
git clone https://github.com/seraph3000/redmine_banner.git- Run migrations (this fork adds a new column
role_idtobannerstable):
cd $REDMINE_ROOT
rake redmine:plugins:migrate NAME=redmine_banner RAILS_ENV=production- Restart Redmine.
Existing data:
-
Existing project banners are kept as default project banners
(
role_idwill beNULL). -
Until you configure role-specific banners, behaviour will be identical to
the original plugin.
Try this:
rake redmine:plugins:migrate NAME=redmine_banner VERSION=0 RAILS_ENV=production- Go to plugin's page and click "Settings" link of Redmine Banner Plugin. You can edit banner message and select style for message. Also you can access setting page from administration menu, click "banner" icon.
This fork adds simple macros that you can use inside the banner message. They are expanded on display for both the global banner and project banners.
All countdown macros take a target date/time in the current user's time zone:
%{cdate:YYYY-MM-DD HH:MM}– remaining days until the target.%{chours:YYYY-MM-DD HH:MM}– remaining hours (0–23 after subtracting full days).%{cmin:YYYY-MM-DD HH:MM}– remaining minutes (0–59 after subtracting full hours).%{ctime:YYYY-MM-DD HH:MM}– remaining total time asHH:MM(for example120:15).
Example:
Maintenance will start in %{cdate:2026-02-02 08:00} days \
%{chours:2026-02-02 08:00} hours \
%{cmin:2026-02-02 08:00} minutes.
If the target time is in the past, countdown macros return 0
(or 00:00 for ctime).
%{today}– current date formatted according to the user's language preferences (format_date).%{now}– current date and time formatted according to the user's language preferences (format_time).%{env}– environment label derived fromRails.env(for examplePROD,DEV,STG).
Example:
[%{env}] Information for %{today}.
This banner was last updated at %{now}.
These macros are expanded only for logged-in users. For anonymous users they return an empty string.
%{user_name}– current user's display name.%{user_last_login}– user's last login date/time (not shown on the login page for privacy reasons).%{user_login_rank_today}– “you are the N-th logged-in user today”, calculated fromusers.last_login_on.
Example:
You are %{user_login_rank_today}-th user logged in today.
Your last login: %{user_last_login}
This notice is for %{user_name}.
Note:
user_login_rank_todayperforms a count query on theuserstable for the current day. On very large instances this may have some performance impact; if in doubt, do not use this macro.
- Banner can be used as a project module. If you want to manage the banner in your project, "Manage Banner" permission is required for your role.
- Go to project settings tab and check "Banner" as project module.
- Then you can see "Banner" tab on project settings page.
This fork extends project banners so you can define different messages per role.
- Each banner record has:
project_idrole_id(may beNULL)- other fields (style, description, etc.)
- For a given project and current user:
- Plugin collects the user's roles in that project.
- If a banner exists whose
role_idmatches one of those roles:-
The banner for the highest priority role (based on Redmine role
position) is shown.
-
- If no role-specific banner exists:
- The default project banner (
role_id = NULL) is shown.
- The default project banner (
Example use cases:
- Project managers see:
“Reminder: please review open issues before the sprint starts.”
- Reporters see:
“When creating issues, please fill in the ‘Steps to reproduce’ section.”
If you do not configure any roles, the behaviour is exactly the same as
original: one banner per project.
- Banner for each project does not support timer.
- Banner for each project is located at the top of the project only. (Not support footer)
Please use ver 0.1.x or v0.1.x-support-Redmine3 branch in case using Redmine3.x.
- Fix: global banner could not be saved when edited from a project page as an admin (routing error to
/global_banner/<project>). Now the global banner always posts correctly toglobal_banner#update.
- Add banner macros for countdown, date/time, environment and user information.
- Apply macro expansion to both global and project banners.
- Add
role_idcolumn tobannerstable. - Add
Banner.for(project, user)to select a project banner based on user roles. - Implement role-based selection in project banner hook.
- Keep PNG icons and behaviour for Redmine 4 / 5.
- Do not change default behaviour when
role_idis not used.
For older changes, please see the original project’s changelog:
Maintenance release.
- Update German translation. (GitHub: #142 by @teatower)
This is bugfix release against 0.3.2. Updating to 0.3.3 is highly recommended!
- Bugfix: HTML problems on redmine_banner.
- Bugfix: Fix wrong url to project banner setting. *Refactor: Remove unused file.
This is bugfix release against 0.3.1. Updating to 0.3.2 is highly recommended!
- Bugfix: HTML problems on redmine_banner 0.3.1. (#134)
- Bugfix: Global banner off does not work correctly. (Degrade from v0.2x)
- Update Chinese translation. (GutHub: #131 by iWangJiaxiang)
- Feature: Enabled to switch who can see the global banner. (#126)
- Refactor: Change to use project menu to prevent the project setting tab's conflict. (#127)
- Feature: Enabled to switch who can see the global banner. (#126)
- Refactor: Change to use project menu to prevent the project setting tab's conflict. (#127)
- Add feature: Give the ability to specific users to manage the site-wide banner. (GitHub: #86 / #113)
- Administrator can assign a group to manage global banner via UI.
- Code refactoring for maintainability.
- Change not to use SettingsController's patch to the update global banner.
This is bugfix release against 0.2.1. Updating to 0.2.2 is highly recommended!
- Fix: Prevent conflict with other plugins. (GitHub: #121)
- French translation update by sparunakian (GitHub: #117)
- Fix: Prevent conflict with CKEditor. (GitHub: #111)
- Code refactoring.
- Add feature to update Global Banner via API. (Alpha / Related: #86 #113)
- Not only Redmine admin but also user who assigned group named GlobalBanner_Admin can also update Global banner via API.
- Even prptotype version.
- Please see swagger.yml to try update global banner via API.
- Update CI Setting
- Add step to build and push image to AWS ECR.
- Add steps to build and deploy to Heroku Container registry as release container service.
- Add how to try banner via Docker in README.
- Support Redmine 4.x.
- Now master branch unsupports Redmine 3.x.
- Please use ver 0.1.x or
v0.1.x-support-Redmine3branch in case using Redmine3.x. - https://github.com/akiko-pusu/redmine_banner/tree/v0.1.x-support-Redmine3
- Follow Redmine's preview option to the wiki toolbar.
NOTE: Mainly, maintenance, bugfix and refactoring only. There is no additional feature, translation in this release.
- Fix style and css selector. (Github: #45)
- Change global banner style for responsive mode. (Github: #68)
- Code refactoring.
- Fix: Prevent deprecation warning. (Github PR: #60) Thanks, Wojciech.
- Refactor: Rename file to prevent conflict (Github #63 / r-labs: 54).
- i18n: Update Italian translation file. (Github: #61 / r-labs: 57) Thanks, R-i-c-k-y.
- i18n: Add Spanish translation file. (Github: #61 / r-labs: 52) Thanks Picazamora!
- i18n: Update Turkish translation file. (Github: #64) Thank you so much, Adnan.
- i18n: Update Portuguese translation file. (Github: #50) Thanks, Guilherme.
- Support Redmine 3.x.
- Update some translation files. Bulgarian, German. Thank you so much, Ivan Cenov, Daniel Felix.
- Change column type of banner_description from string to text.Thank you so much Namezero. (#44)
- Fixed bug: Global banner timer does not work. (r-labs: #1337)
- Feature: Add related link field for more information to Global Banner. (r-labs: #1339)
- i18n: Update Korean translation file. (r-labs: #1329) Thank you so much, Ki Won Kim.
- Authenticated users can turn off global banner in their session.
- Add option to show global banner only for authenticated users.
- Add option to show only at the login page.
- Code refactoring.
- Italian translation was contributed by @R-i-c-k-y.
- French translation was contributed by Laurent HADJADJ.
- Support Redmine 2.1. (Redmine 2.0.x is no longer supported. Please use version 0.0.7 for Redmine 2.0.x)
- Compatible with Redmine 2.0.0
- Fixed bug: Project banner should be off when module turned disabled.
- Fixed bug: In some situation, "ActionView::TemplateError undefined method is_action_to_display" is happened.
- Update Russian Translation. Thank you so much, Александр Ананьев.
- Support banner for each project. Thank you so much, Denny Schäfer, Haru Iida.
- Support timer function.
- Add links to turn off or modify banner message quickly. (Links are shown to Administrator only)
- Code refactoring. Stop to override base.rhtml and use javascript. Great thanks, Haru Iida-san. Also, remove some "To-Do" section of README.
- Add translations. Russian, German, Brazilian Portugues. Thank you so much, Александр Ананьев, Denny Schäfer, Maiko de Andrade!
- Support i18n.
- First release
You can try quickly this plugin with Docker environment. Please try:
# Admin password is 'redmine_banner_commit_sha'
% git clone https://github.com/akiko-pusu/redmine_banner
% cd redmine_banner
% docker-compose up web -d
# or
#
# Admin password is 'redmine_banner_{COMMIT}'
% docker build --build-arg=COMMIT=$(git rev-parse --short HEAD) \
--build-arg=BRANCH=$(git name-rev --name-only HEAD) -t akiko/redmine_banner:latest .
% docker run -p 3000:3000 akiko/redmine_banner:latestPlease see wercker.yml for more details.
% cd REDMINE_ROOT_DIR
% cp plugins/redmine_banner/Gemfile.local plugins/redmine_banner/Gemfile
% bundle install --with test
% export RAILS_ENV=test
% bundle exec ruby -I"lib:test" -I plugins/redmine_banner/test \
plugins/redmine_banner/test/functional/banner_controller_test.rbor
% bundle exec rails redmine_banner:test- Original: https://github.com/akiko-pusu/redmine_banner
- Fork (this repository): https://github.com/seraph3000/redmine_banner
- http://www.r-labs.org/projects/banner (Project Page)
This software is licensed under the GNU GPL v2.
See COPYRIGHT and COPYING for details.
Original copyright remains with Akiko Takano.
Additional changes in this fork are provided under the same license.
