kuppayam 0.1.5dev3 → 0.1.5dev4
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/kuppayam.js +3 -0
- data/app/assets/stylesheets/kuppayam.css +1 -0
- data/app/helpers/filter_helper.rb +9 -3
- data/app/helpers/resource_helper.rb +1 -1
- data/app/models/kuppayam/application_record.rb +1 -2
- data/app/views/kuppayam/filters/_display_dropdown_filters.html.erb +11 -0
- data/app/views/kuppayam/filters/_display_filters.html.erb +29 -0
- data/{lib/kuppayam/extras/kuppayam → config/initializers}/importer.rb +0 -0
- data/config/initializers/validators.rb +78 -0
- data/lib/kuppayam/version.rb +1 -1
- metadata +6 -4
- data/config/initializers/kuppayam_validators.rb +0 -76
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85f6707e4fd3e6cc5fb402e489820c8a9251be63
|
4
|
+
data.tar.gz: 789034cf9ba14f8aba6513cd9707bb026c4277b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4095f94e3bd48b0b18dcf010b71681ef4139c47daceb8fffe4dae6ac8feeb804c25bac4a5dbbdb87f0ef0912477ac0160b72dd54ba57ccfd2735b445d28ec958
|
7
|
+
data.tar.gz: 55417a161f925d62f0a1ec61d8705af7b830b71c2522bcbc06560d83ea11d4605bdee227b1bdef78e89e99c18bf5648f713c51fd1277395cc2d84c5071c9b1ff
|
@@ -12,6 +12,7 @@
|
|
12
12
|
//
|
13
13
|
//= require kuppayam/utilities.js
|
14
14
|
//= require bootstrap.min.js
|
15
|
+
//= require moment.min.js
|
15
16
|
//= require TweenMax.min.js
|
16
17
|
//= require resizeable.js
|
17
18
|
//= require joinable.js
|
@@ -21,5 +22,7 @@
|
|
21
22
|
//= require wysihtml5/lib/js/wysihtml5-0.3.0.js
|
22
23
|
//= require wysihtml5/src/bootstrap-wysihtml5.js
|
23
24
|
//= require toastr/toastr.min.js
|
25
|
+
//= require daterangepicker/daterangepicker.js
|
26
|
+
//= require multiselect/js/jquery.multi-select.js
|
24
27
|
|
25
28
|
|
@@ -3,7 +3,6 @@ module FilterHelper
|
|
3
3
|
|
4
4
|
def configure_filters
|
5
5
|
configure_filter_settings
|
6
|
-
configure_filter_ui_settings
|
7
6
|
configure_filter_param_mapping
|
8
7
|
end
|
9
8
|
|
@@ -98,6 +97,8 @@ module FilterHelper
|
|
98
97
|
options = rpf[:options] || {}
|
99
98
|
parse_reference_filter_from_params(rpf[:filter_name], rpf[:filter_class], options)
|
100
99
|
end if filter_settings.has_key?(:reference_filters)
|
100
|
+
|
101
|
+
configure_filter_ui_settings
|
101
102
|
end
|
102
103
|
|
103
104
|
# Use this method to create a filter if the value is in a variable
|
@@ -329,10 +330,15 @@ module FilterHelper
|
|
329
330
|
end
|
330
331
|
selected_text = filter_options[:select_label] unless selected_text
|
331
332
|
|
332
|
-
# Clone the existing filters
|
333
|
+
# Clone the existing filters first
|
333
334
|
# remove the filters which are to be removed and add which are to be added
|
334
335
|
# Also remove the filter which is currently selected
|
335
|
-
|
336
|
+
|
337
|
+
unless filter_options[:current_filters].blank?
|
338
|
+
temp_filters = {}
|
339
|
+
else
|
340
|
+
temp_filters = filter_options[:current_filters].clone
|
341
|
+
end
|
336
342
|
temp_filters.merge!(filter_options[:filters_to_add])
|
337
343
|
temp_filters.reject!{|k,v| filter_options[:filters_to_remove].include?(k)}
|
338
344
|
temp_filters.reject!{|k,v| k == filter_name.to_sym }
|
@@ -145,7 +145,7 @@ module ResourceHelper
|
|
145
145
|
item_name: default_item_name,
|
146
146
|
class: default_class,
|
147
147
|
layout: :table,
|
148
|
-
|
148
|
+
show_modal_after_create: true,
|
149
149
|
show_modal_after_update: true,
|
150
150
|
view_path: "/kuppayam/workflows/peacock",
|
151
151
|
js_view_path: "/kuppayam/workflows/peacock"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="row" id="div_kuppayam_report_filters">
|
2
|
+
<div class="col-md-12">
|
3
|
+
<% @filter_ui_settings.each do |filter_name, options| %>
|
4
|
+
<% if options[:object_filter] == true %>
|
5
|
+
<%= report_object_filter(filter_name, options) %>
|
6
|
+
<% else %>
|
7
|
+
<%= report_filter(filter_name, options) %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div class="mb-20" style="font-size:16px; color: darkred; text-align: left;">Selected Filters</div>
|
2
|
+
|
3
|
+
<div class="table-responsive table-scrollable">
|
4
|
+
<table class="table table-striped table-condensed table-bordered">
|
5
|
+
<tbody>
|
6
|
+
<tr>
|
7
|
+
<% @filters.each do |name, value| %>
|
8
|
+
<th style="text-align: left;"><%= name.to_s.titleize %></th>
|
9
|
+
<% end %>
|
10
|
+
</tr>
|
11
|
+
<tr>
|
12
|
+
<% @filters.each do |name, value| %>
|
13
|
+
<%
|
14
|
+
display = case value
|
15
|
+
when ActiveRecord::Base
|
16
|
+
value.display_name
|
17
|
+
when "null", nil
|
18
|
+
"IS NULL"
|
19
|
+
else
|
20
|
+
value.to_s.titleize
|
21
|
+
end
|
22
|
+
#display = value.is_a?(ActiveRecord::Base) ? value.display_name : value.to_s
|
23
|
+
%>
|
24
|
+
<td style="text-align: left;"><%= display %></td>
|
25
|
+
<% end %>
|
26
|
+
</tr>
|
27
|
+
</tbody>
|
28
|
+
</table>
|
29
|
+
</div>
|
File without changes
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module Kuppayam
|
2
|
+
module Validators
|
3
|
+
|
4
|
+
def generate_validation_options(attribute, options)
|
5
|
+
{a: 1}
|
6
|
+
reg_exp = /\A[a-zA-Z1-9\-\ \(\)\.+]*\z/i
|
7
|
+
options.reverse_merge!(
|
8
|
+
presence: true,
|
9
|
+
min_length: 3,
|
10
|
+
max_length: 256,
|
11
|
+
format: reg_exp,
|
12
|
+
uniqueness: false,
|
13
|
+
mandatory: false
|
14
|
+
)
|
15
|
+
|
16
|
+
if options.has_key?(:condition_method) && !options[:condition_method].blank?
|
17
|
+
condition_proc = proc {|obj| obj.send(options[:condition_method])}
|
18
|
+
elsif options.has_key?(:mandatory) && options[:mandatory] == false
|
19
|
+
condition_proc = proc {|obj| !obj.send(attribute).blank?}
|
20
|
+
else
|
21
|
+
condition_proc = nil
|
22
|
+
end
|
23
|
+
|
24
|
+
voptions = {
|
25
|
+
presence: options[:presence],
|
26
|
+
length: { minimum: options[:min_length], maximum: options[:max_length]},
|
27
|
+
format: {:with => options[:format]}
|
28
|
+
}
|
29
|
+
voptions.merge!(uniqueness: options[:uniqueness]) if options[:uniqueness]
|
30
|
+
voptions.merge!(if: condition_proc) if condition_proc
|
31
|
+
|
32
|
+
voptions
|
33
|
+
end
|
34
|
+
|
35
|
+
def validate_string(attribute, **options)
|
36
|
+
voptions = generate_validation_options(attribute, options)
|
37
|
+
validates attribute, **voptions
|
38
|
+
end
|
39
|
+
|
40
|
+
def validate_username(attribute, **options)
|
41
|
+
reg_exp = /\A[a-zA-Z0-9\_\.]*\z/
|
42
|
+
options.merge!(mandatory: true, min_length: 3, max_length: 128, format: reg_exp, :uniqueness => {:case_sensitive => false})
|
43
|
+
voptions = generate_validation_options(attribute, options)
|
44
|
+
validates attribute, **voptions
|
45
|
+
end
|
46
|
+
|
47
|
+
def validate_email(attribute, **options)
|
48
|
+
reg_exp = /\A(|(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})\z/i
|
49
|
+
options.merge!(mandatory: true, format: reg_exp, :uniqueness => {:case_sensitive => false})
|
50
|
+
voptions = generate_validation_options(attribute, options)
|
51
|
+
validates attribute, **voptions
|
52
|
+
end
|
53
|
+
|
54
|
+
# format can be either :us or :indian
|
55
|
+
def validate_phone(attribute, **options)
|
56
|
+
options.reverse_merge!(phone_format: :india)
|
57
|
+
if options[:phone_format] == :us
|
58
|
+
reg_exp = /\A[0-9]{3}[-][0-9]{3}[-][0-9]{4}\z/
|
59
|
+
length = 12
|
60
|
+
else
|
61
|
+
reg_exp = /\A[0-9]{10}\z/
|
62
|
+
length = 10
|
63
|
+
end
|
64
|
+
options.merge!(format: reg_exp, min_length: length, max_length: length)
|
65
|
+
options.reverse_merge!(numericality: true, mandatory: true, uniqueness: true)
|
66
|
+
voptions = generate_validation_options(attribute, options)
|
67
|
+
validates attribute, **voptions
|
68
|
+
end
|
69
|
+
|
70
|
+
def validate_password(attribute, **options)
|
71
|
+
reg_exp = /\A(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9!@$#&*_\.,;:])/
|
72
|
+
options.merge!(mandatory: true, format: reg_exp, min_length: 7, max_length: 256)
|
73
|
+
voptions = generate_validation_options(attribute, options)
|
74
|
+
validates attribute, **voptions
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
end
|
data/lib/kuppayam/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuppayam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5dev4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kpvarma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -351,6 +351,8 @@ files:
|
|
351
351
|
- app/views/kuppayam/documents/edit.js.erb
|
352
352
|
- app/views/kuppayam/documents/new.js.erb
|
353
353
|
- app/views/kuppayam/documents/update.html.erb
|
354
|
+
- app/views/kuppayam/filters/_display_dropdown_filters.html.erb
|
355
|
+
- app/views/kuppayam/filters/_display_filters.html.erb
|
354
356
|
- app/views/kuppayam/http_status/404.html.erb
|
355
357
|
- app/views/kuppayam/images/_action_buttons.html.erb
|
356
358
|
- app/views/kuppayam/images/_crop_form.html.erb
|
@@ -407,8 +409,9 @@ files:
|
|
407
409
|
- app/views/layouts/kuppayam/layout_horizontal_menu.html.erb
|
408
410
|
- app/views/layouts/kuppayam/print_a4.html.erb
|
409
411
|
- config/initializers/config_center.rb
|
412
|
+
- config/initializers/importer.rb
|
410
413
|
- config/initializers/inflections.rb
|
411
|
-
- config/initializers/
|
414
|
+
- config/initializers/validators.rb
|
412
415
|
- config/locales/kuppayam/general.yml
|
413
416
|
- config/routes.rb
|
414
417
|
- db/migrate/20170000000000_create_images.rb
|
@@ -419,7 +422,6 @@ files:
|
|
419
422
|
- lib/kuppayam/action_view/modal_helper.rb
|
420
423
|
- lib/kuppayam/action_view/theme_helper.rb
|
421
424
|
- lib/kuppayam/engine.rb
|
422
|
-
- lib/kuppayam/extras/kuppayam/importer.rb
|
423
425
|
- lib/kuppayam/version.rb
|
424
426
|
- lib/tasks/kuppayam_tasks.rake
|
425
427
|
- vendor/assets/fonts/elusive/css/animation.css
|
@@ -1,76 +0,0 @@
|
|
1
|
-
module KuppayamValidators
|
2
|
-
|
3
|
-
def generate_validation_options(attribute, options)
|
4
|
-
{a: 1}
|
5
|
-
reg_exp = /\A[a-zA-Z1-9\-\ \(\)\.+]*\z/i
|
6
|
-
options.reverse_merge!(
|
7
|
-
presence: true,
|
8
|
-
min_length: 3,
|
9
|
-
max_length: 256,
|
10
|
-
format: reg_exp,
|
11
|
-
uniqueness: false,
|
12
|
-
mandatory: false
|
13
|
-
)
|
14
|
-
|
15
|
-
if options.has_key?(:condition_method) && !options[:condition_method].blank?
|
16
|
-
condition_proc = proc {|obj| obj.send(options[:condition_method])}
|
17
|
-
elsif options.has_key?(:mandatory) && options[:mandatory] == false
|
18
|
-
condition_proc = proc {|obj| !obj.send(attribute).blank?}
|
19
|
-
else
|
20
|
-
condition_proc = nil
|
21
|
-
end
|
22
|
-
|
23
|
-
voptions = {
|
24
|
-
presence: options[:presence],
|
25
|
-
length: { minimum: options[:min_length], maximum: options[:max_length]},
|
26
|
-
format: {:with => options[:format]}
|
27
|
-
}
|
28
|
-
voptions.merge!(uniqueness: options[:uniqueness]) if options[:uniqueness]
|
29
|
-
voptions.merge!(if: condition_proc) if condition_proc
|
30
|
-
|
31
|
-
voptions
|
32
|
-
end
|
33
|
-
|
34
|
-
def validate_string(attribute, **options)
|
35
|
-
voptions = generate_validation_options(attribute, options)
|
36
|
-
validates attribute, **voptions
|
37
|
-
end
|
38
|
-
|
39
|
-
def validate_username(attribute, **options)
|
40
|
-
reg_exp = /\A[a-zA-Z0-9\_\.]*\z/
|
41
|
-
options.merge!(mandatory: true, min_length: 3, max_length: 128, format: reg_exp, :uniqueness => {:case_sensitive => false})
|
42
|
-
voptions = generate_validation_options(attribute, options)
|
43
|
-
validates attribute, **voptions
|
44
|
-
end
|
45
|
-
|
46
|
-
def validate_email(attribute, **options)
|
47
|
-
reg_exp = /\A(|(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})\z/i
|
48
|
-
options.merge!(mandatory: true, format: reg_exp, :uniqueness => {:case_sensitive => false})
|
49
|
-
voptions = generate_validation_options(attribute, options)
|
50
|
-
validates attribute, **voptions
|
51
|
-
end
|
52
|
-
|
53
|
-
# format can be either :us or :indian
|
54
|
-
def validate_phone(attribute, **options)
|
55
|
-
options.reverse_merge!(phone_format: :india)
|
56
|
-
if options[:phone_format] == :us
|
57
|
-
reg_exp = /\A[0-9]{3}[-][0-9]{3}[-][0-9]{4}\z/
|
58
|
-
length = 12
|
59
|
-
else
|
60
|
-
reg_exp = /\A[0-9]{10}\z/
|
61
|
-
length = 10
|
62
|
-
end
|
63
|
-
options.merge!(format: reg_exp, min_length: length, max_length: length)
|
64
|
-
options.reverse_merge!(numericality: true, mandatory: true, uniqueness: true)
|
65
|
-
voptions = generate_validation_options(attribute, options)
|
66
|
-
validates attribute, **voptions
|
67
|
-
end
|
68
|
-
|
69
|
-
def validate_password(attribute, **options)
|
70
|
-
reg_exp = /\A(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9!@$#&*_\.,;:])/
|
71
|
-
options.merge!(mandatory: true, format: reg_exp, min_length: 7, max_length: 256)
|
72
|
-
voptions = generate_validation_options(attribute, options)
|
73
|
-
validates attribute, **voptions
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|