kirgudu_base 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/kirgudu_base/dynamicEvents.js +2 -1
- data/app/assets/javascripts/kirgudu_base/jquery.container-management.js +241 -0
- data/app/assets/javascripts/kirgudu_base/jquery.fancybox copia.js +2020 -0
- data/app/assets/javascripts/kirgudu_base/scripts_nrg.js +300 -383
- data/app/controllers/kirgudu_base/admin_controller.rb +1 -44
- data/app/controllers/kirgudu_base/application_controller.rb +135 -92
- data/app/controllers/kirgudu_base/cabinet_controller.rb +35 -35
- data/app/controllers/kirgudu_base/security/authentications_controller.rb +452 -0
- data/app/controllers/kirgudu_base/security/email_confirmations_controller.rb +46 -0
- data/app/helpers/kirgudu_base/application_helper.rb +25 -0
- data/app/helpers/kirgudu_base/authentication_form_builder.rb +76 -0
- data/app/helpers/kirgudu_base/controllers/{basic_actions_with_parent.rb → OLD_basic_actions.rb} +39 -54
- data/app/helpers/kirgudu_base/controllers/basic_actions.rb +967 -161
- data/app/helpers/kirgudu_base/controllers/container_items_management_actions.rb +118 -40
- data/app/helpers/kirgudu_base/controllers/container_items_sorting_actions.rb +2 -2
- data/app/helpers/kirgudu_base/controllers/dynamic_pages.rb +147 -11
- data/app/helpers/kirgudu_base/form_builder.rb +3 -1
- data/app/helpers/kirgudu_base/gui_helper.rb +10 -5
- data/app/helpers/kirgudu_base/models/exports.rb +122 -122
- data/app/helpers/kirgudu_base/models/scopes.rb +5 -0
- data/app/mailers/authentications_mailer.rb +53 -0
- data/app/models/kirgudu_base/base_model.rb +47 -14
- data/app/models/kirgudu_base/dynamic_pages/builder.rb +0 -8
- data/app/models/kirgudu_base/dynamic_pages/controller_link.rb +4 -1
- data/app/models/kirgudu_base/dynamic_pages/controller_link_builder.rb +2 -1
- data/app/models/kirgudu_base/dynamic_pages/controller_link_id.rb +6 -6
- data/app/models/kirgudu_base/dynamic_pages/controller_link_id_builder.rb +6 -6
- data/app/models/kirgudu_base/dynamic_pages/element.rb +4 -5
- data/app/models/kirgudu_base/dynamic_pages/entry_builder.rb +2 -2
- data/app/models/kirgudu_base/dynamic_pages/event_if_block_builder.rb +1 -1
- data/app/models/kirgudu_base/dynamic_pages/form_builder.rb +2 -2
- data/app/models/kirgudu_base/dynamic_pages/list.rb +2 -0
- data/app/models/kirgudu_base/dynamic_pages/list_builder.rb +7 -3
- data/app/models/kirgudu_base/dynamic_pages/management_settings.rb +30 -0
- data/app/models/kirgudu_base/dynamic_pages/management_settings_builder.rb +47 -0
- data/app/models/kirgudu_base/dynamic_pages/menu.rb +9 -5
- data/app/models/kirgudu_base/dynamic_pages/menu_builder.rb +8 -5
- data/app/models/kirgudu_base/dynamic_pages/menu_item.rb +22 -6
- data/app/models/kirgudu_base/dynamic_pages/menu_items_block_builder.rb +9 -4
- data/app/models/kirgudu_base/dynamic_pages/menu_section.rb +38 -0
- data/app/models/kirgudu_base/dynamic_pages/menu_section_builder.rb +36 -0
- data/app/models/kirgudu_base/dynamic_pages/page.rb +6 -2
- data/app/models/kirgudu_base/dynamic_pages/page_builder.rb +18 -0
- data/app/models/kirgudu_base/dynamic_pages/relation.rb +23 -0
- data/app/models/kirgudu_base/dynamic_pages/relation_builder.rb +35 -0
- data/app/models/kirgudu_base/dynamic_pages/sorting_settings.rb +31 -0
- data/app/models/kirgudu_base/dynamic_pages/sorting_settings_builder.rb +48 -0
- data/app/models/kirgudu_base/security/autheintication.rb +4 -0
- data/app/models/kirgudu_base/security/authentication.rb +6 -7
- data/app/models/kirgudu_base/security/email_confirmation.rb +7 -0
- data/app/models/kirgudu_base/security/restore_password_code.rb +5 -0
- data/app/models/kirgudu_base/security/user.rb +2 -0
- data/app/models/kirgudu_base/security.rb +6 -7
- data/app/models/kirgudu_base/settings/group.rb +22 -0
- data/app/models/kirgudu_base/settings/option.rb +44 -0
- data/app/models/kirgudu_base/settings/settings_manager.rb +69 -0
- data/app/models/kirgudu_base/settings/value.rb +36 -0
- data/app/views/admin_templates/default/admin/layouts/application.html.erb +6 -4
- data/app/views/admin_templates/default/admin/system/settings/groups/edit.html.erb +9 -9
- data/app/views/admin_templates/default/admin/system/settings/groups/new.html.erb +1 -1
- data/app/views/admin_templates/default/admin/system/settings/options/edit.html.erb +1 -1
- data/app/views/admin_templates/default/admin/system/settings/options/new.html.erb +1 -1
- data/app/views/admin_templates/default/admin/system/settings/values/edit.html.erb +1 -1
- data/app/views/admin_templates/default/admin/system/settings/values/new.html.erb +1 -1
- data/app/views/admin_templates/erp/admin/shared/_top_nav_bar.html.erb +1 -3
- data/app/views/admin_templates/erp/admin/shared/entry_edit_form_renderer.html.erb +1 -1
- data/app/views/admin_templates/erp/admin/shared/entry_new_form_renderer.html.erb +1 -1
- data/app/views/admin_templates/good/admin/layouts/OLD_application.html.erb +14 -14
- data/app/views/admin_templates/good/admin/layouts/application.html.erb +11 -113
- data/app/views/admin_templates/good/admin/shared/_left_menu.html.erb +74 -63
- data/app/views/admin_templates/good/{zapanel/files/New Adobe Photoshop Image 12.psd → admin/shared/_left_menu_item.html.erb} +0 -0
- data/app/views/admin_templates/good/admin/shared/_left_menu_section.html.erb +21 -0
- data/app/views/admin_templates/good/admin/shared/render_new_OLD.html.erb +90 -0
- data/app/views/admin_templates/good/admin/shared/renderer_edit.html.erb +44 -13
- data/app/views/admin_templates/good/admin/shared/renderer_edit_OLD.html.erb +106 -0
- data/app/views/admin_templates/good/admin/shared/renderer_entries_list.html.erb +39 -18
- data/app/views/admin_templates/good/admin/shared/renderer_entries_list_with_parent.html.erb +4 -4
- data/app/views/admin_templates/good/admin/shared/renderer_management.html.erb +164 -0
- data/app/views/admin_templates/good/admin/shared/renderer_new.html.erb +40 -10
- data/app/views/admin_templates/good/admin/shared/renderer_show.html.erb +170 -58
- data/app/views/admin_templates/good/admin/shared/renderer_show_OLD.html.erb +159 -0
- data/app/views/admin_templates/good/admin/shared/renderer_sorting.html.erb +30 -0
- data/app/views/admin_templates/good/kirgudu_base/authentications/login.html.erb +13 -13
- data/app/views/admin_templates/good/kirgudu_base/authentications/register.html.erb +1 -1
- data/app/views/admin_templates/good/kirgudu_base/old/login_page.html.erb +7 -7
- data/app/views/admin_templates/good_flexy/admin/layouts/application.html.erb +17 -16
- data/app/views/admin_templates/good_flexy/admin/shared/_left_menu.html.erb +7 -0
- data/app/views/admin_templates/good_flexy/admin/shared/renderer_entries_list.html.erb +25 -17
- data/app/views/admin_templates/good_flexy/admin/shared/renderer_form_edit.html.erb +34 -13
- data/app/views/admin_templates/good_flexy/admin/shared/renderer_form_new.html.erb +31 -10
- data/app/views/admin_templates/good_flexy/admin/shared/renderer_show.html.erb +67 -52
- data/config/locales/kirgudu_base.ru.yml +92 -0
- data/config/routes.rb +16 -16
- data/db/migrate/20140413134252_create_kirgudu_base_security_authentications.rb +15 -0
- data/db/migrate/20140413152144_create_kirgudu_base_security_email_confirmations.rb +17 -0
- data/db/migrate/20140413201121_add_confirmations_kirgudu_base_security_users.rb +14 -0
- data/db/migrate/20140415093106_create_kirgudu_base_security_restore_password_codes.rb +20 -0
- data/lib/kirgudu_base.rb +2 -2
- data/test/fixtures/kirgudu_base/kirgudu_base/security/autheintications.yml +11 -0
- data/test/fixtures/kirgudu_base/security/applications.yml +21 -0
- data/test/fixtures/kirgudu_base/security/autheintications.yml +11 -0
- data/test/fixtures/kirgudu_base/security/authentications.yml +11 -0
- data/test/fixtures/kirgudu_base/security/email_confirmations.yml +13 -0
- data/test/fixtures/kirgudu_base/security/restore_password_codes.yml +13 -0
- data/test/models/kirgudu_base/kirgudu_base/security/autheintication_test.rb +9 -0
- data/test/models/kirgudu_base/security/application_test.rb +9 -0
- data/test/models/kirgudu_base/security/autheintication_test.rb +9 -0
- data/test/models/kirgudu_base/security/authentication_test.rb +9 -0
- data/test/models/kirgudu_base/security/email_confirmation_test.rb +9 -0
- data/test/models/kirgudu_base/security/restore_password_code_test.rb +9 -0
- metadata +102 -79
- data/app/assets/javascripts/kirgudu_base/jquery.fancybox.pack.js +0 -45
- data/app/controllers/kirgudu_base/authentications_controller.rb +0 -157
- data/app/views/admin_templates/good/zapanel/404.html +0 -386
- data/app/views/admin_templates/good/zapanel/billing.html +0 -550
- data/app/views/admin_templates/good/zapanel/blank-page.html +0 -343
- data/app/views/admin_templates/good/zapanel/buttons.html +0 -1018
- data/app/views/admin_templates/good/zapanel/calendars.html +0 -451
- data/app/views/admin_templates/good/zapanel/cart.html +0 -522
- data/app/views/admin_templates/good/zapanel/charts.html +0 -611
- data/app/views/admin_templates/good/zapanel/collapse.html +0 -555
- data/app/views/admin_templates/good/zapanel/contact.php +0 -102
- data/app/views/admin_templates/good/zapanel/dashboard.html +0 -985
- data/app/views/admin_templates/good/zapanel/dashboard2.html +0 -1091
- data/app/views/admin_templates/good/zapanel/dashboard3.html +0 -1079
- data/app/views/admin_templates/good/zapanel/data/movies.json +0 -1
- data/app/views/admin_templates/good/zapanel/faq.html +0 -435
- data/app/views/admin_templates/good/zapanel/file-manager.html +0 -358
- data/app/views/admin_templates/good/zapanel/files/index.php +0 -0
- data/app/views/admin_templates/good/zapanel/font-awesome/less/bootstrap.less +0 -84
- data/app/views/admin_templates/good/zapanel/font-awesome/less/core.less +0 -129
- data/app/views/admin_templates/good/zapanel/font-awesome/less/extras.less +0 -93
- data/app/views/admin_templates/good/zapanel/font-awesome/less/font-awesome-ie7.less +0 -1953
- data/app/views/admin_templates/good/zapanel/font-awesome/less/font-awesome.less +0 -33
- data/app/views/admin_templates/good/zapanel/font-awesome/less/icons.less +0 -381
- data/app/views/admin_templates/good/zapanel/font-awesome/less/mixins.less +0 -48
- data/app/views/admin_templates/good/zapanel/font-awesome/less/path.less +0 -14
- data/app/views/admin_templates/good/zapanel/font-awesome/less/variables.less +0 -735
- data/app/views/admin_templates/good/zapanel/font-awesome/scss/_bootstrap.scss +0 -84
- data/app/views/admin_templates/good/zapanel/font-awesome/scss/_core.scss +0 -129
- data/app/views/admin_templates/good/zapanel/font-awesome/scss/_extras.scss +0 -93
- data/app/views/admin_templates/good/zapanel/font-awesome/scss/_icons.scss +0 -381
- data/app/views/admin_templates/good/zapanel/font-awesome/scss/_mixins.scss +0 -48
- data/app/views/admin_templates/good/zapanel/font-awesome/scss/_path.scss +0 -14
- data/app/views/admin_templates/good/zapanel/font-awesome/scss/_variables.scss +0 -734
- data/app/views/admin_templates/good/zapanel/font-awesome/scss/font-awesome-ie7.scss +0 -1953
- data/app/views/admin_templates/good/zapanel/font-awesome/scss/font-awesome.scss +0 -33
- data/app/views/admin_templates/good/zapanel/form.html +0 -790
- data/app/views/admin_templates/good/zapanel/gallery.html +0 -392
- data/app/views/admin_templates/good/zapanel/grids.html +0 -574
- data/app/views/admin_templates/good/zapanel/hosting-dashboard.html +0 -448
- data/app/views/admin_templates/good/zapanel/icon.html +0 -722
- data/app/views/admin_templates/good/zapanel/inbox.html +0 -375
- data/app/views/admin_templates/good/zapanel/index.html +0 -48
- data/app/views/admin_templates/good/zapanel/invoice.html +0 -423
- data/app/views/admin_templates/good/zapanel/js/proxy/elFinderSupportVer1.js +0 -338
- data/app/views/admin_templates/good/zapanel/js/skins/default/lightbox-close.png +0 -0
- data/app/views/admin_templates/good/zapanel/js/skins/default/lightbox-next.png +0 -0
- data/app/views/admin_templates/good/zapanel/js/skins/default/lightbox-prev.png +0 -0
- data/app/views/admin_templates/good/zapanel/notification.html +0 -400
- data/app/views/admin_templates/good/zapanel/order-recieved.html +0 -348
- data/app/views/admin_templates/good/zapanel/php/MySQLStorage.sql +0 -23
- data/app/views/admin_templates/good/zapanel/php/connector.php +0 -44
- data/app/views/admin_templates/good/zapanel/php/elFinder.class.php +0 -1103
- data/app/views/admin_templates/good/zapanel/php/elFinderConnector.class.php +0 -133
- data/app/views/admin_templates/good/zapanel/php/elFinderVolumeDriver.class.php +0 -3370
- data/app/views/admin_templates/good/zapanel/php/elFinderVolumeLocalFileSystem.class.php +0 -835
- data/app/views/admin_templates/good/zapanel/php/elFinderVolumeMySQL.class.php +0 -896
- data/app/views/admin_templates/good/zapanel/php/mime.types +0 -512
- data/app/views/admin_templates/good/zapanel/price-table.html +0 -400
- data/app/views/admin_templates/good/zapanel/profile.html +0 -387
- data/app/views/admin_templates/good/zapanel/progressbar.html +0 -555
- data/app/views/admin_templates/good/zapanel/range-slider.html +0 -440
- data/app/views/admin_templates/good/zapanel/ribbon-grids.html +0 -491
- data/app/views/admin_templates/good/zapanel/sale-purchase-dashboard.html +0 -803
- data/app/views/admin_templates/good/zapanel/search.html +0 -370
- data/app/views/admin_templates/good/zapanel/skins/default/lightbox-close.png +0 -0
- data/app/views/admin_templates/good/zapanel/skins/default/lightbox-loading.gif +0 -0
- data/app/views/admin_templates/good/zapanel/skins/default/lightbox-next.png +0 -0
- data/app/views/admin_templates/good/zapanel/skins/default/lightbox-pause.png +0 -0
- data/app/views/admin_templates/good/zapanel/skins/default/lightbox-play.png +0 -0
- data/app/views/admin_templates/good/zapanel/skins/default/lightbox-playvideo.png +0 -0
- data/app/views/admin_templates/good/zapanel/skins/default/lightbox-prev.png +0 -0
- data/app/views/admin_templates/good/zapanel/slider.html +0 -453
- data/app/views/admin_templates/good/zapanel/tables.html +0 -470
- data/app/views/admin_templates/good/zapanel/typography.html +0 -746
@@ -36,132 +36,132 @@ module KirguduBase
|
|
36
36
|
|
37
37
|
private
|
38
38
|
|
39
|
-
def validate_data_filters(properties)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
def validate_data_filter(property)
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
def validate_data_filter_autocomplete_with_id(property, entry)
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
def validate_data_filter_chosen_select(property, entry)
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
39
|
+
#def validate_data_filters(properties)
|
40
|
+
# if Rails.env == 'development'
|
41
|
+
# if properties && properties.is_a?(Array)
|
42
|
+
# properties.each do |p|
|
43
|
+
# validate_data_filter(p)
|
44
|
+
# end
|
45
|
+
# end
|
46
|
+
# end
|
47
|
+
#end
|
48
|
+
#
|
49
|
+
#def validate_data_filter(property)
|
50
|
+
#
|
51
|
+
# entry = self.new
|
52
|
+
#
|
53
|
+
# #validateing property by input_type
|
54
|
+
# property_input_type = property[:input_type] || :text_field
|
55
|
+
#
|
56
|
+
# if property_input_type == :chosen_select
|
57
|
+
# validate_data_filter_chosen_select(property, entry)
|
58
|
+
# elsif property_input_type == :autocomplete_with_id
|
59
|
+
# validate_data_filter_autocomplete_with_id(property, entry)
|
60
|
+
# elsif property_input_type == :switcher
|
61
|
+
#
|
62
|
+
# elsif property_input_type == :date_picker
|
63
|
+
#
|
64
|
+
# elsif property_input_type == :time_picker
|
65
|
+
#
|
66
|
+
# elsif property_input_type == :image_selector
|
67
|
+
#
|
68
|
+
# elsif property_input_type == :check_box
|
69
|
+
#
|
70
|
+
# elsif property_input_type == :radio_button
|
71
|
+
#
|
72
|
+
# elsif property_input_type == :link
|
73
|
+
#
|
74
|
+
# elsif property_input_type == :elastic_text_area
|
75
|
+
#
|
76
|
+
#
|
77
|
+
# elsif property_input_type == :text_area
|
78
|
+
#
|
79
|
+
# elsif property_input_type == :text_field
|
80
|
+
#
|
81
|
+
# else
|
82
|
+
# raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nINPUT TYPE #{property_input_type} is not supported at the moment"
|
83
|
+
# end
|
84
|
+
#
|
85
|
+
# # validating class attribute
|
86
|
+
# validate_data_filter_attribute_class(property, entry)
|
87
|
+
# # validating span attribute
|
88
|
+
# validate_data_filter_attribute_span(property, entry)
|
89
|
+
#end
|
90
|
+
#
|
91
|
+
#def validate_data_filter_autocomplete_with_id(property, entry)
|
92
|
+
# #validateting text_value_property attribute
|
93
|
+
# validate_data_filter_attribute_text_value_property(property, entry)
|
94
|
+
# #validating placeholder presense
|
95
|
+
# validate_data_filter_attribute_placeholder(property, entry)
|
96
|
+
# #validatting onchange attribute
|
97
|
+
# validate_data_filter_attribute_onchange(property, entry)
|
98
|
+
#
|
99
|
+
#
|
100
|
+
# validate_data_filter_attribute_source(property, entry)
|
101
|
+
#end
|
102
|
+
#
|
103
|
+
#def validate_data_filter_chosen_select(property, entry)
|
104
|
+
# #validateting text_value_property attribute
|
105
|
+
# validate_data_filter_attribute_text_value_property(property, entry)
|
106
|
+
# #validating placeholder presense
|
107
|
+
# validate_data_filter_attribute_placeholder(property, entry)
|
108
|
+
# #validatting onchange attribute
|
109
|
+
# validate_data_filter_attribute_onchange(property, entry)
|
110
|
+
#
|
111
|
+
#end
|
112
112
|
|
113
113
|
|
114
114
|
##################################### FORM PROPERTY ATTRIBUTE VALIDATIONS #####################
|
115
115
|
|
116
|
-
def validate_data_filter_attribute_onchange(property, entry)
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
end
|
121
|
-
|
122
|
-
def validate_data_filter_attribute_class(property, entry)
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
end
|
129
|
-
|
130
|
-
def validate_data_filter_attribute_span(property, entry)
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
end
|
137
|
-
|
138
|
-
def validate_data_filter_attribute_placeholder(property, entry)
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
end
|
143
|
-
|
144
|
-
def validate_data_filter_attribute_text_value_property(property, entry)
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
end
|
153
|
-
|
154
|
-
def validate_data_filter_attribute_source_url(property, entry)
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
end
|
159
|
-
|
160
|
-
def validate_data_filter_attribute_source(property, entry)
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
end
|
116
|
+
#def validate_data_filter_attribute_onchange(property, entry)
|
117
|
+
# if property[:onchange]
|
118
|
+
#
|
119
|
+
# end
|
120
|
+
#end
|
121
|
+
#
|
122
|
+
#def validate_data_filter_attribute_class(property, entry)
|
123
|
+
# if property[:class]
|
124
|
+
# unless property[:class].is_a?(String)
|
125
|
+
# raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nCLASS attribute is not a String'"
|
126
|
+
# end
|
127
|
+
# end
|
128
|
+
#end
|
129
|
+
#
|
130
|
+
#def validate_data_filter_attribute_span(property, entry)
|
131
|
+
# if property[:span]
|
132
|
+
# unless property[:span].is_a?(String)
|
133
|
+
# raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nSPAN attribute is not a String'"
|
134
|
+
# end
|
135
|
+
# end
|
136
|
+
#end
|
137
|
+
#
|
138
|
+
#def validate_data_filter_attribute_placeholder(property, entry)
|
139
|
+
# if property[:placeholder].nil? || property[:placeholder].blank?
|
140
|
+
# raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nPLACEHOLDER missed"
|
141
|
+
# end
|
142
|
+
#end
|
143
|
+
#
|
144
|
+
#def validate_data_filter_attribute_text_value_property(property, entry)
|
145
|
+
# unless property[:text_value_property]
|
146
|
+
# raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nTEXT_VALUE_PROPERTY attribute missed"
|
147
|
+
# end
|
148
|
+
#
|
149
|
+
# unless entry.respond_to?(property[:text_value_property])
|
150
|
+
# raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nTEXT_VALUE_PROPERTY '#{property[:text_value_property]}' method not found for this class"
|
151
|
+
# end
|
152
|
+
#end
|
153
|
+
#
|
154
|
+
#def validate_data_filter_attribute_source_url(property, entry)
|
155
|
+
# unless property[:source_url]
|
156
|
+
# raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nSOURCE_URL attribute missed"
|
157
|
+
# end
|
158
|
+
#end
|
159
|
+
#
|
160
|
+
#def validate_data_filter_attribute_source(property, entry)
|
161
|
+
# unless property[:source]
|
162
|
+
# raise "Current Model Class: #{self}\r\nForm Property '#{property[:name]}'\r\nSOURCE attribute missed"
|
163
|
+
# end
|
164
|
+
#end
|
165
165
|
end
|
166
166
|
end
|
167
167
|
end
|
@@ -152,8 +152,13 @@ module KirguduBase
|
|
152
152
|
module ByDeletionStatus
|
153
153
|
def self.included(base)
|
154
154
|
base.scope :by_deletion_status, lambda { |value| base.where(deletion_status_id: value) if value }
|
155
|
+
base.scope :with_deletion_status_active, lambda { |value| base.where(deletion_status_id: 1) if value == 1 }
|
156
|
+
base.scope :with_deletion_status_deleted, lambda { |value| base.where(deletion_status_id: 2) if value == 1 }
|
157
|
+
base.scope :with_deletion_status_purged, lambda { |value| base.where(deletion_status_id: 3) if value == 1 }
|
155
158
|
end
|
159
|
+
|
156
160
|
end
|
161
|
+
|
157
162
|
end
|
158
163
|
end
|
159
164
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
module KirguduBase
|
3
|
+
class AuthenticationsMailer < ActionMailer::Base
|
4
|
+
|
5
|
+
def confirmation_code(from, to, user, confirmation, template_path)
|
6
|
+
@data = {}
|
7
|
+
@data[:user] = user
|
8
|
+
@data[:confirmation] = confirmation
|
9
|
+
|
10
|
+
# mail(from: from, to: to, subject: I18n.t("kirgudu_base.authentications.confirm_email.email.subject")) do |format|
|
11
|
+
# format.text { render "#{KirguduBase.path_to_views}/mailers/authentications/confirmation_code.html" }
|
12
|
+
# format.html { render "#{KirguduBase.path_to_views}/mailers/authentications/confirmation_code.html" }
|
13
|
+
# end
|
14
|
+
|
15
|
+
mail(from: from, to: to, subject: I18n.t("kirgudu_base.authentications.confirm_email.email.subject"), content_type: "text/html") do |format|
|
16
|
+
format.html { render "#{KirguduBase.path_to_views}/mailers/authentications/confirmation_code" }
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
def restore_password_code(from, to, user, restore)
|
22
|
+
@data = {}
|
23
|
+
@data[:user] = user
|
24
|
+
@data[:restore] = restore
|
25
|
+
|
26
|
+
# mail(from: from, to: to, subject: I18n.t("kirgudu_base.authentications.restore_password.email.subject")) do |format|
|
27
|
+
# format.text { render "#{KirguduBase.path_to_views}/mailers/authentications/restore_password_code" }
|
28
|
+
# format.html { render "#{KirguduBase.path_to_views}/mailers/authentications/restore_password_code" }
|
29
|
+
# end
|
30
|
+
|
31
|
+
mail(from: from, to: to, subject: I18n.t("kirgudu_base.authentications.restore_password_code.email.subject"), content_type: "text/html") do |format|
|
32
|
+
format.html { render "/mailers/authentications/restore_password_code" }
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
def restore_password_success(from, to, user, password)
|
38
|
+
@data = {}
|
39
|
+
@data[:user] = user
|
40
|
+
@data[:password] = password
|
41
|
+
|
42
|
+
# mail(from: from, to: to, subject: I18n.t("kirgudu_base.authentications.restore_password_success.email.subject"), content_type: "text/html") do |format|
|
43
|
+
# format.text { render "#{KirguduBase.path_to_views}/mailers/authentications/restore_password_success" }
|
44
|
+
# format.html { render "#{KirguduBase.path_to_views}/mailers/authentications/restore_password_success" }
|
45
|
+
# end
|
46
|
+
|
47
|
+
mail(from: from, to: to, subject: I18n.t("kirgudu_base.authentications.restore_password_success.email.subject"), content_type: "text/html") do |format|
|
48
|
+
format.html { render "#{self.class.get_method_latest_result(:get_kb_template)}#{KirguduBase.path_to_views}/mailers/authentications/restore_password_success" }
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -138,13 +138,14 @@ module KirguduBase
|
|
138
138
|
|
139
139
|
def self.apply_filters_to_query(query, filters = {})
|
140
140
|
filters ||= {}
|
141
|
-
per_page = filters[:per_page]
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
141
|
+
per_page = filters[:per_page]
|
142
|
+
if per_page
|
143
|
+
per_page = 99999 if per_page <= 0
|
144
|
+
page_number = nil
|
145
|
+
page_number = filters[:page].to_i if filters[:page]
|
146
|
+
if page_number.nil? || page_number < 1
|
147
|
+
page_number = 1
|
148
|
+
end
|
148
149
|
end
|
149
150
|
|
150
151
|
|
@@ -152,12 +153,13 @@ module KirguduBase
|
|
152
153
|
|
153
154
|
query = query.with_slug(filters[:slug]) if self.respond_to?(:with_slug)
|
154
155
|
query = query.with_keyword(filters[:keyword]) if self.respond_to?(:with_keyword)
|
155
|
-
if self.respond_to?(:with_name)
|
156
|
-
query = query.with_name(filters[:name])
|
157
|
-
end
|
156
|
+
query = query.with_name(filters[:name]) if self.respond_to?(:with_name)
|
158
157
|
|
159
158
|
|
160
159
|
query = query.by_deletion_status(filters[:deletion_status_id]) if self.respond_to?(:by_deletion_status)
|
160
|
+
query = query.with_deletion_status_active(filters[:active]) if self.respond_to?(:with_deletion_status_active)
|
161
|
+
query = query.with_deletion_status_deleted(filters[:deleted]) if self.respond_to?(:with_deletion_status_deleted)
|
162
|
+
query = query.with_deletion_status_purged(filters[:purged]) if self.respond_to?(:with_deletion_status_purged)
|
161
163
|
|
162
164
|
query = query.by_creator(filters[:created_by]) if self.respond_to?(:by_creator)
|
163
165
|
query = query.by_creator(filters[:updated_by]) if self.respond_to?(:by_creator)
|
@@ -168,10 +170,15 @@ module KirguduBase
|
|
168
170
|
query = query.by_updated_at_start(filters[:updated_at]) if self.respond_to?(:by_updated_at_start)
|
169
171
|
query = query.by_updated_at_start(filters[:updated_at]) if self.respond_to?(:by_updated_at_finish)
|
170
172
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
173
|
+
|
174
|
+
if per_page
|
175
|
+
query = query
|
176
|
+
.page(page_number)
|
177
|
+
.per_page(per_page)
|
178
|
+
end
|
179
|
+
|
180
|
+
query.order(filters[:order] || "name asc")
|
181
|
+
|
175
182
|
end
|
176
183
|
|
177
184
|
def self.for_form_params
|
@@ -182,6 +189,32 @@ module KirguduBase
|
|
182
189
|
self.class.for_model_params
|
183
190
|
end
|
184
191
|
|
192
|
+
|
193
|
+
def self.for_sql_order_by(name, direction = nil)
|
194
|
+
if name.nil?
|
195
|
+
raise "Class. Ordery By Colum Name is Null"
|
196
|
+
end
|
197
|
+
|
198
|
+
direction = direction.to_sym if direction
|
199
|
+
direction ||= :asc
|
200
|
+
"#{self.table_name}.#{name} #{direction == :asc ? 'asc' : 'desc'}"
|
201
|
+
end
|
202
|
+
|
203
|
+
def self.for_sql_order_by_inverted(name, direction = nil)
|
204
|
+
direction = direction.to_sym if direction
|
205
|
+
direction ||= :asc
|
206
|
+
self.for_sql_order_by(name, direction == :asc ? :desc : :asc)
|
207
|
+
end
|
208
|
+
|
209
|
+
def for_sql_order_by(name, direction = nil)
|
210
|
+
self.class.for_sql_order_by(name, direction)
|
211
|
+
end
|
212
|
+
|
213
|
+
def for_sql_order_by_inverted(name, direction = nil)
|
214
|
+
self.class.for_sql_order_by_inverted(name, direction)
|
215
|
+
end
|
216
|
+
|
217
|
+
|
185
218
|
protected
|
186
219
|
|
187
220
|
def normalize_values_before_validation
|
@@ -2,9 +2,6 @@ module KirguduBase
|
|
2
2
|
module DynamicPages
|
3
3
|
class Builder
|
4
4
|
def initialize(&block)
|
5
|
-
self.kontroller_klass = kontroller_klass
|
6
|
-
self.parent_element = parent_element
|
7
|
-
|
8
5
|
instance_eval(&block) if block_given?
|
9
6
|
end
|
10
7
|
|
@@ -49,9 +46,6 @@ module KirguduBase
|
|
49
46
|
raise "Parameter \"#{name}\" must be a \"String\" or a :Symbol." unless value && (value.is_a?(String) || value.is_a?(Symbol))
|
50
47
|
end
|
51
48
|
|
52
|
-
attr_accessor :kontroller_klass
|
53
|
-
attr_accessor :parent_element
|
54
|
-
|
55
49
|
def validate_generated_element(element)
|
56
50
|
errors = []
|
57
51
|
unless element.valid?
|
@@ -68,9 +62,7 @@ module KirguduBase
|
|
68
62
|
if errors.length > 0
|
69
63
|
|
70
64
|
raise "ERRORS<br/>
|
71
|
-
Controller: #{kontroller_klass} <br/>
|
72
65
|
Class: #{element.class}
|
73
|
-
Parent: #{element.parent_element} <br/>
|
74
66
|
Name: #{element.name if element.respond_to?(:name)} <br/>
|
75
67
|
|
76
68
|
#{errors.join('<br/>')}".html_safe
|
@@ -12,6 +12,7 @@ module KirguduBase
|
|
12
12
|
self.controller = nil
|
13
13
|
self.action = nil
|
14
14
|
self.id = nil
|
15
|
+
self.ids = nil
|
15
16
|
|
16
17
|
super(options)
|
17
18
|
end
|
@@ -20,6 +21,7 @@ module KirguduBase
|
|
20
21
|
attr_accessor :controller
|
21
22
|
attr_accessor :action
|
22
23
|
attr_accessor :id
|
24
|
+
attr_accessor :ids
|
23
25
|
|
24
26
|
|
25
27
|
def to_external_hash(options = {})
|
@@ -27,7 +29,8 @@ module KirguduBase
|
|
27
29
|
options.merge!({
|
28
30
|
controller: self.controller,
|
29
31
|
action: self.action,
|
30
|
-
id: self.id
|
32
|
+
id: self.id,
|
33
|
+
ids: self.ids
|
31
34
|
})
|
32
35
|
super(options)
|
33
36
|
end
|
@@ -2,20 +2,20 @@ module KirguduBase
|
|
2
2
|
module DynamicPages
|
3
3
|
class ControllerLinkId < ::KirguduBase::DynamicPages::Element
|
4
4
|
|
5
|
-
mergeable_attributes :
|
5
|
+
mergeable_attributes :from, :to
|
6
6
|
|
7
|
-
validates_presence_of :
|
7
|
+
validates_presence_of :from, :to
|
8
8
|
|
9
9
|
def initialize(options = {})
|
10
10
|
|
11
|
-
self.
|
12
|
-
self.
|
11
|
+
self.from = nil
|
12
|
+
self.to = nil
|
13
13
|
|
14
14
|
super(options)
|
15
15
|
end
|
16
16
|
|
17
|
-
attr_accessor :
|
18
|
-
attr_accessor :
|
17
|
+
attr_accessor :from
|
18
|
+
attr_accessor :to
|
19
19
|
|
20
20
|
|
21
21
|
def to_external_hash(options = {})
|
@@ -9,8 +9,8 @@ module KirguduBase
|
|
9
9
|
def initialize(&block)
|
10
10
|
self.builder_options.merge!(
|
11
11
|
{
|
12
|
-
|
13
|
-
|
12
|
+
from: nil,
|
13
|
+
to: nil
|
14
14
|
}
|
15
15
|
)
|
16
16
|
|
@@ -18,12 +18,12 @@ module KirguduBase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
|
21
|
-
def
|
22
|
-
self.builder_options[:
|
21
|
+
def from(value)
|
22
|
+
self.builder_options[:from] = value
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
self.builder_options[:
|
25
|
+
def to(value)
|
26
|
+
self.builder_options[:to] = value
|
27
27
|
end
|
28
28
|
|
29
29
|
def to_element
|
@@ -41,16 +41,15 @@ module KirguduBase
|
|
41
41
|
self.parent_entry.kontroller_klass if self.parent_entry && self.parent_entry.respond_to?(:kontroller_klass)
|
42
42
|
end
|
43
43
|
|
44
|
-
protected
|
45
|
-
|
46
|
-
attr_writer :parent_entry
|
47
|
-
|
48
44
|
def as_json(options = {})
|
49
45
|
super((options || {}).merge({
|
50
|
-
:except => [:parent_entry]
|
46
|
+
:except => [:parent_entry, :validation_context, :errors]
|
51
47
|
}))
|
52
48
|
end
|
53
49
|
|
50
|
+
protected
|
51
|
+
|
52
|
+
attr_writer :parent_entry
|
54
53
|
|
55
54
|
end
|
56
55
|
end
|
@@ -30,8 +30,8 @@ module KirguduBase
|
|
30
30
|
elements = ::KirguduBase::DynamicPages::EntryPropertiesBlockBuilder.new(&block).to_elements
|
31
31
|
|
32
32
|
elements.each do |element|
|
33
|
-
self.builder_options[:properties] =
|
34
|
-
self.builder_options[:properties]
|
33
|
+
self.builder_options[:properties] = {} unless self.builder_options[:properties]
|
34
|
+
self.builder_options[:properties][element.name] = element
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -22,7 +22,7 @@ module KirguduBase
|
|
22
22
|
@actions.each do |element|
|
23
23
|
element.constraint = ::KirguduBase::DynamicPages::EventActionConstraint.new(name: self.name, values: self.values)
|
24
24
|
|
25
|
-
|
25
|
+
|
26
26
|
#element.constraint.name = self.name
|
27
27
|
#element.constraint.values = self.values
|
28
28
|
end
|
@@ -36,8 +36,8 @@ module KirguduBase
|
|
36
36
|
def properties(&block)
|
37
37
|
elements = ::KirguduBase::DynamicPages::FormPropertiesBlockBuilder.new(&block).to_elements
|
38
38
|
elements.each do |element|
|
39
|
-
self.builder_options[:properties] =
|
40
|
-
self.builder_options[:properties]
|
39
|
+
self.builder_options[:properties] = {} unless self.builder_options[:properties]
|
40
|
+
self.builder_options[:properties][element.name] = element
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -21,6 +21,7 @@ module KirguduBase
|
|
21
21
|
self.cells = nil
|
22
22
|
self.model = nil
|
23
23
|
self.parent = nil
|
24
|
+
self.relation = nil
|
24
25
|
|
25
26
|
super(options)
|
26
27
|
|
@@ -35,6 +36,7 @@ module KirguduBase
|
|
35
36
|
attr_accessor :filters
|
36
37
|
attr_accessor :model
|
37
38
|
attr_accessor :parent
|
39
|
+
attr_accessor :relation
|
38
40
|
|
39
41
|
|
40
42
|
end
|
@@ -40,12 +40,16 @@ module KirguduBase
|
|
40
40
|
self.builder_options[:per_page] = value
|
41
41
|
end
|
42
42
|
|
43
|
+
def relation(&block)
|
44
|
+
self.builder_options[:relation] = ::KirguduBase::DynamicPages::RelationBuilder.new(&block).to_element
|
45
|
+
end
|
46
|
+
|
43
47
|
|
44
48
|
def properties(&block)
|
45
49
|
elements = ::KirguduBase::DynamicPages::ListPropertiesBlockBuilder.new(&block).to_elements
|
46
50
|
elements.each do |element|
|
47
|
-
self.builder_options[:properties] =
|
48
|
-
self.builder_options[:properties]
|
51
|
+
self.builder_options[:properties] = {} unless self.builder_options[:properties]
|
52
|
+
self.builder_options[:properties][element.name] = element
|
49
53
|
end if elements
|
50
54
|
end
|
51
55
|
|
@@ -73,7 +77,7 @@ module KirguduBase
|
|
73
77
|
end
|
74
78
|
|
75
79
|
def parent(&block)
|
76
|
-
self.builder_options[:parent] = ::KirguduBase::DynamicPages::ParentElementBuilder.new(&block).
|
80
|
+
self.builder_options[:parent] = ::KirguduBase::DynamicPages::ParentElementBuilder.new(&block).to_element
|
77
81
|
end
|
78
82
|
|
79
83
|
|