#29: First login-less pages
This commit adds a config for . When enabled it allows users to navigate on the routes which don't have the @login_required
This commit is contained in:
parent
c0d203afde
commit
6917b476fd
@ -242,7 +242,7 @@ def ytsearch():
|
|||||||
'thumbnail':'https:{}'.format(c['thumbnails'][0]),
|
'thumbnail':'https:{}'.format(c['thumbnails'][0]),
|
||||||
'subCount':c['suscriberCountText'].split(" ")[0]
|
'subCount':c['suscriberCountText'].split(" ")[0]
|
||||||
})
|
})
|
||||||
return render_template('ytsearch.html', form=form, btform=button_form, channels=channels, videos=videos)
|
return render_template('ytsearch.html', form=form, btform=button_form, channels=channels, videos=videos, restricted=config['restrictPublicUsage'])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return render_template('ytsearch.html', form=form)
|
return render_template('ytsearch.html', form=form)
|
||||||
@ -301,7 +301,7 @@ def channel(id):
|
|||||||
data = feedparser.parse(data.content)
|
data = feedparser.parse(data.content)
|
||||||
|
|
||||||
channelData = YoutubeSearch.channelInfo(id)
|
channelData = YoutubeSearch.channelInfo(id)
|
||||||
return render_template('channel.html', form=form, btform=button_form, channel=channelData[0], videos=channelData[1])
|
return render_template('channel.html', form=form, btform=button_form, channel=channelData[0], videos=channelData[1], restricted=config['restrictPublicUsage'])
|
||||||
|
|
||||||
@app.route('/watch', methods=['GET'])
|
@app.route('/watch', methods=['GET'])
|
||||||
@login_required
|
@login_required
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if restricted or current_user.is_authenticated %}
|
||||||
<div class="center aligned extra content">
|
<div class="center aligned extra content">
|
||||||
{% if not current_user.is_following_yt(channel.id) %}
|
{% if not current_user.is_following_yt(channel.id) %}
|
||||||
<p>
|
<p>
|
||||||
@ -35,6 +36,7 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
{% for res in channels %}
|
{% for res in channels %}
|
||||||
<div class="item">
|
<div class="item">
|
||||||
|
{% if restricted or current_user.is_authenticated %}
|
||||||
<div class="right floated content">
|
<div class="right floated content">
|
||||||
{% if not current_user.is_following_yt(res.channelId) %}
|
{% if not current_user.is_following_yt(res.channelId) %}
|
||||||
<p>
|
<p>
|
||||||
@ -37,6 +38,7 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
<img alt="Avatar" class="ui avatar image" src="{{ res.thumbnail }}">
|
<img alt="Avatar" class="ui avatar image" src="{{ res.thumbnail }}">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<a class = "header" href="{{ url_for('channel', id=res.channelId)}}">{{res.username}}</a>
|
<a class = "header" href="{{ url_for('channel', id=res.channelId)}}">{{res.username}}</a>
|
||||||
|
@ -2,5 +2,6 @@
|
|||||||
"serverName": "Yotter.xyz",
|
"serverName": "Yotter.xyz",
|
||||||
"nitterInstance": "https://nitter.net/",
|
"nitterInstance": "https://nitter.net/",
|
||||||
"maxInstanceUsers": 10,
|
"maxInstanceUsers": 10,
|
||||||
"serverLocation": "Germany"
|
"serverLocation": "Germany",
|
||||||
|
"restrictPublicUsage":false
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user