1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Split in components and display the main page to anyone

This commit is contained in:
Steffo 2019-01-06 19:29:06 +01:00
parent e45bfaacf5
commit 04f55b555e
11 changed files with 159 additions and 90 deletions

View file

@ -254,6 +254,11 @@ table {
border-radius: 0 0 4px 4px;
padding: 8px;
}
ul {
column-width: 200px;
word-wrap: break-word;
}
}
.input-grid {
@ -270,6 +275,16 @@ table {
}
}
.super-title {
font-size: 64px;
text-align: center;
img {
height: 128px;
vertical-align: middle;
}
}
@media (min-width:601px) {
.mobile-only {
display: none;
@ -815,7 +830,9 @@ table {
.wiki-log {
font-family: "Consolas", "Source Code Pro", monospace;
font-size: small;
margin-bottom: 12px;
opacity: 0.4;
.last-reason {
font-style: italic;
@ -859,7 +876,7 @@ table {
}
}
.main-page {
.two-columns {
display: grid;
@media (min-width:601px) {
@ -894,11 +911,6 @@ table {
grid-row-end: 3;
}
}
ul {
column-width: 200px;
word-wrap: break-word;
}
}
.event {
@ -951,3 +963,22 @@ table {
#edit-css {
font-size: medium;
}
#members-list {
list-style: none;
li {
&::before {
content: "•";
display: inline-block;
width: 1em;
margin-left: -1em;
}
&.admin {
&::before {
color: #ffff00;
}
}
}
}

View file

@ -0,0 +1,9 @@
<div class="box">
<div class="upper-box">
Citazione casuale dal diario
</div>
<div class="lower-box">
{% include "components/diarioentry.html" %}
<a href="{{ url_for("page_diario") }}">Visualizza tutto il diario</a>
</div>
</div>

View file

@ -0,0 +1,12 @@
<div class="box">
{% if next_events %}
<div class="upper-box">
Prossimi eventi
</div>
<div class="lower-box">
{% for event in events %}
{% include "components/event.html" %}
{% endfor %}
</div>
{% endif %}
</div>

View file

@ -0,0 +1,18 @@
<div class="box">
<div class="upper-box">
Noi in vari giochi
</div>
<div class="lower-box">
<ul>
<li><a href="{{ url_for("page_game", name="ryg") }}">Royal Games</a></li>
<li><a href="{{ url_for("page_game", name="halloween2018") }}">Halloween 2018</a></li>
<li><a href="{{ url_for("page_game", name="tg") }}">Telegram</a></li>
<li><a href="{{ url_for("page_game", name="discord") }}">Discord</a></li>
<li><a href="{{ url_for("page_game", name="steam") }}">Steam</a></li>
<li><a href="{{ url_for("page_game", name="dota") }}">Dota 2</a></li>
<li><a href="{{ url_for("page_game", name="lol") }}">League of Legends</a></li>
<li><a href="{{ url_for("page_game", name="ow") }}">Overwatch</a></li>
<li><a href="{{ url_for("page_game", name="osu") }}">osu!</a></li>
</ul>
</div>
</div>

View file

@ -0,0 +1,25 @@
<div class="box">
<div class="upper-box">
Link riservati ai membri
</div>
<div class="lower-box">
<ul>
{% if g.rygconf['Telegram']['invite_link'] %}
<li><a href="{{ g.rygconf['Telegram']['invite_link'] }}">Link di unione a Telegram</a></li>
{% else %}
<li><i>Link di unione a Telegram disattivato</i></li>
{% endif %}
{% if g.rygconf['Discord']['invite_link'] %}
<li><a href="{{ g.rygconf['Discord']['invite_link'] }}">Link di invito a Discord</a></li>
{% else %}
<li><i>Link di invito a Discord disattivato</i></li>
{% endif %}
<li><a href="https://steamcommunity.com/groups/royalgamescastle">Gruppo Steam Community</a></li>
<li><a href="https://new.reddit.com/r/RoyalGames/">/r/RoyalGames</a></li>
<li><a href="{{ url_for("page_music") }}">Statistiche su Royal Music</a></li>
<li><a href="http://amazon.steffo.eu/royal-music-cache/">File in cache di Royal Music</a></li>
<li><a href="{{ url_for("page_activity") }}">Statistiche sull'attività</a></li>
<li><a href="https://github.com/Steffo99/royalnet">Codice sorgente di Royalnet</a></li>
</ul>
</div>
</div>

View file

@ -0,0 +1,12 @@
<div class="box">
<div class="upper-box">
Membri
</div>
<div class="lower-box">
<ul>
{% for royal in royals %}
<li><a href="/profile/{{ royal.username }}">{{ royal.username }}</a></li>
{% endfor %}
</ul>
</div>
</div>

View file

@ -0,0 +1,8 @@
<div class="box">
<div class="upper-box">
Benvenuti!
</div>
<div class="lower-box">
Benvenuti al sito della community Royal Games!
</div>
</div>

View file

@ -0,0 +1,8 @@
<div class="box">
<div class="upper-box">
Cosa siamo?
</div>
<div class="lower-box">
La Royal Games è una community... indescrivibile!
</div>
</div>

View file

@ -14,6 +14,8 @@
<li><a href="/wiki/{{ page.key }}">{{ page.key }}</a></li>
{% endfor %}
</ul>
oppure... <input id="input-key" name="key" type="text" placeholder="Nome pagina" class="half"><button onclick="createpage()">Crea</button>
{% if g.logged_in %}
oppure... <input id="input-key" name="key" type="text" placeholder="Nome pagina" class="half"><button onclick="createpage()">Crea</button>
{% endif %}
</div>
</div>

View file

@ -9,90 +9,31 @@
{% endblock %}
{% block body %}
<h1 id="main-title">
Royal Games
<h1 class="super-title">
<img src="{{ url_for('static', filename='FixMeRYGLogo.jpg') }}" alt=""> Royal Games
</h1>
<div class="main-page">
<div class="two-columns">
<div class="left">
<div class="box">
{% if next_events %}
<div class="upper-box">
Prossimi eventi
</div>
<div class="lower-box">
{% for event in next_events %}
{% include "components/event.html" %}
{% endfor %}
</div>
{% endif %}
</div>
<div class="box">
<div class="upper-box">
Citazione casuale dal diario
</div>
<div class="lower-box">
{% include "components/diarioentry.html" %}
<a href="{{ url_for("page_diario") }}">Visualizza tutto</a>
</div>
</div>
{% include "components/wikibox.html" %}
{% if not g.logged_in %}
{% include "components/welcome.html" %}
{% endif %}
{% if g.logged_in %}
{% include "components/eventlist.html" %}
{% include "components/diariooftheday.html" %}
{% endif %}
{% include "components/memberbox.html" %}
</div>
<div class="right">
<div class="box">
<div class="upper-box">
Link utili
</div>
<div class="lower-box">
<ul>
{% if g.rygconf['Telegram']['invite_link'] %}
<li><a href="{{ g.rygconf['Telegram']['invite_link'] }}">Link di unione a Telegram</a></li>
{% else %}
<li><i>Link di unione a Telegram disattivato</i></li>
{% endif %}
{% if g.rygconf['Discord']['invite_link'] %}
<li><a href="{{ g.rygconf['Discord']['invite_link'] }}">Link di invito a Discord</a></li>
{% else %}
<li><i>Link di invito a Discord disattivato</i></li>
{% endif %}
<li><a href="https://steamcommunity.com/groups/royalgamescastle">Gruppo Steam Community</a></li>
<li><a href="https://new.reddit.com/r/RoyalGames/">/r/RoyalGames</a></li>
<li><a href="{{ url_for("page_music") }}">Statistiche su Royal Music</a></li>
<li><a href="http://amazon.steffo.eu/royal-music-cache/">File in cache di Royal Music</a></li>
<li><a href="{{ url_for("page_activity") }}">Statistiche sull'attività</a></li>
<li><a href="https://github.com/Steffo99/royalnet">Codice sorgente di Royalnet</a></li>
</ul>
</div>
</div>
<div class="box">
<div class="upper-box">
Membri
</div>
<div class="lower-box">
<ul>
{% for royal in royals %}
<li><a href="/profile/{{ royal.username }}">{{ royal.username }}</a></li>
{% endfor %}
</ul>
</div>
</div>
<div class="box">
<div class="upper-box">
Resoconti
</div>
<div class="lower-box">
<ul>
<li><a href="{{ url_for("page_game", name="ryg") }}">Royal Games</a></li>
<li><a href="{{ url_for("page_game", name="halloween2018") }}">Halloween 2018</a></li>
<li><a href="{{ url_for("page_game", name="tg") }}">Telegram</a></li>
<li><a href="{{ url_for("page_game", name="discord") }}">Discord</a></li>
<li><a href="{{ url_for("page_game", name="steam") }}">Steam</a></li>
<li><a href="{{ url_for("page_game", name="dota") }}">Dota 2</a></li>
<li><a href="{{ url_for("page_game", name="lol") }}">League of Legends</a></li>
<li><a href="{{ url_for("page_game", name="ow") }}">Overwatch</a></li>
<li><a href="{{ url_for("page_game", name="osu") }}">osu!</a></li>
</ul>
</div>
</div>
{% if not g.logged_in %}
{% include "components/whatarewe.html" %}
{% endif %}
{% if g.logged_in %}
{% include "components/links.html" %}
{% endif %}
{% include "components/gamestatsbox.html" %}
{% if g.logged_in %}
{% include "components/wikibox.html" %}
{% endif %}
</div>
</div>
{% endblock %}

View file

@ -61,8 +61,6 @@ def page_500():
@app.route("/")
def page_main():
if not fl_session.get("user_id"):
return redirect(url_for("page_login"))
db_session = db.Session()
royals = db_session.query(db.Royal).order_by(db.Royal.username).all()
wiki_pages = db_session.query(db.WikiEntry).order_by(db.WikiEntry.key).all()
@ -72,7 +70,7 @@ def page_main():
halloween = db.Halloween.puzzle_status()[1]
db_session.close()
return render_template("main.html", royals=royals, wiki_pages=wiki_pages, entry=random_diario,
next_events=next_events, g=fl_g, escape=escape, halloween=enumerate(halloween))
events=next_events, g=fl_g, escape=escape, halloween=enumerate(halloween))
@app.route("/profile/<name>")
@ -436,6 +434,11 @@ def hooks_github():
def pre_request():
fl_g.css = "nryg.less"
fl_g.rygconf = config
if fl_session is not None and fl_session.get("username") is not None and fl_session.get("user_id") is not None:
fl_g.logged_in = True
else:
fl_g.logged_in = False
if __name__ == "__main__":