Updated user not found page.

This commit is contained in:
flash 2019-06-06 22:18:31 +02:00
parent a2ae5e3d15
commit 712979ba89
5 changed files with 179 additions and 169 deletions

View file

@ -7,9 +7,9 @@ $isEditing = !empty($_GET['edit']) && is_string($_GET['edit']) ? (bool)$_GET['ed
$userId = user_find_for_profile($userId);
if ($userId < 1) {
if($userId < 1) {
http_response_code(404);
echo tpl_render('user.notfound');
echo tpl_render('profile.index');
return;
}

View file

@ -28,6 +28,7 @@
</div>
<div class="profile__header__details__content">
{% if profile is defined %}
<div class="profile__header__username" style="{{ profile.user_colour|html_colour }}">
{{ profile.username }}
</div>
@ -44,9 +45,17 @@
{{ profile.user_country|country_name }}
</div>
</div>
{% else %}
<div class="profile__header__username">
User not found!
</div>
<div class="profile__header__title">
Check the link and try again.
</div>
{% endif %}
</div>
{% if profile_relation_info|length > 0 and (profile_relation_info.subject_relation is not null or profile_relation_info.user_relation is not null) %}
{% if profile is defined and profile_relation_info|length > 0 and (profile_relation_info.subject_relation is not null or profile_relation_info.user_relation is not null) %}
<div class="profile__header__details__relation" title="Since {{ profile_relation_info.relation_created|date('r') }}">
{% if profile_relation_info.subject_relation and profile_relation_info.user_relation %}
Mutual Friends
@ -60,6 +69,7 @@
</div>
<div class="profile__header__options">
{% if profile is defined %}
<div class="profile__header__actions">
{% if profile_mode is empty %}
{% if profile_is_editing %}
@ -81,6 +91,7 @@
<a href="{{ url('user-profile', {'user': profile.user_id}) }}" class="input__button profile__header__action">Return</a>
{% endif %}
</div>
{% endif %}
{% if stats is defined %}
<div class="profile__header__stats">

View file

@ -3,8 +3,12 @@
{% from 'user/macros.twig' import user_profile_warning %}
{% from '_layout/input.twig' import input_hidden, input_csrf, input_text, input_checkbox, input_file, input_file_raw, input_select %}
{% set canonical_url = url('user-profile', {'user': profile.user_id}) %}
{% set title = profile.username %}
{% if profile is defined %}
{% set canonical_url = url('user-profile', {'user': profile.user_id}) %}
{% set title = profile.username %}
{% else %}
{% set title = 'User not found!' %}
{% endif %}
{% block content %}
{% if profile_is_editing %}
@ -169,6 +173,7 @@
</div>
{% endif %}
{% if profile is defined %}
<div class="profile__content__main">
{% if (profile_is_editing and perms.edit_about) or profile.user_about_content|length > 0 %}
<div class="container profile__container profile__about" id="about">
@ -254,6 +259,7 @@
{% endfor %}
</div>
{% endif %}
{% endif %}
</div>
</div>
{% if profile_is_editing %}

View file

@ -1,8 +1,9 @@
{% extends 'master.twig' %}
{% set image = url('user-avatar', {'user': profile.user_id, 'res': 240}) %}
{% set manage_link = '/manage/users.php?v=view&u=' ~ profile.user_id %}
{% set stats = [
{% if profile is defined %}
{% set image = url('user-avatar', {'user': profile.user_id, 'res': 240}) %}
{% set manage_link = '/manage/users.php?v=view&u=' ~ profile.user_id %}
{% set stats = [
{
'title': 'Joined',
'is_date': true,
@ -45,4 +46,10 @@
'title': 'Changes',
'value': profile.changelog_count,
},
] %}
] %}
{% else %}
{% set image = url('user-avatar', {'user': 0, 'res': 240}) %}
{% set manage_link = '/manage/users.php?v=listing' %}
{% set profile_is_editing = false %}
{% set profile_notices = [] %}
{% endif %}

View file

@ -1,14 +0,0 @@
{% extends 'user/master.twig' %}
{% from 'macros.twig' import container_title %}
{% set title = 'User not found!' %}
{% block content %}
<div class="container">
{{ container_title('User not found!') }}
<div class="container__content">
<p>Check the url and try again.</p>
</div>
</div>
{% endblock %}