Home page#
The address / shows two pages. A signed-in user gets a dashboard (fairdm/dashboard.html). Everyone else gets the landing page (fairdm/landing.html), which this page describes: its sections, the template blocks that hold them and the view that feeds them. What a visitor sees on the screen is described in the home screen. The settings that change the page are described in Settings: HOME_PAGE_CONFIG, PORTAL_DESCRIPTION and ACCOUNT_ALLOW_REGISTRATION.
The landing page is built from daisy-cotton-ext page blocks, whose stylesheet FairDM links for you. The view is fairdm.views.generic.FairDMHomeView, routed at / in fairdm.conf.urls.
Sections#
The page has no navigation bar, so the hero starts at the top of the window. The sections come in this order. Each is a template block, a component and a context entry the view provides. A section with nothing to show draws nothing.
Section |
Block |
Component |
Context entry |
Left out when |
|---|---|---|---|---|
Hero |
|
|
never |
|
Figures |
|
|
every count is zero |
|
About |
|
|
never |
|
Latest datasets |
|
|
there is no public dataset |
|
Samples and measurements |
|
|
no type is registered |
|
Community |
|
|
there are no people and no organizations |
|
New projects |
|
|
there is no public project |
|
API |
|
none: the template builds the address of the dataset endpoint |
never |
|
Invitation |
|
|
never |
|
Footer |
|
|
never |
Two more blocks complete the template:
Block |
Holds |
|---|---|
|
Empty. Fill it to put a navigation bar above the hero, for example |
|
The page title, the portal’s name. |
hero has the keys eyebrow, title, lead, image and logo. about has name, description, keywords, authority and authority_url.
landing.footer fills the shell’s app.footer block, and landing.header fills its app.header block.
What a section may show#
Every method that feeds a section returns only what a visitor who has not signed in may open. A private dataset, a public dataset inside a private project, and the samples and measurements of a dataset that is not published are never counted or named.
FairDMHomeView#
Attributes#
Attribute |
Default |
What it limits |
|---|---|---|
|
|
Datasets in the latest datasets section, and projects in the new projects section. |
|
|
Sample types, and measurement types, listed before the rest are counted. |
|
|
People in the community section. |
|
|
Organizations named in the community section. |
|
a dictionary |
The hero’s content where |
|
|
The template a visitor gets. |
|
|
The template a signed-in user gets. |
Methods#
Method |
Returns |
Feeds |
|---|---|---|
|
The context with every entry below added. |
The landing template. |
|
The name saved in the portal identity, else |
|
|
A dictionary of |
|
|
A dictionary of |
|
|
A list of dictionaries with |
|
|
At most |
|
|
At most |
|
|
A dictionary of |
|
|
At most |
|
|
At most |
|
The view also adds people_count (the number of people the portal lists) and allow_registration (the ACCOUNT_ALLOW_REGISTRATION setting).