FIX: css и шаблоны

* Добавлена таблица тегов для пространств
This commit is contained in:
Evg 2021-04-11 18:40:39 +03:00
parent b44627e3a5
commit 25bf00aee1
16 changed files with 88 additions and 182 deletions

View file

@ -35,6 +35,7 @@ https://my.areadev.ru
* https://meta.discourse.org/
* https://discuss.flarum.org/
* https://tildes.net/
* https://subreply.com/
...

View file

@ -42,6 +42,8 @@ class SpaceController extends \MainController
$space['space_img'] = 'space_no.png';
}
$space['space_date'] = Base::ru_date($space['space_date']);
// Покажем 404
if(!$posts) {
include HLEB_GLOBAL_DIRECTORY . '/app/Optional/404.php';
@ -71,7 +73,7 @@ class SpaceController extends \MainController
'space_hide' => $space_hide,
];
return view("space/spaceposts", ['data' => $data, 'uid' => $uid, 'posts' => $result, 'space' => $space]);
return view("space/space-posts", ['data' => $data, 'uid' => $uid, 'posts' => $result, 'space_info' => $space]);
}
// Форма изменения пространства

View file

@ -168,6 +168,7 @@ CREATE TABLE `space` (
`space_color` varchar(128) NOT NULL,
`space_img` varchar(250) DEFAULT NULL,
`space_text` varchar(550) NOT NULL,
`space_date` timestamp NOT NULL DEFAULT current_timestamp(),
`space_category_id` int(11) NOT NULL DEFAULT 1,
`space_tip` int(11) NOT NULL DEFAULT 1,
`space_permit_users` int(11) NOT NULL DEFAULT 1
@ -177,10 +178,32 @@ CREATE TABLE `space` (
-- Дамп данных таблицы `space`
--
INSERT INTO `space` (`space_id`, `space_name`, `space_slug`, `space_description`, `space_color`, `space_text`, `space_category_id`, `space_tip`, `space_permit_users`) VALUES
(1, 'cms', 'cms', 'Системы управления сайтами...', '', 'тест 1...', 0, 1, 0),
(2, 'Вопросы', 'qa', 'Вопросы и ответы', '', 'тест 2...', 0, 2, 0),
(3, 'флуд', 'flud', 'Просто обычные разговоры', '', 'тест 3...', 0, 3, 0);
INSERT INTO `space` (`space_id`, `space_name`, `space_slug`, `space_description`, `space_color`, `space_text`, `space_date`, `space_category_id`, `space_tip`, `space_permit_users`) VALUES
(1, 'cms', 'cms', 'Системы управления сайтами...', '', 'тест 1...', '2021-02-28 12:15:58', 0, 1, 0),
(2, 'Вопросы', 'qa', 'Вопросы и ответы', '', 'тест 2...', '2021-02-28 12:15:58', 0, 2, 0),
(3, 'флуд', 'flud', 'Просто обычные разговоры', '', 'тест 3...', '2021-02-28 12:15:58', 0, 3, 0);
--
-- Дамп данных таблицы `space`
--
CREATE TABLE `space_tags` (
`st_id` int(11) NOT NULL,
`space_id` int(11) NOT NULL,
`title` varchar(150) NOT NULL,
`description` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Индексы таблицы `cms_blog_cats`
--
ALTER TABLE `space_tags`
ADD PRIMARY KEY (`st_id`),
ADD KEY `space_id` (`space_id`);
ALTER TABLE `space_tags`
MODIFY `st_id` int(11) NOT NULL AUTO_INCREMENT;
-- --------------------------------------------------------

View file

@ -25,9 +25,7 @@ html, body {
*, *:before, *:after {
box-sizing: inherit;
}
article, aside, footer, header, section {
display: block;
}
tt {
font-size: 14px;
}
@ -123,10 +121,11 @@ h1.head {
text-transform: uppercase;
letter-spacing: 1px;
}
h1.space {
h1.space, .nav a.post-space {
font-size: 16px;
margin: 0 0 0 68px;
letter-spacing: 1px;
color: #2562dc;
}
h1.space a {
color: #2562dc;
@ -434,7 +433,6 @@ div.select2-choices {
display: inline-block;
padding: 2px 10px 2px 10px;
line-height: 18px;
color: var(--color-gray-2);
text-align: center;
background-color: #fafafa;
border: 1px solid #ccc;
@ -652,6 +650,15 @@ a.space_5 {
padding: 5px;
margin-left: 20px;
}
.space-text h2 {
padding: 0;
margin: 0;
font-size: 16px;
font-weight: 300;
}
.space-text-bar {
margin: 10px 0;
}
.space-img {
float: left;
width: 40px;
@ -883,13 +890,10 @@ textarea.mess {
.dark a {
color: var(--color-white);
}
.dark a:hover {
.dark header, .dark header a, .dark a:hover {
color: #eee;
}
.dark header, .dark header a {
color: #eee;
}
.dark footer, .dark footer a, .na {
.dark footer, .dark footer a, .na, .dark a.menu.active, .dark .info-n.active {
color: #999;
}
.dark .menu-h .md-icon {
@ -899,7 +903,7 @@ textarea.mess {
max-width: 360px;
display: inline-block;
}
.dark blockquote {
.dark blockquote, .dark .menu-info {
background-color: #555;
}
@ -1010,7 +1014,6 @@ menu a span {
body.menuno menu {
display: none;
}
@media (min-width: 840px) {
body {
@ -1033,9 +1036,6 @@ body.menuno menu {
display: block;
grid-area: sidebar;
}
/* main {
max-width: calc(100vw - 250px - 1.2rem);
} */
}
@media screen and (max-width: 840px) {

View file

@ -1,5 +1,5 @@
<?php include TEMPLATE_DIR . '/admin/header_admin.php'; ?>
<main>
<div class="w-100">
<div class="left-ots">
<h1 class="top"><?php echo $data['h1']; ?></h1>

View file

@ -1,5 +1,5 @@
<?php include TEMPLATE_DIR . '/admin/header_admin.php'; ?>
<main>
<div class="w-100">
<div class="left-ots">
<h1 class="top"><?php echo $data['h1']; ?></h1>

View file

@ -1,24 +0,0 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main>
<div class="left-ots">
<h1 class="head"><?= $data['h1']; ?></h1>
<div class="box wide">
<form class="" action="/invite" method="post">
<?php csrf_field(); ?>
<div class="boxline">
<label for="email"><?= lang('Code'); ?></label>
<input type="text" name="invite" id="invite">
</div>
<div class="row">
<div class="boxline">
<button type="submit" class="button-primary"><?= lang('Sign in'); ?></button>
<small>
<span class="left-ots"><a href="/recover"><?= lang('forgot-password'); ?>?</a></span>
</small>
</div>
</div>
</form>
</div>
</div>
</main>
<?php include TEMPLATE_DIR . '/footer.php'; ?>

View file

@ -1,51 +0,0 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main>
<div class="left-ots">
<h1 class="top"><?php echo $data['h1']; ?></h1>
<?php if (!empty($comments)) { ?>
<?php foreach ($comments as $comm) { ?>
<?php if($comm['comment_del'] == 0) { ?>
<div class="comm-telo_bottom">
<div class="voters">
<div class="comm-up-id"></div>
<div class="score"><?php echo $comm['comment_votes']; ?></div>
</div>
<div class="comm-telo">
<div class="comm-header">
<img class="ava" alt="<?php echo $comm['login']; ?>" src="/uploads/avatar/small/<?php echo $comm['avatar']; ?>">
<span class="user">
<a href="/u/<?php echo $comm['login']; ?>"><?php echo $comm['login']; ?></a>
<?php echo $comm['date']; ?>
</span>
<span class="otst"> | </span>
<span class="date">
<a href="/posts/<?= $comm['post_slug']; ?>"><?php echo $comm['post_title']; ?></a>
</span>
</div>
<div class="comm-telo-body">
<?php echo $comm['content']; ?>
</div>
</div>
</div>
<?php } else { ?>
<div class="dell comm-telo_bottom">
<div class="voters"></div>
~ Комментарий удален
</div>
<?php } ?>
<?php } ?>
<?php } else { ?>
<div class="no-content"><?= lang('no-comment'); ?>...</div>
<?php } ?>
</div>
</main>
<?php include TEMPLATE_DIR . '/footer.php'; ?>

View file

@ -36,9 +36,21 @@
</svg>
</div>
</li>
<?php if(!empty($space)) { ?>
<?php if(!empty($space_info)) { ?>
<li class="nav no-mob">
<h1 class="space"> <a href="">~ <?= $space['space_name']; ?></a></h1>
<h1 class="space">
<a href="/s/<?= $space_info['space_slug']; ?>">
~ <?= $space_info['space_name']; ?>
</a>
</h1>
</li>
<?php } ?>
<?php if(!empty($post['space_slug'])) { ?>
<li class="nav no-mob">
<a class="post-space" href="/s/<?= $post['space_slug']; ?>" title="<?= $post['space_name']; ?>">
~ <?= $post['space_name']; ?>
</a>
</li>
<?php } ?>
</ul>

View file

@ -1,5 +1,5 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main>
<div class="w-100">
<div class="left-ots">
<h1><a href="/messages">Все сообщения</a> / <?= $data['title']; ?> </h1>

View file

@ -1,5 +1,5 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main>
<div class="w-100">
<div class="left-ots">
<div class="messages">
<h1><?= $data['title'] ?></h1>

View file

@ -1,5 +1,5 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main>
<div class="w-100">
<div class="left-ots">
<a class="right" href="/messages">Все сообщения</a>
<h2><?= $data['title']; ?></h2>

View file

@ -1,5 +1,5 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main>
<div class="w-100">
<div class="left-ots">
<h1><?php echo $data['h1']; ?></h1>

View file

@ -1,5 +1,5 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main>
<div class="w-100">
<div class="left-ots">
<h1><?= $data['h1']; ?></h1>

View file

@ -1,66 +0,0 @@
<?php include TEMPLATE_DIR . '/header.php'; ?>
<main>
<div class="left-ots">
<h1 class="top"><?php echo $data['h1']; ?></h1>
<div class="telo posts">
<?php if (!empty($posts)) { ?>
<?php foreach ($posts as $post) { ?>
<?php if (!$uid['id']) { ?>
<div id="vot<?= $post['post_id']; ?>" class="voters">
<a rel="nofollow" href="/login"><div class="post-up-id"></div></a>
<div class="score"><?= $post['post_votes']; ?></div>
</div>
<?php } else { ?>
<?php if ($post['votes_post_user_id'] || $uid['id'] == $post['post_user_id']) { ?>
<div class="voters active">
<div class="post-up-id"></div>
<div class="score"><?= $post['post_votes']; ?></div>
</div>
<?php } else { ?>
<div id="up<?= $post['post_id']; ?>" class="voters">
<div data-id="<?= $post['post_id']; ?>" class="post-up-id"></div>
<div class="score"><?= $post['post_votes']; ?></div>
</div>
<?php } ?>
<?php } ?>
<div class="post-telo">
<a class="u-url" href="/posts/<?php echo $post['post_slug']; ?>">
<h3 class="titl"><?php echo $post['post_title']; ?></h3>
</a>
<a class="space space_<?= $post['space_tip'] ?>" href="/s/<?= $post['space_slug']; ?>" title="<?= $post['space_name']; ?>">
<?= $post['space_name']; ?>
</a>
<div class="footer">
<img class="ava" src="/uploads/avatar/small/<?php echo $post['avatar']; ?>">
<span class="user">
<a href="/u/<?php echo $post['login']; ?>"><?php echo $post['login']; ?></a>
</span>
<span class="date">
<?php echo $post['post_date']; ?>
</span>
<?php if($post['post_comments'] !=0) { ?>
<span class="otst"> | </span>
комментариев (<?php echo $post['post_comments'] ?>)
<?php } ?>
</div>
</div>
<?php } ?>
<?php } else { ?>
<div class="no-content"><?= lanf('no-post'); ?>...</div>
<?php } ?>
</div>
</div>
</main>
<?php include TEMPLATE_DIR . '/footer.php'; ?>

View file

@ -28,7 +28,17 @@
<a class="u-url" href="/posts/<?= $post['post_slug']; ?>">
<h3 class="titl"><?= $post['post_title']; ?></h3>
</a>
<?php if ($post['post_content_preview']) { ?>
<div class="show">
<span class="show_add_<?= $post['post_id']; ?>">
<a data-post_id="<?= $post['post_id']; ?>" class="showpost">
<span>&#9658;</span>
<?= $post['post_content_preview']; ?>...
</a>
</span>
</div>
<?php } ?>
<div id="show_<?= $post['post_id']; ?>" class="show_detail"></div>
<div class="footer">
<img class="ava" src="/uploads/avatar/small/<?= $post['avatar'] ?>">
<span class="user">
@ -66,24 +76,23 @@
<?php } else { ?>
<div class="right">
<?php if($data['space_hide'] == 1) { ?>
<div data-id="<?= $space['space_id']; ?>" class="hide-space-id add-space">Подписаться</div>
<div data-id="<?= $space_info['space_id']; ?>" class="hide-space-id add-space">Подписаться</div>
<?php } else { ?>
<div data-id="<?= $space['space_id']; ?>" class="hide-space-id no-space">Отписаться</div>
<div data-id="<?= $space_info['space_id']; ?>" class="hide-space-id no-space">Отписаться</div>
<?php } ?>
</div>
<?php } ?>
<br> <br>
<div class="space-text">
<img class="space-img" src="/uploads/space/<?= $space['space_img']; ?>">
<?php print_r($space); ?>
<?= $space['space_name']; ?>
<?= $space['space_text']; ?>
<img class="space-img" src="/uploads/space/<?= $space_info['space_img']; ?>">
<h2><?= $space_info['space_name']; ?></h2>
<div class="data"><?= $space_info['space_date']; ?></div>
<div class="space-text-bar">
<?= $space_info['space_text']; ?>
</div>
<?php if($uid['trust_level'] == 5) { ?>
<a class="right" href="/space/<?= $space['space_slug']; ?>/edit">
<a class="right" href="/space/<?= $space_info['space_slug']; ?>/edit">
<svg class="md-icon moon">
<use xlink:href="/assets/svg/icons.svg#edit"></use>
</svg>