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

seletion of footer banner to CMS #63

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/pages/banners/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ box:
cta: Invia la candidatura
link: https://www.scienzeingegneria.univr.it/?ent=iscrizionecs&cs=406
banners:
- name: teachers
title: Un team di docenti professionisti nella loro materia
text: >
Ogni docente del master lavora nel ambito della propria materia che potrà strasferirvi non solo le conoscenze necessarie ma anche le modalità e i trucchi del mestiere.
cta: scopri chi sono
link: /docenti
image: /img/docenti.jpg
alt: docenti
- name: students
title: I risultati dei nostri studenti sono la nostra più grande soddisfazione
text: >
Al termine del master i nostri ragazzi intraprendono diversi percorsi di carriera chi all'interno di grandi company chi invece in aziende più piccole dal forte valore tecnologico.
cta: studenti
link: /alumni/#students
image: /img/placeholder.png
alt: placeholder
link: /alumni
image: /img/studenti.jpg
alt: le loro storie
- name: partners
title: Mettiamo in contatto le migliori aziende di gaming con i talenti di domani
text: >
Crediamo nella collaborazione, non solo con talenti professionisti, ma anche con le migliori aziende del settore videoludico per creare un ponte tra formazione e il mondo del lavoro.
cta: i nostri partner
link: /collaborazioni/#partners
link: /collaborazioni
image: /img/classroom.jpg
alt: partners
- name: master
Expand All @@ -41,4 +49,12 @@ banners:
link: /programma
image: /img/scuola.jpg
alt: scuola
- name: projects
title: I progetti dei ragazzi
text: >
Durante il master avrai modo di sviluppare diversi progetti per entrare nel vivo della realizzarzione di un gioco.
cta: il tuo primo videogame
link: /progetti
image: /img/work-3.jpg
alt: project work
---
1 change: 1 addition & 0 deletions src/pages/master/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ redirect_from:
title: Il master 2019
image: /img/master-cover.jpg
altImage: programming
footerBanner: program
paragraphs:
- description: >
L’enorme sviluppo dei videogiochi trova sicuramente il suo elemento
Expand Down
1 change: 1 addition & 0 deletions src/pages/partners/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Il Master collabora con le più importanti aziende italiane del set
image: /img/classroom.jpg
altImage: programming
partnersTitle: I Partners
footerBanner: students
partners:
- name: MILESTONE
main: true
Expand Down
2 changes: 2 additions & 0 deletions src/pages/programma/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: >
Il master mira a soddisfare le esigenze di formazione elevata nell’ambito dello sviluppo di applicazioni videoludiche, si svolge in stretto contatto con le principali aziende videoludiche italiane e in particolare con l’Associazione Editori e Sviluppatori Videogiochi Italiani (AESVI). Le competenze acquisite durante il master sono immediatamente spendibili al termine del percorso formativo.
<br><br>
Le lezioni sono a frequenza obbligatoria e si terranno principalmente nei giorni di venerdi e sabato (per esigenze organizzative saranno eventualmente coinvolti anche altri giorni).
bannerRight: teachers
bannerLeft: partners

