diff --git a/README.ja.md b/README.ja.md index 398bc8b..978b61b 100644 --- a/README.ja.md +++ b/README.ja.md @@ -4,7 +4,7 @@ ## 機能 -条件に一致した画面に対して、JavaScript、CSSを埋め込むことで、画面をカスタマイズします。 +条件に一致した画面に対して、JavaScript、CSS、HTMLを埋め込むことで、画面をカスタマイズします。 ## インストール方法 @@ -50,7 +50,7 @@ bundle exec rake redmine:plugins:migrate RAILS_ENV=production 該当ページにコードの挿入位置に該当する箇所が無かった場合、コードは埋め込まれません。たとえば、「Path pattern」で`.*`で全ページを指定しても、「Insertion position」に「Bottom of issue detail」を指定していると、チケットの詳細表示画面でしか実行されないことになります。 -「Type」にてコードの種類(「JavaScript」または「CSS」)を選択し、「Code」に実際のコードを入力します。 +「Type」にてコードの種類(「JavaScript」、「CSS」または「HTML」)を選択し、「Code」に実際のコードを入力します。 「Comment」にはカスタマイズに対する概要を記載できます。ここで入力した内容は、一覧表示で表示されます。(Commentが入力されていればComment、Commentが入力されていない場合はCodeが一覧に表示) @@ -127,7 +127,7 @@ ViewCustomize = { ## サポートバージョン -* 最新バージョン : Redmine 3.1.x 以降 +* 最新バージョン : Redmine 3.1.x から 3.4.x、4.0.x 以降 * 1.2.2 : Redmine 2.0.x から 3.4.x ## ライセンス diff --git a/README.md b/README.md index 52086d4..6b79b13 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This a plugin allows you to customize the view for the [Redmine](http://www.redm ## Features -Customize the page by inserting JavaScript or CSS on the page that matched the condition. +Customize the page by inserting JavaScript, CSS or HTML on the page that matched the condition. ## Installation @@ -53,7 +53,7 @@ Issue input fields are reconstructed when trackers or statuses are changed. If " If there is no part corresponding to the insertion position of the code on the page, the code is not insert. For example, even if you specify `.*` in "Path pattern", if "Bottom of issue detail" is specified for "Insertion position", it will be executed only on the issue detail page. -In "Type", select the type of code ("JavaScript" or "CSS") and enter the actual code in "Code". +In "Type", select the type of code ("JavaScript", "CSS" or "HTML") and enter the actual code in "Code". For "Comment" you can put an overview on customization. The contents entered here are displayed in the list display. When "Comment" is entered, "Comment" is displayed on the list. @@ -133,7 +133,7 @@ For example, to access the user's API key is `ViewCustomize.context.user.apiKey` ## Supported versions -* Current version : Redmine 3.1.x or later +* Current version : Redmine 3.1.x - 3.4.x, 4.0.x or later * 1.2.2 : Redmine 2.0.x - 3.4.x ## License diff --git a/app/models/view_customize.rb b/app/models/view_customize.rb index 0a77dfd..979bc26 100644 --- a/app/models/view_customize.rb +++ b/app/models/view_customize.rb @@ -10,10 +10,12 @@ class ViewCustomize < ActiveRecord::Base TYPE_JAVASCRIPT = "javascript" TYPE_CSS = "css" + TYPE_HTML = "html" @@customize_types = { :label_javascript => TYPE_JAVASCRIPT, - :label_css => TYPE_CSS + :label_css => TYPE_CSS, + :label_html => TYPE_HTML } INSERTION_POSITION_HTML_HEAD = "html_head" @@ -50,6 +52,10 @@ def is_css? customize_type == TYPE_CSS end + def is_html? + customize_type == TYPE_HTML + end + def available?(user=User.current) is_enabled && (!is_private || author == user) end diff --git a/app/views/view_customizes/show.html.erb b/app/views/view_customizes/show.html.erb index 7cedbc1..74254ab 100644 --- a/app/views/view_customizes/show.html.erb +++ b/app/views/view_customizes/show.html.erb @@ -28,7 +28,7 @@