mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-03 20:02:47 +00:00 
			
		
		
		
	(Public-)Corpus List fix+highligting owner status
This commit is contained in:
		@@ -3,6 +3,7 @@ from flask_breadcrumbs import register_breadcrumb
 | 
			
		||||
from flask_login import current_user, login_required, login_user
 | 
			
		||||
from app.auth.forms import LoginForm
 | 
			
		||||
from app.models import Corpus, User
 | 
			
		||||
from sqlalchemy import or_
 | 
			
		||||
from . import bp
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -38,8 +39,10 @@ def faq():
 | 
			
		||||
@register_breadcrumb(bp, '.dashboard', '<i class="material-icons left">dashboard</i>Dashboard')
 | 
			
		||||
@login_required
 | 
			
		||||
def dashboard():
 | 
			
		||||
    corpora = Corpus.query.filter(or_(Corpus.followers.any(id=current_user.id), Corpus.user == current_user)).all()
 | 
			
		||||
    return render_template(
 | 
			
		||||
        'main/dashboard.html.j2',
 | 
			
		||||
        corpora=corpora,
 | 
			
		||||
        title='Dashboard'
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
@@ -81,15 +84,7 @@ def terms_of_use():
 | 
			
		||||
@register_breadcrumb(bp, '.social_area', '<i class="material-icons left">group</i>Social Area')
 | 
			
		||||
@login_required
 | 
			
		||||
def social_area():
 | 
			
		||||
    # corpora = [
 | 
			
		||||
    #     c.to_json_serializeable() for c
 | 
			
		||||
    #     in Corpus.query.filter(Corpus.is_public == True, Corpus.user != current_user).all()
 | 
			
		||||
    # ]
 | 
			
		||||
    corpora = Corpus.query.filter(Corpus.is_public == True, Corpus.user != current_user).all()
 | 
			
		||||
    # users = [
 | 
			
		||||
    #     u.to_json_serializeable(relationships=True, filter_by_privacy_settings=True,) for u
 | 
			
		||||
    #     in User.query.filter(User.is_public == True, User.id != current_user.id).all()
 | 
			
		||||
    # ]
 | 
			
		||||
    users = User.query.filter(User.is_public == True, User.id != current_user.id).all()
 | 
			
		||||
    return render_template(
 | 
			
		||||
        'main/social_area.html.j2',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user