</encoder>
</appender>
+ <logger name="rails">
+ <level value="DEBUG"/>
+ </logger>
+
<logger name="org.hibernate.cache.ReadWriteCache">
<!-- removing "An item was expired by the cache while it was locked (increase your cache timeout)" msg -->
<level value="ERROR"/>
</logger>
-
- <logger name="org.sonar.INFO">
- <level value="INFO"/>
+ <logger name="org.hibernate">
+ <level value="WARN"/>
</logger>
- <logger name="rails">
+ <!-- Display SQL requests and results by setting the following loggers to level DEBUG -->
+ <logger name="org.hibernate.SQL">
+ <level value="WARN"/>
+ </logger>
+ <logger name="org.apache.ibatis">
<level value="DEBUG"/>
</logger>
-
- <logger name="org.sonar.MEASURE_FILTER">
+ <logger name="java.sql">
<level value="DEBUG"/>
</logger>
+ <logger name="java.sql.ResultSet">
+ <level value="WARN"/>
+ </logger>
<root>
<level value="INFO"/>
bad_request('Missing qualifier') if params[:qualifier].blank?
end
- def bulk_apply_form
-
+ def apply_template_form
+ bad_request('There are currently no results to apply the permission template to') if params[:projects].blank?
+ @permission_templates = Internal.permission_templates.selectAllPermissionTemplates().collect {|pt| [pt.name, pt.id]}
+ render :partial => 'apply_template_form', :locals => {:components => params[:projects], :qualifier => params[:qualifier] || 'TRK'}
end
# POST REQUESTS
redirect
end
- def bulk_apply_template
+ def apply_template
verify_post_request
require_parameters :template_id
Internal.permissions.applyPermissionTemplate(params)
<p>
This section allows you to configure the default permission templates that will be applied by SonarQube while analysing your projects.
</p>
- <br/>
<% form_tag(:controller => 'permission_templates', :action => 'set_default_template') do %>
<% @root_qualifiers.each do |qualifier| %>
<%= label_tag("default_template_#{qualifier}", "Default permission template for #{message('qualifier.' + qualifier)}:") %>
- <%= select_tag("default_template_#{qualifier}", options_for_select(@permission_templates_options, @default_templates[qualifier])) %>
- <br/>
+ <%= select_tag("default_template_#{qualifier}", options_for_select(@permission_templates_options, @default_templates[qualifier])) %>
<% end %>
<br/>
<br/>
--- /dev/null
+<form id="apply-template-form" method="post" action="<%= ApplicationController.root_context -%>/roles/apply_template">
+ <input type="hidden" name="components" id="apply-template-components" value="<%= components.join(',') %>"/>
+ <fieldset>
+ <div class="modal-head">
+ <h2><%= message('roles.apply_template.form.title', {:params => ''}) -%></h2>
+ </div>
+ <div class="modal-body">
+ <div class="apply-template errors error" style="display:none;"/>
+ <div class="modal-field">
+ <span><%= "Select the template to apply to #{components.size} #{message('qualifier.' + qualifier)}(s):" %></span><br/>
+ <%= select_tag('template_id', options_for_select(@permission_templates, -1)) %>
+ </div>
+ </div>
+ <div class="modal-foot">
+ <span id="apply-template-loading-image" class="hidden"><%= image_tag 'loading.gif' %></span>
+ <input type="submit" value="<%= message('apply') -%>" id="apply-template-submit" class="apply-template" onclick="return displayLoadingImage()" />
+ <a href="#" onclick="return closeModalWindow()" id="apply-template-cancel"><%= message('cancel') -%></a>
+ </div>
+ </fieldset>
+</form>
+<script>
+ $j("#apply-template-form").modalForm({
+ error: function (xhr, textStatus, errorThrown) {
+ $j('#apply-template-loading-image').addClass("hidden");
+ var htmlClass = 'apply-template';
+ $j('input[type=submit].' + htmlClass).removeAttr('disabled');
+ $j('.' + htmlClass + '.errors').show();
+ $j('.' + htmlClass + '.errors').html(xhr.responseText);
+ }
+ });
+
+ function displayLoadingImage() {
+ $j('#apply-template-loading-image').removeClass("hidden");
+ }
+
+</script>
<div id="project-roles-operations" style="float: right;">
<ul class="operations">
<li class="last">
- <a id="bulk-update" href="<%= url_for params.merge({:action => 'bulk_apply_form'}) -%>"
- class="link-action open-modal"><%= message('projects_role.apply_template') -%></a>
+ <%= link_to message('projects_role.apply_template'), {:action => :apply_template_form, :projects => @projects.collect {|proj| proj.id}, :qualifier => @qualifier},
+ :id => 'apply-template-modal', :class => 'open-modal link-action' %>
</li>
</ul>
</div>