spina-admin-conferences 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +101 -0
  4. data/Rakefile +40 -0
  5. data/app/assets/config/spina_admin_conferences_manifest.js +4 -0
  6. data/app/assets/javascripts/spina/admin/conferences/application.es6 +20 -0
  7. data/app/assets/javascripts/spina/admin/conferences/controllers/conference_events_form_controller.es6 +175 -0
  8. data/app/assets/javascripts/spina/admin/conferences/controllers/presentation_attachments_form_controller.es6 +175 -0
  9. data/app/assets/javascripts/spina/admin/conferences/controllers/select_options_controller.es6 +216 -0
  10. data/app/assets/stylesheets/spina/admin/conferences/application.sass +14 -0
  11. data/app/controllers/spina/admin/conferences/application_controller.rb +20 -0
  12. data/app/controllers/spina/admin/conferences/conferences_controller.rb +148 -0
  13. data/app/controllers/spina/admin/conferences/delegates_controller.rb +116 -0
  14. data/app/controllers/spina/admin/conferences/dietary_requirements_controller.rb +106 -0
  15. data/app/controllers/spina/admin/conferences/events_controller.rb +24 -0
  16. data/app/controllers/spina/admin/conferences/institutions_controller.rb +106 -0
  17. data/app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb +104 -0
  18. data/app/controllers/spina/admin/conferences/presentation_attachments_controller.rb +24 -0
  19. data/app/controllers/spina/admin/conferences/presentation_types_controller.rb +109 -0
  20. data/app/controllers/spina/admin/conferences/presentations_controller.rb +124 -0
  21. data/app/controllers/spina/admin/conferences/rooms_controller.rb +109 -0
  22. data/app/controllers/spina/admin/conferences/sessions_controller.rb +118 -0
  23. data/app/helpers/spina/admin/conferences/conferences_helper.rb +44 -0
  24. data/app/jobs/spina/admin/conferences/application_job.rb +11 -0
  25. data/app/jobs/spina/admin/conferences/delegate_import_job.rb +37 -0
  26. data/app/jobs/spina/admin/conferences/import_job.rb +26 -0
  27. data/app/jobs/spina/admin/conferences/presentation_import_job.rb +38 -0
  28. data/app/mailers/spina/admin/conferences/application_mailer.rb +13 -0
  29. data/app/models/spina/admin/conferences.rb +11 -0
  30. data/app/models/spina/admin/conferences/application_record.rb +14 -0
  31. data/app/models/spina/admin/conferences/conference.rb +152 -0
  32. data/app/models/spina/admin/conferences/date_part.rb +15 -0
  33. data/app/models/spina/admin/conferences/delegate.rb +89 -0
  34. data/app/models/spina/admin/conferences/dietary_requirement.rb +33 -0
  35. data/app/models/spina/admin/conferences/email_address_part.rb +21 -0
  36. data/app/models/spina/admin/conferences/event.rb +120 -0
  37. data/app/models/spina/admin/conferences/institution.rb +46 -0
  38. data/app/models/spina/admin/conferences/part.rb +20 -0
  39. data/app/models/spina/admin/conferences/presentation.rb +143 -0
  40. data/app/models/spina/admin/conferences/presentation_attachment.rb +27 -0
  41. data/app/models/spina/admin/conferences/presentation_attachment_type.rb +35 -0
  42. data/app/models/spina/admin/conferences/presentation_type.rb +60 -0
  43. data/app/models/spina/admin/conferences/room.rb +52 -0
  44. data/app/models/spina/admin/conferences/session.rb +56 -0
  45. data/app/models/spina/admin/conferences/time_part.rb +53 -0
  46. data/app/models/spina/admin/conferences/url_part.rb +21 -0
  47. data/app/validators/spina/admin/conferences/conference_date_validator.rb +20 -0
  48. data/app/validators/spina/admin/conferences/email_address_validator.rb +28 -0
  49. data/app/validators/spina/admin/conferences/finish_date_validator.rb +20 -0
  50. data/app/validators/spina/admin/conferences/finish_time_validator.rb +20 -0
  51. data/app/validators/spina/admin/conferences/http_url_validator.rb +28 -0
  52. data/app/views/layouts/spina/admin/conferences/conferences.html.haml +19 -0
  53. data/app/views/layouts/spina/admin/conferences/delegates.html.haml +10 -0
  54. data/app/views/layouts/spina/admin/conferences/dietary_requirements.html.haml +10 -0
  55. data/app/views/layouts/spina/admin/conferences/institutions.html.haml +17 -0
  56. data/app/views/layouts/spina/admin/conferences/presentation_attachment_types.html.haml +10 -0
  57. data/app/views/layouts/spina/admin/conferences/presentations.html.haml +10 -0
  58. data/app/views/spina/admin/conferences/application/_empty_list.html.haml +3 -0
  59. data/app/views/spina/admin/conferences/application/_errors.html.haml +11 -0
  60. data/app/views/spina/admin/conferences/application/_errors.js.erb +2 -0
  61. data/app/views/spina/admin/conferences/conferences/_conference.html.haml +9 -0
  62. data/app/views/spina/admin/conferences/conferences/_event_fields.html.haml +39 -0
  63. data/app/views/spina/admin/conferences/conferences/_event_row.html.haml +5 -0
  64. data/app/views/spina/admin/conferences/conferences/_form.html.haml +23 -0
  65. data/app/views/spina/admin/conferences/conferences/_form_conference_details.html.haml +29 -0
  66. data/app/views/spina/admin/conferences/conferences/_form_delegates.html.haml +12 -0
  67. data/app/views/spina/admin/conferences/conferences/_form_parts.html.haml +15 -0
  68. data/app/views/spina/admin/conferences/conferences/_form_presentation_types.html.haml +12 -0
  69. data/app/views/spina/admin/conferences/conferences/_form_presentations.html.haml +12 -0
  70. data/app/views/spina/admin/conferences/conferences/_form_rooms.html.haml +12 -0
  71. data/app/views/spina/admin/conferences/conferences/_form_structure.html.haml +19 -0
  72. data/app/views/spina/admin/conferences/conferences/_form_structure_item.html.haml +13 -0
  73. data/app/views/spina/admin/conferences/conferences/edit.html.haml +1 -0
  74. data/app/views/spina/admin/conferences/conferences/index.html.haml +18 -0
  75. data/app/views/spina/admin/conferences/conferences/new.html.haml +1 -0
  76. data/app/views/spina/admin/conferences/delegates/_delegate.html.haml +13 -0
  77. data/app/views/spina/admin/conferences/delegates/_form.html.haml +23 -0
  78. data/app/views/spina/admin/conferences/delegates/_form_conferences.html.haml +14 -0
  79. data/app/views/spina/admin/conferences/delegates/_form_delegate_details.html.haml +38 -0
  80. data/app/views/spina/admin/conferences/delegates/_form_presentations.html.haml +12 -0
  81. data/app/views/spina/admin/conferences/delegates/edit.html.haml +1 -0
  82. data/app/views/spina/admin/conferences/delegates/index.html.haml +23 -0
  83. data/app/views/spina/admin/conferences/delegates/new.html.haml +1 -0
  84. data/app/views/spina/admin/conferences/dietary_requirements/_dietary_requirement.html.haml +6 -0
  85. data/app/views/spina/admin/conferences/dietary_requirements/_form.html.haml +23 -0
  86. data/app/views/spina/admin/conferences/dietary_requirements/_form_delegates.html.haml +12 -0
  87. data/app/views/spina/admin/conferences/dietary_requirements/_form_dietary_requirement_details.html.haml +9 -0
  88. data/app/views/spina/admin/conferences/dietary_requirements/edit.html.haml +1 -0
  89. data/app/views/spina/admin/conferences/dietary_requirements/index.html.haml +15 -0
  90. data/app/views/spina/admin/conferences/dietary_requirements/new.html.haml +1 -0
  91. data/app/views/spina/admin/conferences/events/new.js.erb +27 -0
  92. data/app/views/spina/admin/conferences/institutions/_form.html.haml +23 -0
  93. data/app/views/spina/admin/conferences/institutions/_form_delegates.html.haml +12 -0
  94. data/app/views/spina/admin/conferences/institutions/_form_institution_details.html.haml +35 -0
  95. data/app/views/spina/admin/conferences/institutions/_form_rooms.html.haml +12 -0
  96. data/app/views/spina/admin/conferences/institutions/_institution.html.haml +7 -0
  97. data/app/views/spina/admin/conferences/institutions/edit.html.haml +1 -0
  98. data/app/views/spina/admin/conferences/institutions/index.html.haml +16 -0
  99. data/app/views/spina/admin/conferences/institutions/new.html.haml +1 -0
  100. data/app/views/spina/admin/conferences/presentation_attachment_types/_form.html.haml +23 -0
  101. data/app/views/spina/admin/conferences/presentation_attachment_types/_presentation_attachment_type.html.haml +6 -0
  102. data/app/views/spina/admin/conferences/presentation_attachment_types/edit.html.haml +1 -0
  103. data/app/views/spina/admin/conferences/presentation_attachment_types/index.html.haml +15 -0
  104. data/app/views/spina/admin/conferences/presentation_attachment_types/new.html.haml +1 -0
  105. data/app/views/spina/admin/conferences/presentation_attachments/new.js.erb +21 -0
  106. data/app/views/spina/admin/conferences/presentation_types/_form.html.haml +23 -0
  107. data/app/views/spina/admin/conferences/presentation_types/_form_presentation_type_details.html.haml +20 -0
  108. data/app/views/spina/admin/conferences/presentation_types/_form_presentations.html.haml +12 -0
  109. data/app/views/spina/admin/conferences/presentation_types/_form_sessions.html.haml +12 -0
  110. data/app/views/spina/admin/conferences/presentation_types/_presentation_type.html.haml +8 -0
  111. data/app/views/spina/admin/conferences/presentation_types/edit.html.haml +1 -0
  112. data/app/views/spina/admin/conferences/presentation_types/index.html.haml +17 -0
  113. data/app/views/spina/admin/conferences/presentation_types/new.html.haml +1 -0
  114. data/app/views/spina/admin/conferences/presentations/_attachment_fields.html.haml +27 -0
  115. data/app/views/spina/admin/conferences/presentations/_attachment_row.html.haml +2 -0
  116. data/app/views/spina/admin/conferences/presentations/_form.html.haml +23 -0
  117. data/app/views/spina/admin/conferences/presentations/_form_presentation_details.html.haml +55 -0
  118. data/app/views/spina/admin/conferences/presentations/_form_presenters.html.haml +12 -0
  119. data/app/views/spina/admin/conferences/presentations/_presentation.html.haml +11 -0
  120. data/app/views/spina/admin/conferences/presentations/edit.html.haml +1 -0
  121. data/app/views/spina/admin/conferences/presentations/index.html.haml +23 -0
  122. data/app/views/spina/admin/conferences/presentations/new.html.haml +1 -0
  123. data/app/views/spina/admin/conferences/rooms/_form.html.haml +23 -0
  124. data/app/views/spina/admin/conferences/rooms/_form_presentations.html.haml +12 -0
  125. data/app/views/spina/admin/conferences/rooms/_form_room_details.html.haml +18 -0
  126. data/app/views/spina/admin/conferences/rooms/_room.html.haml +8 -0
  127. data/app/views/spina/admin/conferences/rooms/edit.html.haml +1 -0
  128. data/app/views/spina/admin/conferences/rooms/index.html.haml +17 -0
  129. data/app/views/spina/admin/conferences/rooms/new.html.haml +1 -0
  130. data/app/views/spina/admin/conferences/sessions/_form.html.haml +23 -0
  131. data/app/views/spina/admin/conferences/sessions/_form_presentations.html.haml +12 -0
  132. data/app/views/spina/admin/conferences/sessions/_form_session_details.html.haml +23 -0
  133. data/app/views/spina/admin/conferences/sessions/_session.html.haml +8 -0
  134. data/app/views/spina/admin/conferences/sessions/edit.html.haml +1 -0
  135. data/app/views/spina/admin/conferences/sessions/index.html.haml +17 -0
  136. data/app/views/spina/admin/conferences/sessions/new.html.haml +1 -0
  137. data/app/views/spina/admin/hooks/conferences/_head.html.haml +2 -0
  138. data/app/views/spina/admin/hooks/conferences/_primary_navigation.html.haml +20 -0
  139. data/app/views/spina/admin/hooks/conferences/_settings_secondary_navigation.html.haml +4 -0
  140. data/app/views/spina/admin/partables/admin/conferences/date_parts/_form.html.haml +5 -0
  141. data/app/views/spina/admin/partables/admin/conferences/email_address_parts/_form.html.haml +5 -0
  142. data/app/views/spina/admin/partables/admin/conferences/time_parts/_form.html.haml +7 -0
  143. data/app/views/spina/admin/partables/admin/conferences/url_parts/_form.html.haml +5 -0
  144. data/config/initializers/assets.rb +13 -0
  145. data/config/initializers/types.rb +13 -0
  146. data/config/locales/en.yml +354 -0
  147. data/config/routes.rb +27 -0
  148. data/db/migrate/20180907141228_create_spina_dates.rb +11 -0
  149. data/db/migrate/20180907141229_create_spina_email_addresses.rb +11 -0
  150. data/db/migrate/20180907141230_create_spina_urls.rb +11 -0
  151. data/db/migrate/20180907141231_create_spina_conferences_institutions.rb +12 -0
  152. data/db/migrate/20180907141232_create_spina_conferences_delegates.rb +15 -0
  153. data/db/migrate/20180907141234_create_spina_conferences_dietary_requirements.rb +11 -0
  154. data/db/migrate/20180907141235_create_spina_conferences_conferences.rb +12 -0
  155. data/db/migrate/20180907141236_create_spina_conferences_presentation_types.rb +13 -0
  156. data/db/migrate/20180907141238_create_join_table_spina_conferences_conference_delegate.rb +7 -0
  157. data/db/migrate/20180907141239_create_join_table_spina_conferences_delegate_presentation.rb +7 -0
  158. data/db/migrate/20180907141240_create_join_table_spina_conferences_delegate_dietary_requirement.rb +7 -0
  159. data/db/migrate/20180907141242_add_type_to_spina_pages.rb +7 -0
  160. data/db/migrate/20180907141243_create_spina_conferences_conference_page_parts.rb +14 -0
  161. data/db/migrate/20180914121905_add_logo_ref_to_spina_conferences_institutions.rb +7 -0
  162. data/db/migrate/20180916135431_create_spina_conferences_rooms.rb +13 -0
  163. data/db/migrate/20180916135432_create_spina_conferences_room_possessions.rb +10 -0
  164. data/db/migrate/20180916135433_create_spina_conferences_room_uses.rb +10 -0
  165. data/db/migrate/20180916135434_create_spina_conferences_presentations.rb +15 -0
  166. data/db/migrate/20181009122503_create_spina_times.rb +11 -0
  167. data/db/migrate/20181009130631_rename_spina_page_parts.rb +10 -0
  168. data/db/migrate/20181012190811_rename_spina_conferences_page_parts.rb +10 -0
  169. data/db/migrate/20181012213049_change_start_time_in_spina_conferences_conferences.rb +15 -0
  170. data/db/migrate/20181012214813_rename_start_time_in_spina_conferences_conferences.rb +7 -0
  171. data/db/migrate/20181017155705_add_dependent_option_to_foreign_keys.rb +36 -0
  172. data/db/migrate/20190408131354_change_spina_resources.rb +56 -0
  173. data/db/migrate/20190622131423_create_spina_conferences_parts.rb +12 -0
  174. data/db/migrate/20190701174807_remove_spina_conference_pages.rb +199 -0
  175. data/db/migrate/20190704135524_add_constraints_to_columns.rb +24 -0
  176. data/db/migrate/20200126034441_create_spina_conferences_presentation_attachment_types.rb +11 -0
  177. data/db/migrate/20200126213718_create_spina_conferences_presentation_attachments.rb +19 -0
  178. data/db/migrate/20200420104603_create_spina_conferences_dietary_requirement_name_translations.rb +19 -0
  179. data/db/migrate/20200420104740_create_spina_conferences_institution_name_and_city_translations.rb +20 -0
  180. data/db/migrate/20200420105057_create_spina_conferences_presentation_title_and_abstract_translations.rb +20 -0
  181. data/db/migrate/20200420105144_create_spina_conferences_presentation_attachment_type_name_translations.rb +20 -0
  182. data/db/migrate/20200420105201_create_spina_conferences_presentation_type_name_translations.rb +19 -0
  183. data/db/migrate/20200420105458_create_spina_conferences_room_building_and_number_translations.rb +20 -0
  184. data/db/migrate/20200420110407_move_attributes_to_translation_tables.rb +161 -0
  185. data/db/migrate/20200420120706_remove_name_from_spina_conferences_dietary_requirements.rb +7 -0
  186. data/db/migrate/20200420120759_remove_name_and_city_from_spina_conferences_institutions.rb +8 -0
  187. data/db/migrate/20200420120946_remove_title_and_abstract_from_spina_conferences_presentations.rb +8 -0
  188. data/db/migrate/20200420121310_remove_name_from_spina_conferences_presentation_attachment_types.rb +7 -0
  189. data/db/migrate/20200420121321_remove_name_from_spina_conferences_presentation_types.rb +7 -0
  190. data/db/migrate/20200420121443_remove_building_and_number_from_spina_conferences_rooms.rb +8 -0
  191. data/db/migrate/20200502133408_create_spina_conferences_conference_name_translations.rb +19 -0
  192. data/db/migrate/20200502183409_set_name_for_spina_conferences_conferences.rb +47 -0
  193. data/db/migrate/20200502183410_remove_institution_from_spina_conferences_conferences.rb +8 -0
  194. data/db/migrate/20200502183719_remove_spina_conferences_room_possessions.rb +60 -0
  195. data/db/migrate/20200503230732_rename_spina_conferences_room_uses.rb +8 -0
  196. data/db/migrate/20200510125131_create_spina_conferences_session_name_translations.rb +19 -0
  197. data/db/migrate/20200802165242_create_spina_conferences_events.rb +13 -0
  198. data/db/migrate/20200802184921_create_spina_conferences_event_name_description_and_location_translations.rb +21 -0
  199. data/db/migrate/20200911161632_update_spina_conferences_parts.rb +23 -0
  200. data/db/migrate/20200911161651_update_spina_parts.rb +37 -0
  201. data/db/migrate/20200911161726_move_presentation_parts.rb +101 -0
  202. data/db/migrate/20200911161739_move_conference_parts.rb +219 -0
  203. data/db/migrate/20201002122517_remove_spina_conferences_conference_page_parts.rb +14 -0
  204. data/db/migrate/20201007125625_add_timestamps_to_spina_conferences_parts.rb +9 -0
  205. data/lib/spina/admin/conferences.rb +20 -0
  206. data/lib/spina/admin/conferences/engine.rb +26 -0
  207. data/lib/spina/admin/conferences/migration/renaming.rb +81 -0
  208. data/lib/spina/admin/conferences/railtie.rb +34 -0
  209. data/lib/spina/admin/conferences/types/interval_type.rb +29 -0
  210. data/lib/spina/admin/conferences/version.rb +10 -0
  211. data/lib/tasks/spina/admin/conferences_tasks.rake +4 -0
  212. metadata +561 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fa2b8b1274af18cc7e12e10334bdf485b21993dc2d108147fb32ecc401a427bb
