client: added features for camera

- [client] also revised date-taken section
This commit is contained in:
skybldev 2021-12-30 09:59:08 -05:00
parent 40331f2ba2
commit 2c1e25c158
3 changed files with 20 additions and 6 deletions

View file

@ -32,8 +32,21 @@
<% if (ctx.post.type == "image" || ctx.post.type == "video" ) { %> <% if (ctx.post.type == "image" || ctx.post.type == "video" ) { %>
<section class='date-taken'> <section class='date-taken'>
<i class='fa fa-clock-o'></i>Taken on <i class='fa fa-clock-o'></i><!--
<%= ctx.makeUserFriendlyTime(ctx.post.dateTaken) %> --><% if (ctx.post.dateTaken) { %><!--
--><%= ctx.makeUserFriendlyTime(ctx.post.dateTaken) %><!--
--><% } else { %><!--
-->Unknown date
<% } %>
</section>
<section class='camera'>
<i class='fa fa-camera'></i><!--
--><% if (ctx.post.camera) { %><!--
--><%= ctx.post.camera %><!--
--><% } else { %><!--
-->Unknown camera
<% } %>
</section> </section>
<% } %> <% } %>

View file

@ -154,6 +154,10 @@ class Post extends events.EventTarget {
return this._dateTaken; return this._dateTaken;
} }
get camera() {
return this._camera;
}
set flags(value) { set flags(value) {
this._flags = value; this._flags = value;
} }
@ -497,6 +501,7 @@ class Post extends events.EventTarget {
_ownFavorite: response.ownFavorite, _ownFavorite: response.ownFavorite,
_hasCustomThumbnail: response.hasCustomThumbnail, _hasCustomThumbnail: response.hasCustomThumbnail,
_dateTaken: response.dateTaken, _dateTaken: response.dateTaken,
_camera: response.camera,
}); });
for (let obj of [this, this._orig]) { for (let obj of [this, this._orig]) {

View file

@ -97,10 +97,6 @@ function formatRelativeTime(timeString) {
} }
function formatUserFriendlyTime(timeString) { function formatUserFriendlyTime(timeString) {
if (!timeString) {
return "an unknown date";
}
return format(Date.parse(timeString), "iii, LLLL dd yyyy 'at' HH:mm:ss"); return format(Date.parse(timeString), "iii, LLLL dd yyyy 'at' HH:mm:ss");
} }