1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +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; border-radius: 0 0 4px 4px;
padding: 8px; padding: 8px;
} }
ul {
column-width: 200px;
word-wrap: break-word;
}
} }
.input-grid { .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) { @media (min-width:601px) {
.mobile-only { .mobile-only {
display: none; display: none;
@ -815,7 +830,9 @@ table {
.wiki-log { .wiki-log {
font-family: "Consolas", "Source Code Pro", monospace; font-family: "Consolas", "Source Code Pro", monospace;
font-size: small;
margin-bottom: 12px; margin-bottom: 12px;
opacity: 0.4;
.last-reason { .last-reason {
font-style: italic; font-style: italic;
@ -859,7 +876,7 @@ table {
} }
} }
.main-page { .two-columns {
display: grid; display: grid;
@media (min-width:601px) { @media (min-width:601px) {
@ -894,11 +911,6 @@ table {
grid-row-end: 3; grid-row-end: 3;
} }
} }
ul {
column-width: 200px;
word-wrap: break-word;
}
} }
.event { .event {
@ -951,3 +963,22 @@ table {
#edit-css { #edit-css {
font-size: medium; 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> <li><a href="/wiki/{{ page.key }}">{{ page.key }}</a></li>
{% endfor %} {% endfor %}
</ul> </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>
</div> </div>

View file

@ -9,90 +9,31 @@
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h1 id="main-title"> <h1 class="super-title">
Royal Games <img src="{{ url_for('static', filename='FixMeRYGLogo.jpg') }}" alt=""> Royal Games
</h1> </h1>
<div class="main-page"> <div class="two-columns">
<div class="left"> <div class="left">
<div class="box"> {% if not g.logged_in %}
{% if next_events %} {% include "components/welcome.html" %}
<div class="upper-box"> {% endif %}
Prossimi eventi {% if g.logged_in %}
</div> {% include "components/eventlist.html" %}
<div class="lower-box"> {% include "components/diariooftheday.html" %}
{% for event in next_events %} {% endif %}
{% include "components/event.html" %} {% include "components/memberbox.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" %}
</div> </div>
<div class="right"> <div class="right">
<div class="box"> {% if not g.logged_in %}
<div class="upper-box"> {% include "components/whatarewe.html" %}
Link utili {% endif %}
</div> {% if g.logged_in %}
<div class="lower-box"> {% include "components/links.html" %}
<ul> {% endif %}
{% if g.rygconf['Telegram']['invite_link'] %} {% include "components/gamestatsbox.html" %}
<li><a href="{{ g.rygconf['Telegram']['invite_link'] }}">Link di unione a Telegram</a></li> {% if g.logged_in %}
{% else %} {% include "components/wikibox.html" %}
<li><i>Link di unione a Telegram disattivato</i></li> {% endif %}
{% 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>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -61,8 +61,6 @@ def page_500():
@app.route("/") @app.route("/")
def page_main(): def page_main():
if not fl_session.get("user_id"):
return redirect(url_for("page_login"))
db_session = db.Session() db_session = db.Session()
royals = db_session.query(db.Royal).order_by(db.Royal.username).all() 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() 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] halloween = db.Halloween.puzzle_status()[1]
db_session.close() db_session.close()
return render_template("main.html", royals=royals, wiki_pages=wiki_pages, entry=random_diario, 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>") @app.route("/profile/<name>")
@ -436,6 +434,11 @@ def hooks_github():
def pre_request(): def pre_request():
fl_g.css = "nryg.less" fl_g.css = "nryg.less"
fl_g.rygconf = config 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__": if __name__ == "__main__":