186 lines
5.2 KiB
Cheetah
186 lines
5.2 KiB
Cheetah
{{define "courses"}}
|
||
<!DOCTYPE html>
|
||
<html>
|
||
{{ template "html_head" . }}
|
||
|
||
<body>
|
||
{{ template "header" . }}
|
||
|
||
<nav class="level">
|
||
<div class="level-item has-text-centered">
|
||
<div>
|
||
<p class="heading">Courses</p>
|
||
<p class="title">10k</p>
|
||
</div>
|
||
</div>
|
||
<div class="level-item has-text-centered">
|
||
<div>
|
||
<p class="heading">Clients</p>
|
||
<p class="title">1m</p>
|
||
</div>
|
||
</div>
|
||
<div class="level-item has-text-centered">
|
||
<div>
|
||
<p class="heading">Categories</p>
|
||
<p class="title">1,024</p>
|
||
</div>
|
||
</div>
|
||
<div class="level-item has-text-centered">
|
||
<div>
|
||
<p class="heading">Likes</p>
|
||
<p class="title">Over 9m</p>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<div class="section">
|
||
<div class="container block">
|
||
<nav class="breadcrumb" aria-label="breadcrumbs" itemprop="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">
|
||
|
||
<ul>
|
||
<li>
|
||
{{ if .LearningTypeName }}
|
||
<a href="/courses" itemprop="url">
|
||
<span itemprop="title">
|
||
Курсы
|
||
</span>
|
||
</a>
|
||
{{ else }}
|
||
<a>
|
||
<span itemprop="title" itemprop="url">
|
||
Курсы
|
||
</span>
|
||
</a>
|
||
{{ end }}
|
||
</li>
|
||
|
||
{{ if .LearningTypeName }}
|
||
<li>
|
||
{{ if .CourseThematicName }}
|
||
<a href="/courses/{{.ActiveLearningType}}" itemprop="url">
|
||
<span itemprop="title">
|
||
{{ .LearningTypeName }}
|
||
</span>
|
||
</a>
|
||
{{ else }}
|
||
<a>
|
||
<span itemprop="title" itemprop="url">
|
||
{{ .LearningTypeName }}
|
||
</span>
|
||
</a>
|
||
{{ end }}
|
||
</li>
|
||
{{ end }}
|
||
|
||
{{ if .CourseThematicName }}
|
||
<li>
|
||
<a>
|
||
<span itemprop="title" itemprop="url">
|
||
{{ .CourseThematicName }}
|
||
</span>
|
||
</a>
|
||
</li>
|
||
{{ end }}
|
||
</ul>
|
||
|
||
</nav>
|
||
|
||
<form id="filter-form" class="columns">
|
||
<div class="select">
|
||
<select id="learning-type-filter" name="learning_type">
|
||
<option value="">Все направления</option>
|
||
{{ range $t := .AvailableLearningTypes }}
|
||
<option value="{{$t.ID}}" {{ if eq $t.ID $.ActiveLearningType }}selected{{ end }}>{{ $t.Name }}</option>
|
||
{{ end }}
|
||
</select>
|
||
</div>
|
||
|
||
{{ if .LearningTypeName }}
|
||
<div class="select">
|
||
<select id="course-thematic-filter" name="course_thematic">
|
||
<option value="">Все темы</option>
|
||
{{ range $t := .AvailableCourseThematics }}
|
||
<option value="{{$t.ID}}" {{ if eq $t.ID $.ActiveCourseThematic }}selected{{ end }}>{{ $t.Name }}</option>
|
||
{{ end }}
|
||
</select>
|
||
</div>
|
||
{{ end }}
|
||
|
||
<button id="go-to-filter" class="button">Перейти</button>
|
||
</form>
|
||
</div>
|
||
|
||
<div id="category-course-list" class="container">
|
||
{{ range $category := .Categories }}
|
||
<div class="box">
|
||
|
||
<div class="title is-3">
|
||
<a href="/courses/{{ $category.ID }}">
|
||
{{ $category.Name }}
|
||
</a>
|
||
</div>
|
||
|
||
<div class="subtitle is-6">
|
||
Some description about the learning category {{ $category.Description }}
|
||
</div>
|
||
|
||
{{ range $subcategory := $category.Subcategories }}
|
||
<div class="box">
|
||
<div class="title is-4">
|
||
<a href="/courses/{{ $category.ID }}/{{ $subcategory.ID }}">
|
||
{{ $subcategory.Name }}
|
||
</a>
|
||
</div>
|
||
<div class="subtitle is-6">Some description about course thematics {{ $subcategory.Description }}</div>
|
||
|
||
<div class="columns is-multiline">
|
||
{{ range $course := $subcategory.Courses }}
|
||
{{ template "course_info" $course }}
|
||
{{ end }}
|
||
</div>
|
||
</div>
|
||
{{ end }}
|
||
|
||
</div>
|
||
{{ end }}
|
||
</div>
|
||
<div id="course-info"></div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
|
||
<a class="pagination-previous">Previous</a>
|
||
<a class="pagination-next" href="/courses/?next={{ .NextPageToken }}&per_page=50">Next page</a>
|
||
</nav>
|
||
|
||
{{ template "footer" . }}
|
||
|
||
<script>
|
||
const formFilterOnSubmit = event => {
|
||
event.preventDefault();
|
||
const lt = document.getElementById('learning-type-filter')
|
||
const ct = document.getElementById('course-thematic-filter');
|
||
let out = '/courses';
|
||
if (lt != null && lt.value != '') {
|
||
out += '/' + lt.value;
|
||
}
|
||
if (ct != null && ct.value != '') {
|
||
out += '/' + ct.value;
|
||
}
|
||
document.location.assign(out);
|
||
return false;
|
||
};
|
||
|
||
document.addEventListener('DOMContentLoaded', () => {
|
||
const ff = document.getElementById('filter-form');
|
||
ff.addEventListener('submit', formFilterOnSubmit);
|
||
})
|
||
</script>
|
||
|
||
</body>
|
||
|
||
</html>
|
||
{{end}}
|