summaryrefslogtreecommitdiff
path: root/src/web/_views/template
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-04-01 11:09:25 -0400
committerFreya Murphy <freya@freyacat.org>2024-04-01 11:09:25 -0400
commit3a82baec9d793edf81ac2b151b0f4d4159641375 (patch)
treef9d50c296b078ac48c2a2391c172c3ccf37edb3f /src/web/_views/template
parentrefactor asset dir, refactor oberver in lib (diff)
downloadxssbook2-3a82baec9d793edf81ac2b151b0f4d4159641375.tar.gz
xssbook2-3a82baec9d793edf81ac2b151b0f4d4159641375.tar.bz2
xssbook2-3a82baec9d793edf81ac2b151b0f4d4159641375.zip
login and register, liking on homepage
Diffstat (limited to '')
-rw-r--r--src/web/_views/template/comment.php (renamed from web/_views/template/comment.php)2
-rw-r--r--src/web/_views/template/error.php (renamed from web/_views/template/error.php)0
-rw-r--r--src/web/_views/template/modal.php (renamed from web/_views/template/modal.php)0
-rw-r--r--src/web/_views/template/pfp.php (renamed from web/_views/template/pfp.php)0
-rw-r--r--src/web/_views/template/post.php (renamed from web/_views/template/post.php)31
-rw-r--r--src/web/_views/template/posts.php (renamed from web/_views/template/posts.php)2
-rw-r--r--src/web/_views/template/toast.php (renamed from web/_views/template/toast.php)11
7 files changed, 32 insertions, 14 deletions
diff --git a/web/_views/template/comment.php b/src/web/_views/template/comment.php
index 20032b2..3ff473b 100644
--- a/web/_views/template/comment.php
+++ b/src/web/_views/template/comment.php
@@ -8,7 +8,7 @@
<div class="ml col sub-card">
<div class="row">
<strong><?=$format_model->name($user)?></strong>
- <span class="dim ml"><?=$format_model->date($comment['date'])?></span>
+ <span class="dim ml"><?=$format_model->date($comment['created'])?></span>
</div>
<?=$comment['content']?>
</div>
diff --git a/web/_views/template/error.php b/src/web/_views/template/error.php
index 2e02cb1..2e02cb1 100644
--- a/web/_views/template/error.php
+++ b/src/web/_views/template/error.php
diff --git a/web/_views/template/modal.php b/src/web/_views/template/modal.php
index e3ce6fe..e3ce6fe 100644
--- a/web/_views/template/modal.php
+++ b/src/web/_views/template/modal.php
diff --git a/web/_views/template/pfp.php b/src/web/_views/template/pfp.php
index aec7318..aec7318 100644
--- a/web/_views/template/pfp.php
+++ b/src/web/_views/template/pfp.php
diff --git a/web/_views/template/post.php b/src/web/_views/template/post.php
index 0541026..83a72bf 100644
--- a/web/_views/template/post.php
+++ b/src/web/_views/template/post.php
@@ -5,7 +5,7 @@
<?php $this->view('template/pfp', array('user' => $user))?>
<div class="col ml">
<strong><?=$user['first_name'] . ' ' . $user['last_name']?></strong>
- <span class="dim"><?=$post['date']?></span>
+ <span class="dim"><?=$post['created']?></span>
</div>
</div>
<p>
@@ -13,20 +13,28 @@
</p>
<?php
$self = $this->main->user();
+ $liked = $post['like_id'] ? 'btn-blue' : '';
+ $post_attrs = array(
+ 'postId' => $post['id']
+ );
+ if ($post['like_id'] !== NULL) {
+ $post_attrs['likeId'] = $post['like_id'];
+ }
?>
<?php if ($self): ?>
<hr>
<div class="row">
- <?=ilang('action_like', class: 'grow btn btn-hover btn-action')?>
- <?=ilang('action_comment', class: 'grow btn btn-hover btn-action action-comment',
- click: '$(\'#new-comment-' . $post['id'] . '\').focus()'
+ <?=ilang('action_like',
+ class: 'btn btn-wide action-like ' . $liked,
+ attrs: $post_attrs
+ )?>
+ <?=ilang('action_comment', class: 'btn btn-wide action-comment',
+ click: '$(\'#action-new-comment-' . $post['id'] . '\').focus()'
)?>
</div>
<hr>
-<?php else: ?>
- <hr>
<?php endif; ?>
- <div class="col comments">
+ <div class="col comments pb">
<?php
$_GET = array('id' => $post['id']);
$cdata = $this->comments();
@@ -52,16 +60,17 @@
?>
</div>
<?php if ($self): ?>
- <div class="row grow mt">
+ <div class="row pb">
<?php $this->view('template/pfp', array('user' => $user))?>
- <form class="ml action-new-comment-form">
+ <form class="ml action-new-comment-form row">
<input
type="hidden"
name="id"
value="<?=$post['id']?>"
>
<input
- class="action-new-comment input"
+ id="action-new-comment-<?=$post['id']?>"
+ class="action-new-comment btn btn-wide btn-alt"
postId="<?=$post['id']?>"
autocomplete="off"
type="text"
@@ -73,3 +82,5 @@
</div>
<?php endif; ?>
</div>
+
+
diff --git a/web/_views/template/posts.php b/src/web/_views/template/posts.php
index f57a25f..5e9156c 100644
--- a/web/_views/template/posts.php
+++ b/src/web/_views/template/posts.php
@@ -10,7 +10,7 @@
if ($loaded >= $page_size && $page_size < $total) {
ilang('action_load_posts',
id: 'action-load-posts',
- class: 'btn btn-line mb',
+ class: 'btn btn-line btn-wide mb',
attrs: array(
'loaded' => $loaded,
'pageSize' => $page_size,
diff --git a/web/_views/template/toast.php b/src/web/_views/template/toast.php
index 1f74602..ae2e7d8 100644
--- a/web/_views/template/toast.php
+++ b/src/web/_views/template/toast.php
@@ -11,9 +11,16 @@
array_push($params, $hint);
}
- $msg = lang($msg, sub: $params);
+ $lang_msg = lang($msg, FALSE, sub: $params);
+
+ if(!$lang_msg) {
+ $lang_msg = $msg;
+ } else {
+ $lang_msg = ucfirst($lang_msg);
+ }
+
?>
<div class="toast error">
- <?=ucfirst($msg)?>
+ <?=$lang_msg?>
<?=ilang('action_close', class: 'action-close-toast')?>
</div>