Commit 2b4290406599224001f9a0be8d035817f215a5a7
1 parent
bac11992
Exists in
master
and in
8 other branches
Removed link from templates option
The templates are not visible, so new user won't be able to see them Also styling the checkbox "is_template" on profile edition (ActionItem2378)
Showing
4 changed files
with
14 additions
and
3 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -1338,7 +1338,7 @@ module ApplicationHelper |
1338 | 1338 | counter = 0 |
1339 | 1339 | radios = klass.templates.map do |template| |
1340 | 1340 | counter += 1 |
1341 | - content_tag('li', labelled_radio_button(link_to(template.name, template.url, :target => '_blank'), "#{field_name}[template_id]", template.id, counter==1)) | |
1341 | + content_tag('li', labelled_radio_button(template.name, "#{field_name}[template_id]", template.id, counter==1)) | |
1342 | 1342 | end.join("\n") |
1343 | 1343 | |
1344 | 1344 | content_tag('div', content_tag('span', _('Template:')) + | ... | ... |
app/models/profile.rb
... | ... | @@ -281,7 +281,7 @@ class Profile < ActiveRecord::Base |
281 | 281 | |
282 | 282 | def valid_template |
283 | 283 | if template_id.present? and !template.is_template |
284 | - errors.add(:template, _('%{fn} is not a template.').fix_i18n) | |
284 | + errors.add(:template, _('is not a template.')) | |
285 | 285 | end |
286 | 286 | end |
287 | 287 | ... | ... |
app/views/profile_editor/edit.rhtml
... | ... | @@ -5,7 +5,9 @@ |
5 | 5 | <% labelled_form_for :profile_data, @profile, :html => { :id => 'profile-data', :multipart => true } do |f| %> |
6 | 6 | |
7 | 7 | <% if user.has_permission?('manage_environment_templates', profile.environment) %> |
8 | - <%= labelled_form_field check_box(:profile_data, :is_template) + _('Is a template?'), '' %> | |
8 | + <div id="profile-is-template"> | |
9 | + <%= labelled_check_box(_('This profile is a template'), 'profile_data[is_template]', true, @profile.is_template) %> | |
10 | + </div> | |
9 | 11 | <% end %> |
10 | 12 | |
11 | 13 | <%= render :partial => partial_for_class(@profile.class), :locals => { :f => f } %> | ... | ... |
public/stylesheets/application.css
... | ... | @@ -2298,6 +2298,15 @@ div#activation_enterprise label, div#activation_enterprise input, div#activation |
2298 | 2298 | #profile_change_picture img { |
2299 | 2299 | margin-left: 10px; |
2300 | 2300 | } |
2301 | + | |
2302 | +#profile-is-template { | |
2303 | + background-color: #E6E6E6; | |
2304 | + border: 1px solid #CCC; | |
2305 | + padding: 5px; | |
2306 | + border-radius: 5px; | |
2307 | + -moz-border-radius: 5px; | |
2308 | + -webkit-border-radius: 5px; | |
2309 | +} | |
2301 | 2310 | /*** REQUIRED FIELDS ***/ |
2302 | 2311 | |
2303 | 2312 | .required-field label { | ... | ... |