DEV: Выбор внешнего вида поста

Если участник выбрал для себя внешний вид поста, то он должен видеть такой вид на всём сайте: в профилях, темах, блогах, в закладках и т.д.
This commit is contained in:
Evg 2022-09-26 07:27:14 +03:00
parent 72d4d2d09c
commit 7e932157b7
12 changed files with 35 additions and 16 deletions

View file

@ -2,7 +2,7 @@
use Hleb\Constructor\Handlers\Request;
Request::getHead()->addStyles('/assets/css/style.css?01');
Request::getHead()->addStyles('/assets/css/style.css?21');
?>
<?= insert('/meta', ['meta' => $meta]); ?>

View file

@ -29,7 +29,13 @@ if ($blog['facet_is_deleted'] == 0) : ?>
</ul>
</div>
<?= insert('/content/post/post-card', ['data' => $data]); ?>
<?php if (Request::getCookie('postAppearance') == 'classic') : ?>
<?= insert('/content/post/post-classic', ['data' => $data]); ?>
<?php else : ?>
<?= insert('/content/post/post-card', ['data' => $data]); ?>
<?php endif; ?>
<?= Html::pagination($data['pNum'], $data['pagesCount'], $data['sheet'], url('blog', ['slug' => $blog['facet_slug']])); ?>
</main>
<aside>

View file

@ -2,7 +2,13 @@
<main>
<?php if ($topic['facet_is_deleted'] == 0) : ?>
<?= insert('/content/facets/topic-header', ['topic' => $topic, 'data' => $data]); ?>
<?= insert('/content/post/post-card', ['data' => $data]); ?>
<?php if (Request::getCookie('postAppearance') == 'classic') : ?>
<?= insert('/content/post/post-classic', ['data' => $data]); ?>
<?php else : ?>
<?= insert('/content/post/post-card', ['data' => $data]); ?>
<?php endif; ?>
<?= Html::pagination($data['pNum'], $data['pagesCount'], $data['sheet'], url('topic', ['slug' => $topic['facet_slug']])); ?>
<?php else : ?>

View file

@ -13,7 +13,6 @@
<?php else : ?>
<?= insert('/content/post/post-card', ['data' => $data]); ?>
<?php endif; ?>
<?php if (UserData::getUserScroll()) : ?>
<div id="scrollArea"></div>

View file

@ -14,7 +14,7 @@ use Hleb\Constructor\Handlers\Request; ?>
<div class="box box-fon article_<?= $post['post_id']; ?>">
<?php if ($post['post_content_img'] || $post['post_thumb_img']) : ?>
<div class="flex">
<div class="mr20">
<div class="mr20 flex-auto">
<?php endif; ?>
<div class="mb15">
@ -41,15 +41,15 @@ use Hleb\Constructor\Handlers\Request; ?>
<div class="flex flex-row items-center justify-between">
<div class="flex gap text-sm flex-row">
<a class="black" href="<?= url('profile', ['login' => $post['login']]); ?>">
<?= Img::avatar($post['avatar'], $post['login'], 'img-sm mr5', 'max'); ?>
<?= Html::votes($post, 'post'); ?>
<a class="gray-600" href="<?= url('profile', ['login' => $post['login']]); ?>">
<span<?php if (Html::loginColor($post['created_at'] ?? false)) : ?> class="green" <?php endif; ?>>
<?= $post['login']; ?>
</span>
</a>
<div class="gray-600 mb-none lowercase"><?= Html::langDate($post['post_date']); ?></div>
<?= Html::votes($post, 'post'); ?>
<?php if ($post['post_answers_count'] != 0) : ?>
<a class="flex gray-600" href="<?= $post_url; ?>#comment">

View file

@ -31,7 +31,11 @@
</div>
<?php endif; ?>
<?= insert('/content/post/post-card', ['data' => $data]); ?>
<?php if (Request::getCookie('postAppearance') == 'classic') : ?>
<?= insert('/content/post/post-classic', ['data' => $data]); ?>
<?php else : ?>
<?= insert('/content/post/post-card', ['data' => $data]); ?>
<?php endif; ?>
<?= Html::pagination($data['pNum'], $data['pagesCount'], false, '/@' . $data['profile']['login'] . '/posts'); ?>
</main>
<aside>

View file

@ -3,7 +3,11 @@
<div class="flex gap">
<main>
<div class="mb15"><?= __('app.posts'); ?> <b><?= $data['profile']['login']; ?></b></div>
<?= insert('/content/post/post-card', ['data' => $data]); ?>
<?php if (Request::getCookie('postAppearance') == 'classic') : ?>
<?= insert('/content/post/post-classic', ['data' => $data]); ?>
<?php else : ?>
<?= insert('/content/post/post-card', ['data' => $data]); ?>
<?php endif; ?>
<?= Html::pagination($data['pNum'], $data['pagesCount'], false, '/@' . $data['profile']['login'] . '/posts'); ?>
</main>
<aside>

View file

@ -2,7 +2,7 @@
use Hleb\Constructor\Handlers\Request;
Request::getHead()->addStyles('/assets/css/style.css?01');
Request::getHead()->addStyles('/assets/css/style.css?21');
$type = $data['type'] ?? false;
$facet = $data['facet'] ?? false;
$post = $data['post'] ?? false;

View file

@ -2,7 +2,7 @@
use Hleb\Constructor\Handlers\Request; ?>
<?php Request::getHead()->addStyles('/assets/css/style.css?01'); ?>
<?php Request::getHead()->addStyles('/assets/css/style.css?21'); ?>
<?= insert('/meta', ['meta' => $meta]); ?>

View file

@ -2,7 +2,7 @@
use Hleb\Constructor\Handlers\Request;
Request::getHead()->addStyles('/assets/css/style.css?01');
Request::getHead()->addStyles('/assets/css/style.css?21');
$uri = $data['type'] ?? 'post';
$q = $data['q'];
?>

View file

@ -2,7 +2,7 @@
use Hleb\Constructor\Handlers\Request;
Request::getHead()->addStyles('/assets/css/style.css?01');
Request::getHead()->addStyles('/assets/css/style.css?21');
$type = $data['type'] ?? false;
$facet = $data['facet'] ?? false; ?>

View file

@ -2,8 +2,8 @@
use Hleb\Constructor\Handlers\Request;
Request::getHead()->addStyles('/assets/css/style.css?01');
Request::getHead()->addStyles('/assets/css/test.css?01');
Request::getHead()->addStyles('/assets/css/style.css?21');
Request::getHead()->addStyles('/assets/css/test.css?21');
$type = $data['type'] ?? false;
$facet = $data['facet'] ?? false; ?>