|
|
|
@ -30,26 +30,42 @@ See doc/COPYRIGHT.rdoc for more details. |
|
|
|
|
<section class="form--section"> |
|
|
|
|
<div class="grid-block wrap"> |
|
|
|
|
<div class="grid-content small-12 large-6"> |
|
|
|
|
<% attributes = ::TypesHelper |
|
|
|
|
.work_package_form_attributes(merge_date: true) |
|
|
|
|
.reject { |name, attr| |
|
|
|
|
# display all custom fields don't display required fields without a default |
|
|
|
|
not name =~ /custom_field_/ and (attr[:required] and not attr[:has_default]) |
|
|
|
|
} |
|
|
|
|
keys = attributes.keys.sort_by do |name| |
|
|
|
|
translated_attribute_name(name, attributes[name]) |
|
|
|
|
end %> |
|
|
|
|
|
|
|
|
|
<%= f.hidden_field :attribute_groups, value: @type.attribute_groups.to_json %> |
|
|
|
|
<%= f.hidden_field :attribute_visibility, value: @type.attribute_visibility.to_json %> |
|
|
|
|
|
|
|
|
|
<div id="types-form-configuration" ng-controller="TypesFormConfigurationCtrl"> |
|
|
|
|
<p><%= I18n.t('text_form_configuration') %></p> |
|
|
|
|
|
|
|
|
|
<button class="button"><i class="button--icon icon-add"></i> Add Group</button> |
|
|
|
|
<button class="button"><i class="button--icon icon-undo"></i> Reset to defaults</button> |
|
|
|
|
|
|
|
|
|
<div dragula="'groups'"> |
|
|
|
|
|
|
|
|
|
<% attributes = ::TypesHelper |
|
|
|
|
.work_package_form_attributes(merge_date: true) |
|
|
|
|
.reject { |name, attr| |
|
|
|
|
# display all custom fields don't display required fields without a default |
|
|
|
|
not name =~ /custom_field_/ and (attr[:required] and not attr[:has_default]) |
|
|
|
|
} |
|
|
|
|
keys = attributes.keys.sort_by do |name| |
|
|
|
|
translated_attribute_name(name, attributes[name]) |
|
|
|
|
end %> |
|
|
|
|
|
|
|
|
|
<div id="type-form-conf-group-template" class="type-form-conf-group" data-key=""> |
|
|
|
|
<div class="group-head"> |
|
|
|
|
<span class="group-handle"></span> |
|
|
|
|
<span class="group-name"></span> |
|
|
|
|
|
|
|
|
|
<div class="attribute-visibility"> |
|
|
|
|
<%= I18n.t('label_always_visible') %> |
|
|
|
|
<span class="delete-group icon icon-close"></span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="attributes" dragula='"attributes"'> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div dragula='"groups"'> |
|
|
|
|
<% @type.attribute_groups.each do |group_name, group_attributes| %> |
|
|
|
|
<div class="type-form-conf-group"> |
|
|
|
|
<div class="type-form-conf-group" data-key="<%= group_name %>"> |
|
|
|
|
<div class="group-head"> |
|
|
|
|
<span class="group-handle"></span> |
|
|
|
|
<span class="group-name"><%= group_name %></span> |
|
|
|
@ -59,7 +75,7 @@ See doc/COPYRIGHT.rdoc for more details. |
|
|
|
|
<span class="delete-group icon icon-close"></span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="attributes" dragula="'attributes'"> |
|
|
|
|
<div class="attributes" dragula='"attributes"'> |
|
|
|
|
<% group_attributes.each do |name| %> |
|
|
|
|
<% next if ( |
|
|
|
|
[ nil, |
|
|
|
@ -67,18 +83,19 @@ See doc/COPYRIGHT.rdoc for more details. |
|
|
|
|
'visible' ].exclude?(attr_visibility(name, @type)) || |
|
|
|
|
attributes[name].nil? |
|
|
|
|
) %> |
|
|
|
|
<div class="type-form-conf-attribute"> |
|
|
|
|
<div class="type-form-conf-attribute" data-key="<%= name %>"> |
|
|
|
|
<span class="attribute-handle"></span> |
|
|
|
|
<span class="attribute-name"> |
|
|
|
|
<%= translated_attribute_name(name, attributes[name]) %> |
|
|
|
|
</span> |
|
|
|
|
|
|
|
|
|
<div class="attribute-visibility"> |
|
|
|
|
<%= check_box_tag "type[attribute_visibility][#{name}]", |
|
|
|
|
<%= check_box_tag "", |
|
|
|
|
'visible', |
|
|
|
|
attr_visibility(name, @type) == 'visible', |
|
|
|
|
id: "type_attribute_visibility_visible_#{name}", |
|
|
|
|
title: I18n.t('tooltip.attribute_visibility.visible') %> |
|
|
|
|
title: I18n.t('tooltip.attribute_visibility.visible'), |
|
|
|
|
'ng-click': "updateHiddenFields()" %> |
|
|
|
|
<span class="delete-group icon icon-close"></span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -86,36 +103,35 @@ See doc/COPYRIGHT.rdoc for more details. |
|
|
|
|
</div> |
|
|
|
|
</div> <!-- END attribute group --> |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
|
<div id="type-form-conf-inactive-group"> |
|
|
|
|
<div class="group-head"> |
|
|
|
|
<span class="group-name">Inactive attributes</span> |
|
|
|
|
<span class="advice">(Drag attributes from here to activate them)</span> |
|
|
|
|
</div> |
|
|
|
|
<div class="attributes" dragula='"attributes"'> |
|
|
|
|
<% keys.each do |name| %> |
|
|
|
|
<% next if ([nil, 'default', 'visible'].include?( |
|
|
|
|
attr_visibility(name, @type))) %> |
|
|
|
|
<div class="type-form-conf-attribute" data-key="<%= name %>"> |
|
|
|
|
<span class="attribute-handle"></span> |
|
|
|
|
<span class="attribute-name"> |
|
|
|
|
<%= translated_attribute_name(name, attributes[name]) %> |
|
|
|
|
</span> |
|
|
|
|
|
|
|
|
|
<div class="type-form-conf-inactive-group"> |
|
|
|
|
<div class="group-head"> |
|
|
|
|
<span class="group-name">Inactive attributes</span> |
|
|
|
|
<span class="advice">(Drag attributes from here to activate them)</span> |
|
|
|
|
</div> |
|
|
|
|
<div class="attributes" dragula="'attributes'"> |
|
|
|
|
<% keys.each do |name| %> |
|
|
|
|
<% next if ([nil, 'default', 'visible'].include?( |
|
|
|
|
attr_visibility(name, @type))) %> |
|
|
|
|
<div class="type-form-conf-attribute"> |
|
|
|
|
<span class="attribute-handle"></span> |
|
|
|
|
<span class="attribute-name"> |
|
|
|
|
<%= translated_attribute_name(name, attributes[name]) %> |
|
|
|
|
</span> |
|
|
|
|
|
|
|
|
|
<div class="attribute-visibility hidden"> |
|
|
|
|
<%= check_box_tag "type[attribute_visibility][#{name}]", |
|
|
|
|
'visible', |
|
|
|
|
attr_visibility(name, @type) == 'visible', |
|
|
|
|
id: "type_attribute_visibility_visible_#{name}", |
|
|
|
|
title: I18n.t('tooltip.attribute_visibility.visible') %> |
|
|
|
|
<span class="delete-group icon icon-close"></span> |
|
|
|
|
</div> |
|
|
|
|
<div class="attribute-visibility"> |
|
|
|
|
<%= check_box_tag "", |
|
|
|
|
'visible', |
|
|
|
|
attr_visibility(name, @type) == 'visible', |
|
|
|
|
id: "type_attribute_visibility_visible_#{name}", |
|
|
|
|
title: I18n.t('tooltip.attribute_visibility.visible'), |
|
|
|
|
'ng-click': "updateHiddenFields()" %> |
|
|
|
|
<span class="delete-group icon icon-close"></span> |
|
|
|
|
</div> |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</types-form-configuration> <!-- END type form configurator --> |
|
|
|
|
</div><!-- END type form configurator --> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|