diff --git a/assets/less/mio/classes/profile/header.less b/assets/less/mio/classes/profile/header.less index e9639d5e..83244809 100644 --- a/assets/less/mio/classes/profile/header.less +++ b/assets/less/mio/classes/profile/header.less @@ -40,11 +40,31 @@ } } - &__stats { + &__options { background-color: rgba(0, 0, 0, .9); padding: 0 20px; display: flex; - justify-content: flex-end; + justify-content: space-between; + } + + &__actions { + display: flex; + align-items: center; + } + + &__action { + border-radius: 2px; + color: var(--accent-colour); + text-decoration: none; + border: 1px solid var(--accent-colour); + margin-right: 10px; + padding: 5px 10px; + cursor: pointer; + font-size: 1.2em; + } + + &__stats { + display: flex; } &__stat { @@ -53,6 +73,10 @@ text-decoration: none; padding: 10px; + &--date { + min-width: 130px; + } + &__name { font-size: .9em; font-variant: small-caps; diff --git a/public/profile.php b/public/profile.php index 81af2466..18f3e95e 100644 --- a/public/profile.php +++ b/public/profile.php @@ -5,7 +5,7 @@ use Misuzu\IO\File; require_once __DIR__ . '/../misuzu.php'; $user_id = (int)($_GET['u'] ?? 0); -$mode = (string)($_GET['m'] ?? 'view'); +$mode = (string)($_GET['m'] ?? null); switch ($mode) { case 'avatar': @@ -54,7 +54,6 @@ switch ($mode) { echo file_get_contents($user_background); break; - case 'view': default: $getProfile = Database::prepare(' SELECT @@ -99,6 +98,6 @@ switch ($mode) { 'profile' => $profile, 'has_background' => is_file(build_path($app->getStoragePath(), 'backgrounds/original', "{$profile['user_id']}.msz")), ]); - echo tpl_render('user.view'); + echo tpl_render('user.profile'); break; } diff --git a/templates/user/view.twig b/templates/user/profile.twig similarity index 62% rename from templates/user/view.twig rename to templates/user/profile.twig index 9c61cf89..573547e9 100644 --- a/templates/user/view.twig +++ b/templates/user/profile.twig @@ -96,70 +96,78 @@ -
-
-
- Joined -
- +
+
+ {% if current_user.user_id|default(0) == profile.user_id %} + Edit Profile + {% endif %}
- {% if profile.last_seen is not null %} -
+
+
- Last seen + Joined
-
- {% endif %} - {% if profile.forum_topic_count > 0 %} -
-
- Topics + {% if profile.last_seen is not null %} +
+
+ Last seen +
+
-
- {{ profile.forum_topic_count|number_format }} -
-
- {% endif %} + {% endif %} - {% if profile.forum_post_count > 0 %} -
-
- Posts + {% if profile.forum_topic_count > 0 %} +
+
+ Topics +
+
+ {{ profile.forum_topic_count|number_format }} +
-
- {{ profile.forum_post_count|number_format }} -
-
- {% endif %} + {% endif %} - {% if profile.comments_count > 0 %} -
-
- Comments + {% if profile.forum_post_count > 0 %} +
+
+ Posts +
+
+ {{ profile.forum_post_count|number_format }} +
-
- {{ profile.comments_count|number_format }} -
-
- {% endif %} + {% endif %} - {% if profile.changelog_count > 0 %} - -