From 251ded87089bb2c5043c4c0e96338d1ddf09920f Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 8 Dec 2022 17:08:54 -0800 Subject: [PATCH] get user profile show working --- nerochan/models.py | 6 ++--- nerochan/static/css/main.css | 8 +++++++ nerochan/templates/user/show.html | 39 ++++++++++++++++++++----------- 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/nerochan/models.py b/nerochan/models.py index b3a0ebc..8f8df23 100644 --- a/nerochan/models.py +++ b/nerochan/models.py @@ -33,10 +33,10 @@ class User(pw.Model): is_mod = pw.BooleanField(default=False) is_verified = pw.BooleanField(default=False) is_banned = pw.BooleanField(default=False) - website = pw.CharField(unique=True, default='') - twitter_handle = pw.CharField(unique=True, default='') + website = pw.CharField(unique=True, null=True) + twitter_handle = pw.CharField(unique=True, null=True) bio = pw.TextField(default='') - email = pw.CharField(unique=True, default='') + email = pw.CharField(unique=True, null=True) @property def is_authenticated(self): diff --git a/nerochan/static/css/main.css b/nerochan/static/css/main.css index 40d2c6c..6851117 100644 --- a/nerochan/static/css/main.css +++ b/nerochan/static/css/main.css @@ -20,6 +20,14 @@ a, a:visited { margin-top: 4em; } +.mt-2 { + margin-top: 2em; +} + +.mt-1 { + margin-top: 1em; +} + .inline { display: inline; } diff --git a/nerochan/templates/user/show.html b/nerochan/templates/user/show.html index 448e405..943d744 100644 --- a/nerochan/templates/user/show.html +++ b/nerochan/templates/user/show.html @@ -5,21 +5,32 @@

{{ user.handle }}

- - {% if user.is_admin %} -

ADMIN

- {% endif %} - {% if user.is_verified %} -

VERIFIED

- {% endif %} -
- registered {{ user.register_date | humanize }} - last login {{ user.last_login_date | humanize }} -
+ + {% if user.is_admin %} +

ADMIN

+ {% endif %} + {% if user.is_verified %} +

VERIFIED

+ {% endif %} +

+ registered {{ user.register_date | humanize }} +

-
-
-
{{ user.wallet_address }}
-
+
+ {% if user.website %} +

site

+ {% endif %} + {% if user.twitter_handle %} +

twitter

+ {% endif %} + {% if user.email %} +

email

+ {% endif %} + {% if user.bio %} +

{{ user.bio }}

+ {% endif %} +
{{ user.wallet_address }}
+

artworks