Skip to content

Commit

Permalink
Bring in "About OITE Events" content
Browse files Browse the repository at this point in the history
- Make events/about page
- Add custom "Related resources" block for side nav
  • Loading branch information
matthinz committed Jun 1, 2022
1 parent a63d75b commit d1971e2
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 6 deletions.
7 changes: 7 additions & 0 deletions _blocks/event-accessibility/block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Event accessibility
---

## Accessibility

If you need interpreting services and/or other reasonable accommodations to participate in an event, contact <[email protected]>. Or, if you regularly request services through the NIH Interpreting Office, contact them at <[email protected]>. American Sign Language interpreting services, CART services, and other reasonable accommodations are available. Requests should be made at least five business days in advance, when possible, to ensure interpreter availability.
13 changes: 13 additions & 0 deletions _blocks/events-subnav/block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Events subnav
---

### Related resources

[About OITE events](/events/about)

[Accessibility](/events/about#accessibility)

[OITE on YouTube](https://www.youtube.com/c/NIHOITE)

[Past events](/events?from=2010-01-01)
1 change: 1 addition & 0 deletions _pages/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ title: About OITE
access:
public: true
---

8 changes: 5 additions & 3 deletions _pages/events/about/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
title: About OITE events
access:
public: true
sidebar_blocks:
- block: "events-subnav/block"
---

# About OITE events

The NIH Office of Intramural Training & Education (OITE) provides free events for the biomedical research community including current NIH trainees, other members of the NIH community, and the public. We offer events related to wellness, personal and professional development, career services, science skills, ethics, and more.

## Accessibility

If you need interpreting services and/or other reasonable accommodations to participate in an event, contact <[email protected]>. Or, if you regularly request services through the NIH Interpreting Office, contact them at [email protected]. American Sign Language interpreting services, CART services, and other reasonable accommodations are available. Requests should be made at least five business days in advance, when possible, to ensure interpreter availability.
{::content_block slug="event-accessibility/block" /}

## Current NIH trainees: check your institute’s calendar for more events

Expand Down
2 changes: 2 additions & 0 deletions _pages/events/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: Events
sidebar_blocks:
- block: events-subnav/block
access:
public: true
lifecycle:
Expand Down
8 changes: 7 additions & 1 deletion app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,18 @@ def index

@events = @events.slice(0, @limit)

@pages = Page.build_hierarchy
@page = begin
Page.find_by_path "events"
Page.find_by_path "events", hierarchy: @pages
rescue Page::NotFound
nil
end

if @page.present?
@side_nav_items = Menu.build_side_nav @pages, @page
@show_sidebar = @page.has_sidebar? || @side_nav_items.length > 0
end

@not_found = begin
ContentBlock.find_by_path "no-events-found/block"
rescue ContentBlock::NotFound
Expand Down
8 changes: 6 additions & 2 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ class PagesController < ApplicationController
end

def page
# :path_prefix is a parameter used to support serving content pages
# from routes handled by other controllers, e.g. `events/about`.
path = "#{params[:path_prefix]}#{params[:path]}"

@pages = Page.build_hierarchy

@page = Page.find_by_path params[:path], hierarchy: @pages
@page = Page.find_by_path path, hierarchy: @pages

if @page.obsolete?
redirect_to content_page_path(path: @page.redirect_page)
Expand All @@ -25,7 +29,7 @@ def page
@page_title = @page.title
render formats: :html
else
store_location_for(:user, "/#{params[:path]}")
store_location_for(:user, "/#{path}")
redirect_to root_path
end
rescue Page::NotFound
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
get "admin/config", format: "yml", to: "pages#netlify_config"
get "admin/", to: "pages#netlify"

get "events/*path", to: "pages#page", defaults: {path_prefix: "events/"}
resources :events, only: %i[index show]

get "sitemap", to: "pages#sitemap"
Expand Down

0 comments on commit d1971e2

Please sign in to comment.