diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6d64f14..b699c99 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1338,7 +1338,7 @@ module ApplicationHelper counter = 0 radios = klass.templates.map do |template| counter += 1 - content_tag('li', labelled_radio_button(link_to(template.name, template.url, :target => '_blank'), "#{field_name}[template_id]", template.id, counter==1)) + content_tag('li', labelled_radio_button(template.name, "#{field_name}[template_id]", template.id, counter==1)) end.join("\n") content_tag('div', content_tag('span', _('Template:')) + diff --git a/app/models/profile.rb b/app/models/profile.rb index 1a8126a..23d1a1f 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -281,7 +281,7 @@ class Profile < ActiveRecord::Base def valid_template if template_id.present? and !template.is_template - errors.add(:template, _('%{fn} is not a template.').fix_i18n) + errors.add(:template, _('is not a template.')) end end diff --git a/app/views/profile_editor/edit.rhtml b/app/views/profile_editor/edit.rhtml index 046ce39..0c5ec83 100644 --- a/app/views/profile_editor/edit.rhtml +++ b/app/views/profile_editor/edit.rhtml @@ -5,7 +5,9 @@ <% labelled_form_for :profile_data, @profile, :html => { :id => 'profile-data', :multipart => true } do |f| %> <% if user.has_permission?('manage_environment_templates', profile.environment) %> - <%= labelled_form_field check_box(:profile_data, :is_template) + _('Is a template?'), '' %> +
+ <%= labelled_check_box(_('This profile is a template'), 'profile_data[is_template]', true, @profile.is_template) %> +
<% end %> <%= render :partial => partial_for_class(@profile.class), :locals => { :f => f } %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index e4be2dc..ac13832 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2298,6 +2298,15 @@ div#activation_enterprise label, div#activation_enterprise input, div#activation #profile_change_picture img { margin-left: 10px; } + +#profile-is-template { + background-color: #E6E6E6; + border: 1px solid #CCC; + padding: 5px; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} /*** REQUIRED FIELDS ***/ .required-field label { -- libgit2 0.21.2