Commit e707aa99fb0a41ef8a4a38fcb78f64c38d9461f3
1 parent
3b569fa2
Exists in
master
and in
29 other branches
Put the default template selected by default
Showing
1 changed file
with
1 additions
and
3 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -1318,10 +1318,8 @@ module ApplicationHelper | @@ -1318,10 +1318,8 @@ module ApplicationHelper | ||
1318 | return '' if templates.count == 0 | 1318 | return '' if templates.count == 0 |
1319 | return hidden_field_tag("#{field_name}[template_id]", templates.first.id) if templates.count == 1 | 1319 | return hidden_field_tag("#{field_name}[template_id]", templates.first.id) if templates.count == 1 |
1320 | 1320 | ||
1321 | - counter = 0 | ||
1322 | radios = templates.map do |template| | 1321 | radios = templates.map do |template| |
1323 | - counter += 1 | ||
1324 | - content_tag('li', labelled_radio_button(link_to(template.name, template.url, :target => '_blank'), "#{field_name}[template_id]", template.id, counter==1)) | 1322 | + content_tag('li', labelled_radio_button(link_to(template.name, template.url, :target => '_blank'), "#{field_name}[template_id]", template.id, environment.is_default_template?(template))) |
1325 | end.join("\n") | 1323 | end.join("\n") |
1326 | 1324 | ||
1327 | content_tag('div', content_tag('label', _('Profile organization'), :for => 'template-options', :class => 'formlabel') + | 1325 | content_tag('div', content_tag('label', _('Profile organization'), :for => 'template-options', :class => 'formlabel') + |