spina-conferences-primer_theme 0.1.6 → 0.1.11

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/spina_conferences_primer_theme_manifest.js +1 -0
  3. data/app/controllers/spina/conferences/primer_theme/presentations_controller.rb +1 -1
  4. data/app/helpers/spina/conferences/primer_theme/application_helper.rb +5 -4
  5. data/app/views/conferences_primer_theme/pages/about.html.haml +3 -0
  6. data/app/views/conferences_primer_theme/pages/events.html.haml +12 -0
  7. data/app/views/layouts/spina/conferences/primer_theme/application.html.haml +1 -0
  8. data/app/views/spina/application/_mobile_navigation_item.html.haml +11 -2
  9. data/app/views/spina/application/_navigation.html.haml +3 -4
  10. data/app/views/spina/application/_navigation_item.html.haml +12 -1
  11. data/app/views/spina/conferences/primer_theme/conferences/_conference.html.haml +15 -16
  12. data/app/views/spina/conferences/primer_theme/conferences/_conference.ics.erb +0 -2
  13. data/app/views/spina/conferences/primer_theme/conferences/_event.html.haml +11 -12
  14. data/app/views/spina/conferences/primer_theme/conferences/_event.ics.erb +0 -2
  15. data/app/views/spina/conferences/primer_theme/conferences/_institution.html.haml +5 -6
  16. data/app/views/spina/conferences/primer_theme/conferences/_institution_logo.html.haml +4 -3
  17. data/app/views/spina/conferences/primer_theme/conferences/_presentation.html.haml +13 -14
  18. data/app/views/spina/conferences/primer_theme/conferences/_presentation.ics.erb +0 -2
  19. data/app/views/spina/conferences/primer_theme/conferences/_presentation_type.html.haml +5 -6
  20. data/app/views/spina/conferences/primer_theme/conferences/_sponsor.html.haml +8 -9
  21. data/app/views/spina/conferences/primer_theme/conferences/show.html.haml +2 -2
  22. data/app/views/spina/pages/_committee_bio.html.haml +14 -10
  23. data/app/views/spina/pages/_document.html.haml +15 -0
  24. data/app/views/spina/pages/_documents.html.haml +7 -0
  25. data/app/views/spina/pages/_event.html.haml +18 -0
  26. data/app/views/spina/pages/_events_list.html.haml +19 -0
  27. data/config/initializers/themes/conferences_primer_theme.rb +53 -1
  28. data/config/locales/en.rb +11 -0
  29. data/config/locales/en.yml +16 -0
  30. data/lib/spina/conferences/primer_theme/version.rb +1 -1
  31. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d8f78c47c7e62b8f1641637726ff25cd91287b192d211b2611cb4e3fdee3c8f
4
- data.tar.gz: 3250dcb6212ba99235b1913687c8744ddff6c7460c9ab0bcfffb9859ab0f6f63
3
+ metadata.gz: b0411781b97280c551101adc4a5ce6c22dc4670ebb46756344f15db684a0f076
4
+ data.tar.gz: faf507df7d5c70707f1bb89deba383e7d9d3566d45e6d5e15fbe619247fba2ec
5
5
  SHA512:
6
- metadata.gz: cd58dadf7abf1ece8546b842de360721e6c3a833cf16a69e4bbd9ea9b7a8ecd1e7149a12258e5700bf6d2dad1fb5a1cfa8fe0378eec62341828e0915e5c855ef
7
- data.tar.gz: 966d524a6977b9e34d0ed54b9e5444984bc8513f47eb7c9c9910e845ea9ff4450ad257f2f43fda4c0d43fd2c603f4be065bb81bd52b35dfbd1c7418c1fa28a2d
6
+ metadata.gz: 63bbf621738d325bef6bc0ef09e98c03c5da4410627f1d9406a3da10829100af8052a5d5fb16e81999b2856a66318dcba69fc7580f270831d514eeaf1cee41d5
7
+ data.tar.gz: 8ee36494041609dd364b8bc8ea1b3e1477cb2a7e499e631b20b17ba44cc6103d231b9121b7abd3e425fe99a32866327e6d5a4de42883b97d2b9b5a2c79f3cb29
@@ -6,3 +6,4 @@
6
6
  //= link @github/include-fragment-element/dist/index.js
