Project

General

Profile

« Previous | Next » 

Revision c88c48f5

Added by Ondřej Pražák over 8 years ago

Fixes #11467 - Textareas in form may be resized only vertically

View differences:

app/assets/stylesheets/bootstrap_and_overrides.scss
legend {
margin-bottom: 10px;
}
textarea.no-stretch {
resize: vertical;
}
app/views/common_parameters/_form.html.erb
<%= password_f f, :value, :size => "col-md-8", :value => @common_parameter.value %>
<% else %>
<%= textarea_f(f, :value,
:class => "form-control value col-md-8",
:class => "form-control value col-md-8 no-stretch",
:rows => line_count(f, :value),
:fullscreen => :true,
:placeholder => _("Value")) %>
app/views/common_parameters/_parameter.html.erb
:value => f.object.value) %>
<% else %>
<%= f.text_area(:value,
:class => "form-control",
:class => "form-control no-stretch",
:rows => line_count(f, :value),
:disabled => disabled,
:placeholder => _("Value")) %>
app/views/common_parameters/_parent_parameter.html.erb
<%= text_field_tag("parent_parameter_#{i}_key", '', :class => "form-control", :placeholder => parameter.name) %>
</td>
<td class="col-md-8">
<%= text_area_tag("parent_parameter_#{i}_value", '', :class => "form-control", :rows => 1, :placeholder => parameter.value) %>
<%= text_area_tag("parent_parameter_#{i}_value", '', :class => "form-control no-stretch", :rows => 1, :placeholder => parameter.value) %>
</td>
</tr>
</table>
app/views/common_parameters/_puppetclass_parameter.html.erb
<%= text_field_tag '', (f.object.lookup_key.key rescue ''), :class => 'form-control', :'data-property' => 'name', :disabled => true, :title => _('Parameter name') %>
</td>
<td class="col-md-4">
<%= f.text_area :value, :rows => line_count(f, :value), :class => 'form-control', :'data-property' => 'value',
<%= f.text_area :value, :rows => line_count(f, :value), :class => 'form-control no-stretch', :'data-property' => 'value',
:disabled => (not authorized_via_my_scope("host_editing", "edit_params")) || f.object.use_puppet_default,
:placeholder => _("Value") %>
<%= text_field_tag '', (f.object.lookup_key.key_type rescue 'unknown'), :class=> 'hide', :'data-property' => 'type', :disabled => true, :title => _('Parameter type') %>
app/views/hosts/_form.html.erb
<div id='model_name'>
<%= select_f f, :model_id, Model.all, :id, :to_label, { :include_blank => true }, {:label => _("Hardware Model")} unless @host.compute_resource_id%>
</div>
<%= textarea_f f, :comment, :help_block => _("Additional information about this host"), :size => "col-md-8", :rows => "3" %>
<%= textarea_f f, :comment, :help_block => _("Additional information about this host"), :size => "col-md-8", :rows => "3", :class => "no-stretch" %>
</div>
</div>
app/views/lookup_keys/_fields.html.erb
<legend><%= _("Parameter details") %></legend>
<%= text_f f, :key, :disabled => f.object.is_param, :size => "col-md-8" %>
<%= f.hidden_field :key if is_param %>
<%= textarea_f f, :description, :rows => :auto, :size => "col-md-8" %>
<%= textarea_f f, :description, :rows => :auto, :size => "col-md-8", :class => "no-stretch" %>
<%= text_f(f, :environment_classes, :value => f.object.environment_classes.map(&:environment).to_sentence, :label => _('Puppet Environments'), :size => "col-md-8", :disabled => true) if is_param %>
<%= show_puppet_class f %>
</fieldset>
......
<%= textarea_f f, :default_value, :value => f.object.default_value_before_type_cast, :size => "col-md-8",
:disabled => (f.object.is_param && (!f.object.override || f.object.use_puppet_default)),
:fullscreen => :true,
:rows => :auto, :help_inline => popover('', _("Value to use when there is no match.")) %>
:rows => :auto,
:help_inline => popover('', _("Value to use when there is no match.")),
:class => "no-stretch" %>
<%= checkbox_f(f, :use_puppet_default, :label => _('Use Puppet default'), :size => "col-md-8",
:help_inline => use_puppet_default_help,
:onchange => 'toggleUsePuppetDefaultValue(this, "default_value")',
......
:help_inline => popover('', _("If checked, will raise an error if there is no default value and no matcher provide a value."))
) if is_param %>
<%= validator_type_selector f %>
<%= text_f f, :validator_rule, :size => "col-md-8", :disabled => f.object.validator_type.blank? %>
<%= text_f f, :validator_rule, :size => "col-md-8", :disabled => f.object.validator_type.blank?, :class => "no-stretch" %>
</div>
</fieldset>
</br>
......
<legend><%= _("Prioritize attribute order") %></legend>
<h6><%= popover("", _("The order in which matchers keys are processed, first match wins.<br> You may use multiple attributes as a matcher key, for example, an order of <code>host group, environment</code> would expect a matcher such as <code>hostgroup = \"web servers\", environment = production</code>"),
:title => _("The order in which values are resolved.")).html_safe %> <%= _("Set the order in which values are resolved.") %></h6>
<%= textarea_f f, :path, :rows => :auto, :label => _("Order"), :id => 'order', :size => "col-md-8", :onchange => 'fill_in_matchers()', :value => f.object.path %>
<%= textarea_f f, :path, :rows => :auto, :label => _("Order"), :id => 'order', :size => "col-md-8", :onchange => 'fill_in_matchers()', :value => f.object.path, :class => "no-stretch" %>
<%= checkbox_f(f, :merge_overrides, :onchange => 'mergeOverridesChanged(this)', :table_field => true,
:disabled => !f.object.supports_merge?, :size => "col-md-1", :label_size => "col-md-3",
:help_inline => popover("", _("Continue to look for matches after first find (only array/hash type)? Note: merging overrides ignores all matchers that use Puppet default."))) %>
app/views/lookup_keys/_value.html.erb
<%= text_field_tag '', nil, :class => 'matcher_value' %>
</td>
<td>
<%= f.text_area :value, :rows => line_count(f, :value), :class => 'form-control', :'data-property' => 'value',
<%= f.text_area :value, :rows => line_count(f, :value), :class => 'form-control no-stretch', :'data-property' => 'value',
:disabled => f.object.use_puppet_default,
:placeholder => _("Value") %>
</td>

Also available in: Unified diff