To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / views / custom_fields / index.api.rsb @ 1591:63650ae64bf2
History | View | Annotate | Download (1.34 KB)
| 1 |
api.array :custom_fields do |
|---|---|
| 2 |
@custom_fields.each do |field| |
| 3 |
api.custom_field do |
| 4 |
api.id field.id |
| 5 |
api.name field.name |
| 6 |
api.customized_type field.class.customized_class.name.underscore if field.class.customized_class |
| 7 |
api.field_format field.field_format |
| 8 |
api.regexp field.regexp |
| 9 |
api.min_length field.min_length |
| 10 |
api.max_length field.max_length |
| 11 |
api.is_required field.is_required? |
| 12 |
api.is_filter field.is_filter? |
| 13 |
api.searchable field.searchable |
| 14 |
api.multiple field.multiple? |
| 15 |
api.default_value field.default_value |
| 16 |
api.visible field.visible? |
| 17 |
|
| 18 |
values = field.possible_values_options |
| 19 |
if values.present? |
| 20 |
api.array :possible_values do |
| 21 |
values.each do |label, value| |
| 22 |
api.possible_value do |
| 23 |
api.value value || label |
| 24 |
end |
| 25 |
end |
| 26 |
end |
| 27 |
end |
| 28 |
|
| 29 |
if field.is_a?(IssueCustomField) |
| 30 |
api.array :trackers do |
| 31 |
field.trackers.each do |tracker| |
| 32 |
api.tracker :id => tracker.id, :name => tracker.name |
| 33 |
end |
| 34 |
end |
| 35 |
api.array :roles do |
| 36 |
field.roles.each do |role| |
| 37 |
api.role :id => role.id, :name => role.name |
| 38 |
end |
| 39 |
end |
| 40 |
end |
| 41 |
end |
| 42 |
end |
| 43 |
end |