Commit 03935b39626d423391842b7e9720dd97cbaaca29
1 parent
7601acd6
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
add infra
Showing
3 changed files
with
12 additions
and
16 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -1310,19 +1310,8 @@ module ApplicationHelper |
1310 | 1310 | templates = environment.send(kind).templates |
1311 | 1311 | return '' if templates.count == 0 |
1312 | 1312 | return hidden_field_tag("#{field_name}[template_id]", templates.first.id) if templates.count == 1 |
1313 | - | |
1314 | - counter = 0 | |
1315 | - radios = templates.map do |template| | |
1316 | - counter += 1 | |
1317 | - content_tag('li', labelled_radio_button(link_to(template.name, template.url, :target => '_blank'), "#{field_name}[template_id]", template.id, counter==1)) | |
1318 | - end.join("\n") | |
1319 | - | |
1320 | - content_tag('div', content_tag('label', _('Profile organization'), :for => 'template-options', :class => 'formlabel') + | |
1321 | - content_tag('p', _('Your profile will be created according to the selected template. Click on the options to view them.'), :style => 'margin: 5px 15px;padding: 0px 10px;') + | |
1322 | - content_tag('ul', radios, :style => 'list-style: none; padding-left: 20px; margin-top: 0.5em;'), | |
1323 | - :id => 'template-options', | |
1324 | - :style => 'margin-top: 1em' | |
1325 | - ) | |
1313 | + options = options_for_select(templates.collect{ |template| [template.name, template.id]}) | |
1314 | + content_tag('div', content_tag('label', _('Profile organization'), :class => 'formlabel') + (select_tag 'profile_data[template_id]', options, :onchange => 'show_fields_for_template(this);')) | |
1326 | 1315 | end |
1327 | 1316 | |
1328 | 1317 | def expirable_content_reference(content, action, text, url, options = {}) | ... | ... |
app/views/account/_signup_form.html.erb
... | ... | @@ -29,6 +29,14 @@ |
29 | 29 | |
30 | 30 | <div id='signup-form-header'> |
31 | 31 | |
32 | + <script> | |
33 | + function show_fields_for_template(element) { | |
34 | + // code here | |
35 | + } | |
36 | + </script> | |
37 | + | |
38 | + <%= template_options(:people, 'profile_data') %> | |
39 | + | |
32 | 40 | <div id='signup-formfield-group'> |
33 | 41 | <%= label(:user, :login, _('Username'), {:class => 'formlabel'}) %> |
34 | 42 | <span id="signup-domain"><%= environment.default_hostname %>/</span> |
... | ... | @@ -109,8 +117,6 @@ |
109 | 117 | |
110 | 118 | <%= @plugins.dispatch(:signup_extra_contents).collect { |content| instance_eval(&content) }.join("") %> |
111 | 119 | |
112 | - <%= template_options(:people, 'profile_data') %> | |
113 | - | |
114 | 120 | <% unless @terms_of_use.blank? %> |
115 | 121 | <div id='terms-of-use-box' class='formfieldline'> |
116 | 122 | <%= labelled_check_box(_('I accept the %s') % link_to(_('terms of use'), {:controller => 'home', :action => 'terms'}, :target => '_blank'), 'user[terms_accepted]') %> | ... | ... |
public/stylesheets/application.css
... | ... | @@ -6142,6 +6142,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { |
6142 | 6142 | -webkit-border-radius: 8px; |
6143 | 6143 | margin: 60px auto 5px; |
6144 | 6144 | position: relative; |
6145 | + width: 400px; | |
6145 | 6146 | } |
6146 | 6147 | |
6147 | 6148 | #signup-form input.invalid_input { |
... | ... | @@ -6190,7 +6191,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { |
6190 | 6191 | #signup-form select { |
6191 | 6192 | height: auto; |
6192 | 6193 | padding-right: 3px; |
6193 | - width: 365px; | |
6194 | + width: 100%; | |
6194 | 6195 | } |
6195 | 6196 | |
6196 | 6197 | #signup-form .select-birth-date select { | ... | ... |