diff --git a/db.py b/db.py index 8263cf84..5bb93dfa 100644 --- a/db.py +++ b/db.py @@ -1050,6 +1050,16 @@ class Quest(Base): return f"" +class Terraria13(Base): + __tablename__ = "terraria13" + + royal_id = Column(Integer, ForeignKey("royals.id"), primary_key=True) + royal = relationship("Royal", backref="terraria13", lazy="joined") + + character_name = Column(String) + contribution = Column(Integer) + + # If run as script, create all the tables in the db if __name__ == "__main__": print("Creating new tables...") diff --git a/static/nryg.less b/static/nryg.less index e613976c..877c1994 100644 --- a/static/nryg.less +++ b/static/nryg.less @@ -844,6 +844,41 @@ ul { } } } + + .terraria13 { + border: 3px solid black; + padding: 15px; + background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url("/static/stoneslab.png"); + font-family: "Andy", sans-serif; + font-weight: bold; + color: white; + grid-row-gap: 5px; + + .character { + grid-row: 1; + font-size: x-large; + } + + .contribution-status { + grid-row: 2; + + .contribution { + font-size: xx-large; + + &.blue { + color: #8686e5; + } + + &.green { + color: #92f892; + } + + &.orange { + color: #e9b688; + } + } + } + } } .wiki { diff --git a/templates/components/gamestatsbox.html b/templates/components/gamestatsbox.html index c5480d9c..a204e011 100644 --- a/templates/components/gamestatsbox.html +++ b/templates/components/gamestatsbox.html @@ -5,7 +5,7 @@
\ No newline at end of file diff --git a/templates/minis/terraria13.html b/templates/minis/terraria13.html new file mode 100644 index 00000000..6b48619b --- /dev/null +++ b/templates/minis/terraria13.html @@ -0,0 +1,21 @@ + +
+
+
+ {{ record.character_name }} +
+
+ + {{ record.contribution }} + + fioryg{% if record.contribution != 1 %}i{% endif %} ottenuti per la partecipazione al server. +
+
+
diff --git a/webserver.py b/webserver.py index 4b3612bd..c5cc7a70 100644 --- a/webserver.py +++ b/webserver.py @@ -126,6 +126,7 @@ def page_profile(name: str): discord = db_session.execute(query_discord_music.one_query, {"royal": user.id}).fetchone() gamelog = db_session.query(db.GameLog).filter_by(royal=user).one_or_none() halloween = db_session.query(db.Halloween).filter_by(royal=user).one_or_none() + terraria13 = db_session.query(db.Terraria13).filter_by(royal=user).one_or_none() db_session.close() if css is not None: converted_bio = Markup(markdown2.markdown(css.bio.replace("<", "<"), @@ -134,7 +135,7 @@ def page_profile(name: str): 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, g=fl_g, bio=converted_bio, gamelog=gamelog, - halloween=halloween) + halloween=halloween, terraria13=terraria13) @app.route("/login") @@ -269,6 +270,9 @@ def page_game(name: str): elif name == "halloween2018": game_name = "Rituale di Halloween" query = db_session.query(db.Halloween).all() + elif name == "terraria13": + game_name = "Terraria 13" + query = db_session.query(db.Terraria13).all() else: abort(404) return @@ -309,6 +313,7 @@ def page_wiki(key: str): elif request.method == "POST": if not fl_g.logged_in: return redirect(url_for("page_login")) + user = db_session.query(db.Royal).filter_by(id=fl_g.user_id).one() new_content = request.form.get("content") # Create new page if wiki_page is None: