hubspot-api-client 4.0.0 → 7.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -1
  3. data/lib/hubspot-api-client.rb +8 -0
  4. data/lib/hubspot/codegen/cms/audit-logs/api/default_api.rb +1 -1
  5. data/lib/hubspot/codegen/cms/performance/configuration.rb +0 -7
  6. data/lib/hubspot/codegen/cms/site-search/models/search_hit_field.rb +4 -2
  7. data/lib/hubspot/codegen/crm/companies/api/associations_api.rb +2 -2
  8. data/lib/hubspot/codegen/crm/companies/api/basic_api.rb +20 -12
  9. data/lib/hubspot/codegen/crm/companies/api/batch_api.rb +40 -24
  10. data/lib/hubspot/codegen/crm/companies/api/search_api.rb +10 -6
  11. data/lib/hubspot/codegen/crm/companies/models/batch_read_input_simple_public_object_id.rb +20 -20
  12. data/lib/hubspot/codegen/crm/companies/models/batch_response_simple_public_object.rb +29 -38
  13. data/lib/hubspot/codegen/crm/companies/models/batch_response_simple_public_object_with_errors.rb +333 -0
  14. data/lib/hubspot/codegen/crm/companies/models/filter.rb +15 -15
  15. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_batch_input.rb +18 -18
  16. data/lib/hubspot/codegen/crm/contacts/api/associations_api.rb +2 -2
  17. data/lib/hubspot/codegen/crm/contacts/api/basic_api.rb +20 -12
  18. data/lib/hubspot/codegen/crm/contacts/api/batch_api.rb +40 -24
  19. data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +10 -6
  20. data/lib/hubspot/codegen/crm/contacts/models/batch_read_input_simple_public_object_id.rb +20 -20
  21. data/lib/hubspot/codegen/crm/contacts/models/batch_response_simple_public_object.rb +29 -38
  22. data/lib/hubspot/codegen/crm/contacts/models/batch_response_simple_public_object_with_errors.rb +333 -0
  23. data/lib/hubspot/codegen/crm/contacts/models/filter.rb +15 -15
  24. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_batch_input.rb +18 -18
  25. data/lib/hubspot/codegen/crm/deals/api/associations_api.rb +2 -2
  26. data/lib/hubspot/codegen/crm/deals/api/basic_api.rb +20 -12
  27. data/lib/hubspot/codegen/crm/deals/api/batch_api.rb +40 -24
  28. data/lib/hubspot/codegen/crm/deals/api/search_api.rb +10 -6
  29. data/lib/hubspot/codegen/crm/deals/models/batch_read_input_simple_public_object_id.rb +20 -20
  30. data/lib/hubspot/codegen/crm/deals/models/batch_response_simple_public_object.rb +29 -38
  31. data/lib/hubspot/codegen/crm/deals/models/batch_response_simple_public_object_with_errors.rb +333 -0
  32. data/lib/hubspot/codegen/crm/deals/models/filter.rb +15 -15
  33. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_batch_input.rb +18 -18
  34. data/lib/hubspot/codegen/crm/extensions/cards/configuration.rb +0 -7
  35. data/lib/hubspot/codegen/crm/line_items/api/associations_api.rb +2 -2
  36. data/lib/hubspot/codegen/crm/line_items/api/basic_api.rb +20 -12
  37. data/lib/hubspot/codegen/crm/line_items/api/batch_api.rb +40 -24
  38. data/lib/hubspot/codegen/crm/line_items/api/search_api.rb +10 -6
  39. data/lib/hubspot/codegen/crm/line_items/models/batch_read_input_simple_public_object_id.rb +20 -20
  40. data/lib/hubspot/codegen/crm/line_items/models/batch_response_simple_public_object.rb +29 -38
  41. data/lib/hubspot/codegen/crm/line_items/models/batch_response_simple_public_object_with_errors.rb +333 -0
  42. data/lib/hubspot/codegen/crm/line_items/models/filter.rb +15 -15
  43. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_batch_input.rb +18 -18
  44. data/lib/hubspot/codegen/crm/owners/api/default_api.rb +0 -2
  45. data/lib/hubspot/codegen/crm/products/api/associations_api.rb +2 -2
  46. data/lib/hubspot/codegen/crm/products/api/basic_api.rb +20 -12
  47. data/lib/hubspot/codegen/crm/products/api/batch_api.rb +40 -24
  48. data/lib/hubspot/codegen/crm/products/api/search_api.rb +10 -6
  49. data/lib/hubspot/codegen/crm/products/models/batch_read_input_simple_public_object_id.rb +20 -20
  50. data/lib/hubspot/codegen/crm/products/models/batch_response_simple_public_object.rb +29 -38
  51. data/lib/hubspot/codegen/crm/products/models/batch_response_simple_public_object_with_errors.rb +333 -0
  52. data/lib/hubspot/codegen/crm/products/models/filter.rb +15 -15
  53. data/lib/hubspot/codegen/crm/products/models/simple_public_object_batch_input.rb +18 -18
  54. data/lib/hubspot/codegen/crm/properties/api/batch_api.rb +30 -18
  55. data/lib/hubspot/codegen/crm/properties/api/core_api.rb +20 -12
  56. data/lib/hubspot/codegen/crm/properties/api/groups_api.rb +20 -12
  57. data/lib/hubspot/codegen/crm/properties/models/batch_read_input_property_name.rb +18 -18
  58. data/lib/hubspot/codegen/crm/properties/models/batch_response_property.rb +29 -23
  59. data/lib/hubspot/codegen/crm/properties/models/property_create.rb +14 -4
  60. data/lib/hubspot/codegen/crm/properties/models/property_update.rb +14 -4
  61. data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +1 -157
  62. data/lib/hubspot/codegen/crm/quotes/api/basic_api.rb +2 -190
  63. data/lib/hubspot/codegen/crm/quotes/api/batch_api.rb +11 -187
  64. data/lib/hubspot/codegen/crm/quotes/api/default_api.rb +426 -0
  65. data/lib/hubspot/codegen/crm/quotes/api/search_api.rb +11 -7
  66. data/lib/hubspot/codegen/crm/quotes/models/batch_read_input_simple_public_object_id.rb +20 -20
  67. data/lib/hubspot/codegen/crm/quotes/models/batch_response_simple_public_object.rb +29 -38
  68. data/lib/hubspot/codegen/crm/quotes/models/batch_response_simple_public_object_with_errors.rb +333 -0
  69. data/lib/hubspot/codegen/crm/quotes/models/filter.rb +15 -15
  70. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_batch_input.rb +18 -18
  71. data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +2 -2
  72. data/lib/hubspot/codegen/crm/tickets/api/basic_api.rb +20 -12
  73. data/lib/hubspot/codegen/crm/tickets/api/batch_api.rb +40 -24
  74. data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +10 -6
  75. data/lib/hubspot/codegen/crm/tickets/models/batch_read_input_simple_public_object_id.rb +20 -20
  76. data/lib/hubspot/codegen/crm/tickets/models/batch_response_simple_public_object.rb +29 -38
  77. data/lib/hubspot/codegen/crm/tickets/models/batch_response_simple_public_object_with_errors.rb +333 -0
  78. data/lib/hubspot/codegen/crm/tickets/models/filter.rb +15 -15
  79. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_batch_input.rb +18 -18
  80. data/lib/hubspot/codegen/oauth/configuration.rb +0 -14
  81. data/lib/hubspot/codegen/webhooks/api/subscriptions_api.rb +16 -12
  82. data/lib/hubspot/codegen/webhooks/configuration.rb +0 -7
  83. data/lib/hubspot/codegen/webhooks/models/batch_response_subscription_response.rb +1 -21
  84. data/lib/hubspot/codegen/webhooks/models/batch_response_subscription_response_with_errors.rb +331 -0
  85. data/lib/hubspot/codegen/webhooks/models/settings_response.rb +28 -28
  86. data/lib/hubspot/codegen/webhooks/models/subscription_create_request.rb +16 -13
  87. data/lib/hubspot/codegen/webhooks/models/subscription_patch_request.rb +7 -7
  88. data/lib/hubspot/codegen/webhooks/models/subscription_response.rb +45 -39
  89. data/lib/hubspot/version.rb +1 -1
  90. data/sample-apps/companies-app/Gemfile.lock +2 -2
  91. data/sample-apps/companies-app/app/lib/services/hubspot/associations/create.rb +1 -1
  92. data/sample-apps/companies-app/app/lib/services/hubspot/associations/delete.rb +1 -1
  93. data/sample-apps/companies-app/app/lib/services/hubspot/associations/get_by_id.rb +2 -2
  94. data/sample-apps/companies-app/app/lib/services/hubspot/companies/create.rb +1 -1
  95. data/sample-apps/companies-app/app/lib/services/hubspot/companies/search.rb +1 -1
  96. data/sample-apps/companies-app/app/lib/services/hubspot/companies/update.rb +1 -2
  97. data/sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb +1 -1
  98. data/sample-apps/contacts-app/Gemfile.lock +2 -2
  99. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/create.rb +1 -1
  100. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/search.rb +1 -1
  101. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/update.rb +1 -2
  102. data/sample-apps/contacts-app/app/lib/services/hubspot/properties/create.rb +1 -2
  103. data/sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb +1 -2
  104. data/sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/archive_batch.rb +1 -1
  105. data/sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/create_batch.rb +1 -1
  106. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/create.rb +1 -1
  107. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/search.rb +1 -1
  108. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/update.rb +1 -2
  109. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/archive_batch.rb +1 -1
  110. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/create_batch.rb +1 -1
  111. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/contacts/search.rb +1 -1
  112. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/properties/create.rb +1 -2
  113. data/sample-apps/trello-integration-app/.env.template +7 -0
  114. data/sample-apps/trello-integration-app/.gitignore +35 -0
  115. data/sample-apps/trello-integration-app/.rspec +1 -0
  116. data/sample-apps/trello-integration-app/.ruby-version +1 -0
  117. data/sample-apps/trello-integration-app/Dockerfile +22 -0
  118. data/sample-apps/trello-integration-app/Gemfile +38 -0
  119. data/sample-apps/trello-integration-app/Gemfile.lock +314 -0
  120. data/sample-apps/trello-integration-app/README.md +31 -0
  121. data/sample-apps/trello-integration-app/Rakefile +6 -0
  122. data/sample-apps/trello-integration-app/app/assets/config/manifest.js +3 -0
  123. data/sample-apps/trello-integration-app/app/assets/images/.keep +0 -0
  124. data/sample-apps/trello-integration-app/app/assets/images/right-arrow.png +0 -0
  125. data/sample-apps/trello-integration-app/app/assets/javascripts/application.js +22 -0
  126. data/sample-apps/trello-integration-app/app/assets/javascripts/cable.js +13 -0
  127. data/sample-apps/trello-integration-app/app/assets/javascripts/channels/.keep +0 -0
  128. data/sample-apps/trello-integration-app/app/assets/javascripts/jquery-spinner.min.js +11071 -0
  129. data/sample-apps/trello-integration-app/app/assets/javascripts/lodash.js +15972 -0
  130. data/sample-apps/trello-integration-app/app/assets/javascripts/mappings.js +78 -0
  131. data/sample-apps/trello-integration-app/app/assets/javascripts/typeahead.bundle.min.js +8 -0
  132. data/sample-apps/trello-integration-app/app/assets/stylesheets/application.css +46 -0
  133. data/sample-apps/trello-integration-app/app/assets/stylesheets/authorization.scss +34 -0
  134. data/sample-apps/trello-integration-app/app/assets/stylesheets/jquery-spinner.css +33 -0
  135. data/sample-apps/trello-integration-app/app/assets/stylesheets/mappings.scss +55 -0
  136. data/sample-apps/trello-integration-app/app/assets/stylesheets/navigation.scss +43 -0
  137. data/sample-apps/trello-integration-app/app/assets/stylesheets/search_frame.scss +81 -0
  138. data/sample-apps/trello-integration-app/app/controllers/application_controller.rb +38 -0
  139. data/sample-apps/trello-integration-app/app/controllers/concerns/.keep +0 -0
  140. data/sample-apps/trello-integration-app/app/controllers/concerns/exception_handler.rb +12 -0
  141. data/sample-apps/trello-integration-app/app/controllers/home_controller.rb +20 -0
  142. data/sample-apps/trello-integration-app/app/controllers/mappings_controller.rb +64 -0
  143. data/sample-apps/trello-integration-app/app/controllers/oauth/authorization_controller.rb +28 -0
  144. data/sample-apps/trello-integration-app/app/controllers/trello/cards_controller.rb +94 -0
  145. data/sample-apps/trello-integration-app/app/controllers/trello/webhooks_controller.rb +30 -0
  146. data/sample-apps/trello-integration-app/app/helpers/application_helper.rb +2 -0
  147. data/sample-apps/trello-integration-app/app/helpers/oauth/authorization_helper.rb +11 -0
  148. data/sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/authorize.rb +17 -0
  149. data/sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/get_authorization_uri.rb +35 -0
  150. data/sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/base.rb +21 -0
  151. data/sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/generate.rb +28 -0
  152. data/sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/refresh.rb +35 -0
  153. data/sample-apps/trello-integration-app/app/lib/services/hubspot/deals/get_by_id.rb +15 -0
  154. data/sample-apps/trello-integration-app/app/lib/services/hubspot/deals/update.rb +17 -0
  155. data/sample-apps/trello-integration-app/app/lib/services/hubspot/extensions_cards/create.rb +82 -0
  156. data/sample-apps/trello-integration-app/app/lib/services/hubspot/pipelines/get_all.rb +11 -0
  157. data/sample-apps/trello-integration-app/app/lib/services/hubspot/pipelines/get_by_id.rb +15 -0
  158. data/sample-apps/trello-integration-app/app/lib/services/trello/authorization/authorize.rb +20 -0
  159. data/sample-apps/trello-integration-app/app/lib/services/trello/boards/get_all.rb +11 -0
  160. data/sample-apps/trello-integration-app/app/lib/services/trello/boards/get_by_id.rb +19 -0
  161. data/sample-apps/trello-integration-app/app/lib/services/trello/cards/format.rb +78 -0
  162. data/sample-apps/trello-integration-app/app/lib/services/trello/cards/get_by_id.rb +15 -0
  163. data/sample-apps/trello-integration-app/app/lib/services/trello/cards/search.rb +15 -0
  164. data/sample-apps/trello-integration-app/app/lib/services/trello/webhooks/create.rb +31 -0
  165. data/sample-apps/trello-integration-app/app/lib/services/trello/webhooks/delete.rb +17 -0
  166. data/sample-apps/trello-integration-app/app/lib/services/trello/webhooks/update.rb +19 -0
  167. data/sample-apps/trello-integration-app/app/models/application_record.rb +3 -0
  168. data/sample-apps/trello-integration-app/app/models/concerns/.keep +0 -0
  169. data/sample-apps/trello-integration-app/app/models/deal_association.rb +2 -0
  170. data/sample-apps/trello-integration-app/app/models/extension_card.rb +4 -0
  171. data/sample-apps/trello-integration-app/app/models/hubspot_token.rb +19 -0
  172. data/sample-apps/trello-integration-app/app/models/mapping.rb +2 -0
  173. data/sample-apps/trello-integration-app/app/models/trello_token.rb +19 -0
  174. data/sample-apps/trello-integration-app/app/models/webhook.rb +2 -0
  175. data/sample-apps/trello-integration-app/app/views/home/index.html.erb +23 -0
  176. data/sample-apps/trello-integration-app/app/views/home/success.html.erb +11 -0
  177. data/sample-apps/trello-integration-app/app/views/layouts/application.html.erb +23 -0
  178. data/sample-apps/trello-integration-app/app/views/mappings/_mapping.html.erb +13 -0
  179. data/sample-apps/trello-integration-app/app/views/mappings/index.html.erb +44 -0
  180. data/sample-apps/trello-integration-app/app/views/oauth/authorization/login.html.erb +42 -0
  181. data/sample-apps/trello-integration-app/app/views/shared/_header.html.erb +15 -0
  182. data/sample-apps/trello-integration-app/app/views/trello/cards/search_frame.html.erb +69 -0
  183. data/sample-apps/trello-integration-app/app/views/trello/cards/search_frame_success.html.erb +7 -0
  184. data/sample-apps/trello-integration-app/bin/bundle +3 -0
  185. data/sample-apps/trello-integration-app/bin/rails +9 -0
  186. data/sample-apps/trello-integration-app/bin/rake +9 -0
  187. data/sample-apps/trello-integration-app/bin/setup +36 -0
  188. data/sample-apps/trello-integration-app/bin/spring +17 -0
  189. data/sample-apps/trello-integration-app/bin/update +31 -0
  190. data/sample-apps/trello-integration-app/bin/yarn +11 -0
  191. data/sample-apps/trello-integration-app/config.ru +5 -0
  192. data/sample-apps/trello-integration-app/config/application.rb +20 -0
  193. data/sample-apps/trello-integration-app/config/boot.rb +3 -0
  194. data/sample-apps/trello-integration-app/config/cable.yml +10 -0
  195. data/sample-apps/trello-integration-app/config/database.yml +16 -0
  196. data/sample-apps/trello-integration-app/config/environment.rb +5 -0
  197. data/sample-apps/trello-integration-app/config/environments/development.rb +61 -0
  198. data/sample-apps/trello-integration-app/config/environments/production.rb +94 -0
  199. data/sample-apps/trello-integration-app/config/environments/test.rb +46 -0
  200. data/sample-apps/trello-integration-app/config/initializers/assets.rb +14 -0
  201. data/sample-apps/trello-integration-app/config/initializers/filter_parameter_logging.rb +4 -0
  202. data/sample-apps/trello-integration-app/config/initializers/hubspot-api-client.rb +3 -0
  203. data/sample-apps/trello-integration-app/config/initializers/mime_types.rb +1 -0
  204. data/sample-apps/trello-integration-app/config/initializers/omniauth.rb +11 -0
  205. data/sample-apps/trello-integration-app/config/initializers/trello.rb +1 -0
  206. data/sample-apps/trello-integration-app/config/initializers/wrap_parameters.rb +14 -0
  207. data/sample-apps/trello-integration-app/config/locales/en.yml +33 -0
  208. data/sample-apps/trello-integration-app/config/puma.rb +34 -0
  209. data/sample-apps/trello-integration-app/config/routes.rb +29 -0
  210. data/sample-apps/trello-integration-app/config/spring.rb +6 -0
  211. data/sample-apps/trello-integration-app/config/storage.yml +34 -0
  212. data/sample-apps/trello-integration-app/db/migrate/20200624132327_create_hubspot_tokens.rb +10 -0
  213. data/sample-apps/trello-integration-app/db/migrate/20200624132336_create_trello_tokens.rb +8 -0
  214. data/sample-apps/trello-integration-app/db/migrate/20200624132337_create_deal_associations.rb +8 -0
  215. data/sample-apps/trello-integration-app/db/migrate/20200702130530_create_extension_cards.rb +8 -0
  216. data/sample-apps/trello-integration-app/db/migrate/20200715143913_create_mappings.rb +12 -0
  217. data/sample-apps/trello-integration-app/db/migrate/20200727083656_create_webhooks.rb +9 -0
  218. data/sample-apps/trello-integration-app/db/schema.rb +52 -0
  219. data/sample-apps/trello-integration-app/db/seeds.rb +7 -0
  220. data/sample-apps/trello-integration-app/docker-compose.yml +41 -0
  221. data/sample-apps/trello-integration-app/docker-entrypoint.sh +8 -0
  222. data/sample-apps/trello-integration-app/lib/assets/.keep +0 -0
  223. data/sample-apps/trello-integration-app/lib/middlewares/trello_payload_params_handler.rb +18 -0
  224. data/sample-apps/trello-integration-app/lib/tasks/.keep +0 -0
  225. data/sample-apps/trello-integration-app/log/.keep +0 -0
  226. data/sample-apps/trello-integration-app/package.json +5 -0
  227. data/sample-apps/trello-integration-app/public/404.html +67 -0
  228. data/sample-apps/trello-integration-app/public/422.html +67 -0
  229. data/sample-apps/trello-integration-app/public/500.html +66 -0
  230. data/sample-apps/trello-integration-app/public/favicon.ico +0 -0
  231. data/sample-apps/trello-integration-app/public/robots.txt +1 -0
  232. data/sample-apps/trello-integration-app/tmp/.keep +0 -0
  233. data/sample-apps/webhooks-contacts-app/app/lib/services/hubspot/contacts/get_batch.rb +1 -4
  234. metadata +277 -2
