Compare commits

...

1 Commits
4.0.3 ... 4.0.4

Author SHA1 Message Date
ca850bb46b UI fixes and composer bump 2025-01-27 00:26:43 -05:00
24 changed files with 167 additions and 83 deletions

View File

@ -17,8 +17,10 @@ use TheTempusProject\Classes\AdminController;
use TheTempusProject\Models\User;
use TheTempusProject\Models\Comments;
use TheTempusProject\Models\Posts;
use TheTempusProject\Models\Contact;
use TheTempusProject\Plugins\Comments as CommentPlugin;
use TheTempusProject\Plugins\Blog as BlogPlugin;
use TheTempusProject\Plugins\Contact as ContactPlugin;
use TheTempusProject\Canary\Bin\Canary as Debug;
class Home extends AdminController {
@ -58,6 +60,19 @@ class Home extends AdminController {
}
}
if ( class_exists( 'TheTempusProject\Plugins\Contact' ) ) {
$plugin = new ContactPlugin;
if ( ! $plugin->checkEnabled() ) {
Debug::info( 'Contact Plugin is disabled in the control panel.' );
Components::set( 'contactDash', '' );
} else {
$posts = new Contact;
$postsList = Views::simpleView( 'contact.admin.dashboard', $posts->listPaginated( 5 ) );
Components::set( 'contactDash', $postsList );
}
}
self::$user = new User;
$users = Views::simpleView( 'admin.dashboard.users', self::$user->recent( 5 ) );
Components::set( 'userDash', $users );

View File

