From 04ea3ea86e3a7f521e29dce950fb3d40d8c3cc99 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 7 Sep 2018 18:58:19 +0200 Subject: [PATCH] CSS improvements --- static/nryg.less | 19 +++++++- templates/profile.html | 101 ++++++++++++++++++++--------------------- webserver.py | 7 ++- 3 files changed, 72 insertions(+), 55 deletions(-) diff --git a/static/nryg.less b/static/nryg.less index 402b8256..9be4fc78 100644 --- a/static/nryg.less +++ b/static/nryg.less @@ -11,6 +11,7 @@ body { font-family: sans-serif; color: @text-color; background-color: @background-color; + box-sizing: border-box; } h1, h2, h3, h4, h5, h6 { @@ -772,6 +773,22 @@ nav { } } +.profile { + width: 380px; + margin-left: auto; + margin-right: auto; + + @media (min-width: 792px) + { + width: 776px; + } + + @media (min-width: 1180px) + { + width: 1164px; + } +} + #edit-css { font-size: medium; -} \ No newline at end of file +} diff --git a/templates/profile.html b/templates/profile.html index b7bd81a4..89a926ac 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -22,59 +22,56 @@

Profilo di {{ ryg.username }} {% if session.get('user_id', '') == ryg.id %}Modifica{% endif %}

- {% if css.bio %} -
-
- Bio -
-
- {{ bio }} +
+ {% if css.bio %} +
+
+ Bio +
+
+ {{ bio }} +
+ {% endif %} +
+ {% with record = ryg %} + {% include "minis/ryg.html" %} + {% endwith %} + {% if tg %} + {% with record = tg %} + {% include "minis/tg.html" %} + {% endwith %} + {% endif %} + {% if discord %} + {% with record = discord %} + {% include "minis/discord.html" %} + {% endwith %} + {% endif %} + {% if steam %} + {% with record = steam %} + {% include "minis/steam.html" %} + {% endwith %} + {% endif %} + {% if dota %} + {% with record = dota %} + {% include "minis/dota.html" %} + {% endwith %} + {% endif %} + {% if osu %} + {% with record = osu %} + {% include "minis/osu.html" %} + {% endwith %} + {% endif %} + {% if lol %} + {% with record = lol %} + {% include "minis/lol.html" %} + {% endwith %} + {% endif %} + {% if ow %} + {% with record = ow %} + {% include "minis/ow.html" %} + {% endwith %} + {% endif %}
- {% endif %} -
- {% with record = ryg %} - {% include "minis/ryg.html" %} - {% endwith %} - {% if tg %} - {% with record = tg %} - {% include "minis/tg.html" %} - {% endwith %} - {% endif %} - {% if discord %} - {% with record = discord %} - {% include "minis/discord.html" %} - {% endwith %} - {% endif %} - {% if steam %} - {% with record = steam %} - {% include "minis/steam.html" %} - {% endwith %} - {% endif %} - {% if dota %} - {% with record = dota %} - {% include "minis/dota.html" %} - {% endwith %} - {% endif %} - {# if rl %} - {% with record = rl %} - {% include "minis/rl.html" %} - {% endwith %} - {% endif #} - {% if osu %} - {% with record = osu %} - {% include "minis/osu.html" %} - {% endwith %} - {% endif %} - {% if lol %} - {% with record = lol %} - {% include "minis/lol.html" %} - {% endwith %} - {% endif %} - {% if ow %} - {% with record = ow %} - {% include "minis/ow.html" %} - {% endwith %} - {% endif %}
{% endblock %} \ No newline at end of file diff --git a/webserver.py b/webserver.py index 0bca9d41..e442e359 100644 --- a/webserver.py +++ b/webserver.py @@ -87,8 +87,11 @@ def page_profile(name: str): tg = db_session.query(db.Telegram).filter_by(royal=user).one_or_none() discord = db_session.execute(query_discord_music.one_query, {"royal": user.id}).fetchone() db_session.close() - converted_bio = Markup(markdown2.markdown(css.bio.replace("<", "<"), - extras=["spoiler", "tables", "smarty-pants", "fenced-code-blocks"])) + if css is not None: + converted_bio = Markup(markdown2.markdown(css.bio.replace("<", "<"), + extras=["spoiler", "tables", "smarty-pants", "fenced-code-blocks"])) + else: + converted_bio = "" return render_template("profile.html", ryg=user, css=css, osu=osu, dota=dota, lol=lol, steam=steam, ow=ow, tg=tg, discord=discord, config=config, bio=converted_bio)