summaryrefslogtreecommitdiff
path: root/src/web/_views/apps
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/web/_views/apps/people/people.php7
-rw-r--r--src/web/_views/auth/main.php (renamed from src/web/_views/apps/auth/login.php)6
-rw-r--r--src/web/_views/error/main.php (renamed from src/web/_views/apps/error/main.php)0
-rw-r--r--src/web/_views/home/main.php (renamed from src/web/_views/apps/home/main.php)8
-rw-r--r--src/web/_views/people/card.php (renamed from src/web/_views/apps/people/card.php)2
-rw-r--r--src/web/_views/people/footer.php (renamed from src/web/_views/apps/people/footer.php)0
-rw-r--r--src/web/_views/people/header.php (renamed from src/web/_views/apps/people/header.php)0
-rw-r--r--src/web/_views/people/main.php (renamed from src/web/_views/apps/people/main.php)12
-rw-r--r--src/web/_views/profile/main.php (renamed from src/web/_views/apps/profile/main.php)28
-rw-r--r--src/web/_views/settings/main.php (renamed from src/web/_views/apps/settings/main.php)7
10 files changed, 32 insertions, 38 deletions
diff --git a/src/web/_views/apps/people/people.php b/src/web/_views/apps/people/people.php
deleted file mode 100644
index 5fc0d17..0000000
--- a/src/web/_views/apps/people/people.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php /* Copyright (c) 2024 Freya Murphy */ ?>
-<?php /* vi: syntax=php */ ?>
-<?php
- foreach($users as $user) {
- $this->view('apps/people/card', array('user' => $user));
- }
-?>
diff --git a/src/web/_views/apps/auth/login.php b/src/web/_views/auth/main.php
index ac4cd02..9604770 100644
--- a/src/web/_views/apps/auth/login.php
+++ b/src/web/_views/auth/main.php
@@ -32,7 +32,7 @@
</div>
<?=ilang('action_login',
class: 'btn btn-primary btn-alt grow',
- button: TRUE,
+ type: 'button',
attrs: array('type' => 'submit')
)?>
<?/*=ilang('action_forgot_passwd',
@@ -43,7 +43,7 @@
<?=ilang('action_create_account',
id: 'action-register',
class: 'btn btn-success btn-alt grow',
- button: TRUE,
+ type: 'button',
attrs: array('type' => 'submit')
)?>
</div>
@@ -79,7 +79,7 @@
});
$('#action-register').on('click', function() {
- $.get( "/modal/register", function (data) {
+ $.get( "/_modal/register", function (data) {
$(document.body).append(data);
});
})
diff --git a/src/web/_views/apps/error/main.php b/src/web/_views/error/main.php
index bcc6f90..bcc6f90 100644
--- a/src/web/_views/apps/error/main.php
+++ b/src/web/_views/error/main.php
diff --git a/src/web/_views/apps/home/main.php b/src/web/_views/home/main.php
index 864034a..c9373d2 100644
--- a/src/web/_views/apps/home/main.php
+++ b/src/web/_views/home/main.php
@@ -1,22 +1,22 @@
<?php /* Copyright (c) 2024 Freya Murphy */ ?>
<?php /* vi: syntax=php */ ?>
<main id="main">
-<?php if ($self): ?>
+<?php if ($session): ?>
<div id="new-post" class="card">
<div class="row grow">
- <?=pfp($self)?>
+ <?=pfp($session)?>
<a
id="action-new-post"
class="btn btn-alt grow ml"
autocomplete="off"
aria-label="<?=ucfirst(lang('action_new_post_tip'))?>"
>
- <?=ucfirst(lang('action_new_post_text', sub: [$self['first_name']]))?>
+ <?=ucfirst(lang('action_new_post_text', sub: [$session['first_name']]))?>
</a>
</div>
<script>
$('#action-new-post').on('click', function() {
- $.get( "/modal/new_post", function (data) {
+ $.get( "/_modal/new_post", function (data) {
$(document.body).append(data);
});
})
diff --git a/src/web/_views/apps/people/card.php b/src/web/_views/people/card.php
index 93b1350..7e040ba 100644
--- a/src/web/_views/apps/people/card.php
+++ b/src/web/_views/people/card.php
@@ -7,7 +7,7 @@
<div class="col">
<?=pfp($user, FALSE)?>
<div class="col ml">
- <span class="name"><?=$this->format_model->name($user)?></span>
+ <span class="name"><?=$this->format_name($user)?></span>
<span class="subtext"><?=$user['username']?></span>
</div>
</div>
diff --git a/src/web/_views/apps/people/footer.php b/src/web/_views/people/footer.php
index f18e031..f18e031 100644
--- a/src/web/_views/apps/people/footer.php
+++ b/src/web/_views/people/footer.php
diff --git a/src/web/_views/apps/people/header.php b/src/web/_views/people/header.php
index b1099ec..b1099ec 100644
--- a/src/web/_views/apps/people/header.php
+++ b/src/web/_views/people/header.php
diff --git a/src/web/_views/apps/people/main.php b/src/web/_views/people/main.php
index ec84ab9..c602b2c 100644
--- a/src/web/_views/apps/people/main.php
+++ b/src/web/_views/people/main.php
@@ -1,18 +1,22 @@
<?php /* Copyright (c) 2024 Freya Murphy */ ?>
-<?php /* vi: syntax=php */ ?>
<div id="people-container" class="col">
-<?php
- $pdata = $this->people();
-?>
+ <?php $pdata = $this->people(); ?>
</div>
<?php
+
$loaded = count($pdata['users']);
$page_size = $pdata['page_size'];
$total = $pdata['count'];
$max = $pdata['max_id'];
$filter_uid = $pdata['filter_uid'];
$filer_type = $pdata['filter_type'];
+
?>
+<?php if ($loaded == 0): ?>
+ <div id="no-people" class="card">
+ <?=lang('no_people_found')?>
+ </div>
+<?php endif; ?>
<?php if ($loaded >= $page_size && $page_size < $total): ?>
<?=ilang('action_load_users',
id: 'action-load-users',
diff --git a/src/web/_views/apps/profile/main.php b/src/web/_views/profile/main.php
index b2ad496..3e7129c 100644
--- a/src/web/_views/apps/profile/main.php
+++ b/src/web/_views/profile/main.php
@@ -11,47 +11,47 @@
<div class="col content grow">
<div class="row grow">
<div class="col mb">
- <strong class="name"><?=$this->format_model->name($user)?></strong>
+ <strong class="name"><?=$this->format_name($user)?></strong>
<span class="subtext"><?=$user['follower_count'] . ' ' . ucfirst(lang('followers'))?></span>
</div>
<?php if (
- $this->main->session &&
- (!isset($self) || $self['id'] != $user['id'])
+ $session &&
+ ($session['id'] != $user['id'])
): ?>
<div class="follow">
<?=ilang(
'action_follow',
id: 'action-follow-follow',
class: 'btn btn-alt',
+ sub: [$user['first_name']],
style: (!$following && !$followed) ? '' : 'display: none',
- sub: [$user['first_name']]
)?>
<?=ilang(
'action_follow_back',
id: 'action-follow-follow-back',
class: 'btn btn-alt',
+ sub: [$user['first_name']],
style: (!$following && $followed) ? '' : 'display: none',
- sub: [$user['first_name']]
)?>
<?=ilang(
'action_following',
id: 'action-follow-following',
class: 'btn btn-alt btn-primary',
+ sub: [$user['first_name']],
style: ($following && !$followed) ? '' : 'display: none',
- sub: [$user['first_name']]
)?>
<?=ilang(
'action_friends',
id: 'action-follow-friends',
class: 'btn btn-alt btn-primary',
+ sub: [$user['first_name']],
style: ($following && $followed) ? '' : 'display: none',
- sub: [$user['first_name']]
)?>
</div>
<script>
let following = <?=json_encode($following)?>;
+ let followingId = <?=json_encode($following_id)?>;
let followed = <?=json_encode($followed)?>;
- let followId = <?=json_encode($follow_id)?>;
let followee_id = <?=json_encode($user['id'])?>;
let btns = {};
@@ -84,15 +84,15 @@
}
const onPostFollow = (data) => {
- followId = data[0].id;
+ followingId = data[0].id;
following = true;
updateFollow();
}
const onClickFollow = () => {
- if (followId) {
+ if (followingId) {
$.ajax({
- url: '/api/follow?id=eq.' + followId,
+ url: '/api/follow?id=eq.' + followingId,
method: 'PATCH',
data: JSON.stringify({ followee_id, value: !following }),
success: onPatchFollow
@@ -181,7 +181,7 @@
</tr>
<tr>
<td><strong><?=ucfirst(lang('about_general_birth_date'))?></strong></td>
- <td><?=$this->main->date($user['birth_date'])?></td>
+ <td><?=$this->format_date($user['birth_date'])?></td>
</tr>
</table>
<h1><?=ucfirst(lang('about_stats'))?></h1>
@@ -204,11 +204,11 @@
</tr>
<tr>
<td><strong><?=ucfirst(lang('about_stats_joined'))?></strong></td>
- <td><?=$this->main->date($user['created'])?></td>
+ <td><?=$this->format_date($user['created'])?></td>
</tr>
<tr>
<td><strong><?=ucfirst(lang('about_stats_seen'))?></strong></td>
- <td><?=$this->main->date($user['seen'])?></td>
+ <td><?=$this->format_date($user['seen'])?></td>
</tr>
</table>
</div>
diff --git a/src/web/_views/apps/settings/main.php b/src/web/_views/settings/main.php
index 2033acc..4401fe1 100644
--- a/src/web/_views/apps/settings/main.php
+++ b/src/web/_views/settings/main.php
@@ -1,9 +1,6 @@
-<?php /* Copyright (c) 2024 Freya Murphy */ ?>
-<?php /* vi: syntax=php */ ?>
+<?php /* Copyright (c) 2024 Freya Murphy */
-<?php
-
-$user = $this->main->user();
+$user = $session;
function __create_form($user, $col) {
$ph = ucfirst(lang('ph_' . $col));