Add an config item to hide following
This commit is contained in:
parent
c01cc39e20
commit
ac5f349d0f
3 changed files with 6 additions and 1 deletions
3
app.py
3
app.py
|
@ -1618,6 +1618,9 @@ def following():
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if config.HIDE_FOLLOWING:
|
||||||
|
abort(404)
|
||||||
|
|
||||||
following, older_than, newer_than = paginated_query(DB.activities, q)
|
following, older_than, newer_than = paginated_query(DB.activities, q)
|
||||||
following = [
|
following = [
|
||||||
(doc["remote_id"], get_backend().fetch_iri(doc["activity"]["object"]))
|
(doc["remote_id"], get_backend().fetch_iri(doc["activity"]["object"]))
|
||||||
|
|
|
@ -72,6 +72,8 @@ with open(os.path.join(KEY_DIR, "me.yml")) as f:
|
||||||
PASS = conf["pass"]
|
PASS = conf["pass"]
|
||||||
EXTRA_INBOXES = conf.get("extra_inboxes", [])
|
EXTRA_INBOXES = conf.get("extra_inboxes", [])
|
||||||
|
|
||||||
|
HIDE_FOLLOWING = strtobool(conf.get("hide_following", "false"))
|
||||||
|
|
||||||
# Theme-related config
|
# Theme-related config
|
||||||
theme_conf = conf.get("theme", {})
|
theme_conf = conf.get("theme", {})
|
||||||
THEME_STYLE = ThemeStyle(theme_conf.get("style", DEFAULT_THEME_STYLE))
|
THEME_STYLE = ThemeStyle(theme_conf.get("style", DEFAULT_THEME_STYLE))
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<li><a href="/with_replies" {% if request.path == "/with_replies" %}class="selected"{% endif %}>With replies <small class="badge">{{ with_replies_count }}</small></a></li>
|
<li><a href="/with_replies" {% if request.path == "/with_replies" %}class="selected"{% endif %}>With replies <small class="badge">{{ with_replies_count }}</small></a></li>
|
||||||
<li><a href="/liked" {% if request.path == "/liked" %}class="selected"{% endif %}>Liked <small class="badge">{{ liked_count }}</small></a></li>
|
<li><a href="/liked" {% if request.path == "/liked" %}class="selected"{% endif %}>Liked <small class="badge">{{ liked_count }}</small></a></li>
|
||||||
<li><a href="/followers"{% if request.path == "/followers" %} class="selected" {% endif %}>Followers <small class="badge">{{ followers_count }}</small></a></li>
|
<li><a href="/followers"{% if request.path == "/followers" %} class="selected" {% endif %}>Followers <small class="badge">{{ followers_count }}</small></a></li>
|
||||||
<li><a href="/following"{% if request.path == "/following" %} class="selected" {% endif %}>Following <small class="badge">{{ following_count }}</small></a></li>
|
{% if not config.HIDE_FOLLOWING or session.logged_in %}<li><a href="/following"{% if request.path == "/following" %} class="selected" {% endif %}>Following <small class="badge">{{ following_count }}</small></a></li>{% endif %}
|
||||||
<!-- <li><a href="/about"{% if request.path == "/about" %} class="selected" {% endif %}>/about</a></li>
|
<!-- <li><a href="/about"{% if request.path == "/about" %} class="selected" {% endif %}>/about</a></li>
|
||||||
-->
|
-->
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in a new issue