diff --git a/freak/__init__.py b/freak/__init__.py index bdd3edb..6b789ec 100644 --- a/freak/__init__.py +++ b/freak/__init__.py @@ -18,7 +18,8 @@ __version__ = '0.3.3' APP_BASE_DIR = os.path.dirname(os.path.dirname(__file__)) -dotenv.load_dotenv() +if not dotenv.load_dotenv(): + warnings.warn('.env not loaded; application may break!', UserWarning) app = Flask(__name__) app.secret_key = os.getenv('SECRET_KEY') diff --git a/freak/templates/feed.html b/freak/templates/feed.html index f538b10..239f66b 100644 --- a/freak/templates/feed.html +++ b/freak/templates/feed.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% from "macros/feed.html" import feed_post, stop_scrolling, no_more_scrolling with context %} {% from "macros/title.html" import title_tag with context %} +{% from "macros/nav.html" import nav_guild, nav_top_communities with context %} {# set feed_title = 'For you' if feed_type == 'foryou' and not feed_title %} {% set feed_title = 'Explore' if feed_type == 'explore' and not feed_title #} @@ -16,12 +17,10 @@ {% block nav %} {% if top_communities %} - {% from "macros/nav.html" import nav_top_communities with context %} - {{ nav_top_communities(top_communities) }} + {{ nav_top_communities(top_communities) }} {% endif %} {% if feed_type == 'guild' %} - {% from "macros/nav.html" import nav_guild with context %} {{ nav_guild(topic) }} {% endif %} diff --git a/freak/templates/singlepost.html b/freak/templates/singlepost.html index 488db25..145f5d9 100644 --- a/freak/templates/singlepost.html +++ b/freak/templates/singlepost.html @@ -3,13 +3,15 @@ {% from "macros/feed.html" import single_comment, feed_upvote, comment_count with context %} {% from "macros/create.html" import comment_area with context %} {% from "macros/icon.html" import icon, callout with context %} +{% from "macros/nav.html" import nav_guild, nav_user with context %} {% block title %}{{ title_tag(p.title + '; from ' + p.topic_or_user().handle()) }}{% endblock %} {% block nav %} {% if p.topic %} - {% from "macros/nav.html" import nav_guild with context %} {{ nav_guild(p.topic) }} + {% elif p.author %} + {{ nav_user(p.author) }} {% endif %} {% endblock %} @@ -26,6 +28,9 @@ on their user page {% endif %} - + {% if p.privacy == 1 %} + - {{ icon('link_post') }} Unlisted + {% endif %} {% if current_user.is_administrator and p.report_count() %} {% call callout() %} diff --git a/freak/templates/userfeed.html b/freak/templates/userfeed.html index c8b9714..3ab5a80 100644 --- a/freak/templates/userfeed.html +++ b/freak/templates/userfeed.html @@ -2,13 +2,19 @@ {% from "macros/feed.html" import feed_post, stop_scrolling, no_more_scrolling with context %} {% from "macros/title.html" import title_tag with context %} {% from "macros/icon.html" import icon, callout with context %} +{% from "macros/nav.html" import nav_user with context %} {% block title %}{{ title_tag(user.handle() + '’s content') }}{% endblock %} + {% block heading %}
{{ icon('karma') }} {{ user.karma }} karma - Joined at: - ID: {{ user.id|to_b32l }}
{% endblock %} +{% block nav %} + {{ user_nav(user) }} +{% endblock %} + {% block content %} {% if l and l.pages > 0 %} {% if not user.is_active %}