- На лого слева вверху добавлена ссылка на главную
- Добавлен механизм отображения вопросов по тегу
- Теперь теги берутся из списка в контроллере
- Теперь при нажатии на тег открывается страница вопросов по тегу
- Добавлена страница hot questions
- При нажатии на название вопроса теперь открывается страница вопроса
- Улучшена пагинация
This commit is contained in:
redtea committed 2026-04-09 22:35:56 +03:00
1 parent 0373603500
commit 33379408ba
9 files changed
+75 -163

No files matched your search

-140
View File
@@ -1,140 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>VkDesk | Fresh Questions</title>
<meta name="description" content="VkDesk Q&A">
<link rel="stylesheet" href="../../static/core/css/style.css">
</head>
<body>
<header class="site-header">
<div class="logo">VkDesk</div>
<form class="search">
<input type="text" placeholder="Search">
<a class="button button--ask" href="index">ASK IT</a>
</form>
<div class="user-block">
<div class="avatar-box small">avatar</div>
<div class="user-links">
<div class="user-name">Dr. Pepper</div>
<div>
<a href="profile">settings</a>
<a href="login">log out</a>
</div>
</div>
</div>
</header>
<div class="content">
<main>
<div class="main-title">
<h1>Fresh Questions</h1>
<a href="#">Top Today</a>
</div>
<article class="card">
<div>
<div class="avatar-box">avatar</div>
<div class="vote-box">
<span>5</span>
<span class="vote-arrows">^<span>'</span></span>
</div>
</div>
<div>
<a class="question-title" href="question.html">How to build a moon park ?</a>
<p>Guys, i have trouble with a moon park. Cant find the black-jack...</p>
<div class="meta">
<a href="question.html">answer (3)</a>
<span>Tags:</span>
<a class="tag" href="#">black-jack</a>
<a class="tag" href="#">bender</a>
</div>
</div>
</article>
<article class="card">
<div>
<div class="avatar-box">avatar</div>
<div class="vote-box">
<span>5</span>
<span class="vote-arrows">^<span>'</span></span>
</div>
</div>
<div>
<a class="question-title" href="question">How to build a moon park ?</a>
<p>Guys, i have trouble with a moon park. Can't find the black-jack...</p>
<div class="meta">
<a href="question">answer (3)</a>
<span>Tags:</span>
<a class="tag" href="#">black-jack</a>
<a class="tag" href="#">bender</a>
</div>
</div>
</article>
<article class="card">
<div>
<div class="avatar-box">avatar</div>
<div class="vote-box">
<span>5</span>
<span class="vote-arrows">^<span>'</span></span>
</div>
</div>
<div>
<a class="question-title" href="question.html">How to build a moon park ?</a>
<p>Guys, i have trouble with a moon park. Can't find the black-jack...</p>
<div class="meta">
<a href="question.html">answer (3)</a>
<span>Tags:</span>
<a class="tag" href="#">black-jack</a>
<a class="tag" href="#">bender</a>
</div>
</div>
</article>
<nav class="pagination">
<a class="page-link" href="#">1</a>
<a class="page-link" href="#">2</a>
<a class="page-link" href="#">3</a>
<span class="page-link">...</span>
<a class="page-link" href="#">53</a>
</nav>
</main>
<aside class="sidebar">
<div class="sidebar-section">
<h2>Trending Tags</h2>
<div class="tag-cloud">
<span>perl</span>
<span class="tag-red">c++</span>
<span>TechnoPark</span>
<span class="tag-red">RUST</span>
<span class="tag-green">django</span>
<span>Mail.Ru</span>
<span>Java</span>
<span class="tag-orange">TS</span>
</div>
</div>
<div class="sidebar-section">
<h2>Top Members</h2>
<div class="member-list">
<a href="#">Mr. Freeman</a>
<a href="#">Dr. House</a>
<a href="#">Bender</a>
<a href="#">Queen Victoria</a>
<a href="#">V. Pupkin</a>
</div>
</div>
</aside>
</div>
<footer class="footer">2026</footer>
</body>
</html>
+16
View File
@@ -0,0 +1,16 @@
{% extends 'core/layout/base.html' %}
{% load static %}
{% block content %}
<div class="main-title">
<h1>Hot Questions</h1>
<a href="/">All questions</a>
</div>
{% for question in hot_questions %}
{% include 'core/partials/question.html' %}
{% endfor %}
{% include 'core/partials/pagination.html' %}
{% endblock %}
+7 -2
View File
@@ -3,10 +3,15 @@
{% block content %}
<div class="main-title">
<h1>Fresh Questions</h1>
<a href="#">Top Today</a>
<h1>All Questions</h1>
<a href="/hot">Hot questions</a>
</div>
{% if tag %}
<div class="current-tag">
Текущий тег: <span>#{{ tag }}</span>
</div>
{% endif %}
{% for question in questions %}
{% include 'core/partials/question.html' %}
{% endfor %}
+4 -9
View File
@@ -9,7 +9,7 @@
</head>
<body>
<header class="site-header">
<div class="logo">VkDesk</div>
<a href="/" class="logo not-underlined">VkDesk</a>
<form class="search">
<input type="text" placeholder="Search">
<a class="button button--ask" href="ask">ASK IT</a>
@@ -34,14 +34,9 @@
<div class="sidebar-section">
<h2>Trending Tags</h2>
<div class="tag-cloud">
<span>perl</span>
<span class="tag-red">python</span>
<span>TechnoPark</span>
<span class="tag-red">MySQL</span>
<span class="tag-green">django</span>
<span>Mail.Ru</span>
<span>Voloshin</span>
<span class="tag-orange">Firefox</span>
{% for tag in tags %}
<a href="/?tag={{ tag }}" class="not-underlined">{{tag}}</a>
{% endfor %}
</div>
</div>
@@ -1,9 +1,13 @@
<nav class="pagination">
{% if page_obj.paginator.num_pages > 1 %}
{% if page_obj.has_previous %}
<a class="page-link" href="?page={{ page_obj.previous_page_number }}">Previous</a>
<a class="page-link" href="?page={{ page_obj.previous_page_number }}">Previous</a>
{% endif %}
<a class="page-link" href="#">{{ page_obj.number }}</a>
{% if page_obj.has_next %}
<a class="page-link" href="?page={{ page_obj.next_page_number }}">Next</a>
{% endif %}
{% endif %}
</nav>
@@ -8,13 +8,14 @@
</div>
</div>
<div>
<p class="question-title" href="question">{{ question.title }}</p>
<a class="question-title" href="question">{{ question.title }}</a>
<p>{{ question.text }}</p>
<div class="meta">
<a href="question">answer (3)</a>
<span>Tags:</span>
<a class="tag" href="#">black-jack</a>
<a class="tag" href="#">bender</a>
{% for tag in question.tags %}
<a class="tag" href="/?tag={{ tag }}">{{ tag }}</a>
{% endfor %}
</div>
</div>
</article>