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,23 @@
|
|
1
|
+
class ArPollItem < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_poll_items do |t|
|
4
|
+
t.string :name, default: ''
|
5
|
+
t.string :text, default: ''
|
6
|
+
t.string :field_type, default: ''
|
7
|
+
t.string :size, default: '10'
|
8
|
+
t.boolean :mandatory, default: false
|
9
|
+
t.string :separator, default: ''
|
10
|
+
t.string :options, default: ''
|
11
|
+
t.integer :order, default: 0
|
12
|
+
|
13
|
+
t.integer :ar_poll_id
|
14
|
+
t.boolean :active, default: true
|
15
|
+
|
16
|
+
t.integer :created_by
|
17
|
+
t.integer :updated_by
|
18
|
+
t.timestamps
|
19
|
+
|
20
|
+
t.index :ar_poll_id
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class ArRemovedUrl < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_removed_urls do |t|
|
4
|
+
t.string :url
|
5
|
+
t.string :description
|
6
|
+
t.integer :created_by
|
7
|
+
t.integer :updated_by
|
8
|
+
t.integer :ar_site_id
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
|
12
|
+
t.index :ar_site_id
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class ArRole < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_roles do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :system_name
|
6
|
+
t.boolean :active, default: true
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
t.integer :created_by
|
10
|
+
t.integer :updated_by
|
11
|
+
|
12
|
+
t.index :name, :unique=>true
|
13
|
+
t.index :system_name
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class ArSite < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_sites do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :description
|
6
|
+
t.string :homepage_link
|
7
|
+
t.string :error_link
|
8
|
+
t.string :header
|
9
|
+
t.string :css
|
10
|
+
t.string :route_name
|
11
|
+
t.string :page_title
|
12
|
+
t.string :page_class, default: 'ArPage'
|
13
|
+
t.string :site_layout, default: 'content'
|
14
|
+
t.string :menu_class, default: 'ArMenu'
|
15
|
+
t.string :request_processor
|
16
|
+
t.string :files_directory
|
17
|
+
t.string :logo
|
18
|
+
t.string :favicon
|
19
|
+
t.string :menu_name
|
20
|
+
t.integer :menu_id
|
21
|
+
t.string :settings
|
22
|
+
t.string :alias_for
|
23
|
+
t.string :rails_view
|
24
|
+
t.string :design
|
25
|
+
t.integer :inherit_policy
|
26
|
+
|
27
|
+
t.boolean :active, default: true
|
28
|
+
t.timestamps
|
29
|
+
t.integer :created_by
|
30
|
+
t.integer :updated_by
|
31
|
+
|
32
|
+
t.index :name, unique: true
|
33
|
+
t.index :alias_for
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
class ArUser < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_users do |t|
|
4
|
+
t.string :username, default: ''
|
5
|
+
t.string :title, default: ''
|
6
|
+
t.string :first_name, default: ''
|
7
|
+
t.string :middle_name, default: ''
|
8
|
+
t.string :last_name, default: ''
|
9
|
+
t.string :name
|
10
|
+
t.string :company, default: ''
|
11
|
+
t.string :address
|
12
|
+
t.string :post
|
13
|
+
t.string :country
|
14
|
+
t.string :phone
|
15
|
+
t.string :email
|
16
|
+
t.string :www
|
17
|
+
t.string :picture
|
18
|
+
t.date :birthdate
|
19
|
+
t.string :about
|
20
|
+
t.datetime :last_visit
|
21
|
+
t.boolean :active, default: true
|
22
|
+
t.date :valid_from
|
23
|
+
t.date :valid_to
|
24
|
+
t.boolean :group, default: false
|
25
|
+
t.string :signature
|
26
|
+
t.string :interests
|
27
|
+
t.string :job_occup
|
28
|
+
t.string :description
|
29
|
+
t.date :reg_date
|
30
|
+
t.string :password_digest
|
31
|
+
|
32
|
+
t.timestamps
|
33
|
+
t.integer :created_by
|
34
|
+
t.integer :updated_by
|
35
|
+
|
36
|
+
t.index :username, unique: true
|
37
|
+
t.index :email, unique: true
|
38
|
+
t.index :group
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class ArUserRole < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_user_roles do |t|
|
4
|
+
t.integer :ar_role_id
|
5
|
+
t.integer :ar_user_id
|
6
|
+
t.date :valid_from
|
7
|
+
t.date :valid_to
|
8
|
+
t.boolean :active, default: true
|
9
|
+
|
10
|
+
t.integer :created_by
|
11
|
+
t.integer :updated_by
|
12
|
+
t.timestamps
|
13
|
+
|
14
|
+
t.index [:ar_user_id, :ar_role_id], name: 'index_ar_user_roles_1'
|
15
|
+
t.index [:ar_role_id, :ar_user_id], name: 'index_ar_user_roles_2'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class ArVisit < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_visits do |t|
|
4
|
+
t.integer :page_id
|
5
|
+
t.integer :user_id
|
6
|
+
t.integer :site_id
|
7
|
+
t.string :session_id
|
8
|
+
t.string :ip
|
9
|
+
t.datetime :time
|
10
|
+
|
11
|
+
t.index :time
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class ArSetup < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_setups do |t|
|
4
|
+
t.string :name
|
5
|
+
t.text :data
|
6
|
+
t.text :form
|
7
|
+
t.string :edit_ids
|
8
|
+
|
9
|
+
t.integer :created_by
|
10
|
+
t.integer :updated_by
|
11
|
+
t.timestamps
|
12
|
+
|
13
|
+
t.index :name
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class ArFolderPermission < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_folder_permissions do |t|
|
4
|
+
t.string :folder_name
|
5
|
+
t.boolean :inherited, default: true
|
6
|
+
t.boolean :active, default: true
|
7
|
+
|
8
|
+
t.integer :created_by
|
9
|
+
t.integer :updated_by
|
10
|
+
t.timestamps
|
11
|
+
|
12
|
+
t.index :folder_name, unique: true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class ArFolderRule < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_folder_rules do |t|
|
4
|
+
t.references :ar_folder_permission
|
5
|
+
t.belongs_to :ar_role
|
6
|
+
t.integer :permission, default: 0
|
7
|
+
t.boolean :active, default: true
|
8
|
+
|
9
|
+
t.integer :created_by
|
10
|
+
t.integer :updated_by
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class ArImage < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :ar_images do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :img_type
|
6
|
+
t.string :text
|
7
|
+
t.string :short
|
8
|
+
t.boolean :keep_original, default: false
|
9
|
+
t.string :size_o
|
10
|
+
t.string :size_l
|
11
|
+
t.string :size_m
|
12
|
+
t.string :size_s
|
13
|
+
t.integer :page_id
|
14
|
+
t.string :keywords
|
15
|
+
|
16
|
+
t.integer :ar_site_id
|
17
|
+
t.integer :created_by
|
18
|
+
t.timestamps
|
19
|
+
|
20
|
+
t.index :ar_site_id
|
21
|
+
t.index :created_by
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2023+ Damjan Rems
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
module Agile
|
25
|
+
class Configuration
|
26
|
+
|
27
|
+
def self.defaults
|
28
|
+
default = {}
|
29
|
+
# 1: new, 2: filter, 3: sort
|
30
|
+
default[:index_standard_actions] = { 1 => 'new', 3 => 'filter' }
|
31
|
+
# 1: edit, 2: duplicate, 3: delete
|
32
|
+
default[:dataset_standard_actions] = { 1 => 'edit', 3 => 'delete' }
|
33
|
+
# 1: back, 2: save, 3: save&back, 4: refresh, 5: enable, 6:new
|
34
|
+
default[:form_standard_actions] = { 1 => 'cancel', 3 => 'save&back' }
|
35
|
+
# top, bottom, both
|
36
|
+
default[:default_actions_position] = 'top'
|
37
|
+
# top, left
|
38
|
+
default[:default_labels_position] = 'left'
|
39
|
+
default
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
data/lib/agile/engine.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2023+ Damjan Rems
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
module Agile #:nodoc:
|
25
|
+
|
26
|
+
class Engine < ::Rails::Engine #:nodoc:
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2023+ Damjan Rems
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
# Agile gem version
|
25
|
+
module Agile # :nodoc:
|
26
|
+
VERSION = '0.0.0.1'.freeze
|
27
|
+
end
|
data/lib/agile.rb
ADDED
@@ -0,0 +1,282 @@
|
|
1
|
+
require 'agile/engine'
|
2
|
+
require 'agile/version'
|
3
|
+
require 'agile/configuration'
|
4
|
+
|
5
|
+
################################################################################
|
6
|
+
# AgileRails plugin module
|
7
|
+
################################################################################
|
8
|
+
module Agile
|
9
|
+
@@paths = {}
|
10
|
+
@@configuration = nil
|
11
|
+
|
12
|
+
################################################################################
|
13
|
+
# Returns source file name of required model.
|
14
|
+
#
|
15
|
+
# Used wherever end user wants to extend basic Agile model. Model source definition
|
16
|
+
# file is tricky to require since it is included in Agile gem and thus a moving
|
17
|
+
# target. Whenever gem version changes file location changes with it. This way
|
18
|
+
# programmer doesn't have to care about actual source file location.
|
19
|
+
#
|
20
|
+
# Parameters:
|
21
|
+
# [ model_name ] String. Must be passed in lower case, just like the file name is.
|
22
|
+
#
|
23
|
+
# Example:
|
24
|
+
# require Agile.model 'ar_page'
|
25
|
+
#
|
26
|
+
###############################################################################
|
27
|
+
def self.model(model_name)
|
28
|
+
File.expand_path("../../app/models/#{model_name}.rb", __FILE__)
|
29
|
+
end
|
30
|
+
|
31
|
+
###############################################################################
|
32
|
+
# If new_value is nil method will return current value of application configuration. Otherwise
|
33
|
+
# it will set new value to the configurations.
|
34
|
+
#
|
35
|
+
# @param [Object] what : Config name
|
36
|
+
# @param [Object] new_value : new config value. Default = nil.
|
37
|
+
###############################################################################
|
38
|
+
def self.config(what, new_value = nil)
|
39
|
+
@@configuration ||= Agile::Configuration.defaults
|
40
|
+
if new_value
|
41
|
+
@@configuration[what.to_sym] = new_value
|
42
|
+
else
|
43
|
+
@@configuration[what.to_sym]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
###############################################################################
|
48
|
+
# When new plugin with its own AgileRails forms is added to application, path to
|
49
|
+
# forms directory must be sent to Agile module. Paths are saved into @@paths hash variable.
|
50
|
+
#
|
51
|
+
# Adding path is best done in plugin module initialization code.
|
52
|
+
#
|
53
|
+
# Parameters:
|
54
|
+
# [path] String. Path to forms directory
|
55
|
+
#
|
56
|
+
# Example:
|
57
|
+
# # As used in MyPlugin plugin.
|
58
|
+
# require "my_plugin/engine"
|
59
|
+
# module MyPlugin
|
60
|
+
# end
|
61
|
+
#
|
62
|
+
# Agile.add_forms_path File.expand_path("../../app/forms", __FILE__)
|
63
|
+
###############################################################################
|
64
|
+
def self.add_forms_path(path)
|
65
|
+
if @@paths[:forms].nil?
|
66
|
+
@@paths[:forms] = []
|
67
|
+
# Agile forms path
|
68
|
+
@@paths[:forms] << File.expand_path('../../app/forms', __FILE__)
|
69
|
+
end
|
70
|
+
@@paths[:forms] << path
|
71
|
+
end
|
72
|
+
|
73
|
+
###############################################################################
|
74
|
+
# Not used anymore!
|
75
|
+
#
|
76
|
+
# Patching is one of the rubies best strenghts and also its curse. Loading
|
77
|
+
# patches in development has become real problem for developers. This is my
|
78
|
+
# way of patch loading.
|
79
|
+
#
|
80
|
+
# Preferred location for patch files is lib/patches. But can be located anywhere in
|
81
|
+
# Rails application path. Add Agile.add_forms_path to initialization part and pass
|
82
|
+
# directory name where patching files are located as parameter.
|
83
|
+
#
|
84
|
+
# Method will also load patch file so loading in config/initializers is not required.
|
85
|
+
#
|
86
|
+
# Parameters:
|
87
|
+
# [path] String. Path to patches directory
|
88
|
+
#
|
89
|
+
# Example:
|
90
|
+
# # As used in MyPlugin plugin.
|
91
|
+
# require "my_plugin/engine"
|
92
|
+
# module MyPlugin
|
93
|
+
# end
|
94
|
+
#
|
95
|
+
# Agile.add_patches_path File.dirname(__FILE__) + '/patches'
|
96
|
+
###############################################################################
|
97
|
+
def self.add_patches_path(path)
|
98
|
+
self.add_path(:patches, path)
|
99
|
+
# Dir["#{path}/**/*.rb"].each { |path| p path; require_dependency path }
|
100
|
+
# Dir["#{path}/**/*.rb"].each { |file| p file; require file }
|
101
|
+
end
|
102
|
+
|
103
|
+
###############################################################################
|
104
|
+
# General add path method. Paths are saved into @@paths hash variable. Paths can
|
105
|
+
# then be reused in different parts of application.
|
106
|
+
#
|
107
|
+
# Adding paths is best done in plugin mudule initialization code.
|
108
|
+
#
|
109
|
+
# Parameters:
|
110
|
+
# [type] Symbol. Defines type of data. Current used values are :forms, :patches
|
111
|
+
# [path] String. Path or string which will be added to @@paths hash.
|
112
|
+
#
|
113
|
+
# Example:
|
114
|
+
# Agile.add_path(File.expand_path('patches', __FILE__), :patches)
|
115
|
+
###############################################################################
|
116
|
+
def self.add_path(type, path)
|
117
|
+
@@paths[type] ||= []
|
118
|
+
@@paths[type] << path
|
119
|
+
end
|
120
|
+
|
121
|
+
###############################################################################
|
122
|
+
# Will return value saved to internal @@paths hash.
|
123
|
+
#
|
124
|
+
# Parameters:
|
125
|
+
# [key] String. Key
|
126
|
+
#
|
127
|
+
# forms_paths = Agile.paths(:forms)
|
128
|
+
# patches_paths = Agile.paths(:patches)
|
129
|
+
###############################################################################
|
130
|
+
def self.paths(key)
|
131
|
+
@@paths[key]
|
132
|
+
end
|
133
|
+
|
134
|
+
###############################################################################
|
135
|
+
# Will return name of file relative to agile_rails gem root
|
136
|
+
###############################################################################
|
137
|
+
def self.from_root(file = nil)
|
138
|
+
File.expand_path("../../#{file}", __FILE__).to_s
|
139
|
+
end
|
140
|
+
|
141
|
+
####################################################################
|
142
|
+
# Checks if any errors exist on document and writes error log. It can also
|
143
|
+
# crash if requested. This is mostly usefull in development for debuging
|
144
|
+
# model errors or when updating multiple collections and each save must be
|
145
|
+
# checked if succesfull.
|
146
|
+
#
|
147
|
+
# @param [Document] Document object which will be checked
|
148
|
+
# @param [Boolean] If true method should end in runtime error. Default = false.
|
149
|
+
#
|
150
|
+
# @return [String] Error messages or empty string if everything is OK.
|
151
|
+
#
|
152
|
+
# @Example Check for error when data is saved.
|
153
|
+
# model.save
|
154
|
+
# if (msg = Agile.model_check(model) ).size > 0
|
155
|
+
# p msg
|
156
|
+
# error process ......
|
157
|
+
# end
|
158
|
+
#
|
159
|
+
####################################################################
|
160
|
+
def self.model_check(document, crash = false)
|
161
|
+
return unless document.errors.any?
|
162
|
+
|
163
|
+
msg = document.errors.inject('') { |r, error| r << "#{error.attribute}: #{error.message}\n" }
|
164
|
+
if crash && msg.size > 0
|
165
|
+
msg = "Validation errors in #{document.class}:\n" + msg
|
166
|
+
pp msg
|
167
|
+
Rails.logger.error(msg)
|
168
|
+
raise 'Validation error. See log for more information.'
|
169
|
+
end
|
170
|
+
msg
|
171
|
+
end
|
172
|
+
|
173
|
+
########################################################################
|
174
|
+
# Determines if redis cache store is active
|
175
|
+
#
|
176
|
+
# @return [Boolean] : True if redis cache store is active
|
177
|
+
########################################################################
|
178
|
+
def self.redis_cache_store?
|
179
|
+
(Rails.application.config.cache_store.first == :redis_cache_store) rescue false
|
180
|
+
end
|
181
|
+
|
182
|
+
####################################################################
|
183
|
+
# Clear cache. If key is specified only this key will be deleted.
|
184
|
+
#
|
185
|
+
# @param [String] Optional key to be deleted
|
186
|
+
####################################################################
|
187
|
+
def self.cache_clear(key = nil)
|
188
|
+
return Rails.cache.clear if key.nil?
|
189
|
+
|
190
|
+
if redis_cache_store?
|
191
|
+
Rails.cache.redis.del(key)
|
192
|
+
else
|
193
|
+
Rails.cache.delete_matched("#{key}*")
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
####################################################################
|
198
|
+
# Read from cache
|
199
|
+
#
|
200
|
+
# @keys [Array] Array of keys
|
201
|
+
#
|
202
|
+
# @return [Object] Data returned from cache
|
203
|
+
####################################################################
|
204
|
+
def self.cache_read(keys)
|
205
|
+
data = if redis_cache_store?
|
206
|
+
tmp_keys = keys.dup
|
207
|
+
first_key = tmp_keys.shift
|
208
|
+
cached = Rails.cache.redis.hget(first_key, tmp_keys.join(''))
|
209
|
+
cached ? Marshal.load(cached) : nil
|
210
|
+
else
|
211
|
+
Rails.cache.read(keys.join(''))
|
212
|
+
end
|
213
|
+
return data if data
|
214
|
+
return unless block_given?
|
215
|
+
|
216
|
+
cache_write(keys, yield)
|
217
|
+
end
|
218
|
+
|
219
|
+
####################################################################
|
220
|
+
# Write data to cache
|
221
|
+
#
|
222
|
+
# @param [Array] keys : array of keys
|
223
|
+
# @param [Object] data : Document object
|
224
|
+
#
|
225
|
+
# @return [Object] data so cache_write can be used as last statement in method.
|
226
|
+
####################################################################
|
227
|
+
def self.cache_write(keys, data)
|
228
|
+
if redis_cache_store?
|
229
|
+
tmp_keys = keys.dup
|
230
|
+
first_key = tmp_keys.shift
|
231
|
+
Rails.cache.redis.hset(first_key, tmp_keys.join(''), Marshal.dump(data))
|
232
|
+
else
|
233
|
+
Rails.cache.write(keys.join(''), data)
|
234
|
+
end
|
235
|
+
data
|
236
|
+
end
|
237
|
+
|
238
|
+
########################################################################
|
239
|
+
# Will dump exception to rails log and console.
|
240
|
+
#
|
241
|
+
# Parameters:
|
242
|
+
# [exception] Object: Exception caught
|
243
|
+
########################################################################
|
244
|
+
def self.dump_exception(exception)
|
245
|
+
msg = [exception.message, *exception.backtrace].join($/)
|
246
|
+
pp msg
|
247
|
+
Rails.logger.error msg
|
248
|
+
end
|
249
|
+
|
250
|
+
###############################################################################
|
251
|
+
# All Routes required by agile_rails.
|
252
|
+
#
|
253
|
+
# Usage:
|
254
|
+
# put Agile.routes line anywhere into your application routes file
|
255
|
+
###############################################################################
|
256
|
+
def self.routes
|
257
|
+
Rails.application.routes.draw do
|
258
|
+
controller :agile_common do
|
259
|
+
post 'agile/autocomplete' => :autocomplete
|
260
|
+
post 'agile_common/ad_click' => :ad_click
|
261
|
+
get 'agile/toggle_edit_mode' => :toggle_edit_mode
|
262
|
+
match 'agile_common/process_login' => :process_login, via: [:put, :post]
|
263
|
+
get 'agile_common/login' => :login
|
264
|
+
get 'agile_common/logout' => :logout
|
265
|
+
get 'agile_common/copy_clipboard' => :copy_clipboard
|
266
|
+
match 'agile_common/paste_clipboard' => :paste_clipboard, via: [:get, :post]
|
267
|
+
put 'agile_common/restore_from_journal' => :restore_from_journal
|
268
|
+
get 'agile_common/add_json_ld_schema' => :add_json_ld_schema
|
269
|
+
get 'agile_common/help' => :help
|
270
|
+
put 'agile_common/poll_submit' => :poll_submit
|
271
|
+
end
|
272
|
+
|
273
|
+
match 'elfinder' => 'agile_elfinder#connector', via: [:get, :post]
|
274
|
+
get 'agile/login' => 'agile#login'
|
275
|
+
get 'agile/logout' => 'agile#logout'
|
276
|
+
match 'agile/run' => 'agile#run', via: [:get, :put, :post]
|
277
|
+
|
278
|
+
resources :agile
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
end
|
data/lib/agile_rails.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'agile'
|