card 1.93.6 → 1.93.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/config/initializers/02_patches/active_record.rb +13 -0
  4. data/config/initializers/patches.rb +6 -0
  5. data/config/initializers/recaptcha.rb +16 -14
  6. data/lib/card.rb +4 -3
  7. data/lib/card/format/nest/fetch.rb +1 -3
  8. data/lib/card/migration/deck_structure.rb +18 -0
  9. data/lib/card/query/attributes.rb +1 -1
  10. data/lib/card/query/clause.rb +6 -7
  11. data/lib/card/query/interpretation.rb +5 -1
  12. data/lib/card/query/value.rb +29 -19
  13. data/lib/card/set/event.rb +52 -28
  14. data/lib/card/set/event/delayed_event.rb +3 -3
  15. data/lib/card/set/format/haml_views.rb +1 -1
  16. data/lib/card/tasks/card.rake +7 -0
  17. data/lib/card/tasks/card/migrate.rake +29 -0
  18. data/lib/card/view/options.rb +7 -189
  19. data/lib/card/view/options/key_lists.rb +41 -0
  20. data/lib/card/view/options/voo_api.rb +165 -0
  21. data/lib/cardio.rb +16 -7
  22. data/lib/cardio/schema.rb +6 -1
  23. data/mod/basic_formats/set/all/base.rb +7 -3
  24. data/mod/basic_formats/set/self/head.rb +5 -0
  25. data/mod/carrierwave/config/core_initializers/carrierwave.rb +7 -0
  26. data/mod/core/set/all/name_validations.rb +3 -4
  27. data/mod/machines/file/all_script_machine_output/file.js +75 -23
  28. data/mod/machines/file/all_style_machine_output/file.css +2 -2
  29. data/mod/machines/lib/javascript/decko.js.coffee +1 -1
  30. data/mod/machines/lib/javascript/decko_filter.js.coffee +18 -10
  31. data/mod/pointer/set/abstract/02_pointer.rb +1 -1
  32. data/mod/pointer/set/abstract/02_pointer/filtered.rb +3 -1
  33. data/mod/pointer/template/abstract/02_pointer/filtered/filter_items.haml +2 -1
  34. data/mod/pointer/template/abstract/02_pointer/filtered/filtered_list_input.haml +3 -2
  35. data/mod/search/set/abstract/01_filter_form_helper.rb +8 -0
  36. data/mod/search/set/abstract/{01_search_params.rb → 02_search_params.rb} +0 -0
  37. data/mod/search/set/abstract/03_filter.rb +1 -1
  38. data/mod/search/set/abstract/wql_search.rb +7 -0
  39. data/mod/search/template/abstract/03_filter/filter_form.haml +24 -22
  40. data/mod/search/template/abstract/search/checkbox_item.haml +1 -1
  41. metadata +9 -6
  42. data/mod/search/set/abstract/02_filter_formgroups.rb +0 -134
@@ -15,27 +15,29 @@
15
15
  %input{ type: :hidden, name: "filter[not_ids]", class: "_not-ids", value: not_ids }
16
16
  .d-flex.flex-row
17
17
  - if sort_input_field
18
- %i.material-icons.text-muted.md-24.p-2 sort
19
- .input-group.sort-input-group.mb-2.card-outline-primary.mr-2
20
- %span.input-group-addon sort
21
- = sort_input_field
18
+ .sort-in-filter-form
19
+ %i.material-icons.text-muted.md-24.p-2.float-left sort
20
+ .input-group.sort-input-group.mb-2.card-outline-primary.mr-5
21
+ %span.input-group-addon sort
22
+ = sort_input_field
22
23
 
23
- %i.material-icons.text-muted.md-24.p-2 search
24
- ._filter-container.d-flex.flew-row.flex-wrap
25
- - categories.each do |key, category|
26
- - if category[:active]
27
- = haml_partial :filter_input, key: key, category: category
24
+ .filter-in-filter-form
25
+ %i.material-icons.text-muted.md-24.p-2.float-left search
26
+ ._filter-container.d-flex.flew-row.flex-wrap
27
+ - categories.each do |key, category|
28
+ - if category[:active]
29
+ = haml_partial :filter_input, key: key, category: category
28
30
 
