LoginSignup
0
2

More than 5 years have passed since last update.

Redmineの注記にテンプレートを入れる(手抜き版)

Posted at

ViewCustomizePluginを使います。

Path pattern: /issues/[0-9]+$
Type: JavaScript

$(function(){
  // テンプレートの文言設定
  let template = "1行目:テンプレート付きで注記を入れる\n2行目:改行する";
  template = encodeURIComponent(template);

  // とりあえず上のメニューにだけ追加する
  let elementReference = document.getElementById( "content" ).firstElementChild;

  // Aタグを追加
  let anchor = document.createElement("a");
  anchor.href = location.pathname + "/edit?issue[notes]=" + template;

  let str = document.createTextNode("テンプレート付き注記");
  anchor.appendChild(str);

  elementReference.insertBefore(anchor, elementReference.firstChild);
});

こんな感じになります。

image.png

リンククリックで編集
image.png

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2