7
7
  //= link @github/tab-container-element/dist/index.js
8
8
  //= link @github/filter-input-element/dist/index.js
9
+ //= link @github/details-menu-element/dist/index.js
@@ -11,7 +11,7 @@ module Spina
11
11
  add_breadcrumb @presentation.name
12
12
  respond_to do |format|
13
13
  format.html
14
- format.ics { render nothing: true, status: :gone }
14
+ format.ics { head :not_found }
15
15
  end
16
16
  end
17
17
 
@@ -18,7 +18,7 @@ module Spina
18
18
 
19
19
  render Primer::BreadcrumbComponent.new(mb: 4) do |component|
20
20
  current_page.ancestors.each do |ancestor|
21
- component.slot(:item, href: 'ancestor.materialized_path') { ancestor.menu_title }
21
+ component.slot(:item, href: ancestor.materialized_path) { ancestor.menu_title }
22
22
  end
23
23
  component.slot(:item, selected: true) { current_page.menu_title }
24
24
  end
@@ -42,15 +42,16 @@ module Spina
42
42
  t :'.title', title: current_page.present? ? current_page.seo_title : @title, suffix: current_account.name # rubocop:disable Rails/HelperInstanceVariable
43
43
  end
44
44
 
45
- def partable_for(*parts, parent: current_page)
45
+ def partable_for(*part_names, parent: current_page)
46
46
  association = case parent
47
47
  when Spina::Page then :page_partable
48
48
  when Spina::StructureItem then :structure_partable
49
49
  when Spina::Account then :layout_partable
50
50
  else :partable
51
51
  end
52
- part = parent.parts.find_by(name: parts)
53
- [part, part.try(association)]
52
+ parts = parent.parts.where(name: part_names)
53
+ part_parents = parts.collect { |part| part.try(association) }
54
+ [*parts, *part_parents]
54
55
  end
55
56
 
56
57
  def calendar(name:, &block)
