99 lines
3.0 KiB
Plaintext
99 lines
3.0 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>{{ appName }}</title>
|
|
<link rel="stylesheet" href="/assets/css/material-icons.css">
|
|
<link rel="stylesheet" href="/assets/css/shared.css">
|
|
<link rel="stylesheet" href="/assets/css/header.css">
|
|
|
|
<link rel="stylesheet" href="/assets/css/breadcrumbs.css">
|
|
<link rel="stylesheet" href="/assets/css/append-button.css">
|
|
<link rel="stylesheet" href="/assets/css/clickable-list.css">
|
|
<link rel="stylesheet" href="/assets/css/pagination.css">
|
|
|
|
<link rel="stylesheet" href="/assets/css/pages/categories.css">
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<div class="page-box header-main">
|
|
<div class="header-logo">
|
|
<img src="/assets/img/logo.svg">
|
|
</div>
|
|
{% if user is not null %}
|
|
<div class="username">
|
|
<span>{{ user.name }}</span>
|
|
<span class="material-icons-outlined">account_box</span>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="page-box header-menu">
|
|
<div>
|
|
<span class="margin-right-8 text-primary">Topics</span>
|
|
{% if userAccess.canManageUsers() %}
|
|
<a class="margin-right-8 text-gray" href="/users">Users</a>
|
|
{% endif %}
|
|
{% if user is null %}
|
|
<a class="text-gray" href="/login">Login</a>
|
|
{% else %}
|
|
<a class="text-gray" href="/logout">Logout</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<main>
|
|
<div class="page-box">
|
|
<h1 class="title">All Categories</h1>
|
|
|
|
{% if categoryAccess.canAdd() %}
|
|
<a class="append-button" href="/add-category">
|
|
<div>Add category</div>
|
|
<span class="icon material-icons">add</span>
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% for category in categories %}
|
|
{% if user is null and category['topics_count'] is 0 %}
|
|
{% continue %}
|
|
{% endif %}
|
|
|
|
<div class="secondary-title">
|
|
<h2>
|
|
<a href="/{{ category['slug'] }}">{{ category['name'] }}</a>
|
|
</h2>
|
|
<a class="secondary-title-action" href="/{{ category['slug'] }}">
|
|
{% if category['topics_count'] > topicsPerCategory %}
|
|
See all {{ category['topics_count']}} topics
|
|
{% endif %}
|
|
</a>
|
|
</div>
|
|
|
|
{% if category['topics_count'] is 0 %}
|
|
<div style="font-size: 14px;color: #93989f;">No topics yet</div>
|
|
{% endif %}
|
|
|
|
<div class="clickable-list">
|
|
{% for topic in category['last_topics'] %}
|
|
<a class="clickable-list-item" href="/{{ category['slug'] }}/{{ topic['slug'] }}">
|
|
<div>
|
|
<div>{{ topic['name'] }}</div>
|
|
<div class="clickable-list-item-sub">
|
|
<span class="icon material-icons-outlined">mode_comment</span>
|
|
<span>{{ topic['comments_count'] == 0 ? 'no comments yet' : topic['comments_count'] }}</span>
|
|
</div>
|
|
</div>
|
|
<span class="icon material-icons">keyboard_arrow_right</span>
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% endfor %}
|
|
</div>
|
|
</main>
|
|
|
|
<br/>
|
|
</body>
|
|
</html>
|