quality_profiles.x_rules_only_in={0} rules only in
quality_profiles.x_rules_have_different_configuration={0} rules have a different configuration
quality_profiles.export_all_rules=All rules
+quality_profiles.remove_project_action=Remove
quality_profiles.remove_projects_action=Remove All
+quality_profiles.add_project_action=Add Project
+quality_profiles.remove_project_confirm_title=Remove Project from Profile
+quality_profiles.remove_project_confirm_message=Are you sure you want to dissociate the project {0} from this profile ? The default profile will be used during next analysis of this project.
+quality_profiles.remove_project_confirm_button=Remove
+quality_profiles.remove_projects_confirm_title=Remove All Projects from Profile
+quality_profiles.remove_projects_confirm_message=Are you sure you want to dissociate all projects from this profile ? The default profile will be used during next analysis of these projects.
+quality_profiles.remove_projects_confirm_button=Remove All
quality_profiles.copy_x_title=Copy Profile {0}
quality_profiles.copy_new_name=New Name
# ==== Options
# * <tt>:id</tt> - HTML ID of the button
# * <tt>:class</tt> - Additional CSS class, generally 'red-button' for deletions
- # * <tt>:button_key</tt> - Default is 'confirm'
- # * <tt>:title_key</tt> -
- # * <tt>:message_key</tt> -
- # * <tt>:message_params</tt> -
- # * <tt>:width</tt> - width in pixels
+ # * <tt>:confirm_button</tt> - L10n key of the confirmation button
+ # * <tt>:confirm_title</tt> - L10n key of the confirmation title
+ # * <tt>:confirm_msg</tt> - L10n key of the confirmation message
+ # * <tt>:confirm_msg_params</tt> - Array of parameters used for building the confirmation message
+ # * <tt>:confirm_width</tt> - width in pixels of the confirmation pop-up
#
def link_to_action(label, post_url, options={})
clazz = options[:class]
id = "id='#{options[:id]}'" if options[:id]
- title_key = options[:title_key]
- button_key = options[:button_key]
- message_key = options[:message_key]
- message_params = options[:message_params]
- width = options[:width]||500
+ title_key = options[:confirm_title]
+ button_key = options[:confirm_button]
+ message_key = options[:confirm_msg]
+ message_params = options[:confirm_msg_params]
+ width = options[:confirm_width]||500
url = "#{ApplicationController.root_context}/confirm?url=#{u post_url}"
- url += "&tk=#{title_key}" if title_key
+ url += "&tk=#{u title_key}" if title_key
if message_key
- url += "&mk=#{message_key}&"
- url += message_params.map{|p| "mp=#{u p}"}.join('&') if message_params
+ url += "&mk=#{u message_key}&"
+ url += message_params.map{|p| "mp[]=#{u p}"}.join('&') if message_params
end
if button_key
- url += "&bk=#{button_key}"
+ url += "&bk=#{u button_key}"
end
"<a href='#{url}' modal-width='#{width}' class='open-modal #{clazz}' #{id}>#{h label}</a>"
<%
title_key = params[:tk] || 'confirm'
message_key = params[:mk] || 'are_you_sure'
- message_params = params[:mp] || []
+ message_params = params['mp'] || []
button_key = params[:bk] || title_key
%>
<form id="confirm-form" method="post" action="<%= params[:url] -%>">
<%= link_to_action message('set_as_default'), "profiles/set_as_default?id=#{profile.id}",
:id => "activate_#{profile.key.parameterize}",
:class => 'button',
- :title_key => 'set_as_default',
- :message_key => 'quality_profiles.are_you_sure_want_x_profile_as_default',
- :message_params => [profile.name] -%>
+ :confirm_title => 'set_as_default',
+ :confirm_msg => 'quality_profiles.are_you_sure_want_x_profile_as_default',
+ :confirm_msg_params => [profile.name] -%>
<% end %>
<% if profile.default_profile? %>
<%= image_tag 'tick.png', :id => "is_active_#{u profile.key}" %>
<%= link_to_action message('delete'), "profiles/delete/#{profile.id}",
:class => 'button red-button',
:id => "delete_#{profile.key.parameterize}",
- :button_key => 'delete',
- :title_key => 'quality_profiles.delete_confirm_title',
- :message_key => 'quality_profiles.are_you_sure_want_delete_profile_x',
- :message_params => [profile.name]
+ :confirm_button => 'delete',
+ :confirm_title => 'quality_profiles.delete_confirm_title',
+ :confirm_msg => 'quality_profiles.are_you_sure_want_delete_profile_x',
+ :confirm_msg_params => [profile.name]
-%>
<% end %>
</td>
-<h1 class="marginbottom10"><%= link_to message('quality_profiles.quality_profiles'), :controller => 'profiles', :action => 'index' -%> / <%= h @profile.language -%>
+<h1 class="marginbottom10"><%= link_to message('quality_profiles.quality_profiles'), :controller => 'profiles', :action => 'index' -%>
+ / <%= h @profile.language -%>
/ <%= h @profile.name %></h1>
<%= render :partial => 'profiles/tabs', :locals => {:selected_tab => 'Projects'} %>
<% @profile.sorted_projects.each do |project| %>
<tr class="<%= cycle('even', 'odd') -%>">
<td class="thin">
- <%= link_to_action message('remove'),
+ <%= link_to_action message('quality_profiles.remove_project_action'),
"#{ApplicationController.root_context}/profiles/remove_project?id=#{@profile.id}&project_id=#{project.id}",
:class => 'link-action',
- :id => "link-remove-#{project.key.parameterize}" -%>
+ :id => "link-remove-#{project.key.parameterize}",
+ :confirm_title => 'quality_profiles.remove_project_confirm_title',
+ :confirm_button => 'quality_profiles.remove_project_confirm_button',
+ :confirm_msg => 'quality_profiles.remove_project_confirm_message',
+ :confirm_msg_params => [project.name]
+ -%>
</td>
<td><%= h project.name -%> <span class="small gray"><%= h project.key -%></span></td>
</tr>
<%= link_to_action message('quality_profiles.remove_projects_action'),
"#{ApplicationController.root_context}/profiles/remove_projects?id=#{@profile.id}",
:class => 'link-action',
- :id => "link-remove-projects" -%>
+ :id => "link-remove-projects",
+ :confirm_title => 'quality_profiles.remove_projects_confirm_title',
+ :confirm_button => 'quality_profiles.remove_projects_confirm_button',
+ :confirm_msg => 'quality_profiles.remove_projects_confirm_message'
+ -%>
</td>
</tr>
</tfoot>