@@ -13,6 +13,9 @@
13
13
  - cache [partable_for(:minutes), content(:minutes)&.structure_items,
14
14
  content(:minutes)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
15
15
  .mt-4.col-12.col-md-6.float-md-left= render partial: 'minutes', object: content(:minutes)
16
+ - cache [partable_for(:documents), content(:documents)&.structure_items,
17
+ content(:documents)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
18
+ .mt-4.col-12.col-md-12.float-md-left= render partial: 'documents', object: content(:documents)
16
19
  - cache [partable_for(:partner_societies), content(:partner_societies)&.structure_items,
17
20
  content(:partner_societies)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
18
21
  - if has_content?(:partner_societies) && content(:partner_societies).structure_items.any?
@@ -0,0 +1,12 @@
1
+ - cache current_page do
2
+ %h1= current_page.title
3
+
4
+ - cache partable_for(:text) do
5
+ - if has_content? :text
6
+ .mt-4= render partial: 'text', object: content(:text)
7
+ - cache [partable_for(:events_list), content(:events_list)&.structure_items,
8
+ content(:events_list)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
9
+ - if has_content?(:events_list) && content(:events_list).structure_items.any?
10
+ .mt-2= render partial: 'events_list', object: content(:events_list)
11
+ - else
12
+ = render Primer::BlankslateComponent.new(title: t(:'.no_events'), icon: 'calendar')
@@ -19,6 +19,7 @@
19
19
  %script{ type: 'module', src: asset_path('@github/include-fragment-element/dist/index.js') }
20
20
  %script{ type: 'module', src: asset_path('@github/tab-container-element/dist/index.js') }
21
21
  %script{ type: 'module', src: asset_path('@github/filter-input-element/dist/index.js') }
22
+ %script{ type: 'module', src: asset_path('@github/details-menu-element/dist/index.js') }
22
23
  = yield :head
23
24
  %body
24
25
  .admin= render 'spina/shared/admin_bar'
@@ -1,2 +1,11 @@
1
- = link_to mobile_navigation_item.menu_title, mobile_navigation_item.materialized_path,
2
- class: %w[d-block py-2 border-top border-white-fade text-white]
1
+ - if mobile_navigation_item.has_children?
2
+ %details.details-reset
3
+ %summary.btn-link.d-block.py-2.border-top.border-white-fade.text-white
4
+ = mobile_navigation_item.menu_title
5
+ = render Primer::OcticonComponent.new(icon: 'chevron-down')
6
+ %ul.list-style-none
7
+ - mobile_navigation_item.children.each do |child|
8
+ %li= link_to child.menu_title, child.materialized_path, class: %w[d-block py-2 pl-3 border-top border-white-fade text-white]
9
+ - elsif mobile_navigation_item.is_root?
10
+ = link_to mobile_navigation_item.menu_title, mobile_navigation_item.materialized_path,
11
+ class: %w[d-block py-2 border-top border-white-fade text-white]
@@ -1,10 +1,9 @@
1
1
  .Header.bg-blue.px-3.px-md-4.px-lg-5
2
- .Header-item.d-none.d-lg-flex.mt-n1.mb-n1= link_to render('logo'), root_path, class: 'Header-link'
2
+ .Header-item.mt-n1.mb-n1= link_to render('logo'), root_path, class: 'Header-link'
3
3
  .Header-item.Header-item--full.d-flex.d-lg-none{ aria: { hidden: true } }
4
- = link_to render('logo'), root_path, class: %w[Header-link float-left]
5
- %details.details-reset.text-right
4
+ %details.details-reset
6
5
  %summary.btn-link.Header-link= octicon 'three-bars', height: 24
7
- .d-flex.flex-column.flex-self-stretch.mt-3.text-left
6
+ .px-3.px-md-4.px-lg-5.bg-blue.Popover.left-0.right-0.mt-3
8
7
  = render partial: 'mobile_navigation_item', collection: main_navigation_items, cached: true
9
8
  = link_to 'Conferences', frontend_conferences_url, class: %w[d-block py-2 border-top border-white-fade text-white]
10
9
  = render partial: 'navigation_item', collection: main_navigation_items, cached: true
@@ -1 +1,12 @@
1
- .Header-item.d-none.d-lg-flex= link_to navigation_item.menu_title, navigation_item.materialized_path, class: 'Header-link'
1
+ - if navigation_item.has_children?
2
+ .Header-item.d-none.d-lg-flex
3
+ %details.dropdown.details-reset.details-overlay
4
+ %summary.Header-link
5
+ = navigation_item.menu_title
6
+ %span.dropdown-caret
7
+ %details-menu.dropdown-menu.dropdown-menu-se.mt-3{ role: 'menu' }
8
+ - navigation_item.children.each do |child|
9
+ %li= link_to child.menu_title, child.materialized_path, class: 'dropdown-item'
10
+ - elsif navigation_item.is_root?
11
+ .Header-item.d-none.d-lg-flex
12
+ = link_to navigation_item.menu_title, navigation_item.materialized_path, class: 'Header-link'
@@ -1,16 +1,15 @@
1
- - cache [conference, conference.institutions, conference.institutions.collect(&:logo)] do
2
- .d-flex.flex-column.flex-md-row-reverse.flex-justify-start.flex-md-justify-between
3
- %ul.list-style-none.d-flex.flex-wrap.flex-md-justify-end.pl-md-2.pb-2.pb-md-0{ class: dom_class(conference.institutions) }
4
- = render partial: 'institution', collection: conference.institutions, cached: -> institution { [institution, institution.logo] }
5
- .flex-auto
6
- %h3.mb-1
7
- = link_to conference.name, frontend_conference_path(conference)
8
- %ul.text-gray.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
9
- %li.mr-sm-3
10
- = octicon 'calendar'
11
- = t :'.dates_html', start_date: time_tag(conference.start_date, format: :date), finish_date: time_tag(conference.finish_date)
12
- - if conference.institutions.any?
13
- %li
14
- = octicon 'location'
15
- %address.d-inline= t :'.locations', institutions: conference.institutions.pluck(:name).to_sentence,
16
- cities: conference.institutions.pluck(:city).uniq.to_sentence
1
+ .d-flex.flex-column.flex-md-row-reverse.flex-justify-start.flex-md-justify-between
2
+ %ul.list-style-none.d-flex.flex-wrap.flex-md-justify-end.pl-md-2.pb-2.pb-md-0{ class: dom_class(conference.institutions) }
3
+ = render partial: 'institution', collection: conference.institutions, cached: -> institution { [institution, institution.logo] }
4
+ .flex-auto
5
+ %h3.mb-1
6
+ = link_to conference.name, frontend_conference_path(conference)
7
+ %ul.text-gray.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
8
+ %li.mr-sm-3
9
+ = octicon 'calendar'
10
+ = t :'.dates_html', start_date: time_tag(conference.start_date, format: :date), finish_date: time_tag(conference.finish_date)
11
+ - if conference.institutions.any?
12
+ %li
13
+ = octicon 'location'
14
+ %address.d-inline= t :'.locations', institutions: conference.institutions.pluck(:name).to_sentence,
15
+ cities: conference.institutions.pluck(:city).uniq.to_sentence
@@ -1,3 +1 @@
1
- <% cache conference do %>
2
1
  <%= conference.to_event.to_ical -%>
3
- <% end %>
@@ -1,12 +1,11 @@
1
- - cache event do
2
- .d-flex.flex-column.flex-sm-row
3
- .flex-shrink-0.mr-sm-3.mb-3.mb-sm-0.col-sm-4
4
- %span.f3-light.mb-1
5
- = octicon 'clock', class: 'v-align-baseline'
6
- = t :'.times_html', start_time: time_tag(event.start_time, format: :short), finish_time: time_tag(event.finish_time, format: :time)
7
- .text-gray
8
- = octicon 'location'
9
- %address.d-inline= event.location
10
- .flex-auto
11
- %h3.mb-1= event.name
12
- .text-gray= event.description.try(:html_safe)
1
+ .d-flex.flex-column.flex-sm-row
2
+ .flex-shrink-0.mr-sm-3.mb-3.mb-sm-0.col-sm-4
3
+ %span.f3-light.mb-1
4
+ = octicon 'clock', class: 'v-align-baseline'
5
+ = t :'.times_html', start_time: time_tag(event.start_time, format: :short), finish_time: time_tag(event.finish_time, format: :time)
6
+ .text-gray
7
+ = octicon 'location'
8
+ %address.d-inline= event.location
9
+ .flex-auto
10
+ %h3.mb-1= event.name
11
+ .text-gray= event.description.try(:html_safe)
@@ -1,3 +1 @@
1
- <% cache event do %>
2
1
  <%= event.to_event.to_ical -%>
3
- <% end %>
@@ -1,6 +1,5 @@
1
- - cache [institution, institution.logo] do
2
- %li
3
- - if institution.logo.present?
4
- = render partial: 'institution_logo', object: institution.logo, locals: { institution: institution }
5
- - else
6
- = institution.name
1
+ %li
2
+ - if institution.logo.present?
3
+ = render partial: 'institution_logo', object: institution.logo, locals: { institution: institution }
4
+ - else
5
+ = institution.name
@@ -1,3 +1,4 @@
1
- - if institution_logo.file.present?
2
- = image_tag main_app.url_for(institution_logo.file.variant(resize_to_limit: [300, 60])), srcset: srcset(institution_logo.file,
3
- variant: { resize_to_limit: [300, 60] }), alt_description: institution.name, draggable: false, class: 'p-1'
1
+ - cache institution_logo do
2
+ - if institution_logo.file.present?
3
+ = image_tag main_app.url_for(institution_logo.file.variant(resize_to_limit: [300, 60])), srcset: srcset(institution_logo.file,
4
+ variant: { resize_to_limit: [300, 60] }), alt_description: institution.name, draggable: false, class: 'p-1'
@@ -1,14 +1,13 @@
1
- - cache [presentation, presentation.presenters] do
2
- .d-flex.flex-column.flex-sm-row
3
- .flex-shrink-0.mr-sm-3.mb-3.mb-sm-0.col-sm-3
4
- %span.f3-light.mb-1
5
- = octicon 'clock', class: 'v-align-baseline'
6
- = time_tag presentation.start_datetime, format: :short
7
- .text-gray
8
- = octicon 'location'
9
- %address.d-inline= presentation.session.room_name
10
- .flex-auto
11
- %h3.mb-1= link_to presentation.title, frontend_conference_presentation_path(conference, presentation)
12
- .text-gray
13
- = octicon presentation.presenters.many? ? 'people' : 'person'
14
- %address.d-inline= presentation.presenters.collect(&:full_name_and_institution).to_sentence
1
+ .d-flex.flex-column.flex-sm-row
2
+ .flex-shrink-0.mr-sm-3.mb-3.mb-sm-0.col-sm-3
3
+ %span.f3-light.mb-1
4
+ = octicon 'clock', class: 'v-align-baseline'
5
+ = time_tag presentation.start_datetime, format: :short
6
+ .text-gray
7
+ = octicon 'location'
8
+ %address.d-inline= presentation.session.room_name
9
+ .flex-auto
10
+ %h3.mb-1= link_to presentation.title, frontend_conference_presentation_path(conference, presentation)
11
+ .text-gray
12
+ = octicon presentation.presenters.many? ? 'people' : 'person'
13
+ %address.d-inline= presentation.presenters.collect(&:full_name_and_institution).to_sentence
@@ -1,3 +1 @@
1
- <% cache presentation do %>
2
1
  <%= presentation.to_event.to_ical -%>
3
- <% end %>
@@ -1,6 +1,5 @@
1
- - cache [presentation_type, @presentation_type] do
2
- %li
3
- = link_to frontend_conference_url(presentation_type.conference, presentation_type: presentation_type.id, tab: 'presentations'),
4
- class: 'filter-item', aria: { current: @presentation_type == presentation_type ? 'page' : nil } do
5
- = presentation_type.name.pluralize
6
- %span.count{ title: t(:'.results') }= presentation_type.presentations.count
1
+ %li
2
+ = link_to frontend_conference_url(presentation_type.conference, presentation_type: presentation_type.id, tab: 'presentations'),
3
+ class: 'filter-item', aria: { current: @presentation_type == presentation_type ? 'page' : nil } do
4
+ = presentation_type.name.pluralize
5
+ %span.count{ title: t(:'.results') }= presentation_type.presentations.count
@@ -1,9 +1,8 @@
1
- - cache [sponsor, sponsor.structure_parts.collect(&:structure_partable)] do
2
- %li.d-inline-block.m-2.v-align-middle
3
- - if sponsor.has_content?(:logo) && sponsor.content(:logo).file.present?
4
- = link_to sponsor.content(:website) do
5
- = image_tag(main_app.url_for(sponsor.content(:logo).file.variant(resize_to_limit: [200, 60])),
6
- srcset: srcset(sponsor.content(:logo).file, variant: { resize_to_limit: [200, 60] }),
7
- alt_description: sponsor.content(:name), draggable: false)
8
- - else
9
- = link_to sponsor.content(:name), sponsor.content(:website)
1
+ %li.d-inline-block.m-2.v-align-middle
2
+ - if sponsor.has_content?(:logo) && sponsor.content(:logo).file.present?
3
+ = link_to sponsor.content(:website) do
4
+ = image_tag(main_app.url_for(sponsor.content(:logo).file.variant(resize_to_limit: [200, 60])),
5
+ srcset: srcset(sponsor.content(:logo).file, variant: { resize_to_limit: [200, 60] }),
6
+ alt_description: sponsor.content(:name), draggable: false)
7
+ - else
8
+ = link_to sponsor.content(:name), sponsor.content(:website)
@@ -5,11 +5,11 @@
5
5
  - cache partable_for(:submission_url, parent: @conference) do
6
6
  - if @conference.content(:submission_url).present?
7
7
  = link_to t(:'.submit_abstract'), @conference.content(:submission_url),
8
- class: %i[btn btn-sm flash-action d-none d-sm-inline-block]
8
+ class: %i[btn btn-primary flash-action]
9
9
  - cache partable_for(:submission_date, parent: @conference) do
10
10
  %p
11
11
  = octicon('clock')
12
- = t :'.submit_by_html', date: time_tag(@conference.content(:submission_date), format: :short)
12
+ = t :'.submit_by_html', date: time_tag(@conference.content(:submission_date), format: :full)
13
13
  - cache partable_for(:submission_text, parent: @conference) do
14
14
  - if @conference.content(:submission_text).present?
15
15
  %p= @conference.content(:submission_text).html_safe
@@ -2,18 +2,22 @@
2
2
  .d-flex.flex-column.flex-md-row.flex-items-start
3
3
  - cache partable_for(:profile_picture, parent: committee_bio) do
4
4
  - if committee_bio.has_content?(:profile_picture) && committee_bio.content(:profile_picture).persisted?
5
- = render Primer::AvatarComponent.new(src: src(committee_bio.content(:profile_picture).file, resize_to_fill: [150, 150]),
6
- srcset: concat_srcset(committee_bio.content(:profile_picture).file,
7
- variant: { resize_to_limit: [150, 150] }),
8
- draggable: false, alt: committee_bio.content(:name), size: 150, mr: [nil, nil, 3, nil],
9
- mb: [3, nil, 0, nil])
5
+ .flex-shrink-0
6
+ = render Primer::AvatarComponent.new(src: src(committee_bio.content(:profile_picture).file, resize_to_fill: [150, 150]),
7
+ srcset: concat_srcset(committee_bio.content(:profile_picture).file,
8
+ variant: { resize_to_limit: [150, 150] }),
9
+ draggable: false, alt: committee_bio.content(:name), size: 150, mr: [nil, nil, 3, nil],
10
+ mb: [3, nil, 0, nil])
10
11
  .flex-auto
11
12
  .d-flex.flex-column.flex-md-row.mb-1
12
- - cache partable_for(:name, :role, parent: committee_bio) do
13
- - if committee_bio.has_content?(:name) && committee_bio.has_content?(:role)
14
- %h3.flex-auto= t :'.name_and_role', name: committee_bio.content(:name), role: committee_bio.content(:role)
15
- - elsif committee_bio.has_content?(:name)
16
- %h3.flex-auto= committee_bio.content(:name)
13
+ - cache partable_for(:name, :role, :institution, parent: committee_bio) do
14
+ .flex-column
15
+ - if committee_bio.has_content?(:name) && committee_bio.has_content?(:role)
16
+ %h3.flex-auto= t :'.name_and_role', name: committee_bio.content(:name), role: committee_bio.content(:role)
17
+ - elsif committee_bio.has_content?(:name)
18
+ %h3.flex-auto= committee_bio.content(:name)
19
+ - if committee_bio.has_content?(:institution)
20
+ %h4.flex-auto= committee_bio.content(:institution)
17
21
  .BtnGroup.mt-1.mt-md-0.ml-md-1{ aria: { label: t(:'.contact_buttons') } }
18
22
  - cache partable_for(:twitter_profile, parent: committee_bio) do
19
23
  - if committee_bio.has_content?(:twitter_profile)
@@ -0,0 +1,15 @@
1
+ - cache [document, document.structure_parts.collect(&:structure_partable)] do
2
+ %li.list-style-none.py-1.d-flex.flex-items-center
3
+ - cache partable_for(:name, parent: document) do
4
+ - if(document.has_content?(:name))
5
+ %h3.flex-auto= document.content(:name)
6
+ - else
7
+ %h3.flex-auto= t :'.no_name'
8
+ - cache partable_for(:attachment, parent: document) do
9
+ - if document.has_content?(:attachment) && document.content(:attachment).persisted?
10
+ = render Primer::ButtonComponent.new(tag: :a, ml: 2,
11
+ href: main_app.rails_blob_path(document.content(:attachment), disposition: :attachment)) do
12
+ = render Primer::OcticonComponent.new(icon: 'desktop-download')
13
+ = t(:'.download')
14
+ - else
15
+ .text-small.text-gray= t :'.no_file'
@@ -0,0 +1,7 @@
1
+ - if documents.present? && documents.structure_items.any?
2
+ = render Primer::SubheadComponent.new do |component|
3
+ = component.slot(:heading) { t :'.title' }
4
+
5
+ %ul{ class: dom_class(documents), id: dom_id(documents) }
6
+ = render partial: 'document', collection: documents.structure_items.sorted_by_structure,
7
+ cached: ->(document) { [document, document.structure_parts.collect(&:structure_partable)] }
@@ -0,0 +1,18 @@
1
+ - cache [event, event.structure_parts.collect(&:structure_partable)] do
2
+ .d-flex.flex-column.flex-items-start
3
+ - cache partable_for(:name, parent: event) do
4
+ - if event.has_content?(:name)
5
+ %h3.flex-auto= event.content(:name)
6
+ - cache partable_for(:location, :start_time, parent: event) do
7
+ -# TODO: use 'format: :full' once edit-submission-flash is merged
8
+ %h4.flex-auto= t(:'.time_and_place', time: event.has_content?(:start_time) ? time_tag(event.content(:start_time), format: :short) : t('.time_tbc'),
9
+ place: event.has_content?(:location) ? event.content(:location) : t('.location_tbc')).try(:html_safe)
10
+ - cache partable_for(:description, parent: event) do
11
+ - if event.has_content?(:description)
12
+ .mt-1.text-gray-light= event.content(:description).try(:html_safe)
13
+ - cache partable_for(:url, parent: event) do
14
+ - if event.has_content?(:url)
15
+ .mt-2
16
+ = render Primer::ButtonComponent.new(tag: :a, href: event.content(:url)) do
17
+ = render Primer::OcticonComponent.new(icon: 'link-external')
18
+ = t :'.more_info'
@@ -0,0 +1,19 @@
1
+ %div{ class: dom_class(events_list), id: dom_id(events_list) }
2
+ = render Primer::SubheadComponent.new(mt: 4) do |component|
3
+ = component.slot(:heading) { t :'.upcoming' }
4
+ - events_list.structure_items.sorted_by_structure.filter { |item| item.has_content?(:start_time) && item.content(:start_time) >= Time.now }.then do |events|
5
+ - if events.any?
6
+ %ul
7
+ = render partial: 'event', layout: 'list_item', cached: ->(event) { [event, event.structure_parts.collect(&:structure_partable)] },
8
+ collection: events
9
+ - else
10
+ = render Primer::BlankslateComponent.new(title: t(:'.no_events'), icon: 'calendar')
11
+ = render Primer::SubheadComponent.new(mt: 4) do |component|
12
+ = component.slot(:heading) { t :'.past' }
13
+ - events_list.structure_items.sorted_by_structure.filter { |item| item.has_content?(:start_time) && item.content(:start_time) < Time.now }.then do |events|
14
+ - if events.any?
15
+ %ul
16
+ = render partial: 'event', layout: 'list_item', cached: ->(event) { [event, event.structure_parts.collect(&:structure_partable)] },
17
+ collection: events
18
+ - else
19
+ = render Primer::BlankslateComponent.new(title: t(:'.no_events'), icon: 'calendar')
@@ -36,6 +36,10 @@
36
36
  name: 'minutes',
37
37
  title: 'Minutes',
38
38
  partable_type: 'Spina::Structure'
39
+ }, {
40
+ name: 'documents',
41
+ title: 'Documents',
42
+ partable_type: 'Spina::Structure'
39
43
  }, {
40
44
  name: 'contact',
41
45
  title: 'Contact',
@@ -68,6 +72,10 @@
68
72
  name: 'sponsors',
69
73
  title: 'Sponsors',
70
74
  partable_type: 'Spina::Structure'
75
+ }, {
76
+ name: 'events_list',
77
+ title: 'Events',
78
+ partable_type: 'Spina::Structure'
71
79
  }]
72
80
 
73
81
  theme.layout_parts = [{
@@ -114,6 +122,17 @@
114
122
  title: 'Attachment',
115
123
  partable_type: 'Spina::Attachment'
116
124
  }]
125
+ }, {
126
+ name: 'documents',
127
+ structure_parts: [{
128
+ name: 'name',
129
+ title: 'Name',
130
+ partable_type: 'Spina::Line'
131
+ }, {
132
+ name: 'attachment',
133
+ title: 'Attachment',
134
+ partable_type: 'Spina::Attachment'
135
+ }]
117
136
  }, {
118
137
  name: 'socials',
119
138
  structure_parts: [{
@@ -158,6 +177,10 @@
158
177
  name: 'name',
159
178
  title: 'Name',
160
179
  partable_type: 'Spina::Line'
180
+ }, {
181
+ name: 'institution',
182
+ title: 'Institution',
183
+ partable_type: 'Spina::Line'
161
184
  }, {
162
185
  name: 'role',
163
186
  title: 'Role',
@@ -194,6 +217,30 @@
194
217
  title: 'Website',
195
218
  partable_type: 'Spina::Admin::Conferences::UrlPart'
196
219
  }]
220
+ }, {
221
+ name: 'events_list',
222
+ title: 'Events',
223
+ structure_parts: [{
224
+ name: 'name',
225
+ title: 'Name',
226
+ partable_type: 'Spina::Line'
227
+ }, {
228
+ name: 'start_time',
229
+ title: 'Time',
230
+ partable_type: 'Spina::Admin::Conferences::TimePart'
231
+ }, {
232
+ name: 'location',
233
+ title: 'Location',
234
+ partable_type: 'Spina::Line'
235
+ }, {
236
+ name: 'description',
237
+ title: 'Description',
238
+ partable_type: 'Spina::Text'
239
+ }, {
240
+ name: 'url',
241
+ title: 'Link',
242
+ partable_type: 'Spina::Admin::Conferences::UrlPart'
243
+ }]
197
244
  }]
