agile_rails 0.0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/MIT-LICENSE +20 -0
- data/README.md +285 -0
- data/Rakefile +39 -0
- data/agile_rails.gemspec +36 -0
- data/app/assets/fonts/ibm-plex-sans-300.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-400.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-500.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-600.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-700.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-italic.woff2 +0 -0
- data/app/assets/images/32px.png +0 -0
- data/app/assets/images/throbber.gif +0 -0
- data/app/assets/javascripts/agile/agile.js +1489 -0
- data/app/assets/javascripts/agile/jquery-migrate.js +702 -0
- data/app/assets/javascripts/agile/jquery.bpopup.js +372 -0
- data/app/assets/javascripts/agile/jquery.datetimepicker.js +1353 -0
- data/app/assets/javascripts/agile/jstree.min.js +6 -0
- data/app/assets/javascripts/agile/select-multiple.js +459 -0
- data/app/assets/javascripts/agile/some_scripts.js +33 -0
- data/app/assets/javascripts/agile.js +22 -0
- data/app/assets/javascripts/agile_application.js +22 -0
- data/app/assets/javascripts/agile_editor.js +22 -0
- data/app/assets/stylesheets/agile/agile.css +1882 -0
- data/app/assets/stylesheets/agile/agile_apps.css +149 -0
- data/app/assets/stylesheets/agile/jquery.datetimepicker.css +304 -0
- data/app/assets/stylesheets/agile/jstree.css +1107 -0
- data/app/assets/stylesheets/agile/select-multiple.css +110 -0
- data/app/assets/stylesheets/agile/th-bg.png +0 -0
- data/app/assets/stylesheets/agile/theme.css +49 -0
- data/app/assets/stylesheets/agile.css +21 -0
- data/app/assets/stylesheets/agile_application.css +20 -0
- data/app/assets/stylesheets/agile_editor.css +19 -0
- data/app/controllers/agile_application_controller.rb +735 -0
- data/app/controllers/agile_common_controller.rb +345 -0
- data/app/controllers/agile_controller.rb +977 -0
- data/app/controllers/agile_main_controller.rb +36 -0
- data/app/controls/agile_control.rb +120 -0
- data/app/controls/agile_report.rb +364 -0
- data/app/controls/ar_category_control.rb +39 -0
- data/app/controls/ar_help_control.rb +139 -0
- data/app/controls/ar_image_control.rb +180 -0
- data/app/controls/ar_journal_control.rb +47 -0
- data/app/controls/ar_menu_item_control.rb +55 -0
- data/app/controls/ar_page_control.rb +64 -0
- data/app/controls/ar_poll_result_control.rb +84 -0
- data/app/controls/ar_setup_control.rb +62 -0
- data/app/controls/belongs_to_control.rb +61 -0
- data/app/controls/browse_models_control.rb +98 -0
- data/app/controls/settings_form_control.rb +137 -0
- data/app/forms/agile_help.yml +112 -0
- data/app/forms/agile_menu.yml +140 -0
- data/app/forms/agile_report_defaults.yml +39 -0
- data/app/forms/all_options.yml +810 -0
- data/app/forms/ar_ad.yml +121 -0
- data/app/forms/ar_big_table.yml +60 -0
- data/app/forms/ar_big_table_value.yml +52 -0
- data/app/forms/ar_browse_fields.yml +35 -0
- data/app/forms/ar_browse_models.yml +48 -0
- data/app/forms/ar_category.yml +73 -0
- data/app/forms/ar_category_as_tree.yml +31 -0
- data/app/forms/ar_design.yml +75 -0
- data/app/forms/ar_filter.yml +52 -0
- data/app/forms/ar_folder_permission.yml +56 -0
- data/app/forms/ar_folder_rule.yml +48 -0
- data/app/forms/ar_gallery.yml +55 -0
- data/app/forms/ar_image.yml +126 -0
- data/app/forms/ar_image_search.yml +83 -0
- data/app/forms/ar_journal.yml +76 -0
- data/app/forms/ar_json_ld.yml +56 -0
- data/app/forms/ar_key_value.yml +33 -0
- data/app/forms/ar_key_value_store.yml +33 -0
- data/app/forms/ar_link.yml +60 -0
- data/app/forms/ar_menu.yml +67 -0
- data/app/forms/ar_menu_item.yml +141 -0
- data/app/forms/ar_page.yml +187 -0
- data/app/forms/ar_part.yml +91 -0
- data/app/forms/ar_permission.yml +52 -0
- data/app/forms/ar_permission_rule.yml +40 -0
- data/app/forms/ar_piece.yml +106 -0
- data/app/forms/ar_policy.yml +64 -0
- data/app/forms/ar_policy_rule.yml +42 -0
- data/app/forms/ar_policy_rule_nocms.yml +40 -0
- data/app/forms/ar_poll.yml +118 -0
- data/app/forms/ar_poll_item.yml +78 -0
- data/app/forms/ar_poll_result.yml +88 -0
- data/app/forms/ar_poll_result_export.yml +35 -0
- data/app/forms/ar_removed_url.yml +41 -0
- data/app/forms/ar_role.yml +43 -0
- data/app/forms/ar_seo.yml +32 -0
- data/app/forms/ar_setup.yml +45 -0
- data/app/forms/ar_site.yml +149 -0
- data/app/forms/ar_steps_template.yml +51 -0
- data/app/forms/ar_user.yml +140 -0
- data/app/forms/ar_user_role.yml +57 -0
- data/app/forms/help/dc_category_as_tree.en +4 -0
- data/app/forms/help/dc_category_as_tree.sl +5 -0
- data/app/forms/json_ld_schema.yml +168 -0
- data/app/helpers/agile_application_helper.rb +1162 -0
- data/app/helpers/agile_category_helper.rb +128 -0
- data/app/helpers/agile_common_helper.rb +308 -0
- data/app/helpers/agile_edit_helper.rb +645 -0
- data/app/helpers/agile_helper.rb +509 -0
- data/app/helpers/agile_index_helper.rb +677 -0
- data/app/helpers/ar_image_helper.rb +128 -0
- data/app/models/agile_form_fields/action.rb +61 -0
- data/app/models/agile_form_fields/agile_form_field.rb +322 -0
- data/app/models/agile_form_fields/belongs_to.rb +112 -0
- data/app/models/agile_form_fields/check_box.rb +73 -0
- data/app/models/agile_form_fields/comment.rb +62 -0
- data/app/models/agile_form_fields/date_picker.rb +104 -0
- data/app/models/agile_form_fields/date_select.rb +68 -0
- data/app/models/agile_form_fields/datetime_picker.rb +88 -0
- data/app/models/agile_form_fields/datetime_select.rb +73 -0
- data/app/models/agile_form_fields/file_field.rb +52 -0
- data/app/models/agile_form_fields/file_select.rb +69 -0
- data/app/models/agile_form_fields/hidden_field.rb +51 -0
- data/app/models/agile_form_fields/html_field.rb +69 -0
- data/app/models/agile_form_fields/journal_diff.rb +62 -0
- data/app/models/agile_form_fields/link_to.rb +69 -0
- data/app/models/agile_form_fields/method.rb +66 -0
- data/app/models/agile_form_fields/multitext_autocomplete.rb +215 -0
- data/app/models/agile_form_fields/number_field.rb +92 -0
- data/app/models/agile_form_fields/password_field.rb +63 -0
- data/app/models/agile_form_fields/radio_button.rb +95 -0
- data/app/models/agile_form_fields/readonly.rb +77 -0
- data/app/models/agile_form_fields/select.rb +281 -0
- data/app/models/agile_form_fields/submit_tag.rb +58 -0
- data/app/models/agile_form_fields/text_area.rb +61 -0
- data/app/models/agile_form_fields/text_autocomplete.rb +171 -0
- data/app/models/agile_form_fields/text_field.rb +55 -0
- data/app/models/agile_form_fields/text_with_select.rb +94 -0
- data/app/models/agile_form_fields/tree_select.rb +170 -0
- data/app/models/ar_big_table.rb +82 -0
- data/app/models/ar_big_table_value.rb +53 -0
- data/app/models/ar_category.rb +109 -0
- data/app/models/ar_design.rb +116 -0
- data/app/models/ar_filter.rb +200 -0
- data/app/models/ar_folder_permission.rb +50 -0
- data/app/models/ar_folder_rule.rb +47 -0
- data/app/models/ar_gallery.rb +53 -0
- data/app/models/ar_image.rb +198 -0
- data/app/models/ar_internals.rb +60 -0
- data/app/models/ar_journal.rb +46 -0
- data/app/models/ar_json_ld.rb +131 -0
- data/app/models/ar_key_value_store.rb +128 -0
- data/app/models/ar_link.rb +48 -0
- data/app/models/ar_memory.rb +172 -0
- data/app/models/ar_menu.rb +144 -0
- data/app/models/ar_menu_item.rb +106 -0
- data/app/models/ar_page.rb +74 -0
- data/app/models/ar_part.rb +66 -0
- data/app/models/ar_permission.rb +180 -0
- data/app/models/ar_permission_rule.rb +65 -0
- data/app/models/ar_policy.rb +78 -0
- data/app/models/ar_policy_rule.rb +65 -0
- data/app/models/ar_poll.rb +74 -0
- data/app/models/ar_poll_item.rb +47 -0
- data/app/models/ar_poll_result.rb +38 -0
- data/app/models/ar_removed_url.rb +42 -0
- data/app/models/ar_role.rb +84 -0
- data/app/models/ar_setup.rb +115 -0
- data/app/models/ar_site.rb +68 -0
- data/app/models/ar_temp.rb +150 -0
- data/app/models/ar_user.rb +72 -0
- data/app/models/ar_user_group.rb +38 -0
- data/app/models/ar_user_role.rb +54 -0
- data/app/models/ar_visit.rb +41 -0
- data/app/models/concerns/ar_page_concern.rb +128 -0
- data/app/models/concerns/ar_part_concern.rb +48 -0
- data/app/models/concerns/ar_piece_concern.rb +48 -0
- data/app/models/concerns/ar_policy_rule_concern.rb +87 -0
- data/app/models/concerns/ar_seo_concern.rb +66 -0
- data/app/models/concerns/ar_site_concern.rb +103 -0
- data/app/models/concerns/ar_user_concern.rb +195 -0
- data/app/renderers/agile_common_renderer.rb +93 -0
- data/app/renderers/agile_renderer.rb +59 -0
- data/app/renderers/ar_ad_renderer.rb +219 -0
- data/app/renderers/ar_captcha_renderer.rb +113 -0
- data/app/renderers/ar_common_renderer.rb +90 -0
- data/app/renderers/ar_gallery_renderer.rb +107 -0
- data/app/renderers/ar_menu_renderer.rb +195 -0
- data/app/renderers/ar_page_renderer.rb +147 -0
- data/app/renderers/ar_part_renderer.rb +235 -0
- data/app/renderers/ar_piece_renderer.rb +119 -0
- data/app/renderers/ar_poll_renderer.rb +272 -0
- data/app/views/agile/_edit_stuff.html.erb +57 -0
- data/app/views/agile/_form.html.erb +24 -0
- data/app/views/agile/_result.html.erb +28 -0
- data/app/views/agile/edit.html.erb +13 -0
- data/app/views/agile/error.html.erb +2 -0
- data/app/views/agile/index.html.erb +14 -0
- data/app/views/agile/login.html.erb +19 -0
- data/app/views/agile/new.html.erb +12 -0
- data/app/views/agile_common/_help.html.erb +18 -0
- data/app/views/agile_common/_iframe_edit.html.erb +2 -0
- data/app/views/agile_common/paste_clipboard.html.erb +17 -0
- data/app/views/layouts/agile.html.erb +17 -0
- data/app/views/layouts/content.html.erb +20 -0
- data/app/views/models/dump_models.html.erb +47 -0
- data/config/initializers/kaminari_patch.rb +56 -0
- data/config/locales/agile_de.yml +138 -0
- data/config/locales/agile_en.yml +162 -0
- data/config/locales/agile_sl.yml +163 -0
- data/config/locales/datetimepicker.yml +19 -0
- data/config/locales/de.yml +231 -0
- data/config/locales/en.yml +13 -0
- data/config/locales/kaminari.yml +26 -0
- data/config/locales/models_en.yml +1032 -0
- data/config/locales/models_sl.yml +1065 -0
- data/config/locales/sl.yml +211 -0
- data/db/migrate/20240120160001_add_sessions_table.rb +12 -0
- data/db/migrate/20240120160002_ar_big_table.rb +17 -0
- data/db/migrate/20240120160003_ar_big_table_value.rb +18 -0
- data/db/migrate/20240120160004_ar_category.rb +22 -0
- data/db/migrate/20240120160005_ar_design.rb +20 -0
- data/db/migrate/20240120160006_ar_filter.rb +17 -0
- data/db/migrate/20240120160007_ar_gallery.rb +21 -0
- data/db/migrate/20240120160008_ar_journal.rb +19 -0
- data/db/migrate/20240120160009_ar_key_value_store.rb +11 -0
- data/db/migrate/20240120160010_ar_link.rb +19 -0
- data/db/migrate/20240120160011_ar_memory.rb +8 -0
- data/db/migrate/20240120160012_ar_menu.rb +21 -0
- data/db/migrate/20240120160013_ar_menu_item.rb +28 -0
- data/db/migrate/20240120160014_ar_page.rb +50 -0
- data/db/migrate/20240120160015_ar_part.rb +33 -0
- data/db/migrate/20240120160016_ar_permission.rb +16 -0
- data/db/migrate/20240120160017_ar_permission_rule.rb +17 -0
- data/db/migrate/20240120160018_ar_piece.rb +28 -0
- data/db/migrate/20240120160019_ar_policy.rb +21 -0
- data/db/migrate/20240120160020_ar_policy_rule.rb +18 -0
- data/db/migrate/20240120160021_ar_poll.rb +27 -0
- data/db/migrate/20240120160022_ar_poll_item.rb +23 -0
- data/db/migrate/20240120160023_ar_poll_result.rb +14 -0
- data/db/migrate/20240120160024_ar_removed_url.rb +16 -0
- data/db/migrate/20240120160025_ar_role.rb +17 -0
- data/db/migrate/20240120160026_ar_site.rb +37 -0
- data/db/migrate/20240120160027_ar_temp.rb +11 -0
- data/db/migrate/20240120160028_ar_user.rb +42 -0
- data/db/migrate/20240120160029_ar_user_group.rb +12 -0
- data/db/migrate/20240120160030_ar_user_role.rb +18 -0
- data/db/migrate/20240120160031_ar_visit.rb +15 -0
- data/db/migrate/20240703016001_ar_setup.rb +16 -0
- data/db/migrate/20240703016002_ar_folder_permission.rb +15 -0
- data/db/migrate/20240703016003_ar_folder_rule.rb +14 -0
- data/db/migrate/20250115000001_ar_image.rb +25 -0
- data/lib/agile/configuration.rb +43 -0
- data/lib/agile/engine.rb +29 -0
- data/lib/agile/version.rb +27 -0
- data/lib/agile.rb +282 -0
- data/lib/agile_rails.rb +1 -0
- data/lib/generators/agile/USAGE +11 -0
- data/lib/generators/agile/new_form_generator.rb +369 -0
- data/lib/generators/convert_to_ar/convert_to_ar_generator.rb +158 -0
- data/lib/tasks/agile_db_clone.rake +132 -0
- data/lib/tasks/agile_db_export_to_yaml.rake +37 -0
- data/lib/tasks/agile_db_migrate.rake +35 -0
- metadata +414 -0
@@ -0,0 +1,810 @@
|
|
1
|
+
|
2
|
+
# Click on the option to discover more
|
3
|
+
|
4
|
+
# TOP LEVEL
|
5
|
+
table: table_name
|
6
|
+
## Name of the model which will be used by the form. Rails ORM is using model names as a way to access tables so
|
7
|
+
## model name in lowercase must be used.<br>
|
8
|
+
extend: form_name
|
9
|
+
## Form can extend another form. Extending form will first be loaded and then keys on the same level will be replaced by
|
10
|
+
## the options in the current file. Options can also be deleted by specifying / as a option value.<br>
|
11
|
+
## example: index: / will remove index option from resulting form
|
12
|
+
include: form_name
|
13
|
+
## Similar to extend, but here included form will be added to current form. Options on the same level will be replaced by the Options in the included file.
|
14
|
+
title: Dialog title
|
15
|
+
## Default dialog title. If omitted title will be acquired from Rails locales.
|
16
|
+
title:
|
17
|
+
## Alternative way of setting title.
|
18
|
+
text: Same as above
|
19
|
+
## same as above
|
20
|
+
eval: SomeClass.title_method
|
21
|
+
## Dialog title can also be set dynamically. Preferred in the control file.
|
22
|
+
controls: controls_file
|
23
|
+
## Controls file name. By default it is the same as table option. If not specified, "_control" will be automatically added
|
24
|
+
## to the value of controls option.
|
25
|
+
readonly: true|1|Yes
|
26
|
+
## This is a readonly form. No fields can be edited on the readonly form and some actions can also be hidden on a readonly
|
27
|
+
## form. Same effect can be accomplished by setting readonly parameter in the URL.
|
28
|
+
permissions:
|
29
|
+
## Only users with specified roles can use the form. Users who don't have specified roles, will be rejected with no access message.<br>
|
30
|
+
## So far only can_view option can be set
|
31
|
+
can_view: role_name,another_role_name
|
32
|
+
|
33
|
+
script: 'javascript code'
|
34
|
+
## It is not the preferred way, but javascript code can also be defined on a form.
|
35
|
+
css: 'css code'
|
36
|
+
## It is not the preferred way, but CSS code can also be defined on a form.
|
37
|
+
|
38
|
+
# INDEX
|
39
|
+
|
40
|
+
index:
|
41
|
+
## index option defines actions and fields which will be used for Rails index action usually for browsing table data.
|
42
|
+
filter: name, body as text_field
|
43
|
+
## field names which can be used for filtering data. Fields must be defined on data entry definition in the form section. If field is not defined in the form section "as text_field" can be used.
|
44
|
+
|
45
|
+
actions: standard
|
46
|
+
## Only standard actions will be used. Standard actions are: "check,new,filter,sort" and can be set in configurations file.
|
47
|
+
actions: standard,sort
|
48
|
+
## When single standard action is omitted from default standard actions it can be added like this.
|
49
|
+
actions:
|
50
|
+
## If required user defined actions standard actions can also be defined like this.
|
51
|
+
standard: yes
|
52
|
+
## Same as actions: standard
|
53
|
+
1: new
|
54
|
+
2: filter
|
55
|
+
3: sort
|
56
|
+
|
57
|
+
1:
|
58
|
+
## When you want to change caption of the standard action.
|
59
|
+
type: new
|
60
|
+
caption: Alternative caption
|
61
|
+
20:
|
62
|
+
## All actions are numbered and are as all other numbered options sorted before being processed. Numbering options
|
63
|
+
## is a hidden feature that allows options to be deleted or updated before the form is processed.<br>
|
64
|
+
## Numbers from 0 to 9 are reserved for standard actions.<br><br>
|
65
|
+
type: link
|
66
|
+
## Action type link will create an action button with a link.
|
67
|
+
caption: can.be.translated
|
68
|
+
## All captions and labels can also be defined in locals. Trick is to use dot "." in the first 10 characters of text.
|
69
|
+
icon: icon-name
|
70
|
+
## Name of the icon defined by material icons in drg_material_icons gem. If icon_name contains dot icon file will be specified
|
71
|
+
## from assets. It it is preceded by path then it will be loaded from a file system.
|
72
|
+
title: Text for mouse over
|
73
|
+
## Title text which will be displayed when button is hovered.
|
74
|
+
controller: controller_name
|
75
|
+
## Controller name for the link. Default value is agile.
|
76
|
+
action: action_name
|
77
|
+
## Action name for the link. Most common values are new, edit and run. Default value is index.<br>
|
78
|
+
## More about run action read below at ajax action description.
|
79
|
+
table: table_name
|
80
|
+
## Table name which which will be used by the AgileRails dialog.
|
81
|
+
form_name: form_name
|
82
|
+
## Form name which which will be used by AgileRails dialog.
|
83
|
+
params:
|
84
|
+
## Additional parameters that will be used by action. Parameters are specified by name and then by the method how they can
|
85
|
+
## be retrieved. In the example below additional p_parents_ids parameter will be added to link. The value will be
|
86
|
+
## retrieved from Rails internals params object and the metod(value) will be ids. Written as example: link_to(..., p_parent_ids: params['ids'])<br>
|
87
|
+
## Parameters starting with p_ are hidden bonus. If loaded form uses field parent_ids its value will initially be filled with p_parent_ids value.
|
88
|
+
p_parent_ids:
|
89
|
+
## Name of the parameter, that will be passed to called program.
|
90
|
+
object: params
|
91
|
+
## Name of the Rails internals object from where value of the parameter will be obtained.
|
92
|
+
## Possible values are: session, params, record, site, page or even class.method. record by default, meaning value will
|
93
|
+
## be acquired from current record.
|
94
|
+
method: ids
|
95
|
+
## Name of the method that will be used to acquire parameter value. In the case of session or params this is value of the key
|
96
|
+
## for the specified parameter.
|
97
|
+
|
98
|
+
url: link_url
|
99
|
+
## Instead of specifying controller/action/table/form_name/params direct URL link can be specified.
|
100
|
+
html:
|
101
|
+
## Any HTML5 data that will be added to final link.
|
102
|
+
class: ar-link-spinner
|
103
|
+
data-confirm: Confirm dialog text.
|
104
|
+
## In this case data confirmation dialog will be opened before action is executed.
|
105
|
+
30:
|
106
|
+
type: popup
|
107
|
+
## Popup window will open when action is clicked. Rest of the options are similar to link options
|
108
|
+
icon: view_timeline-o
|
109
|
+
## Name of the icon defined by material icons in drg_material_icons gem. If icon_name contains dot (.), icon file will be loaded
|
110
|
+
## from assets. If it is preceded by path (/) then it will be loaded from a file system.
|
111
|
+
caption: Events
|
112
|
+
## All captions and labels can also be defined in locals. Trick is to use dot "." in the first 10 characters of text.
|
113
|
+
table: ar_memory
|
114
|
+
## ar_memory is special rails model, which is used to enter data, which is not saved in the database. It can be used to enter
|
115
|
+
## program settings or to specify parameters for programs which will be executed directly or in background etc...
|
116
|
+
## Also notice that action must be set to new, otherwise AgileRails will try to read data from database before the dialog is shown.
|
117
|
+
## Result of the data entry dialog must be processed in the controls file.
|
118
|
+
form_name: form_name
|
119
|
+
## Form name which will be used by AgileRails dialog.
|
120
|
+
action: new
|
121
|
+
## In this case must be new. For more read above table option.
|
122
|
+
params:
|
123
|
+
## In this case called url will contain parameter id which will be acquired from current record id field.
|
124
|
+
id:
|
125
|
+
method: id
|
126
|
+
html:
|
127
|
+
## Any HTML5 data that will be added to final link.
|
128
|
+
|
129
|
+
40:
|
130
|
+
type: window
|
131
|
+
## Popup window will open when action is clicked. Rest of the options are similar to link options
|
132
|
+
icon: view_timeline-o
|
133
|
+
## Name of the icon defined by material icons in drg_material_icons gem. If icon_name contains dot icon file will be specified
|
134
|
+
## from assets. It it is preceded by path then it will be loaded from a file system.
|
135
|
+
caption: Events
|
136
|
+
## All captions and labels can also be defined in locals. Trick is to use dot "." in the first 10 characters of text.
|
137
|
+
table: ar_memory
|
138
|
+
## ar_memory is special rails model, which is used to enter data, which is not saved in the database. It can be used to enter
|
139
|
+
## program settings or to specify parameters for programs which will be executed directly or in background etc...
|
140
|
+
## Also notice that action must be set to new, otherwise AgileRails will try to read data from database before the dialog is shown.
|
141
|
+
## Result of the data entry dialog must be processed in the controls file.
|
142
|
+
form_name: form_name
|
143
|
+
## Form name which which will be used by AgileRails dialog.
|
144
|
+
action: new
|
145
|
+
## In this case must be new. For more read above table option.
|
146
|
+
params:
|
147
|
+
## In this example called url will contain parameter id which will be acquired from current record id field.
|
148
|
+
id:
|
149
|
+
method: id
|
150
|
+
html:
|
151
|
+
## Any HTML5 data that will be added to final link.
|
152
|
+
|
153
|
+
50:
|
154
|
+
type: ajax
|
155
|
+
## XMLHttpRequest will be used to call server program and result of the call will be processed by awaiting script.
|
156
|
+
## Unfortunately for now the best description for DSL used to control return of ajax call can be found in source code in
|
157
|
+
## agile_rails/app/assests/javascripts/agile/agile.js file. Look for process_json_result function.
|
158
|
+
caption: Confirm all selected
|
159
|
+
## All captions and labels can also be defined in locals. Trick is to use dot "." in the first 10 characters of text.
|
160
|
+
icon: check
|
161
|
+
## Name of the icon defined by material icons in drg_material_icons gem. If icon_name contains dot icon file will be specified
|
162
|
+
## from assets. It it is preceded by path then it will be loaded from a file system.
|
163
|
+
action: run
|
164
|
+
## run action is the action that will save space in Rails routes file. Agile run action will
|
165
|
+
## load control file specified by "control" option and then call method specified after the dot. Which is similar
|
166
|
+
## to invoking action in Rails controller.
|
167
|
+
table: table_name
|
168
|
+
## By default ar_memory. Table name is not required but if used, called program will check if the user has the rights to view the data in the table.
|
169
|
+
## Rights to access can also be specified in control file by specifying can_process callback.
|
170
|
+
## If not specified access to ar_memory table defined in "Table access permissions" should block any user which is not logged in.
|
171
|
+
control: SomeControl.method_to_be_called
|
172
|
+
## When processing run action, AgileController will first extend itself with control file and then try to call the specified method.
|
173
|
+
## If the method is not found it will throw an error.
|
174
|
+
method: get, put, post
|
175
|
+
## method defines html method used for the call. Default value is get.
|
176
|
+
|
177
|
+
60:
|
178
|
+
type: menu
|
179
|
+
## Action can also provide a drop_down menu which will be shown when user hovers the action button. It was an idea that
|
180
|
+
## was abandoned later, but the option is still available.
|
181
|
+
caption: Some caption
|
182
|
+
## All captions and labels can also be defined in locals. Trick is to use dot "." in the first 10 characters of text.
|
183
|
+
eval: menu_for_whatever
|
184
|
+
## Evaluate helper method to get the menu data. Menu data must be organized within ul/li html tags.
|
185
|
+
eval: ModulClass.menu_for
|
186
|
+
## or evaluate method in a class to get the menu data. Menu data must be organized within ul/li html tags.
|
187
|
+
|
188
|
+
70:
|
189
|
+
type: field
|
190
|
+
## Actions area can also have data entry fields beside filter entry field. They can be used for quick searching and filtering. They can be processed in controls file by setting javascript trigger on field change.
|
191
|
+
name: field_name
|
192
|
+
## If field_name is already defined in the form section, this is all you need
|
193
|
+
position: right,left
|
194
|
+
## Position of the field on actions area. By default it is positioned on the right side of actions area.
|
195
|
+
|
196
|
+
80:
|
197
|
+
type: field
|
198
|
+
## When field name is not defined in the form section.
|
199
|
+
## All options are the same as defining data entry field in the form section except type parameter, which is renamed to field_type for obvious reason.
|
200
|
+
name: start_date
|
201
|
+
field_type: date_picker
|
202
|
+
position: left
|
203
|
+
# DATA SET
|
204
|
+
|
205
|
+
data_set:
|
206
|
+
## Data set options define the data and how it will be displayed when browsing table. If "type: method" option is used
|
207
|
+
## it can also define use helper method or view partial to display data.
|
208
|
+
type: method
|
209
|
+
## Ruby method will be used to get html content for the view.
|
210
|
+
eval: my_helper_method
|
211
|
+
## html content will be provided by helper.
|
212
|
+
view: path_to/partial
|
213
|
+
## html content will be provided by Rails view partial.
|
214
|
+
|
215
|
+
data_set:
|
216
|
+
## Default data_set options define columns data and how it will be displayed in the view.
|
217
|
+
filter: custom_filter_method
|
218
|
+
## filter option defines method which will be used to filter data in a view. Method must be specified in a control file.
|
219
|
+
## If not specified default_filter method is used. If method is not defined in a control file, filter entered by filter action
|
220
|
+
## is applied to table data.
|
221
|
+
footer: custom_footer_method
|
222
|
+
## When table in a view must contain footer record it can be provided by method defined in footer option. Default value is
|
223
|
+
## default_footer. @footer_record can be specified anywhere in the controls file since it is a class variable. It also need'nt
|
224
|
+
## to be of current record class. It can be an array with elements corresponding to view columns.
|
225
|
+
per_page: 10
|
226
|
+
## Number of rows displayed per page in a view. Default is 25.
|
227
|
+
|
228
|
+
dblclick:
|
229
|
+
## By default when double clicking on a row of a view, show action will be executed, and it will load current form with readonly
|
230
|
+
## option. This action can be overwritten by dblclick option. id parameter is automatically added to called url.
|
231
|
+
table: table_name
|
232
|
+
## Table name which which will be used by the AgileRails dialog.
|
233
|
+
form_name: form_name
|
234
|
+
## Form name which which will be used by AgileRails dialog.
|
235
|
+
action: show
|
236
|
+
## Rails action. Default is get.
|
237
|
+
readonly: 1
|
238
|
+
## Called dialog will be readonly
|
239
|
+
window_close: 1 (close), 2 (history.back)
|
240
|
+
## If specified, this option defines which action will be used for closing called dialog. 1 - will use window.close, 2 - will
|
241
|
+
## use history.back and it can depend on how parent dialog is opened.
|
242
|
+
|
243
|
+
table_style: 'color: green; width: 200%;'
|
244
|
+
## Additional style can be appended to view's table. Use width option to stretch table beyond the viewport.
|
245
|
+
table_class: t-class
|
246
|
+
## Additional class can be appended to view's table.
|
247
|
+
tr_style: 'color: green;'
|
248
|
+
## Additional style can be appended to view's table row.
|
249
|
+
tr_style:
|
250
|
+
## Style can also be defined dynamically with eval option.
|
251
|
+
eval: "record['result'] < 0 ? 'color: red;' : 'color: #000;'"
|
252
|
+
tr_class: tr-class
|
253
|
+
## Specific class can be defined for a view's row.
|
254
|
+
|
255
|
+
actions: standard
|
256
|
+
## Standard data_set actions can be check,edit,show,duplicate,delete and can be configured.
|
257
|
+
actions: standard,edit,show,duplicate,delete
|
258
|
+
## When standard actions are not part of standard definition
|
259
|
+
actions:
|
260
|
+
standard: yes
|
261
|
+
## When you need user defined actions standard actions can also be defined like this.
|
262
|
+
0: check
|
263
|
+
## Special check action will add checkbox to every row and enable processing selected records.
|
264
|
+
## Check action must be defined with the key 0.
|
265
|
+
1: edit
|
266
|
+
2:
|
267
|
+
type: duplicate
|
268
|
+
## Duplicate action will try to duplicate currently selected record. If record has related records in another table they
|
269
|
+
## can be processed by dup_record callback in control file. Newly duplicated record can be accessed as @record before it is saved.
|
270
|
+
dup_fields: name,another_field
|
271
|
+
## When you duplicate record, fields defined as unique will prevent duplication. dup_fields option will add " dup" value to those fields.
|
272
|
+
3:
|
273
|
+
type: delete
|
274
|
+
## In this example standard delete action will have alternative title and icon.
|
275
|
+
title: Delete it
|
276
|
+
icon: trash
|
277
|
+
|
278
|
+
10:
|
279
|
+
## All actions are numbered and are as all other numbered options sorted before being processed. Numbering options
|
280
|
+
## is a hidden feature that allows options to be deleted or updated before the form is processed.<br>
|
281
|
+
## Numbers from 0 to 9 are reserved for standard actions.
|
282
|
+
type: ajax
|
283
|
+
## XMLHttpRequest will be used to call server action and result of the call will be processed by awaiting script.
|
284
|
+
## For more about specifying options for the action see previous ajax action description.
|
285
|
+
icon: check
|
286
|
+
action: run
|
287
|
+
table: table_name
|
288
|
+
control: SomeControl.some_method
|
289
|
+
params:
|
290
|
+
ids:
|
291
|
+
## Value of ids param will be forwarded to called action.
|
292
|
+
object: params
|
293
|
+
method: ids
|
294
|
+
user_id:
|
295
|
+
## Value of user_id field will be acquired from current record.
|
296
|
+
method: user_id
|
297
|
+
design_id:
|
298
|
+
## Value of design_id field will be acquired from landing page data (@page.design_id).
|
299
|
+
object: page
|
300
|
+
method: design_id
|
301
|
+
|
302
|
+
# Look also the above index actions
|
303
|
+
|
304
|
+
# COLUMNS
|
305
|
+
|
306
|
+
columns:
|
307
|
+
## columns option defines which fields from table will be visible in the view.
|
308
|
+
1:
|
309
|
+
## All columns are numbered and are as all other numbered options sorted before being processed. Numbering options
|
310
|
+
## is a hidden feature that allows options to be deleted or updated before the form is processed.<br>
|
311
|
+
name: title
|
312
|
+
## Name of the field from model. This also includes any method defined in a model.
|
313
|
+
width: 25% (none || hidden)
|
314
|
+
## Width of the column. If specified in px strange offsets may occure. Column can also be hidden. Default value is 15%
|
315
|
+
align: left | right | center
|
316
|
+
## Align of the column. Default value is left.
|
317
|
+
style: 'color: red;'
|
318
|
+
## Additional style added to the column.
|
319
|
+
td_class: class-name
|
320
|
+
## Additional class added to the column.
|
321
|
+
td_style:
|
322
|
+
## Similar to style just that the return value can accept valid ruby expression
|
323
|
+
eval: "record.value < 0 ? 'color: red;' : 'color: black;'"
|
324
|
+
## In the example cell will be painted red if value of the field value is less then 0. Otherwise it will be painted in black.
|
325
|
+
2:
|
326
|
+
name: site_id
|
327
|
+
## Name of the field from model. This also includes any method defined in a model.
|
328
|
+
eval: agile_name_for_id,ar_site,name
|
329
|
+
## Option eval will evaluate ruby expression to get the value for the cell. Custom method, which must be defined in Rails helpers,
|
330
|
+
## will receive two parameters. Current record and value of the current field.<br>
|
331
|
+
## Some of the helpers methods, like agile_name_for_id, are predefined and can be written simplified. Method receives two parameters:<br>
|
332
|
+
## model_name : Name of the model<br>
|
333
|
+
## name : name of the field to be returned<br>
|
334
|
+
## agile_name_for_id helper will look into model_name table for record with id = site_id and return the value of the name field.
|
335
|
+
3:
|
336
|
+
name: valid_from
|
337
|
+
## Name of the field from model. This also includes any method defined in a model.
|
338
|
+
format: D
|
339
|
+
## Format date_time in default date format
|
340
|
+
format: '%d.%m.%Y'
|
341
|
+
## Custom date format
|
342
|
+
4:
|
343
|
+
name: number
|
344
|
+
## Name of the field from model. This also includes any method defined in a model.
|
345
|
+
format: N2
|
346
|
+
## Format number with 2 decimals
|
347
|
+
5:
|
348
|
+
name: active
|
349
|
+
eval: agile_icon_for_boolean
|
350
|
+
## Predefined helper for displaying checked or unchecked icon
|
351
|
+
6:
|
352
|
+
name: selected
|
353
|
+
eval: agile_name_for_value
|
354
|
+
## Predefined helper for displaying descriptions instead of values for select fields with choices defined in locales.
|
355
|
+
|
356
|
+
# FORM
|
357
|
+
|
358
|
+
form:
|
359
|
+
## Form option defines input fields and actions for create, edit and show action.
|
360
|
+
title:
|
361
|
+
## If not specified title defined on the top of the form will be used
|
362
|
+
field: description
|
363
|
+
## When editing data value of the field will be displayed in the dialog title. Example: Edit : Pages : My first page
|
364
|
+
title:
|
365
|
+
## Title can also be defined for specific action
|
366
|
+
edit: Title for edit
|
367
|
+
## Title for edit action
|
368
|
+
show: Title for show
|
369
|
+
## Title for show action
|
370
|
+
labels_position: top,left
|
371
|
+
## Labels positions can be defined in configuration, but can be changed in form. Left means labels will be displayed
|
372
|
+
## left of the input field, top will put labels on top of input field.
|
373
|
+
actions_position: top,bottom,both
|
374
|
+
## Actions panel position can be defined in configuration, but can be changed in form. Personally I like actions on top and bottom
|
375
|
+
## of the dialog, especially when data is entered on mobile devices.
|
376
|
+
height: 600
|
377
|
+
## Height of the dialog is dynamically changed every time dialog is created or tab is pressed.
|
378
|
+
## With height you can specify fixed height of the dialog
|
379
|
+
|
380
|
+
actions: standard,back,save,save&back,refresh,enable,new
|
381
|
+
## Forms standard actions are: "back,save,save&back,refresh,enable,new" and can be set in configurations file
|
382
|
+
## configuration options are same as for index and data_set actions.
|
383
|
+
|
384
|
+
actions:
|
385
|
+
## Most of the actions are created the same so everything written above also stands for form actions. There are some options
|
386
|
+
## that make sense only when editing data.
|
387
|
+
10:
|
388
|
+
## All form actions are numbered and are as all other numbered options sorted before being processed. Numbering options
|
389
|
+
## is a hidden feature that allows options to be deleted or updated before the form is processed.<br>
|
390
|
+
## Numbers from 0 to 9 are reserved for standard actions.
|
391
|
+
type: ajax
|
392
|
+
controller: ctrl
|
393
|
+
action: action
|
394
|
+
method: (get),put,post
|
395
|
+
caption: ajax_call
|
396
|
+
control: control_name.method_to_call
|
397
|
+
show: default,always,readonly
|
398
|
+
## Some actions don't make sense when editing record and some don't make sense when record is beeing viewed. If the option is omitted
|
399
|
+
## or option's value is default then action is display only when record is edited. Readonly means that action is displayed ony when
|
400
|
+
## record is show or in readonly mode. Always defines that action is always present.
|
401
|
+
|
402
|
+
active: new_record, not_new_record
|
403
|
+
## Action can be active or disabled. Action will be active when new record is created or record is edited - not_new_record.
|
404
|
+
active:
|
405
|
+
## Activity can be determined by evaluating Ruby expression. In the example below depending on user_id field is present.
|
406
|
+
eval: record.user_id.present?
|
407
|
+
active: SomeClass.is_active_method
|
408
|
+
## Activity can be determined by evaluating a class method. Rails environment is sent as parameter to the called method.
|
409
|
+
active:
|
410
|
+
## Same as above, just different syntax
|
411
|
+
method: SomeClass.is_active_method
|
412
|
+
html:
|
413
|
+
## Any valid HTML5 element can be added to action
|
414
|
+
data-validate: no
|
415
|
+
## Use when there is HTML5 validation active on form input fields and you want to execute action (ex. close dialog)
|
416
|
+
## without data validation.
|
417
|
+
|
418
|
+
20:
|
419
|
+
type: window
|
420
|
+
## This action will open dialog in a new window
|
421
|
+
controller: agile
|
422
|
+
form_name: form
|
423
|
+
table: table
|
424
|
+
action: edit
|
425
|
+
method: (get),put,post
|
426
|
+
caption: Edit linked document
|
427
|
+
params:
|
428
|
+
id:
|
429
|
+
object: record (can be omitted)
|
430
|
+
method: page_id
|
431
|
+
user:
|
432
|
+
object: session
|
433
|
+
method: user_id
|
434
|
+
html:
|
435
|
+
## Any valid HTML5 element can be added to action<br>
|
436
|
+
## In the examples below data-x and data-y options will force new window size to be 800px * 400px
|
437
|
+
data-x: 800
|
438
|
+
data-y: 400
|
439
|
+
data-fields: field1,field2,...
|
440
|
+
## Values of the fields on the current dialog will be used as parameters to the action called.
|
441
|
+
30:
|
442
|
+
type: script
|
443
|
+
## Script action will execute javascript code defined as js: option
|
444
|
+
caption: Cancel
|
445
|
+
js: parent.location.reload();
|
446
|
+
40:
|
447
|
+
type: submit
|
448
|
+
## Submit action will perform form submit.
|
449
|
+
caption: Send
|
450
|
+
value: first_submit
|
451
|
+
## Value for submit can be defined. If not defined value has the value of caption and it might be localized.
|
452
|
+
|
453
|
+
#FIELDS
|
454
|
+
# All input fields defined by agile_rails project can be found in agile_rails/app/models/agile_form_fields folder. You can look
|
455
|
+
# how input fields are defined and create your own data input fields if you need.
|
456
|
+
|
457
|
+
fields:
|
458
|
+
## Here is where the definition of input fields on a form begins. If form has data distributed on tabs then tabs option
|
459
|
+
## is used instead of fields following by first tab name on the next level. From there on definition of input fields on a single tab
|
460
|
+
## is the same as defining input fields with fields option.>br><br>
|
461
|
+
10:
|
462
|
+
## All data entry fields are numbered and are as all other numbered options sorted before being processed. Numbering options
|
463
|
+
## is a hidden feature that allows options to be deleted or updated before the form is processed.<br>
|
464
|
+
# required
|
465
|
+
name: sender_email
|
466
|
+
## Name of the field in the record (table). Field must exist in the table otherwise runtime error will be thrown. To debug
|
467
|
+
## runtime errors you may look at sessions[:form_processing] value, which holds data of the line in which error occurred.<br>
|
468
|
+
## If you want to include fields that are not defined in database table then you must implement two methods to retrieve and assign data
|
469
|
+
## in the model. These methods are def field_name and def field_name=(value)<br><br>
|
470
|
+
## If you want to include fields that are not defined in a tabel model, then field name must be preceded with underscore.
|
471
|
+
## These fields may then be processed in control file in before_save or after_save callbacks like params[:record][:_field_name].
|
472
|
+
# required
|
473
|
+
type: text_field
|
474
|
+
## Implementation of link=https://apidock.com/rails/ActionView/Helpers/FormHelper/text_field,text_field input field.
|
475
|
+
|
476
|
+
# Following options apply to most of the fields
|
477
|
+
|
478
|
+
caption: Name of the label text
|
479
|
+
# or
|
480
|
+
text:
|
481
|
+
# or
|
482
|
+
label:
|
483
|
+
## Caption, text and label options are interchangeable except for some fields like check_box where label is used for label after
|
484
|
+
## the check_box field and caption is used for defining label left from the check_box field.<br><br>
|
485
|
+
## It is better practice to define field labels in Rails locales.
|
486
|
+
help: Some help for the name field
|
487
|
+
## It is better practice to define help text for the fields in Rails locales. Help text is displayed when you hover
|
488
|
+
## the input field label and assembled when you click on help icon.
|
489
|
+
size: 20
|
490
|
+
## Size of the input field
|
491
|
+
group: 2, 3
|
492
|
+
## Group 2 or 3 fields grouped in a row
|
493
|
+
line: top, bottom
|
494
|
+
## Draw a line before or after this field to divide fields into groups. On last implementation lines were replaced visually
|
495
|
+
## just by implementing different CSS rules. But the option name stays the same.
|
496
|
+
readonly: yes | true | 1
|
497
|
+
## If readonly option is specified the field is displayed on a form, but it will not be saved to the table. If you want a
|
498
|
+
## field to be displayed on a form and also to be saved to table then you should use readonly field type.
|
499
|
+
default: 10
|
500
|
+
## There are many ways to initialize value of a field when new record is created. It can be defined in database, in controls file
|
501
|
+
## or it can be defined with default option on the form.
|
502
|
+
default:
|
503
|
+
eval: session[:user_id]
|
504
|
+
## Default value can also be obtained by evaluating any valid ruby expression.
|
505
|
+
|
506
|
+
html:
|
507
|
+
## Anything by html5 standards like the two examples below.
|
508
|
+
style: 'color: red'
|
509
|
+
type: email
|
510
|
+
|
511
|
+
20:
|
512
|
+
type: action
|
513
|
+
## Action button can also me placed anywhere on the form. Everything written for previous actions is also valid for action buttons on the form.
|
514
|
+
action_type: popup,ajax,window,popup,link,submit
|
515
|
+
## Since type option is reserved for type of field, action_type option defines type of the action.
|
516
|
+
caption: Export data
|
517
|
+
icon: icon_name
|
518
|
+
action: new
|
519
|
+
method: get
|
520
|
+
form_name: data_export
|
521
|
+
table: ar_memory
|
522
|
+
params:
|
523
|
+
table_name:
|
524
|
+
object: params
|
525
|
+
method: table
|
526
|
+
|
527
|
+
30:
|
528
|
+
name: ar_parts
|
529
|
+
type: belongs_to
|
530
|
+
## It is possible to edit main table record and table which holds related records on the same form. The form for editing
|
531
|
+
## related data is loaded into its own iframe on the main form. When primary form is reloaded secondary form is also reloaded. When related
|
532
|
+
## table has no need for control file, belongs_to_control can be used, to default_filter only data belonging to parent record and to
|
533
|
+
## assign parent's id to parent_id field when record is saved. If not, the logic must be implemented in custom control file.
|
534
|
+
belongs_to: ar_page
|
535
|
+
## Name of the model to whom this table is related to.
|
536
|
+
form_name: ar_part
|
537
|
+
## Form name that will be used to edit related data.
|
538
|
+
refresh: default,delay,always
|
539
|
+
## By default iframe displaying related table will resize itself according to the size of data. But there is a problem with browsers
|
540
|
+
## which can't retrieve size of the objects that are hidden on the tabs. Refresh option defines when iframe will be updated.
|
541
|
+
## Possible values are: default : on creation, delay : when parent tab is first selected, always : always when tab is clicked.
|
542
|
+
|
543
|
+
40:
|
544
|
+
name: status
|
545
|
+
type: check_box
|
546
|
+
## Implementation of link=https://apidock.com/rails/ActionView/Helpers/FormHelper/check_box,check_box input field.
|
547
|
+
choices: yes,no
|
548
|
+
## It is preferred to define choices in Rails locales. If the field is boolean type, then choices option can be omitted.
|
549
|
+
checked_value: yes
|
550
|
+
## The same as above together with option below. Just a longer version.
|
551
|
+
unchecked_value: no
|
552
|
+
label: label
|
553
|
+
## Checkbox field may have a label written right to the check box. If used, set text to blank like in the example below.
|
554
|
+
text: ' '
|
555
|
+
html:
|
556
|
+
## Anything by html5 standards that apply to check_box
|
557
|
+
|
558
|
+
50:
|
559
|
+
type: comment
|
560
|
+
## Comment type will simply output text into edit form.
|
561
|
+
text: myapp.comment_text
|
562
|
+
## Text to be displayed.
|
563
|
+
caption: false
|
564
|
+
## If you want the comment to spread from left to right site of the form set caption to false.
|
565
|
+
html:
|
566
|
+
## Anything by html5 standards
|
567
|
+
style: 'color: red'
|
568
|
+
class: some_class
|
569
|
+
|
570
|
+
60:
|
571
|
+
name: date_begin
|
572
|
+
type: date_picker
|
573
|
+
## Implementation of input field for selecting date. The implementation uses link=https://xdsoft.net/jqplugins/datetimepicker/,DateTimePicker javascript library.
|
574
|
+
## Link also shows different options that can be used by date_picker input field.
|
575
|
+
options: 'inline: true'
|
576
|
+
|
577
|
+
70:
|
578
|
+
name: valid_date
|
579
|
+
type: date_select
|
580
|
+
## Implementation of link=https://apidock.com/rails/ActionView/Helpers/DateHelper/date_select,date_select input field.
|
581
|
+
options:
|
582
|
+
include_blank: true
|
583
|
+
html:
|
584
|
+
|
585
|
+
80:
|
586
|
+
name: start_at
|
587
|
+
type: datetime_picker
|
588
|
+
## Implementation of input field for selecting time. The implementation uses link=https://xdsoft.net/jqplugins/datetimepicker/,DateTimePicker javascript library.
|
589
|
+
## Link also shows different options that can be used by datetime_picker input field.
|
590
|
+
options: 'step: 60, inline: true'
|
591
|
+
# or
|
592
|
+
options:
|
593
|
+
step: 60
|
594
|
+
inline: true
|
595
|
+
html:
|
596
|
+
|
597
|
+
90:
|
598
|
+
name: end_time
|
599
|
+
type: datetime_select
|
600
|
+
## Implementation of link=https://apidock.com/rails/ActionView/Helpers/DateHelper/datetime_select,datetime_select input field.
|
601
|
+
options:
|
602
|
+
include_blank: true
|
603
|
+
html:
|
604
|
+
|
605
|
+
100:
|
606
|
+
name: title
|
607
|
+
type: file_field
|
608
|
+
## Implementation of link=https://apidock.com/rails/ActionView/Helpers/FormHelper/file_field,file_field input field. The logic for extracting
|
609
|
+
## data and process file must be done in control file. Best in before_save callback.
|
610
|
+
size: 30
|
611
|
+
html:
|
612
|
+
|
613
|
+
110:
|
614
|
+
name: picture
|
615
|
+
type: file_select
|
616
|
+
## File select input field use file manager to manage files on server. You can read more about how to configure
|
617
|
+
## file manager object in agile_rails/app/models/agile_form_fields/file_select.rb file.<br>
|
618
|
+
## Agile Rails provides agile_rails_html_editor gem, which includes link=https://github.com/Studio-42/elFinder,elFinder javascript file manager.
|
619
|
+
size: 50
|
620
|
+
|
621
|
+
120:
|
622
|
+
name: im_hidden
|
623
|
+
type: hidden_field
|
624
|
+
## Implementation of link=https://apidock.com/rails/ActionView/Helpers/FormHelper/hidden_field,hidden_field input field.
|
625
|
+
## Hidden fields are not visible on the dialog, but their value will be saved to the database like any other field.
|
626
|
+
|
627
|
+
130:
|
628
|
+
name: body
|
629
|
+
type: html_field
|
630
|
+
## html_field should start ritch text editor for editing data in table field. You can read more about how to configure
|
631
|
+
## html_field object in agile_rails/app/models/agile_form_fields/html_field.rb file.<br>
|
632
|
+
## Agile Rails provides agile_rails_html_editor gem, which includes link=https://ckeditor.com,CKEditor javascript rich text editor.
|
633
|
+
options: "height: 500, width: 550, toolbar: 'basic'"
|
634
|
+
|
635
|
+
140:
|
636
|
+
type: link_to
|
637
|
+
## Same as type: action, action_type: link. It was created so it can be used on poll forms.
|
638
|
+
caption: Some action
|
639
|
+
icon: cogs
|
640
|
+
controller: my_controller
|
641
|
+
action: my_action
|
642
|
+
id: id # will be replaced by record.id
|
643
|
+
# or
|
644
|
+
url: /some/url
|
645
|
+
|
646
|
+
150:
|
647
|
+
name: galery
|
648
|
+
type: method
|
649
|
+
## Type Method will call method defined in helpers or in Class and paint it's return. Useful when you want to display some complex data
|
650
|
+
## or create a custom input field, without creating agile_form_fields object.
|
651
|
+
eval: show_gallery
|
652
|
+
## Method defined in a helper
|
653
|
+
eval: MyClass.show_gallery
|
654
|
+
## Method defined in a class
|
655
|
+
|
656
|
+
160:
|
657
|
+
name: kategories
|
658
|
+
type: multitext_autocomplete
|
659
|
+
## Multitext autocomplete is complex input field which uses autocomplete function to add values to the list of values. It
|
660
|
+
## can be used where select with multiple option or tree_select have too many options. It receives and returns data as Array object.
|
661
|
+
search:
|
662
|
+
table: ar_site
|
663
|
+
field: name
|
664
|
+
## Data for autocomplete function will be searched in ar_site model and field name will be returned as description.
|
665
|
+
table: ar_site
|
666
|
+
search: name
|
667
|
+
## Same as above just shorter
|
668
|
+
search: ar_site.name
|
669
|
+
## Same as above in single line
|
670
|
+
search: ModelClass..method_name
|
671
|
+
## Autocomplete can also call custom method defined in a model class. It is important that the method is defined in a Model Class
|
672
|
+
## since autocomplete checks if the user has view rights to the table. Method will receive currently typed characters into
|
673
|
+
## input field and must return array of possible choices [[text, id], [text, id], ....]
|
674
|
+
with_new: ar_site
|
675
|
+
## If a record is not found in searched table, dialog for entering new record into table can be invoked in a new window.
|
676
|
+
## It is assumed that table and form_name are the same.
|
677
|
+
size: 30
|
678
|
+
|
679
|
+
170:
|
680
|
+
name: value
|
681
|
+
type: number_field
|
682
|
+
## Implementation of field for entering numbers or values. Entering whole numbers can be done with text_field, but for
|
683
|
+
## entering decimal numbers or to display thousands delimiters number_field should be used.
|
684
|
+
size: 10
|
685
|
+
format:
|
686
|
+
## Which characters are used for formating is defined in Rails locales. Here we define number of decimals and if thousands
|
687
|
+
## delimiter will be present or not.
|
688
|
+
decimals: 2
|
689
|
+
delimiter: false
|
690
|
+
format: N2
|
691
|
+
## Short version. Thousand delimiter will be present.
|
692
|
+
|
693
|
+
180:
|
694
|
+
name: password
|
695
|
+
type: pasword_field
|
696
|
+
## Implementation of link=https://apidock.com/rails/ActionView/Helpers/FormHelper/password_field,password_field input field.
|
697
|
+
size: 10
|
698
|
+
|
699
|
+
200:
|
700
|
+
name: hifi
|
701
|
+
type: radio_button
|
702
|
+
## Implementation of link=https://apidock.com/rails/ActionView/Helpers/FormHelper/radio_button,radio_button input field.
|
703
|
+
choices: 'Marantz:1,Sony:2,Bose:3,Pioneer:4'
|
704
|
+
## It is preferred to define choices in Rails locales. For variations of defining choices see select input field.
|
705
|
+
inline: true
|
706
|
+
## By default choices are displayed stacked. If inline option is set to true, they are displayed inline.
|
707
|
+
|
708
|
+
210:
|
709
|
+
name: user
|
710
|
+
type: readonly
|
711
|
+
## Readonly input field is displayed on the form but it's value will not be saved to database on save action.
|
712
|
+
name: user_id
|
713
|
+
## In this example readonly field will display user's name instead of the value of user_id field.
|
714
|
+
eval: agile_name_for_id,ar_user,name
|
715
|
+
|
716
|
+
220:
|
717
|
+
name: type
|
718
|
+
type: select
|
719
|
+
## Implementation of link=https://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/select,select input field.
|
720
|
+
choices: helpers.label.model.choices_for_field
|
721
|
+
## It is preferred to define choices for select in Rails locales. When choices option is omitted choices will be obtained
|
722
|
+
## from helpers.label.model.choices_for_field_name Rails locale. But can also be defined in any locale like in this example.
|
723
|
+
choices: Audi,BMW,Mercedes
|
724
|
+
## Choices for select defined in a form
|
725
|
+
selected: BMW
|
726
|
+
## BMW choice will be selected
|
727
|
+
choices: Audi:1,BMW:2,Mercedes:3
|
728
|
+
selected: 2
|
729
|
+
## In this case text will bi shown to user but value will be written to database.
|
730
|
+
choices:
|
731
|
+
## Choices for select will be acquired by evaluating valid ruby expression. Return of the expression can be array with single elements
|
732
|
+
## or array containing arrays with two elements. [[text1, value1], [text2, value2], ...]
|
733
|
+
eval: ArCategory.values_for_env
|
734
|
+
depend: company,another_field
|
735
|
+
## Value of the select field may depend on the value of other fields on a form. When the value of depend field changes
|
736
|
+
## the choices for select field will also change. In the background autocomplete function is used so choices for the
|
737
|
+
## select must be obtained by evaluating ruby expression. Called method will receive value of the depend field. If field depends
|
738
|
+
## on more then one fields then parameter will bi divided with the comma.
|
739
|
+
include_blank: Select car
|
740
|
+
## Select input field can have a blank choice available.
|
741
|
+
|
742
|
+
230:
|
743
|
+
type: submit_tag
|
744
|
+
## Like link_to, submit_tag can also be putted anywhere on the form. This is implementation of
|
745
|
+
## Rails link=https://apidock.com/rails/ActionView/Helpers/FormBuilder/submit,submit field.
|
746
|
+
caption: translate.this
|
747
|
+
icon: check
|
748
|
+
|
749
|
+
240:
|
750
|
+
name: css
|
751
|
+
type: text_area
|
752
|
+
size: 100x30
|
753
|
+
html:
|
754
|
+
# anything by html5 standards
|
755
|
+
|
756
|
+
250:
|
757
|
+
name: user_id
|
758
|
+
type: text_autocomplete
|
759
|
+
search: ar_user.name
|
760
|
+
search: Class..some_method
|
761
|
+
search:
|
762
|
+
table: ar_user
|
763
|
+
field: name
|
764
|
+
method: some_method
|
765
|
+
is_id: false
|
766
|
+
size: 30
|
767
|
+
with_new: ar_user
|
768
|
+
with_edit: ar_user
|
769
|
+
|
770
|
+
260:
|
771
|
+
name: title
|
772
|
+
type: text_field
|
773
|
+
size: 30
|
774
|
+
html:
|
775
|
+
required: yes
|
776
|
+
# and anything by html5 standards
|
777
|
+
|
778
|
+
270:
|
779
|
+
name: link
|
780
|
+
type: text_with_select
|
781
|
+
choices: eval @env.agile_page_class.all_pages_for_site(@env.agile_get_site)
|
782
|
+
size: 50
|
783
|
+
|
784
|
+
280:
|
785
|
+
name: categories
|
786
|
+
type: tree_select
|
787
|
+
choices: eval Categories.all_categories
|
788
|
+
multiple: true
|
789
|
+
parent_disabled: false
|
790
|
+
parent_opened: false
|
791
|
+
size: 50x10
|
792
|
+
|
793
|
+
# tabbed input form
|
794
|
+
|
795
|
+
tabs:
|
796
|
+
tab1:
|
797
|
+
caption: my_caption
|
798
|
+
caption: helpers.label.table.tab1
|
799
|
+
|
800
|
+
10:
|
801
|
+
name: name
|
802
|
+
type: text_field
|
803
|
+
size: 50
|
804
|
+
|
805
|
+
# any AgileRails form field definition same as with fields
|
806
|
+
|
807
|
+
tab2:
|
808
|
+
# any AgileRails form field definition same as with fields
|
809
|
+
tab3:
|
810
|
+
##
|