Project

General

Profile

« Previous | Next » 

Revision 989e0aad

Added by Leos Stejskal almost 3 years ago

Fixes #32822 - Job templates and resource picker

New `resource` user input type for templates with
template macro `input_resource` returning the resource object

View differences:

app/views/template_inputs/_form.html.erb
<%= text_f f, :name, :disabled => @template.locked? %>
<%= checkbox_f f, :required, :disabled => @template.locked? %>
<%= selectable_f f, :input_type, template_input_types_options(@template.available_input_types), {}, :class => "input_type_selector #{@template.locked? && 'without_select2'}", :disabled => @template.locked? %>
<%= selectable_f f, :value_type, [[_('Plain'), 'plain'], [_("Search"), 'search'], [_('Date'), 'date']], {}, {'data-item': f.index || f.object.id, class: "select-value-type #{@template.locked? && 'without_select2'}", onchange: "tfm.templateInputs.inputValueOnchange(this)", disabled: @template.locked? } %>
<%= selectable_f f, :value_type, template_input_value_type_options, {}, {'data-item': f.index || f.object.id, class: "select-value-type #{@template.locked? && 'without_select2'}", onchange: "tfm.templateInputs.inputValueOnchange(this)", disabled: @template.locked? } %>
<%= selectable_f f, :resource_type, Permission.resources_with_translations, {}, {wrapper_class: "#{hide_resource_type_input(f.object)} form-group resource-type-#{f.index || f.object.id}", class: "#{@template.locked? && 'without_select2'}", disabled: @template.locked? } %>
<% @template.available_input_types.each do |type| %>
<div class="<%= type %>_input_type custom_input_type_fields" style="<%= f.object.input_type == type ? '' : 'display:none' %>">

Also available in: Unified diff