This commit is contained in:
retoor 2025-04-14 22:31:46 +02:00
parent 3b05acffd2
commit a3abd854bb
2 changed files with 48 additions and 0 deletions
src/snek
templates
view

View File

@ -0,0 +1,36 @@
{% extends "app.html" %}
{% block sidebar %}
<aside class="sidebar" id="channelSidebar">
<h2>User</h2>
<ul>
<li><a class="no-select" href="/user/{{ user.uid }}.html">Profile</a></li>
<li><a class="no-select" href="/channel/{{ user.uid }}.html">DM</a></li>
</ul>
<h2>Gists</h2>
<ul>
<li>No gists</li>
</ul>
</aside>
{% endblock %}
{% block header_text %}<h2 style="color:#fff">{{ user.username }} {% if user.nick != user.username %}({{ user.nick }}){% endif %}</h2>{% endblock %}
{% block head %}
{% endblock %}
{% block main %}
<section>
{% autoescape false %}
{% markdown %}
{{ profile }}
{% endmarkdown %}
{% endautoescape %}
</section>
{% endblock main %}

12
src/snek/view/user.py Normal file
View File

@ -0,0 +1,12 @@
from snek.system.view import BaseView
class UserView(BaseView):
async def get(self):
user = self.request['user']
profile_content = await self.services.user_property.get(user['uid'],'profile') or ''
return await self.render_template('user.html', {
'user': user.record,
'profile': profile_content
})