fix(mixins): Add locale/api and active link

This commit is contained in:
Khaled Garbaya
2017-09-28 13:51:53 +02:00
committed by Benedikt Rötsch
parent 07c5cc77b0
commit 713f554609
9 changed files with 32 additions and 25 deletions

View File

@@ -13,7 +13,7 @@ block content
each l in course.fields.lessons
if l.fields
li
a(href=`/courses/${course.fields.slug}/lessons/${l.fields.slug}`) #{l.fields.title}
a(href=`/courses/${course.fields.slug}/lessons/${l.fields.slug}${queryString}`) #{l.fields.title}
section.wrapper-with-sidebar__content
h1= course.fields.title
@@ -21,7 +21,7 @@ block content
+lesson(lesson)
if lessonIndex + 1< lessons.length
if lessons[lessonIndex + 1].fields
a.cta(href=`/courses/${course.fields.slug}/lessons/${lessons[lessonIndex + 1].fields.slug}`) View next lesson
a.cta(href=`/courses/${course.fields.slug}/lessons/${lessons[lessonIndex + 1].fields.slug}${queryString}`) View next lesson
else
p !{helpers.markdown(course.fields.description)}
a.cta(href=`/courses/${course.fields.slug}/lessons/${course.fields.lessons[0].fields.slug}`) Start course
a.cta(href=`/courses/${course.fields.slug}/lessons/${course.fields.lessons[0].fields.slug}${queryString}`) Start course

View File

@@ -12,7 +12,7 @@ block content
a.active(href=`/courses`) All courses
each category in categories
li
a(href=`/courses/categories/${category.sys.id}`) #{category.fields.title}
a(href=`/courses/categories/${category.sys.id}${queryString}`) #{category.fields.title}
section.wrapper-with-sidebar__content
h1= title
.courses.grid-list-small

View File

@@ -17,23 +17,23 @@ html
fieldset
label(for='api') API type:
select(name='api' onChange='this.form.submit()')
option(value='CDA') Delivery API
option(value='CPA') Preview API
option(value='cda' selected=query.api === 'cda') Delivery API
option(value='cpa' selected=query.api === 'cpa') Preview API
fieldset
label(for='locale') Language:
select(name='locale' onChange='this.form.submit()')
option(value='en-US') English
option(value='de-DE') German
option(value='en-US' selected=query.locale === 'en-US') English
option(value='de-DE' selected=query.locale === 'de-DE') German
nav.header__navigation
ul
li
a.active(href='/') Home
a(href=`/${queryString}` class=(currentPath === '/'? 'active' : '')) Home
li
a(href='/courses') Courses
a(href=`/courses${queryString}` class=(currentPath.startsWith('/courses') ? 'active' : '') ) Courses
li
a(href='/about') About
a(href=`/about${queryString}` class=(currentPath.startsWith('/about') ? 'active' : '')) About
li
a(href='/settings') Settings
a(href=`/settings${queryString}` class=(currentPath.startsWith('/settings') ? 'active' : '')) Settings
#main__content
block content
@@ -45,13 +45,13 @@ html
nav.footer__navigation
ul
li
a.active(href='/') Home
a(href=`/${queryString}` class=(currentPath === '/'? 'active' : '')) Home
li
a(href='/courses') Courses
a(href=`/courses${queryString}` class=(currentPath.startsWith('/courses') ? 'active' : '') ) Courses
li
a(href='/about') About
a(href=`/about${queryString}` class=(currentPath.startsWith('/about') ? 'active' : '')) About
li
a(href='/settings') Settings
a(href=`/settings${queryString}` class=(currentPath.startsWith('/settings') ? 'active' : '')) Settings
.footer__apps
a(href='#')
img(src='/images/app-store-badge.png')

View File

@@ -3,10 +3,10 @@ mixin courseCard(course = {fields: {title: '', description: '', categories: [],
.course-card__categories
if(course.fields.categories)
each category in course.fields.categories
a.course-card__category(href=`/courses/categories/${category.sys.id}`) #{category.fields.title}
a.course-card__category(href=`/courses/categories/${category.sys.id}${queryString}`) #{category.fields.title}
h2.course-card__title= course.fields.title
.course-card__description-wrapper
p !{helpers.markdown(course.fields.shortDescription)}
.course-card__link-wrapper
a.course-card__link(href=`/courses/${course.fields.slug}`) view course
a.course-card__link(href=`/courses/${course.fields.slug}${queryString}`) view course