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

@ -9,7 +9,7 @@ $userId = user_find_for_profile($userId);
if($userId < 1) { if($userId < 1) {
http_response_code(404); http_response_code(404);
echo tpl_render('user.notfound'); echo tpl_render('profile.index');
return; return;
} }

View file

@ -28,6 +28,7 @@
</div> </div>
<div class="profile__header__details__content"> <div class="profile__header__details__content">
{% if profile is defined %}
<div class="profile__header__username" style="{{ profile.user_colour|html_colour }}"> <div class="profile__header__username" style="{{ profile.user_colour|html_colour }}">
{{ profile.username }} {{ profile.username }}
</div> </div>
@ -44,9 +45,17 @@
{{ profile.user_country|country_name }} {{ profile.user_country|country_name }}
</div> </div>
</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> </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') }}"> <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 %} {% if profile_relation_info.subject_relation and profile_relation_info.user_relation %}
Mutual Friends Mutual Friends
@ -60,6 +69,7 @@
</div> </div>
<div class="profile__header__options"> <div class="profile__header__options">
{% if profile is defined %}
<div class="profile__header__actions"> <div class="profile__header__actions">
{% if profile_mode is empty %} {% if profile_mode is empty %}
{% if profile_is_editing %} {% 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> <a href="{{ url('user-profile', {'user': profile.user_id}) }}" class="input__button profile__header__action">Return</a>
{% endif %} {% endif %}
</div> </div>
{% endif %}
{% if stats is defined %} {% if stats is defined %}
<div class="profile__header__stats"> <div class="profile__header__stats">

View file

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

View file

@ -1,5 +1,6 @@
{% extends 'master.twig' %} {% extends 'master.twig' %}
{% if profile is defined %}
{% set image = url('user-avatar', {'user': profile.user_id, 'res': 240}) %} {% set image = url('user-avatar', {'user': profile.user_id, 'res': 240}) %}
{% set manage_link = '/manage/users.php?v=view&u=' ~ profile.user_id %} {% set manage_link = '/manage/users.php?v=view&u=' ~ profile.user_id %}
{% set stats = [ {% set stats = [
@ -46,3 +47,9 @@
'value': profile.changelog_count, '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 %}