titleParagraphs: Il programma nel dettaglio
paragraphs:
Expand Down
1 change: 1 addition & 0 deletions src/pages/projects/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: >
La sezione alumni raccoglie consigli e testimonianze di ex studenti che oggi lavorano nella industry.
image: /img/scuola.jpg
altImage: cover
footerBanner: teachers
titleLabProjects: I progetti di laboratorio
labProjects:
- altVideo: video
Expand Down
1 change: 1 addition & 0 deletions src/pages/students/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ description: >
lavorano nella industry.
image: /img/scuola.jpg
altImage: students
footerBanner: projects
students:
- altImage: Riccardo Reffato
compLink: 'http://milestone.it/'
Expand Down
1 change: 1 addition & 0 deletions src/pages/teachers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ description: >
image: /img/docenti.jpg
altImage: docente in classe
teachersTitle: I docenti
footerBanner: partners
teachers:
- fullName: Umberto Castellani
role: Fondamenti di interazione uomo-macchina
Expand Down
4 changes: 3 additions & 1 deletion src/templates/master-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ MasterPageTemplate.propTypes = {
serviceTitle: PropTypes.string,
paragraphs: PropTypes.array,
services: PropTypes.array,
footerBanner: PropTypes.string,
scientificCommittee: PropTypes.shape({
title: PropTypes.string,
description: PropTypes.string,
Expand All @@ -172,7 +173,7 @@ MasterPageTemplate.propTypes = {
const MasterPage = ({ data }) => {
const { frontmatter } = data.markdownRemark;
const banner = data.bannersData.frontmatter.banners.filter(
(banner) => banner.name === "program"
(banner) => banner.name === frontmatter.footerBanner
);

return (
Expand Down Expand Up @@ -248,6 +249,7 @@ export const masterPageQuery = graphql`
}
}
}
footerBanner
}
}
bannersData: markdownRemark(
Expand Down
4 changes: 3 additions & 1 deletion src/templates/partners-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ PartnersPageTemplate.propTypes = {

const PartnersPage = ({ data }) => {
const { frontmatter } = data.markdownRemark
const banner = data.bannersData.frontmatter.banners.filter(banner => banner.name === 'master')
const banner = data.bannersData.frontmatter.banners.filter(banner => banner.name === frontmatter.footerBanner)
return (
<Layout>
<PartnersPageTemplate
Expand Down Expand Up @@ -98,6 +98,7 @@ export const masterPageQuery = graphql`
title
description
partnersTitle
footerBanner
altImage
image {
extension
Expand All @@ -123,6 +124,7 @@ export const masterPageQuery = graphql`
}
}
}

}
}
bannersData: markdownRemark(frontmatter: { templateKey: { eq: "banners"}}) {
Expand Down
34 changes: 17 additions & 17 deletions src/templates/program-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ export const ProgramPageTemplate = ({
description,
titleParagraphs,
paragraphs,
scientificCommittee,
people,
bannerStudents,
bannerMaster,
bannerRight,
bannerLeft,
}) => {
return (
<>
Expand All @@ -42,34 +40,34 @@ export const ProgramPageTemplate = ({
</div>
</div>
</section>
{ !!bannerStudents && !!bannerMaster &&
{ !!bannerRight && !!bannerLeft &&
<section className="section has-double-background">
<div className="container is-horizontal-spaced">
<div className="columns is-tablet is-vcentered">
<div className="column">
<div className="has-text-primary-invert" style={{padding: '5%'}}>
<h3 className="title is-2 is-spaced is-size-3-mobile is-size-2-tablet">
{bannerStudents.title}
{bannerLeft.title}
</h3>
<p className="description">
{bannerStudents.text}
{bannerLeft.text}
</p>
<Button
text={bannerStudents.cta} link={bannerStudents.link}
text={bannerLeft.cta} link={bannerLeft.link}
styles={`cta cta-large cta__invert`}
/>
</div>
</div>
<div className="column">
<div className="has-text-primary" style={{padding: '5%'}}>
<h3 className="title is-2 is-spaced has-text-primary is-size-3-mobile is-size-2-tablet">
{bannerMaster.title}
{bannerRight.title}
</h3>
<p className="description">
{bannerMaster.text}
{bannerRight.text}
</p>
<Button
text={bannerMaster.cta} link={bannerMaster.link}
text={bannerRight.cta} link={bannerRight.link}
styles={`cta cta-large cta__primary`}
/>
</div>
Expand All @@ -87,8 +85,8 @@ ProgramPageTemplate.propTypes = {
subtitle: PropTypes.string,
description: PropTypes.string,
titleParagraphs: PropTypes.string,
bannerStudents: PropTypes.object,
bannerMaster: PropTypes.object,
bannerRight: PropTypes.object,
bannerLeft: PropTypes.object,
paragraphs: PropTypes.arrayOf(
PropTypes.shape({
title: PropTypes.string,
Expand All @@ -99,8 +97,8 @@ ProgramPageTemplate.propTypes = {

const ProgramPage = ({ data }) => {
const { frontmatter } = data.markdownRemark
const bannerMaster = data.bannersData.frontmatter.banners.filter(banner => banner.name === 'master')
const bannerStudents = data.bannersData.frontmatter.banners.filter(banner => banner.name === 'partners')
const bannerRight = data.bannersData.frontmatter.banners.filter(banner => banner.name === frontmatter.bannerRight)
const bannerLeft = data.bannersData.frontmatter.banners.filter(banner => banner.name === frontmatter.bannerLeft)
return (
<Layout>
<ProgramPageTemplate
Expand All @@ -109,8 +107,8 @@ const ProgramPage = ({ data }) => {
description={frontmatter.description}
titleParagraphs={frontmatter.titleParagraphs}
paragraphs={frontmatter.paragraphs}
bannerMaster={bannerMaster[0]}
bannerStudents={bannerStudents[0]}
bannerRight={bannerRight[0]}
bannerLeft={bannerLeft[0]}
/>
</Layout>
)
Expand Down Expand Up @@ -143,6 +141,8 @@ export const masterPageQuery = graphql`
title
description
}
bannerRight
bannerLeft
}
}
bannersData: markdownRemark(frontmatter: { templateKey: { eq: "banners"}}) {
Expand Down
3 changes: 2 additions & 1 deletion src/templates/projects-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ ProjectsPageTemplate.propTypes = {

const ProjectsPage = ({ data }) => {
const { frontmatter } = data.markdownRemark
const banner = data.bannersData.frontmatter.banners.filter(banner => banner.name === 'partners')
const banner = data.bannersData.frontmatter.banners.filter(banner => banner.name === frontmatter.footerBanner)
return (
<Layout>
<ProjectsPageTemplate
Expand Down Expand Up @@ -363,6 +363,7 @@ export const projectsPageQuery = graphql`
}
}
}
footerBanner
titleLabProjects
labProjects {
title
Expand Down
3 changes: 2 additions & 1 deletion src/templates/students-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ StudentsPageTemplate.propTypes = {

const StudentsPage = ({ data }) => {
const { frontmatter } = data.markdownRemark
const banner = data.bannersData.frontmatter.banners.filter(banner => banner.name === 'partners')
const banner = data.bannersData.frontmatter.banners.filter(banner => banner.name === frontmatter.footerBanner)
return (
<Layout>
<StudentsPageTemplate
Expand Down Expand Up @@ -95,6 +95,7 @@ export const studentsPageQuery = graphql`
}
}
}
footerBanner
students {
fullName
linkedin
Expand Down
3 changes: 2 additions & 1 deletion src/templates/teachers-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TeachersPageTemplate.propTypes = {

const TeachersPage = ({ data }) => {
const { frontmatter } = data.markdownRemark
const banner = data.bannersData.frontmatter.banners.filter(banner => banner.name === 'partners')
const banner = data.bannersData.frontmatter.banners.filter(banner => banner.name === frontmatter.footerBanner)
return (
<Layout>
<TeachersPageTemplate
Expand Down Expand Up @@ -117,6 +117,7 @@ export const masterPageQuery = graphql`
}
}
}
footerBanner
teachers {
fullName
role
Expand Down
51 changes: 47 additions & 4 deletions static/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ collections:
{label: Description, name: description, widget: markdown, buttons: [bold, italic, code, link, code-block, bulleted-list]},
],
}
- {
label: "Footer banner",
name: footerBanner,
widget: "select",
options: ["teachers", "students", "partners","master","program","projects"]
}

# PROGRAM PAGE
- file: "src/pages/programma/index.md"
Expand All @@ -193,6 +199,18 @@ collections:
{label: Description, name: description, widget: markdown, buttons: [bold, italic, code, link, code-block, bulleted-list]},
],
}
- {
label: "Footer left banner",
name: bannerLeft,
widget: "select",
options: ["teachers", "students", "partners","master","program","projects"]
}
- {
label: "Footer right banner",
name: bannerRight,
widget: "select",
options: ["teachers", "students", "partners","master","program","projects"]
}

# PROJECTS PAGE
- file: "src/pages/projects/index.md"
Expand Down Expand Up @@ -264,6 +282,12 @@ collections:
{label: Alt, name: altImage, widget: string},
],
}
- {
label: "Footer banner",
name: footerBanner,
widget: "select",
options: ["teachers", "students", "partners","master","program","projects"]
}

# STUDENTS PAGE
- file: "src/pages/students/index.md"
Expand Down Expand Up @@ -293,8 +317,14 @@ collections:
{label: Games, name: games, widget: text, required: false},
],
}
- {
label: "Footer banner",
name: footerBanner,
widget: "select",
options: ["teachers", "students", "partners","master","program","projects"]
}

# PARTNERS PAGE
# PARTNERS PAGE
- file: "src/pages/partners/index.md"
label: "Partners list"
name: "partners"
Expand All @@ -319,8 +349,14 @@ collections:
{label: "Show in home", name: main, widget: boolean, required: false}
],
}
- {
label: "Footer banner",
name: footerBanner,
widget: "select",
options: ["teachers", "students", "partners","master","program","projects"]
}

# TEACHERS PAGE
# TEACHERS PAGE
- file: "src/pages/teachers/index.md"
label: "Teachers list"
name: "teachers"
Expand All @@ -345,6 +381,12 @@ collections:
{label: Biography, name: bio, widget: string, required: false}
],
}
- {
label: "Footer banner",
name: footerBanner,
widget: "select",
options: ["teachers", "students", "partners","master","program","projects"]
}

# BANNERS
- file: "src/pages/banners/index.md"
Expand All @@ -368,11 +410,12 @@ collections:
}
# ROWS
- {
label: Banners,
label: Footer banner,
name: banners,
widget: list,
allow_add: false,
fields: [
{label: Name, name: name, widget: string, required: false},
{label: Name, name: name, widget: string, required: true},
{label: Image, name: image, widget: image, default: "/img/placeholder.png", required: false},
{label: Alt image, image: alt, widget: string, required: false},
{label: Banner title, name: title, widget: string},
Expand Down
File renamed without changes