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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +101 -0
- data/Rakefile +40 -0
- data/app/assets/config/spina_admin_conferences_manifest.js +4 -0
- data/app/assets/javascripts/spina/admin/conferences/application.es6 +20 -0
- data/app/assets/javascripts/spina/admin/conferences/controllers/conference_events_form_controller.es6 +175 -0
- data/app/assets/javascripts/spina/admin/conferences/controllers/presentation_attachments_form_controller.es6 +175 -0
- data/app/assets/javascripts/spina/admin/conferences/controllers/select_options_controller.es6 +216 -0
- data/app/assets/stylesheets/spina/admin/conferences/application.sass +14 -0
- data/app/controllers/spina/admin/conferences/application_controller.rb +20 -0
- data/app/controllers/spina/admin/conferences/conferences_controller.rb +148 -0
- data/app/controllers/spina/admin/conferences/delegates_controller.rb +116 -0
- data/app/controllers/spina/admin/conferences/dietary_requirements_controller.rb +106 -0
- data/app/controllers/spina/admin/conferences/events_controller.rb +24 -0
- data/app/controllers/spina/admin/conferences/institutions_controller.rb +106 -0
- data/app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb +104 -0
- data/app/controllers/spina/admin/conferences/presentation_attachments_controller.rb +24 -0
- data/app/controllers/spina/admin/conferences/presentation_types_controller.rb +109 -0
- data/app/controllers/spina/admin/conferences/presentations_controller.rb +124 -0
- data/app/controllers/spina/admin/conferences/rooms_controller.rb +109 -0
- data/app/controllers/spina/admin/conferences/sessions_controller.rb +118 -0
- data/app/helpers/spina/admin/conferences/conferences_helper.rb +44 -0
- data/app/jobs/spina/admin/conferences/application_job.rb +11 -0
- data/app/jobs/spina/admin/conferences/delegate_import_job.rb +37 -0
- data/app/jobs/spina/admin/conferences/import_job.rb +26 -0
- data/app/jobs/spina/admin/conferences/presentation_import_job.rb +38 -0
- data/app/mailers/spina/admin/conferences/application_mailer.rb +13 -0
- data/app/models/spina/admin/conferences.rb +11 -0
- data/app/models/spina/admin/conferences/application_record.rb +14 -0
- data/app/models/spina/admin/conferences/conference.rb +152 -0
- data/app/models/spina/admin/conferences/date_part.rb +15 -0
- data/app/models/spina/admin/conferences/delegate.rb +89 -0
- data/app/models/spina/admin/conferences/dietary_requirement.rb +33 -0
- data/app/models/spina/admin/conferences/email_address_part.rb +21 -0
- data/app/models/spina/admin/conferences/event.rb +120 -0
- data/app/models/spina/admin/conferences/institution.rb +46 -0
- data/app/models/spina/admin/conferences/part.rb +20 -0
- data/app/models/spina/admin/conferences/presentation.rb +143 -0
- data/app/models/spina/admin/conferences/presentation_attachment.rb +27 -0
- data/app/models/spina/admin/conferences/presentation_attachment_type.rb +35 -0
- data/app/models/spina/admin/conferences/presentation_type.rb +60 -0
- data/app/models/spina/admin/conferences/room.rb +52 -0
- data/app/models/spina/admin/conferences/session.rb +56 -0
- data/app/models/spina/admin/conferences/time_part.rb +53 -0
- data/app/models/spina/admin/conferences/url_part.rb +21 -0
- data/app/validators/spina/admin/conferences/conference_date_validator.rb +20 -0
- data/app/validators/spina/admin/conferences/email_address_validator.rb +28 -0
- data/app/validators/spina/admin/conferences/finish_date_validator.rb +20 -0
- data/app/validators/spina/admin/conferences/finish_time_validator.rb +20 -0
- data/app/validators/spina/admin/conferences/http_url_validator.rb +28 -0
- data/app/views/layouts/spina/admin/conferences/conferences.html.haml +19 -0
- data/app/views/layouts/spina/admin/conferences/delegates.html.haml +10 -0
- data/app/views/layouts/spina/admin/conferences/dietary_requirements.html.haml +10 -0
- data/app/views/layouts/spina/admin/conferences/institutions.html.haml +17 -0
- data/app/views/layouts/spina/admin/conferences/presentation_attachment_types.html.haml +10 -0
- data/app/views/layouts/spina/admin/conferences/presentations.html.haml +10 -0
- data/app/views/spina/admin/conferences/application/_empty_list.html.haml +3 -0
- data/app/views/spina/admin/conferences/application/_errors.html.haml +11 -0
- data/app/views/spina/admin/conferences/application/_errors.js.erb +2 -0
- data/app/views/spina/admin/conferences/conferences/_conference.html.haml +9 -0
- data/app/views/spina/admin/conferences/conferences/_event_fields.html.haml +39 -0
- data/app/views/spina/admin/conferences/conferences/_event_row.html.haml +5 -0
- data/app/views/spina/admin/conferences/conferences/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/conferences/_form_conference_details.html.haml +29 -0
- data/app/views/spina/admin/conferences/conferences/_form_delegates.html.haml +12 -0
- data/app/views/spina/admin/conferences/conferences/_form_parts.html.haml +15 -0
- data/app/views/spina/admin/conferences/conferences/_form_presentation_types.html.haml +12 -0
- data/app/views/spina/admin/conferences/conferences/_form_presentations.html.haml +12 -0
- data/app/views/spina/admin/conferences/conferences/_form_rooms.html.haml +12 -0
- data/app/views/spina/admin/conferences/conferences/_form_structure.html.haml +19 -0
- data/app/views/spina/admin/conferences/conferences/_form_structure_item.html.haml +13 -0
- data/app/views/spina/admin/conferences/conferences/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/conferences/index.html.haml +18 -0
- data/app/views/spina/admin/conferences/conferences/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/delegates/_delegate.html.haml +13 -0
- data/app/views/spina/admin/conferences/delegates/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/delegates/_form_conferences.html.haml +14 -0
- data/app/views/spina/admin/conferences/delegates/_form_delegate_details.html.haml +38 -0
- data/app/views/spina/admin/conferences/delegates/_form_presentations.html.haml +12 -0
- data/app/views/spina/admin/conferences/delegates/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/delegates/index.html.haml +23 -0
- data/app/views/spina/admin/conferences/delegates/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/dietary_requirements/_dietary_requirement.html.haml +6 -0
- data/app/views/spina/admin/conferences/dietary_requirements/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/dietary_requirements/_form_delegates.html.haml +12 -0
- data/app/views/spina/admin/conferences/dietary_requirements/_form_dietary_requirement_details.html.haml +9 -0
- data/app/views/spina/admin/conferences/dietary_requirements/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/dietary_requirements/index.html.haml +15 -0
- data/app/views/spina/admin/conferences/dietary_requirements/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/events/new.js.erb +27 -0
- data/app/views/spina/admin/conferences/institutions/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/institutions/_form_delegates.html.haml +12 -0
- data/app/views/spina/admin/conferences/institutions/_form_institution_details.html.haml +35 -0
- data/app/views/spina/admin/conferences/institutions/_form_rooms.html.haml +12 -0
- data/app/views/spina/admin/conferences/institutions/_institution.html.haml +7 -0
- data/app/views/spina/admin/conferences/institutions/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/institutions/index.html.haml +16 -0
- data/app/views/spina/admin/conferences/institutions/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentation_attachment_types/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/presentation_attachment_types/_presentation_attachment_type.html.haml +6 -0
- data/app/views/spina/admin/conferences/presentation_attachment_types/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentation_attachment_types/index.html.haml +15 -0
- data/app/views/spina/admin/conferences/presentation_attachment_types/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentation_attachments/new.js.erb +21 -0
- data/app/views/spina/admin/conferences/presentation_types/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/presentation_types/_form_presentation_type_details.html.haml +20 -0
- data/app/views/spina/admin/conferences/presentation_types/_form_presentations.html.haml +12 -0
- data/app/views/spina/admin/conferences/presentation_types/_form_sessions.html.haml +12 -0
- data/app/views/spina/admin/conferences/presentation_types/_presentation_type.html.haml +8 -0
- data/app/views/spina/admin/conferences/presentation_types/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentation_types/index.html.haml +17 -0
- data/app/views/spina/admin/conferences/presentation_types/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentations/_attachment_fields.html.haml +27 -0
- data/app/views/spina/admin/conferences/presentations/_attachment_row.html.haml +2 -0
- data/app/views/spina/admin/conferences/presentations/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/presentations/_form_presentation_details.html.haml +55 -0
- data/app/views/spina/admin/conferences/presentations/_form_presenters.html.haml +12 -0
- data/app/views/spina/admin/conferences/presentations/_presentation.html.haml +11 -0
- data/app/views/spina/admin/conferences/presentations/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentations/index.html.haml +23 -0
- data/app/views/spina/admin/conferences/presentations/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/rooms/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/rooms/_form_presentations.html.haml +12 -0
- data/app/views/spina/admin/conferences/rooms/_form_room_details.html.haml +18 -0
- data/app/views/spina/admin/conferences/rooms/_room.html.haml +8 -0
- data/app/views/spina/admin/conferences/rooms/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/rooms/index.html.haml +17 -0
- data/app/views/spina/admin/conferences/rooms/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/sessions/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/sessions/_form_presentations.html.haml +12 -0
- data/app/views/spina/admin/conferences/sessions/_form_session_details.html.haml +23 -0
- data/app/views/spina/admin/conferences/sessions/_session.html.haml +8 -0
- data/app/views/spina/admin/conferences/sessions/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/sessions/index.html.haml +17 -0
- data/app/views/spina/admin/conferences/sessions/new.html.haml +1 -0
- data/app/views/spina/admin/hooks/conferences/_head.html.haml +2 -0
- data/app/views/spina/admin/hooks/conferences/_primary_navigation.html.haml +20 -0
- data/app/views/spina/admin/hooks/conferences/_settings_secondary_navigation.html.haml +4 -0
- data/app/views/spina/admin/partables/admin/conferences/date_parts/_form.html.haml +5 -0
- data/app/views/spina/admin/partables/admin/conferences/email_address_parts/_form.html.haml +5 -0
- data/app/views/spina/admin/partables/admin/conferences/time_parts/_form.html.haml +7 -0
- data/app/views/spina/admin/partables/admin/conferences/url_parts/_form.html.haml +5 -0
- data/config/initializers/assets.rb +13 -0
- data/config/initializers/types.rb +13 -0
- data/config/locales/en.yml +354 -0
- data/config/routes.rb +27 -0
- data/db/migrate/20180907141228_create_spina_dates.rb +11 -0
- data/db/migrate/20180907141229_create_spina_email_addresses.rb +11 -0
- data/db/migrate/20180907141230_create_spina_urls.rb +11 -0
- data/db/migrate/20180907141231_create_spina_conferences_institutions.rb +12 -0
- data/db/migrate/20180907141232_create_spina_conferences_delegates.rb +15 -0
- data/db/migrate/20180907141234_create_spina_conferences_dietary_requirements.rb +11 -0
- data/db/migrate/20180907141235_create_spina_conferences_conferences.rb +12 -0
- data/db/migrate/20180907141236_create_spina_conferences_presentation_types.rb +13 -0
- data/db/migrate/20180907141238_create_join_table_spina_conferences_conference_delegate.rb +7 -0
- data/db/migrate/20180907141239_create_join_table_spina_conferences_delegate_presentation.rb +7 -0
- data/db/migrate/20180907141240_create_join_table_spina_conferences_delegate_dietary_requirement.rb +7 -0
- data/db/migrate/20180907141242_add_type_to_spina_pages.rb +7 -0
- data/db/migrate/20180907141243_create_spina_conferences_conference_page_parts.rb +14 -0
- data/db/migrate/20180914121905_add_logo_ref_to_spina_conferences_institutions.rb +7 -0
- data/db/migrate/20180916135431_create_spina_conferences_rooms.rb +13 -0
- data/db/migrate/20180916135432_create_spina_conferences_room_possessions.rb +10 -0
- data/db/migrate/20180916135433_create_spina_conferences_room_uses.rb +10 -0
- data/db/migrate/20180916135434_create_spina_conferences_presentations.rb +15 -0
- data/db/migrate/20181009122503_create_spina_times.rb +11 -0
- data/db/migrate/20181009130631_rename_spina_page_parts.rb +10 -0
- data/db/migrate/20181012190811_rename_spina_conferences_page_parts.rb +10 -0
- data/db/migrate/20181012213049_change_start_time_in_spina_conferences_conferences.rb +15 -0
- data/db/migrate/20181012214813_rename_start_time_in_spina_conferences_conferences.rb +7 -0
- data/db/migrate/20181017155705_add_dependent_option_to_foreign_keys.rb +36 -0
- data/db/migrate/20190408131354_change_spina_resources.rb +56 -0
- data/db/migrate/20190622131423_create_spina_conferences_parts.rb +12 -0
- data/db/migrate/20190701174807_remove_spina_conference_pages.rb +199 -0
- data/db/migrate/20190704135524_add_constraints_to_columns.rb +24 -0
- data/db/migrate/20200126034441_create_spina_conferences_presentation_attachment_types.rb +11 -0
- data/db/migrate/20200126213718_create_spina_conferences_presentation_attachments.rb +19 -0
- data/db/migrate/20200420104603_create_spina_conferences_dietary_requirement_name_translations.rb +19 -0
- data/db/migrate/20200420104740_create_spina_conferences_institution_name_and_city_translations.rb +20 -0
- data/db/migrate/20200420105057_create_spina_conferences_presentation_title_and_abstract_translations.rb +20 -0
- data/db/migrate/20200420105144_create_spina_conferences_presentation_attachment_type_name_translations.rb +20 -0
- data/db/migrate/20200420105201_create_spina_conferences_presentation_type_name_translations.rb +19 -0
- data/db/migrate/20200420105458_create_spina_conferences_room_building_and_number_translations.rb +20 -0
- data/db/migrate/20200420110407_move_attributes_to_translation_tables.rb +161 -0
- data/db/migrate/20200420120706_remove_name_from_spina_conferences_dietary_requirements.rb +7 -0
- data/db/migrate/20200420120759_remove_name_and_city_from_spina_conferences_institutions.rb +8 -0
- data/db/migrate/20200420120946_remove_title_and_abstract_from_spina_conferences_presentations.rb +8 -0
- data/db/migrate/20200420121310_remove_name_from_spina_conferences_presentation_attachment_types.rb +7 -0
- data/db/migrate/20200420121321_remove_name_from_spina_conferences_presentation_types.rb +7 -0
- data/db/migrate/20200420121443_remove_building_and_number_from_spina_conferences_rooms.rb +8 -0
- data/db/migrate/20200502133408_create_spina_conferences_conference_name_translations.rb +19 -0
- data/db/migrate/20200502183409_set_name_for_spina_conferences_conferences.rb +47 -0
- data/db/migrate/20200502183410_remove_institution_from_spina_conferences_conferences.rb +8 -0
- data/db/migrate/20200502183719_remove_spina_conferences_room_possessions.rb +60 -0
- data/db/migrate/20200503230732_rename_spina_conferences_room_uses.rb +8 -0
- data/db/migrate/20200510125131_create_spina_conferences_session_name_translations.rb +19 -0
- data/db/migrate/20200802165242_create_spina_conferences_events.rb +13 -0
- data/db/migrate/20200802184921_create_spina_conferences_event_name_description_and_location_translations.rb +21 -0
- data/db/migrate/20200911161632_update_spina_conferences_parts.rb +23 -0
- data/db/migrate/20200911161651_update_spina_parts.rb +37 -0
- data/db/migrate/20200911161726_move_presentation_parts.rb +101 -0
- data/db/migrate/20200911161739_move_conference_parts.rb +219 -0
- data/db/migrate/20201002122517_remove_spina_conferences_conference_page_parts.rb +14 -0
- data/db/migrate/20201007125625_add_timestamps_to_spina_conferences_parts.rb +9 -0
- data/lib/spina/admin/conferences.rb +20 -0
- data/lib/spina/admin/conferences/engine.rb +26 -0
- data/lib/spina/admin/conferences/migration/renaming.rb +81 -0
- data/lib/spina/admin/conferences/railtie.rb +34 -0
- data/lib/spina/admin/conferences/types/interval_type.rb +29 -0
- data/lib/spina/admin/conferences/version.rb +10 -0
- data/lib/tasks/spina/admin/conferences_tasks.rake +4 -0
- metadata +561 -0
checksums.yaml
ADDED
|
@@ -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
|
data/MIT-LICENSE
ADDED
|
@@ -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.
|
data/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Conferences
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.com/jmalcic/spina-conferences)
|
|
4
|
+

|
|
5
|
+
[](https://coveralls.io/github/jmalcic/spina-conferences?branch=master)
|
|
6
|
+
[](https://lgtm.com/projects/g/jmalcic/spina-conferences/alerts/)
|
|
7
|
+
[](https://lgtm.com/projects/g/jmalcic/spina-conferences/context:javascript)
|
|
8
|
+
[](https://www.codefactor.io/repository/github/jmalcic/spina-conferences)
|
|
9
|
+
[](http://inch-ci.org/github/jmalcic/spina-conferences)
|
|
10
|
+
[](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).
|
data/Rakefile
ADDED
|
@@ -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,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
|
+
}
|