@ -28,6 +28,10 @@
background-color: #2c2c2c;
}
hr {
color: #f5f5f5;
}
.bg-none,.bg-warning {
color: #000 !important;
@ -145,6 +149,7 @@ body {
background-color: #1f1f1f;
color: #e0e0e0;
}
.form-control:focus {
color: #e0e0e0;
border-color: #1e90ff;

View File

@ -12,7 +12,14 @@
.context-other-bg {
background-color: #eaeaea;
}
.nav-link.active {
font-weight: bold; /* Make the text bold */
}
hr {
color: #000;
}
.context-main-bg {
background-color: #f7f7f7;
@ -57,7 +64,7 @@
bottom: 2.5px;
left: 5px;
transition: transform 0.3s ease-in-out;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
box-shadow: 0 2px 4px #00000033;
}
/* Change background color when checked */

View File

@ -168,9 +168,11 @@ class Posts extends DatabaseModel {
$draft = ' <b>Draft</b>';
}
$instance->isDraft = $draft;
$instance->authorName = $authorName;
$instance->authorName = \ucfirst( $authorName );
if ( self::$comments !== false ) {
$instance->commentCount = self::$comments->count( 'blog', $instance->ID );
} else {
$instance->commentCount = 0;
}
$instance->content = Filters::applyOne( 'mentions.0', $instance->content, true );
$instance->content = Filters::applyOne( 'hashtags.0', $instance->content, true );

View File

@ -21,7 +21,7 @@
<tbody>
{LOOP}
<tr>
<td><a href="{ROOT_URL}admin/blog/view/{ID}">{title}</a>{isDraft}</td>
<td><a href="{ROOT_URL}admin/blog/view/{ID}" class="text-decoration-none">{title}</a>{isDraft}</td>
<td>{authorName}</td>
<td>{commentCount}</td>
<td>{DTC}{created}{/DTC}</td>

View File

@ -1,7 +1,7 @@
{LOOP}
<article class="blog-post">
<h2 class="blog-post-title mb-1">{title}</h2>
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{author}" class="text-decoration-none">{authorName}</a></p>
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{authorName}" class="text-decoration-none">{authorName}</a></p>
<div class="well">
{contentSummary}
</div>

View File

@ -3,7 +3,7 @@
<div class="blog-post">
<h2 class="blog-post-title">{title}</h2>
<hr>
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{author}" class="text-decoration-none">{authorName}</a></p>
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{authorName}" class="text-decoration-none">{authorName}</a></p>
{content}
{ADMIN}
<hr>

View File

@ -1,11 +1,15 @@
<div class="p-4">
<h4 class="fst-italic">Archives</h4>
<ul class="list-unstyled mb-0">
{LOOP}
<li>({count}) <a href="{ROOT_URL}blog/month/{month}/{year}" class="text-decoration-none">{monthText} {year}</a></li>
{/LOOP}
{ALT}
<li>None To Show</li>
{/ALT}
</ul>
<div class="card context-main-bg">
<div class="card-header">
<h3 class="card-title">Archives</h3>
</div>
<div class="card-body">
<ol class="list-unstyled">
{LOOP}
<li>({count}) <a href="{ROOT_URL}blog/month/{month}/{year}" class="text-decoration-none">{monthText} {year}</a></li>
{/LOOP}
{ALT}
<li>None To Show</li>
{/ALT}
</ol>
</div>
</div>

View File

@ -0,0 +1,29 @@
<table class="table context-main">
<thead>
<tr>
<th style="width: 5%"></th>
<th style="width: 25%"></th>
<th style="width: 55%"></th>
<th style="width: 5%"></th>
<th style="width: 5%"></th>
</tr>
</thead>
<tbody>
{LOOP}
<tr>
<td>{ID}</td>
<td>{DTC}{time}{/DTC}</td>
<td>{feedback}</td>
<td><a href="{ROOT_URL}admin/contact/view/{ID}" class="btn btn-sm btn-primary"><i class="fa fa-fw fa-upload"></i></a></td>
<td><a href="{ROOT_URL}admin/contact/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>
</tr>
{/LOOP}
{ALT}
<tr>
<td class="text-center" colspan="5">
No Contact forms to show.
</td>
</tr>
{/ALT}
</tbody>
</table>

View File

@ -34,14 +34,16 @@ class AdminLoader extends DefaultLoader {
}
$links[$key]->url = '#' . $name . 'Dropdown';
$links[$key]->text = '<span>' . $link->text . '</span><i class="fa fa-fw fa-caret-down ms-2"></i>';
$links[$key]->duuuuuuuh = Views::simpleView( 'nav.adminSub', $out );
$links[$key]->subnav = Views::simpleView( 'nav.adminSub', $out );
} else {
$links[$key]->linkClasses = 'nav-link';
$links[$key]->linkAttributes = '';
$links[$key]->duuuuuuuh = '';
$links[$key]->subnav = '';
}
}
Components::set( 'ADMIN_LINKS', Views::simpleView( 'nav.admin', $links ) );
$menu = Views::simpleView( 'nav.admin', $links );
$activeMenu = Navigation::activePageSelect( $menu, Input::get( 'url' ), false, true );
Components::set( 'ADMIN_LINKS', $activeMenu );
Navigation::setCrumbComponent( 'ADMIN_BREADCRUMBS', Input::get( 'url' ) );
}
}

View File

@ -73,7 +73,9 @@ class DefaultLoader extends Loader {
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet" disabled>' );
}
Components::set( 'topNavRight', Template::parse( App::$topNavRight . '{STATUS}' ) );
Components::set( 'topNavLeft', Views::simpleView( 'nav.main', Navigation::getMenuLinks( App::MAIN_MENU_NAME ) ) );
$menu = Views::simpleView( 'nav.main', Navigation::getMenuLinks( App::MAIN_MENU_NAME ) );
$activeMenu = Navigation::activePageSelect( $menu, Input::get( 'url' ), false, true );
Components::set( 'topNavLeft', $activeMenu );
Components::set( 'colorSelect', Views::simpleView( 'forms.colorSelect' ) );
Components::set( 'iconSelect', Views::simpleView( 'forms.iconSelect' ) );
Navigation::setCrumbComponent( 'BREADCRUMB', Input::get( 'url' ) );

View File

@ -8,6 +8,11 @@
{commentDash}
</div>
</div>
<div class="row">
<div class="col-10 offset-1">
{contactDash}
</div>
</div>
<div class="row">
<div class="col-10 offset-1">
{blogDash}

View File

