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

@ -16,10 +16,7 @@
body {
font-family: "Open Sans", sans-serif;
padding: 0 0 3em;
margin: 0;
background: #aaa 0 -50% fixed;
background-image: radial-gradient(ellipse at top, #ccc 0%, #aaa 55%, #333 100%);
}
#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_header {

View File

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

View File

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

View File

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

View File

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

View File

@ -18,14 +18,14 @@ class MediaUploader extends SubTemplate
protected function html_content()
{
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>
<div>
<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>
<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 id="upload_preview_area">
</div>

View File

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

View File

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

View File

@ -8,10 +8,32 @@
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()
{
echo $this->html_content();
echo '
<div class="', $this->_class, '"', isset($this->_id) ? ' id="' . $this->_id . '"' : '', '>',
$this->html_content(), '
</div>';
}
abstract protected function html_content();
public function setClassName($className)
{
$this->_class = $className;
}
public function setDOMId($id)
{
$this->_id = $id;
}
}