DEV: Add a space detail page stub

This commit is contained in:
Evg 2021-09-04 19:36:47 +03:00
parent ae7a41f8ce
commit 1cfc38a450
10 changed files with 77 additions and 46 deletions

View file

@ -143,7 +143,6 @@ class SpaceController extends MainController
];
$data = [
'h1' => $space['space_name'],
'sheet' => $sheet,
'pagesCount' => ceil($pagesCount / $limit),
'pNum' => $page,
@ -155,4 +154,27 @@ class SpaceController extends MainController
return view('/space/space', ['meta' => $meta, 'uid' => $uid, 'data' => $data]);
}
public function wiki()
{
// Under development
$wiki = [];
Request::getHead()->addStyles('/assets/css/space.css');
$meta = [
'canonical' => Config::get(Config::PARAM_URL) . '/s/' . $space['space_slug'] . '/wiki',
'sheet' => 'wiki',
'meta_title' => lang('Wiki space') . ' | ' . Config::get(Config::PARAM_NAME),
'meta_desc' => lang('wiki-space-desc') . ' ' . Config::get(Config::PARAM_HOME_TITLE),
];
$data = [
'h1' => lang('Wiki space'),
'sheet' => 'wiki',
'wiki' => $wiki,
];
return view('/space/wiki', ['meta' => $meta, 'uid' => Base::getUid(), 'data' => $data]);
}
}

View file

@ -27,6 +27,7 @@ class AnswerModel extends MainModel
answer_date,
answer_user_id,
answer_post_id,
answer_ip,
answer_votes,
answer_is_deleted,
user_id,

View file

@ -28,6 +28,7 @@ class CommentModel extends MainModel
comment_content,
comment_post_id,
comment_user_id,
comment_ip,
comment_votes,
comment_is_deleted,
user_id,

View file

