mirror of
https://github.com/dolphin-emu/redmine_issue_templates.git
synced 2026-01-31 01:15:19 +01:00
Try to use JQueryUI's tooltip.
This commit is contained in:
@@ -97,26 +97,24 @@ class IssueTemplatesController < ApplicationController
|
|||||||
|
|
||||||
# update pulldown
|
# update pulldown
|
||||||
def set_pulldown
|
def set_pulldown
|
||||||
|
@grouped_options = []
|
||||||
|
group = []
|
||||||
|
@default_template = nil
|
||||||
@setting = IssueTemplateSetting.find_or_create(@project.id)
|
@setting = IssueTemplateSetting.find_or_create(@project.id)
|
||||||
inherit_template = @setting.enabled_inherit_templates?
|
inherit_template = @setting.enabled_inherit_templates?
|
||||||
|
|
||||||
@default_template = nil
|
|
||||||
|
|
||||||
project_ids = inherit_template ? @project.ancestors.collect(&:id) : [@project.id]
|
project_ids = inherit_template ? @project.ancestors.collect(&:id) : [@project.id]
|
||||||
issue_templates = IssueTemplate.where('project_id = ? AND tracker_id = ? AND enabled = ?',
|
issue_templates = IssueTemplate.where('project_id = ? AND tracker_id = ? AND enabled = ?',
|
||||||
@project.id, @tracker.id, true).order('position')
|
@project.id, @tracker.id, true).order('position')
|
||||||
|
|
||||||
project_default_template = IssueTemplate.where('project_id = ? AND tracker_id = ? AND enabled = ?
|
project_default_template = IssueTemplate.where('project_id = ? AND tracker_id = ? AND enabled = ?
|
||||||
AND is_default = ?',
|
AND is_default = ?',
|
||||||
@project.id, @tracker.id, true, true).first
|
@project.id, @tracker.id, true, true).first
|
||||||
|
|
||||||
unless project_default_template.blank?
|
unless project_default_template.blank?
|
||||||
@default_template = project_default_template
|
@default_template = project_default_template
|
||||||
end
|
end
|
||||||
|
|
||||||
@grouped_options = []
|
|
||||||
group = []
|
|
||||||
|
|
||||||
if issue_templates.size > 0
|
if issue_templates.size > 0
|
||||||
issue_templates.each { |x| group.push([x.title, x.id]) }
|
issue_templates.each { |x| group.push([x.title, x.id]) }
|
||||||
end
|
end
|
||||||
@@ -125,8 +123,8 @@ class IssueTemplatesController < ApplicationController
|
|||||||
inherit_templates = []
|
inherit_templates = []
|
||||||
|
|
||||||
# keep ordering of project tree
|
# keep ordering of project tree
|
||||||
# TODO: Add Test code.
|
# TODO: Add Test code.
|
||||||
project_ids.each do |i|
|
project_ids.each do |i|
|
||||||
inherit_templates.concat(IssueTemplate.where('project_id = ? AND tracker_id = ? AND enabled = ?
|
inherit_templates.concat(IssueTemplate.where('project_id = ? AND tracker_id = ? AND enabled = ?
|
||||||
AND enabled_sharing = ?', i, @tracker.id, true, true).order('position'))
|
AND enabled_sharing = ?', i, @tracker.id, true, true).order('position'))
|
||||||
end
|
end
|
||||||
@@ -135,7 +133,7 @@ class IssueTemplatesController < ApplicationController
|
|||||||
inherit_templates.each do |x|
|
inherit_templates.each do |x|
|
||||||
group.push([x.title, x.id, {:class => "inherited"}])
|
group.push([x.title, x.id, {:class => "inherited"}])
|
||||||
if x.is_default == true
|
if x.is_default == true
|
||||||
if project_default_template.blank?
|
if project_default_template.blank?
|
||||||
@default_template = x
|
@default_template = x
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -144,16 +142,16 @@ class IssueTemplatesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
@globalIssueTemplates = GlobalIssueTemplate.find(:all,:include => [:projects],
|
@globalIssueTemplates = GlobalIssueTemplate.find(:all,:include => [:projects],
|
||||||
:conditions => [" tracker_id = ? AND projects.id = ?", @tracker.id, @project.id] )
|
:conditions => [" tracker_id = ? AND projects.id = ?", @tracker.id, @project.id] )
|
||||||
|
|
||||||
if @globalIssueTemplates.any?
|
if @globalIssueTemplates.any?
|
||||||
@globalIssueTemplates.each do |x|
|
@globalIssueTemplates.each do |x|
|
||||||
group.push([x.title, x.id, {:class => "global"}])
|
group.push([x.title, x.id, {:class => "global"}])
|
||||||
if x.is_default == true
|
# Using global template as default template is now disabled.
|
||||||
if project_default_template.blank?
|
# if x.is_default == true
|
||||||
@default_template = x
|
# if project_default_template.blank?
|
||||||
end
|
# @default_template = x
|
||||||
end
|
# end
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% unless @globalIssueTemplates.blank? %>
|
<% unless @globalIssueTemplates.blank? %>
|
||||||
<h2 class="template"><%=h "#{l(:label_global_templates)}" %></h2>
|
<h2 class="template"><%=h "#{l(:global_issue_templates)}" %></h2>
|
||||||
<div class="template_box">
|
<div class="template_box">
|
||||||
|
|
||||||
<table class="list issues">
|
<table class="list issues">
|
||||||
@@ -139,7 +139,10 @@
|
|||||||
:action => 'show', :id => issue_template.id,
|
:action => 'show', :id => issue_template.id,
|
||||||
}, {:title => issue_template.note } %></td>
|
}, {:title => issue_template.note } %></td>
|
||||||
|
|
||||||
<td><%= issue_template.title %></td>
|
<td>
|
||||||
|
<%= link_to h(issue_template.title), {:controller => 'global_issue_templates',
|
||||||
|
:id => issue_template.id, :action => 'show'}, title: textilizable(issue_template.description), class: "tooltip" %>
|
||||||
|
</td>
|
||||||
<td><%=h issue_template.tracker.name %></td>
|
<td><%=h issue_template.tracker.name %></td>
|
||||||
<td><%=h issue_template.author %></td>
|
<td><%=h issue_template.author %></td>
|
||||||
<td><%= format_time(issue_template.updated_on)%> </td>
|
<td><%= format_time(issue_template.updated_on)%> </td>
|
||||||
|
|||||||
@@ -4,6 +4,19 @@
|
|||||||
*/
|
*/
|
||||||
changeType = "";
|
changeType = "";
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
$(".tooltip").tooltip({
|
||||||
|
position: {
|
||||||
|
my: "left top",
|
||||||
|
at: "left bottom"
|
||||||
|
},
|
||||||
|
content: function () {
|
||||||
|
return $(this).prop('title');
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
function checkExpand(ch) {
|
function checkExpand(ch) {
|
||||||
var obj=document.all && document.all(ch) || document.getElementById && document.getElementById(ch);
|
var obj=document.all && document.all(ch) || document.getElementById && document.getElementById(ch);
|
||||||
if(obj && obj.style) obj.style.display=
|
if(obj && obj.style) obj.style.display=
|
||||||
|
|||||||
@@ -118,4 +118,14 @@ padding: 6px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.icon-erase { background-image: url(../images/eraser.png); }
|
.icon-erase { background-image: url(../images/eraser.png); }
|
||||||
|
|
||||||
|
#admin-menu a.redmine-issue-templates {
|
||||||
|
background-image: url(../images/issue_templates.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: inline-block;
|
||||||
|
width: 5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,4 +37,5 @@ en:
|
|||||||
label_enabledshaing_help_message: "If true, this template can be shared with descendant projects. (You also have to activate Inherited template option at child project.)"
|
label_enabledshaing_help_message: "If true, this template can be shared with descendant projects. (You also have to activate Inherited template option at child project.)"
|
||||||
label_should_replaced: "Replace subject and description"
|
label_should_replaced: "Replace subject and description"
|
||||||
label_should_replaced_help_message: "If true, existing subject and description are cleared and replaced with template text.(Default is false, and appended text.)"
|
label_should_replaced_help_message: "If true, existing subject and description are cleared and replaced with template text.(Default is false, and appended text.)"
|
||||||
label_global_templates: "Global Issue Templates"
|
global_issue_templates: "Global Issue Templates"
|
||||||
|
no_issue_templates_for_this_redmine: "No global issue templates are defined for this redmine."
|
||||||
@@ -37,4 +37,5 @@ ja:
|
|||||||
label_enabledshaing_help_message: "オプションをチェックすると、子プロジェクトでの利用を許可します。(子プロジェクト側での『テンプレートの継承』を設定した場合)"
|
label_enabledshaing_help_message: "オプションをチェックすると、子プロジェクトでの利用を許可します。(子プロジェクト側での『テンプレートの継承』を設定した場合)"
|
||||||
label_should_replaced: "テンプレート読み込みの際に本文とタイトルを上書き"
|
label_should_replaced: "テンプレート読み込みの際に本文とタイトルを上書き"
|
||||||
label_should_replaced_help_message: "オプションをチェックすると、テンプレートを適用する際に、入力済みの本文とタイトルを上書きします。(デフォルトはOFFです)"
|
label_should_replaced_help_message: "オプションをチェックすると、テンプレートを適用する際に、入力済みの本文とタイトルを上書きします。(デフォルトはOFFです)"
|
||||||
label_global_templates: "グローバルテンプレート"
|
global_issue_templates: "グローバル チケットテンプレート"
|
||||||
|
no_issue_templates_for_this_redmine: "このRedmineにはグローバルチケットテンプレートは定義されていません。"
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ class IssueTemplatesIssuesHook < Redmine::Hook::ViewListener
|
|||||||
o = stylesheet_link_tag('issue_templates', :plugin => 'redmine_issue_templates')
|
o = stylesheet_link_tag('issue_templates', :plugin => 'redmine_issue_templates')
|
||||||
if (context[:controller].class.name == 'IssuesController' and
|
if (context[:controller].class.name == 'IssuesController' and
|
||||||
context[:controller].action_name != 'index') or
|
context[:controller].action_name != 'index') or
|
||||||
(context[:controller].class.name == 'IssueTemplatesController')
|
(context[:controller].class.name == 'IssueTemplatesController') or
|
||||||
|
(context[:controller].class.name == 'GlobalIssueTemplatesController')
|
||||||
o << javascript_include_tag('issue_templates', :plugin => 'redmine_issue_templates')
|
o << javascript_include_tag('issue_templates', :plugin => 'redmine_issue_templates')
|
||||||
end
|
end
|
||||||
return o
|
return o
|
||||||
|
|||||||
Reference in New Issue
Block a user