summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-10-21 14:08:29 -0400
committerJules Laplace <jules@okfoc.us>2014-10-21 14:08:29 -0400
commitd80ba1570ecf6e5fdb16d24c6f0ad189492a8bd8 (patch)
tree0d741d88338bd78d424739bd075e4bdd6e139f0d
parenta8c9c1198a8872c7ebcf3db920d2de3fe721bfc3 (diff)
gallery view on staff
-rw-r--r--views/staff/_gallery.ejs38
-rw-r--r--views/staff/users/media.ejs4
2 files changed, 40 insertions, 2 deletions
diff --git a/views/staff/_gallery.ejs b/views/staff/_gallery.ejs
new file mode 100644
index 0000000..d5948e3
--- /dev/null
+++ b/views/staff/_gallery.ejs
@@ -0,0 +1,38 @@
+[[ media.forEach(function(media){ ]]
+ <div class="media">
+ [[ if (media.type == "image") { ]]
+ <a class="medialink" href="[[- media.url ]]" target="_blank"><img src="[[- media.url ]]"></a>
+ [[ } else { ]]
+ <a class="medialink" href="[[- media.url ]]" target="_blank">[[- media.shortUrl ]]</a>
+ [[ } ]]
+ <br>
+ <a href="/staff/media/[[- media._id ]]">[view]</a>
+ <a href="/staff/users/[[- media.user.username ]]">[[- media.user.username ]]</a>
+ [[- media.date ]]
+ </div>
+[[ }) ]]
+</table>
+
+<style>
+.media {
+ height: 28vw;
+ width: 24vw;
+ margin: 1vw;
+ display: inline-block;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.staff .body a.medialink {
+ width: 24vw;
+ height: 24vw;
+ display: block;
+ overflow: hidden;
+ color: #00f;
+ border: 0;
+ text-decoration: underline;
+}
+.staff .body a.medialink img {
+ max-width: 100%;
+}
+</style> \ No newline at end of file
diff --git a/views/staff/users/media.ejs b/views/staff/users/media.ejs
index b13e5fb..a44ad6a 100644
--- a/views/staff/users/media.ejs
+++ b/views/staff/users/media.ejs
@@ -1,6 +1,6 @@
[[ include ../_header ]]
- <h1>Users</h1>
+ <h1>User Media</h1>
<nav>
<a href="/staff">home</a>
@@ -12,7 +12,7 @@
<hr>
[[ include ../_pagination ]]
-[[ include ../_media ]]
+[[ include ../_gallery ]]
[[ include ../_pagination ]]
[[ include ../_footer ]]