hubl/src/index.pug
2021-04-13 13:31:12 +02:00

240 lines
11 KiB
Plaintext

doctype html
html(lang="en")
head
meta(charset="UTF-8")
title #{client.name || "My Personal Hubl"}
meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(http-equiv="X-UA-Compatible", content="ie=edge")
if client.favicon
link(rel="icon" type="image/png" href=`${client.favicon}`)
else
link(rel="icon" type="image/webp" href="./images/favicon.webp")
link(rel="preconnect" href="https://fonts.gstatic.com")
link(rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap")
link(rel='stylesheet', href='/styles/index.scss')
if client.css
link(rel='stylesheet', href=`${client.css}`)
link(rel="manifest" href="/manifest.webmanifest")
script(src="https://browser.sentry-cdn.com/5.25.0/bundle.tracing.min.js" defer)
include hubl-router.pug
script(type="module" src="/components/getRoute.js" defer)
script(type="module" src="/components/sentry.js" defer)
script(type="module" src="/components/hubl-auto-login.js" defer)
script(type="module" src="/components/hubl-search-users.js" defer)
script(type="module" src="/components/hubl-reactivity.js" defer)
script(type="module" src="/components/sw-toolbox.js" defer)
script(src="index.js" defer)
include dependencies.pug
include context.pug
//- swal2 does not work with skypack
script(src="https://cdn.jsdelivr.net/npm/sweetalert2@10" defer)
body.bg-color-grey
if componentSet.has("autoLogin") || componentSet.has("registering")
for component of components
if component.type == "autoLogin"
if component.parameters
if component.parameters.authority
sib-auth(style='display:none!important' auto-login)
sib-auth-provider(
data-authority=`${component.parameters.authority}`
data-id=`${component.parameters.authorityName || "authority"}`
data-client-name=`${client.name || "My Personal Hubl"}`
)
if component.type == "registering"
if component.parameters
if component.parameters.authority
sib-auth(style='display:none!important')
sib-auth-provider(
data-authority=`${component.parameters.authority}`
data-id=`${component.parameters.authorityName || "authority"}`
data-client-name=`${client.name || "My Personal Hubl"}`
)
if componentSet.has("registering")
include views/page-registering.pug
.notLoggedIn(style='visibility:hidden;')
nav#main__menu.scrollbar-nav.segment.bg-color-heading.text-top.quarter.text-disable-selection.jsLeftMenu
include views/partials/menu-left.pug
main#content.segment.three-quarter.sm-full.text-top
header#header.segment.full.padding-left-xlarge.padding-right-medium.sm-padding-right-xsmall.sm-padding-left-small.shadow-small.text-disable-selection.bg-color-white
include views/partials/header.pug
include views/partials/widgets.pug
for component of components
if component.route
//- Components declaration with route (no `route` attribute or `route`="something")
div(
id=component.route
data-view=component.route
hidden
)&attributes({"no-render": component.noRender})
if component.type == "about"
include views/page-about.pug
if component.type == "chat"
.whitespace-normal
hubl-reactivity(bind-user nested-field='inbox' target-src="store://user.contacts")
include views/page-messages.pug
if component.type == "circles"
.with-sidebar.whitespace-normal
hubl-reactivity(bind-user nested-field='inbox' target-src="store://user.circles")
hubl-reactivity(bind-user nested-field="circles" target-src="store://user")
hubl-reactivity(data-src=`${component.endpoints.get}joinable/` target-src=`${component.endpoints.get}`)
hubl-reactivity(data-src=`${component.endpoints.post}` target-src=`${component.endpoints.get}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${component.endpoints.post}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${component.endpoints.post}joinable/`)
hubl-reactivity(data-src=`${component.endpoints.get}joinable/` target-src=`${component.endpoints.get}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${component.endpoints.get}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${component.endpoints.get}joinable/`)
include views/page-circle.pug
if component.type == "communities"
.scrollbar-content.whitespace-normal
include views/page-communities.pug
if component.type == "dashboard"
.scrollbar-content
include views/page-dashboard.pug
if component.type == "events"
.scrollbar-content.bg-color-white
include views/page-events.pug
if component.type == "jobBoard"
.scrollbar-content
hubl-reactivity(data-src=`${component.endpoints.post}current/` target-src=`${component.endpoints.get}`)
hubl-reactivity(data-src=`${component.endpoints.post}expired/` target-src=`${component.endpoints.get}`)
hubl-reactivity(data-src=`${component.endpoints.post}` target-src=`${component.endpoints.get}`)
hubl-reactivity(data-src=`${component.endpoints.get}current/` target-src=`${component.endpoints.get}`)
hubl-reactivity(data-src=`${component.endpoints.get}current/` target-src=`${component.endpoints.get}expired/`)
hubl-reactivity(data-src=`${component.endpoints.get}expired/` target-src=`${component.endpoints.get}`)
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${component.endpoints.get}expired/`)
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${component.endpoints.get}`)
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${component.endpoints.get}current/`)
include views/page-job-board.pug
if component.type == "polls"
.scrollbar-content
include views/page-polls.pug
if component.type == "projects"
.with-sidebar.whitespace-normal
hubl-reactivity(bind-user nested-field='inbox' target-src="store://user.projects")
hubl-reactivity(bind-user nested-field="projects" target-src="store://user")
hubl-reactivity(data-src=`${component.endpoints.post}joinable/` target-src=`${component.endpoints.get}`)
hubl-reactivity(data-src=`${component.endpoints.post}` target-src=`${component.endpoints.get}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${component.endpoints.post}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${component.endpoints.post}joinable/`)
hubl-reactivity(data-src=`${component.endpoints.get}joinable/` target-src=`${component.endpoints.get}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${component.endpoints.get}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${component.endpoints.get}joinable/`)
include views/page-project.pug
if component.type == "resources"
.scrollbar-content.bg-color-white
include views/page-resources.pug
if component.type == "profileDirectory"
.scrollbar-content
hubl-reactivity(bind-user nested-field="profile" target-src="store://user")
hubl-reactivity(bind-user nested-field="account" target-src="store://user")
include views/page-directory.pug
else
//- Components declaration without any route (`route`="false") but that need some code declaration
if component.type == "admin"
include views/page-admin.pug
if component.type == "analytics"
if component.parameters
if component.parameters.type && component.parameters.url && component.parameters.url
solid-analytics(
type=`${component.parameters.type}`
url=`${component.parameters.url}`
id=`${component.parameters.id}`
)
if component.type == "notification"
include views/partials/notifications.pug
if component.type == "lang"
hubl-lang(
hidden
lang=component.parameters.name
file=component.parameters.file
)
if componentSet.has('profileDirectory')
.scrollbar-content(
id=`${getRoute("profileDirectory", true)}-profile`
hidden
data-view=`${getRoute("profileDirectory", true)}-profile`
no-render
)
include views/page-profile.pug
if componentSet.has('circles')
div.scrollbar-content.bg-color-white(
id=`${getComponent('circles').route}-left`
hidden
data-view=`${getComponent('circles').route}-left`
no-render
)
include views/partials/circle/page-circle-left.pug
if componentSet.has('projects')
div.scrollbar-content.bg-color-white(
id=`${getComponent('projects').route}-left`
hidden
data-view=`${getComponent('projects').route}-left`
no-render
)
include views/partials/project/page-project-left.pug
.loggedIn-loader.bg-color-grey.global-loader
div
div.loader
div
div
div
div
div#something-goes-wrong(hidden)
br
span(data-trans="errors.somethingGoesWrong")
span  
a(data-trans='errors.reload' href='/')
if client.i18n
hubl-fallback-lang(
hidden
lang=client.i18n.lang?client.i18n.lang:"fr"
)&attributes({"force": client.i18n.force})
div(
id="swal-content-text"
hidden
data-trans="success")