SubTemplate: use SubTemplates for boxed content only

This commit is contained in:
Aaron van Geffen 2023-03-11 13:37:59 +01:00
parent 0366df9b5f
commit 307d34430a
9 changed files with 53 additions and 23 deletions

View File

@ -8,18 +8,15 @@
@import url(//fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic); @import url(//fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic);
@font-face { @font-face {
font-family: 'Invaders'; font-family: 'Invaders';
src: url('fonts/invaders.ttf') format('truetype'); src: url('fonts/invaders.ttf') format('truetype');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
body { body {
font-family: "Open Sans", sans-serif; font-family: "Open Sans", sans-serif;
padding: 0 0 3em;
margin: 0;
background: #aaa 0 -50% fixed; background: #aaa 0 -50% fixed;
background-image: radial-gradient(ellipse at top, #ccc 0%, #aaa 55%, #333 100%);
} }
#wrapper, header { #wrapper, header {
@ -94,6 +91,17 @@ ul#nav li a:hover {
} }
/* Content boxes
------------------*/
.content-box {
background-color: #fff;
margin: 0 auto 2rem;
padding: 2rem;
border-radius: 0.5rem;
box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}
/* Tiled grid /* Tiled grid
---------------*/ ---------------*/
.tiled_header { .tiled_header {

View File

@ -6,11 +6,11 @@
* Kabuki CMS (C) 2013-2015, Aaron van Geffen * Kabuki CMS (C) 2013-2015, Aaron van Geffen
*****************************************************************************/ *****************************************************************************/
class AdminBar extends SubTemplate class AdminBar extends Template
{ {
private $extra_items = []; private $extra_items = [];
protected function html_content() public function html_main()
{ {
echo ' echo '
<div id="admin_bar"> <div id="admin_bar">

View File

@ -6,7 +6,7 @@
* Kabuki CMS (C) 2013-2016, Aaron van Geffen * Kabuki CMS (C) 2013-2016, Aaron van Geffen
*****************************************************************************/ *****************************************************************************/
class AlbumButtonBox extends SubTemplate class AlbumButtonBox extends Template
{ {
private $buttons; private $buttons;
@ -15,7 +15,7 @@ class AlbumButtonBox extends SubTemplate
$this->buttons = $buttons; $this->buttons = $buttons;
} }
protected function html_content() public function html_main()
{ {
echo ' echo '
<div class="album_button_box">'; <div class="album_button_box">';

View File

@ -6,7 +6,7 @@
* Kabuki CMS (C) 2013-2016, Aaron van Geffen * Kabuki CMS (C) 2013-2016, Aaron van Geffen
*****************************************************************************/ *****************************************************************************/
class AlbumHeaderBox extends SubTemplate class AlbumHeaderBox extends Template
{ {
private $back_link_title; private $back_link_title;
private $back_link; private $back_link;
@ -21,7 +21,7 @@ class AlbumHeaderBox extends SubTemplate
$this->back_link_title = $back_link_title; $this->back_link_title = $back_link_title;
} }
protected function html_content() public function html_main()
{ {
echo ' echo '
<div class="album_title_box"> <div class="album_title_box">

View File

@ -6,7 +6,7 @@
* Kabuki CMS (C) 2013-2015, Aaron van Geffen * Kabuki CMS (C) 2013-2015, Aaron van Geffen
*****************************************************************************/ *****************************************************************************/
class AlbumIndex extends SubTemplate class AlbumIndex extends Template
{ {
protected $albums; protected $albums;
protected $show_edit_buttons; protected $show_edit_buttons;
@ -23,7 +23,7 @@ class AlbumIndex extends SubTemplate
$this->show_labels = $show_labels; $this->show_labels = $show_labels;
} }
protected function html_content() public function html_main()
{ {
echo ' echo '
<div class="tiled_grid clearfix">'; <div class="tiled_grid clearfix">';

View File

@ -18,14 +18,14 @@ class MediaUploader extends SubTemplate
protected function html_content() protected function html_content()
{ {
echo ' echo '
<form action="', BASEURL, '/uploadmedia/?tag=', $this->tag->id_tag, '" class="boxed_content" method="post" enctype="multipart/form-data"> <form action="', BASEURL, '/uploadmedia/?tag=', $this->tag->id_tag, '" method="post" enctype="multipart/form-data">
<h2>Upload new photos to &quot;', $this->tag->tag, '&quot;</h2> <h2>Upload new photos to &quot;', $this->tag->tag, '&quot;</h2>
<div> <div>
<h3>Select files</h3> <h3>Select files</h3>
<input type="file" id="upload_queue" name="uploads[]" multiple> <input class="form-control" type="file" id="upload_queue" name="uploads[]" multiple>
</div> </div>
<div> <div>
<input name="save" id="photo_submit" type="submit" value="Upload the lot"> <input class="btn btn-primary" name="save" id="photo_submit" type="submit" value="Upload the lot">
</div> </div>
<div id="upload_preview_area"> <div id="upload_preview_area">
</div> </div>

View File

@ -6,7 +6,7 @@
* Kabuki CMS (C) 2013-2016, Aaron van Geffen * Kabuki CMS (C) 2013-2016, Aaron van Geffen
*****************************************************************************/ *****************************************************************************/
class PhotoPage extends SubTemplate class PhotoPage extends Template
{ {
protected $photo; protected $photo;
private $exif; private $exif;
@ -34,7 +34,7 @@ class PhotoPage extends SubTemplate
$this->is_asset_owner = $flag; $this->is_asset_owner = $flag;
} }
protected function html_content() public function html_main()
{ {
$this->photoNav(); $this->photoNav();
$this->photo(); $this->photo();

View File

@ -6,7 +6,7 @@
* Kabuki CMS (C) 2013-2015, Aaron van Geffen * Kabuki CMS (C) 2013-2015, Aaron van Geffen
*****************************************************************************/ *****************************************************************************/
class PhotosIndex extends SubTemplate class PhotosIndex extends Template
{ {
protected $mosaic; protected $mosaic;
protected $show_edit_buttons; protected $show_edit_buttons;
@ -42,7 +42,7 @@ class PhotosIndex extends SubTemplate
$this->show_labels = $show_labels; $this->show_labels = $show_labels;
} }
protected function html_content() public function html_main()
{ {
echo ' echo '
<div class="tiled_grid clearfix">'; <div class="tiled_grid clearfix">';

View File

@ -8,10 +8,32 @@
abstract class SubTemplate extends Template abstract class SubTemplate extends Template
{ {
protected $_class = 'content-box container';
protected $_id;
protected $_title;
public function __construct($title = '')
{
$this->_title = $title;
}
public function html_main() public function html_main()
{ {
echo $this->html_content(); echo '
<div class="', $this->_class, '"', isset($this->_id) ? ' id="' . $this->_id . '"' : '', '>',
$this->html_content(), '
</div>';
} }
abstract protected function html_content(); abstract protected function html_content();
public function setClassName($className)
{
$this->_class = $className;
}
public function setDOMId($id)
{
$this->_id = $id;
}
} }