29
- .dropdown._add-filter-dropdown
30
- %button.btn.btn-secondary.dropdown-toggle{"aria-expanded": "false",
31
- "aria-haspopup": "true",
32
- "data-toggle": "dropdown",
33
- type: "button" }
34
- Add filter
35
- .dropdown-menu
36
- - categories.each do |key, category|
37
- %a.dropdown-item._filter-category-select{style: ("display: none;" if category[:active]),
38
- "data-category" => key,
39
- "data-label" => category[:label],
40
- :href => "#"}
41
- = category[:label]
31
+ .dropdown._add-filter-dropdown
32
+ %button.btn.btn-secondary.dropdown-toggle{"aria-expanded": "false",
33
+ "aria-haspopup": "true",
34
+ "data-toggle": "dropdown",
35
+ type: "button" }
36
+ Add filter
37
+ .dropdown-menu
38
+ - categories.each do |key, category|
39
+ %a.dropdown-item._filter-category-select{style: ("display: none;" if category[:active]),
40
+ "data-category" => key,
41
+ "data-label" => category[:label],
42
+ :href => "#"}
43
+ = category[:label]
@@ -2,6 +2,6 @@
2
2
  %table.search-checkbox-item._search-checkbox-item.w-100
3
3
  %tr
4
4
  %td.checkbox-side
5
- = check_box_tag "checkbox-#{unique_id}", item_card.key
5
+ = check_box_tag item_card.name, item_card.key
6
6
  %td.item-view-side{ style: "background: #fff" }
7
7
  = nest_item item_card
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.93.6
4
+ version: 1.93.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-12-16 00:00:00.000000000 Z
14
+ date: 2018-01-21 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cardname
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.3.6
22
+ version: 0.3.7
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.3.6
29
+ version: 0.3.7
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: haml
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -479,6 +479,7 @@ files:
479
479
  - lib/card/mailer.rb
480
480
  - lib/card/migration.rb
481
481
  - lib/card/migration/core.rb
482
+ - lib/card/migration/deck_structure.rb
482
483
  - lib/card/migration/import.rb
483
484
  - lib/card/migration/import/import_data.rb
484
485
  - lib/card/migration/import/import_data/card_attributes.rb
@@ -551,6 +552,8 @@ files:
551
552
  - lib/card/view/cache.rb
552
553
  - lib/card/view/cache_action.rb
553
554
  - lib/card/view/options.rb
555
+ - lib/card/view/options/key_lists.rb
556
+ - lib/card/view/options/voo_api.rb
554
557
  - lib/card/view/stub.rb
555
558
  - lib/card/view/visibility.rb
556
559
  - lib/cardio.rb
@@ -3263,6 +3266,7 @@ files:
3263
3266
  - mod/bootstrap/vendor/select2/tests/vendor/qunit-1.23.1.js
3264
3267
  - mod/bootstrap/vendor/select2/vendor/jquery-2.1.0.js
3265
3268
  - mod/carrierwave/Gemfile
3269
+ - mod/carrierwave/config/core_initializers/carrierwave.rb
3266
3270
  - mod/carrierwave/lib/carrier_wave/cardmount.rb
3267
3271
  - mod/carrierwave/lib/carrier_wave/file_card_uploader.rb
3268
3272
  - mod/carrierwave/lib/carrier_wave/image_card_uploader.rb
@@ -3522,8 +3526,7 @@ files:
3522
3526
  - mod/search/lib/card/filter_query.rb
3523
3527
  - mod/search/set/abstract/00_filter_helper.rb
3524
3528
  - mod/search/set/abstract/01_filter_form_helper.rb
3525
- - mod/search/set/abstract/01_search_params.rb
3526
- - mod/search/set/abstract/02_filter_formgroups.rb
3529
+ - mod/search/set/abstract/02_search_params.rb
3527
3530
  - mod/search/set/abstract/03_filter.rb
3528
3531
  - mod/search/set/abstract/04_right_filter_form.rb
3529
3532
  - mod/search/set/abstract/search.rb
