summaryrefslogtreecommitdiff
path: root/src/web/_views/profile/main.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/web/_views/profile/main.php (renamed from src/web/_views/apps/profile/main.php)28
1 files changed, 14 insertions, 14 deletions
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>