Merge branch 'main' into joeykimsey-com
This commit is contained in:
@ -20,15 +20,14 @@ use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Classes\AdminController;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Plugins\Blog as BlogPlugin;
|
||||
use TheTempusProject\Models\Posts;
|
||||
|
||||
class Blog extends AdminController {
|
||||
public static $posts;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$blog = new BlogPlugin;
|
||||
self::$posts = $blog->posts;
|
||||
self::$posts = new Posts;
|
||||
self::$title = 'Admin - Blog';
|
||||
$view = Navigation::activePageSelect( 'nav.admin', '/admin/blog' );
|
||||
Components::set( 'ADMINNAV', $view );
|
||||
|
@ -27,17 +27,16 @@ use TheTempusProject\Plugins\Blog as BlogPlugin;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
use TheTempusProject\Plugins\Comments;
|
||||
use TheTempusProject\Models\Comments as CommentsModel;
|
||||
use TheTempusProject\Models\Posts as PostsModel;
|
||||
|
||||
class Blog extends Controller {
|
||||
protected static $blog;
|
||||
protected static $comments;
|
||||
protected static $posts;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
Template::setTemplate( 'blog' );
|
||||
$blog = new BlogPlugin;
|
||||
self::$posts = $blog->posts;
|
||||
self::$posts = new PostsModel;
|
||||
}
|
||||
|
||||
public function index() {
|
||||
@ -57,39 +56,41 @@ class Blog extends Controller {
|
||||
|
||||
public function comments( $sub = null, $data = null ) {
|
||||
Debug::log( 'Controller initiated: ' . __METHOD__ . '.' );
|
||||
if ( empty( self::$comments ) ) {
|
||||
self::$comments = new CommentsModel;
|
||||
}
|
||||
$plugin = new Comments;
|
||||
|
||||
if ( empty( $sub ) || empty( $data ) ) {
|
||||
Session::flash( 'error', 'Whoops, try again.' );
|
||||
Redirect::to( 'blog' );
|
||||
Issues::add( 'error', 'There was an issue with your request. Please check the url and try again.' );
|
||||
return $this->index();
|
||||
}
|
||||
|
||||
$plugin = new Comments;
|
||||
if ( ! $plugin->checkEnabled() ) {
|
||||
Issues::add( 'error', 'Comments are disabled.' );
|
||||
return $this->index();
|
||||
}
|
||||
$comments = new CommentsModel;
|
||||
|
||||
switch ( $sub ) {
|
||||
case 'post':
|
||||
$content = self::$posts->findById( (int) $data );
|
||||
if ( empty( $content ) ) {
|
||||
Session::flash( 'error', 'Unknown Post.' );
|
||||
Redirect::to( 'blog' );
|
||||
Issues::add( 'error', 'Unknown Content.' );
|
||||
return $this->index();
|
||||
}
|
||||
return $plugin->formPost( self::$posts->tableName, $content, 'blog/post/' );
|
||||
return self::$comments->formPost( 'blog', $content, 'blog/post/' );
|
||||
case 'edit':
|
||||
$content = self::$comments->findById( $data );
|
||||
$content = $comments->findById( $data );
|
||||
if ( empty( $content ) ) {
|
||||
Session::flash( 'error', 'Unknown Comment.' );
|
||||
Redirect::to( 'blog' );
|
||||
Issues::add( 'error', 'Unknown Comment.' );
|
||||
return $this->index();
|
||||
}
|
||||
return $plugin->formEdit( self::$posts->tableName, $content, 'blog/post/' );
|
||||
return self::$comments->formEdit( 'blog', $content, 'blog/post/' );
|
||||
case 'delete':
|
||||
$content = self::$comments->findById( $data );
|
||||
$content = $comments->findById( $data );
|
||||
if ( empty( $content ) ) {
|
||||
Session::flash( 'error', 'Unknown Comment.' );
|
||||
Redirect::to( 'blog' );
|
||||
Issues::add( 'error', 'Unknown Comment.' );
|
||||
return $this->index();
|
||||
}
|
||||
return $plugin->formDelete( self::$posts->tableName, $content, 'blog/post/' );
|
||||
return self::$comments->formDelete( 'blog', $content, 'blog/post/' );
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,26 +102,34 @@ class Blog extends Controller {
|
||||
if ( empty( $post ) ) {
|
||||
return $this->index();
|
||||
}
|
||||
if ( empty( self::$comments ) ) {
|
||||
self::$comments = new CommentsModel;
|
||||
}
|
||||
Debug::log( 'Controller initiated: ' . __METHOD__ . '.' );
|
||||
self::$title = 'Blog Post';
|
||||
// I removed this once because i didn't realize.
|
||||
// this triggers the comment post controller method when the comment form is submitted on the post viewing page
|
||||
|
||||
if ( Input::exists( 'contentId' ) ) {
|
||||
$this->comments( 'post', Input::post( 'contentId' ) );
|
||||
}
|
||||
|
||||
Components::set( 'CONTENT_ID', $id );
|
||||
Components::set( 'COMMENT_TYPE', 'blog' );
|
||||
if ( App::$isLoggedIn ) {
|
||||
Components::set( 'NEWCOMMENT', Views::simpleView( 'comments.create' ) );
|
||||
} else {
|
||||
Components::set( 'COMMENT_TYPE', self::$posts->tableName );
|
||||
|
||||
$plugin = new Comments;
|
||||
if ( ! $plugin->checkEnabled() ) {
|
||||
Components::set( 'NEWCOMMENT', '' );
|
||||
Components::set( 'count', '0' );
|
||||
Components::set( 'COMMENTS', '' );
|
||||
} else {
|
||||
$comments = new CommentsModel;
|
||||
if ( App::$isLoggedIn ) {
|
||||
Components::set( 'NEWCOMMENT', Views::simpleView( 'comments.create' ) );
|
||||
} else {
|
||||
Components::set( 'NEWCOMMENT', '' );
|
||||
}
|
||||
Components::set( 'count', $comments->count( self::$posts->tableName, $post->ID ) );
|
||||
Components::set( 'COMMENTS', Views::simpleView( 'comments.list', $comments->display( 10, self::$posts->tableName, $post->ID ) ) );
|
||||
}
|
||||
|
||||
$post = self::$posts->findById( $id );
|
||||
Components::set( 'count', self::$comments->count( self::$posts->tableName, $post->ID ) );
|
||||
Components::set( 'COMMENTS', Views::simpleView( 'comments.list', self::$comments->display( 10, self::$posts->tableName, $post->ID ) ) );
|
||||
|
||||
self::$title .= ' - ' . $post->title;
|
||||
self::$pageDescription = strip_tags( $post->contentSummaryNoLink );
|
||||
Views::view( 'blog.post', $post );
|
||||
|
@ -131,34 +131,34 @@ class Posts extends DatabaseModel {
|
||||
}
|
||||
$draft = '';
|
||||
$authorName = self::$user->getUsername( $instance->author );
|
||||
|
||||
$cleanPost = Sanitize::contentShort( $instance->content );
|
||||
$postSpace = explode( ' ', $cleanPost );
|
||||
$wordsArray = explode( ' ', $cleanPost );
|
||||
$postLine = explode( "\n", $cleanPost );
|
||||
// summary by words: 100
|
||||
$spaceSummary = implode( ' ', array_splice( $postSpace, 0, 100 ) );
|
||||
// summary by lines: 5
|
||||
$spaceSummary = implode( ' ', array_splice( $wordsArray, 0, 100 ) );
|
||||
$lineSummary = implode( "\n", array_splice( $postLine, 0, 5 ) );
|
||||
if ( strlen( $spaceSummary ) < strlen( $lineSummary ) ) {
|
||||
$contentSummaryNoLink = $spaceSummary;
|
||||
$contentSummary = $spaceSummary;
|
||||
if ( count( $postSpace, 1 ) <= 100 ) {
|
||||
if ( count( $wordsArray, 1 ) >= 100 ) {
|
||||
$contentSummaryNoLink = $contentSummary;
|
||||
$contentSummary .= '... <a href="{ROOT_URL}blog/post/' . $instance->ID . '">Read More</a>';
|
||||
$contentSummary .= '... <a href="{ROOT_URL}blog/post/' . $instance->ID . '" class="text-decoration-none">Read More</a>';
|
||||
}
|
||||
} else {
|
||||
// @todo: need to refine this after testing
|
||||
$contentSummaryNoLink = $lineSummary;
|
||||
$contentSummary = $lineSummary . '... <a href="{ROOT_URL}blog/post/' . $instance->ID . '">Read More</a>';
|
||||
$contentSummary = $lineSummary . '... <a href="{ROOT_URL}blog/post/' . $instance->ID . '" class="text-decoration-none">Read More</a>';
|
||||
}
|
||||
$instance->contentSummaryNoLink = $contentSummaryNoLink;
|
||||
$instance->contentSummary = $contentSummary;
|
||||
|
||||
if ( isset( $params['stripHtml'] ) && $params['stripHtml'] === true ) {
|
||||
$instance->contentSummary = strip_tags( $instance->content );
|
||||
}
|
||||
if ( $instance->draft != '0' ) {
|
||||
$draft = ' <b>Draft</b>';
|
||||
}
|
||||
$instance->isDraft = $draft;
|
||||
$instance->authorName = $authorName;
|
||||
$instance->contentSummaryNoLink = $contentSummaryNoLink;
|
||||
$instance->contentSummary = $contentSummary;
|
||||
if ( isset( $params['stripHtml'] ) && $params['stripHtml'] === true ) {
|
||||
$instance->contentSummary = strip_tags( $instance->content );
|
||||
}
|
||||
if ( self::$comments !== false ) {
|
||||
$instance->commentCount = self::$comments->count( 'blog', $instance->ID );
|
||||
}
|
||||
@ -221,9 +221,9 @@ class Posts extends DatabaseModel {
|
||||
$whereClause = '*';
|
||||
}
|
||||
if ( empty( $limit ) ) {
|
||||
$postData = self::$db->getPaginated( $this->tableName, $whereClause );
|
||||
$postData = self::$db->get( $this->tableName, $whereClause );
|
||||
} else {
|
||||
$postData = self::$db->getPaginated( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
|
||||
$postData = self::$db->get( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
|
||||
}
|
||||
if ( !$postData->count() ) {
|
||||
Debug::info( 'No Blog posts found.' );
|
||||
@ -239,7 +239,7 @@ class Posts extends DatabaseModel {
|
||||
} else {
|
||||
$whereClause = ['draft', '=', '0'];
|
||||
}
|
||||
$postData = self::$db->getPaginated( $this->tableName, $whereClause );
|
||||
$postData = self::$db->get( $this->tableName, $whereClause );
|
||||
if ( !$postData->count() ) {
|
||||
Debug::info( 'No Blog posts found.' );
|
||||
|
||||
@ -263,7 +263,7 @@ class Posts extends DatabaseModel {
|
||||
$firstDayUnix = date( 'U', strtotime( "first day of $year" ) );
|
||||
$lastDayUnix = date( 'U', strtotime( "last day of $year" ) );
|
||||
$whereClause = array_merge( $whereClause, ['created', '<=', $lastDayUnix, 'AND', 'created', '>=', $firstDayUnix] );
|
||||
$postData = self::$db->getPaginated( $this->tableName, $whereClause );
|
||||
$postData = self::$db->get( $this->tableName, $whereClause );
|
||||
if ( !$postData->count() ) {
|
||||
Debug::info( 'No Blog posts found.' );
|
||||
|
||||
@ -282,7 +282,7 @@ class Posts extends DatabaseModel {
|
||||
$whereClause = ['draft', '=', '0', 'AND'];
|
||||
}
|
||||
$whereClause = array_merge( $whereClause, ['author' => $ID] );
|
||||
$postData = self::$db->getPaginated( $this->tableName, $whereClause );
|
||||
$postData = self::$db->get( $this->tableName, $whereClause );
|
||||
if ( !$postData->count() ) {
|
||||
Debug::info( 'No Blog posts found.' );
|
||||
|
||||
@ -311,7 +311,7 @@ class Posts extends DatabaseModel {
|
||||
$month = date( 'F', $firstDayUnix );
|
||||
$lastDayUnix = date( 'U', strtotime( "last day of $month $year" ) );
|
||||
$whereClause = array_merge( $whereClause, ['created', '<=', $lastDayUnix, 'AND', 'created', '>=', $firstDayUnix] );
|
||||
$postData = self::$db->getPaginated( $this->tableName, $whereClause );
|
||||
$postData = self::$db->get( $this->tableName, $whereClause );
|
||||
if ( !$postData->count() ) {
|
||||
Debug::info( 'No Blog posts found.' );
|
||||
|
||||
|
@ -12,12 +12,7 @@
|
||||
*/
|
||||
namespace TheTempusProject\Plugins;
|
||||
|
||||
use ReflectionClass;
|
||||
use TheTempusProject\Classes\Installer;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Classes\Plugin;
|
||||
use TheTempusProject\Models\Posts;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
|
||||
class Blog extends Plugin {
|
||||
public $pluginName = 'TP Blog';
|
||||
@ -28,11 +23,11 @@ class Blog extends Plugin {
|
||||
public $pluginDescription = 'A simple plugin to add a blog to your installation.';
|
||||
public $admin_links = [
|
||||
[
|
||||
'text' => '<i class="glyphicon glyphicon-text-size"></i> Blog',
|
||||
'text' => '<i class="fa fa-fw fa-font"></i> Blog',
|
||||
'url' => '{ROOT_URL}admin/blog',
|
||||
],
|
||||
];
|
||||
public $footer_links = [
|
||||
public $info_footer_links = [
|
||||
[
|
||||
'text' => 'Blog',
|
||||
'url' => '{ROOT_URL}blog/index',
|
||||
@ -50,10 +45,4 @@ class Blog extends Plugin {
|
||||
],
|
||||
],
|
||||
];
|
||||
public $posts;
|
||||
|
||||
public function __construct( $load = false ) {
|
||||
$this->posts = new Posts;
|
||||
parent::__construct( $load );
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
namespace TheTempusProject\Templates;
|
||||
|
||||
use TheTempusProject\Plugins\Blog;
|
||||
use TheTempusProject\Models\Posts;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
@ -25,10 +25,11 @@ class BlogLoader extends DefaultLoader {
|
||||
* needed by this template.
|
||||
*/
|
||||
public function __construct() {
|
||||
$blog = new Blog;
|
||||
$posts = $blog->posts;
|
||||
$posts = new Posts;
|
||||
Components::set('SIDEBAR', Views::simpleView('blog.sidebar', $posts->recent(5)));
|
||||
Components::set('SIDEBAR2', Views::simpleView('blog.sidebar2', $posts->archive()));
|
||||
Components::set('SIDEBARABOUT', Views::simpleView('blog.about'));
|
||||
Components::set('BLOGFEATURES', '');
|
||||
Navigation::setCrumbComponent( 'BLOG_BREADCRUMBS', Input::get( 'url' ) );
|
||||
Components::set( 'BLOG_TEMPLATE_URL', Template::parse( '{ROOT_URL}app/plugins/comments/' ) );
|
||||
$this->addCss( '<link rel="stylesheet" href="{BLOG_TEMPLATE_URL}css/comments.css">' );
|
||||
|
@ -10,10 +10,10 @@
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta property="og:url" content="{CURRENT_URL}">
|
||||
<meta name='twitter:card' content='summary' />
|
||||
<meta name='twitter:card' content='summary_large_image'>
|
||||
<title>{TITLE}</title>
|
||||
<meta itemprop="name" content="{TITLE}">
|
||||
<meta name="twitter:title" content="{TITLE}">
|
||||
@ -28,84 +28,89 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="author" content="The Tempus Project">
|
||||
{ROBOT}
|
||||
<link rel="alternate" hreflang="en-us" href="alternateURL">
|
||||
<link rel="icon" href="{ROOT_URL}images/favicon.ico">
|
||||
<!-- Required CSS -->
|
||||
<link rel="stylesheet" href="{FONT_AWESOME_URL}font-awesome.min.css" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{BOOTSTRAP_CDN}css/bootstrap-theme.min.css" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.1/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer">
|
||||
<link rel="stylesheet" href="{BOOTSTRAP_CDN}css/bootstrap.min.css" crossorigin="anonymous">
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" href="{ROOT_URL}blog/rss" title="{TITLE} Feed" type="application/rss+xml" />
|
||||
<link rel="alternate" href="{ROOT_URL}blog/rss" title="{TITLE} Feed" type="application/rss+xml">
|
||||
<!-- Custom styles for this template -->
|
||||
{TEMPLATE_CSS_INCLUDES}
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
||||
<!--Brand and toggle should get grouped for better mobile display -->
|
||||
<div class="navbar-header">
|
||||
<a href="{ROOT_URL}" class="navbar-brand">{SITENAME}</a>
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse" style="">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="collapse navbar-collapse navbar-ex1-collapse">
|
||||
<!-- Navigation -->
|
||||
<header class="p-3 text-bg-dark">
|
||||
<div class="container">
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
|
||||
<img src="{ROOT_URL}{LOGO}" class="bi me-2" width="40" height="32" role="img" aria-label="{SITENAME} Logo">
|
||||
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
|
||||
{SITENAME}
|
||||
</a>
|
||||
{topNavLeft}
|
||||
<div class="navbar-right">
|
||||
<ul class="nav navbar-nav">
|
||||
{topNavRight}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container-fluid">
|
||||
<div class="foot-pad">
|
||||
<div class="text-end d-flex align-items-center">
|
||||
{topNavRight}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="d-flex flex-column min-vh-100">
|
||||
<div class="flex-container flex-grow-1">
|
||||
{ISSUES}
|
||||
<div class="row">
|
||||
<div class="container">
|
||||
<div class="container pt-4">
|
||||
<div class="row">
|
||||
{ERROR}
|
||||
{NOTICE}
|
||||
{SUCCESS}
|
||||
{INFO}
|
||||
</div>
|
||||
</div>
|
||||
{/ISSUES}
|
||||
<div class="row">
|
||||
|
||||
<!-- Leading Content -->
|
||||
<div class="container">
|
||||
{BLOGFEATURES}
|
||||
</div>
|
||||
|
||||
<div class="pt-4">
|
||||
<div class="container">
|
||||
<div class="page-header">
|
||||
<h1 class="blog-title">{SITENAME} Blog</h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-8 blog-main">
|
||||
{BLOG_BREADCRUMBS}
|
||||
<h3 class="pb-4 mb-4 fst-italic border-bottom">
|
||||
{SITENAME} Blog
|
||||
</h3>
|
||||
<div class="row g-5">
|
||||
<!-- Main Content -->
|
||||
<div class="col-md-8">
|
||||
{CONTENT}
|
||||
</div>
|
||||
<!-- /.blog-main -->
|
||||
<div class="col-sm-3 col-sm-offset-1 blog-sidebar">
|
||||
<div class="sidebar-module">
|
||||
{SIDEBAR}
|
||||
</div>
|
||||
<div class="sidebar-module">
|
||||
{SIDEBAR2}
|
||||
<!-- Sidebar Content -->
|
||||
<div class="col-md-4">
|
||||
<div class="position-sticky" style="top: 2rem;">
|
||||
<div class="p-4">
|
||||
{SIDEBARABOUT}
|
||||
</div>
|
||||
<div class="p-4">
|
||||
{SIDEBAR}
|
||||
</div>
|
||||
<div class="p-4">
|
||||
{SIDEBAR2}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.blog-sidebar -->
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
{FOOT}
|
||||
{COPY}
|
||||
</footer>
|
||||
</div>
|
||||
<!-- Bootstrap core JavaScript and jquery -->
|
||||
<script src="{JQUERY_CDN}jquery.min.js" crossorigin="anonymous"></script>
|
||||
<script src="{BOOTSTRAP_CDN}js/bootstrap.min.js" crossorigin="anonymous"></script>
|
||||
<script language="JavaScript" crossorigin="anonymous" type="text/javascript" src="{JQUERY_CDN}jquery.min.js"></script>
|
||||
<script language="JavaScript" crossorigin="anonymous" type="text/javascript" src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script language="JavaScript" crossorigin="anonymous" type="text/javascript" src="{BOOTSTRAP_CDN}js/bootstrap.min.js"></script>
|
||||
<!-- Custom javascript for this template -->
|
||||
{TEMPLATE_JS_INCLUDES}
|
||||
</body>
|
||||
|
6
app/plugins/blog/views/about.html
Normal file
6
app/plugins/blog/views/about.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="p-4 mb-3 rounded context-main-bg">
|
||||
<h4 class="fst-italic">About</h4>
|
||||
<p class="mb-0">
|
||||
The blog is mostly here to serve ass a simple way to link to long-form content on the site. There won't be any breaking news or tell-all stories here. Just good ole fashioned boring crap no one wants to read.
|
||||
</p>
|
||||
</div>
|
@ -1,31 +1,47 @@
|
||||
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
|
||||
<legend>New Blog Post</legend>
|
||||
<div class="form-group">
|
||||
<label for="title" class="col-lg-3 control-label">Title</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="text" class="form-check-input" name="title" id="title">
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Add Blog Post</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="" method="post">
|
||||
<fieldset>
|
||||
<!-- Title -->
|
||||
<div class="mb-3 row">
|
||||
<label for="title" class="col-lg-3 col-form-label text-end">Title:</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="text" class="form-control" name="title" id="title" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- form buttons -->
|
||||
<div class="mb-3 row">
|
||||
<div class="offset-3 col-lg-6">
|
||||
<div class="btn-group w-100">
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" onclick="insertTag ('blogPost', 'c');">✔</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" onclick="insertTag ('blogPost', 'x');">✖</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" onclick="insertTag ('blogPost', '!');">❕</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" onclick="insertTag ('blogPost', '?');">❔</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Message -->
|
||||
<div class="mb-3 row">
|
||||
<label for="blogPost" class="col-lg-3 col-form-label text-end">Post:</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="blogPost" id="blogPost" rows="6" maxlength="2000" required></textarea>
|
||||
<small class="form-text text-muted">Max: 2000 characters</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden Token -->
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
</fieldset>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="text-center">
|
||||
<button name="submit" value="publish" type="submit" class="mx-2 btn btn-lg btn-primary">Publish</button>
|
||||
<button name="submit" value="saveDraft" type="submit" class="mx-2 btn btn-lg btn-primary">Save as Draft</button>
|
||||
<button name="submit" value="preview" type="submit" class="mx-2 btn btn-lg btn-primary">Preview</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-6 col-lg-offset-3 btn-group">
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="insertTag ('blogPost', 'c');">✔</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="insertTag ('blogPost', 'x');">✖</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="insertTag ('blogPost', '!');">❕</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="insertTag ('blogPost', '?');">❔</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="blogPost" class="col-lg-3 control-label">Post</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="blogPost" maxlength="2000" rows="10" cols="50" id="blogPost"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-6 col-lg-offset-3">
|
||||
<button name="submit" value="publish" type="submit" class="btn btn-lg btn-primary">Publish</button>
|
||||
<button name="submit" value="saveDraft" type="submit" class="btn btn-lg btn-primary">Save as Draft</button>
|
||||
<button name="submit" value="preview" type="submit" class="btn btn-lg btn-primary">Preview</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
@ -1,5 +1,5 @@
|
||||
<legend>New Posts</legend>
|
||||
<table class="table table-striped">
|
||||
<table class="table context-main">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20%"></th>
|
||||
@ -14,9 +14,9 @@
|
||||
<tr>
|
||||
<td>{title}</td>
|
||||
<td>{contentSummary}</td>
|
||||
<td><a href="{ROOT_URL}admin/blog/view/{ID}" class="btn btn-sm btn-primary" role="button"><i class="glyphicon glyphicon-open"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/blog/edit/{ID}" class="btn btn-sm btn-warning" role="button"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
<td width="30px"><a href="{ROOT_URL}admin/blog/delete/{ID}" class="btn btn-sm btn-danger" role="button"><i class="glyphicon glyphicon-trash"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/blog/view/{ID}" class="btn btn-sm btn-primary"><i class="fa fa-fw fa-upload"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/blog/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
|
||||
<td width="30px"><a href="{ROOT_URL}admin/blog/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
|
@ -1,31 +1,47 @@
|
||||
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
|
||||
<legend>Edit Blog Post</legend>
|
||||
<div class="form-group">
|
||||
<label for="title" class="col-lg-3 control-label">Title</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="text" class="form-check-input" name="title" id="title" value="{title}">
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Edit Blog Post</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="" method="post">
|
||||
<fieldset>
|
||||
<!-- Title -->
|
||||
<div class="mb-3 row">
|
||||
<label for="title" class="col-lg-3 col-form-label text-end">Title:</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="text" class="form-control" name="title" id="title" value="{title}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- form buttons -->
|
||||
<div class="mb-3 row">
|
||||
<div class="offset-3 col-lg-6">
|
||||
<div class="btn-group w-100">
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" onclick="insertTag ('blogPost', 'c');">✔</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" onclick="insertTag ('blogPost', 'x');">✖</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" onclick="insertTag ('blogPost', '!');">❕</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" onclick="insertTag ('blogPost', '?');">❔</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Message -->
|
||||
<div class="mb-3 row">
|
||||
<label for="blogPost" class="col-lg-3 col-form-label text-end">Post:</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="blogPost" id="blogPost" rows="6" maxlength="2000" required>{content}</textarea>
|
||||
<small class="form-text text-muted">Max: 2000 characters</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden Token -->
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
</fieldset>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="text-center">
|
||||
<button name="submit" value="publish" type="submit" class="mx-2 btn btn-lg btn-primary">Publish</button>
|
||||
<button name="submit" value="saveDraft" type="submit" class="mx-2 btn btn-lg btn-primary">Save as Draft</button>
|
||||
<button name="submit" value="preview" type="submit" class="mx-2 btn btn-lg btn-primary">Preview</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-6 col-lg-offset-3 btn-group">
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="insertTag ('blogPost', 'c');">✔</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="insertTag ('blogPost', 'x');">✖</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="insertTag ('blogPost', '!');">❕</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="insertTag ('blogPost', '?');">❔</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="blogPost" class="col-lg-3 control-label">Post</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="blogPost" maxlength="2000" rows="10" cols="50" id="blogPost">{content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-6 col-lg-offset-3">
|
||||
<button name="submit" value="publish" type="submit" class="btn btn-lg btn-primary">Publish</button>
|
||||
<button name="submit" value="saveDraft" type="submit" class="btn btn-lg btn-primary">Save as Draft</button>
|
||||
<button name="submit" value="preview" type="submit" class="btn btn-lg btn-primary">Preview</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
@ -1,45 +1,48 @@
|
||||
<legend>Blog Posts</legend>
|
||||
{PAGINATION}
|
||||
<form action="{ROOT_URL}admin/blog/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">Title</th>
|
||||
<th style="width: 20%">Author</th>
|
||||
<th style="width: 10%">comments</th>
|
||||
<th style="width: 10%">Created</th>
|
||||
<th style="width: 10%">Updated</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 10%">
|
||||
<INPUT type="checkbox" onchange="checkAll(this)" name="check.b" value="B_[]"/>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td><a href="{ROOT_URL}admin/blog/view/{ID}">{title}</a>{isDraft}</td>
|
||||
<td>{authorName}</td>
|
||||
<td>{commentCount}</td>
|
||||
<td>{DTC}{created}{/DTC}</td>
|
||||
<td>{DTC}{edited}{/DTC}</td>
|
||||
<td><a href="{ROOT_URL}admin/blog/edit/{ID}" class="btn btn-sm btn-warning" role="button"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/blog/delete/{ID}" class="btn btn-sm btn-danger" role="button"><i class="glyphicon glyphicon-trash"></i></a></td>
|
||||
<td>
|
||||
<input type="checkbox" value="{ID}" name="B_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
No results to show.
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="{ROOT_URL}admin/blog/create" class="btn btn-sm btn-primary" role="button">Create</a>
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger">Delete</button>
|
||||
</form>
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Blog Posts</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="{ROOT_URL}admin/blog/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">Title</th>
|
||||
<th style="width: 20%">Author</th>
|
||||
<th style="width: 10%">comments</th>
|
||||
<th style="width: 10%">Created</th>
|
||||
<th style="width: 10%">Updated</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 10%">
|
||||
<input type="checkbox" onchange="checkAll(this)" name="check.b" value="B_[]">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td><a href="{ROOT_URL}admin/blog/view/{ID}">{title}</a>{isDraft}</td>
|
||||
<td>{authorName}</td>
|
||||
<td>{commentCount}</td>
|
||||
<td>{DTC}{created}{/DTC}</td>
|
||||
<td>{DTC}{edited}{/DTC}</td>
|
||||
<td><a href="{ROOT_URL}admin/blog/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/blog/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="B_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
No results to show.
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="{ROOT_URL}admin/blog/create" class="btn btn-sm btn-primary">Create</a>
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
|
||||
</form>
|
||||
</div>
|
@ -1,11 +1,14 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-8 blog-main">
|
||||
<div class="page-header">
|
||||
<h1>{title} <small>{DTC}{created}{/DTC} by <a href="{ROOT_URL}admin/users/view/{author}">{authorName}</a></small></h1>
|
||||
</div>
|
||||
<div class="well">{content}</div>
|
||||
<a href="{ROOT_URL}admin/blog/delete/{ID}" class="btn btn-md btn-danger" role="button">Delete</a>
|
||||
<a href="{ROOT_URL}admin/blog/edit/{ID}" class="btn btn-md btn-warning" role="button">Edit</a>
|
||||
<a href="{ROOT_URL}admin/comments/blog/{ID}" class="btn btn-md btn-primary" role="button">View Comments</a>
|
||||
</div><!-- /.blog-main -->
|
||||
</div><!-- /.row -->
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Blog Post: {title}</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}admin/users/view/{author}">{authorName}</a></p>
|
||||
<div class="well">{content}</div>
|
||||
{ADMIN}
|
||||
<hr>
|
||||
<a href="{ROOT_URL}admin/blog/delete/{ID}" class="btn btn-md btn-danger"><i class="fa fa-fw fa-trash"></i></a>
|
||||
<a href="{ROOT_URL}admin/blog/edit/{ID}" class="btn btn-md btn-warning"><i class="fa fa-fw fa-pencil"></i></a>
|
||||
<a href="{ROOT_URL}admin/comments/blog/{ID}" class="btn btn-md btn-primary">View Comments</a>
|
||||
<hr>
|
||||
{/ADMIN}
|
||||
</div>
|
7
app/plugins/blog/views/largeFeature.html
Normal file
7
app/plugins/blog/views/largeFeature.html
Normal file
@ -0,0 +1,7 @@
|
||||
<div class="p-4 p-md-5 mb-4 rounded text-bg-dark">
|
||||
<div class="col-md-6 px-0">
|
||||
<h1 class="display-4 fst-italic">Title of a longer featured blog post</h1>
|
||||
<p class="lead my-3">Multiple lines of text that form the lede, informing new readers quickly and efficiently about what’s most interesting in this post’s contents.</p>
|
||||
<p class="lead mb-0"><a href="#" class="text-white fw-bold">Continue reading...</a></p>
|
||||
</div>
|
||||
</div>
|
@ -1,18 +1,15 @@
|
||||
{PAGINATION}
|
||||
{LOOP}
|
||||
<div class="blog-post">
|
||||
<h2 class="blog-post-title"><a href="{ROOT_URL}blog/post/{ID}">{title}</a></h2>
|
||||
<hr>
|
||||
<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>
|
||||
<div class="well">
|
||||
<p class="blog-post-meta">
|
||||
Posted on <i>{DTC date}{created}{/DTC}</i> by <a href="{ROOT_URL}home/profile/{author}"><strong>{authorName}</strong></a>
|
||||
</p>
|
||||
{contentSummary}
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<hr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<div class="blog-post">
|
||||
<article class="blog-post">
|
||||
<p class="blog-post-meta">No Posts Found.</p>
|
||||
</div>
|
||||
</article>
|
||||
{/ALT}
|
||||
|
@ -3,12 +3,12 @@
|
||||
<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}">{authorName}</a></p>
|
||||
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{author}" class="text-decoration-none">{authorName}</a></p>
|
||||
{content}
|
||||
{ADMIN}
|
||||
<hr>
|
||||
<a href="{ROOT_URL}admin/blog/delete/{ID}" class="btn btn-md btn-danger" role="button">Delete</a>
|
||||
<a href="{ROOT_URL}admin/blog/edit/{ID}" class="btn btn-md btn-warning" role="button">Edit</a>
|
||||
<a href="{ROOT_URL}admin/blog/delete/{ID}" class="btn btn-md btn-danger"><i class="fa fa-fw fa-trash"></i></a>
|
||||
<a href="{ROOT_URL}admin/blog/edit/{ID}" class="btn btn-md btn-warning"><i class="fa fa-fw fa-pencil"></i></a>
|
||||
<hr>
|
||||
{/ADMIN}
|
||||
</div><!-- /.blog-post -->
|
||||
|
@ -1,6 +1,6 @@
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Recent Posts</h3>
|
||||
<div class="card">
|
||||
<div class="card-header bg-info">
|
||||
<h3 class="card-title">Recent Posts</h3>
|
||||
</div>
|
||||
<ul class="list-group">
|
||||
{LOOP}
|
||||
|
@ -1,18 +1,18 @@
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Recent Posts</h3>
|
||||
<div class="card context-main-bg">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Recent Posts</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="card-body">
|
||||
<ol class="list-unstyled">
|
||||
{LOOP}
|
||||
<li><a href="{ROOT_URL}blog/post/{ID}">{title}</a></li>
|
||||
<li><a href="{ROOT_URL}blog/post/{ID}" class="text-decoration-none">{title}</a></li>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<li>No Posts to show</li>
|
||||
{/ALT}
|
||||
</ol>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<a href="{ROOT_URL}blog">View All</a>
|
||||
<div class="card-footer">
|
||||
<a href="{ROOT_URL}blog" class="text-decoration-none">View All</a>
|
||||
</div>
|
||||
</div>
|
@ -1,14 +1,11 @@
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Archives</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<ol class="list-unstyled">
|
||||
{LOOP}
|
||||
<li>({count}) <a href="{ROOT_URL}blog/month/{month}/{year}">{monthText} {year}</a></li>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
{/ALT}
|
||||
</ol>
|
||||
</div>
|
||||
<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>
|
31
app/plugins/blog/views/smallFeature.html
Normal file
31
app/plugins/blog/views/smallFeature.html
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-6">
|
||||
<div class="row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
|
||||
<div class="col p-4 d-flex flex-column position-static">
|
||||
<strong class="d-inline-block mb-2 text-primary">World</strong>
|
||||
<h3 class="mb-0">Featured post</h3>
|
||||
<div class="mb-1 text-muted">Nov 12</div>
|
||||
<p class="card-text mb-auto">This is a wider card with supporting text below as a natural lead-in to additional content.</p>
|
||||
<a href="#" class="stretched-link">Continue reading</a>
|
||||
</div>
|
||||
<div class="col-auto d-none d-lg-block">
|
||||
<svg class="bd-placeholder-img" width="200" height="250" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
|
||||
<div class="col p-4 d-flex flex-column position-static">
|
||||
<strong class="d-inline-block mb-2 text-success">Design</strong>
|
||||
<h3 class="mb-0">Post title</h3>
|
||||
<div class="mb-1 text-muted">Nov 11</div>
|
||||
<p class="mb-auto">This is a wider card with supporting text below as a natural lead-in to additional content.</p>
|
||||
<a href="#" class="stretched-link">Continue reading</a>
|
||||
</div>
|
||||
<div class="col-auto d-none d-lg-block">
|
||||
<svg class="bd-placeholder-img" width="200" height="250" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -41,7 +41,7 @@ class Bugreport extends Controller {
|
||||
return Views::view( 'bugreport.create' );
|
||||
}
|
||||
$result = self::$bugreport->create( App::$activeUser->ID, Input::post( 'url' ), Input::post( 'ourl' ), Input::post( 'repeat' ), Input::post( 'entry' ) );
|
||||
if ( true === $result ) {
|
||||
if ( false != $result ) {
|
||||
Session::flash( 'success', 'Your Bug Report has been received. We may contact you for more information at the email address you provided.' );
|
||||
Redirect::to( 'home/index' );
|
||||
} else {
|
||||
|
@ -13,7 +13,6 @@
|
||||
namespace TheTempusProject\Models;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Classes\Config;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Canary\Classes\CustomException;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
|
@ -49,10 +49,11 @@ class Bugreport extends Plugin {
|
||||
'default' => false,
|
||||
],
|
||||
];
|
||||
public $footer_links = [
|
||||
public $contact_footer_links = [
|
||||
[
|
||||
'text' => 'Bug Report',
|
||||
'url' => '{ROOT_URL}bugreport',
|
||||
'filter' => 'loggedin',
|
||||
],
|
||||
];
|
||||
public $admin_links = [
|
||||
|
@ -1,42 +1,45 @@
|
||||
<legend>Bug Reports</legend>
|
||||
{PAGINATION}
|
||||
<form action="{ROOT_URL}admin/bugreport/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%">ID</th>
|
||||
<th style="width: 20%">Time</th>
|
||||
<th style="width: 60%">Description</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%">
|
||||
<INPUT type="checkbox" onchange="checkAll(this)" name="check.br" value="BR_[]"/>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td align="center">{ID}</td>
|
||||
<td align="center">{DTC}{time}{/DTC}</td>
|
||||
<td>{description}</td>
|
||||
<td><a href="{ROOT_URL}admin/bugreport/view/{ID}" class="btn btn-sm btn-primary" role="button"><i class="glyphicon glyphicon-open"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/bugreport/delete/{ID}" class="btn btn-sm btn-danger" role="button"><i class="glyphicon glyphicon-trash"></i></a></td>
|
||||
<td>
|
||||
<input type="checkbox" value="{ID}" name="BR_[]">
|
||||
</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">Delete</button>
|
||||
</form>
|
||||
<br />
|
||||
<a href="{ROOT_URL}admin/bugreport/clear">clear all</a>
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Bug Reports</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="{ROOT_URL}admin/bugreport/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%">ID</th>
|
||||
<th style="width: 20%">Time</th>
|
||||
<th style="width: 60%">Description</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%">
|
||||
<input type="checkbox" onchange="checkAll(this)" name="check.br" value="BR_[]">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td align="center">{ID}</td>
|
||||
<td align="center">{DTC}{time}{/DTC}</td>
|
||||
<td>{description}</td>
|
||||
<td><a href="{ROOT_URL}admin/bugreport/view/{ID}" class="btn btn-sm btn-primary"><i class="fa fa-fw fa-upload"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/bugreport/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="BR_[]">
|
||||
</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>
|
||||
<br>
|
||||
<a href="{ROOT_URL}admin/bugreport/clear">clear all</a>
|
||||
</div>
|
@ -1,64 +1,69 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xs-offset-0 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 top-pad" >
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Bug Report</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class=" col-md-12 col-lg-12 ">
|
||||
<table class="table table-user-primary">
|
||||
<tbody>
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<div class="card shadow">
|
||||
<!-- Card Header -->
|
||||
<div class="card-header text-center bg-dark text-white">
|
||||
<h3 class="card-title mb-0">Bug Report</h3>
|
||||
</div>
|
||||
|
||||
<!-- Card Body -->
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
<!-- Log Details -->
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">ID:</th>
|
||||
<td>{ID}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" width="200"><b>ID</b></td>
|
||||
<td align="right">{ID}</td>
|
||||
<th scope="row">Time submitted</th>
|
||||
<td>{DTC}{time}{/DTC}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Time submitted</b></td>
|
||||
<td align="right">{DTC}{time}{/DTC}</td>
|
||||
<th scope="row">URL:</th>
|
||||
<td><a href="{URL}">{URL}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Submitted by</b></td>
|
||||
<td align="right"><a href="{ROOT_URL}admin/users/view/{userID}">{submittedBy}</a></td>
|
||||
<th scope="row">Original URL</th>
|
||||
<td><a href="{OURL}">{OURL}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>IP</b></td>
|
||||
<td align="right">{ip}</td>
|
||||
<th scope="row">Multiple occurrences?</th>
|
||||
<td>{repeatText}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">IP:</th>
|
||||
<td>{ip}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">User:</th>
|
||||
<td><a href="{ROOT_URL}admin/users/view/{userID}">{submittedBy}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>URL:</b></td>
|
||||
<td align="right"><a href="{URL}">{URL}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Original URL</b></td>
|
||||
<td align="right"><a href="{OURL}">{OURL}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Multiple occurrences?</b></td>
|
||||
<td align="right">{repeatText}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="2"><b>Description</b></td>
|
||||
<th scope="row" colspan="2">Description:</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{description}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Admin Controls -->
|
||||
<div class="card-footer text-center">
|
||||
{ADMIN}
|
||||
<form action="{ROOT_URL}admin/bugreport/delete" method="post">
|
||||
<INPUT type="hidden" name="BR_" value="{ID}"/>
|
||||
<input type="hidden" name="token" value="{TOKEN}" />
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="glyphicon glyphicon-remove"></i></button>
|
||||
<input type="hidden" name="BR_" value="{ID}">
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
|
||||
</form>
|
||||
{/ADMIN}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,36 +1,52 @@
|
||||
<legend>Bug Report</legend>
|
||||
<p>Thank you for visiting Our bug reporting page. We value our users' input highly and in an effort to better serve your needs, please fill out the form below to help us address this issue.</p>
|
||||
<p>We read each and every bug report submitted, and by submitting this form you allow us to send you a follow up email.</p>
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
<label for="url">Page you were trying to reach:</label>
|
||||
<input type="url" name="url" id="url" class="form-control" aria-describedby="urlHelp">
|
||||
<p id="urlHelp" class="form-text text-muted">
|
||||
What is the URL of the page you actually received the error on? (The URL is the website address. Example: {ROOT_URL}home)
|
||||
</p>
|
||||
<label for="ourl">Page you were on:</label>
|
||||
<input type="url" name="ourl" id="ourl" class="form-control" aria-describedby="ourlHelp">
|
||||
<p id="ourlHelp" class="form-text text-muted">
|
||||
What is the URL of the page you were on before you received the error? (The URL is the website address. Example: {ROOT_URL}home/newhome)
|
||||
</p>
|
||||
<label for="repeat">*Has this happened more than once?</label>
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="radio" name="repeat" id="repeat" value="false" checked>
|
||||
No
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="radio" name="repeat" id="repeat" value="true">
|
||||
Yes
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="entry" class="col-lg-3 control-label">Describe the problem/error as best as you can: (max:2000 characters)</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="entry" maxlength="2000" rows="10" cols="50" id="entry"></textarea>
|
||||
<div class="col-8 mx-auto p-4 rounded shadow-sm mb-5 context-main-bg mt-4 container">
|
||||
<h2 class="text-center mb-4">Bug Report</h2>
|
||||
<hr>
|
||||
<p>Thank you for visiting our bug reporting page. We value our users' input highly and in an effort to better serve your needs, please fill out the form below to help us address this issue.</p>
|
||||
<p>We read each and every bug report submitted, and by submitting this form you allow us to send you a follow-up email.</p>
|
||||
<form action="" method="post">
|
||||
<!-- Page URL -->
|
||||
<div class="mb-3">
|
||||
<label for="url" class="form-label">Page you were trying to reach:</label>
|
||||
<input type="url" name="url" id="url" class="form-control" aria-describedby="urlHelp" required>
|
||||
<small id="urlHelp" class="form-text text-muted">
|
||||
What is the URL of the page you actually received the error on? (The URL is the website address. Example: {ROOT_URL}home)
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Submit</button>
|
||||
</form>
|
||||
|
||||
<!-- Referrer URL -->
|
||||
<div class="mb-3">
|
||||
<label for="ourl" class="form-label">Page you were on:</label>
|
||||
<input type="url" name="ourl" id="ourl" class="form-control" aria-describedby="ourlHelp">
|
||||
<small id="ourlHelp" class="form-text text-muted">
|
||||
What is the URL of the page you were on before you received the error? (The URL is the website address. Example: {ROOT_URL}home/newhome)
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<!-- Repeat Issue -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">*Has this happened more than once?</label>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="repeat" id="repeatNo" value="false" checked>
|
||||
<label class="form-check-label" for="repeatNo">No</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="repeat" id="repeatYes" value="true">
|
||||
<label class="form-check-label" for="repeatYes">Yes</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Description -->
|
||||
<div class="mb-3">
|
||||
<label for="entry" class="form-label">Describe the problem/error as best as you can: (max: 2000 characters)</label>
|
||||
<textarea class="form-control" name="entry" id="entry" rows="6" maxlength="2000" required></textarea>
|
||||
</div>
|
||||
|
||||
<!-- Hidden Token -->
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="text-center">
|
||||
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
@ -49,9 +49,13 @@ class Comments extends AdminController {
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function viewComment( $data = null ) {
|
||||
$commentData = self::$comments->findById( $data );
|
||||
if ( $commentData !== false ) {
|
||||
public function viewComments( $contentID = null ) {
|
||||
if ( empty( $contentID ) ) {
|
||||
Issues::add( 'error', 'Content ID not found.' );
|
||||
return $this->index();
|
||||
}
|
||||
$contentData = self::$comments->findById( $data );
|
||||
if ( empty( $contentID ) ) {
|
||||
return Views::view( 'comments.list', $commentData );
|
||||
}
|
||||
Issues::add( 'error', 'Comment not found.' );
|
||||
|
@ -170,7 +170,7 @@ class Comments extends DatabaseModel {
|
||||
$where = ['contentType', '=', $contentType];
|
||||
}
|
||||
if ( empty( $limit ) ) {
|
||||
$commentData = self::$db->getPaginated( $this->tableName, $where, 'created', 'DESC' );
|
||||
$commentData = self::$db->get( $this->tableName, $where, 'created', 'DESC' );
|
||||
} else {
|
||||
$commentData = self::$db->get( $this->tableName, $where, 'created', 'DESC', [0, $limit] );
|
||||
}
|
||||
|
@ -25,9 +25,10 @@ use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Hermes\Functions\Redirect;
|
||||
use TheTempusProject\Bedrock\Functions\Session;
|
||||
use TheTempusProject\Models\Comments as CommentModel;
|
||||
use TheTempusProject\Models\Comments as CommentsModel;
|
||||
|
||||
class Comments extends Plugin {
|
||||
protected static $comments;
|
||||
public $pluginName = 'TP Comments';
|
||||
public $pluginAuthor = 'JoeyK';
|
||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
||||
@ -61,7 +62,6 @@ class Comments extends Plugin {
|
||||
]
|
||||
],
|
||||
];
|
||||
public $comments;
|
||||
|
||||
public function __construct( $load = false ) {
|
||||
if ( !empty(App::$activePerms) ) {
|
||||
@ -75,11 +75,16 @@ class Comments extends Plugin {
|
||||
'replace' => ( App::$isMod ? '$1' : '' ),
|
||||
'enabled' => true,
|
||||
];
|
||||
$this->getModel();
|
||||
self::$comments = new CommentsModel;
|
||||
parent::__construct( $load );
|
||||
}
|
||||
|
||||
public function formPost( $type, $content, $redirect ) {
|
||||
if ( ! $this->checkEnabled() ) {
|
||||
Debug::info( 'Comments Plugin is disabled in the control panel.' );
|
||||
Issues::add( 'error', 'Comments are disabled.' );
|
||||
return false;
|
||||
}
|
||||
if ( !App::$isLoggedIn ) {
|
||||
Session::flash( 'notice', 'You must be logged in to post comments.' );
|
||||
return Redirect::to( $redirect . $content->ID );
|
||||
@ -88,7 +93,7 @@ class Comments extends Plugin {
|
||||
Session::flash( 'error', [ 'There was a problem with your comment form.' => Check::userErrors() ] );
|
||||
return Redirect::to( $redirect . $content->ID );
|
||||
}
|
||||
if ( !$this->comments->create( $type, $content->ID, Input::post( 'comment' ) ) ) {
|
||||
if ( !self::$comments->create( $type, $content->ID, Input::post( 'comment' ) ) ) {
|
||||
Session::flash( 'error', [ 'There was a problem posting your comment.' => Check::userErrors() ] );
|
||||
} else {
|
||||
Session::flash( 'success', 'Comment posted' );
|
||||
@ -97,6 +102,11 @@ class Comments extends Plugin {
|
||||
}
|
||||
|
||||
public function formEdit( $type, $content, $redirect ) {
|
||||
if ( ! $this->checkEnabled() ) {
|
||||
Debug::info( 'Comments Plugin is disabled in the control panel.' );
|
||||
Issues::add( 'error', 'Comments are disabled.' );
|
||||
return false;
|
||||
}
|
||||
if ( !App::$isLoggedIn ) {
|
||||
Session::flash( 'notice', 'You must be logged in to do that.' );
|
||||
return Redirect::to( $type );
|
||||
@ -112,7 +122,7 @@ class Comments extends Plugin {
|
||||
Issues::add( 'error', [ 'There was a problem editing your comment.' => Check::userErrors() ] );
|
||||
return Views::view( 'comments.admin.edit', $content );
|
||||
}
|
||||
if ( !$this->comments->update( $content->ID, Input::post( 'comment' ) ) ) {
|
||||
if ( !self::$comments->update( $content->ID, Input::post( 'comment' ) ) ) {
|
||||
Issues::add( 'error', [ 'There was a problem editing your comment.' => Check::userErrors() ] );
|
||||
return Views::view( 'comments.admin.edit', $content );
|
||||
}
|
||||
@ -121,6 +131,11 @@ class Comments extends Plugin {
|
||||
}
|
||||
|
||||
public function formDelete( $type, $content, $redirect ) {
|
||||
if ( ! $this->checkEnabled() ) {
|
||||
Debug::info( 'Comments Plugin is disabled in the control panel.' );
|
||||
Issues::add( 'error', 'Comments are disabled.' );
|
||||
return false;
|
||||
}
|
||||
if ( !App::$isLoggedIn ) {
|
||||
Session::flash( 'notice', 'You must be logged in to do that.' );
|
||||
return Redirect::to( $type );
|
||||
@ -129,18 +144,11 @@ class Comments extends Plugin {
|
||||
Session::flash( 'error', 'You do not have permission to edit this comment' );
|
||||
return Redirect::to( $type );
|
||||
}
|
||||
if ( !$this->comments->delete( (array) $content->ID ) ) {
|
||||
if ( !self::$comments->delete( (array) $content->ID ) ) {
|
||||
Session::flash( 'error', 'There was an error with your request.' );
|
||||
} else {
|
||||
Session::flash( 'success', 'Comment has been deleted' );
|
||||
}
|
||||
return Redirect::to( $redirect . $content->contentID );
|
||||
}
|
||||
|
||||
public function getModel() {
|
||||
if ( empty($this->comments) ) {
|
||||
$this->comments = new CommentModel;
|
||||
}
|
||||
return $this->comments;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<legend>New Comments</legend>
|
||||
<table class="table table-striped">
|
||||
<table class="table context-main">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20%"></th>
|
||||
@ -13,8 +13,8 @@
|
||||
<tr>
|
||||
<td>{authorName}</td>
|
||||
<td>{content}</td>
|
||||
<td><a href="{ROOT_URL}admin/comments/edit/{ID}" class="btn btn-sm btn-warning" role="button"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/comments/delete/{ID}" class="btn btn-sm btn-danger" role="button"><i class="glyphicon glyphicon-trash"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/comments/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/comments/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
|
@ -1,9 +1,25 @@
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
<div class="form-group center-block">
|
||||
<div class="col-lg-4 col-lg-offset-4">
|
||||
<textarea class="form-control" name="comment" maxlength="2000" rows="10" cols="50" id="comment">{content}</textarea>
|
||||
</div>
|
||||
<div class="mb-4 mt-4">
|
||||
<div class="offset-md-1 col-10 p-3 context-main-bg">
|
||||
<legend class="text-center">Edit Comment</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="" method="post" class="container py-4">
|
||||
<fieldset>
|
||||
<div class="mb-3 row">
|
||||
<label for="comment" class="col-lg-5 col-form-label text-end">Comment:</label>
|
||||
<div class="col-lg-3">
|
||||
<textarea class="form-control" name="comment" maxlength="2000" rows="5" cols="50" id="comment">{content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden Token -->
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="text-center">
|
||||
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg">Save</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Comment</button>
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
</form>
|
||||
</div>
|
@ -1,43 +1,45 @@
|
||||
<legend>Recent Comments</legend>
|
||||
{PAGINATION}
|
||||
<form action="{ROOT_URL}admin/comments/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20%">Author</th>
|
||||
<th style="width: 20%">Subject</th>
|
||||
<th style="width: 35%">Comment</th>
|
||||
<th style="width: 10%">Time</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%">
|
||||
<INPUT type="checkbox" onchange="checkAll(this)" name="check.c" value="C_[]"/>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td><a href="{ROOT_URL}admin/users/view/{author}">{authorName}</a></td>
|
||||
<td><a href="{ROOT_URL}admin/blog/view/{contentID}">{contentTitle}</a></td>
|
||||
<td>{content}</td>
|
||||
<td>{DTC}{created}{/DTC}</td>
|
||||
<td><a href="{ROOT_URL}admin/comments/edit/{ID}" class="btn btn-sm btn-warning" role="button"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/comments/delete/{ID}" class="btn btn-sm btn-danger" role="button"><i class="glyphicon glyphicon-trash"></i></a></td>
|
||||
<td>
|
||||
<input type="checkbox" value="{ID}" name="C_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td align="center" colspan="7">
|
||||
No results to show.
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger">Delete</button>
|
||||
</form>
|
||||
<br />
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Recent Comments</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="{ROOT_URL}admin/comments/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20%">Author</th>
|
||||
<th style="width: 20%">Subject</th>
|
||||
<th style="width: 35%">Comment</th>
|
||||
<th style="width: 10%">Time</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%">
|
||||
<input type="checkbox" onchange="checkAll(this)" name="check.c" value="C_[]">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td><a href="{ROOT_URL}admin/users/view/{author}">{authorName}</a></td>
|
||||
<td><a href="{ROOT_URL}admin/blog/view/{contentID}">{contentTitle}</a></td>
|
||||
<td>{content}</td>
|
||||
<td>{DTC}{created}{/DTC}</td>
|
||||
<td><a href="{ROOT_URL}admin/comments/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/comments/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="C_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td align="center" colspan="7">
|
||||
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>
|
@ -1,8 +1,8 @@
|
||||
<div class="action">
|
||||
<a href="{ROOT_URL}{COMMENT_TYPE}/comments/edit/{ID}" class="btn btn-warning btn-xs" role="button">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
<a href="{ROOT_URL}{COMMENT_TYPE}/comments/edit/{ID}" class="btn btn-warning btn-sm">
|
||||
<span class="fa fa-fw fa-pencil"></span>
|
||||
</a>
|
||||
<a href="{ROOT_URL}{COMMENT_TYPE}/comments/delete/{ID}" class="btn btn-danger btn-xs" role="button">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
<a href="{ROOT_URL}{COMMENT_TYPE}/comments/delete/{ID}" class="btn btn-danger btn-sm">
|
||||
<span class="fa fa-fw fa-trash"></span>
|
||||
</a>
|
||||
</div>
|
@ -1,10 +1,14 @@
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
<div class="form-group center-block">
|
||||
<div class="col-lg-8 col-lg-offset-2">
|
||||
<textarea class="form-control" name="comment" maxlength="2000" rows="4" cols="50" id="comment"></textarea>
|
||||
</div>
|
||||
<form action="" method="post" class="text-center mx-auto mt-4" style="max-width: 600px;">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
class="form-control"
|
||||
name="comment"
|
||||
maxlength="2000"
|
||||
rows="4"
|
||||
id="comment"
|
||||
placeholder="Write your comment here..."></textarea>
|
||||
</div>
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Comment</button>
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary mb-3">Comment</button>
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<input type="hidden" name="contentId" value="{CONTENT_ID}">
|
||||
</form>
|
||||
</form>
|
||||
|
@ -1,22 +1,23 @@
|
||||
<div class="panel panel-info widget comments">
|
||||
<div class="panel-heading">
|
||||
<span class="glyphicon glyphicon-comment"></span>
|
||||
<h3 class="panel-title">Comments</h3>
|
||||
<span class="label label-primary">{count}</span>
|
||||
<div class="card">
|
||||
<div class="card-header d-flex align-items-center justify-content-between context-second-bg context-main">
|
||||
<h3 class="card-title mb-0">
|
||||
<i class="fa fa-fw fa-comment"></i> Comments
|
||||
</h3>
|
||||
<span class="badge bg-primary">{count}</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<ul class="list-group">
|
||||
<div class="card-body context-main-bg context-main">
|
||||
<ul class="list-group list-group-flush">
|
||||
{LOOP}
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-xs-2 col-md-1">
|
||||
<img src="{ROOT_URL}{avatar}" class="img-circle img-responsive" alt="" />
|
||||
<li class="list-group-item context-second-bg context-main mb-2">
|
||||
<div class="d-flex align-items-start">
|
||||
<div class="me-3">
|
||||
<img src="{ROOT_URL}{avatar}" class="rounded-circle" alt="User Avatar" style="width: 50px; height: 50px;">
|
||||
</div>
|
||||
<div class="col-xs-10 col-md-11">
|
||||
<div>
|
||||
<div class="mic-info">
|
||||
By: <a href="{ROOT_URL}home/profile/{author}">{authorName}</a> on {DTC date}{created}{/DTC}
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb-1">
|
||||
<small class="text-muted">
|
||||
By: <a href="{ROOT_URL}home/profile/{author}" class="text-decoration-none">{authorName}</a> on {DTC date}{created}{/DTC}
|
||||
</small>
|
||||
</div>
|
||||
<div class="comment-text">
|
||||
{content}
|
||||
@ -27,13 +28,9 @@
|
||||
</li>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-md-11">
|
||||
<div class="comment-text">
|
||||
<p class="text-center">Be the first to comment.</p>
|
||||
</div>
|
||||
</div>
|
||||
<li class="list-group-item context-second-bg context-main mb-2">
|
||||
<div class="text-center">
|
||||
<p class="mb-0">Be the first to comment.</p>
|
||||
</div>
|
||||
</li>
|
||||
{/ALT}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/feedback/controllers/admin/feedback.php
|
||||
* app/plugins/contact/controllers/admin/contact.php
|
||||
*
|
||||
* This is the feedback admin controller.
|
||||
* This is the contact admin controller.
|
||||
*
|
||||
* @package TP Feedback
|
||||
* @package TP Contact
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
@ -18,29 +18,29 @@ use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Classes\AdminController;
|
||||
use TheTempusProject\Models\Feedback as FeedbackModel;
|
||||
use TheTempusProject\Models\Contact as ContactModel;
|
||||
|
||||
class Feedback extends AdminController {
|
||||
protected static $feedback;
|
||||
class Contact extends AdminController {
|
||||
protected static $contact;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
self::$title = 'Admin - Feedback';
|
||||
self::$feedback = new FeedbackModel;
|
||||
$view = Navigation::activePageSelect( 'nav.admin', '/admin/feedback' );
|
||||
self::$title = 'Admin - Contact';
|
||||
self::$contact = new ContactModel;
|
||||
$view = Navigation::activePageSelect( 'nav.admin', '/admin/contact' );
|
||||
Components::set( 'ADMINNAV', $view );
|
||||
}
|
||||
|
||||
public function view( $id = null ) {
|
||||
Views::view( 'feedback.admin.view', self::$feedback->findById( $id ) );
|
||||
Views::view( 'contact.admin.view', self::$contact->findById( $id ) );
|
||||
}
|
||||
|
||||
public function delete( $data = null ) {
|
||||
if ( Input::exists( 'submit' ) ) {
|
||||
$data = Input::post( 'F_' );
|
||||
}
|
||||
if ( self::$feedback->delete( (array) $data ) ) {
|
||||
Issues::add( 'success', 'feedback deleted' );
|
||||
if ( self::$contact->delete( (array) $data ) ) {
|
||||
Issues::add( 'success', 'contact deleted' );
|
||||
} else {
|
||||
Issues::add( 'error', 'There was an error with your request.' );
|
||||
}
|
||||
@ -48,11 +48,11 @@ class Feedback extends AdminController {
|
||||
}
|
||||
|
||||
public function clear( $data = null ) {
|
||||
self::$feedback->clear();
|
||||
self::$contact->clear();
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function index( $data = null ) {
|
||||
Views::view( 'feedback.admin.list', self::$feedback->listPaginated() );
|
||||
Views::view( 'contact.admin.list', self::$contact->listPaginated() );
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/feedback/controllers/feedback.php
|
||||
* app/plugins/contact/controllers/contact.php
|
||||
*
|
||||
* This is the home controller for the feedback plugin.
|
||||
* This is the home controller for the contact plugin.
|
||||
*
|
||||
* @package TP Feedback
|
||||
* @package TP Contact
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
@ -20,25 +20,25 @@ use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Functions\Session;
|
||||
use TheTempusProject\Hermes\Functions\Redirect;
|
||||
use TheTempusProject\Models\Feedback as FeedbackModel;
|
||||
use TheTempusProject\Models\Contact as ContactModel;
|
||||
|
||||
class Feedback extends Controller {
|
||||
protected static $feedback;
|
||||
class Contact extends Controller {
|
||||
protected static $contact;
|
||||
|
||||
public function index() {
|
||||
self::$feedback = new FeedbackModel;
|
||||
self::$title = 'Feedback - {SITENAME}';
|
||||
self::$pageDescription = 'At {SITENAME}, we value our users\' input. You can provide any feedback or suggestions using this form.';
|
||||
self::$contact = new ContactModel;
|
||||
self::$title = 'Contact - {SITENAME}';
|
||||
self::$pageDescription = 'At {SITENAME}, we value our users\' input. You can provide any contact or suggestions using this form.';
|
||||
if ( !Input::exists() ) {
|
||||
return Views::view( 'feedback.feedback' );
|
||||
return Views::view( 'contact.create' );
|
||||
}
|
||||
if ( !Forms::check( 'feedback' ) ) {
|
||||
if ( !Forms::check( 'contact' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your form, please check your submission and try again.' => Check::userErrors() ] );
|
||||
return Views::view( 'feedback.feedback' );
|
||||
return Views::view( 'contact.create' );
|
||||
}
|
||||
$result = self::$feedback->create( Input::post( 'name' ), Input::post( 'feedbackEmail' ), Input::post( 'entry' ) );
|
||||
$result = self::$contact->create( Input::post( 'name' ), Input::post( 'contactEmail' ), Input::post( 'entry' ) );
|
||||
if ( $result ) {
|
||||
Session::flash( 'success', 'Thank you! Your feedback has been received.' );
|
||||
Session::flash( 'success', 'Thank you! Your contact has been received.' );
|
||||
Redirect::to( 'home/index' );
|
||||
} else {
|
||||
Issues::add( 'error', [ 'There was an error with your form, please check your submission and try again.' => Check::userErrors() ] );
|
@ -1,35 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/feedback/forms.php
|
||||
* app/plugins/contact/forms.php
|
||||
*
|
||||
* This houses all of the form checking functions for this plugin.
|
||||
*
|
||||
* @package TP Feedback
|
||||
* @package TP Contact
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Plugins\Feedback;
|
||||
namespace TheTempusProject\Plugins\Contact;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
|
||||
class FeedbackForms extends Forms {
|
||||
class ContactForms extends Forms {
|
||||
/**
|
||||
* Adds these functions to the form list.
|
||||
*/
|
||||
public function __construct() {
|
||||
self::addHandler( 'feedback', __CLASS__, 'feedback' );
|
||||
self::addHandler( 'contact', __CLASS__, 'contact' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the feedback form.
|
||||
* Validates the contact form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function feedback() {
|
||||
public static function contact() {
|
||||
if ( !Input::exists( 'name' ) ) {
|
||||
Check::addUserError( 'You must provide a name.' );
|
||||
return false;
|
||||
@ -38,12 +38,12 @@ class FeedbackForms extends Forms {
|
||||
Check::addUserError( 'Invalid name.' );
|
||||
return false;
|
||||
}
|
||||
if ( !empty( Input::post( 'feedbackEmail' ) ) && !Check::email( Input::post( 'feedbackEmail' ) ) ) {
|
||||
if ( !empty( Input::post( 'contactEmail' ) ) && !Check::email( Input::post( 'contactEmail' ) ) ) {
|
||||
Check::addUserError( 'Invalid Email.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'entry' ) == '' ) {
|
||||
Check::addUserError( 'Feedback cannot be empty.' );
|
||||
Check::addUserError( 'Contact cannot be empty.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Check::token() ) {
|
||||
@ -53,4 +53,4 @@ class FeedbackForms extends Forms {
|
||||
}
|
||||
}
|
||||
|
||||
new FeedbackForms;
|
||||
new ContactForms;
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/feedback/models/feedback.php
|
||||
* app/plugins/contact/models/contact.php
|
||||
*
|
||||
* This class is used for the manipulation of the feedback database table.
|
||||
*
|
||||
* @todo make this send a confirmation email
|
||||
*
|
||||
* @package TP Feedback
|
||||
* @package TP Contact
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
@ -14,13 +14,12 @@
|
||||
*/
|
||||
namespace TheTempusProject\Models;
|
||||
|
||||
use TheTempusProject\Bedrock\Classes\Config;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
use TheTempusProject\Plugins\Feedback as Plugin;
|
||||
use TheTempusProject\Plugins\Contact as Plugin;
|
||||
|
||||
class Feedback extends DatabaseModel {
|
||||
class Contact extends DatabaseModel {
|
||||
public $tableName = 'feedback';
|
||||
public $databaseMatrix = [
|
||||
[ 'name', 'varchar', '128' ],
|
||||
@ -40,7 +39,7 @@ class Feedback extends DatabaseModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a feedback form to the db.
|
||||
* Saves a contact form to the db.
|
||||
*
|
||||
* @param string $name -the name on the form
|
||||
* @param string $email -the email provided
|
||||
@ -49,7 +48,7 @@ class Feedback extends DatabaseModel {
|
||||
*/
|
||||
public function create( $name, $email, $feedback ) {
|
||||
if ( !$this->plugin->checkEnabled() ) {
|
||||
Debug::info( 'Feedback is disabled in the config.' );
|
||||
Debug::info( 'Contact is disabled in the config.' );
|
||||
return false;
|
||||
}
|
||||
$fields = [
|
||||
@ -60,14 +59,14 @@ class Feedback extends DatabaseModel {
|
||||
'ip' => $_SERVER['REMOTE_ADDR'],
|
||||
];
|
||||
if ( !self::$db->insert( $this->tableName, $fields ) ) {
|
||||
Debug::info( 'Feedback::create - failed to insert to db' );
|
||||
Debug::info( 'Contact::create - failed to insert to db' );
|
||||
return false;
|
||||
}
|
||||
return self::$db->lastId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to clear feedback from the DB.
|
||||
* Function to clear contact from the DB.
|
||||
*
|
||||
* @todo is there a way i could check for success here I'm pretty sure this is just a bad idea?
|
||||
* @return bool
|
||||
@ -77,8 +76,8 @@ class Feedback extends DatabaseModel {
|
||||
self::$log = new Log;
|
||||
}
|
||||
self::$db->delete( $this->tableName, ['ID', '>=', '0'] );
|
||||
self::$log->admin( 'Cleared Feedback' );
|
||||
Debug::info( 'Feedback Cleared' );
|
||||
self::$log->admin( 'Contacts Cleared' );
|
||||
Debug::info( 'Contacts Cleared' );
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/feedback/plugin.php
|
||||
* app/plugins/contact/plugin.php
|
||||
*
|
||||
* This houses all of the main plugin info and functionality.
|
||||
*
|
||||
* @package TP Feedback
|
||||
* @package TP Contact
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
@ -14,18 +14,18 @@ namespace TheTempusProject\Plugins;
|
||||
|
||||
use TheTempusProject\Classes\Plugin;
|
||||
|
||||
class Feedback extends Plugin {
|
||||
public $pluginName = 'TP Feedback';
|
||||
class Contact extends Plugin {
|
||||
public $pluginName = 'TP Contact';
|
||||
public $pluginAuthor = 'JoeyK';
|
||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
||||
public $modelVersion = '1.0';
|
||||
public $pluginVersion = '3.0';
|
||||
public $pluginDescription = 'A simple plugin which adds a form and management for user submitted feedback.';
|
||||
public $configName = 'feedback';
|
||||
public $pluginDescription = 'A simple plugin which adds a form and management for user submitted contact forms.';
|
||||
public $configName = 'contact';
|
||||
public $configMatrix = [
|
||||
'enabled' => [
|
||||
'type' => 'radio',
|
||||
'pretty' => 'Enable User Feedback.',
|
||||
'pretty' => 'Enable User Contact.',
|
||||
'default' => true,
|
||||
],
|
||||
'sendEmail' => [
|
||||
@ -36,25 +36,25 @@ class Feedback extends Plugin {
|
||||
'emailTemplate' => [
|
||||
'type' => 'text',
|
||||
'pretty' => 'Email Template',
|
||||
'default' => 'feedbackEmail',
|
||||
'default' => 'contactEmail',
|
||||
],
|
||||
];
|
||||
public $permissionMatrix = [
|
||||
'feedback' => [
|
||||
'pretty' => 'Can Submit Feedback',
|
||||
'default' => false,
|
||||
'contact' => [
|
||||
'pretty' => 'Can Submit Contact',
|
||||
'default' => true,
|
||||
],
|
||||
];
|
||||
public $footer_links = [
|
||||
public $contact_footer_links = [
|
||||
[
|
||||
'text' => 'Feedback',
|
||||
'url' => '{ROOT_URL}feedback',
|
||||
'text' => 'Contact',
|
||||
'url' => '{ROOT_URL}contact',
|
||||
],
|
||||
];
|
||||
public $admin_links = [
|
||||
[
|
||||
'text' => '<i class="fa fa-fw fa-support"></i> Feedback',
|
||||
'url' => '{ROOT_URL}admin/feedback',
|
||||
'text' => '<i class="fa fa-fw fa-briefcase"></i> Contact',
|
||||
'url' => '{ROOT_URL}admin/contact',
|
||||
],
|
||||
];
|
||||
}
|
45
app/plugins/contact/views/admin/list.html
Normal file
45
app/plugins/contact/views/admin/list.html
Normal file
@ -0,0 +1,45 @@
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Contact Forms</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="{ROOT_URL}admin/contact/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%">ID</th>
|
||||
<th style="width: 25%">Time</th>
|
||||
<th style="width: 55%">Feedback</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%">
|
||||
<input type="checkbox" onchange="checkAll(this)" name="check.f" value="F_[]">
|
||||
</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>
|
||||
<td>
|
||||
<input type="checkbox" value="{ID}" name="F_[]">
|
||||
</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>
|
||||
<br>
|
||||
<a href="{ROOT_URL}admin/contact/clear">clear all</a>
|
||||
</div>
|
61
app/plugins/contact/views/admin/view.html
Normal file
61
app/plugins/contact/views/admin/view.html
Normal file
@ -0,0 +1,61 @@
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<div class="card shadow">
|
||||
<!-- Card Header -->
|
||||
<div class="card-header text-center bg-dark text-white">
|
||||
<h3 class="card-title mb-0">Contact Form</h3>
|
||||
</div>
|
||||
|
||||
<!-- Card Body -->
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
<!-- Log Details -->
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">ID:</th>
|
||||
<td>{ID}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Time submitted</th>
|
||||
<td>{DTC}{time}{/DTC}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Email:</th>
|
||||
<td>{email}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Name:</th>
|
||||
<td>{name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">IP:</th>
|
||||
<td>{ip}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" colspan="2">Feedback:</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{feedback}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Admin Controls -->
|
||||
<div class="card-footer text-center">
|
||||
{ADMIN}
|
||||
<form action="{ROOT_URL}admin/contact/delete" method="post">
|
||||
<input type="hidden" name="F_" value="{ID}">
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
|
||||
</form>
|
||||
{/ADMIN}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
45
app/plugins/contact/views/create.html
Normal file
45
app/plugins/contact/views/create.html
Normal file
@ -0,0 +1,45 @@
|
||||
<div class="context-main-bg container py-4 my-4">
|
||||
<h2 class="text-center mb-4">Contact Us</h2>
|
||||
<div class="col-lg-6 offset-md-3">
|
||||
<p>
|
||||
Here at <strong>{SITENAME}</strong>, we highly value your feedback. We constantly strive to provide our users with the highest level of quality in everything we do.
|
||||
</p>
|
||||
<p>
|
||||
If you would like to provide any suggestions or comments on our service, we ask that you please fill out the quick form below and let us know what's on your mind.
|
||||
</p>
|
||||
</div>
|
||||
<form action="" method="post">
|
||||
<!-- Name -->
|
||||
<div class="mb-3 row">
|
||||
<label for="name" class="col-lg-3 col-form-label text-end">Name:</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="text" class="form-control" name="name" id="name" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Email (Optional) -->
|
||||
<div class="mb-3 row">
|
||||
<label for="contactEmail" class="col-lg-3 col-form-label text-end">E-mail: (optional)</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="email" class="form-control" name="contactEmail" id="contactEmail">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Feedback -->
|
||||
<div class="mb-3 row">
|
||||
<label for="entry" class="col-lg-3 col-form-label text-end">Feedback:</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="entry" id="entry" rows="6" maxlength="2000" required></textarea>
|
||||
<small class="form-text text-muted">Max: 2000 characters</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden Token -->
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="text-center">
|
||||
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
@ -1,42 +0,0 @@
|
||||
<legend>Feedback</legend>
|
||||
{PAGINATION}
|
||||
<form action="{ROOT_URL}admin/feedback/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%">ID</th>
|
||||
<th style="width: 25%">Time</th>
|
||||
<th style="width: 55%">Feedback</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%">
|
||||
<INPUT type="checkbox" onchange="checkAll(this)" name="check.f" value="F_[]"/>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td>{ID}</td>
|
||||
<td>{DTC}{time}{/DTC}</td>
|
||||
<td>{feedback}</td>
|
||||
<td><a href="{ROOT_URL}admin/feedback/view/{ID}" class="btn btn-sm btn-primary" role="button"><i class="glyphicon glyphicon-open"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/feedback/delete/{ID}" class="btn btn-sm btn-danger" role="button"><i class="glyphicon glyphicon-trash"></i></a></td>
|
||||
<td>
|
||||
<input type="checkbox" value="{ID}" name="F_[]">
|
||||
</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">Delete</button>
|
||||
</form>
|
||||
<br />
|
||||
<a href="{ROOT_URL}admin/feedback/clear">clear all</a>
|
@ -1,56 +0,0 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xs-offset-0 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 top-pad" >
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Feedback</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class=" col-md-12 col-lg-12 ">
|
||||
<table class="table table-user-primary">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" width="200">ID:</td>
|
||||
<td align="right">{ID}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Time submitted:</td>
|
||||
<td align="right">{DTC}{time}{/DTC}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IP:</td>
|
||||
<td align="right">{ip}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email:</td>
|
||||
<td align="right">{email}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td align="right">{name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="2">Feedback</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{feedback}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
{ADMIN}
|
||||
<form action="{ROOT_URL}admin/feedback/delete" method="post">
|
||||
<INPUT type="hidden" name="F_" value="{ID}"/>
|
||||
<input type="hidden" name="token" value="{TOKEN}" />
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="glyphicon glyphicon-remove"></i></button>
|
||||
</form>
|
||||
{/ADMIN}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,27 +0,0 @@
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
<legend>Feedback</legend>
|
||||
<p>Here at {SITENAME} we highly value your feedback. We constantly strive to provide our users with the highest level of quality in everything we do.</p>
|
||||
<p>If you would like to provide any suggestions or comments on our service, we ask that you please fill out the quick form below and let us know what's on your mind.</p>
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-lg-1 control-label">Name:</label>
|
||||
<div class="col-lg-2">
|
||||
<input class="form-control" type="text" name="name" id="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="feedbackEmail" class="col-lg-1 control-label">E-mail: (optional)</label>
|
||||
<div class="col-lg-2">
|
||||
<input class="form-control" type="text" name="feedbackEmail" id="feedbackEmail">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="entry" class="col-lg-3 control-label">Feedback:<br> (max:2000 characters)</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="entry" maxlength="2000" rows="10" cols="50" id="entry"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Submit</button><br>
|
||||
</form>
|
@ -61,7 +61,7 @@ class Message extends DatabaseModel {
|
||||
Debug::info( 'Invalid user ID' );
|
||||
return false;
|
||||
}
|
||||
$messageData = self::$db->getPaginated( $this->tableName, [ 'ID', '=', $parent ] );
|
||||
$messageData = self::$db->get( $this->tableName, [ 'ID', '=', $parent ] );
|
||||
if ( $messageData->count() == 0 ) {
|
||||
Debug::info( 'Message not found.' );
|
||||
return false;
|
||||
@ -71,7 +71,7 @@ class Message extends DatabaseModel {
|
||||
if ( $type !== null ) {
|
||||
$params = array_merge( $params, [ 'AND', $type, '=', $user ] );
|
||||
}
|
||||
$messageData = self::$db->getPaginated( $this->tableName, $params, 'ID', 'DESC', [ 0, 1 ] );
|
||||
$messageData = self::$db->get( $this->tableName, $params, 'ID', 'DESC', [ 0, 1 ] );
|
||||
if ( $messageData->count() != 0 ) {
|
||||
if ( $messageData->first()->recieverDeleted == 0 ) {
|
||||
$message = $messageData->first();
|
||||
@ -93,7 +93,7 @@ class Message extends DatabaseModel {
|
||||
Debug::info( 'Invalid ID' );
|
||||
return false;
|
||||
}
|
||||
$messageData = self::$db->getPaginated( $this->tableName, [ 'ID', '=', $id ] );
|
||||
$messageData = self::$db->get( $this->tableName, [ 'ID', '=', $id ] );
|
||||
if ( $messageData->count() == 0 ) {
|
||||
Debug::info( 'Message not found.' );
|
||||
return false;
|
||||
@ -122,7 +122,7 @@ class Message extends DatabaseModel {
|
||||
} else {
|
||||
$find = $message->ID;
|
||||
}
|
||||
$messageData = self::$db->getPaginated( $this->tableName, [ 'ID', '=', $find, 'OR', 'Parent', '=', $find ], 'ID', 'ASC' )->results();
|
||||
$messageData = self::$db->get( $this->tableName, [ 'ID', '=', $find, 'OR', 'Parent', '=', $find ], 'ID', 'ASC' )->results();
|
||||
Components::set( 'PID', $find );
|
||||
|
||||
if ( $markRead == true ) {
|
||||
@ -138,7 +138,7 @@ class Message extends DatabaseModel {
|
||||
$limit = 10;
|
||||
}
|
||||
$limit = [ 0, $limit ];
|
||||
$messageData = self::$db->getPaginated(
|
||||
$messageData = self::$db->get(
|
||||
$this->tableName,
|
||||
[
|
||||
'parent', '=', 0,
|
||||
@ -154,7 +154,7 @@ class Message extends DatabaseModel {
|
||||
$limit
|
||||
);
|
||||
if ( $messageData->count() == 0 ) {
|
||||
Debug::info( 'No messages found' );
|
||||
Debug::info( 'getInbox: No messages found' );
|
||||
return false;
|
||||
}
|
||||
$filters = [
|
||||
@ -175,7 +175,7 @@ class Message extends DatabaseModel {
|
||||
$limit = 10;
|
||||
}
|
||||
$limit = [ 0, $limit ];
|
||||
$messageData = self::$db->getPaginated(
|
||||
$messageData = self::$db->get(
|
||||
$this->tableName,
|
||||
[
|
||||
'parent', '=', 0,
|
||||
@ -187,7 +187,7 @@ class Message extends DatabaseModel {
|
||||
$limit
|
||||
);
|
||||
if ( $messageData->count() == 0 ) {
|
||||
Debug::info( 'No messages found' );
|
||||
Debug::info( 'getOutbox: No messages found' );
|
||||
return false;
|
||||
}
|
||||
$filters = [
|
||||
|
@ -20,7 +20,6 @@ use TheTempusProject\Houdini\Classes\Views;
|
||||
|
||||
class Messages extends Plugin {
|
||||
public $pluginName = 'TP Messages';
|
||||
public $configName = 'messages';
|
||||
public $pluginAuthor = 'JoeyK';
|
||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
||||
public $modelVersion = '1.0';
|
||||
@ -33,25 +32,24 @@ class Messages extends Plugin {
|
||||
],
|
||||
];
|
||||
private static $loaded = false;
|
||||
|
||||
public function __construct() {
|
||||
// This was taken directly from the main app
|
||||
// load the message template data as part of the template
|
||||
$messages = new Message;
|
||||
Components::set( 'MESSAGE_COUNT', $messages->unreadCount() );
|
||||
if ( $messages->unreadCount() > 0 ) {
|
||||
$messageBadge = Views::simpleView( 'messages.badge' );
|
||||
} else {
|
||||
$messageBadge = '';
|
||||
}
|
||||
Components::set( 'MBADGE', $messageBadge );
|
||||
if ( App::$isLoggedIn ) {
|
||||
Components::set( 'RECENT_MESSAGES', Views::simpleView( 'messages.nav.recentMessagesDropdown', $messages->getInbox( 5 ) ) );
|
||||
} else {
|
||||
Components::set( 'RECENT_MESSAGES', '' );
|
||||
}
|
||||
if ( ! self::$loaded ) {
|
||||
$messages = new Message;
|
||||
Components::set( 'MESSAGE_COUNT', $messages->unreadCount() );
|
||||
if ( $messages->unreadCount() > 0 ) {
|
||||
$messageBadge = Views::simpleView( 'messages.badge' );
|
||||
} else {
|
||||
$messageBadge = '';
|
||||
}
|
||||
Components::set( 'MBADGE', $messageBadge );
|
||||
if ( App::$isLoggedIn ) {
|
||||
Components::set( 'RECENT_MESSAGES', Views::simpleView( 'messages.nav.recentMessagesDropdown', $messages->getInbox( 5 ) ) );
|
||||
} else {
|
||||
Components::set( 'RECENT_MESSAGES', '' );
|
||||
}
|
||||
App::$topNavRight .= '{RECENT_MESSAGES}';
|
||||
App::$topNavRightDropdown .= '<li><a href="{ROOT_URL}messages"><i class="fa fa-fw fa-envelope"></i> Inbox {MBADGE}</a></li>';
|
||||
App::$topNavRightDropdown .= '<li><a href="{ROOT_URL}messages" class="dropdown-item"><i class="fa fa-fw fa-envelope"></i> Inbox {MBADGE}</a></li>';
|
||||
self::$loaded = true;
|
||||
}
|
||||
parent::__construct();
|
||||
|
@ -1,25 +1,57 @@
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
<legend>New Message</legend>
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label for="toUser" class="col-lg-1 control-label">To:</label>
|
||||
<div class="col-lg-2">
|
||||
<input class="form-control" type="text" name="toUser" id="toUser" value="{prepopuser}">
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-4">
|
||||
<form action="" method="post" class="needs-validation">
|
||||
<legend class="mb-4">New Message</legend>
|
||||
<fieldset>
|
||||
<!-- To User Field -->
|
||||
<div class="mb-3 row">
|
||||
<label for="toUser" class="col-sm-6 col-form-label">To:</label>
|
||||
<div class="col-sm-6">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="toUser"
|
||||
id="toUser"
|
||||
value="{prepopuser}"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Subject Field -->
|
||||
<div class="mb-3 row">
|
||||
<label for="subject" class="col-sm-6 col-form-label">Subject:</label>
|
||||
<div class="col-sm-6">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="subject"
|
||||
id="subject"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Message Field -->
|
||||
<div class="mb-3">
|
||||
<label for="message" class="form-label">Message:</label>
|
||||
<textarea
|
||||
class="form-control"
|
||||
name="message"
|
||||
id="message"
|
||||
rows="6"
|
||||
maxlength="2000"
|
||||
required></textarea>
|
||||
</div>
|
||||
</fieldset>
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button
|
||||
type="submit"
|
||||
name="submit"
|
||||
value="submit"
|
||||
class="btn btn-primary btn-lg">
|
||||
Send
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="subject" class="col-lg-1 control-label">Subject:</label>
|
||||
<div class="col-lg-2">
|
||||
<input class="form-control" type="text" name="subject" id="subject">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="entry" class="col-lg-3 control-label">Message:</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="message" maxlength="2000" rows="10" cols="50" id="message"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Send</button><br>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,14 +1,14 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xs-offset-0 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 top-pad" >
|
||||
<div class="panel panel-primary">
|
||||
<div class="col-sm-12 col-md-6 col-lg-6 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 top-pad" >
|
||||
<div class="card panel-primary">
|
||||
{LOOP}
|
||||
{SINGLE}
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{subject}</h3>
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">{subject}</h3>
|
||||
</div>
|
||||
{/SINGLE}
|
||||
<div class="panel-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-lg-3 " align="center">
|
||||
<a href="{ROOT_URL}home/profile/{userFrom}">{userFrom}</a><br>
|
||||
@ -23,10 +23,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<div class="card-footer">
|
||||
{ADMIN}
|
||||
{ID}
|
||||
<span class="pull-right">
|
||||
<span class="float-right">
|
||||
{DTC}{sent}{/DTC}
|
||||
</span>
|
||||
{/ADMIN}
|
||||
|
@ -1,14 +1,14 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xs-offset-0 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 top-pad" >
|
||||
<div class="panel panel-primary">
|
||||
<div class="col-sm-12 col-md-6 col-lg-6 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 top-pad" >
|
||||
<div class="card panel-primary">
|
||||
{LOOP}
|
||||
{SINGLE}
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{subject}</h3>
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">{subject}</h3>
|
||||
</div>
|
||||
{/SINGLE}
|
||||
<div class="panel-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-lg-3 " align="center">
|
||||
<a href="{ROOT_URL}home/profile/{userFrom}">{userFrom}</a><br>
|
||||
@ -23,10 +23,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<div class="card-footer">
|
||||
{ADMIN}
|
||||
{ID}
|
||||
<span class="pull-right">
|
||||
<span class="float-right">
|
||||
{DTC}{sent}{/DTC}
|
||||
</span>
|
||||
{/ADMIN}
|
||||
|
@ -1,6 +1,14 @@
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-envelope"></i>{MBADGE}</a>
|
||||
<ul class="dropdown-menu message-dropdown">
|
||||
<div class="dropdown nav-item mx-2">
|
||||
<a
|
||||
href="#"
|
||||
class="d-block dropdown-toggle nav-link"
|
||||
id="messagesDropdown"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
<i class="fa fa-fw fa-envelope"></i><span class="ml-3">{MBADGE}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu text-small" aria-labelledby="messagesDropdown">
|
||||
<li class="message-header">
|
||||
<div class="media">
|
||||
<div class="media-body text-center" style="padding-bottom: 10px; padding-top: 10px">
|
||||
@ -12,7 +20,7 @@
|
||||
<li class="message-preview">
|
||||
<a href="{ROOT_URL}messages/view/{ID}">
|
||||
<div class="media">
|
||||
<span class="pull-left">
|
||||
<span class="float-left">
|
||||
<img class="media-object avatar-round-40" src="{ROOT_URL}{fromAvatar}" alt="">
|
||||
</span>
|
||||
<div class="media-body">
|
||||
@ -35,7 +43,7 @@
|
||||
</li>
|
||||
{/ALT}
|
||||
<li class="message-footer text-center">
|
||||
<a href="{ROOT_URL}messages">Read All New Messages</a>
|
||||
<a href="{ROOT_URL}messages" class="dropdown-item">Read All New Messages</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
@ -45,7 +45,10 @@ class Notifications extends AdminController {
|
||||
}
|
||||
|
||||
public function create() {
|
||||
$select = Forms::getFormFieldHtml( 'groupSelect', 'User Group', 'select', 'All', self::$group->listGroupsSimple( true ) );
|
||||
$select = Forms::getSelectHtml(
|
||||
'groupSelect',
|
||||
self::$group->listGroupsSimple( true )
|
||||
);
|
||||
Components::set( 'groupSelect', $select );
|
||||
if ( ! Input::exists( 'submit' ) ) {
|
||||
return Views::view( 'notifications.admin.send' );
|
||||
|
@ -12,7 +12,6 @@
|
||||
*/
|
||||
namespace TheTempusProject\Models;
|
||||
|
||||
use TheTempusProject\Bedrock\Classes\Config;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
@ -74,12 +73,12 @@ class Notification extends DatabaseModel {
|
||||
'expiresAt', '<', time(),
|
||||
];
|
||||
if ( empty( $limit ) ) {
|
||||
$notifications = self::$db->getPaginated( $this->tableName, $whereClause );
|
||||
$notifications = self::$db->get( $this->tableName, $whereClause );
|
||||
} else {
|
||||
$notifications = self::$db->getPaginated( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
|
||||
$notifications = self::$db->get( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
|
||||
}
|
||||
if ( !$notifications->count() ) {
|
||||
Debug::info( 'No Notifications found.' );
|
||||
Debug::info( 'Notification:getByUser No Notifications found' );
|
||||
return false;
|
||||
}
|
||||
return $this->filter( $notifications->results() );
|
||||
@ -116,7 +115,7 @@ class Notification extends DatabaseModel {
|
||||
];
|
||||
if ( !self::$db->update( $this->tableName, $id, $fields ) ) {
|
||||
new CustomException( 'notificationDelete' );
|
||||
Debug::error( "Bookmarks: $id not updated" );
|
||||
Debug::error( "Notifications: $id not updated" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -131,8 +130,10 @@ class Notification extends DatabaseModel {
|
||||
}
|
||||
if ( $message->seenAt == 0 ) {
|
||||
$message->unseenBadge = Views::simpleView( 'notifications.unseenBadge' );
|
||||
$message->markReadLink = '<a href="{ROOT_URL}notifications/markRead/'.$message->ID.'" class="btn btn-sm btn-primary"><i class="fa-solid fa-fw fa-envelope-open"></i></a>';
|
||||
} else {
|
||||
$message->unseenBadge = '';
|
||||
$message->markReadLink = '';
|
||||
}
|
||||
$out[] = (object) $message;
|
||||
if ( !empty( $end ) ) {
|
||||
|
@ -20,7 +20,6 @@ use TheTempusProject\Houdini\Classes\Views;
|
||||
|
||||
class Notifications extends Plugin {
|
||||
public $pluginName = 'TP Notifications';
|
||||
public $configName = 'notifications';
|
||||
public $pluginAuthor = 'JoeyK';
|
||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
||||
public $modelVersion = '1.0';
|
||||
@ -34,7 +33,7 @@ class Notifications extends Plugin {
|
||||
];
|
||||
public $admin_links = [
|
||||
[
|
||||
'text' => '<i class="glyphicon glyphicon-bell"></i> Notify',
|
||||
'text' => '<i class="fa fa-fw fa-bell"></i> Notify',
|
||||
'url' => '{ROOT_URL}admin/notifications',
|
||||
],
|
||||
];
|
||||
@ -50,14 +49,14 @@ class Notifications extends Plugin {
|
||||
$messageBadge = '';
|
||||
}
|
||||
Components::set( 'NBADGE', $messageBadge );
|
||||
if ( App::$isLoggedIn ) {
|
||||
Components::set( 'recentNotifications', Views::simpleView( 'notifications.nav.recentNotificationsDropdown', $notifications->getByUser( 10 ) ) );
|
||||
} else {
|
||||
Components::set( 'recentNotifications', '' );
|
||||
}
|
||||
if ( ! self::$loaded ) {
|
||||
if ( App::$isLoggedIn ) {
|
||||
Components::set( 'recentNotifications', Views::simpleView( 'notifications.nav.recentNotificationsDropdown', $notifications->getByUser( 10 ) ) );
|
||||
} else {
|
||||
Components::set( 'recentNotifications', '' );
|
||||
}
|
||||
App::$topNavRight .= '{recentNotifications}';
|
||||
App::$topNavRightDropdown .= '<li><a href="{ROOT_URL}notifications"><i class="glyphicon glyphicon-bell"></i> Notifications {NBADGE}</a></li>';
|
||||
App::$topNavRightDropdown .= '<li><a href="{ROOT_URL}notifications" class="dropdown-item"><i class="fa fa-fw fa-bell"></i> Notifications {NBADGE}</a></li>';
|
||||
self::$loaded = true;
|
||||
}
|
||||
}
|
||||
|
@ -1,44 +1,62 @@
|
||||
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
|
||||
<legend>Send Notification</legend>
|
||||
<div class="form-group">
|
||||
{groupSelect}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="expiration" class="col-lg-3 control-label">Expiration </label>
|
||||
<div class="col-lg-3">
|
||||
<select id="expiration" name="expiration" class="form-control custom-select">
|
||||
<option value="0">forever</option>
|
||||
<option value="1800">30 Minutes</option>
|
||||
<option value="3600">60 Minutes</option>
|
||||
<option value="14400">4 hours</option>
|
||||
<option value="28800">8 hours</option>
|
||||
<option value="43200">12 hours</option>
|
||||
<option value="86400">24 hours</option>
|
||||
<option value="172800">2 days</option>
|
||||
<option value="259200">3 days</option>
|
||||
<option value="432000">5 days</option>
|
||||
<option value="604800">7 days</option>
|
||||
<option value="1209600">2 weeks</option>
|
||||
<option value="1814400">3 weeks</option>
|
||||
<option value="2419200">4 weeks</option>
|
||||
<option value="2592000">1 month</option>
|
||||
<option value="5184000">2 months</option>
|
||||
<option value="7776000">3 months</option>
|
||||
<option value="15552000">6 months</option>
|
||||
<option value="31536000">12 months</option>
|
||||
</select>
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Send Notification</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<!-- Group -->
|
||||
<div class="mb-3 row">
|
||||
<label for="groupSelect" class="col-lg-3 col-form-label text-end">Group:</label>
|
||||
<div class="col-lg-6">
|
||||
{groupSelect}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Recipients -->
|
||||
<div class="mb-3 row">
|
||||
<label for="expiration" class="col-lg-3 col-form-label text-end">Expiration:</label>
|
||||
<div class="col-lg-6">
|
||||
<select class="form-control" name="expiration" id="expiration">
|
||||
<option value="0">forever</option>
|
||||
<option value="1800">30 Minutes</option>
|
||||
<option value="3600">60 Minutes</option>
|
||||
<option value="14400">4 hours</option>
|
||||
<option value="28800">8 hours</option>
|
||||
<option value="43200">12 hours</option>
|
||||
<option value="86400">24 hours</option>
|
||||
<option value="172800">2 days</option>
|
||||
<option value="259200">3 days</option>
|
||||
<option value="432000">5 days</option>
|
||||
<option value="604800">7 days</option>
|
||||
<option value="1209600">2 weeks</option>
|
||||
<option value="1814400">3 weeks</option>
|
||||
<option value="2419200">4 weeks</option>
|
||||
<option value="2592000">1 month</option>
|
||||
<option value="5184000">2 months</option>
|
||||
<option value="7776000">3 months</option>
|
||||
<option value="15552000">6 months</option>
|
||||
<option value="31536000">12 months</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Notification -->
|
||||
<div class="mb-3 row">
|
||||
<label for="notification" class="col-lg-3 col-form-label text-end">Notification:</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="notification" id="notification" rows="6" maxlength="2000" required></textarea>
|
||||
<small class="form-text text-muted">Max: 2000 characters</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden Token -->
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
</fieldset>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="text-center">
|
||||
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg center-block">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="notification" class="col-lg-3 control-label">Notification</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="notification" maxlength="2000" rows="10" cols="50" id="notification"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-6 col-lg-offset-3">
|
||||
<button name="submit" value="publish" type="submit" class="btn btn-lg btn-primary">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
@ -1 +1 @@
|
||||
<span class="label label-danger">{notificationCount}</span>
|
||||
<span class="badge bg-danger rounded-pill">{notificationCount}</span>
|
@ -1,30 +1,38 @@
|
||||
{PAGINATION}
|
||||
<div class="row" style="margin-top: 30px; margin-bottom: 50px;">
|
||||
<form action="" method="post">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 90%">Notification</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr {unseenBadge}>
|
||||
<td>{notification}</td>
|
||||
<td><a href="{ROOT_URL}notifications/markRead/{ID}" class="btn btn-sm btn-primary" role="button"><i class="glyphicon glyphicon-open"></i></a></td>
|
||||
<td><a href="{ROOT_URL}notifications/delete/{ID}" class="btn btn-sm btn-danger" role="button"><i class="glyphicon glyphicon-trash"></i></a></td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
No Notifications
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<div class="col-8 mx-auto p-4 rounded shadow-sm context-main-bg my-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<legend class="text-center">Notifications</legend>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 90%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr {unseenBadge}>
|
||||
<td class=" context-main">{notification}</td>
|
||||
<td>
|
||||
{markReadLink}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{ROOT_URL}notifications/delete/{ID}" class="btn btn-sm btn-danger">
|
||||
<i class="fa fa-fw fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td colspan="7" class=" context-main">
|
||||
No Notifications
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,29 +1,41 @@
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-bell"></i>{NBADGE}</a>
|
||||
<ul class="dropdown-menu message-dropdown">
|
||||
<!-- Notifications Dropdown -->
|
||||
<div class="dropdown nav-item mx-2">
|
||||
<a
|
||||
href="#"
|
||||
class="d-flex align-items-center text-white text-decoration-none dropdown-toggle"
|
||||
id="notificationsDropdown"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
<i class="fa fa-fw fa-bell"></i><span class="ms-2">{NBADGE}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-dark dropdown-menu-end text-small shadow" aria-labelledby="notificationsDropdown">
|
||||
{LOOP}
|
||||
<li class="message-preview">
|
||||
<a href="{ROOT_URL}notifications">
|
||||
<!-- Notification Item -->
|
||||
<li>
|
||||
<a href="{ROOT_URL}notifications" class="dropdown-item">
|
||||
<div class="media">
|
||||
<div class="media-body">
|
||||
<p class="small text-muted"><i class="fa fa-clock-o"></i> {DTC}{createdAt}{/DTC}</p>
|
||||
{notification}
|
||||
<p class="small text-muted mb-1"><i class="fa fa-clock-o me-1"></i> {DTC}{createdAt}{/DTC}</p>
|
||||
<span>{notification}</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<li class="message-preview">
|
||||
<div class="media">
|
||||
<div class="media-body text-center" style="padding-bottom: 10px; padding-top: 10px">
|
||||
<h5 class="media-heading"><strong>No Notifications</strong></h5>
|
||||
</div>
|
||||
</div>
|
||||
<li class="px-3 text-center">
|
||||
<strong>No Notifications</strong>
|
||||
</li>
|
||||
{/ALT}
|
||||
<li class="message-footer text-center">
|
||||
<a href="{ROOT_URL}notifications">See All Notifications</a>
|
||||
<!-- Footer -->
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
<li>
|
||||
<a href="/notifications" class="dropdown-item text-center">
|
||||
See All Notifications
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
|
@ -38,14 +38,3 @@ class Redirects extends Plugin {
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
// as long as this is in the plugin constructor, it should happen before the controller and method loading
|
||||
// $routes = new RoutesModel;
|
||||
// $route = $routes->findByOriginalUrl( $url );
|
||||
// if ( false !== $route ) {
|
||||
// if ( 'internal' === $route->redirect_type ) {
|
||||
// $this->setUrl( $route->forwarded_url );
|
||||
// } else {
|
||||
// Redirect::external( $route->forwarded_url );
|
||||
// }
|
||||
// }
|
45
app/plugins/subscribe/plugin.php
Normal file
45
app/plugins/subscribe/plugin.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/subscribe/plugin.php
|
||||
*
|
||||
* This houses all of the main plugin info and functionality.
|
||||
*
|
||||
* @package TP Subscribe
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Plugins;
|
||||
|
||||
use ReflectionClass;
|
||||
use TheTempusProject\Classes\Installer;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Classes\Plugin;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
|
||||
class Subscribe extends Plugin {
|
||||
private static $loaded = false;
|
||||
public $pluginName = 'TP Subscribe';
|
||||
public $pluginAuthor = 'JoeyK';
|
||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
||||
public $modelVersion = '1.0';
|
||||
public $pluginVersion = '3.0';
|
||||
public $pluginDescription = 'A simple plugin to add a method for users to share their email.';
|
||||
public $admin_links = [
|
||||
[
|
||||
'text' => '<i class="fa fa-fw fa-address-book"></i> Subscriptions',
|
||||
'url' => '{ROOT_URL}admin/subscriptions',
|
||||
],
|
||||
];
|
||||
|
||||
public function __construct( $load = false ) {
|
||||
parent::__construct( $load );
|
||||
if ( ! self::$loaded ) {
|
||||
Components::append( 'FOOTER_RIGHT', Views::simpleView( 'subscribe.footer.right') );
|
||||
self::$loaded = true;
|
||||
}
|
||||
}
|
||||
}
|
24
app/plugins/subscribe/views/admin/add.html
Normal file
24
app/plugins/subscribe/views/admin/add.html
Normal file
@ -0,0 +1,24 @@
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Add Subscriber</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="" method="post">
|
||||
<fieldset>
|
||||
<!-- Subject -->
|
||||
<div class="mb-3 row">
|
||||
<label for="email" class="col-lg-5 col-form-label text-end">Email:</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="email" class="form-control" name="email" id="email" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden Token -->
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
</fieldset>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="text-center">
|
||||
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg center-block">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
40
app/plugins/subscribe/views/admin/list.html
Normal file
40
app/plugins/subscribe/views/admin/list.html
Normal file
@ -0,0 +1,40 @@
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Subscribers</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="{ROOT_URL}admin/subscriptions/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%">ID</th>
|
||||
<th style="width: 85%">email</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%">
|
||||
<input type="checkbox" onchange="checkAll(this)" name="check.s" value="S_[]">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td align="center">{ID}</td>
|
||||
<td>{EMAIL}</td>
|
||||
<td><a href="{ROOT_URL}admin/subscriptions/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="S_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td align="center" colspan="6">
|
||||
No results to show.
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="{ROOT_URL}admin/subscriptions/add" class="btn btn-sm btn-primary">Add</a>
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
|
||||
</form>
|
||||
</div>
|
@ -1,15 +1,11 @@
|
||||
|
||||
<div class="col-lg-3 text-center">
|
||||
<h3>Subscribe</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<div class="input-append newsletter-box">
|
||||
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal">
|
||||
<input type="email" class="full form-control" placeholder="Email" id="email" name="email" autocomplete="email" style="margin-bottom: 15px;">
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Subscribe</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="col-md-5 offset-md-1 mb-3 text-center">
|
||||
<h5 class="">Subscribe</h5>
|
||||
<div class="d-flex flex-column flex-sm-row gap-2 justify-content-center mx-auto">
|
||||
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal">
|
||||
<label for="email" class="visually-hidden">Email address</label>
|
||||
<input name="email" id="email" type="email" class="form-control my-2" placeholder="Email address" autocomplete="email">
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button class="btn btn-primary my-2 w-100" name="submit" value="submit" type="submit">Subscribe</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user