diff options
author | Freya Murphy <freya@freyacat.org> | 2024-12-23 11:13:27 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-12-23 11:13:27 -0500 |
commit | 5a2ba9c2e7605bb788bc406184547d22c6436867 (patch) | |
tree | cbd988d534e8a8593a31d70571222443f80da0b3 /src/web/_views/_template | |
parent | fix about modal (diff) | |
download | xssbook2-5a2ba9c2e7605bb788bc406184547d22c6436867.tar.gz xssbook2-5a2ba9c2e7605bb788bc406184547d22c6436867.tar.bz2 xssbook2-5a2ba9c2e7605bb788bc406184547d22c6436867.zip |
v2.1.0, refactor w/ crimson
Diffstat (limited to '')
-rw-r--r-- | src/web/_views/_template/comment.php (renamed from src/web/_views/template/comment.php) | 7 | ||||
-rw-r--r-- | src/web/_views/_template/error.php (renamed from src/web/_views/template/error.php) | 0 | ||||
-rw-r--r-- | src/web/_views/_template/modal.php (renamed from src/web/_views/template/modal.php) | 2 | ||||
-rw-r--r-- | src/web/_views/_template/post.php (renamed from src/web/_views/template/post.php) | 13 | ||||
-rw-r--r-- | src/web/_views/_template/posts.php (renamed from src/web/_views/template/posts.php) | 11 | ||||
-rw-r--r-- | src/web/_views/_template/toast.php (renamed from src/web/_views/template/toast.php) | 18 |
6 files changed, 25 insertions, 26 deletions
diff --git a/src/web/_views/template/comment.php b/src/web/_views/_template/comment.php index ceac588..b947ff6 100644 --- a/src/web/_views/template/comment.php +++ b/src/web/_views/_template/comment.php @@ -1,14 +1,11 @@ <?php /* Copyright (c) 2024 Freya Murphy */ ?> <?php /* vi: syntax=php */ ?> -<?php - $format_model = $this->load->model('format'); -?> <div class="comment row mt"> <?=pfp($user)?> <div class="ml col sub-card"> <div class="row"> - <strong><?=$format_model->name($user)?></strong> - <span class="subtext ml"><?=$this->main->date($comment['created'])?></span> + <strong><?=$this->format_name($user)?></strong> + <span class="subtext ml"><?=$this->format_date($comment['created'])?></span> </div> <?=$comment['content']?> </div> diff --git a/src/web/_views/template/error.php b/src/web/_views/_template/error.php index 2e02cb1..2e02cb1 100644 --- a/src/web/_views/template/error.php +++ b/src/web/_views/_template/error.php diff --git a/src/web/_views/template/modal.php b/src/web/_views/_template/modal.php index 2a041a7..8e4545d 100644 --- a/src/web/_views/template/modal.php +++ b/src/web/_views/_template/modal.php @@ -9,6 +9,6 @@ class: 'btn btn-action modal-close', )?> </div> - <?php $this->view('modal/' . $content) ?> + <?php $this->view('_modal/' . $content, $data) ?> </div> </div> diff --git a/src/web/_views/template/post.php b/src/web/_views/_template/post.php index 48f8bb6..f7f5de2 100644 --- a/src/web/_views/template/post.php +++ b/src/web/_views/_template/post.php @@ -5,14 +5,13 @@ <?=pfp($user)?> <div class="col ml"> <strong><?=$user['first_name'] . ' ' . $user['last_name']?></strong> - <span class="subtext"><?=$this->main->date($post['created'])?></span> + <span class="subtext"><?=$this->format_date($post['created'])?></span> </div> </div> <p> <?=$post['content']?> </p> <?php - $self = $this->main->user(); $liked = $post['like_id'] ? 'btn-primary' : ''; $post_attrs = array( 'postId' => $post['id'] @@ -22,7 +21,7 @@ } ?> <span class="likes subtext"><span class="count"><?=$post['like_count']?></span><?=' ' . ucfirst(lang('likes'))?></span> -<?php if ($self): ?> +<?php if ($session): ?> <hr> <div class="row"> <?=ilang('action_like', @@ -30,7 +29,7 @@ attrs: $post_attrs )?> <?=ilang('action_comment', class: 'btn grow action-comment', - click: '$(\'#action-new-comment-' . $post['id'] . '\').focus()' + onclick: '$(\'#action-new-comment-' . $post['id'] . '\').focus()' )?> </div> <hr> @@ -46,7 +45,7 @@ $total = $post['comment_count']; if ($loaded >= $page_size && $page_size < $total) { - ilang('action_load_comments', + echo ilang('action_load_comments', class: 'action-load-comments btn btn-blend mt', attrs: array( 'postId' => $post['id'], @@ -60,9 +59,9 @@ ?> </div> -<?php if ($self): ?> +<?php if ($session): ?> <div class="row pb"> - <?=pfp($self)?> + <?=pfp($session)?> <form class="ml action-new-comment-form row"> <input type="hidden" diff --git a/src/web/_views/template/posts.php b/src/web/_views/_template/posts.php index ed79688..4202e67 100644 --- a/src/web/_views/template/posts.php +++ b/src/web/_views/_template/posts.php @@ -7,9 +7,16 @@ $total = $pdata['total']; $max = $pdata['max']; $filterUid = $pdata['filter_uid']; - +?> +<?php if ($loaded == 0): ?> + <div id="no-posts" class="card"> + <span class="no-posts-title mb"><?=lang('no_posts_found')?></span> + <span><?=random_value(explode("\n", lang('no_posts_found_ext')))?></span> + </div> +<?php endif; ?> +<?php if ($loaded >= $page_size && $page_size < $total) { - ilang('action_load_posts', + echo ilang('action_load_posts', id: 'action-load-posts', class: 'btn btn-blend grow mb mt', attrs: array( diff --git a/src/web/_views/template/toast.php b/src/web/_views/_template/toast.php index 0a6a82f..902955c 100644 --- a/src/web/_views/template/toast.php +++ b/src/web/_views/_template/toast.php @@ -3,21 +3,17 @@ <?php $params = array(); - if ($detail) { - array_push($params, lang('api_column_' . $detail)); - } + if ($detail) + $params[] = lang('api_column_' . $detail); - if ($hint) { - array_push($params, $hint); - } + if ($hint) + $params[] = $hint; - $lang_msg = lang($msg, FALSE, sub: $params); - - if(!$lang_msg) { + $lang_msg = lang($msg, '', sub: $params); + if(!$lang_msg) $lang_msg = $msg; - } else { + else $lang_msg = ucfirst($lang_msg); - } ?> <div class="toast <?=$type?>"> |