-
Notifications
You must be signed in to change notification settings - Fork 53
How to use this plugin previous version (1.xx, 1.0.x...)
Since this Banner plugin requires the Redmine which version is 1.2 or later, previous version of Redmine may not run correctly.
In addition to above, this plugin uses javascript to show the message just after top-menu.
Then I made a request to add new viewhook, at http://www.redmine.org/issues/9915.
If you think this request is reasonable, please vote above ;-)
Bannerプラグインは、init.rbに、Redmineバージョン1.2以上、というコードを指定しているため、それより前のバージョンで稼働させようとすると、アプリケーション全体がうまく起動しません。 また、Bannerで使用している、ヘッダ部分へのメッセージ表示は、JavaScriptを利用しています。
Version0.0.3からは、JavaScriptを使う方法で対応していますが、もしよろしかったら、こちらのチケットにVoteしていただければ幸いです。 http://www.redmine.org/issues/9915.
Here is a quick workaround to use this plugin on older version of Redmine, such as 1.0.x, 1.1. / バージョン1.2より前のRedmineで利用する方法は、下記の通りです。
Comment out or remove this line.
- requires_redmine :version_or_higher => '1.2.0'
If not, Redmine will be failed to start.
That's all.
If you are using banner plugin 0.0.2, please see following or update to 0.0.3.
2. Copy Redmine/app/view/layouts/base.rhtml to Redmine/vendr/plugins/redmine_banner/app/view/layouts/base.rhtml
Copy Redmine/app/view/layouts/base.rhtml to Redmine/vendr/plugins/redmine_banner/app/view/layouts/base.rhtml. You can overwrite the existing redmine_banner/app/view/layouts/base.rhtml. This template, base.rhtml, should be based on the same version's one for Redmine.
Banner pluin 0.0.2をご利用の場合は、この作業が必要です。 ただし、特に問題ない限りは、0.0.3へのアップデートをお勧めします。(Redmine本体のバージョンアップに対応しやすくなります)
先にあるものを上書きしてしまってかまいません。 利用しているRedmineのバージョンにマッチしたbase.rhtmlを使うのがポイントです。
Add a this line, <%= call_hook :view_layouts_base_after_top_menu %>, just after <div id="top-menu">..</div> block.
トップメニューを描画する部分の下に、 <%= call_hook :view_layouts_base_after_top_menu %> という一行を挿入します。 <div id="top-menu">..</div> というトップメニューブロックの直下です。
Exp. / 下記が具体例です。
<div id="top-menu">
<div id="account">
<%= render_menu :account_menu -%>
</div>
<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}",:id => 'loggedas') if User.current.logged? %>
<%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
</div>
<%= call_hook :view_layouts_base_after_top_menu %> # This is a magic spell:)