wip
This commit is contained in:
204
app/config/config.json
Normal file
204
app/config/config.json
Normal file
@ -0,0 +1,204 @@
|
||||
{
|
||||
"main":
|
||||
{
|
||||
"logo":
|
||||
{
|
||||
"type": "file",
|
||||
"pretty": "Site Logo (Used mostly in emails)",
|
||||
"default": "images/logo.png",
|
||||
"value": "images/logo.png"
|
||||
},
|
||||
"name":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Site Name",
|
||||
"default": "TTP Example",
|
||||
"value": "Joey Kimsey"
|
||||
},
|
||||
"template":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Default Site Template",
|
||||
"default": "default",
|
||||
"value": "default"
|
||||
},
|
||||
"tokenEnabled":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Enable CSRF Token for all forms.",
|
||||
"default": true,
|
||||
"value": true
|
||||
},
|
||||
"loginLimit":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Maximum Login Attempts per hour",
|
||||
"default": 5,
|
||||
"value": "5"
|
||||
}
|
||||
},
|
||||
"uploads":
|
||||
{
|
||||
"files":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Enable File Uploads",
|
||||
"default": true,
|
||||
"value": true
|
||||
},
|
||||
"images":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Enable Image Uploads",
|
||||
"default": true,
|
||||
"value": true
|
||||
},
|
||||
"maxFileSize":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Maximum File Size",
|
||||
"default": 5000000,
|
||||
"value": "5000000"
|
||||
},
|
||||
"maxImageSize":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Maximum Image Size",
|
||||
"default": 500000,
|
||||
"value": "500000"
|
||||
}
|
||||
},
|
||||
"database":
|
||||
{
|
||||
"dbMaxQuery":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Maximum results per query",
|
||||
"default": 100,
|
||||
"protected": true,
|
||||
"value": 100
|
||||
},
|
||||
"dbEnabled":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Database Enabled",
|
||||
"default": true,
|
||||
"protected": true,
|
||||
"value": true
|
||||
},
|
||||
"dbHost":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Database Host (IE: http://localhost:3306)",
|
||||
"default": "127.0.0.1",
|
||||
"protected": true,
|
||||
"value": "194.195.208.99"
|
||||
},
|
||||
"dbName":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Database Name",
|
||||
"default": "ttp-example",
|
||||
"protected": true,
|
||||
"value": "jk-com"
|
||||
},
|
||||
"dbPassword":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Database Password",
|
||||
"default": "",
|
||||
"protected": true,
|
||||
"value": "lsVb#$D74816"
|
||||
},
|
||||
"dbPrefix":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Database table Prefix",
|
||||
"default": "TTP_",
|
||||
"protected": true,
|
||||
"value": "TTP_"
|
||||
},
|
||||
"dbUsername":
|
||||
{
|
||||
"type": "text",
|
||||
"pretty": "Database Username",
|
||||
"default": "root",
|
||||
"protected": true,
|
||||
"value": "joeyk"
|
||||
}
|
||||
},
|
||||
"group":
|
||||
{
|
||||
"defaultGroup":
|
||||
{
|
||||
"type": "customSelect",
|
||||
"pretty": "The Default Group for new registrations.",
|
||||
"default": 5,
|
||||
"value": 5
|
||||
}
|
||||
},
|
||||
"logging":
|
||||
{
|
||||
"admin":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Enable Admin Action Logging.",
|
||||
"default": true,
|
||||
"value": true
|
||||
},
|
||||
"errors":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Enable Error Logging",
|
||||
"default": true,
|
||||
"value": true
|
||||
},
|
||||
"logins":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Enable Login Logging",
|
||||
"default": true,
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"bookmarks":
|
||||
{
|
||||
"enabled":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Enable Bookmarks.",
|
||||
"default": true,
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"calendar":
|
||||
{
|
||||
"enabled":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Enable Calendar.",
|
||||
"default": true,
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"contacts":
|
||||
{
|
||||
"enabled":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Enable Contacts.",
|
||||
"default": true,
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"notes":
|
||||
{
|
||||
"enabled":
|
||||
{
|
||||
"type": "radio",
|
||||
"pretty": "Enable Notes.",
|
||||
"default": true,
|
||||
"value": true
|
||||
}
|
||||
}
|
||||
}
|
1
app/config/config.json.bak
Normal file
1
app/config/config.json.bak
Normal file
@ -0,0 +1 @@
|
||||
{"main":{"logo":{"value":"images\/logo.png"},"name":{"value":"Joey Kimsey"},"loginLimit":{"type":"text","pretty":"Maximum Login Attempts per hour","default":5,"value":5}},"database":{"dbMaxQuery":{"value":100},"dbEnabled":{"value":true},"dbHost":{"value":"194.195.208.99"},"dbName":{"value":"jk-com"},"dbPassword":{"value":"lsVb#$D74816"},"dbPrefix":{"value":"TTP_"},"dbUsername":{"value":"joeyk"}}}
|
1
app/config/install.json
Normal file
1
app/config/install.json
Normal file
File diff suppressed because one or more lines are too long
1
app/config/permissions.json
Normal file
1
app/config/permissions.json
Normal file
@ -0,0 +1 @@
|
||||
{"adminAccess":{"pretty":"Access Administrator Areas","default":false},"addRoute":{"pretty":"Add Custom Routes","default":false},"uploadImages":{"pretty":"Upload images (such as avatars)","default":false},"useBookmarks":{"pretty":"Can use the bookmarks feature","default":false},"createEvents":{"pretty":"Can add events to bookmarks","default":false},"useCalendar":{"pretty":"Can use the calendar feature","default":false},"modAccess":{"pretty":"Access Moderator Areas","default":false},"useContacts":{"pretty":"Can use the contacts feature","default":false},"uploadFiles":{"pretty":"Can upload files","default":false},"sendMessages":{"pretty":"Can send Messages","default":false},"useNotes":{"pretty":"Can use the notes feature","default":false},"sendNotifications":{"pretty":"Can send notifications","default":false},"redirects":{"pretty":"Can modify redirects","default":false},"createTas":{"pretty":"Can create todo items","default":false},"createList":{"pretty":"Can create todo lists","default":false},"updates":{"pretty":"Can create status updates","default":false}}
|
1
app/config/permissions.json.bak
Normal file
1
app/config/permissions.json.bak
Normal file
@ -0,0 +1 @@
|
||||
{"adminAccess":{"pretty":"Access Administrator Areas","default":false},"addRoute":{"pretty":"Add Custom Routes","default":false},"uploadImages":{"pretty":"Upload images (such as avatars)","default":false},"useBookmarks":{"pretty":"Can use the bookmarks feature","default":false},"createEvents":{"pretty":"Can add events to bookmarks","default":false},"useCalendar":{"pretty":"Can use the calendar feature","default":false},"modAccess":{"pretty":"Access Moderator Areas","default":false},"useContacts":{"pretty":"Can use the contacts feature","default":false},"uploadFiles":{"pretty":"Can upload files","default":false},"sendMessages":{"pretty":"Can send Messages","default":false},"useNotes":{"pretty":"Can use the notes feature","default":false},"sendNotifications":{"pretty":"Can send notifications","default":false},"redirects":{"pretty":"Can modify redirects","default":false},"createTas":{"pretty":"Can create todo items","default":false},"createList":{"pretty":"Can create todo lists","default":false},"updates":{"pretty":"Can create status updates","default":false}}
|
1
app/config/preferences.json
Normal file
1
app/config/preferences.json
Normal file
@ -0,0 +1 @@
|
||||
{"gender":{"pretty":"Gender","type":"select","default":"unspecified","options":["male","female","other","unspecified"],"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"newsletter":{"pretty":"Receive our Newsletter?","type":"checkbox","default":"true","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"avatar":{"pretty":"Avatar","type":"file","default":"images\/defaultAvatar.png","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"timezone":{"pretty":"Timezone","type":"timezone","default":"America\/New_York","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"dateFormat":{"pretty":"Date Format","type":"select","default":"F j, Y","options":{"1-8-1991":"n-j-Y","8-1-1991":"j-n-Y","01-08-1991":"m-d-Y","08-01-1991":"d-m-Y","January 8, 1991":"F-j-Y","8 January, 1991":"j-F-Y","January 08, 1991":"F-d-Y","08 January, 1991":"d-F-Y","Jan 8, 1991":"M-j-Y","8 Jan 1991":"j-M-Y","Jan 08, 1991":"M-d-Y","08 Jan 1991":"d-M-Y"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"timeFormat":{"pretty":"Time Format","type":"select","default":"g:i:s A","options":{"3:33:33 AM":"g:i:s A","03:33:33 AM":"h:i:s A","3:33:33 am":"g:i:s a","03:33:33 am":"h:i:s a","3:33:33 (military)":"G:i:s","03:33:33 (military)":"H:i:s"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"pageLimit":{"pretty":"Items Displayed Per Page","type":"select","default":"10","options":["10","15","20","25","50"],"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"calendarPreference":{"pretty":"Default Calendar View","type":"select","default":"byMonth","options":{"Daily":"byDay","Weekly":"byWeek","Monthly":"byMonth","Yearly":"byYear","All Events":"events"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"weekStart":{"pretty":"First day of the week for the Calendar","type":"select","default":"sunday","options":{"Sunday":"6","Monday":"7"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"}}
|
1
app/config/preferences.json.bak
Normal file
1
app/config/preferences.json.bak
Normal file
@ -0,0 +1 @@
|
||||
{"gender":{"pretty":"Gender","type":"select","default":"unspecified","options":["male","female","other","unspecified"],"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"newsletter":{"pretty":"Receive our Newsletter?","type":"checkbox","default":"true","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"avatar":{"pretty":"Avatar","type":"file","default":"images\/defaultAvatar.png","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"timezone":{"pretty":"Timezone","type":"timezone","default":"America\/New_York","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"dateFormat":{"pretty":"Date Format","type":"select","default":"F j, Y","options":{"1-8-1991":"n-j-Y","8-1-1991":"j-n-Y","01-08-1991":"m-d-Y","08-01-1991":"d-m-Y","January 8, 1991":"F-j-Y","8 January, 1991":"j-F-Y","January 08, 1991":"F-d-Y","08 January, 1991":"d-F-Y","Jan 8, 1991":"M-j-Y","8 Jan 1991":"j-M-Y","Jan 08, 1991":"M-d-Y","08 Jan 1991":"d-M-Y"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"timeFormat":{"pretty":"Time Format","type":"select","default":"g:i:s A","options":{"3:33:33 AM":"g:i:s A","03:33:33 AM":"h:i:s A","3:33:33 am":"g:i:s a","03:33:33 am":"h:i:s a","3:33:33 (military)":"G:i:s","03:33:33 (military)":"H:i:s"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"pageLimit":{"pretty":"Items Displayed Per Page","type":"select","default":"10","options":["10","15","20","25","50"],"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"calendarPreference":{"pretty":"Default Calendar View","type":"select","default":"byMonth","options":{"Daily":"byDay","Weekly":"byWeek","Monthly":"byMonth","Yearly":"byYear","All Events":"events"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"weekStart":{"pretty":"First day of the week for the Calendar","type":"select","default":"sunday","options":{"Sunday":"6","Monday":"7"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"}}
|
@ -28,7 +28,26 @@ class Home extends Controller {
|
||||
public function index() {
|
||||
self::$title = '{SITENAME}';
|
||||
self::$pageDescription = 'This is the homepage of your new Tempus Project Installation. Thank you for installing. find more info at https://thetempusproject.com';
|
||||
Views::view( 'index' );
|
||||
$optionValues = [
|
||||
(object) [ "option" => "Full-Stack Developer" ],
|
||||
(object) [ "option" => "DevOps Engineer" ],
|
||||
(object) [ "option" => "Web Developer" ],
|
||||
(object) [ "option" => "App Developer" ],
|
||||
(object) [ "option" => "Senior PHP Developer" ],
|
||||
(object) [ "option" => "Server/Waiter" ],
|
||||
(object) [ "option" => "Cook" ],
|
||||
(object) [ "option" => "Farm-Hand" ],
|
||||
(object) [ "option" => "Dish-Boy" ],
|
||||
(object) [ "option" => "Brother" ],
|
||||
(object) [ "option" => "Son" ],
|
||||
(object) [ "option" => "Friend" ],
|
||||
(object) [ "option" => "Student" ],
|
||||
(object) [ "option" => "Polymath" ],
|
||||
(object) [ "option" => "Geek" ],
|
||||
(object) [ "option" => "Nerd" ],
|
||||
];
|
||||
shuffle($optionValues);
|
||||
Views::view( 'test', $optionValues );
|
||||
}
|
||||
|
||||
public function login() {
|
||||
@ -98,4 +117,16 @@ class Home extends Controller {
|
||||
// this should look up comments and blog posts with the hashtag in them
|
||||
Views::view( 'hashtags' );
|
||||
}
|
||||
|
||||
public function about() {
|
||||
self::$title = 'About - {SITENAME}';
|
||||
self::$pageDescription = 'Just a bit more info on me.';
|
||||
Views::view( 'about' );
|
||||
}
|
||||
|
||||
public function hire() {
|
||||
self::$title = 'Consulting and Freelance - {SITENAME}';
|
||||
self::$pageDescription = 'More details on how to hire me for consulting or freelance work.';
|
||||
Views::view( 'hire' );
|
||||
}
|
||||
}
|
||||
|
103
app/plugins/portfolio/controllers/admin/portfolio.php
Normal file
103
app/plugins/portfolio/controllers/admin/portfolio.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/portfolio/controllers/admin/portfolio.php
|
||||
*
|
||||
* This is the Portfolio admin controller.
|
||||
*
|
||||
* @package TP Portfolio
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Controllers\Admin;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Classes\AdminController;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Models\Links;
|
||||
|
||||
class Portfolio extends AdminController {
|
||||
public static $links;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
self::$links = new Links;
|
||||
self::$title = 'Admin - Portfolio';
|
||||
$view = Navigation::activePageSelect( 'nav.admin', '/admin/portfolio' );
|
||||
Components::set( 'ADMINNAV', $view );
|
||||
}
|
||||
|
||||
public function index( $data = null ) {
|
||||
Views::view( 'portfolio.admin.list', self::$links->listPaginated() );
|
||||
}
|
||||
|
||||
public function create( $data = null ) {
|
||||
if ( !Input::exists( 'submit' ) ) {
|
||||
return Views::view( 'portfolio.admin.create' );
|
||||
}
|
||||
if ( !Forms::check( 'newLink' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
$result = self::$links->create( Input::post( 'section' ), Input::post( 'title' ), Input::post( 'image' ), Input::post( 'url' ), Input::post( 'description' ) );
|
||||
if ( $result ) {
|
||||
Issues::add( 'success', 'Your link has been created.' );
|
||||
return $this->index();
|
||||
} else {
|
||||
Issues::add( 'error', [ 'There was an unknown error submitting your data.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
}
|
||||
|
||||
public function edit( $data = null ) {
|
||||
if ( !Input::exists( 'submit' ) ) {
|
||||
return Views::view( 'portfolio.admin.edit', self::$links->findById( $data ) );
|
||||
}
|
||||
if ( !Forms::check( 'editLink' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
$fields = [
|
||||
'section' => Input::post( 'section' ),
|
||||
'title' => Input::post( 'title' ),
|
||||
'image' => Input::post( 'image' ),
|
||||
'url' => Input::post( 'url' ),
|
||||
'description' => Input::post( 'description' ),
|
||||
];
|
||||
if ( self::$links->update( $data, $fields ) ) {
|
||||
Issues::add( 'success', 'Link Updated.' );
|
||||
return $this->index();
|
||||
}
|
||||
Issues::add( 'error', 'There was an error with your request.' );
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function view( $data = null ) {
|
||||
$linkData = self::$links->findById( $data );
|
||||
if ( $linkData !== false ) {
|
||||
return Views::view( 'portfolio.admin.view', $linkData );
|
||||
}
|
||||
Issues::add( 'error', 'Link not found.' );
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function delete( $data = null ) {
|
||||
if ( $data == null ) {
|
||||
if ( Input::exists( 'P_' ) ) {
|
||||
$data = Input::post( 'P_' );
|
||||
}
|
||||
}
|
||||
if ( !self::$links->delete( (array) $data ) ) {
|
||||
Issues::add( 'error', 'There was an error with your request.' );
|
||||
} else {
|
||||
Issues::add( 'success', 'Link has been deleted' );
|
||||
}
|
||||
$this->index();
|
||||
}
|
||||
}
|
36
app/plugins/portfolio/controllers/portfolio.php
Normal file
36
app/plugins/portfolio/controllers/portfolio.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/portfolio/controllers/portfolio.php
|
||||
*
|
||||
* This is the bug reports controller.
|
||||
*
|
||||
* @package TP Portfolio
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Controllers;
|
||||
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Classes\Controller;
|
||||
use TheTempusProject\Models\Links;
|
||||
|
||||
class Portfolio extends Controller {
|
||||
protected static $links;
|
||||
|
||||
public function index() {
|
||||
self::$links = new Links;
|
||||
self::$title = '{SITENAME} - Portfolio';
|
||||
self::$pageDescription = 'Its not the longest portfolio in the world, but I\'m certainly proud of it.';
|
||||
|
||||
$links = self::$links->listPaginated();
|
||||
if ( false == $links ) {
|
||||
Issues::add( 'error', 'Well, this is embarrassing, surely he wouldn\'t just have no portfolio..... right.... Dave? ... erm Joey?' );
|
||||
return;
|
||||
} else {
|
||||
Views::view( 'portfolio.portfolio', self::$links->listPaginated() );
|
||||
}
|
||||
}
|
||||
}
|
79
app/plugins/portfolio/forms.php
Normal file
79
app/plugins/portfolio/forms.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/portfolio/forms.php
|
||||
*
|
||||
* This houses all of the form checking functions for this plugin.
|
||||
*
|
||||
* @package TP Portfolio
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Plugins\Portfolio;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
|
||||
class PortfolioForms extends Forms {
|
||||
/**
|
||||
* Adds these functions to the form list.
|
||||
*/
|
||||
public function __construct() {
|
||||
self::addHandler( 'newLink', __CLASS__, 'newLink' );
|
||||
self::addHandler( 'editLink', __CLASS__, 'editLink' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the new position post form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function newLink() {
|
||||
if ( !Input::exists( 'section' ) ) {
|
||||
self::addUserError( 'You must specify section' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'title' ) ) {
|
||||
self::addUserError( 'You must specify title' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'url' ) ) {
|
||||
self::addUserError( 'You must specify url' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'description' ) ) {
|
||||
self::addUserError( 'You must specify description' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the edit position post form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function editLink() {
|
||||
if ( !Input::exists( 'section' ) ) {
|
||||
self::addUserError( 'You must specify section' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'title' ) ) {
|
||||
self::addUserError( 'You must specify title' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'url' ) ) {
|
||||
self::addUserError( 'You must specify url' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'description' ) ) {
|
||||
self::addUserError( 'You must specify description' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
new PortfolioForms;
|
71
app/plugins/portfolio/models/links.php
Normal file
71
app/plugins/portfolio/models/links.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/portfolio/models/links.php
|
||||
*
|
||||
* This class is used for the manipulation of the links database table.
|
||||
*
|
||||
* @package TP Portfolio
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
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\Portfolio as Plugin;
|
||||
|
||||
class Links extends DatabaseModel {
|
||||
public $tableName = 'portfolio_links';
|
||||
public $databaseMatrix = [
|
||||
[ 'section', 'varchar', '32' ],
|
||||
[ 'title', 'varchar', '128' ],
|
||||
[ 'image', 'varchar', '256' ],
|
||||
[ 'url', 'varchar', '256' ],
|
||||
[ 'description', 'text', '' ],
|
||||
];
|
||||
public $plugin;
|
||||
|
||||
/**
|
||||
* The model constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->plugin = new Plugin;
|
||||
}
|
||||
|
||||
public function create( $section, $title, $image, $url, $description ) {
|
||||
if ( !$this->plugin->checkEnabled() ) {
|
||||
Debug::info( 'Portfolio is disabled in the config.' );
|
||||
return false;
|
||||
}
|
||||
$fields = [
|
||||
'section' => $section,
|
||||
'title' => $title,
|
||||
'image' => $image,
|
||||
'url' => $url,
|
||||
'description' => $description,
|
||||
];
|
||||
if ( !self::$db->insert( $this->tableName, $fields ) ) {
|
||||
Debug::info( 'Links::create - failed to insert to db' );
|
||||
return false;
|
||||
}
|
||||
return self::$db->lastId();
|
||||
}
|
||||
|
||||
public function update( $id, $fields ) {
|
||||
if ( !Check::id( $id ) ) {
|
||||
Debug::info( 'modelBlog: illegal ID.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::$db->update( $this->tableName, $id, $fields ) ) {
|
||||
// new CustomException( 'linkUpdate' );
|
||||
Debug::error( "Links:update: $id not updated: $fields" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
44
app/plugins/portfolio/plugin.php
Normal file
44
app/plugins/portfolio/plugin.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/portfolio/plugin.php
|
||||
*
|
||||
* This houses all of the main plugin info and functionality.
|
||||
*
|
||||
* @package TP Portfolio
|
||||
* @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 TheTempusProject\Classes\Plugin;
|
||||
|
||||
class Portfolio extends Plugin {
|
||||
public $pluginName = 'TP Portfolio';
|
||||
public $pluginAuthor = 'JoeyK';
|
||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
||||
public $modelVersion = '1.0';
|
||||
public $pluginVersion = '3.0';
|
||||
public $pluginDescription = 'A simple plugin which adds management for a portfolio.';
|
||||
public $configName = 'portfolio';
|
||||
public $configMatrix = [
|
||||
'enabled' => [
|
||||
'type' => 'radio',
|
||||
'pretty' => 'Enable the portfolio Feature.',
|
||||
'default' => true,
|
||||
],
|
||||
];
|
||||
public $main_links = [
|
||||
[
|
||||
'text' => 'Portfolio',
|
||||
'url' => '{ROOT_URL}portfolio/index',
|
||||
],
|
||||
];
|
||||
public $admin_links = [
|
||||
[
|
||||
'text' => '<i class="fa fa-fw fa-support"></i> Portfolio',
|
||||
'url' => '{ROOT_URL}admin/portfolio',
|
||||
],
|
||||
];
|
||||
}
|
19
app/plugins/portfolio/views/admin/create.html
Normal file
19
app/plugins/portfolio/views/admin/create.html
Normal file
@ -0,0 +1,19 @@
|
||||
<h2>Add Portfolio Link</h2>
|
||||
<form action="#" method="POST">
|
||||
<label for="section">Section Name:</label><br>
|
||||
<input type="text" id="section" name="section" required><br><br>
|
||||
|
||||
<label for="title">Title:</label><br>
|
||||
<input type="text" id="title" name="title" required><br><br>
|
||||
|
||||
<label for="image">Image:</label><br>
|
||||
<input type="text" id="image" name="image" required><br><br>
|
||||
|
||||
<label for="url">URL:</label><br>
|
||||
<input type="text" id="url" name="url" required><br><br>
|
||||
|
||||
<label for="description">Description:</label><br>
|
||||
<textarea id="description" name="description" rows="20" cols="50" required></textarea><br><br>
|
||||
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
</form>
|
19
app/plugins/portfolio/views/admin/edit.html
Normal file
19
app/plugins/portfolio/views/admin/edit.html
Normal file
@ -0,0 +1,19 @@
|
||||
<h2>Edit Portfolio Link</h2>
|
||||
<form action="#" method="POST">
|
||||
<label for="section">Section Name:</label><br>
|
||||
<input type="text" id="section" name="section" value="{section}" required><br><br>
|
||||
|
||||
<label for="title">Title:</label><br>
|
||||
<input type="text" id="title" name="title" value="{title}" required><br><br>
|
||||
|
||||
<label for="image">Image:</label><br>
|
||||
<input type="text" id="image" name="image" value="{image}" required><br><br>
|
||||
|
||||
<label for="url">URL:</label><br>
|
||||
<input type="text" id="url" name="url" value="{url}" required><br><br>
|
||||
|
||||
<label for="description">Description</label><br>
|
||||
<textarea id="description" name="description" rows="20" cols="50" required>{description}</textarea><br><br>
|
||||
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
</form>
|
41
app/plugins/portfolio/views/admin/list.html
Normal file
41
app/plugins/portfolio/views/admin/list.html
Normal file
@ -0,0 +1,41 @@
|
||||
<legend>Portfolio Links</legend>
|
||||
{PAGINATION}
|
||||
<form action="{ROOT_URL}admin/portfolio/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">title</th>
|
||||
<th style="width: 30%">section</th>
|
||||
<th style="width: 25%">url</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%">
|
||||
<INPUT type="checkbox" onchange="checkAll(this)" name="check.b" value="B_[]"/>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td><a href="{ROOT_URL}admin/portfolio/view/{ID}">{title}</a></td>
|
||||
<td>{section}</td>
|
||||
<td>{url}</td>
|
||||
<td><a href="{ROOT_URL}admin/portfolio/edit/{ID}" class="btn btn-sm btn-warning" role="button"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/portfolio/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="P_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
No results to show.
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="{ROOT_URL}admin/portfolio/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>
|
16
app/plugins/portfolio/views/admin/view.html
Normal file
16
app/plugins/portfolio/views/admin/view.html
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
<legend>Portfolio Link</legend>
|
||||
<hr>
|
||||
<div class="media portfolio-link">
|
||||
<div class="media-left">
|
||||
<a href="#">
|
||||
<img class="media-object" src="{image}" alt="{title} preview">
|
||||
</a>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<h4 class="media-heading"><a href="{url}">{title}</a></h4>
|
||||
{description}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
20
app/plugins/portfolio/views/portfolio.html
Normal file
20
app/plugins/portfolio/views/portfolio.html
Normal file
@ -0,0 +1,20 @@
|
||||
<h1>Portfolio</h1>
|
||||
<hr>
|
||||
{LOOP}
|
||||
<div class="media portfolio-link col-md-8 col-md-offset-2">
|
||||
<div class="media-left">
|
||||
<a href="#">
|
||||
<img class="media-object" src="{image}" alt="{title} preview">
|
||||
</a>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<h4 class="media-heading"><a href="{url}">{title}</a></h4>
|
||||
{description}
|
||||
</div>
|
||||
</div>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<div class="portfolio-link">
|
||||
<p>None Found</p>
|
||||
</div>
|
||||
{/ALT}
|
103
app/plugins/resume/controllers/admin/resume.php
Normal file
103
app/plugins/resume/controllers/admin/resume.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/resume/controllers/admin/resume.php
|
||||
*
|
||||
* This is the Resume admin controller.
|
||||
*
|
||||
* @package TP Resume
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Controllers\Admin;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Classes\AdminController;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Models\Positions;
|
||||
|
||||
class Resume extends AdminController {
|
||||
public static $positions;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
self::$positions = new Positions;
|
||||
self::$title = 'Admin - Resume';
|
||||
$view = Navigation::activePageSelect( 'nav.admin', '/admin/resume' );
|
||||
Components::set( 'ADMINNAV', $view );
|
||||
}
|
||||
|
||||
public function index( $data = null ) {
|
||||
Views::view( 'resume.admin.list', self::$positions->listPaginated() );
|
||||
}
|
||||
|
||||
public function create( $data = null ) {
|
||||
if ( !Input::exists( 'submit' ) ) {
|
||||
return Views::view( 'resume.admin.create' );
|
||||
}
|
||||
if ( !Forms::check( 'newPosition' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
$result = self::$positions->create( Input::post( 'name' ), Input::post( 'position' ), Input::post( 'start' ), Input::post( 'end' ), Input::post( 'details' ) );
|
||||
if ( $result ) {
|
||||
Issues::add( 'success', 'Your position has been created.' );
|
||||
return $this->index();
|
||||
} else {
|
||||
Issues::add( 'error', [ 'There was an unknown error submitting your data.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
}
|
||||
|
||||
public function edit( $data = null ) {
|
||||
if ( !Input::exists( 'submit' ) ) {
|
||||
return Views::view( 'resume.admin.edit', self::$positions->findById( $data ) );
|
||||
}
|
||||
if ( !Forms::check( 'editPosition' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
$fields = [
|
||||
'name' => Input::post( 'name' ),
|
||||
'position' => Input::post( 'position' ),
|
||||
'start' => Input::post( 'start' ),
|
||||
'end' => Input::post( 'end' ),
|
||||
'details' => Input::post( 'details' ),
|
||||
];
|
||||
if ( self::$positions->update( $data, $fields ) ) {
|
||||
Issues::add( 'success', 'Position Updated.' );
|
||||
return $this->index();
|
||||
}
|
||||
Issues::add( 'error', 'There was an error with your request.' );
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function view( $data = null ) {
|
||||
$positionData = self::$positions->findById( $data );
|
||||
if ( $positionData !== false ) {
|
||||
return Views::view( 'resume.admin.view', $positionData );
|
||||
}
|
||||
Issues::add( 'error', 'Position not found.' );
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function delete( $data = null ) {
|
||||
if ( $data == null ) {
|
||||
if ( Input::exists( 'P_' ) ) {
|
||||
$data = Input::post( 'P_' );
|
||||
}
|
||||
}
|
||||
if ( !self::$positions->delete( (array) $data ) ) {
|
||||
Issues::add( 'error', 'There was an error with your request.' );
|
||||
} else {
|
||||
Issues::add( 'success', 'Position has been deleted' );
|
||||
}
|
||||
$this->index();
|
||||
}
|
||||
}
|
58
app/plugins/resume/controllers/resume.php
Normal file
58
app/plugins/resume/controllers/resume.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/resume/controllers/resume.php
|
||||
*
|
||||
* This is the bug reports controller.
|
||||
*
|
||||
* @package TP Resume
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Controllers;
|
||||
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Classes\Controller;
|
||||
use TheTempusProject\Models\Positions;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Houdini\Classes\Template;
|
||||
|
||||
class Resume extends Controller {
|
||||
protected static $positions;
|
||||
|
||||
public function index() {
|
||||
self::$positions = new Positions;
|
||||
self::$title = '{SITENAME} - Resume';
|
||||
self::$pageDescription = 'Its not the longest resume in the world, but I\'m certainly proud of it.';
|
||||
|
||||
$positions = self::$positions->listPaginated();
|
||||
if ( false == $positions ) {
|
||||
Issues::add( 'error', 'Well, this is embarrassing, surely he wouldn\'t just have no resume..... right.... Dave? ... erm Joey?' );
|
||||
return;
|
||||
} else {
|
||||
Components::set( 'RESUME_NAV', Views::simpleView( 'resume.nav') );
|
||||
Components::set( 'RESUME_DOWNLOADS', Views::simpleView( 'resume.download') );
|
||||
if ( !Input::exists( 'view' ) ) {
|
||||
return Views::view( 'resume.resume', $positions );
|
||||
} else {
|
||||
Components::append( 'TEMPLATE_CSS_INCLUDES', Template::parse('<link rel="stylesheet" href="{ROOT_URL}app/plugins/resume/css/timeline.css" />') );
|
||||
$side = 'left';
|
||||
foreach ($positions as $key => $position) {
|
||||
$position->side = $side; // Add the new entry for side
|
||||
$side = ($side === 'left') ? 'right' : 'left'; // Alternate between left and right
|
||||
}
|
||||
return Views::view( 'resume.timeline', $positions );
|
||||
}
|
||||
}
|
||||
}
|
||||
public function test() {
|
||||
self::$positions = new Positions;
|
||||
self::$title = '{SITENAME} - Resume';
|
||||
self::$pageDescription = 'Its not the longest resume in the world, but I\'m certainly proud of it.';
|
||||
|
||||
return Views::view( 'resume.test' );
|
||||
}
|
||||
}
|
132
app/plugins/resume/css/timeline.css
Normal file
132
app/plugins/resume/css/timeline.css
Normal file
@ -0,0 +1,132 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
/* background-color: #474e5d;
|
||||
font-family: Helvetica, sans-serif; */
|
||||
}
|
||||
|
||||
/* The actual timeline (the vertical ruler) */
|
||||
.resume-timeline {
|
||||
position: relative;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* The actual timeline (the vertical ruler) */
|
||||
.resume-timeline::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 6px;
|
||||
background-color: #B5B5B5;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
margin-left: -3px;
|
||||
}
|
||||
|
||||
/* Container around content */
|
||||
.timeline-container {
|
||||
padding: 10px 40px;
|
||||
position: relative;
|
||||
background-color: inherit;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
/* The circles on the timeline */
|
||||
.timeline-container::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
right: -13px;
|
||||
background-color: #337ab7;
|
||||
border: 4px solid #FF9F55;
|
||||
top: 15px;
|
||||
border-radius: 50%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* Place the container to the left */
|
||||
.left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/* Place the container to the right */
|
||||
.right {
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
/* Add arrows to the left container (pointing right) */
|
||||
.left::before {
|
||||
content: " ";
|
||||
height: 0;
|
||||
position: absolute;
|
||||
top: 22px;
|
||||
width: 0;
|
||||
z-index: 1;
|
||||
right: 30px;
|
||||
border: medium solid white;
|
||||
border-width: 10px 0 10px 10px;
|
||||
border-color: transparent transparent transparent white;
|
||||
}
|
||||
|
||||
/* Add arrows to the right container (pointing left) */
|
||||
.right::before {
|
||||
content: " ";
|
||||
height: 0;
|
||||
position: absolute;
|
||||
top: 22px;
|
||||
width: 0;
|
||||
z-index: 1;
|
||||
left: 30px;
|
||||
border: medium solid white;
|
||||
border-width: 10px 10px 10px 0;
|
||||
border-color: transparent white transparent transparent;
|
||||
}
|
||||
|
||||
/* Fix the circle for containers on the right side */
|
||||
.right::after {
|
||||
left: -11px;
|
||||
}
|
||||
|
||||
/* The actual content */
|
||||
.timeline-content {
|
||||
padding: 20px 30px;
|
||||
background-color: white;
|
||||
position: relative;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* Media queries - Responsive timeline on screens less than 600px wide */
|
||||
@media screen and (max-width: 600px) {
|
||||
/* Place the timelime to the left */
|
||||
.resume-timeline::after {
|
||||
left: 31px;
|
||||
}
|
||||
|
||||
/* Full-width containers */
|
||||
.timeline-container {
|
||||
width: 100%;
|
||||
padding-left: 70px;
|
||||
padding-right: 25px;
|
||||
}
|
||||
|
||||
/* Make sure that all arrows are pointing leftwards */
|
||||
.timeline-container::before {
|
||||
left: 60px;
|
||||
border: medium solid white;
|
||||
border-width: 10px 10px 10px 0;
|
||||
border-color: transparent white transparent transparent;
|
||||
}
|
||||
|
||||
/* Make sure all circles are at the same spot */
|
||||
.left::after, .right::after {
|
||||
left: 15px;
|
||||
}
|
||||
|
||||
/* Make all right containers behave like the left ones */
|
||||
.right {
|
||||
left: 0%;
|
||||
}
|
||||
}
|
87
app/plugins/resume/forms.php
Normal file
87
app/plugins/resume/forms.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/resume/forms.php
|
||||
*
|
||||
* This houses all of the form checking functions for this plugin.
|
||||
*
|
||||
* @package TP Resume
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Plugins\Resume;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
|
||||
class ResumeForms extends Forms {
|
||||
/**
|
||||
* Adds these functions to the form list.
|
||||
*/
|
||||
public function __construct() {
|
||||
self::addHandler( 'newPosition', __CLASS__, 'newPosition' );
|
||||
self::addHandler( 'editPosition', __CLASS__, 'editPosition' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the new position post form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function newPosition() {
|
||||
if ( !Input::exists( 'name' ) ) {
|
||||
self::addUserError( 'You must specify name' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'position' ) ) {
|
||||
self::addUserError( 'You must specify position' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'start' ) ) {
|
||||
self::addUserError( 'You must specify start' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'end' ) ) {
|
||||
self::addUserError( 'You must specify end' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'details' ) ) {
|
||||
self::addUserError( 'You must specify details' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the edit position post form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function editPosition() {
|
||||
if ( !Input::exists( 'name' ) ) {
|
||||
self::addUserError( 'You must specify name' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'position' ) ) {
|
||||
self::addUserError( 'You must specify position' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'start' ) ) {
|
||||
self::addUserError( 'You must specify start' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'end' ) ) {
|
||||
self::addUserError( 'You must specify end' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'details' ) ) {
|
||||
self::addUserError( 'You must specify details' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
new ResumeForms;
|
88
app/plugins/resume/models/positions.php
Normal file
88
app/plugins/resume/models/positions.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/resume/models/positions.php
|
||||
*
|
||||
* This class is used for the manipulation of the positions database table.
|
||||
*
|
||||
* @package TP Resume
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
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\Resume as Plugin;
|
||||
|
||||
class Positions extends DatabaseModel {
|
||||
public $tableName = 'positions';
|
||||
public $databaseMatrix = [
|
||||
[ 'name', 'varchar', '128' ],
|
||||
[ 'position', 'varchar', '128' ],
|
||||
[ 'start', 'varchar', '16' ],
|
||||
[ 'end', 'varchar', '16' ],
|
||||
[ 'details', 'text', '' ],
|
||||
];
|
||||
public $plugin;
|
||||
|
||||
/**
|
||||
* The model constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->plugin = new Plugin;
|
||||
}
|
||||
|
||||
public function create( $name, $position, $start, $end, $details ) {
|
||||
if ( !$this->plugin->checkEnabled() ) {
|
||||
Debug::info( 'Resume is disabled in the config.' );
|
||||
return false;
|
||||
}
|
||||
$fields = [
|
||||
'name' => $name,
|
||||
'position' => $position,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'details' => $details,
|
||||
];
|
||||
if ( !self::$db->insert( $this->tableName, $fields ) ) {
|
||||
Debug::info( 'Position::create - failed to insert to db' );
|
||||
return false;
|
||||
}
|
||||
return self::$db->lastId();
|
||||
}
|
||||
|
||||
public function filter( $postArray, $params = [] ) {
|
||||
foreach ( $postArray as $instance ) {
|
||||
if ( !is_object( $instance ) ) {
|
||||
$instance = $postArray;
|
||||
$end = true;
|
||||
}
|
||||
$instance->prettyStart = $instance->start;
|
||||
$instance->prettyEnd = $instance->end;
|
||||
$out[] = $instance;
|
||||
if ( !empty( $end ) ) {
|
||||
$out = $out[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
public function update( $id, $fields ) {
|
||||
if ( !Check::id( $id ) ) {
|
||||
Debug::info( 'Positions:update: illegal ID.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::$db->update( $this->tableName, $id, $fields ) ) {
|
||||
// new CustomException( 'positionUpdate' );
|
||||
Debug::error( "Positions:update: $id not updated: $fields" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
44
app/plugins/resume/plugin.php
Normal file
44
app/plugins/resume/plugin.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/resume/plugin.php
|
||||
*
|
||||
* This houses all of the main plugin info and functionality.
|
||||
*
|
||||
* @package TP Resume
|
||||
* @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 TheTempusProject\Classes\Plugin;
|
||||
|
||||
class Resume extends Plugin {
|
||||
public $pluginName = 'TP Resume';
|
||||
public $pluginAuthor = 'JoeyK';
|
||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
||||
public $modelVersion = '1.0';
|
||||
public $pluginVersion = '3.0';
|
||||
public $pluginDescription = 'A simple plugin which adds management for a resume.';
|
||||
public $configName = 'resume';
|
||||
public $configMatrix = [
|
||||
'enabled' => [
|
||||
'type' => 'radio',
|
||||
'pretty' => 'Enable the resume Feature.',
|
||||
'default' => true,
|
||||
],
|
||||
];
|
||||
public $main_links = [
|
||||
[
|
||||
'text' => 'Resume',
|
||||
'url' => '{ROOT_URL}resume/index',
|
||||
],
|
||||
];
|
||||
public $admin_links = [
|
||||
[
|
||||
'text' => '<i class="fa fa-fw fa-support"></i> Resume',
|
||||
'url' => '{ROOT_URL}admin/resume',
|
||||
],
|
||||
];
|
||||
}
|
19
app/plugins/resume/views/admin/create.html
Normal file
19
app/plugins/resume/views/admin/create.html
Normal file
@ -0,0 +1,19 @@
|
||||
<h2>Resume Entry Form</h2>
|
||||
<form action="#" method="POST">
|
||||
<label for="name">Company Name:</label><br>
|
||||
<input type="text" id="name" name="name" required><br><br>
|
||||
|
||||
<label for="position">Position:</label><br>
|
||||
<input type="text" id="position" name="position" required><br><br>
|
||||
|
||||
<label for="start">Start Month/Year:</label><br>
|
||||
<input type="month" id="start" name="start" required><br><br>
|
||||
|
||||
<label for="end">End Month/Year:</label><br>
|
||||
<input type="month" id="end" name="end" required><br><br>
|
||||
|
||||
<label for="details">Details:</label><br>
|
||||
<textarea id="details" name="details" rows="20" cols="50" required></textarea><br><br>
|
||||
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
</form>
|
19
app/plugins/resume/views/admin/edit.html
Normal file
19
app/plugins/resume/views/admin/edit.html
Normal file
@ -0,0 +1,19 @@
|
||||
<h2>Edit Resume Position</h2>
|
||||
<form action="#" method="POST">
|
||||
<label for="name">Company Name:</label><br>
|
||||
<input type="text" id="name" name="name" value="{name}" required><br><br>
|
||||
|
||||
<label for="position">Position:</label><br>
|
||||
<input type="text" id="position" name="position" value="{position}" required><br><br>
|
||||
|
||||
<label for="start">Start Month/Year:</label><br>
|
||||
<input type="month" id="start" name="start" value="{start}" required><br><br>
|
||||
|
||||
<label for="end">End Month/Year:</label><br>
|
||||
<input type="month" id="end" name="end" value="{end}" required><br><br>
|
||||
|
||||
<label for="details">Details:</label><br>
|
||||
<textarea id="details" name="details" rows="20" cols="50" required>{details}</textarea><br><br>
|
||||
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
</form>
|
43
app/plugins/resume/views/admin/list.html
Normal file
43
app/plugins/resume/views/admin/list.html
Normal file
@ -0,0 +1,43 @@
|
||||
<legend>Resume Positions</legend>
|
||||
{PAGINATION}
|
||||
<form action="{ROOT_URL}admin/resume/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">Name</th>
|
||||
<th style="width: 20%">Position</th>
|
||||
<th style="width: 10%">Start</th>
|
||||
<th style="width: 10%">End</th>
|
||||
<th style="width: 10%"></th>
|
||||
<th style="width: 10%"></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/resume/view/{ID}">{name}</a></td>
|
||||
<td>{position}</td>
|
||||
<td>{prettyStart}</td>
|
||||
<td>{prettyEnd}</td>
|
||||
<td><a href="{ROOT_URL}admin/resume/edit/{ID}" class="btn btn-sm btn-warning" role="button"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/resume/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="P_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
No results to show.
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="{ROOT_URL}admin/resume/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>
|
8
app/plugins/resume/views/admin/view.html
Normal file
8
app/plugins/resume/views/admin/view.html
Normal file
@ -0,0 +1,8 @@
|
||||
<legend>Resume Position</legend>
|
||||
<div class="resume-position">
|
||||
<h3 class="resume-position-title">{name}</h3>
|
||||
<p><b>{position}</b> from <i>{prettyStart}</i> to <i>{prettyEnd}</i></p>
|
||||
<div class="well">
|
||||
{details}
|
||||
</div>
|
||||
</div>
|
9
app/plugins/resume/views/download.html
Normal file
9
app/plugins/resume/views/download.html
Normal file
@ -0,0 +1,9 @@
|
||||
<div class="col-lg-12 text-center" role="group" aria-label="Resume Downloads">
|
||||
<div class="btn-group text-center" role="group" aria-label="Resume Downloads">
|
||||
<h3>Download</h3>
|
||||
<a href="/downloads/JoeyKimsey-resume.docx" class="btn btn-default" role="button">Word</a>
|
||||
<a href="/downloads/JoeyKimsey-resume.pdf" class="btn btn-default" role="button">PDF</a>
|
||||
<a href="/downloads/JoeyKimsey-resume.md" class="btn btn-default" role="button">Markdown</a>
|
||||
<a href="/downloads/JoeyKimsey-resume.txt" class="btn btn-default" role="button">Text</a>
|
||||
</div>
|
||||
</div>
|
4
app/plugins/resume/views/nav.html
Normal file
4
app/plugins/resume/views/nav.html
Normal file
@ -0,0 +1,4 @@
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="Resume View Type">
|
||||
<a href="?view=tiimeline" class="btn btn-default" role="button">Timeliine</a>
|
||||
<a href="?" class="btn btn-default" role="button">Standard</a>
|
||||
</div>
|
18
app/plugins/resume/views/resume.html
Normal file
18
app/plugins/resume/views/resume.html
Normal file
@ -0,0 +1,18 @@
|
||||
<h1>Resume</h1>
|
||||
<hr>
|
||||
{RESUME_NAV}
|
||||
{LOOP}
|
||||
<div class="resume-position">
|
||||
<h3 class="resume-position-title">{name}</h3>
|
||||
<p><b>{position}</b> from <i>{prettyStart}</i> to <i>{prettyEnd}</i></p>
|
||||
<div class="well">
|
||||
{details}
|
||||
</div>
|
||||
</div>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<div class="resume-position">
|
||||
<p>None Found</p>
|
||||
</div>
|
||||
{/ALT}
|
||||
{RESUME_DOWNLOADS}
|
139
app/plugins/resume/views/test.html
Normal file
139
app/plugins/resume/views/test.html
Normal file
@ -0,0 +1,139 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="Resume View Type">
|
||||
<a href="?view=tiimeline" class="btn btn-default" role="button">Timeline</a>
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-default btn-lg dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
Options <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
<li><a href="#">Something else here</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a href="?" class="btn btn-default" role="button">Standard</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<input type="checkbox" aria-label="...">
|
||||
</span>
|
||||
<span class="input-group-addon" id="basic-addon3">
|
||||
Show / Hide the Bullshit
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
|
||||
|
||||
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon3">https://example.com/users/</span>
|
||||
<input type="checkbox" aria-label="...">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<input type="checkbox" aria-label="...">
|
||||
</span>
|
||||
<input type="text" class="form-control" aria-label="...">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<input type="checkbox" aria-label="...">
|
||||
</span>
|
||||
|
||||
<span class="input-group-addon" id="basic-addon3">https://example.com/users/</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">@</span>
|
||||
<input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Recipient's username" aria-describedby="basic-addon2">
|
||||
<span class="input-group-addon" id="basic-addon2">@example.com</span>
|
||||
</div>
|
||||
|
||||
<label for="basic-url">Your vanity URL</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon3">https://example.com/users/</span>
|
||||
<input type="text" class="form-control" id="basic-url" aria-describedby="basic-addon3">
|
||||
</div>
|
22
app/plugins/resume/views/timeline.html
Normal file
22
app/plugins/resume/views/timeline.html
Normal file
@ -0,0 +1,22 @@
|
||||
<h1>Resume</h1>
|
||||
<hr>
|
||||
{RESUME_NAV}
|
||||
{LOOP}
|
||||
<div class="resume-timeline">
|
||||
<div class="timeline-container {side}">
|
||||
<div class="timeline-content">
|
||||
<h3 class="resume-position-title">{name}</h3>
|
||||
<p><b>{position}</b> from <i>{prettyStart}</i> to <i>{prettyEnd}</i></p>
|
||||
<div class="well">
|
||||
{details}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<div class="resume-timeline">
|
||||
<p>None Found</p>
|
||||
</div>
|
||||
{/ALT}
|
||||
{RESUME_DOWNLOADS}
|
@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/subscribe/controllers/admin/subscriptions.php
|
||||
*
|
||||
* This is the subscriptions admin controller.
|
||||
*
|
||||
* @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\Controllers\Admin;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Classes\AdminController;
|
||||
use TheTempusProject\Models\Subscribe;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
|
||||
class Subscriptions extends AdminController {
|
||||
public static $subscribe;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
self::$title = 'Admin - Email Subscribers';
|
||||
self::$subscribe = new Subscribe;
|
||||
}
|
||||
|
||||
public function delete( $data = null ) {
|
||||
if ( $data == null ) {
|
||||
if ( Input::exists( 'submit' ) ) {
|
||||
$data = Input::post( 'S_' );
|
||||
}
|
||||
}
|
||||
if ( !self::$subscribe->delete( (array) $data ) ) {
|
||||
Issues::add( 'error', 'There was an error with your request, please try again.' );
|
||||
} else {
|
||||
Issues::add( 'success', 'Subscriber removed.' );
|
||||
}
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function add( $data = null ) {
|
||||
if ( !Input::exists( 'submit' ) ) {
|
||||
return Views::view( 'subscribe.admin.add' );
|
||||
}
|
||||
if ( !Forms::check( 'subscribe' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
if ( !self::$subscribe->add( Input::post( 'email' ) ) ) {
|
||||
Issues::add( 'error', 'There was an error with your request, please try again.' );
|
||||
return $this->index();
|
||||
}
|
||||
Issues::add( 'success', 'Subscriber added.' );
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function index( $data = null ) {
|
||||
Views::view( 'subscribe.admin.list', self::$subscribe->listPaginated() );
|
||||
}
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/subscribe/controllers/subscribe.php
|
||||
*
|
||||
* This is the home controller for the subscribe plugin.
|
||||
*
|
||||
* @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\Controllers;
|
||||
|
||||
use TheTempusProject\Classes\Controller;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Hermes\Functions\Redirect;
|
||||
use TheTempusProject\Bedrock\Functions\Session;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Classes\Email;
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Models\Subscribe as SubscribeModel;
|
||||
|
||||
class Subscribe extends Controller {
|
||||
private static $subscribe;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
self::$subscribe = new SubscribeModel;
|
||||
}
|
||||
|
||||
public function index() {
|
||||
self::$title = 'Subscribe - {SITENAME}';
|
||||
self::$pageDescription = 'We are always publishing great content and keeping our members up to date. If you would like to join our list, you can subscribe here.';
|
||||
if ( !Input::exists( 'email' ) ) {
|
||||
return Views::view( 'subscribe.subscribe' );
|
||||
}
|
||||
if ( !Forms::check( 'subscribe' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] );
|
||||
return Views::view( 'subscribe.subscribe' );
|
||||
}
|
||||
if ( !self::$subscribe->add( Input::post( 'email' ) ) ) {
|
||||
Issues::add( 'error', 'There was an error with your request, please try again.' );
|
||||
return Views::view( 'subscribe.subscribe' );
|
||||
}
|
||||
$data = self::$subscribe->get( Input::post( 'email' ) );
|
||||
Email::send( Input::post( 'email' ), 'subscribe', $data->confirmationCode, ['template' => true] );
|
||||
Issues::add( 'success', 'You have successfully been subscribed to our mailing list.' );
|
||||
}
|
||||
|
||||
public function unsubscribe( $email = null, $code = null ) {
|
||||
self::$title = '{SITENAME}';
|
||||
self::$pageDescription = '';
|
||||
if ( !empty( $email ) && !empty( $code ) ) {
|
||||
if ( self::$subscribe->unsubscribe( $email, $code ) ) {
|
||||
return Issues::add( 'success', 'You have been successfully unsubscribed from receiving further mailings.' );
|
||||
}
|
||||
Issues::add( 'error', 'There was an error with your request.' );
|
||||
return Views::view( 'subscribe.unsubscribe' );
|
||||
}
|
||||
if ( !Input::exists( 'submit' ) ) {
|
||||
return Views::view( 'subscribe.unsubscribe' );
|
||||
}
|
||||
if ( !Forms::check( 'unsubscribe' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] );
|
||||
return Views::view( 'subscribe.unsubscribe' );
|
||||
}
|
||||
$data = self::$subscribe->get( Input::post( 'email' ) );
|
||||
if ( empty( $data ) ) {
|
||||
Issues::add( 'notice', 'There was an error with your request.' );
|
||||
return Views::view( 'subscribe.unsubscribe' );
|
||||
}
|
||||
Email::send( Input::post( 'email' ), 'unsubInstructions', $data->confirmationCode, ['template' => true] );
|
||||
Session::flash( 'success', 'An email with instructions on how to unsubscribe has been sent to your email.' );
|
||||
Redirect::to( 'home/index' );
|
||||
}
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/subscribe/forms.php
|
||||
*
|
||||
* This houses all of the form checking functions for this plugin.
|
||||
*
|
||||
* @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\Subscribe;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
|
||||
class SubscribeForms extends Forms {
|
||||
/**
|
||||
* Adds these functions to the form list.
|
||||
*/
|
||||
public function __construct() {
|
||||
self::addHandler( 'subscribe', __CLASS__, 'subscribe' );
|
||||
self::addHandler( 'unsubscribe', __CLASS__, 'unsubscribe' );
|
||||
self::addHandler( 'newSubscription', __CLASS__, 'newSubscription' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the subscribe form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function subscribe() {
|
||||
if ( !self::email( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'Invalid email.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the unsubscribe form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function unsubscribe() {
|
||||
if ( !self::email( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'Invalid email.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the new subscription form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function newSubscription() {
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
new SubscribeForms;
|
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/subscribe/models/subscribe.php
|
||||
*
|
||||
* This class is used for the manipulation of the subscribers database table.
|
||||
*
|
||||
* @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\Models;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Code;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
|
||||
class Subscribe extends DatabaseModel {
|
||||
public $tableName = 'subscribers';
|
||||
public $databaseMatrix = [
|
||||
[ 'confirmed', 'int', '1' ],
|
||||
[ 'subscribed', 'int', '10' ],
|
||||
[ 'confirmationCode', 'varchar', '80' ],
|
||||
[ 'email', 'varchar', '75' ],
|
||||
];
|
||||
|
||||
/**
|
||||
* Adds an email to the subscribers database.
|
||||
*
|
||||
* @param string $email - the email you are trying to add.
|
||||
* @return bool
|
||||
*/
|
||||
public function add( $email ) {
|
||||
if ( !Check::email( $email ) ) {
|
||||
return false;
|
||||
}
|
||||
$alreadyExists = self::$db->get( $this->tableName, ['email', '=', $email] );
|
||||
|
||||
if ( $alreadyExists->error() ) {
|
||||
Debug::info( 'Error querying database: ' . $alreadyExists->errorMessage() );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $alreadyExists->count() ) {
|
||||
Debug::info( 'email already subscribed.' );
|
||||
return false;
|
||||
}
|
||||
$fields = [
|
||||
'email' => $email,
|
||||
'confirmationCode' => Code::genConfirmation(),
|
||||
'confirmed' => 0,
|
||||
'subscribed' => time(),
|
||||
];
|
||||
self::$db->insert( $this->tableName, $fields );
|
||||
return self::$db->lastId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an email from the subscribers database.
|
||||
*
|
||||
* @param string $email - The email you are trying to remove.
|
||||
* @param string $code - The confirmation code to unsubscribe.
|
||||
* @return boolean
|
||||
*/
|
||||
public function unsubscribe( $email, $code ) {
|
||||
if ( !Check::email( $email ) ) {
|
||||
return false;
|
||||
}
|
||||
$user = self::$db->get( $this->tableName, ['email', '=', $email, 'AND', 'confirmationCode', '=', $code] );
|
||||
if ( !$user->count() ) {
|
||||
Debug::info( __METHOD__ . ' - Cannot find subscriber with that email and code' );
|
||||
return false;
|
||||
}
|
||||
self::$db->delete( $this->tableName, ['ID', '=', $user->first()->ID] );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a subscriber object for the provided email address.
|
||||
*
|
||||
* @param string $email - An email address to look for.
|
||||
* @return bool|object - Depending on success.
|
||||
*/
|
||||
public function get( $email ) {
|
||||
if ( !Check::email( $email ) ) {
|
||||
return false;
|
||||
}
|
||||
$data = self::$db->get( $this->tableName, ['email', '=', $email] );
|
||||
if ( !$data->count() ) {
|
||||
Debug::info( __METHOD__ . ' - Email not found' );
|
||||
return false;
|
||||
}
|
||||
return (object) $data->first();
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
<?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 {
|
||||
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 );
|
||||
Components::set( 'FOOTER_RIGHT', Views::simpleView( 'subscribe.footer.right') );
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
<input type="email" placeholder="Email" id="email" name="email">
|
||||
<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>
|
@ -1,37 +0,0 @@
|
||||
<legend>Subscribers</legend>
|
||||
{PAGINATION}
|
||||
<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" role="button"><i class="glyphicon glyphicon-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" role="button">Add</a>
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger">Delete</button>
|
||||
</form>
|
@ -1,5 +0,0 @@
|
||||
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal">
|
||||
<input type="email" placeholder="Email" id="email" name="email" autocomplete="email">
|
||||
<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>
|
@ -1,5 +0,0 @@
|
||||
<form action="{ROOT_URL}home/unsubscribe" method="post" class="form-horizontal">
|
||||
<input type="email" placeholder="Email" id="email" name="email">
|
||||
<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>
|
85
app/plugins/updates/controllers/updates.php
Normal file
85
app/plugins/updates/controllers/updates.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/updates/controllers/updates.php
|
||||
*
|
||||
* This is the status updates controller.
|
||||
*
|
||||
* @package TP Status-Updates
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Controllers;
|
||||
|
||||
use TheTempusProject\Hermes\Functions\Redirect;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Functions\Session;
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Classes\Controller;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Models\Update;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
|
||||
class Updates extends Controller {
|
||||
protected static $updates;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
self::$updates = new Update;
|
||||
self::$title = 'Status Updates - {SITENAME}';
|
||||
self::$pageDescription = 'On this page you can view and post new status updates.';
|
||||
if ( ! App::$isLoggedIn ) {
|
||||
return Issues::add( 'notice', 'You must be logged in to post or view statuses.' );
|
||||
}
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$updates = self::$updates->byUser( App::$activeUser->ID );
|
||||
Components::set( 'list', Views::simpleView( 'updates.list', $updates ) );
|
||||
Components::set( 'create', Views::simpleView( 'updates.create' ) );
|
||||
|
||||
if ( ! Input::exists() ) {
|
||||
return Views::view( 'updates.dash' );
|
||||
}
|
||||
|
||||
if ( ! Forms::check( 'createUpdate' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your report.' => Check::userErrors() ] );
|
||||
return Views::view( 'updates.dash' );
|
||||
}
|
||||
|
||||
$result = self::$updates->create( Input::post( 'status' ) );
|
||||
|
||||
if ( true === $result ) {
|
||||
Issues::add( 'success', 'Your status has been posted.' );
|
||||
} else {
|
||||
Issues::add( 'error', 'There was an unresolved error while submitting your status.' );
|
||||
}
|
||||
|
||||
return Views::view( 'updates.dash' );
|
||||
}
|
||||
|
||||
public function post() {
|
||||
if ( ! Input::exists() ) {
|
||||
return Views::view( 'updates.create' );
|
||||
}
|
||||
if ( !Forms::check( 'createUpdate' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your report.' => Check::userErrors() ] );
|
||||
return Views::view( 'updates.create' );
|
||||
}
|
||||
$result = self::$updates->create( Input::post( 'status' ) );
|
||||
if ( true === $result ) {
|
||||
Session::flash( 'success', 'Your status has been posted.' );
|
||||
Redirect::to( 'home/index' );
|
||||
} else {
|
||||
Issues::add( 'error', 'There was an unresolved error while submitting your status.' );
|
||||
return Views::view( 'updates.create' );
|
||||
}
|
||||
}
|
||||
|
||||
public function byUser( $id = null ) {
|
||||
}
|
||||
}
|
36
app/plugins/updates/forms.php
Normal file
36
app/plugins/updates/forms.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/updates/forms.php
|
||||
*
|
||||
* This houses all of the form checking functions for this plugin.
|
||||
*
|
||||
* @package TP Status-Updates
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Plugins\Updates;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
|
||||
class UpdateForms extends Forms {
|
||||
/**
|
||||
* Adds these functions to the form list.
|
||||
*/
|
||||
public function __construct() {
|
||||
self::addHandler( 'createUpdate', __CLASS__, 'createUpdate' );
|
||||
}
|
||||
|
||||
public static function createUpdate() {
|
||||
if ( ! Input::exists( 'status' ) ) {
|
||||
Check::addUserError( 'You must provide an status.' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
new UpdateForms;
|
87
app/plugins/updates/models/update.php
Normal file
87
app/plugins/updates/models/update.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/updates/models/update.php
|
||||
*
|
||||
* This class is used for the manipulation of the status_updates database table.
|
||||
*
|
||||
* @package TP Status-Updates
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
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\Updates as Plugin;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
|
||||
class Update extends DatabaseModel {
|
||||
public $tableName = 'status_updates';
|
||||
public $databaseMatrix = [
|
||||
[ 'status', 'varchar', '512' ],
|
||||
[ 'createdAt', 'int', '10' ],
|
||||
[ 'createdBy', 'int', '10' ],
|
||||
[ 'updatedAt', 'int', '10' ],
|
||||
[ 'updatedBy', 'int', '10' ],
|
||||
[ 'deletedAt', 'int', '10' ],
|
||||
[ 'deletedBy', 'int', '10' ],
|
||||
];
|
||||
public $plugin;
|
||||
|
||||
/**
|
||||
* The model constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->plugin = new Plugin;
|
||||
}
|
||||
public function create( $status ) {
|
||||
if ( ! $this->plugin->checkEnabled() ) {
|
||||
Debug::info( 'Status-Updates are disabled in the config.' );
|
||||
return false;
|
||||
}
|
||||
$fields = [
|
||||
'status' => $status,
|
||||
'createdAt' => time(),
|
||||
'createdBy' => App::$activeUser->ID,
|
||||
];
|
||||
if ( !self::$db->insert( $this->tableName, $fields ) ) {
|
||||
Debug::info( 'Status-Updates::create - failed to insert to db' );
|
||||
return false;
|
||||
}
|
||||
return self::$db->lastId();
|
||||
}
|
||||
public function update( $status ) {
|
||||
if ( !$this->plugin->checkEnabled() ) {
|
||||
Debug::info( 'Status-Updates are disabled in the config.' );
|
||||
return false;
|
||||
}
|
||||
$fields = [
|
||||
'status' => $status,
|
||||
'updatedAt' => time(),
|
||||
'updatedBy' => App::$activeUser->ID,
|
||||
];
|
||||
if ( !self::$db->update( $this->tableName, $id, $fields ) ) {
|
||||
Debug::info( 'Status-Updates::update - failed to update to db' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public function byUser( $userID, $limit = null ) {
|
||||
$whereClause = [ 'createdBy', '=', $userID ];
|
||||
if ( empty( $limit ) ) {
|
||||
$reviews = self::$db->get( $this->tableName, $whereClause );
|
||||
} else {
|
||||
$reviews = self::$db->get( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
|
||||
}
|
||||
if ( !$reviews->count() ) {
|
||||
Debug::info( 'No Reviews found.' );
|
||||
return false;
|
||||
}
|
||||
return $this->filter( $reviews->results() );
|
||||
}
|
||||
}
|
30
app/plugins/updates/plugin.php
Normal file
30
app/plugins/updates/plugin.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/updates/plugin.php
|
||||
*
|
||||
* This houses all of the main plugin info and functionality.
|
||||
*
|
||||
* @package TP Status-Updates
|
||||
* @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 TheTempusProject\Classes\Plugin;
|
||||
|
||||
class Updates extends Plugin {
|
||||
public $pluginName = 'TP Status-Updates';
|
||||
public $pluginAuthor = 'JoeyK';
|
||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
||||
public $modelVersion = '1.0';
|
||||
public $pluginVersion = '3.0';
|
||||
public $pluginDescription = 'A simple plugin which adds a user status update system.';
|
||||
public $permissionMatrix = [
|
||||
'updates' => [
|
||||
'pretty' => 'Can create status updates',
|
||||
'default' => false,
|
||||
],
|
||||
];
|
||||
}
|
10
app/plugins/updates/views/create.html
Normal file
10
app/plugins/updates/views/create.html
Normal file
@ -0,0 +1,10 @@
|
||||
<div class="container mt-5">
|
||||
<h2>Update your status</h2>
|
||||
<form id="status-form" method="post">
|
||||
<div class="form-group">
|
||||
<label for="status">Your Status:</label>
|
||||
<textarea class="form-control" id="status" name="status" rows="5" required></textarea>
|
||||
</div>
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block ">Submit</button>
|
||||
</form>
|
||||
</div>
|
2
app/plugins/updates/views/dash.html
Normal file
2
app/plugins/updates/views/dash.html
Normal file
@ -0,0 +1,2 @@
|
||||
{list}
|
||||
{create}
|
26
app/plugins/updates/views/list.html
Normal file
26
app/plugins/updates/views/list.html
Normal file
@ -0,0 +1,26 @@
|
||||
<legend>Updates</legend>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20%">Date</th>
|
||||
<th style="width: 70%">Status</th>
|
||||
<th style="width: 10%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td align="center">{DTC}{createdAt}{/DTC}</td>
|
||||
<td align="center">{status}</td>
|
||||
<td><a href="{ROOT_URL}updates/delete/{ID}" class="btn btn-sm btn-danger" role="button"><i class="glyphicon glyphicon-trash"></i></a></td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td align="center" colspan="6">
|
||||
No results to show.
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
102
app/plugins/wip/controllers/admin/wip.php
Normal file
102
app/plugins/wip/controllers/admin/wip.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/wip/controllers/admin/wip.php
|
||||
*
|
||||
* This is the projects admin controller.
|
||||
*
|
||||
* @package TP Wip
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Controllers\Admin;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Classes\AdminController;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Models\Projects;
|
||||
|
||||
class Wip extends AdminController {
|
||||
public static $projects;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
self::$projects = new Projects;
|
||||
self::$title = 'Admin - Projects';
|
||||
$view = Navigation::activePageSelect( 'nav.admin', '/admin/wip' );
|
||||
Components::set( 'ADMINNAV', $view );
|
||||
}
|
||||
|
||||
public function index( $data = null ) {
|
||||
Views::view( 'wip.admin.list', self::$projects->listPaginated() );
|
||||
}
|
||||
|
||||
public function create( $data = null ) {
|
||||
if ( !Input::exists( 'submit' ) ) {
|
||||
return Views::view( 'wip.admin.create' );
|
||||
}
|
||||
if ( !Forms::check( 'newProject' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
$result = self::$projects->create( Input::post( 'title' ), Input::post( 'description' ), Input::post( 'progress' ), Input::post( 'startDate' ) );
|
||||
if ( $result ) {
|
||||
Issues::add( 'success', 'Your projects has been created.' );
|
||||
return $this->index();
|
||||
} else {
|
||||
Issues::add( 'error', [ 'There was an unknown error submitting your data.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
}
|
||||
|
||||
public function edit( $data = null ) {
|
||||
if ( !Input::exists( 'submit' ) ) {
|
||||
return Views::view( 'wip.admin.edit', self::$projects->findById( $data ) );
|
||||
}
|
||||
if ( !Forms::check( 'editProject' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
$fields = [
|
||||
'title' => Input::post( 'title' ),
|
||||
'description' => Input::post( 'description' ),
|
||||
'progress' => Input::post( 'progress' ),
|
||||
'startDate' => Input::post( 'startDate' ),
|
||||
];
|
||||
if ( self::$projects->update( $data, $fields ) ) {
|
||||
Issues::add( 'success', 'Projects Updated.' );
|
||||
return $this->index();
|
||||
}
|
||||
Issues::add( 'error', 'There was an error with your request.' );
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function view( $data = null ) {
|
||||
$projectData = self::$projects->findById( $data );
|
||||
if ( $projectData !== false ) {
|
||||
return Views::view( 'wip.admin.view', $projectData );
|
||||
}
|
||||
Issues::add( 'error', 'Projects not found.' );
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function delete( $data = null ) {
|
||||
if ( $data == null ) {
|
||||
if ( Input::exists( 'P_' ) ) {
|
||||
$data = Input::post( 'P_' );
|
||||
}
|
||||
}
|
||||
if ( !self::$projects->delete( (array) $data ) ) {
|
||||
Issues::add( 'error', 'There was an error with your request.' );
|
||||
} else {
|
||||
Issues::add( 'success', 'Projects has been deleted' );
|
||||
}
|
||||
$this->index();
|
||||
}
|
||||
}
|
36
app/plugins/wip/controllers/wip.php
Normal file
36
app/plugins/wip/controllers/wip.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/wip/controllers/wip.php
|
||||
*
|
||||
* This is the bug reports controller.
|
||||
*
|
||||
* @package TP Wip
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Controllers;
|
||||
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Classes\Controller;
|
||||
use TheTempusProject\Models\Projects;
|
||||
|
||||
class Wip extends Controller {
|
||||
protected static $projects;
|
||||
|
||||
public function index() {
|
||||
self::$projects = new Projects;
|
||||
self::$title = '{SITENAME} - Works in Progress';
|
||||
self::$pageDescription = 'Its not the longest wip in the world, but I\'m certainly proud of it.';
|
||||
|
||||
$projects = self::$projects->listPaginated();
|
||||
if ( false == $projects ) {
|
||||
Issues::add( 'error', 'Well, this is embarrassing, surely he wouldn\'t just have no wip..... right.... Dave? ... erm Joey?' );
|
||||
return;
|
||||
} else {
|
||||
Views::view( 'wip.wip', self::$projects->listPaginated() );
|
||||
}
|
||||
}
|
||||
}
|
79
app/plugins/wip/forms.php
Normal file
79
app/plugins/wip/forms.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/wip/forms.php
|
||||
*
|
||||
* This houses all of the form checking functions for this plugin.
|
||||
*
|
||||
* @package TP Wip
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Plugins\Wip;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
|
||||
class WipForms extends Forms {
|
||||
/**
|
||||
* Adds these functions to the form list.
|
||||
*/
|
||||
public function __construct() {
|
||||
self::addHandler( 'newProject', __CLASS__, 'newProject' );
|
||||
self::addHandler( 'editProject', __CLASS__, 'editProject' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the new project post form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function newProject() {
|
||||
if ( !Input::exists( 'title' ) ) {
|
||||
self::addUserError( 'You must specify title' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'description' ) ) {
|
||||
self::addUserError( 'You must specify description' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'progress' ) ) {
|
||||
self::addUserError( 'You must specify progress' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'startDate' ) ) {
|
||||
self::addUserError( 'You must specify startDate' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the edit project post form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function editProject() {
|
||||
if ( !Input::exists( 'title' ) ) {
|
||||
self::addUserError( 'You must specify title' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'description' ) ) {
|
||||
self::addUserError( 'You must specify description' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'progress' ) ) {
|
||||
self::addUserError( 'You must specify progress' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'startDate' ) ) {
|
||||
self::addUserError( 'You must specify startDate' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
new WipForms;
|
85
app/plugins/wip/models/projects.php
Normal file
85
app/plugins/wip/models/projects.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/wip/models/projects.php
|
||||
*
|
||||
* This class is used for the manipulation of the projects database table.
|
||||
*
|
||||
* @package TP WIP
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
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\Wip as Plugin;
|
||||
|
||||
class Projects extends DatabaseModel {
|
||||
public $tableName = 'projects';
|
||||
public $databaseMatrix = [
|
||||
[ 'title', 'varchar', '128' ],
|
||||
[ 'description', 'text', '' ],
|
||||
[ 'progress', 'int', '3' ],
|
||||
[ 'startDate', 'varchar', '32' ],
|
||||
];
|
||||
public $plugin;
|
||||
|
||||
/**
|
||||
* The model constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->plugin = new Plugin;
|
||||
}
|
||||
|
||||
public function create( $title, $description, $progress, $startDate ) {
|
||||
if ( !$this->plugin->checkEnabled() ) {
|
||||
Debug::info( 'Wip is disabled in the config.' );
|
||||
return false;
|
||||
}
|
||||
$fields = [
|
||||
'title' => $title,
|
||||
'description' => $description,
|
||||
'progress' => $progress,
|
||||
'startDate' => $startDate,
|
||||
];
|
||||
if ( !self::$db->insert( $this->tableName, $fields ) ) {
|
||||
Debug::info( 'Projects::create - failed to insert to db' );
|
||||
return false;
|
||||
}
|
||||
return self::$db->lastId();
|
||||
}
|
||||
|
||||
public function update( $id, $fields ) {
|
||||
if ( !Check::id( $id ) ) {
|
||||
Debug::info( 'Project:update: illegal ID.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::$db->update( $this->tableName, $id, $fields ) ) {
|
||||
// new CustomException( 'projectUpdate' );
|
||||
Debug::error( "Project:update: $id not updated: $fields" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function filter( $postArray, $params = [] ) {
|
||||
foreach ( $postArray as $instance ) {
|
||||
if ( !is_object( $instance ) ) {
|
||||
$instance = $postArray;
|
||||
$end = true;
|
||||
}
|
||||
$instance->prettyStart = $instance->startDate;
|
||||
$out[] = $instance;
|
||||
if ( !empty( $end ) ) {
|
||||
$out = $out[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
44
app/plugins/wip/plugin.php
Normal file
44
app/plugins/wip/plugin.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/wip/plugin.php
|
||||
*
|
||||
* This houses all of the main plugin info and functionality.
|
||||
*
|
||||
* @package TP Wip
|
||||
* @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 TheTempusProject\Classes\Plugin;
|
||||
|
||||
class Wip extends Plugin {
|
||||
public $pluginName = 'TP Wip';
|
||||
public $pluginAuthor = 'JoeyK';
|
||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
||||
public $modelVersion = '1.0';
|
||||
public $pluginVersion = '3.0';
|
||||
public $pluginDescription = 'A simple plugin which adds management for a wip.';
|
||||
public $configName = 'wip';
|
||||
public $configMatrix = [
|
||||
'enabled' => [
|
||||
'type' => 'radio',
|
||||
'pretty' => 'Enable the wip Feature.',
|
||||
'default' => true,
|
||||
],
|
||||
];
|
||||
public $main_links = [
|
||||
[
|
||||
'text' => 'WIP',
|
||||
'url' => '{ROOT_URL}wip/index',
|
||||
],
|
||||
];
|
||||
public $admin_links = [
|
||||
[
|
||||
'text' => '<i class="fa fa-fw fa-support"></i> Wip',
|
||||
'url' => '{ROOT_URL}admin/wip',
|
||||
],
|
||||
];
|
||||
}
|
16
app/plugins/wip/views/admin/create.html
Normal file
16
app/plugins/wip/views/admin/create.html
Normal file
@ -0,0 +1,16 @@
|
||||
<h2>Create Project</h2>
|
||||
<form action="#" method="POST">
|
||||
<label for="title">Title:</label><br>
|
||||
<input type="text" id="title" name="title" required><br><br>
|
||||
|
||||
<label for="progress">Progress:</label><br>
|
||||
<input type="text" id="progress" name="progress" required><br><br>
|
||||
|
||||
<label for="startDate">Start Month/Year:</label><br>
|
||||
<input type="month" id="startDate" name="startDate" required><br><br>
|
||||
|
||||
<label for="description">Description:</label><br>
|
||||
<textarea id="description" name="description" rows="20" cols="50" required></textarea><br><br>
|
||||
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
</form>
|
16
app/plugins/wip/views/admin/edit.html
Normal file
16
app/plugins/wip/views/admin/edit.html
Normal file
@ -0,0 +1,16 @@
|
||||
<h2>Edit Project</h2>
|
||||
<form action="#" method="POST">
|
||||
<label for="title">Title:</label><br>
|
||||
<input type="text" id="title" name="title" value="{title}" required><br><br>
|
||||
|
||||
<label for="progress">Progress:</label><br>
|
||||
<input type="text" id="progress" name="progress" value="{progress}" required><br><br>
|
||||
|
||||
<label for="startDate">Start Month/Year:</label><br>
|
||||
<input type="month" id="startDate" name="startDate" value="{startDate}" required><br><br>
|
||||
|
||||
<label for="description">Description:</label><br>
|
||||
<textarea id="description" name="description" rows="20" cols="50" required>{description}</textarea><br><br>
|
||||
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
</form>
|
41
app/plugins/wip/views/admin/list.html
Normal file
41
app/plugins/wip/views/admin/list.html
Normal file
@ -0,0 +1,41 @@
|
||||
<legend>Works in Progress</legend>
|
||||
{PAGINATION}
|
||||
<form action="{ROOT_URL}admin/wip/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">Title</th>
|
||||
<th style="width: 20%">Progress</th>
|
||||
<th style="width: 20%">Start Date</th>
|
||||
<th style="width: 10%"></th>
|
||||
<th style="width: 10%"></th>
|
||||
<th style="width: 10%">
|
||||
<INPUT type="checkbox" onchange="checkAll(this)" name="check.b" value="P_[]"/>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td><a href="{ROOT_URL}admin/wip/view/{ID}">{title}</a></td>
|
||||
<td>{progress}</td>
|
||||
<td>{startDate}</td>
|
||||
<td><a href="{ROOT_URL}admin/wip/edit/{ID}" class="btn btn-sm btn-warning" role="button"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
<td><a href="{ROOT_URL}admin/wip/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="P_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
No results to show.
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="{ROOT_URL}admin/wip/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>
|
8
app/plugins/wip/views/admin/view.html
Normal file
8
app/plugins/wip/views/admin/view.html
Normal file
@ -0,0 +1,8 @@
|
||||
<legend>WIP</legend>
|
||||
<div class="wip-project">
|
||||
<h3 class="wip-project-title">{name}</h3>
|
||||
<p><b>{position}</b> from <i>{prettyStart}</i> to <i>{prettyEnd}</i></p>
|
||||
<div class="well">
|
||||
{details}
|
||||
</div>
|
||||
</div>
|
19
app/plugins/wip/views/wip.html
Normal file
19
app/plugins/wip/views/wip.html
Normal file
@ -0,0 +1,19 @@
|
||||
<h1>Work in Progress</h1>
|
||||
<hr>
|
||||
{LOOP}
|
||||
<div class="wip-project">
|
||||
<h3 class="wip-project-title">{title}</h3>
|
||||
<p><b>Started: </b><i>{prettyStart}</i></p>
|
||||
<div class="progress">
|
||||
<div class="progress-bar" role="progressbar" style="width: {progress}%" aria-valuenow="{progress}" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<div class="well">
|
||||
{description}
|
||||
</div>
|
||||
</div>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<div class="wip-project">
|
||||
<p>None Found</p>
|
||||
</div>
|
||||
{/ALT}
|
41
app/views/about.html
Normal file
41
app/views/about.html
Normal file
@ -0,0 +1,41 @@
|
||||
<h1>About Me</h1>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<img src="/images/on-call.jpg" class="img-responsive center-block" alt="Description of image" style="height: 480px;">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<img src="/images/voting.jpg" class="img-responsive center-block" alt="Description of image">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<img src="/images/cleaned-up.jpg" class="img-responsive center-block" alt="Description of image">
|
||||
</div>
|
||||
<div class="col-md-offset-2 col-md-8" style="padding-top: 20px;">
|
||||
<p>Generally speaking, I feel uncomfortable talking to anyone about myself.
|
||||
It may seem a bit hollow to say in the about-me section of a website bearing my own name, but its true.</p>
|
||||
|
||||
<p>My name is... Joey Kimsey and I am a 33 year old web-developer. I think it would be fair to say I am a full-stack developer though I find myself in and enjoy backend development more.
|
||||
Over the past decade I have moved from professionally designing popup advertising for major car manufacturers, to working for the CDC in a major time of crisis,
|
||||
to harassing AI to spread information to entrepreneurs in other languages. I love this technology and I love what we can do with it.</p>
|
||||
|
||||
<p>Things always get a bit awkward when i tell people I am 33 but I've been doing this for 20 years, but its true. When i was still in single-digits, we got our first PC, with windows 98.
|
||||
I won't lie to you about remembering the specs, but I can tell you that it changed the world for me. I believe we had internet access through our phone provider before, but eventually we wound up on AOL and the world expanded in front of me.
|
||||
There were websites for everything! and it was all new, they were still talking about the internet like it was something that was going to happen, but i was already living through it, it was already changing the world around me.</p>
|
||||
|
||||
<p>As many children do, i became curious, I wanted to know how the internet worked. I found out i could have my onw little spot on the internet. I found angelfire.
|
||||
I learned about html, images, pearl scripts, and I even made webpages for everything i liked: runescape, skateboarding, vampires. Eventually I really wanted to make something so my friends could send me messages on the website.
|
||||
At the time, pearl was pretty complicated, not many people used it, and it was heavily limited on free hosting. I needed to find a different way, so i started searching and eventually stumbled into php.</p>
|
||||
|
||||
<p>Once I found php, i fell in love with programming. Not only was the web new and fresh, i knew how it worked. I had a magical superpower that no one else did.
|
||||
Over the years i built dozens of projects including working for many local business-owners from a young age.
|
||||
I eventually went to college for computer science, where I learned that java is a terrible language and that i was more interested in building than learning how to build, so I dropped out.
|
||||
After working several jobs over the following years, I was given the opportunity by a close friend to move out of my small town.
|
||||
When i moved to Atlanta, I finally found an employer willing to give me a shot and my resume picks up from there.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
55
app/views/hire.html
Normal file
55
app/views/hire.html
Normal file
@ -0,0 +1,55 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h1>Interested in hiring me?</h1>
|
||||
<h3>
|
||||
<span class="label label-primary">Open To</span> Freelance / Limited Contract Work
|
||||
</h3>
|
||||
<h3>
|
||||
<span class="label label-success">Actively Seeking</span> Long-Term Contract Work
|
||||
</h3>
|
||||
<h3>
|
||||
<span class="label label-success">Actively Seeking</span> Salaried Positions
|
||||
</h3>
|
||||
|
||||
<h3>Disclaimer</h3>
|
||||
|
||||
<p>I am a full-stack developer but I am generally more capable at backend work. If your project is requires complex design elements or revisions, I may not be the right fit for your needs.</p>
|
||||
|
||||
<h3>Pricing</h3>
|
||||
|
||||
<p>When it comes to this industry; level-of-effort is the key to everything.
|
||||
With that in mind, it can be challenging to reliably quote a rate for my time.
|
||||
For most purposes my rate is $75/hour with a two hour minimum. With larger or repeat projects, compensation is more flexible.</p>
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
<h3>Contact</h3>
|
||||
<p>For privacy reasons, I do not make my personal contact details publicly available. In order to schedule a call or meeting, please connect with me on LinkedIn or use the contact form below.</p>
|
||||
<p>I am generally able to respond to requests within 24 hours.</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="contactEmail" class="col-lg-1 control-label">E-mail:</label>
|
||||
<div class="col-lg-2">
|
||||
<input class="form-control" type="text" name="contactEmail" id="contactEmail">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="details" class="col-lg-3 control-label">Details:<br> (max:2000 characters)</label>
|
||||
<div class="col-lg-6">
|
||||
<textarea class="form-control" name="details" maxlength="2000" rows="10" cols="50" id="details"></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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1 +1,159 @@
|
||||
lul, testing
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="container text-center">
|
||||
<div class="jumbotron text-center">
|
||||
<h1>Joey Kimsey</h1>
|
||||
<p>I tried to put something clever here, but when I didn't understand it later I changed it to:<br>
|
||||
There are too many stories to tell here but explore a few below.</p>
|
||||
<select class="form-control dropdown-big" style="width: auto; display: inline-block; margin-bottom: 20px;">
|
||||
{LOOP}
|
||||
<option>{option}</option>
|
||||
{/LOOP}
|
||||
</select>
|
||||
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
|
||||
</div>
|
||||
<p>Thanks for taking the time to learn more about me! Forgive the implied redundancy, but my name is Joey Kimsey, and I professionally describe myself as a web developer. On this site you will find a few
|
||||
brief writings on my career and personal life as well as links to various projects and other services. At this time I don't find much value in the social media platforms. While I do have them, they serve
|
||||
more as a reservation in my name than an active party.</p>
|
||||
<p>I would love to change the landscape of social media, but alas, I feel we need to give up "free" for "fees" lest we become the product.</p>
|
||||
<p>I live on inbox-zero, and for anyone willing to suffer my google assistant on the first call, I'm always available by phone. With that said, I do not make my personal email or phone number publicly
|
||||
available on this site. If anything here peaks your interest, or you just want to talk more about a project, feel free to contact me here and I should respond relatively quickly.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="media">
|
||||
<div class="media-left">
|
||||
<div id="carousel-career" class="carousel slide" data-ride="carousel" style="width: 150px; height: 150px;">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#carousel-career" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#carousel-career" data-slide-to="1"></li>
|
||||
<li data-target="#carousel-career" data-slide-to="2"></li>
|
||||
<li data-target="#carousel-career" data-slide-to="3"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner">
|
||||
<div class="item active">
|
||||
<img src="/images/ba.png" alt="First slide">
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/images/ione.png" alt="Second">
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/images/emeals.png" alt="eMeals">
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/images/springbot.png" alt="Springbot">
|
||||
</div>
|
||||
</div>
|
||||
<a href="#carousel-career" class="left carousel-control" data-slide="prev">
|
||||
<span class="glyphicon glyphicon-chevron-left"></span>
|
||||
</a>
|
||||
<a href="#carousel-career" class="right carousel-control" data-slide="next">
|
||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="media-body media-middle">
|
||||
<h4 class="media-heading">My Career</h4>
|
||||
<p>From IPB to ChatGPT and everything in-between; I have worked with, and on, many platforms. What I would refer to as my "professional experience" spans 7 years but my experience
|
||||
in this field spans another decade at least. Learn more when you view my Resume. It can be viewed, downloaded, and expounded upon via my blog. Feel free to explore and follow up with any questions.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="media">
|
||||
<div class="media-body media-middle">
|
||||
<h4 class="media-heading">My Products</h4>
|
||||
<p>One of the downfalls I have as a developer is failing to save my failures. (trust me, its less philosophical than it sounds) Many times when I finish projects, or call it quits, the code is
|
||||
either resigned to its life in production where I would prefer it not to be publicly available, or It goes to the big backup disk in the sky. When you factor in my immense respect
|
||||
for lawyers and the whimsically worded writs they have me sign; I am left with limited examples to share. Fortunately II have some long running project examples which are available for download and review.</p>
|
||||
</div>
|
||||
<div class="media-right">
|
||||
<div id="carousel-products" class="carousel slide" data-ride="carousel" style="width: 150px; height: 150px;">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#carousel-products" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#carousel-products" data-slide-to="1"></li>
|
||||
<li data-target="#carousel-products" data-slide-to="2"></li>
|
||||
<li data-target="#carousel-products" data-slide-to="3"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner">
|
||||
<div class="item active">
|
||||
<img src="/images/AAA_M_Additions.png" alt="First slide">
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/images/bedrock.jpg" alt="Second slide">
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/images/canary.jpg" alt="Third slide">
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/images/houdini.jpg" alt="Third slide">
|
||||
</div>
|
||||
</div>
|
||||
<a href="#carousel-products" class="left carousel-control" data-slide="prev">
|
||||
<span class="glyphicon glyphicon-chevron-left"></span>
|
||||
</a>
|
||||
<a href="#carousel-products" class="right carousel-control" data-slide="next">
|
||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="media">
|
||||
<div class="media-left">
|
||||
<div id="carousel-projects" class="carousel slide" data-ride="carousel" style="width: 150px; height: 150px;">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#carousel-projects" data-slide-to="0" class="active"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner">
|
||||
<div class="item active">
|
||||
<img src="/images/tte.png" alt="First slide">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="media-body media-middle">
|
||||
<h4 class="media-heading">My Projects</h4>
|
||||
<p>At any given time I have at least a half dozen projects in various stages of completion. As most could attest; interests peak and
|
||||
wain as moods and times change. Here you can find a brief overview of the various projects I am devoting some level of attention to.
|
||||
Not guaranteed acuate, and not guaranteed complete, but you're here anyways, so take a peak behind the homepage </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="media">
|
||||
<div class="media-body media-middle">
|
||||
<h4 class="media-heading">Contact Me</h4>
|
||||
<p>While II do not make my phone number or email available, you can still reach out about anything using my contact form here.</p>
|
||||
</div>
|
||||
<div class="media-right">
|
||||
<a href="/contact">
|
||||
<img class="media-object" src="/images/vacation.jpg" alt="still-working" style="width: 150px; height: 150px;">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user