From e707aa99fb0a41ef8a4a38fcb78f64c38d9461f3 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Mon, 11 Aug 2014 14:23:19 -0300 Subject: [PATCH] Put the default template selected by default --- app/helpers/application_helper.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2752745..e5712ae 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1318,10 +1318,8 @@ module ApplicationHelper return '' if templates.count == 0 return hidden_field_tag("#{field_name}[template_id]", templates.first.id) if templates.count == 1 - counter = 0 radios = 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(link_to(template.name, template.url, :target => '_blank'), "#{field_name}[template_id]", template.id, environment.is_default_template?(template))) end.join("\n") content_tag('div', content_tag('label', _('Profile organization'), :for => 'template-options', :class => 'formlabel') + -- libgit2 0.21.2