Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
move poles to /about, resize menu #174 #191 (#194)
Browse files Browse the repository at this point in the history
Co-authored-by: CLIC EPFL <[email protected]>
  • Loading branch information
s314cy and CLIC EPFL authored Sep 22, 2021
1 parent efe03f5 commit d0b7ed8
Show file tree
Hide file tree
Showing 40 changed files with 36 additions and 106 deletions.
9 changes: 0 additions & 9 deletions src/components/base-view.njk
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,9 @@

<div class="menu">
<ul>
<li {% if tab == "home" %} class="current" {% endif %}>
<a href="/">Accueil</a>
</li>
<li {% if tab == "about" %} class="current" {% endif %}>
<a href="/about">L'association</a>
</li>
<li {% if tab == "poles" %} class="current" {% endif %}>
<a href="/poles">Pôles</a>
</li>
<li {% if tab == "commissions" %} class="current" {% endif %}>
<a href="/commissions">Commissions</a>
</li>
Expand All @@ -109,9 +103,6 @@
<li>
<a href="/about">L'Association</a>
</li>
<li>
<a href="/poles">Pôles</a>
</li>
<li>
<a href="/commissions">Commissions</a>
</li>
Expand Down
22 changes: 22 additions & 0 deletions src/pages/about/about-page-view.njk
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,28 @@
</div>
</div>

<div class="wrapper bg-white">
<div class="center">
<div class="content padded-40">
<h1>Nos Pôles</h1>
<div class="poles padded-40">
{% for row in polesList | batch(4) %}
<div class="poles-row">
{% for item in row %}
<div class="poles-item">
<a href="/about/{{item.slug}}">
<img src="/about/{{item.imageURL}}" alt="{{item.name}}">
<p class="title">{{item.name}}</p>
</a>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
</div>
</div>

{{ base.footer() }}

<script type="text/javascript" src="/vendor/jquery.min.js"></script>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/about/about-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { Page } from '../page'
import { Request, Response } from 'express'
import { Sponsor, sponsorsComponent } from '../../components/sponsors/sponsors'
import { Pole, poleComponent } from './poles/pole'

/**
* View model that binds the data to the template for the about page
Expand All @@ -15,6 +16,7 @@ import { Sponsor, sponsorsComponent } from '../../components/sponsors/sponsors'
*/
class AboutPageViewModel {
sponsorsList: Sponsor[] = sponsorsComponent.listValid()
polesList: Pole[] = poleComponent.list()
}

/**
Expand All @@ -36,4 +38,4 @@ class AboutPage extends Page {
* Export a single instance of the about page
*/
const aboutPage = new AboutPage()
export { aboutPage }
export { aboutPage }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</head>

<body>
{{ base.header(tab = "poles") }}
{{ base.header(tab = "about") }}

<div class="wrapper bg-white">
<div class="center">
Expand All @@ -27,7 +27,7 @@
&gt; {{ pole.name }}
</p>

<img src="/poles/{{ pole.imageURL }}" alt="logo" class="center-image">
<img src="/about/{{ pole.imageURL }}" alt="logo" class="center-image">
<div class="pole-page">
{{ pole.pageBody | safe }}
</div>
Expand Down Expand Up @@ -79,7 +79,7 @@
<a href="{{member.websiteURL}}" target="_blank">

<div class="member">
<img src="/poles/portraits/{{member.imageURL}}" alt="{{member.name}}"/>
<img src="/about/portraits/{{member.imageURL}}" alt="{{member.name}}"/>
<div class="desc">
<p class="name">{{member.name}}</p>
<p class="role">{{member.role}}</p>
Expand All @@ -94,7 +94,7 @@
{% for teammate in pole.teammates %}
<a href="{{member.websiteURL}}" target="_blank">
<div class="member">
<img src="/poles/portraits/{{teammate.imageURL}}" alt="{{teammate.name}}">
<img src="/about/portraits/{{teammate.imageURL}}" alt="{{teammate.name}}">
<div class="desc">
<p class="name">{{teammate.name}}</p>
<p class="role">Équipier</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page } from '../page'
import { Page } from '../../page'
import { Request, Response } from 'express'
import { Pole } from './pole'

Expand All @@ -20,7 +20,7 @@ class PolePage extends Page {

/** @inheritDoc */
render = (req: Request, res: Response) => {
const template = "pages/poles/pole-page-view.njk"
const template = "pages/about/poles/pole-page-view.njk"

res.render(template, this.viewModel)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PolePage } from './pole-page'

const poleRouter = express.Router()

poleRouter.use("/", express.static("src/pages/poles/assets/"))
poleRouter.use("/", express.static("src/pages/about/poles/assets/"))

poleComponent.list().forEach(pole => {
poleRouter.get("/" + pole.slug, new PolePage(pole).render)
Expand Down
4 changes: 2 additions & 2 deletions src/pages/poles/pole.ts → src/pages/about/poles/pole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import fs from 'fs'
import path from 'path'
import showdown from 'showdown'
import data from './pole-list.json'
import { logger } from '../../logger'
import { logger } from '../../../logger'
import { fstat } from 'fs'

/**
* Commission content path
* Must correct to src/ folder since this will be compiled in dist
*/
const CONTENT_PATH = path.resolve(__dirname, "../../../src/pages/poles/assets/")
const CONTENT_PATH = path.resolve(__dirname, "../../../../src/pages/about/poles/assets/")

class PoleMember {
name: string
Expand Down
51 changes: 0 additions & 51 deletions src/pages/poles/poles-page-view.njk

This file was deleted.

23 changes: 0 additions & 23 deletions src/pages/poles/poles-page.ts

This file was deleted.

15 changes: 2 additions & 13 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import { coachingListRouter } from './pages/coaching/coaching-router'
import { notFoundPage } from './pages/404/404-page'
import { commissionRouter } from './pages/commissions/commission-router'
import { commissionsPage } from './pages/commissions/commissions-page'
import { poleRouter } from './pages/poles/pole-router'
import { polesPage } from './pages/poles/poles-page'
import { poleRouter } from './pages/about/poles/pole-router'
import { eventRouter } from './pages/events/event-router'
import { eventsPage } from './pages/events/events-page'

Expand Down Expand Up @@ -61,16 +60,6 @@ router.get('/coaching', coachingPage.render)
*/
router.get('/commissions', commissionsPage.render)

/**
* Poles page
*/
router.get('/poles', polesPage.render)

/**
* Events page
*/
//router.get('/events', eventsPage.render)

/**
* Sponsors router
* Routes defined in {@link components/sponsors/sponsors-router.ts} will be
Expand Down Expand Up @@ -119,7 +108,7 @@ router.use("/coaching", coachingListRouter)

router.use("/commissions", commissionRouter)

router.use("/poles", poleRouter)
router.use("/about", poleRouter)

router.use("/events", eventRouter)

Expand Down

0 comments on commit d0b7ed8

Please sign in to comment.