Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guideline pages #42

Open
hantuzun opened this issue Apr 17, 2020 · 2 comments
Open

Add guideline pages #42

hantuzun opened this issue Apr 17, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@hantuzun
Copy link
Member

Pages

The index page /guidelines

Can have guideline category pages in the following format:

In a card form with the following contents:

  • Image
  • Title
  • Description

Inspirations

Guideline category pages /guidelines/:category

Can have a list of the guidelines in the category.

Should have its attributes that're seen on the parent page visible as well. Such as:

  • Image
  • Title
  • Description

Inspirations

Guideline pages /guidelines/:category/:title

Should render a markdown.

Inspirations

Routes

The following routes should be reachable:

  • /guidelines
  • /guidelines/:category
  • /guidelines/:category/:title

:category

One of the following:

  • common
  • aid-crews
  • elderly-crews
  • coordination-crews
  • triage-crews
  • hospital-crews
  • research-ambassadors

Notes

For images, the following graphics could be used.

Common: undraw_reading_0re1.svg in https://www.notion.so/Assets-04b473617ece497291aa7fbff4b8d912
Others: The same images used on the landing page.

:title

URL should be in hyphen-separated case aka kebab-case.

Example route

/guidelines/elderly-crews/role-definition

Design considerations

  • Could use the limites set of typography options used in other pages. The naming of these classes could be improved.

Linking

In the top bar, we could remove the FAQ link and put a "Guidelines" link instead.

@hantuzun hantuzun added this to the Public Launch milestone Apr 17, 2020
@hantuzun
Copy link
Member Author

hantuzun commented Apr 17, 2020

.../en/guidelines/0-elderly-crews/00-role-definition.md

render in path:

/guidelines/elderly-crews/role-definition

@hantuzun
Copy link
Member Author

hantuzun commented Apr 17, 2020

Example directory: Download


Example screenshot:

Screen Shot 2020-04-17 at 17 17 09


One thing to consider is to how to determine URLs from this convention.

.../en/guidelines/00-elderly-crews/00-role-definition.md

could be rendered in the following path:

pandemicvolunteers.org/en/guidelines/elderly-crews/role-definition

role-definition could be derived from the filename "00-role-definition.md". Because the same thing needs to be done for elderly-crews in the path as well.

The one above might be a better approach than deriving these 2 kinds of URL paths from metadata files and Markdown titles.

dimanyc added a commit that referenced this issue Apr 17, 2020
Closes #42

This PR handles adding guideline resources are described in #42.

To follow the requested URL structure (comment:
#42 (comment)),
an default locale of `en` is introduced and used as a scope in routes,
to ensure that `/en/guidelines` and `/guidelines` route default to the
same resource

Because `guidelines` are ephemeral, a presenter is used to display
initial guidelines that have guideline categories that, in turn, have
many articles. Presenters also take care of fetching and rendering
metadata stored in YML files

TODO:
- add markdown parsing / rendering based on https://github.com/panvol/pandemic-volunteers/pull/44/files#diff-e55a6c615d18aeb75e0610b835b16658
- make methods such as `GuidelineCategory.extract_slug` etc., metadata
  file fetching and loading, and loading dirs via `Pathname` reusable.
  This is because GuidelineCategory and GuidelineArticle will be sharing
  90% of their methods. GuidelineArticle will also need to be able to
  load its own metadata
- move `GuidelinesPresenter` to `app/models` since `GuidelineCategory`
  is very similar and acts as a stand-in for a model
- add designs
@dimanyc dimanyc mentioned this issue Apr 17, 2020
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants