kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
3.5 KiB
81 lines
3.5 KiB
|
|
<%
|
|
gon.push({
|
|
hide_sections: {
|
|
all: @custom_action.all_actions.map { |a| { key: a.key, label: a.human_name } },
|
|
active: @custom_action.actions.map { |a| { key: a.key, label: a.human_name } }
|
|
}
|
|
})
|
|
%>
|
|
|
|
<%= include_gon(camel_case: true, camel_depth: 15) %>
|
|
|
|
<div class="form--field">
|
|
<%= f.text_field :name, required: true, container_class: '-middle', label: 'Name' %>
|
|
</div>
|
|
|
|
<fieldset class="form--fieldset" id="custom-actions-form--conditions">
|
|
<legend class="form--fieldset-legend">
|
|
<%= t('custom_actions.conditions') %>
|
|
</legend>
|
|
|
|
<% @custom_action.all_conditions.each do |condition| %>
|
|
<div class="form--field">
|
|
<%= styled_label_tag("custom_action_conditions_#{condition.key}", condition.human_name) %>
|
|
<% input_name = "custom_action[conditions][#{condition.key}]" %>
|
|
<% selected_values = condition.values
|
|
select_options = options_for_select(condition.allowed_values.map { |v| [v[:label], v[:value]] },
|
|
selected: selected_values) %>
|
|
<%= styled_select_tag input_name,
|
|
select_options,
|
|
container_class: '-middle' %>
|
|
</div>
|
|
<% end %>
|
|
</fieldset>
|
|
|
|
<fieldset class="form--fieldset" id="custom-actions-form--actions">
|
|
<legend class="form--fieldset-legend">
|
|
<%= t('custom_actions.actions') %>
|
|
</legend>
|
|
|
|
<div id="custom-actions-form--active-actions">
|
|
<% @custom_action.all_actions.each do |action| %>
|
|
<hide-section section-name="<%= action.key %>">
|
|
<div class="form--field">
|
|
<%= styled_label_tag("custom_action_actions_#{action.key}", action.human_name) %>
|
|
|
|
<% input_name = "custom_action[actions][#{action.key}]" %>
|
|
<% if %i(associated_property boolean associated_property_multi).include?(action.type) %>
|
|
<% selected_values = action.values
|
|
select_options = options_for_select(action.allowed_values.map { |v| [v[:label], v[:value]] },
|
|
selected: selected_values) %>
|
|
<%= styled_select_tag input_name,
|
|
select_options,
|
|
multiple: action.type == :associated_property_multi,
|
|
container_class: '-middle' %>
|
|
<% elsif %i(date_property).include?(action.type) %>
|
|
<%= styled_text_field_tag input_name,
|
|
action.values,
|
|
id: "on-date-value-#{action.key}",
|
|
container_class: '-slim',
|
|
size: '10' %>
|
|
<%= calendar_for("on-date-value-#{action.key}") %>
|
|
<% elsif %i(string_property text_property).include?(action.type) %>
|
|
<%= styled_text_field_tag input_name,
|
|
action.values,
|
|
container_class: '-slim',
|
|
step: 'any' %>
|
|
<% elsif %i(integer_property float_property).include?(action.type) %>
|
|
<%= styled_number_field_tag input_name,
|
|
action.values,
|
|
container_class: '-slim',
|
|
step: 'any' %>
|
|
<% end %>
|
|
<hide-section-link section-name="<%= action.key %>"></hide-section-link>
|
|
</div>
|
|
</hide-section>
|
|
<% end %>
|
|
</div>
|
|
|
|
<add-section-dropdown id="custom-actions-form--selectable-actions"></add-section-dropdown>
|
|
</fieldset>
|
|
|