@ -18,8 +18,8 @@
<tbody>
{LOOP}
<tr>
<td><a href="{ROOT_URL}admin/groups/view/{ID}">{name}</a></td>
<td><a href="{ROOT_URL}admin/groups/listmembers/{ID}">{userCount}</a></td>
<td><a href="{ROOT_URL}admin/groups/view/{ID}" class="text-decoration-none">{name}</a></td>
<td><a href="{ROOT_URL}admin/groups/listmembers/{ID}" class="text-decoration-none">{userCount}</a></td>
<td><a href="{ROOT_URL}admin/groups/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
<td><a href="{ROOT_URL}admin/groups/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>
<td>

View File

@ -1,40 +1,43 @@
<h1>{groupName} <small>user list</small></h1>
{PAGINATION}
<form action="{ROOT_URL}admin/users/delete" method="post">
<table class="table table-striped">
<thead>
<tr>
<th style="width: 5%">ID</th>
<th style="width: 55%">Username</th>
<th style="width: 25%">Joined</th>
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 5%">
<input type="checkbox" onchange="checkAll(this)" name="check.u" value="U_[]">
</th>
</tr>
</thead>
<tbody>
{LOOP}
<tr>
<td>{ID}</td>
<td><a href='{ROOT_URL}admin/users/view/{ID}'>{username}</a></td>
<td>{DTC date}{registered}{/DTC}</td>
<td><a href="{ROOT_URL}admin/users/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
<td><a href="{ROOT_URL}admin/users/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>
<td>
<input type="checkbox" value="{ID}" name="U_[]">
</td>
</tr>
{/LOOP}
{ALT}
<tr>
<td align="center" colspan="6">
No results to show.
</td>
</tr>
{/ALT}
</tbody>
</table>
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
<div class="context-main-bg context-main p-3">
<legend class="text-center">{groupName} <small>user list</small></legend>
<hr>
{ADMIN_BREADCRUMBS}
<form action="{ROOT_URL}admin/users/delete" method="post">
<table class="table table-striped">
<thead>
<tr>
<th style="width: 5%">ID</th>
<th style="width: 55%">Username</th>
<th style="width: 25%">Joined</th>
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 5%">
<input type="checkbox" onchange="checkAll(this)" name="check.u" value="U_[]">
</th>
</tr>
</thead>
<tbody>
{LOOP}
<tr>
<td>{ID}</td>
<td><a href='{ROOT_URL}admin/users/view/{ID}' class="text-decoration-none">{username}</a></td>
<td>{DTC date}{registered}{/DTC}</td>
<td><a href="{ROOT_URL}admin/users/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
<td><a href="{ROOT_URL}admin/users/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>
<td>
<input type="checkbox" value="{ID}" name="U_[]">
</td>
</tr>
{/LOOP}
{ALT}
<tr>
<td align="center" colspan="6">
No results to show.
</td>
</tr>
{/ALT}
</tbody>
</table>
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
</div>

View File

@ -17,7 +17,7 @@
<tbody>
{LOOP}
<tr>
<td><a href="{ROOT_URL}admin/plugins/view/{name}">{name}</a></td>
<td><a href="{ROOT_URL}admin/plugins/view/{name}" class="text-decoration-none">{name}</a></td>
<td>{enabled_txt}</td>
<td>{installStatus}</td>
<td>{version}</td>

View File

@ -22,7 +22,7 @@
{LOOP}
<tr>
<td align="center">{ID}</td>
<td><a href='{ROOT_URL}admin/routes/view/{ID}'>{nickname}</a></td>
<td><a href='{ROOT_URL}admin/routes/view/{ID}' class="text-decoration-none">{nickname}</a></td>
<td>{redirect_type}</td>
<td>{original_url}</td>
<td>{forwarded_url}</td>

View File

@ -1,4 +1,6 @@
<div class="context-main-bg context-main p-3">
<legend class="text-center">Settings</legend>
<hr>
{ADMIN_BREADCRUMBS}
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
<fieldset>

View File

@ -14,7 +14,7 @@
<tbody>
{LOOP}
<tr>
<td><a href='{ROOT_URL}admin/tokens/view/{ID}'>{name}</a></td>
<td><a href='{ROOT_URL}admin/tokens/view/{ID}' class="text-decoration-none">{name}</a></td>
<td>{token_type}</td>
<td><a href="{ROOT_URL}admin/tokens/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
<td><a href="{ROOT_URL}admin/tokens/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>

