</ul>
<div class="note">
- <a href="#" onclick="return hideIssueMore(this)">Hide</a><%= image_tag 'asc.png' -%>
+ <a href="#" onclick="return toggleIssueChangelog(this)">Hide</a><%= image_tag 'asc.png' -%>
</div>
\ No newline at end of file
<img src="<%= ApplicationController.root_context -%>/images/priority/<%= issue.severity -%>.png" title="<%= h message("severity.#{issue.severity}") -%>">
- <a href="#" onclick="return showIssueRule(this)" class="rulename"><%= h Internal.rules.ruleL10nName(@issue_results.rule(issue)) -%></a>
+ <a href="#" onclick="return toggleIssueRule(this)" class="rulename"><%= h Internal.rules.ruleL10nName(@issue_results.rule(issue)) -%></a>
<% if issue.resolution %>
<%= image_tag 'sep12.png' -%>
<% end %>
<%= image_tag 'sep12.png' -%>
- <a href="#" onclick="return showIssueChangelog(this)" class="gray"><%= distance_of_time_in_words_to_now(Api::Utils.java_to_ruby_datetime(issue.creationDate())) -%></a>
+ <a href="#" onclick="return toggleIssueChangelog(this)" class="gray"><%= distance_of_time_in_words_to_now(Api::Utils.java_to_ruby_datetime(issue.creationDate())) -%></a>
<% if issue.reporter %>
<%= image_tag 'sep12.png' -%>
<% end %>
</div>
- <div class="issue-more" style="display: none"></div>
+ <div class="issue-rule" style="display: none"></div>
+ <div class="issue-changelog" style="display: none"></div>
<% unless issue.message.blank? %>
<div class="code-issue-msg">
<% end %>
<div class="note">
- <a href="#" onclick="return hideIssueMore(this)">Hide</a><%= image_tag 'asc.png' -%>
+ <a href="#" onclick="return toggleIssueRule(this)">Hide</a><%= image_tag 'asc.png' -%>
<%= image_tag 'sep12.png' -%>
<%= @rule.plugin_name -%>
<%= image_tag 'sep12.png' -%>
- <a onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;"
- href="<%= url_for :controller => 'rules', :action => 'show', :id => @rule.key, :layout => 'false' -%>">
- <%= @rule.plugin_rule_key -%>
- </a>
+ <a href="#" onclick="return openIssueRulePopup(this)"><%= @rule.plugin_rule_key -%></a>
</div>
\ No newline at end of file
rule_select_box = "$('#{select_box_id}')"
rule_check_box = "$('#{check_box_id}')"
changel_level = remote_function(
- :url => {:action => 'activate_rule', :rule_id => rule.id, :id => profile.id},
- :loading => "$('levels_#{rule.id}').replace('<img src=\"#{ApplicationController.root_context}/images/loading.gif\"/>');",
- :with => "'level=' + #{rule_select_box}.value", :condition => "#{rule_check_box}.checked")
+ :url => {:action => 'activate_rule', :rule_id => rule.id, :id => profile.id},
+ :loading => "$('levels_#{rule.id}').replace('<img src=\"#{ApplicationController.root_context}/images/loading.gif\"/>');",
+ :with => "'level=' + #{rule_select_box}.value", :condition => "#{rule_check_box}.checked")
activate_rule = remote_function(
- :url => {:action => 'activate_rule', :rule_id => rule.id, :id => profile.id},
- :loading => "$('levels_#{rule.id}').replace('<img src=\"#{ApplicationController.root_context}/images/loading.gif\"/>');",
- :with => "'level=' + get_level_for_rule(#{rule_select_box},#{rule_check_box})")
+ :url => {:action => 'activate_rule', :rule_id => rule.id, :id => profile.id},
+ :loading => "$('levels_#{rule.id}').replace('<img src=\"#{ApplicationController.root_context}/images/loading.gif\"/>');",
+ :with => "'level=' + get_level_for_rule(#{rule_select_box},#{rule_check_box})")
%>
<%= check_box_tag(check_box_id, 'yes', (!active_rule.nil?), :onclick => activate_rule, :disabled => !enable_modification || (active_rule && (active_rule.inherited? || active_rule.overrides?))) %>
<%= select_tag(select_box_id, options_for_select(RulesConfigurationController::RULE_PRIORITIES, (active_rule.nil? ? rule.priority_text : active_rule.priority_text)),
<% end %>
<% end %>
- <div style="height: 17px;line-height: 17px;font-size: 11px;">
- <div style="float: left">
- <div style="color: #888" id="rule_repository_<%= rule.id -%>"><%= message('rules_configuration.repository') %> : <%= rule.repository_key %></div>
- <div style="color: #888" id="rule_key_<%= rule.id -%>"><%= message('key') %> : <%= rule.plugin_rule_key %></div>
- <% if !rule.removed? %>
- <div style="color: #888" id="rule_available_since_<%= rule.id -%>"><%= message('rules_configuration.available_since') %> : <%= human_short_date(rule.created_at) %></div>
- <% else %>
- <div style="color: #888" id="rule_available_since_<%= rule.id -%>"><%= message('rules_configuration.removed_since') %> : <%= human_short_date(rule.updated_at) %></div>
- <% end %>
- </div>
+ <div class="note">
+ <span id="rule_repository_<%= rule.id -%>"><%= message('rules_configuration.repository') %> : <%= rule.repository_key %></span>
+ <%= image_tag 'sep12.png' -%>
+ <span id="rule_key_<%= rule.id -%>"><%= message('key') %>: <%= rule.plugin_rule_key %></span>
+ <%= image_tag 'sep12.png' -%>
+ <% if rule.removed? %>
+ <span id="rule_available_since_<%= rule.id -%>"><%= message('rules_configuration.removed_since') %>: <%= human_short_date(rule.updated_at) %></span>
+ <% else %>
+ <span id="rule_available_since_<%= rule.id -%>"><%= message('rules_configuration.available_since') %> <%= human_short_date(rule.created_at) %></span>
+ <% end %>
</div>
</div>
</td>
//******************* HANDLING OF DROPDOWN MENUS [END] ******************* //
+function openPopup(url, popupId) {
+ window.open(url,popupId,'height=800,width=900,scrollbars=1,resizable=1');
+ return false;
+}
\ No newline at end of file
errorsElt.html(jqXHR.responseText);
errorsElt.removeClass('hidden');
}
- ).always(function() {
+ ).always(function () {
loadingElt.addClass('hidden');
});
return false;
}
-function hideIssueMore(elt) {
- var issueElt = $j(elt).closest('[data-issue-key]');
- var moreElt = issueElt.find('.issue-more');
- moreElt.slideUp('fast');
+function toggleIssueRule(elt) {
+ var issueElt = $j(elt).closest('[data-issue-rule]');
+ var ruleElt = issueElt.find('.issue-rule');
+ if (ruleElt.is(':visible')) {
+ ruleElt.slideUp('fast');
+ } else {
+ issueElt.find('.issue-changelog').slideUp('fast');
+ var ruleKey = issueElt.attr('data-issue-rule');
+ $j.get(baseUrl + "/issue/rule/" + ruleKey, function (html) {
+ ruleElt.html(html);
+ ruleElt.slideDown('fast');
+ });
+ }
return false;
}
-function showIssueRule(elt) {
- var issueElt = $j(elt).closest('[data-issue-rule]');
- var ruleKey = issueElt.attr('data-issue-rule');
- var moreElt = issueElt.find('.issue-more');
- moreElt.slideUp('fast');
- $j.get(baseUrl + "/issue/rule/" + ruleKey, function (html) {
- moreElt.html(html);
- moreElt.slideDown('fast');
- });
+function toggleIssueChangelog(elt) {
+ var issueElt = $j(elt).closest('[data-issue-key]');
+ var changelogElt = issueElt.find('.issue-changelog');
+ if (changelogElt.is(':visible')) {
+ changelogElt.slideUp('fast');
+ } else {
+ issueElt.find('.issue-rule').slideUp('fast');
+ var issueKey = issueElt.attr('data-issue-key');
+ $j.get(baseUrl + "/issue/changelog/" + issueKey, function (html) {
+ changelogElt.html(html);
+ changelogElt.slideDown('fast');
+ });
+ }
return false;
}
-function showIssueChangelog(elt) {
- var issueElt = $j(elt).closest('[data-issue-key]');
- var issueKey = issueElt.attr('data-issue-key');
- var moreElt = issueElt.find('.issue-more');
- moreElt.slideUp('fast');
- $j.get(baseUrl + "/issue/changelog/" + issueKey, function (html) {
- moreElt.html(html);
- moreElt.slideDown('fast');
- });
+function openIssueRulePopup(elt) {
+ var issueElt = $j(elt).closest('[data-issue-rule]');
+ var ruleKey = issueElt.attr('data-issue-rule');
+ openPopup(baseUrl + "/rules/show/" + ruleKey + "?layout=false", 'rule');
return false;
}
\ No newline at end of file
border: 2px solid #4b9fd5;
border-top: none;
}
+
+.nolayout {
+ padding: 10px;
+}
\ No newline at end of file
vertical-align: text-bottom;
}
-.code-issue-comment, .code-issue-msg, .code-issue-actions, .code-issue-form, .issue-more {
+.code-issue-comment, .code-issue-msg, .code-issue-actions, .code-issue-form, .issue-rule, .issue-changelog {
background-color: #EFEFEF;
border: 1px solid #DDD;
border-top: none;