@@ -1,134 +0,0 @@
1
- include_set Abstract::FilterFormHelper
2
-
3
- # FIXME: the vast majority of these need to be moved back to wikirate
4
- format :html do
5
- view :filter_name_formgroup, cache: :never do
6
- text_filter :name
7
- end
8
-
9
- view :filter_project_formgroup, cache: :never do
10
- select_filter_type_based :project
11
- end
12
-
13
- view :filter_year_formgroup, cache: :never do
14
- select_filter :year, "Year", "most recent"
15
- end
16
-
17
- view :filter_wikirate_topic_formgroup, cache: :never do
18
- # select_filter_type_based :wikirate_topic
19
- autocomplete_filter :wikirate_topic
20
- end
21
-
22
- view :filter_metric_formgroup, cache: :never do
23
- # select_filter_type_based :metric
24
- autocomplete_filter :metric
25
- end
26
-
27
- view :filter_wikirate_company_formgroup, cache: :never do
28
- # select_filter_type_based :wikirate_company
29
- autocomplete_filter :wikirate_company
30
- end
31
-
32
- view :filter_research_policy_formgroup, cache: :never do
33
- multiselect_filter :research_policy, "Research Policy"
34
- end
35
-
36
- def research_policy_select
37
- select_filter_type_based :research_policy
38
- end
39
-
40
- view :filter_metric_type_formgroup, cache: :never do
41
- multiselect_filter :metric_type, "Metric Type"
42
- end
43
-
44
- def metric_type_select
45
- select_filter :metric_type, "Metric Type"
46
- end
47
-
48
- view :filter_metric_value_formgroup, cache: :never do
49
- select_filter :metric_value, "Value", "exists"
50
- end
51
-
52
- view :filter_designer_formgroup, cache: :never do
53
- select_filter :designer, "Designer"
54
- end
55
-
56
- view :filter_importance_formgroup, cache: :never do
57
- multiselect_filter :importance, "My Vote", %w[upvotes novotes]
58
- end
59
-
60
- view :filter_industry_formgroup, cache: :never do
61
- select_filter :industry, "Industry"
62
- end
63
-
64
- def sort_options
65
- {}
66
- end
67
-
68
- def default_year_option
69
- { "Most Recent" => "latest" }
70
- end
71
-
72
- def year_options
73
- type_options(:year, "desc").each_with_object(default_year_option) do |v, h|
74
- h[v] = v
75
- end
76
- end
77
-
78
- def metric_value_options
79
- opts = {
80
- "All" => "all",
81
- "Researched" => "exists",
82
- "Known" => "known",
83
- "Unknown" => "unknown",
84
- "Not Researched" => "none",
85
- "Edited today" => "today",
86
- "Edited this week" => "week",
87
- "Edited this month" => "month",
88
- "Outliers" => "outliers"
89
- }
90
- return opts unless filter_param(:range)
91
- opts.each_with_object({}) do |(k, v), h|
92
- h[add_range(k, v)] = v
93
- end
94
- end
95
-
96
- def add_range key, _value
97
- key # unless selected_value?(value)
98
- # range = filter_param :range
99
- # "#{range[:from]} <= #{key} < #{range[:to]}"
100
- end
101
-
102
- def selected_value? value
103
- (filter_param(:metric_value) && value == filter_param(:metric_value)) ||
104
- value == "exists"
105
- end
106
-
107
- def metric_type_options
108
- %i[researched formula wiki_rating].map { |n| Card.quick_fetch(n).name }
109
- end
110
-
111
- def research_policy_options
112
- type_options :research_policy
113
- end
114
-
115
- def importance_options
116
- { "I voted FOR" => :upvotes,
117
- "I voted AGAINST" => :downvotes,
118
- "I did NOT vote" => :novotes }
119
- end
120
-
121
- def industry_options
122
- card_name = CompanyFilterQuery::INDUSTRY_METRIC_NAME
123
- Card[card_name].value_options
124
- end
125
-
126
- def designer_options
127
- metrics = Card.search type_id: MetricID, return: :name
128
- metrics.map do |m|
129
- names = m.to_name.parts
130
- # score metric?
131
- names.length == 3 ? names[2] : names[0]
132
- end.uniq!(&:downcase).sort_by!(&:downcase)
133
- end
134
- end