View File

@ -20,7 +20,7 @@
{LOOP}
<tr>
<td align="center">{ID}</td>
<td><a href='{ROOT_URL}admin/users/view/{ID}'>{username}</a></td>
<td><a href='{ROOT_URL}admin/users/view/{ID}' class="text-decoration-none">{username}</a></td>
<td>{DTC date}{registered}{/DTC}</td>
<td><a href="{ROOT_URL}admin/users/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
<td><a href="{ROOT_URL}admin/users/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>

View File

@ -4,7 +4,7 @@
<a href="{url}" class="text-white {linkClasses}" {linkAttributes}>
{text}
</a>
{duuuuuuuh}
{subnav}
</li>
{/LOOP}
</ul>

View File

@ -1,6 +1,6 @@
<ul class="collapse list-unstyled ms-3 text-small shadow" id="{dropdownName}Dropdown">
{LOOP}
<li class="nav-item"><a href="{url}" class="nav-link text-white">{text}</a></li>
<li class="nav-item"><a href="{url}" class="submenu nav-link text-white">{text}</a></li>
{/LOOP}
</ul>

View File

@ -1,5 +1,13 @@
<ul class="nav col-12 col-lg-auto mb-2 justify-content-center mb-md-0 mx-auto">
{LOOP}
<li><a href="{url}" class="nav-link px-2 text-white">{text}</a></li>
{/LOOP}
</ul>
<nav class="navbar navbar-expand col-12 col-lg-auto mb-2 justify-content-center mb-md-0 mx-auto">
<div class="container-fluid">
<ul class="navbar-nav">
{LOOP}
<li class="nav-item">
<a href="{url}" class="nav-link px-2 text-white">
{text}
</a>
</li>
{/LOOP}
</ul>
</div>
</nav>

View File

@ -22,9 +22,9 @@
{
"components/jquery": "1.9.*",
"fortawesome/font-awesome": "4.7",
"thetempusproject/bedrock": "1.1",
"thetempusproject/bedrock": "1.1.1",
"thetempusproject/canary": "1.0.6",
"thetempusproject/houdini": "2.0.1",
"thetempusproject/houdini": "2.0.2",
"twbs/bootstrap": "5.2.3"
},
"autoload":

16
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "7b53f62bdce4655bce03a69a5e6ae57a",
"content-hash": "b54d2da34f833481cff28144a669b2aa",
"packages": [
{
"name": "components/jquery",
@ -303,17 +303,17 @@
},
{
"name": "thetempusproject/bedrock",
"version": "1.1",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://git.thetempusproject.com/the-tempus-project/bedrock",
"reference": "3b8e0994912eef8c203c8d47258754d6c78d4b19"
"reference": "bcd73d58f9d7df41b5ec0f12871ff15cfcc215ae"
},
"require": {
"php": ">=8.1.0",
"thetempusproject/canary": "1.0.6",
"thetempusproject/hermes": "1.0.3",
"thetempusproject/houdini": "2.0.1"
"thetempusproject/houdini": "2.0.2"
},
"type": "library",
"autoload": {
@ -344,7 +344,7 @@
"framework",
"mvc"
],
"time": "2025-01-22T02:02:57+00:00"
"time": "2025-01-27T05:07:05+00:00"
},
{
"name": "thetempusproject/canary",
@ -434,11 +434,11 @@
},
{
"name": "thetempusproject/houdini",
"version": "2.0.1",
"version": "2.0.2",
"source": {
"type": "git",
"url": "https://git.thetempusproject.com/the-tempus-project/houdini",
"reference": "b03fc3b7ddcdd0213f8f927a9bf1c0c68c62138f"
"reference": "fb027a4ebc327e709ad3da29a4cf112894c2b7e6"
},
"require": {
"php": ">=8.1.0",
@ -474,7 +474,7 @@
"thetempusproject",
"tools"
],
"time": "2025-01-22T01:59:01+00:00"
"time": "2025-01-27T05:02:14+00:00"
},
{
"name": "twbs/bootstrap",