Add very basic context buttons to album pages.

This commit is contained in:
Aaron van Geffen 2016-09-04 14:49:13 +02:00
parent ddcc28aff6
commit 2d77fbdbb7
3 changed files with 57 additions and 0 deletions

View File

@ -57,6 +57,17 @@ class ViewPhotoAlbum extends HTMLController
if (isset($header_box))
$this->page->adopt($header_box);
$this->page->adopt(new AlbumButtonBox([
[
'url' => BASEURL . '/uploadmedia/?tag=' . $id_tag,
'caption' => 'Upload new photos here',
],
[
'url' => BASEURL . '/addalbum/?tag=' . $id_tag,
'caption' => 'Create new subalbum here',
]
]));
// Fetch subalbums, but only if we're on the first page.
if ($page === 1)
{

View File

@ -314,6 +314,23 @@ ul#nav li a:hover {
}
/* Album button box
---------------------*/
.album_button_box {
float: right;
margin-bottom: 20px;
}
.album_button_box > a {
background: #fff;
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
display: inline-block;
float: left;
font-size: 1em;
padding: 8px 10px;
margin-left: 12px;
}
/* Generic boxed content
--------------------------*/
.boxed_content {
@ -703,6 +720,7 @@ a#previous_photo:hover, a#next_photo:hover {
border-color: #aaa;
}
/* Spinner animation
----------------------*/
.spinner {

View File

@ -0,0 +1,28 @@
<?php
/*****************************************************************************
* AlbumButtonBox.php
* Defines the AlbumButtonBox template.
*
* Kabuki CMS (C) 2013-2016, Aaron van Geffen
*****************************************************************************/
class AlbumButtonBox extends SubTemplate
{
public function __construct($buttons)
{
$this->buttons = $buttons;
}
protected function html_content()
{
echo '
<div class="album_button_box">';
foreach ($this->buttons as $button)
echo '
<a href="', $button['url'], '">', $button['caption'], '</a>';
echo '
</div>';
}
}