@@ -0,0 +1,78 @@
1
+ $(document).ready(function(){
2
+ $('select#boards, select#pipelines').on('change', fetchMappings);
3
+ $('form.mapping-select').on('ajax:success', createMapping);
4
+
5
+ });
6
+
7
+ function removeMapping(e) {
8
+ e.preventDefault();
9
+ $.ajax({
10
+ type: "DELETE",
11
+ url: `/mappings/${$(this).siblings('.mapping-id').data('id')}`,
12
+ dataType: 'json',
13
+ success: function(result) {
14
+ $(`.mapping-id[data-id="${result.data.id}"]`).parent().remove();
15
+ }
16
+ });
17
+ }
18
+
19
+ function createMapping(event) {
20
+ [response, _, _] = event.detail;
21
+ addMappingtoDOM(response.data.mapping);
22
+
23
+ }
24
+
25
+ function addMappingtoDOM(mappingData) {
26
+ var mappingRow = $('.mapping-row.template').clone().removeClass('template');
27
+ mappingRow.find('.board-list-id').text(mappingData.board_list_name);
28
+ mappingRow.find('.pipeline-stage-id').text(mappingData.pipeline_stage_label);
29
+ mappingRow.find('.mapping-id').attr('data-id', mappingData.id);
30
+ mappingRow.find('.remove-button').on('click', removeMapping);
31
+ $('.mapping-row.template').parent().append(mappingRow);
32
+ }
33
+
34
+ function fetchMappings() {
35
+ var spinner = new jQuerySpinner({
36
+ parentClass: 'wrapper'
37
+ });
38
+
39
+ spinner.show();
40
+
41
+ $.ajax({
42
+ url: "/mappings",
43
+ type: 'GET',
44
+ dataType: 'json',
45
+ data: {
46
+ board_id: $('#boards option:selected').val(),
47
+ pipeline_id: $('#pipelines option:selected').val(),
48
+ },
49
+ success: function(rsp){
50
+ if (rsp.status == 'ok'){
51
+ spinner.hide();
52
+ $('.mapping-row').not('.template').remove();
53
+ if (rsp.data.board_lists != null && rsp.data.pipeline_stages != null) {
54
+ if (rsp.data.mappings != null) {
55
+ $('.mapping-headers').css('display', 'flex');
56
+
57
+ _.each(rsp.data.mappings, function(mapping) { addMappingtoDOM(mapping) });
58
+ }
59
+ $('.mapping-select').css('display', 'flex');
60
+
61
+ _.each(rsp.data.board_lists, function(board_list){
62
+ $('#mapping_board_list_id').append(`<option value="${board_list.id}">${board_list.name}</option>`);
63
+ });
64
+
65
+ _.each(rsp.data.pipeline_stages, function(pipeline_stage){
66
+ $('#mapping_pipeline_stage_id').append(`<option value="${pipeline_stage.id}">${pipeline_stage.label}</option>`);
67
+ });
68
+
69
+ $('#mapping_board_id').val(rsp.data.board_id);
70
+ $('#mapping_pipeline_id').val(rsp.data.pipeline_id);
71
+ } else {
72
+ $('.mapping-select').hide();
73
+ $('.mapping-headers').hide();
74
+ }
75
+ }
76
+ }
77
+ });
78
+ }
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * typeahead.js 0.11.1
3
+ * https://github.com/twitter/typeahead.js
4
+ * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
5
+ */
6
+
7
+ !function(a,b){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(c){return a.Bloodhound=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):a.Bloodhound=b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c="0.11.1",d=function(){"use strict";function a(a){return a=b.toStr(a),a?a.split(/\s+/):[]}function c(a){return a=b.toStr(a),a?a.split(/\W+/):[]}function d(a){return function(c){return c=b.isArray(c)?c:[].slice.call(arguments,0),function(d){var e=[];return b.each(c,function(c){e=e.concat(a(b.toStr(d[c])))}),e}}}return{nonword:c,whitespace:a,obj:{nonword:d(c),whitespace:d(a)}}}(),e=function(){"use strict";function c(c){this.maxSize=b.isNumber(c)?c:100,this.reset(),this.maxSize<=0&&(this.set=this.get=a.noop)}function d(){this.head=this.tail=null}function e(a,b){this.key=a,this.val=b,this.prev=this.next=null}return b.mixin(c.prototype,{set:function(a,b){var c,d=this.list.tail;this.size>=this.maxSize&&(this.list.remove(d),delete this.hash[d.key],this.size--),(c=this.hash[a])?(c.val=b,this.list.moveToFront(c)):(c=new e(a,b),this.list.add(c),this.hash[a]=c,this.size++)},get:function(a){var b=this.hash[a];return b?(this.list.moveToFront(b),b.val):void 0},reset:function(){this.size=0,this.hash={},this.list=new d}}),b.mixin(d.prototype,{add:function(a){this.head&&(a.next=this.head,this.head.prev=a),this.head=a,this.tail=this.tail||a},remove:function(a){a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev},moveToFront:function(a){this.remove(a),this.add(a)}}),c}(),f=function(){"use strict";function c(a,c){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+b.escapeRegExChars(this.prefix)),this.ls=c||h,!this.ls&&this._noop()}function d(){return(new Date).getTime()}function e(a){return JSON.stringify(b.isUndefined(a)?null:a)}function f(b){return a.parseJSON(b)}function g(a){var b,c,d=[],e=h.length;for(b=0;e>b;b++)(c=h.key(b)).match(a)&&d.push(c.replace(a,""));return d}var h;try{h=window.localStorage,h.setItem("~~~","!"),h.removeItem("~~~")}catch(i){h=null}return b.mixin(c.prototype,{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=b.noop},_safeSet:function(a,b){try{this.ls.setItem(a,b)}catch(c){"QuotaExceededError"===c.name&&(this.clear(),this._noop())}},get:function(a){return this.isExpired(a)&&this.remove(a),f(this.ls.getItem(this._prefix(a)))},set:function(a,c,f){return b.isNumber(f)?this._safeSet(this._ttlKey(a),e(d()+f)):this.ls.removeItem(this._ttlKey(a)),this._safeSet(this._prefix(a),e(c))},remove:function(a){return this.ls.removeItem(this._ttlKey(a)),this.ls.removeItem(this._prefix(a)),this},clear:function(){var a,b=g(this.keyMatcher);for(a=b.length;a--;)this.remove(b[a]);return this},isExpired:function(a){var c=f(this.ls.getItem(this._ttlKey(a)));return b.isNumber(c)&&d()>c?!0:!1}}),c}(),g=function(){"use strict";function c(a){a=a||{},this.cancelled=!1,this.lastReq=null,this._send=a.transport,this._get=a.limiter?a.limiter(this._get):this._get,this._cache=a.cache===!1?new e(0):h}var d=0,f={},g=6,h=new e(10);return c.setMaxPendingRequests=function(a){g=a},c.resetCache=function(){h.reset()},b.mixin(c.prototype,{_fingerprint:function(b){return b=b||{},b.url+b.type+a.param(b.data||{})},_get:function(a,b){function c(a){b(null,a),k._cache.set(i,a)}function e(){b(!0)}function h(){d--,delete f[i],k.onDeckRequestArgs&&(k._get.apply(k,k.onDeckRequestArgs),k.onDeckRequestArgs=null)}var i,j,k=this;i=this._fingerprint(a),this.cancelled||i!==this.lastReq||((j=f[i])?j.done(c).fail(e):g>d?(d++,f[i]=this._send(a).done(c).fail(e).always(h)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(c,d){var e,f;d=d||a.noop,c=b.isString(c)?{url:c}:c||{},f=this._fingerprint(c),this.cancelled=!1,this.lastReq=f,(e=this._cache.get(f))?d(null,e):this._get(c,d)},cancel:function(){this.cancelled=!0}}),c}(),h=window.SearchIndex=function(){"use strict";function c(c){c=c||{},c.datumTokenizer&&c.queryTokenizer||a.error("datumTokenizer and queryTokenizer are both required"),this.identify=c.identify||b.stringify,this.datumTokenizer=c.datumTokenizer,this.queryTokenizer=c.queryTokenizer,this.reset()}function d(a){return a=b.filter(a,function(a){return!!a}),a=b.map(a,function(a){return a.toLowerCase()})}function e(){var a={};return a[i]=[],a[h]={},a}function f(a){for(var b={},c=[],d=0,e=a.length;e>d;d++)b[a[d]]||(b[a[d]]=!0,c.push(a[d]));return c}function g(a,b){var c=0,d=0,e=[];a=a.sort(),b=b.sort();for(var f=a.length,g=b.length;f>c&&g>d;)a[c]<b[d]?c++:a[c]>b[d]?d++:(e.push(a[c]),c++,d++);return e}var h="c",i="i";return b.mixin(c.prototype,{bootstrap:function(a){this.datums=a.datums,this.trie=a.trie},add:function(a){var c=this;a=b.isArray(a)?a:[a],b.each(a,function(a){var f,g;c.datums[f=c.identify(a)]=a,g=d(c.datumTokenizer(a)),b.each(g,function(a){var b,d,g;for(b=c.trie,d=a.split("");g=d.shift();)b=b[h][g]||(b[h][g]=e()),b[i].push(f)})})},get:function(a){var c=this;return b.map(a,function(a){return c.datums[a]})},search:function(a){var c,e,j=this;return c=d(this.queryTokenizer(a)),b.each(c,function(a){var b,c,d,f;if(e&&0===e.length)return!1;for(b=j.trie,c=a.split("");b&&(d=c.shift());)b=b[h][d];return b&&0===c.length?(f=b[i].slice(0),void(e=e?g(e,f):f)):(e=[],!1)}),e?b.map(f(e),function(a){return j.datums[a]}):[]},all:function(){var a=[];for(var b in this.datums)a.push(this.datums[b]);return a},reset:function(){this.datums={},this.trie=e()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),c}(),i=function(){"use strict";function a(a){this.url=a.url,this.ttl=a.ttl,this.cache=a.cache,this.prepare=a.prepare,this.transform=a.transform,this.transport=a.transport,this.thumbprint=a.thumbprint,this.storage=new f(a.cacheKey)}var c;return c={data:"data",protocol:"protocol",thumbprint:"thumbprint"},b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(a){this.cache&&(this.storage.set(c.data,a,this.ttl),this.storage.set(c.protocol,location.protocol,this.ttl),this.storage.set(c.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var a,b={};return this.cache?(b.data=this.storage.get(c.data),b.protocol=this.storage.get(c.protocol),b.thumbprint=this.storage.get(c.thumbprint),a=b.thumbprint!==this.thumbprint||b.protocol!==location.protocol,b.data&&!a?b.data:null):null},fromNetwork:function(a){function b(){a(!0)}function c(b){a(null,e.transform(b))}var d,e=this;a&&(d=this.prepare(this._settings()),this.transport(d).fail(b).done(c))},clear:function(){return this.storage.clear(),this}}),a}(),j=function(){"use strict";function a(a){this.url=a.url,this.prepare=a.prepare,this.transform=a.transform,this.transport=new g({cache:a.cache,limiter:a.limiter,transport:a.transport})}return b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(a,b){function c(a,c){b(a?[]:e.transform(c))}var d,e=this;if(b)return a=a||"",d=this.prepare(a,this._settings()),this.transport.get(d,c)},cancelLastRequest:function(){this.transport.cancel()}}),a}(),k=function(){"use strict";function d(d){var e;return d?(e={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:b.identity,transform:b.identity,transport:null},d=b.isString(d)?{url:d}:d,d=b.mixin(e,d),!d.url&&a.error("prefetch requires url to be set"),d.transform=d.filter||d.transform,d.cacheKey=d.cacheKey||d.url,d.thumbprint=c+d.thumbprint,d.transport=d.transport?h(d.transport):a.ajax,d):null}function e(c){var d;if(c)return d={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:b.identity,transport:null},c=b.isString(c)?{url:c}:c,c=b.mixin(d,c),!c.url&&a.error("remote requires url to be set"),c.transform=c.filter||c.transform,c.prepare=f(c),c.limiter=g(c),c.transport=c.transport?h(c.transport):a.ajax,delete c.replace,delete c.wildcard,delete c.rateLimitBy,delete c.rateLimitWait,c}function f(a){function b(a,b){return b.url=f(b.url,a),b}function c(a,b){return b.url=b.url.replace(g,encodeURIComponent(a)),b}function d(a,b){return b}var e,f,g;return e=a.prepare,f=a.replace,g=a.wildcard,e?e:e=f?b:a.wildcard?c:d}function g(a){function c(a){return function(c){return b.debounce(c,a)}}function d(a){return function(c){return b.throttle(c,a)}}var e,f,g;return e=a.limiter,f=a.rateLimitBy,g=a.rateLimitWait,e||(e=/^throttle$/i.test(f)?d(g):c(g)),e}function h(c){return function(d){function e(a){b.defer(function(){g.resolve(a)})}function f(a){b.defer(function(){g.reject(a)})}var g=a.Deferred();return c(d,e,f),g}}return function(c){var f,g;return f={initialize:!0,identify:b.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},c=b.mixin(f,c||{}),!c.datumTokenizer&&a.error("datumTokenizer is required"),!c.queryTokenizer&&a.error("queryTokenizer is required"),g=c.sorter,c.sorter=g?function(a){return a.sort(g)}:b.identity,c.local=b.isFunction(c.local)?c.local():c.local,c.prefetch=d(c.prefetch),c.remote=e(c.remote),c}}(),l=function(){"use strict";function c(a){a=k(a),this.sorter=a.sorter,this.identify=a.identify,this.sufficient=a.sufficient,this.local=a.local,this.remote=a.remote?new j(a.remote):null,this.prefetch=a.prefetch?new i(a.prefetch):null,this.index=new h({identify:this.identify,datumTokenizer:a.datumTokenizer,queryTokenizer:a.queryTokenizer}),a.initialize!==!1&&this.initialize()}var e;return e=window&&window.Bloodhound,c.noConflict=function(){return window&&(window.Bloodhound=e),c},c.tokenizers=d,b.mixin(c.prototype,{__ttAdapter:function(){function a(a,b,d){return c.search(a,b,d)}function b(a,b){return c.search(a,b)}var c=this;return this.remote?a:b},_loadPrefetch:function(){function b(a,b){return a?c.reject():(e.add(b),e.prefetch.store(e.index.serialize()),void c.resolve())}var c,d,e=this;return c=a.Deferred(),this.prefetch?(d=this.prefetch.fromCache())?(this.index.bootstrap(d),c.resolve()):this.prefetch.fromNetwork(b):c.resolve(),c.promise()},_initialize:function(){function a(){b.add(b.local)}var b=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(a),this.initPromise},initialize:function(a){return!this.initPromise||a?this._initialize():this.initPromise},add:function(a){return this.index.add(a),this},get:function(a){return a=b.isArray(a)?a:[].slice.call(arguments),this.index.get(a)},search:function(a,c,d){function e(a){var c=[];b.each(a,function(a){!b.some(f,function(b){return g.identify(a)===g.identify(b)})&&c.push(a)}),d&&d(c)}var f,g=this;return f=this.sorter(this.index.search(a)),c(this.remote?f.slice():f),this.remote&&f.length<this.sufficient?this.remote.get(a,e):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return g.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),c}();return l}),function(a,b){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c=function(){"use strict";function a(a){var g,h;return h=b.mixin({},f,a),g={css:e(),classes:h,html:c(h),selectors:d(h)},{css:g.css,html:g.html,classes:g.classes,selectors:g.selectors,mixin:function(a){b.mixin(a,g)}}}function c(a){return{wrapper:'<span class="'+a.wrapper+'"></span>',menu:'<div class="'+a.menu+'"></div>'}}function d(a){var c={};return b.each(a,function(a,b){c[b]="."+a}),c}function e(){var a={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),a}var f={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return a}(),d=function(){"use strict";function c(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d,e;return d="typeahead:",e={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},b.mixin(c.prototype,{_trigger:function(b,c){var e;return e=a.Event(d+b),(c=c||[]).unshift(e),this.$el.trigger.apply(this.$el,c),e},before:function(a){var b,c;return b=[].slice.call(arguments,1),c=this._trigger("before"+a,b),c.isDefaultPrevented()},trigger:function(a){var b;this._trigger(a,[].slice.call(arguments,1)),(b=e[a])&&this._trigger(b,[].slice.call(arguments,1))}}),c}(),e=function(){"use strict";function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift();)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&f>e;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function g(){var a;return a=window.setImmediate?function(a){setImmediate(function(){a()})}:function(a){setTimeout(function(){a()},0)}}function h(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var i=/\s+/,j=g();return{onSync:c,onAsync:b,off:d,trigger:e}}(),f=function(a){"use strict";function c(a,c,d){for(var e,f=[],g=0,h=a.length;h>g;g++)f.push(b.escapeRegExChars(a[g]));return e=d?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",c?new RegExp(e):new RegExp(e,"i")}var d={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(e){function f(b){var c,d,f;return(c=h.exec(b.data))&&(f=a.createElement(e.tagName),e.className&&(f.className=e.className),d=b.splitText(c.index),d.splitText(c[0].length),f.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(f,d)),!!c}function g(a,b){for(var c,d=3,e=0;e<a.childNodes.length;e++)c=a.childNodes[e],c.nodeType===d?e+=b(c)?1:0:g(c,b)}var h;e=b.mixin({},d,e),e.node&&e.pattern&&(e.pattern=b.isArray(e.pattern)?e.pattern:[e.pattern],h=c(e.pattern,e.caseSensitive,e.wordsOnly),g(e.node,f))}}(window.document),g=function(){"use strict";function c(c,e){c=c||{},c.input||a.error("input is missing"),e.mixin(this),this.$hint=a(c.hint),this.$input=a(c.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=d(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=b.noop)}function d(b){return a('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return c.normalizeQuery(a)===c.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;return h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},c.normalizeQuery=function(a){return b.toStr(a).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},b.mixin(c.prototype,e,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a),b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(a,b){var c;switch(a){case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkLanguageDirection:function(){var a=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==a&&(this.dir=a,this.$hint.attr("dir",a),this.trigger("langDirChanged",a))},_setQuery:function(a,b){var c,d;c=f(a,this.query),d=c?this.query.length!==a.length:!1,this.query=a,b||c?!b&&d&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var a,c,d,e,f=this;return a=b.bind(this._onBlur,this),c=b.bind(this._onFocus,this),d=b.bind(this._onKeydown,this),e=b.bind(this._onInput,this),this.$input.on("blur.tt",a).on("focus.tt",c).on("keydown.tt",d),!b.isMsie()||b.isMsie()>9?this.$input.on("input.tt",e):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){h[a.which||a.keyCode]||b.defer(b.bind(f._onInput,f,a))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(a,b){this.setInputValue(a),this._setQuery(a,b)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(a){this.$input.val(a),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue(),b=this.getHint(),c=a!==b&&0===b.indexOf(a),d=""!==a&&c&&!this.hasOverflow(),!d&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,c,d;return a=this.$input.val().length,c=this.$input[0].selectionStart,b.isNumber(c)?c===a:document.selection?(d=document.selection.createRange(),d.moveStart("character",-a),a===d.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=a("<div>")}}),c}(),h=function(){"use strict";function c(c,e){c=c||{},c.templates=c.templates||{},c.templates.notFound=c.templates.notFound||c.templates.empty,c.source||a.error("missing source"),c.node||a.error("missing node"),c.name&&!h(c.name)&&a.error("invalid dataset name: "+c.name),e.mixin(this),this.highlight=!!c.highlight,this.name=c.name||j(),this.limit=c.limit||5,this.displayFn=d(c.display||c.displayKey),this.templates=g(c.templates,this.displayFn),this.source=c.source.__ttAdapter?c.source.__ttAdapter():c.source,this.async=b.isUndefined(c.async)?this.source.length>2:!!c.async,this._resetLastSuggestion(),this.$el=a(c.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function d(a){function c(b){return b[a]}return a=a||b.stringify,b.isFunction(a)?a:c}function g(c,d){function e(b){return a("<div>").text(d(b))}return{notFound:c.notFound&&b.templatify(c.notFound),pending:c.pending&&b.templatify(c.pending),header:c.header&&b.templatify(c.header),footer:c.footer&&b.templatify(c.footer),suggestion:c.suggestion||e}}function h(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var i,j;return i={val:"tt-selectable-display",obj:"tt-selectable-object"},j=b.getIdGenerator(),c.extractData=function(b){var c=a(b);return c.data(i.obj)?{val:c.data(i.val)||"",obj:c.data(i.obj)||null}:null},b.mixin(c.prototype,e,{_overwrite:function(a,b){b=b||[],b.length?this._renderSuggestions(a,b):this.async&&this.templates.pending?this._renderPending(a):!this.async&&this.templates.notFound?this._renderNotFound(a):this._empty(),this.trigger("rendered",this.name,b,!1)},_append:function(a,b){b=b||[],b.length&&this.$lastSuggestion.length?this._appendSuggestions(a,b):b.length?this._renderSuggestions(a,b):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(a),this.trigger("rendered",this.name,b,!0)},_renderSuggestions:function(a,b){var c;c=this._getSuggestionsFragment(a,b),this.$lastSuggestion=c.children().last(),this.$el.html(c).prepend(this._getHeader(a,b)).append(this._getFooter(a,b))},_appendSuggestions:function(a,b){var c,d;c=this._getSuggestionsFragment(a,b),d=c.children().last(),this.$lastSuggestion.after(c),this.$lastSuggestion=d},_renderPending:function(a){var b=this.templates.pending;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_renderNotFound:function(a){var b=this.templates.notFound;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(c,d){var e,g=this;return e=document.createDocumentFragment(),b.each(d,function(b){var d,f;f=g._injectQuery(c,b),d=a(g.templates.suggestion(f)).data(i.obj,b).data(i.val,g.displayFn(b)).addClass(g.classes.suggestion+" "+g.classes.selectable),e.appendChild(d[0])}),this.highlight&&f({className:this.classes.highlight,node:e,pattern:c}),a(e)},_getFooter:function(a,b){return this.templates.footer?this.templates.footer({query:a,suggestions:b,dataset:this.name}):null},_getHeader:function(a,b){return this.templates.header?this.templates.header({query:a,suggestions:b,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=a()},_injectQuery:function(a,c){return b.isObject(c)?b.mixin({_query:a},c):c},update:function(b){function c(a){g||(g=!0,a=(a||[]).slice(0,e.limit),h=a.length,e._overwrite(b,a),h<e.limit&&e.async&&e.trigger("asyncRequested",b))}function d(c){c=c||[],!f&&h<e.limit&&(e.cancel=a.noop,h+=c.length,e._append(b,c.slice(0,e.limit-h)),e.async&&e.trigger("asyncReceived",b))}var e=this,f=!1,g=!1,h=0;this.cancel(),this.cancel=function(){f=!0,e.cancel=a.noop,e.async&&e.trigger("asyncCanceled",b)},this.source(b,c,d),!g&&c([])},cancel:a.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=a("<div>")}}),c}(),i=function(){"use strict";function c(c,d){function e(b){var c=f.$node.find(b.node).first();return b.node=c.length?c:a("<div>").appendTo(f.$node),new h(b,d)}var f=this;c=c||{},c.node||a.error("node is required"),d.mixin(this),this.$node=a(c.node),this.query=null,this.datasets=b.map(c.datasets,e)}return b.mixin(c.prototype,e,{_onSelectableClick:function(b){this.trigger("selectableClicked",a(b.currentTarget))},_onRendered:function(a,b,c,d){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",b,c,d)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){function a(a){return a.isEmpty()}return b.every(this.datasets,a)},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var a=this.getActiveSelectable();a&&a.removeClass(this.classes.cursor)},_ensureVisible:function(a){var b,c,d,e;b=a.position().top,c=b+a.outerHeight(!0),d=this.$node.scrollTop(),e=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),0>b?this.$node.scrollTop(d+b):c>e&&this.$node.scrollTop(d+(c-e))},bind:function(){var a,c=this;return a=b.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,a),b.each(this.datasets,function(a){a.onSync("asyncRequested",c._propagate,c).onSync("asyncCanceled",c._propagate,c).onSync("asyncReceived",c._propagate,c).onSync("rendered",c._onRendered,c).onSync("cleared",c._onCleared,c)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(a){this.$node.attr("dir",a)},selectableRelativeToCursor:function(a){var b,c,d,e;return c=this.getActiveSelectable(),b=this._getSelectables(),d=c?b.index(c):-1,e=d+a,e=(e+1)%(b.length+1)-1,e=-1>e?b.length-1:e,-1===e?null:b.eq(e)},setCursor:function(a){this._removeCursor(),(a=a&&a.first())&&(a.addClass(this.classes.cursor),this._ensureVisible(a))},getSelectableData:function(a){return a&&a.length?h.extractData(a):null},getActiveSelectable:function(){var a=this._getSelectables().filter(this.selectors.cursor).first();return a.length?a:null},getTopSelectable:function(){var a=this._getSelectables().first();return a.length?a:null},update:function(a){function c(b){b.update(a)}var d=a!==this.query;return d&&(this.query=a,b.each(this.datasets,c)),d},empty:function(){function a(a){a.clear()}b.each(this.datasets,a),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function c(a){a.destroy()}this.$node.off(".tt"),this.$node=a("<div>"),b.each(this.datasets,c)}}),c}(),j=function(){"use strict";function a(){i.apply(this,[].slice.call(arguments,0))}var c=i.prototype;return b.mixin(a.prototype,i.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),c.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),c.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(a){return this.$node.css("ltr"===a?this.css.ltr:this.css.rtl),c.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),a}(),k=function(){"use strict";function c(c,e){var f,g,h,i,j,k,l,m,n,o,p;c=c||{},c.input||a.error("missing input"),c.menu||a.error("missing menu"),c.eventBus||a.error("missing event bus"),e.mixin(this),this.eventBus=c.eventBus,this.minLength=b.isNumber(c.minLength)?c.minLength:1,this.input=c.input,this.menu=c.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),f=d(this,"activate","open","_onFocused"),g=d(this,"deactivate","_onBlurred"),h=d(this,"isActive","isOpen","_onEnterKeyed"),i=d(this,"isActive","isOpen","_onTabKeyed"),j=d(this,"isActive","_onEscKeyed"),k=d(this,"isActive","open","_onUpKeyed"),l=d(this,"isActive","open","_onDownKeyed"),m=d(this,"isActive","isOpen","_onLeftKeyed"),n=d(this,"isActive","isOpen","_onRightKeyed"),o=d(this,"_openIfActive","_onQueryChanged"),p=d(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",f,this).onSync("blurred",g,this).onSync("enterKeyed",h,this).onSync("tabKeyed",i,this).onSync("escKeyed",j,this).onSync("upKeyed",k,this).onSync("downKeyed",l,this).onSync("leftKeyed",m,this).onSync("rightKeyed",n,this).onSync("queryChanged",o,this).onSync("whitespaceChanged",p,this).onSync("langDirChanged",this._onLangDirChanged,this)}function d(a){var c=[].slice.call(arguments,1);return function(){var d=[].slice.call(arguments);b.each(c,function(b){return a[b].apply(a,d)})}}return b.mixin(c.prototype,{_hacks:function(){var c,d;c=this.input.$input||a("<div>"),d=this.menu.$node||a("<div>"),c.on("blur.tt",function(a){var e,f,g;
8
+ e=document.activeElement,f=d.is(e),g=d.has(e).length>0,b.isMsie()&&(f||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){c.focus()}))}),d.on("mousedown.tt",function(a){a.preventDefault()})},_onSelectableClicked:function(a,b){this.select(b)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(a,b,c,d){this._updateHint(),this.eventBus.trigger("render",c,d,b)},_onAsyncRequested:function(a,b,c){this.eventBus.trigger("asyncrequest",c,b)},_onAsyncCanceled:function(a,b,c){this.eventBus.trigger("asynccancel",c,b)},_onAsyncReceived:function(a,b,c){this.eventBus.trigger("asyncreceive",c,b)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())&&this.select(c)&&b.preventDefault()},_onTabKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())?this.select(c)&&b.preventDefault():(c=this.menu.getTopSelectable())&&this.autocomplete(c)&&b.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(a,b){this._minLengthMet(b)?this.menu.update(b):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(a,b){this.dir!==b&&(this.dir=b,this.menu.setLanguageDirection(b))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(a){return a=b.isString(a)?a:this.input.getQuery()||"",a.length>=this.minLength},_updateHint:function(){var a,c,d,e,f,h,i;a=this.menu.getTopSelectable(),c=this.menu.getSelectableData(a),d=this.input.getInputValue(),!c||b.isBlankString(d)||this.input.hasOverflow()?this.input.clearHint():(e=g.normalizeQuery(d),f=b.escapeRegExChars(e),h=new RegExp("^(?:"+f+")(.+$)","i"),i=h.exec(c.val),i&&this.input.setHint(d+i[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return this.isActive()?!0:!this.isEnabled()||this.eventBus.before("active")?!1:(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return this.isActive()?this.eventBus.before("idle")?!1:(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0):!0},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(a){this.input.setQuery(b.toStr(a))},getVal:function(){return this.input.getQuery()},select:function(a){var b=this.menu.getSelectableData(a);return b&&!this.eventBus.before("select",b.obj)?(this.input.setQuery(b.val,!0),this.eventBus.trigger("select",b.obj),this.close(),!0):!1},autocomplete:function(a){var b,c,d;return b=this.input.getQuery(),c=this.menu.getSelectableData(a),d=c&&b!==c.val,d&&!this.eventBus.before("autocomplete",c.obj)?(this.input.setQuery(c.val),this.eventBus.trigger("autocomplete",c.obj),!0):!1},moveCursor:function(a){var b,c,d,e,f;return b=this.input.getQuery(),c=this.menu.selectableRelativeToCursor(a),d=this.menu.getSelectableData(c),e=d?d.obj:null,f=this._minLengthMet()&&this.menu.update(b),f||this.eventBus.before("cursorchange",e)?!1:(this.menu.setCursor(c),d?this.input.setInputValue(d.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",e),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),c}();!function(){"use strict";function e(b,c){b.each(function(){var b,d=a(this);(b=d.data(p.typeahead))&&c(b,d)})}function f(a,b){return a.clone().addClass(b.classes.hint).removeData().css(b.css.hint).css(l(a)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function h(a,b){a.data(p.attrs,{dir:a.attr("dir"),autocomplete:a.attr("autocomplete"),spellcheck:a.attr("spellcheck"),style:a.attr("style")}),a.addClass(b.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!a.attr("dir")&&a.attr("dir","auto")}catch(c){}return a}function l(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function m(a){var c,d;c=a.data(p.www),d=a.parent().filter(c.selectors.wrapper),b.each(a.data(p.attrs),function(c,d){b.isUndefined(c)?a.removeAttr(d):a.attr(d,c)}),a.removeData(p.typeahead).removeData(p.www).removeData(p.attr).removeClass(c.classes.input),d.length&&(a.detach().insertAfter(d),d.remove())}function n(c){var d,e;return d=b.isJQuery(c)||b.isElement(c),e=d?a(c).first():[],e.length?e:null}var o,p,q;o=a.fn.typeahead,p={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},q={initialize:function(e,l){function m(){var c,m,q,r,s,t,u,v,w,x,y;b.each(l,function(a){a.highlight=!!e.highlight}),c=a(this),m=a(o.html.wrapper),q=n(e.hint),r=n(e.menu),s=e.hint!==!1&&!q,t=e.menu!==!1&&!r,s&&(q=f(c,o)),t&&(r=a(o.html.menu).css(o.css.menu)),q&&q.val(""),c=h(c,o),(s||t)&&(m.css(o.css.wrapper),c.css(s?o.css.input:o.css.inputWithNoHint),c.wrap(m).parent().prepend(s?q:null).append(t?r:null)),y=t?j:i,u=new d({el:c}),v=new g({hint:q,input:c},o),w=new y({node:r,datasets:l},o),x=new k({input:v,menu:w,eventBus:u,minLength:e.minLength},o),c.data(p.www,o),c.data(p.typeahead,x)}var o;return l=b.isArray(l)?l:[].slice.call(arguments,1),e=e||{},o=c(e.classNames),this.each(m)},isEnabled:function(){var a;return e(this.first(),function(b){a=b.isEnabled()}),a},enable:function(){return e(this,function(a){a.enable()}),this},disable:function(){return e(this,function(a){a.disable()}),this},isActive:function(){var a;return e(this.first(),function(b){a=b.isActive()}),a},activate:function(){return e(this,function(a){a.activate()}),this},deactivate:function(){return e(this,function(a){a.deactivate()}),this},isOpen:function(){var a;return e(this.first(),function(b){a=b.isOpen()}),a},open:function(){return e(this,function(a){a.open()}),this},close:function(){return e(this,function(a){a.close()}),this},select:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.select(d)}),c},autocomplete:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.autocomplete(d)}),c},moveCursor:function(a){var b=!1;return e(this.first(),function(c){b=c.moveCursor(a)}),b},val:function(a){var b;return arguments.length?(e(this,function(b){b.setVal(a)}),this):(e(this.first(),function(a){b=a.getVal()}),b)},destroy:function(){return e(this,function(a,b){m(b),a.destroy()}),this}},a.fn.typeahead=function(a){return q[a]?q[a].apply(this,[].slice.call(arguments,1)):q.initialize.apply(this,arguments)},a.fn.typeahead.noConflict=function(){return a.fn.typeahead=o,this}}()});
@@ -0,0 +1,46 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6
+ * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
16
+
17
+ html {
18
+ height: 100%;
19
+ }
20
+ body {
21
+ min-height: 100%;
22
+ }
23
+
24
+ .wrapper .container {
25
+ padding-bottom: 2rem;
26
+ padding-top: 2rem;
27
+ }
28
+
29
+ .error-wrapper .result {
30
+ color: white;
31
+ background-color: red;
32
+ }
33
+
34
+
35
+ h3.alert-success {
36
+ text-align: center;
37
+ }
38
+
39
+ pre {
40
+ line-height: 0.7;
41
+ }
42
+
43
+ pre p {
44
+ margin: 0;
45
+ margin-left: 5px;
46
+ }
@@ -0,0 +1,34 @@
1
+ .authorize-button .button {
2
+ width: 200px;
3
+ }
4
+
5
+ .center {
6
+ margin: auto;
7
+ width: 60%;
8
+ padding: 10px;
9
+ }
10
+
11
+ .authorization-info {
12
+ margin-top: 20px;
13
+ text-align: center;
14
+ }
15
+
16
+ .authorized {
17
+ width: 200px;
18
+ cursor: default;
19
+ pointer-events: none;
20
+ text-decoration: none;
21
+ background-color: grey;
22
+ border: none;
23
+ text-align: center;
24
+ display: block;
25
+ }
26
+
27
+ .button-inline {
28
+ margin-left: 10px;
29
+ display: inline-block;
30
+ }
31
+
32
+ .authorize-link {
33
+ display: inline;
34
+ }
@@ -0,0 +1,33 @@
1
+ .jquery-spinner-wrap {
2
+ position:absolute;
3
+ top:0;
4
+ z-index:100;
5
+ width:100%;
6
+ height:100%;
7
+ display:none;
8
+ background:rgba(0,0,0,0.2)
9
+ }
10
+
11
+ .jquery-spinner-wrap .jquery-spinner-circle {
12
+ height:100%;
13
+ display:flex;
14
+ justify-content:center;
15
+ align-items:center
16
+ }
17
+
18
+ .jquery-spinner-wrap .jquery-spinner-circle .jquery-spinner-bar {
19
+ width:40px;
20
+ height:40px;
21
+ border:4px #ddd solid;
22
+ border-top:4px #9b4dca solid;
23
+ border-radius:50%;
24
+ animation:sp-anime 0.8s infinite linear
25
+ }
26
+
27
+ @keyframes sp-anime {
28
+ 100% {
29
+ transform:rotate(360deg)
30
+ }
31
+ }
32
+
33
+
@@ -0,0 +1,55 @@
1
+ .mapping-select {
2
+ display: none;
3
+ }
4
+
5
+ .mapping-select select {
6
+ display: inline-block !important;
7
+ margin-right: 10px;
8
+ }
9
+
10
+ .mapping-select input[type=submit] {
11
+ margin: 0;
12
+ }
13
+
14
+ #mappings-container {
15
+ width: 100%;
16
+ height: 100%;
17
+ }
18
+
19
+ .mapping-row {
20
+ border: 1px solid;
21
+ border-color: rgba($color: grey, $alpha: 0.2);
22
+ margin-top: 10px;
23
+ border-radius: 10px;
24
+ }
25
+
26
+ .row.mapping-headers {
27
+ border: 1px solid;
28
+ border-color: rgba($color: grey, $alpha: 0.2);
29
+ background-color: rgba($color: #9b4dca, $alpha: 0.1);
30
+ padding: 10px;
31
+ border-radius: 10px;
32
+ display: none;
33
+ }
34
+
35
+ .mapping-row .column, .mapping-row button {
36
+ display: flex;
37
+ align-items: center;
38
+ margin: 5px;
39
+ }
40
+
41
+ .mapping-row .remove-button, .row.mapping-headers .remove-button {
42
+ margin-top: 10px;
43
+ max-width: 100px;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ }
48
+
49
+ .mapping-row.template {
50
+ display: none;
51
+ }
52
+
53
+ .mapping-id {
54
+ display: none;
55
+ }
@@ -0,0 +1,43 @@
1
+ .navigation {
2
+ background: #f4f5f6;
3
+ border-bottom: .1rem solid #d1d1d1;
4
+ display: block;
5
+ height: 5.2rem;
6
+ left: 0;
7
+ max-width: 100%;
8
+ width: 100%;
9
+ }
10
+
11
+ .navigation .container {
12
+ padding-bottom: 0;
13
+ padding-top: 0
14
+ }
15
+
16
+ .navigation .navigation-list {
17
+ list-style: none;
18
+ margin-bottom: 0;
19
+ }
20
+
21
+ .navigation .navigation-item {
22
+ float: left;
23
+ margin-bottom: 0;
24
+ margin-left: 2.5rem;
25
+ position: relative
26
+ }
27
+
28
+ .navigation .navigation-title, .navigation .title {
29
+ color: #606c76;
30
+ position: relative
31
+ }
32
+
33
+ .navigation .navigation-link, .navigation .navigation-title, .navigation .title {
34
+ display: inline;
35
+ font-size: 1.6rem;
36
+ line-height: 5.2rem;
37
+ padding: 0;
38
+ text-decoration: none
39
+ }
40
+
41
+ .navigation .navigation-link.active {
42
+ color: #606c76
43
+ }
@@ -0,0 +1,81 @@
1
+ .typeahead,
2
+ .tt-query,
3
+ .tt-hint {
4
+ width: 396px;
5
+ height: 30px;
6
+ padding: 8px 12px;
7
+ font-size: 24px;
8
+ line-height: 30px;
9
+ border: 2px solid #ccc;
10
+ -webkit-border-radius: 8px;
11
+ -moz-border-radius: 8px;
12
+ border-radius: 8px;
13
+ outline: none;
14
+ }
15
+
16
+ .typeahead {
17
+ background-color: #fff;
18
+ margin-bottom: 0;
19
+ }
20
+
21
+ .typeahead:focus {
22
+ border: 2px solid #0097cf;
23
+ }
24
+
25
+ .tt-query {
26
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
27
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
28
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
29
+ }
30
+
31
+ .tt-hint {
32
+ color: #999
33
+ }
34
+
35
+ .tt-menu {
36
+ width: 422px;
37
+ padding: 8px 0;
38
+ background-color: #fff;
39
+ border: 1px solid #ccc;
40
+ -webkit-border-radius: 8px;
41
+ -moz-border-radius: 8px;
42
+ border-radius: 8px;
43
+ -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
44
+ -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
45
+ box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
46
+ }
47
+
48
+ .tt-suggestion {
49
+ padding: 3px 20px;
50
+ font-size: 18px;
51
+ line-height: 24px;
52
+ }
53
+
54
+ .tt-suggestion:hover {
55
+ cursor: pointer;
56
+ color: #fff;
57
+ background-color: #9b4dca;
58
+ }
59
+
60
+ .tt-suggestion.tt-cursor {
61
+ color: #fff;
62
+ background-color: #0097cf;
63
+
64
+ }
65
+
66
+ .tt-suggestion p {
67
+ margin: 0;
68
+ }
69
+
70
+ .typeahead .empty-message {
71
+ padding: 5px 10px;
72
+ text-align: center;
73
+ }
74
+
75
+ input[type=submit] {
76
+ margin-top: 1rem;
77
+ }
78
+
79
+ span.twitter-typeahead {
80
+ display: block !important;
81
+ }
@@ -0,0 +1,38 @@
1
+ class ApplicationController < ActionController::Base
2
+ include ExceptionHandler
3
+
4
+ before_action :check_env_variables
5
+ protect_from_forgery prepend: true
6
+
7
+ helper_method :authorized?
8
+
9
+ private
10
+
11
+ def authorized?
12
+ HubspotToken.instance.filled? && TrelloToken.instance.filled?
13
+ end
14
+
15
+ def check_env_variables
16
+ missing_vars = %w[
17
+ HUBSPOT_CLIENT_ID
18
+ HUBSPOT_CLIENT_SECRET
19
+ HUBSPOT_DEVELOPER_API_KEY
20
+ HUBSPOT_APPLICATION_ID
21
+ TRELLO_KEY
22
+ TRELLO_SECRET
23
+ ].select { |var| ENV[var].blank? }
24
+ raise(ExceptionHandler::HubspotError.new, "Please specify #{missing_vars.join(', ')} in .env") if missing_vars.present?
25
+ end
26
+
27
+ def authorize
28
+ redirect_to login_path and return unless authorized?
29
+
30
+ new_hubspot_tokens = Services::Hubspot::Authorization::Tokens::Refresh.new(
31
+ tokens: HubspotToken.instance.attributes,
32
+ request: request
33
+ ).call
34
+ HubspotToken.instance.update_attributes(new_hubspot_tokens)
35
+ Services::Hubspot::Authorization::Authorize.new(tokens: HubspotToken.instance.attributes).call
36
+ Services::Trello::Authorization::Authorize.new(tokens: TrelloToken.instance.attributes).call
37
+ end
38
+ end
@@ -0,0 +1,12 @@
1
+ module ExceptionHandler
2
+ extend ActiveSupport::Concern
3
+
4
+ class HubspotError < StandardError; end
5
+
6
+ included do
7
+ rescue_from HubspotError do |error|
8
+ @error = error
9
+ render template: 'home/index'
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,20 @@
1
+ class HomeController < ApplicationController
2
+ before_action :authorize
3
+
4
+ def index
5
+ @data_fetch_url = url_for(controller: 'trello/cards', action: :index, only_path: false, protocol: 'https')
6
+ @base_url = url_for(controller: :home, action: :index, only_path: false, protocol: 'https')
7
+ @card_id = ExtensionCard.find_by(card_id_key: ExtensionCard::CARD_ID_KEY)&.card_id
8
+ @card_title = ExtensionCard::CARD_TITLE
9
+ end
10
+
11
+ def create_card
12
+ Services::Hubspot::ExtensionsCards::Create.new(request: request).call
13
+
14
+ redirect_to action: :success
15
+ end
16
+
17
+ def success
18
+ @extension_card = ExtensionCard.find_by(card_id_key: ExtensionCard::CARD_ID_KEY)
19
+ end
20
+ end