diff --git a/controllers/ViewPhotoAlbum.php b/controllers/ViewPhotoAlbum.php index 32b2ecef..3cc48769 100644 --- a/controllers/ViewPhotoAlbum.php +++ b/controllers/ViewPhotoAlbum.php @@ -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) { diff --git a/public/css/default.css b/public/css/default.css index 4b38af8e..2129e5eb 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -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 { diff --git a/templates/AlbumButtonBox.php b/templates/AlbumButtonBox.php new file mode 100644 index 00000000..5228fe78 --- /dev/null +++ b/templates/AlbumButtonBox.php @@ -0,0 +1,28 @@ +buttons = $buttons; + } + + protected function html_content() + { + echo ' +
'; + + foreach ($this->buttons as $button) + echo ' + ', $button['caption'], ''; + + echo ' +
'; + } +}