4
+ data.tar.gz: 92a089aac4a4a99e52d6f2837d2ae7ba8f297994dd940646c8aeace2c0460397
5
+ SHA512:
6
+ metadata.gz: e842dbe6a4ddcf77c74e1df2809e84dc85dda7252b2239cbd67fa53644b55c8ebe8eb87986ae4a33a4f4bcba9594c1ace8d7400d20a19c86e0f314024998303f
7
+ data.tar.gz: 5a3286da4f42372a7136cb24447dd001b5c48bec7bbb3f0239eef84827ed2f09e7e8269d969f41baa3fd720c1e33cfa4bc189170ec41d398bbe05ed4f9a8065d
@@ -0,0 +1,20 @@
1
+ Copyright 2019 Justin Malčić
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,101 @@
1
+ # Conferences
2
+
3
+ [![Build Status](https://travis-ci.com/jmalcic/spina-conferences.svg?branch=master)](https://travis-ci.com/jmalcic/spina-conferences)
4
+ ![Rails tests](https://github.com/jmalcic/spina-conferences/workflows/Rails%20tests/badge.svg?branch=master&event=push)
5
+ [![Coverage Status](https://coveralls.io/repos/github/jmalcic/spina-conferences/badge.svg?branch=master)](https://coveralls.io/github/jmalcic/spina-conferences?branch=master)
6
+ [![Total alerts](https://img.shields.io/lgtm/alerts/g/jmalcic/spina-conferences.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/jmalcic/spina-conferences/alerts/)
7
+ [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/jmalcic/spina-conferences.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/jmalcic/spina-conferences/context:javascript)
8
+ [![Code quality](https://www.codefactor.io/repository/github/jmalcic/spina-conferences/badge)](https://www.codefactor.io/repository/github/jmalcic/spina-conferences)
9
+ [![Inline docs](http://inch-ci.org/github/jmalcic/spina-conferences.svg?branch=master)](http://inch-ci.org/github/jmalcic/spina-conferences)
10
+ [![Visual testing](https://percy.io/static/images/percy-badge.svg)](https://percy.io/Ulab/spina-conferences)
11
+
12
+ *Conferences* is a plugin for [Spina](https://www.spinacms.com 'Spina website') (a [Rails](http://rubyonrails.org 'Ruby on Rails website') content management system) to add conference management functionality.
13
+ With the plugin, you'll be able to manage details of conferences, delegates, and presentations.
14
+ See the wiki for details of the types of data supported.
15
+
16
+ ## Usage
17
+
18
+ The plugin will add a **Conferences** item to Spina's primary navigation menu.
19
+ The menu structure will then be as follows:
20
+
21
+ * *Other menu items*
22
+
23
+ * Conferences
24
+
25
+ * Institutions
26
+
27
+ * Conferences
28
+
29
+ * Delegates
30
+
31
+ * Presentations
32
+
33
+ After installing the plugin, you just need to start your server in the usual way:
34
+ ```bash
35
+ $ rails s
36
+ ```
37
+
38
+ ## Installation
39
+
40
+ ### From scratch
41
+
42
+ You'll need [Rails](http://rubyonrails.org 'Ruby on Rails website') installed if it isn't already.
43
+ Read how to do this in the [Rails getting started guide](https://guides.rubyonrails.org/getting_started.html 'Getting Started with Rails').
44
+
45
+ Then run:
46
+ ```bash
47
+ $ rails new your_app --database postgresql
48
+ $ rails db:create
49
+ $ rails active_storage:install
50
+ ```
51
+
52
+ Add this line to your application's Gemfile:
53
+
54
+ ```ruby
55
+ gem 'spina'
56
+ ```
57
+
58
+ And then execute:
59
+ ```bash
60
+ $ bundle:install
61
+ ```
62
+
63
+ Run the Spina install generator:
64
+ ```bash
65
+ $ rails g spina:install
66
+ ```
67
+
68
+ And follow the prompts.
69
+ Then follow the instructions below.
70
+
71
+ ### For existing Spina installations
72
+
73
+ Add this line to your application's Gemfile:
74
+
75
+ ```ruby
76
+ gem 'spina-conferences', github: 'jmalcic/spina-conferences'
77
+ ```
78
+
79
+ You'll then need to install and run the migrations from Conferences (the Spina install generator does this for Spina).
80
+
81
+ First install the migrations and then migrate the database:
82
+ ```bash
83
+ $ rake spina_conferences:install:migrations
84
+ $ rake db:migrate
85
+ ```
86
+
87
+ ### Configuring the main Rails app
88
+
89
+ Conferences requires a job queueing backend for import functionality, and you'll also want to cache pages listing
90
+ presentations, conferences, and so on. Read about this in the Rails guides covering
91
+ [Active Job](https://guides.rubyonrails.org/active_job_basics.html) and
92
+ [caching](https://guides.rubyonrails.org/caching_with_rails.html).
93
+
94
+ ## Contributing
95
+
96
+ You're very welcome to contribute, particularly to translations.
97
+ If there's a bug, or you have a feature request, make an issue on GitHub first.
98
+
99
+ ## License
100
+
101
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'bundler/setup'
5
+ rescue LoadError
6
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
+ end
8
+
9
+ require 'rdoc/task'
10
+
11
+ RDoc::Task.new(:rdoc) do |rdoc|
12
+ rdoc.rdoc_dir = 'rdoc'
13
+ rdoc.title = 'Spina::Admin::Conferences'
14
+ rdoc.options << '--line-numbers'
15
+ rdoc.rdoc_files.include('README.md')
16
+ rdoc.rdoc_files.include('lib/**/*.rb')
17
+ end
18
+
19
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
20
+ load 'rails/tasks/engine.rake'
21
+
22
+ load 'rails/tasks/statistics.rake'
23
+
24
+ require 'bundler/gem_tasks'
25
+
26
+ require 'rake/testtask'
27
+
28
+ Rake::TestTask.new(:test) do |t|
29
+ t.libs << 'test'
30
+ t.pattern = 'test/**/*_test.rb'
31
+ t.verbose = false
32
+ t.warning = false
33
+ t.ruby_opts = %w[-W:no-deprecated]
34
+ end
35
+
36
+ task default: :test
37
+
38
+ require 'rubocop/rake_task'
39
+
40
+ RuboCop::RakeTask.new
@@ -0,0 +1,4 @@
1
+ //= link_tree ../images
2
+ //= link spina/admin/conferences/application.js
3
+ //= link spina/admin/conferences/application.css
4
+ //= link spina_manifest.js
@@ -0,0 +1,20 @@
1
+ //= require stimulus
2
+ //= require_directory ./controllers
3
+
4
+ /**
5
+ * @external Stimulus
6
+ */
7
+ /* global Stimulus, SelectOptionsController, PresentationAttachmentsFormController, ConferenceEventsFormController */
8
+ const application = Stimulus.Application.start()
9
+ application.register('select-options', SelectOptionsController)
10
+ application.register('presentation-attachments-form', PresentationAttachmentsFormController)
11
+ application.register('conference-events-form', ConferenceEventsFormController)
12
+
13
+ document.addEventListener('turbolinks:load', () => {
14
+ Array.from(document.getElementsByClassName('conference-datepicker')).forEach(element => {
15
+ $(element).datepicker({
16
+ dateFormat: 'yy-mm-dd',
17
+ firstDay: 1
18
+ })
19
+ })
20
+ })
@@ -0,0 +1,175 @@
1
+ /* global Stimulus */
2
+
3
+ /**
4
+ * @external Stimulus
5
+ * @see {@link https://stimulusjs.org}
6
+ */
7
+
8
+ /**
9
+ * @classdesc Controller that manages conference event inputs.
10
+ */
11
+ class ConferenceEventsFormController extends Stimulus.Controller { // eslint-disable-line no-unused-vars
12
+ // noinspection JSUnusedGlobalSymbols
13
+ static get targets() {
14
+ return [
15
+ /**
16
+ * @private
17
+ * @property {HTMLElement[]} formLinkTargets - The form link elements.
18
+ */
19
+ 'formLink',
20
+ /**
21
+ * @private
22
+ * @property {HTMLElement} addFormLinkTarget - The button element for adding forms.
23
+ */
24
+ 'addFormLink',
25
+ /**
26
+ * @private
27
+ * @property {HTMLElement[]} formPaneTargets - The form pane elements.
28
+ */
29
+ 'formPane',
30
+ /**
31
+ * @private
32
+ * @property {HTMLElement[]} destroyFieldTargets - The destroy field hidden inputs.
33
+ */
34
+ 'destroyField',
35
+ /**
36
+ * @private
37
+ * @property {HTMLElement[]} formLinkLabelTargets - The form link label elements.
38
+ */
39
+ 'formLinkLabel'
40
+ ]
41
+ }
42
+ // noinspection JSUnusedGlobalSymbols
43
+ /**
44
+ * @private
45
+ * @property {string} activeClass - The class used to mark elements as active.
46
+ */
47
+ static get classes() {
48
+ return ['active']
49
+ }
50
+
51
+ /**
52
+ * Returns visible form pane targets.
53
+ * @private
54
+ * @return {HTMLElement[]} Form pane targets currently shown.
55
+ */
56
+ get visibleFormPaneTargets() {
57
+ return this.getVisibleTargets(this.formPaneTargets)
58
+ }
59
+
60
+ /**
61
+ * Returns visible form link targets.
62
+ * @private
63
+ * @return {HTMLElement[]} Form link targets currently shown.
64
+ */
65
+ get visibleFormLinkTargets() {
66
+ return this.getVisibleTargets(this.formLinkTargets)
67
+ }
68
+
69
+ // noinspection JSUnusedGlobalSymbols
70
+ /**
71
+ * Removes the form for the button firing the event.
72
+ * @param {Event} event - The event fired by the button.
73
+ */
74
+ removeForm(event) {
75
+ if (!(event.currentTarget instanceof HTMLElement)) return
76
+ const index = this.getIndexOfChild(this.formPaneTargets, event.currentTarget)
77
+ const visibleIndex = this.getIndexOfChild(this.visibleFormPaneTargets, event.currentTarget)
78
+ this.destroyFieldTargets[index].value = true.toString()
79
+ this.hideTargetPair(index)
80
+ if (this.visibleFormPaneTargets.length > 0) {
81
+ let newIndex = visibleIndex <= this.visibleFormPaneTargets.length - 1 ? visibleIndex : visibleIndex - 1
82
+ this.makeTargetPairActive(newIndex)
83
+ }
84
+ this.updateURL()
85
+ }
86
+
87
+ // noinspection JSUnusedGlobalSymbols
88
+ /**
89
+ * Updates the form link labels with new type.
90
+ * @param {Event} event - The event fired by the select element.
91
+ */
92
+ updateType(event) {
93
+ if (!(event.currentTarget instanceof HTMLSelectElement)) return
94
+ const index = this.getIndexOfChild(this.formPaneTargets, event.currentTarget)
95
+ this.formLinkLabelTargets[index].textContent = event.currentTarget.selectedOptions[0].label
96
+ }
97
+
98
+ /**
99
+ * Updates the URL used to get new forms.
100
+ */
101
+ updateURL() {
102
+ const params = new URLSearchParams(this.addFormLinkTarget.search)
103
+ params.set('index', String(this.formPaneTargets.length))
104
+ params.set('active', String(this.visibleFormPaneTargets.length === 0))
105
+ this.addFormLinkTarget.search = params.toString()
106
+ }
107
+
108
+ /**
109
+ * Hides a form pane and form link target sharing an index.
110
+ * @private
111
+ * @private
112
+ * @param {Number} index - The index of the targets to hide.
113
+ */
114
+ hideTargetPair(index) {
115
+ this.hide(this.formPaneTargets[index])
116
+ this.hide(this.formLinkTargets[index])
117
+ }
118
+
119
+ /**
120
+ * Marks a form pane and form link target sharing an index as active.
121
+ * @private
122
+ * @param {Number} index - The index of the targets to show.
123
+ */
124
+ makeTargetPairActive(index) {
125
+ this.makeActive(this.visibleFormPaneTargets[index])
126
+ this.makeActive(this.visibleFormLinkTargets[index])
127
+ }
128
+
129
+ /**
130
+ * Makes an element inactive and hides it.
131
+ * @private
132
+ * @param {HTMLElement} element - The element.
133
+ */
134
+ hide(element) {
135
+ this.makeInactive(element)
136
+ element.hidden = true
137
+ }
138
+
139
+ /**
140
+ * Makes an element inactive.
141
+ * @private
142
+ * @param {HTMLElement} element - The element.
143
+ */
144
+ makeInactive(element) {
145
+ element.classList.remove(this.activeClass)
146
+ }
147
+
148
+ /**
149
+ * Makes an element active.
150
+ * @private
151
+ * @param {HTMLElement} element - The element.
152
+ */
153
+ makeActive(element) {
154
+ element.classList.add(this.activeClass)
155
+ }
156
+
157
+ /**
158
+ * Gets the index of an element within a collection.
159
+ * @private
160
+ * @param {HTMLElement[]} collection
161
+ * @param {HTMLElement} child
162
+ */
163
+ getIndexOfChild(collection, child) {
164
+ return collection.indexOf(collection.find(element => element.contains(child)))
165
+ }
166
+
167
+ /**
168
+ * Gets visible targets within a collection.
169
+ * @private
170
+ * @param {HTMLElement[]} targets
171
+ */
172
+ getVisibleTargets(targets) {
173
+ return targets.filter(target => target.hidden === false)
174
+ }
175
+ }
@@ -0,0 +1,175 @@
1
+ /* global Stimulus */
2
+
3
+ /**
4
+ * @external Stimulus
5
+ * @see {@link https://stimulusjs.org}
6
+ */
7
+
8
+ /**
9
+ * @classdesc Controller that manages presentation attachment inputs.
10
+ */
11
+ class PresentationAttachmentsFormController extends Stimulus.Controller { // eslint-disable-line no-unused-vars
12
+ // noinspection JSUnusedGlobalSymbols
13
+ static get targets() {
14
+ return [
15
+ /**
16
+ * @private
17
+ * @property {HTMLElement[]} formLinkTargets - The form link elements.
18
+ */
19
+ 'formLink',
20
+ /**
21
+ * @private
22
+ * @property {HTMLElement} addFormLinkTarget - The button element for adding forms.
23
+ */
24
+ 'addFormLink',
25
+ /**
26
+ * @private
27
+ * @property {HTMLElement[]} formPaneTargets - The form pane elements.
28
+ */
29
+ 'formPane',
30
+ /**
31
+ * @private
32
+ * @property {HTMLElement[]} destroyFieldTargets - The destroy field hidden inputs.
33
+ */
34
+ 'destroyField',
35
+ /**
36
+ * @private
37
+ * @property {HTMLElement[]} formLinkLabelTargets - The form link label elements.
38
+ */
39
+ 'formLinkLabel'
40
+ ]
41
+ }
42
+ // noinspection JSUnusedGlobalSymbols
43
+ /**
44
+ * @private
45
+ * @property {string} activeClass - The class used to mark elements as active.
46
+ */
47
+ static get classes() {
48
+ return ['active']
49
+ }
50
+
51
+ /**
52
+ * Returns visible form pane targets.
53
+ * @private
54
+ * @return {HTMLElement[]} Form pane targets currently shown.
55
+ */
56
+ get visibleFormPaneTargets() {
57
+ return this.getVisibleTargets(this.formPaneTargets)
58
+ }
59
+
60
+ /**
61
+ * Returns visible form link targets.
62
+ * @private
63
+ * @return {HTMLElement[]} Form link targets currently shown.
64
+ */
65
+ get visibleFormLinkTargets() {
66
+ return this.getVisibleTargets(this.formLinkTargets)
67
+ }
68
+
69
+ // noinspection JSUnusedGlobalSymbols
70
+ /**
71
+ * Removes the form for the button firing the event.
72
+ * @param {Event} event - The event fired by the button.
73
+ */
74
+ removeForm(event) {
75
+ if (!(event.currentTarget instanceof HTMLElement)) return
76
+ const index = this.getIndexOfChild(this.formPaneTargets, event.currentTarget)
77
+ const visibleIndex = this.getIndexOfChild(this.visibleFormPaneTargets, event.currentTarget)
78
+ this.destroyFieldTargets[index].value = true.toString()
79
+ this.hideTargetPair(index)
80
+ if (this.visibleFormPaneTargets.length > 0) {
81
+ let newIndex = visibleIndex <= this.visibleFormPaneTargets.length - 1 ? visibleIndex : visibleIndex - 1
82
+ this.makeTargetPairActive(newIndex)
83
+ }
84
+ this.updateURL()
85
+ }
86
+
87
+ // noinspection JSUnusedGlobalSymbols
88
+ /**
89
+ * Updates the form link labels with new type.
90
+ * @param {Event} event - The event fired by the select element.
91
+ */
92
+ updateType(event) {
93
+ if (!(event.currentTarget instanceof HTMLSelectElement)) return
94
+ const index = this.getIndexOfChild(this.formPaneTargets, event.currentTarget)
95
+ this.formLinkLabelTargets[index].textContent = event.currentTarget.selectedOptions[0].label
96
+ }
97
+
98
+ /**
99
+ * Updates the URL used to get new forms.
100
+ */
101
+ updateURL() {
102
+ const params = new URLSearchParams(this.addFormLinkTarget.search)
103
+ params.set('index', String(this.formPaneTargets.length))
104
+ params.set('active', String(this.visibleFormPaneTargets.length === 0))
105
+ this.addFormLinkTarget.search = params.toString()
106
+ }
107
+
108
+ /**
109
+ * Hides a form pane and form link target sharing an index.
110
+ * @private
111
+ * @private
112
+ * @param {Number} index - The index of the targets to hide.
113
+ */
114
+ hideTargetPair(index) {
115
+ this.hide(this.formPaneTargets[index])
116
+ this.hide(this.formLinkTargets[index])
117
+ }
118
+
119
+ /**
120
+ * Marks a form pane and form link target sharing an index as active.
121
+ * @private
122
+ * @param {Number} index - The index of the targets to show.
123
+ */
124
+ makeTargetPairActive(index) {
125
+ this.makeActive(this.visibleFormPaneTargets[index])
126
+ this.makeActive(this.visibleFormLinkTargets[index])
127
+ }
128
+
129
+ /**
130
+ * Makes an element inactive and hides it.
131
+ * @private
132
+ * @param {HTMLElement} element - The element.
133
+ */
134
+ hide(element) {
135
+ this.makeInactive(element)
136
+ element.hidden = true
137
+ }
138
+
139
+ /**
140
+ * Makes an element inactive.
141
+ * @private
142
+ * @param {HTMLElement} element - The element.
143
+ */
144
+ makeInactive(element) {
145
+ element.classList.remove(this.activeClass)
146
+ }
147
+
148
+ /**
149
+ * Makes an element active.
150
+ * @private
151
+ * @param {HTMLElement} element - The element.
152
+ */
153
+ makeActive(element) {
154
+ element.classList.add(this.activeClass)
155
+ }
156
+
157
+ /**
158
+ * Gets the index of an element within a collection.
159
+ * @private
160
+ * @param {HTMLElement[]} collection
161
+ * @param {HTMLElement} child
162
+ */
163
+ getIndexOfChild(collection, child) {
164
+ return collection.indexOf(collection.find(element => element.contains(child)))
165
+ }
166
+
167
+ /**
168
+ * Gets visible targets within a collection.
169
+ * @private
170
+ * @param {HTMLElement[]} targets
171
+ */
172
+ getVisibleTargets(targets) {
173
+ return targets.filter(target => target.hidden === false)
174
+ }
175
+ }