Project

General

Profile

Patch #5675 ยป fixed_settings_html.diff

Holger Just, 2010-06-11 17:37

View differences:

app/helpers/settings_helper.rb (working copy)
40 40
    setting_values = Setting.send(setting)
41 41
    setting_values = [] unless setting_values.is_a?(Array)
42 42
      
43
    setting_label(setting, options) +
44
      hidden_field_tag("settings[#{setting}][]", '') +
43
    setting_label(setting, options.merge({:for => nil})) +
44
      hidden_field_tag("settings[#{setting}][]", '', :id => nil) +
45 45
      choices.collect do |choice|
46
        text, value = (choice.is_a?(Array) ? choice : [choice, choice]) 
47
        content_tag('label',
48
          check_box_tag("settings[#{setting}][]", value, Setting.send(setting).include?(value)) + text.to_s,
46
        text, value = (choice.is_a?(Array) ? choice : [choice, choice])
47
        id = "settings_#{setting}_#{value.downcase.underscore}"
48
        content_tag('span',
49
          check_box_tag("settings[#{setting}][]", value, Setting.send(setting).include?(value), :id => id) +
50
          content_tag('label', text.to_s, :for => id),
49 51
          :class => 'block'
50 52
        )
51 53
      end.join
......
63 65
  
64 66
  def setting_check_box(setting, options={})
65 67
    setting_label(setting, options) +
66
      hidden_field_tag("settings[#{setting}]", 0) +
68
      hidden_field_tag("settings[#{setting}]", 0, :id => nil) +
67 69
      check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options)
68 70
  end
69 71
  
70 72
  def setting_label(setting, options={})
71 73
    label = options.delete(:label)
72
    label != false ? content_tag("label", l(label || "setting_#{setting}")) : ''
74
    for_id = options.key?(:for) ? options.delete(:for) : "settings_#{setting}"
75
    label != false ? content_tag("label", l(label || "setting_#{setting}"), :for => for_id) : ''
73 76
  end
74 77
end
app/views/settings/_mail_handler.rhtml (working copy)
2 2

  
3 3
<div class="box tabular settings">
4 4
  <p>
5
    <%= setting_text_area :mail_handler_body_delimiters, :rows => 5 %>
5
    <%= setting_text_area :mail_handler_body_delimiters, :rows => 5, :cols => 60 %>
6 6
    <br /><em><%= l(:text_line_separated) %></em>
7 7
  </p>
8 8
</div>
app/views/common/_tabs.rhtml (working copy)
15 15
  </div>
16 16
</div>
17 17

  
18
<script>
18
<% javascript_tag do -%>
19 19
	Event.observe(window, 'load', function() { displayTabsButtons(); });
20 20
	Event.observe(window, 'resize', function() { displayTabsButtons(); }); 
21
</script>
21
<%- end %>
22 22

  
23 23
<% tabs.each do |tab| -%>
24 24
  <%= content_tag('div', render(:partial => tab[:partial], :locals => {:tab => tab} ), 
public/stylesheets/application.css (working copy)
395 395
width: 270px;
396 396
}
397 397

  
398
.tabular label.block{
398
.tabular span.block{display: block;}
399
.tabular span.block label {
399 400
font-weight: normal;
400 401
margin-left: 0px !important;
401 402
text-align: left;
402 403
float: none;
403
display: block;
404 404
width: auto;
405 405
}
406 406

  
    (1-1/1)