@ -11,28 +11,28 @@
<?php if (!empty($data['answers'])) { ?>
<?php foreach ($data['answers'] as $answer) { ?>
<a href="<?= post_url($answer); ?>">
<b><?= $answer['post_title']; ?></b>
</a>
<div id="answer_<?= $answer['answer_id']; ?>">
<div class="size-13">
<?= user_avatar_img($answer['user_avatar'], 'small', $answer['user_login'], 'ava'); ?>
<a class="date" href="/u/<?= $answer['user_login']; ?>"><?= $answer['user_login']; ?></a>
<span class="mr5 ml5"> &#183; </span>
<?= $answer['date']; ?>
<span class="mr5 ml5"> &#183; </span>
<a href="/post/<?= $answer['post_id']; ?>/<?= $answer['post_slug']; ?>">
<?= $answer['post_title']; ?>
<div class="size-13 gray">
<?= user_avatar_img($answer['user_avatar'], 'small', $answer['user_login'], 'ava mr5'); ?>
<a class="date mr5" href="/u/<?= $answer['user_login']; ?>">
<?= $answer['user_login']; ?>
</a>
<span class="mr5">
<?= $answer['date']; ?>
</span>
<?= content_ip($answer['answer_ip'], $uid); ?>
<?php if ($answer['post_type'] == 1) { ?>
<i class="icon-help green"></i>
<?php } ?>
</div>
<div class="mt5 mr0 mb10 ml0 size-15 max-width">
<div class="size-15 max-width">
<?= $answer['content']; ?>
</div>
<div class="border-bottom mb15 mt5 pb5 size-13 hidden gray">
<div class="border-bottom mb15 pb5 size-13 hidden gray">
+ <?= $answer['answer_votes']; ?>
<span id="cm_dell" class="right comment_link size-13">
<a data-type="answer" data-id="<?= $answer['answer_id']; ?>" class="type-action">
<?php if ($data['sheet'] == 'answers-ban') { ?>

View file

@ -11,19 +11,19 @@
<?php if (!empty($data['comments'])) { ?>
<?php foreach ($data['comments'] as $comment) { ?>
<a href="<?= post_url($comment); ?>">
<b><?= $comment['post_title']; ?></b>
</a>
<div id="comment_<?= $comment['comment_id']; ?>">
<div class="size-13">
<?= user_avatar_img($comment['user_avatar'], 'small', $comment['user_login'], 'ava'); ?>
<a class="date" href="/u/<?= $comment['user_login']; ?>"><?= $comment['user_login']; ?></a>
<span class="mr5 ml5"> &#183; </span>
<span class="date"><?= $comment['date']; ?></span>
<span class="mr5 ml5"> &#183; </span>
<a href="/post/<?= $comment['post_id']; ?>/<?= $comment['post_slug']; ?>">
<?= $comment['post_title']; ?>
<div class="size-13 gray">
<?= user_avatar_img($comment['user_avatar'], 'small', $comment['user_login'], 'ava mr5'); ?>
<a class="date mr5" href="/u/<?= $comment['user_login']; ?>">
<?= $comment['user_login']; ?>
</a>
<span class="date mr5">
<?= $comment['date']; ?>
</span>
<?= content_ip($comment['comment_ip'], $uid); ?>
<?php if ($comment['post_type'] == 1) { ?>
<i class="icon-commenting-o middle"></i>
<?php } ?>

View file

@ -1,7 +1,7 @@
<div class="wrap">
<main class="admin">
<div class="white-box pt5 pr15 pb5 pl15">
<?= breadcrumb('/admin', lang('Admin'), null, null, lang('Posts'));
<?= breadcrumb('/admin', lang('Admin'), null, null, lang('Posts'));
$pages = array(
array('id' => 'posts', 'url' => '/admin/posts', 'content' => lang('All')),
array('id' => 'posts-ban', 'url' => '/admin/posts/ban', 'content' => lang('Deleted posts')),
@ -15,14 +15,15 @@
<b><?= $post['post_title']; ?></b>
</a>
<div id="post_<?= $post['post_id']; ?>">
<div class="size-13">
<?= user_avatar_img($post['user_avatar'], 'small', $post['user_login'], 'ava'); ?>
<span class="mr5 ml5"></span>
<a class="date" href="/u/<?= $post['user_login']; ?>"><?= $post['user_login']; ?></a>
<span class="mr5 ml5"> &#183; </span>
<?= $post['date']; ?>
<span class="mr5 ml5"> &#183; </span>
<?= $post['post_ip']; ?>
<div class="size-13 gray">
<?= user_avatar_img($post['user_avatar'], 'small', $post['user_login'], 'ava mr5'); ?>
<a class="date mr5" href="/u/<?= $post['user_login']; ?>">
<?= $post['user_login']; ?>
</a>
<span class="mr55">
<?= $post['date']; ?>
</span>
<?= content_ip($post['post_ip'], $uid); ?>
<?php if ($post['post_type'] == 1) { ?>
<i class="icon-help green"></i>
<?php } ?>

View file

@ -2,14 +2,14 @@
<main class="admin">
<div class="white-box pt5 pr15 pb5 pl15">
<?= breadcrumb('/admin', lang('Admin'), '/admin/users', lang('Users'), lang('Users')); ?>
<?php
<?php
$pages = array(
array('id' => 'users', 'url' => '/admin/users', 'content' => lang('All')),
array('id' => 'users-ban', 'url' => '/admin/users/ban', 'content' => lang('Banned')),
);
echo tabs_nav($pages, $data['sheet'], $uid);
?>
<?php if ($data['alluser']) { ?>
<table>
<thead>
@ -17,7 +17,7 @@
<th><?= lang('Avatar'); ?></th>
<th><?= lang('Information'); ?></th>
<th>IP <?= lang('registrations'); ?></th>
<td><?= lang('Last'); ?></th>
<th><?= lang('Last'); ?></th>
<th>Ban</th>
<th><?= lang('Action'); ?></th>
</thead>
@ -47,22 +47,20 @@
bans: <?= $user['isBan']['banlist_int_num']; ?>
<?php } ?>
</td>
<td class="size-13">
<?= $user['user_reg_ip']; ?>
<td class="size-13 align-right">
<?= content_ip($user['user_reg_ip'], $uid); ?>
<?php if ($user['replayIp'] > 1) { ?>
<sup class="red">(<?= $user['replayIp']; ?>)</sup>
<?php } ?> <br>
<?php } ?>
<br>
<?= $user['created_at']; ?>
</td>
<td class="size-13">
<td class="size-13 align-right">
<?php if (!empty($user['logs']['logs_ip_address'])) { ?>
<a href="/admin/logip/<?= $user['logs']['logs_ip_address']; ?>">
<?= $user['logs']['logs_ip_address']; ?>
</a>
<?= content_ip($user['logs']['logs_ip_address'], $uid); ?>
<br>
<?= $user['logs']['logs_date']; ?>
<?php } ?>
<?php if ($user['user_activated'] == 1) { ?>
<div><?= lang('Email activated'); ?></div>
<?php } else { ?>

View file

@ -197,6 +197,7 @@ img {
.right { float: right; }
.right-10 { right: 10px; }
.center { text-align: center; }
.align-right { text-align: right; }
.middle { vertical-align: middle; }
.lowercase { text-transform: lowercase; }
.justify-content-between { justify-content: space-between; }

View file

@ -0,0 +1,7 @@
<?php if ($data['wiki']) { ?>
<div class="white-box p15">
<!-- заглушка -->
</div>
<?php } else { ?>
<?= no_content('No'); ?>
<?php } ?>

View file

@ -128,7 +128,7 @@ Route::get('/s/{slug}/page/{page?}')->controller('Space\SpaceController@posts',
Route::get('/s/{slug}/top')->controller('Space\SpaceController@posts', ['top'])->where(['slug' => '[A-Za-z0-9_]+']);
Route::get('/s/{slug}/top/page/{page?}')->controller('Space\SpaceController@posts', ['top'])->where(['slug' => '[A-Za-z0-9_]+', 'page' => '[0-9]+']);
Route::get('/s/{slug}/writers')->controller('Space\SpaceController@posts', ['writers'])->where(['slug' => '[A-Za-z0-9_]+']);
Route::get('/s/{slug}/wiki')->controller('Space\SpaceController@wiki')->where(['slug' => '[A-Za-z0-9_]+']);
Route::get('/moderations')->controller('ActionController@moderation');