diff --git a/templates/settings/account.twig b/templates/settings/account.twig index 315e2f96..06fca5de 100644 --- a/templates/settings/account.twig +++ b/templates/settings/account.twig @@ -263,7 +263,7 @@ {% endif %} {% if settings_perms.edit_about %} -
+
About
diff --git a/templates/user/_layout/header.twig b/templates/user/_layout/header.twig new file mode 100644 index 00000000..68aeda8f --- /dev/null +++ b/templates/user/_layout/header.twig @@ -0,0 +1,80 @@ +
+
+
+ +
+
+ {{ profile.username }} +
+ + {% if profile.user_title is not empty %} +
+ {{ profile.user_title }} +
+ {% endif %} + +
+
+
+ {{ profile.user_country|country_name }} +
+
+
+ + {% if friend_info is defined and (friend_info.profile_relation is not null or friend_info.visitor_relation is not null) %} +
+ {% if friend_info.profile_relation and friend_info.visitor_relation %} + Mutual Friends + {% elseif friend_info.visitor_relation %} + You Follow + {% elseif friend_info.profile_relation %} + Follows You + {% endif %} +
+ {% endif %} +
+ +
+
+ {% if current_user.user_id|default(0) == profile.user_id %} + Edit Profile + {% elseif current_user is defined %} + {% if friend_info.visitor_relation == constant('MSZ_USER_RELATION_FOLLOW') %} + {{ friend_info.profile_relation == constant('MSZ_USER_RELATION_FOLLOW') ? 'Unfriend' : 'Unfollow' }} + {% else %} + {{ friend_info.profile_relation == constant('MSZ_USER_RELATION_FOLLOW') ? 'Add as Friend' : 'Follow' }} + {% endif %} + {% endif %} +
+ + {% if stats is defined %} +
+ {% for stat in stats %} + {% if stat.value|default(false) %} + {% set is_date = stat.is_date|default(false) %} + +
+
+ {{ stat.title }} +
+ + {% if is_date %} + + {% else %} +
+ {{ stat.value|number_format }} +
+ {% endif %} +
+ {% endif %} + {% endfor %} +
+ {% endif %} +
+
diff --git a/templates/user/profile.twig b/templates/user/profile.twig index 7c691cac..7168a81f 100644 --- a/templates/user/profile.twig +++ b/templates/user/profile.twig @@ -10,127 +10,38 @@ {% set site_background_url = '/profile.php?m=background&u=' ~ profile.user_id %} {% endif %} +{% set stats = [ + { + 'title': 'Joined', + 'is_date': true, + 'value': profile.created_at, + }, + { + 'title': 'Last seen', + 'is_date': true, + 'value': profile.last_seen, + }, + { + 'title': 'Topics', + 'value': profile.forum_topic_count, + }, + { + 'title': 'Posts', + 'value': profile.forum_post_count, + }, + { + 'title': 'Comments', + 'value': profile.comments_count, + }, + { + 'title': 'Changes', + 'value': profile.changelog_count, + }, +] %} + {% block content %}
-
-
-
- -
-
- {{ profile.username }} -
- - {% if profile.user_title is not empty %} -
- {{ profile.user_title }} -
- {% endif %} - -
-
-
- {{ profile.user_country|country_name }} -
-
-
- - {% if friend_info is defined and (friend_info.profile_relation is not null or friend_info.visitor_relation is not null) %} -
- {% if friend_info.profile_relation and friend_info.visitor_relation %} - Mutual Friends - {% elseif friend_info.visitor_relation %} - You Follow - {% elseif friend_info.profile_relation %} - Follows You - {% endif %} -
- {% endif %} -
- -
-
- {% if current_user.user_id|default(0) == profile.user_id %} - Edit Profile - {% elseif current_user is defined %} - {% if friend_info.visitor_relation == constant('MSZ_USER_RELATION_FOLLOW') %} - {{ friend_info.profile_relation == constant('MSZ_USER_RELATION_FOLLOW') ? 'Unfriend' : 'Unfollow' }} - {% else %} - {{ friend_info.profile_relation == constant('MSZ_USER_RELATION_FOLLOW') ? 'Add as Friend' : 'Follow' }} - {% endif %} - {% endif %} -
- -
-
-
- Joined -
- -
- - {% if profile.last_seen is not null %} -
-
- Last seen -
- -
- {% endif %} - - {% if profile.forum_topic_count > 0 %} -
-
- Topics -
-
- {{ profile.forum_topic_count|number_format }} -
-
- {% endif %} - - {% if profile.forum_post_count > 0 %} -
-
- Posts -
-
- {{ profile.forum_post_count|number_format }} -
-
- {% endif %} - - {% if profile.comments_count > 0 %} -
-
- Comments -
-
- {{ profile.comments_count|number_format }} -
-
- {% endif %} - - {% if profile.changelog_count > 0 %} - -
- Changes -
-
- {{ profile.changelog_count|number_format }} -
-
- {% endif %} -
-
-
+ {% include 'user/_layout/header.twig' %}