color=Color
compare=Compare
configure=Configure
+confirm=Confirm
copy=Copy
create=Create
created=Created
quality_profiles.profile_x_created=Profile "{0}" created. Set it as default or link it to a project to use it for next measures.
quality_profiles.profile_x_already_exists=This profile already exists: {0}.
quality_profiles.please_type_profile_name=Please type a profile name.
+quality_profiles.delete_confirm_title=Delete Profile
quality_profiles.profile_x_deleted=Profile "{0}" is deleted.
quality_profiles.default_profile_is_x=Default profile is "{0}".
quality_profiles.profile_x_not_activated=Profile "{0}" is created but not activated.
quality_profiles.profile_name_already_exists=This profile name already exists.
quality_profiles.new_name=New name
quality_profiles.name_for_new_profile=Name for the new profile
+quality_profiles.delete_confirm_title=Delete Profile
quality_profiles.are_you_sure_want_delete_profile_x=Are you sure that you want to delete the profile "{0}" ?
quality_profiles.editing_profile=Editing profile
quality_profiles.profile_inheritance=Profile inheritance
#
class ConfirmController < ApplicationController
- # GET /confirm?url=<return_to_url>&[t=<title_key]
+ # GET /confirm?url=<return_to_url>[&tk=<title_key][&mk=<message_key][&mp=<message_parameters]
def index
render :partial => 'confirm/confirm'
end
# ==== Options
# * <tt>:id</tt> - HTML ID of the button
# * <tt>:class</tt> - Additional CSS class, generally 'red-button' for deletions
+ # * <tt>:title_key</tt> -
# * <tt>:message_key</tt> -
# * <tt>:message_params</tt> -
# * <tt>:width</tt> - width in pixels
def button_to_action(label, post_url, options={})
clazz = options[:class]
id = "id='#{options[:id]}'" if options[:id]
+ title_key = options[:title_key]
message_key = options[:message_key]
message_params = options[:message_params]
width = options[:width]||500
url = "#{ApplicationController.root_context}/confirm?url=#{u post_url}"
+ url += "&tk=#{title_key}" if title_key
if message_key
- url += "&k=#{message_key}&"
- url += message_params.map{|p| "p=#{u p}"}.join('&') if message_params
+ url += "&mk=#{message_key}&"
+ url += message_params.map{|p| "mp=#{u p}"}.join('&') if message_params
end
- "<a href='#{url}' modal-width='#{width}' class='open-modal button #{clazz}' #{id}>#{label}</a>"
+ "<a href='#{url}' modal-width='#{width}' class='open-modal button #{clazz}' #{id}>#{h label}</a>"
end
end
<%
- message_key = params[:k] || 'are_you_sure'
- message_params = params[:p] || []
+ title_key = params[:tk] || 'are_you_sure'
+ message_key = params[:mk] || 'are_you_sure'
+ message_params = params[:mp] || []
%>
<form id="form-confirm" method="post" action="<%= params[:url] -%>">
<fieldset>
<div class="form-head">
- <img src="<%= ApplicationController.root_context -%>/images/warning.png" style="vertical-align: text-bottom"/>
- <%= h message(message_key, :params => message_params) -%>
+ <h2><%= h message title_key -%></h2>
+ </div>
+ <div class="form-body">
+ <div class="info">
+ <img src="<%= ApplicationController.root_context -%>/images/information.png" style="vertical-align: text-bottom"/>
+ <%= h message(message_key, :params => message_params) -%>
+ </div>
</div>
<div class="form-foot">
- <input type="submit" value="Confirm"/>
- <a href="#" onclick="return closeModalWindow()"><%= message('cancel') -%></a>
+ <input type="submit" value="<%= h message('confirm') -%>"/>
+ <a href="#" onclick="return closeModalWindow()"><%= h message('cancel') -%></a>
</div>
</fieldset>
</form>
\ No newline at end of file
</div>
<div class="form-body">
<% if @error %>
- <div class="form-field">
- <p class="error"><%= h @error -%></p>
- </div>
+ <p class="error"><%= h @error -%></p>
<% end %>
<div class="form-field">
- <label for="name">New name</label>
+ <label for="name">New name <em>*</em></label>
<input id="new-name" name="name" type="text" size="50" maxlength="100"/>
</div>
</div>
<div class="form-head">
<h2>Rename Profile: <%= h @profile.name -%></h2>
</div>
+
<div class="form-body">
<% if @error %>
- <div class="form-field">
- <p class="error"><%= h @error -%></p>
- </div>
+ <p class="error"><%= h @error -%></p>
<% end %>
<div class="form-field">
- <label for="name">New name</label>
+ <label for="name">New name <em>*</em></label>
<input id="new-name" name="name" type="text" size="50" maxlength="100"/>
</div>
</div>
<% if !profile.default_profile? && administrator? %>
<%= button_to_action message('set_as_default'), "profiles/set_as_default?id=#{profile.id}",
:id => "activate_#{profile.key.parameterize}",
+ :title_key => 'set_as_default',
:message_key => 'quality_profiles.are_you_sure_want_x_profile_as_default',
:message_params => [profile.name] -%>
<% end %>
<%= button_to_action message('delete'), "profiles/delete/#{profile.id}",
:class => 'red-button',
:id => "delete_#{profile.key.parameterize}",
+ :title_key => 'quality_profiles.delete_confirm_title',
:message_key => 'quality_profiles.are_you_sure_want_delete_profile_x',
:message_params => [profile.name]
-%>
if ($j('#modal').length) {
return; // another window is already opening
}
- var $dialog = $j('<div id="modal"></div>').appendTo('body');
- $j.get($link.attr('href'), {}, function (html) {
+ var $dialog = $j('<div id="modal" class="ui-widget-overlay"></div>').appendTo('body');
+ var url = $link.attr('modal-url') || $link.attr('href');
+ $j.get(url,function (html) {
+ $dialog.removeClass('ui-widget-overlay');
$dialog.html(html);
$dialog
.dialog({
}
});
$dialog.dialog("open");
+ }).error(function () {
+ alert("Server error. Please contact your administrator.");
+ }).complete(function() {
+ $dialog.removeClass('ui-widget-overlay');
});
$link.click(function () {
.nolayout {
padding: 10px;
}
-
-#modal {
- display: none;
-}
\ No newline at end of file
padding: 4px;
}
+.info {
+ background-color: #CAE3F2;
+ padding: 4px;
+ border: 1px solid #4B9FD5;
+}
+
/* ------------------- SETUP / MIGRATION PAGES ------------------- */
.migration {
background-image: url("../images/sonar.png");
border: 1px solid #4b9fd5;
width: 230px;
text-align: left;
- background-color: #d4e7ff;
+ background-color: #CAE3F2;
padding: 15px 20px;
}
background-color: #EFEFEF;
line-height: 30px;
height: 30px;
+ border-bottom: 1px solid #ccc;
}
.form-body {
- border-top: 1px solid #ccc;
+ padding: 5px;
}
.form-field {
- padding: 5px 10px;
+ clear: both;
+ display: block;
+ padding: 5px 0 5px 140px;
}
-.form-field label:before {
- content: "";
+.form-field label em {
+ color: #990000;
+ font-style: italic;
}
.form-field label {
display: block;
- text-align: right;
- width: 120px;
float: left;
+ text-align: right;
+ width: 130px;
+ left: -140px;
+ margin-right: -130px;
line-height: 1;
- padding: 5px 5px 0 0;
+ word-wrap: break-word;
+ position: relative;
+ padding-top: 5px;
}
.form-foot {
margin-right: 10px;
}
+.form-field-description {
+ clear: both;
+ font-size: 11px;
+ color: #777;
+}
+
input[type=text], input[type=password]{
height: 18px;
padding: 0 3px;