198
245
 
199
246
  theme.view_templates = [{
@@ -214,7 +261,12 @@
214
261
  name: 'about',
215
262
  title: 'About',
216
263
  description: 'Contains information about the society',
217
- page_parts: %w[text constitution minutes partner_societies contact]
264
+ page_parts: %w[text constitution minutes documents partner_societies contact]
265
+ }, {
266
+ name: 'events',
267
+ title: 'Events',
268
+ description: 'Contains details of past and upcoming events',
269
+ page_parts: %w[text events_list]
218
270
  }, {
219
271
  name: 'show',
220
272
  title: 'Blank',
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ {
4
+ en: {
5
+ date: {
6
+ formats: {
7
+ full: ->(time, _) { "%A, #{time.day.ordinalize} %B %Y" }
8
+ }
9
+ }
10
+ }
11
+ }
@@ -82,6 +82,11 @@ en:
82
82
  download: Download
83
83
  no_file: No file uploaded.
84
84
  no_date: No date specified.
85
+ documents:
86
+ title: Documents
87
+ download: Download
88
+ no_file: No file uploaded.
89
+ no_name: No name.
85
90
  partner_societies:
86
91
  title: Partner societies
87
92
  no_societies: No societies added.
@@ -89,6 +94,17 @@ en:
89
94
  website: Website
90
95
  email: Email
91
96
  contact_buttons: Contact buttons
97
+ events:
98
+ no_events: No events.
99
+ events_list:
100
+ upcoming: Upcoming events
101
+ past: Past events
102
+ no_events: No events.
103
+ event:
104
+ time_and_place: "%{place}, %{time}"
105
+ time_tbc: Time TBC
106
+ location_tbc: Location TBC
107
+ more_info: More information
92
108
 
93
109
  conferences:
94
110
  primer_theme:
@@ -3,7 +3,7 @@
3
3
  module Spina
4
4
  module Conferences
5
5
  module PrimerTheme
6
- VERSION = '0.1.6'
6
+ VERSION = '0.1.11'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spina-conferences-primer_theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Malčić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-08 00:00:00.000000000 Z
11
+ date: 2020-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: babel-transpiler
@@ -303,6 +303,7 @@ files:
303
303
  - app/helpers/spina/conferences/primer_theme/navigations_helper.rb
304
304
  - app/views/conferences_primer_theme/pages/about.html.haml
305
305
  - app/views/conferences_primer_theme/pages/committee.html.haml
306
+ - app/views/conferences_primer_theme/pages/events.html.haml
306
307
  - app/views/conferences_primer_theme/pages/homepage.html.haml
307
308
  - app/views/conferences_primer_theme/pages/information.html.haml
308
309
  - app/views/conferences_primer_theme/pages/show.html.haml
@@ -347,6 +348,10 @@ files:
347
348
  - app/views/spina/pages/_committee_bios.html.haml
348
349
  - app/views/spina/pages/_constitution.html.haml
349
350
  - app/views/spina/pages/_contact.html.haml
351
+ - app/views/spina/pages/_document.html.haml
352
+ - app/views/spina/pages/_documents.html.haml
353
+ - app/views/spina/pages/_event.html.haml
354
+ - app/views/spina/pages/_events_list.html.haml
350
355
  - app/views/spina/pages/_homepage_content.html.haml
351
356
  - app/views/spina/pages/_jumbotron.html.haml
352
357
  - app/views/spina/pages/_minutes.html.haml
@@ -355,6 +360,7 @@ files:
355
360
  - app/views/spina/pages/_partner_society.html.haml
356
361
  - config/initializers/assets.rb
357
362
  - config/initializers/themes/conferences_primer_theme.rb
363
+ - config/locales/en.rb
358
364
  - config/locales/en.yml
359
365
  - config/routes.rb
360
366
  - lib/spina/conferences/primer_theme.rb