Updates.
This commit is contained in:
		
							parent
							
								
									3b05acffd2
								
							
						
					
					
						commit
						a3abd854bb
					
				
							
								
								
									
										36
									
								
								src/snek/templates/user.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/snek/templates/user.html
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										12
									
								
								src/snek/view/user.py
									
									
									
									
									
										Normal 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  
 | 
			
		||||
        })
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user