forked from mkdegucena/themes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategory_page.hbs
82 lines (78 loc) · 2.72 KB
/
category_page.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<main class="main-sidebar" role="main">
<div id="sidebar" class="sidebar-panel">
<ul class="sidebar">
<li class="sidebar-item sidebar-home">
<a href="{{page_path 'help_center'}}" class="sidebar-item-title">
Home
</a>
</li>
<li class="sidebar-section" v-for='category in categories' :data-id='category.id'>
<h4 class="sidebar-category-title" v-cloak>{[{category.name}]}</h4>
<ul>
<li :class="['sidebar-item', isOpen(section.id)]" v-for='section in category.sections' :data-id='section.id'>
<span class="sidebar-item-title" @click='setActiveSection(section.id)'>
{[{section.name}]}
</span>
<ul v-if='section.id === activeSection'>
<li :class="['sidebar-item', isCurrent(article.id)]" v-for='article in section.articles'>
<a :href='article.html_url' class="sidebar-item-link">
{[{article.title}]}
</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="container content">
<div class="category-container">
<div class="category-content">
<header class="page-header">
<h1>{{category.name}}</h1>
{{#if category.description}}
<p class="page-header-description">{{category.description}}</p>
{{/if}}
</header>
<div class="section-tree">
{{#each sections}}
<section class="section">
<h3 class="section-tree-title">
<a href="{{url}}">{{name}}</a>
{{#if internal}}
<span class="icon-lock" title="{{t 'internal'}}"></span>
{{/if}}
</h3>
{{#if articles}}
<ul class="article-list">
{{#each articles}}
<li class="article-list-item{{#if promoted}} article-promoted{{/if}}">
{{#if promoted}}
<span data-title="{{t 'promoted'}}" class="icon-star"></span>
{{/if}}
<a href="{{url}}" class="article-list-link">{{title}}</a>
</li>
{{/each}}
</ul>
{{#if more_articles}}
<a href="{{url}}" class="see-all-articles">
{{t 'show_all_articles' count=article_count}}
</a>
{{/if}}
{{else}}
<i class="section-empty">
<a href="{{url}}">{{t 'empty'}}</a>
</i>
{{/if}}
</section>
{{else}}
<i class="category-empty">
<a href="{{category.url}}">{{t 'empty'}}</a>
</i>
{{/each}}
</div>
</div>
</div>
</div>
<script>sidebar.$mount("main");</script>
</main>