1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Telegram login improvements

This commit is contained in:
Steffo 2019-08-03 12:28:27 +02:00
parent 92343183c5
commit 02d1419204
6 changed files with 46 additions and 19 deletions

View file

@ -16,8 +16,8 @@ rp = Royalprint("tglogin", __name__, url_prefix="/login/telegram", required_tabl
@rp.route("/") @rp.route("/")
def tglogin_index(): def tglogin_index():
if f.request.url_root != "https://ryg.steffo.eu/": #if f.request.url_root != "https://ryg.steffo.eu/":
return error(404, "Il login tramite Telegram non è possibile su questo dominio.") # return error(404, "Il login tramite Telegram non è possibile su questo dominio.")
f.session.pop("royal", None) f.session.pop("royal", None)
return f.render_template("tglogin_index.html") return f.render_template("tglogin_index.html")

View file

@ -12,6 +12,13 @@
</span> </span>
</div> </div>
<div class="dbox-bot"> <div class="dbox-bot">
<div class="center tg-login-container">
<script async src="https://telegram.org/js/telegram-widget.js?6" data-telegram-login="royalgamesbot" data-size="large" data-auth-url="{{ url_for("tglogin.tglogin_done") }}" data-request-access="write"></script>
</div>
<p>
Per fare il login, devi aver <code>sync</code>ato il tuo account sul gruppo Telegram Royal Games!
</p>
<div class="tiny">
<p> <p>
Facendo il login su questo sito, acconsenti a ricevere due <abbr title="cookie">biscottini</abbr> che memorizzino l'account con cui hai fatto il login.<br> Facendo il login su questo sito, acconsenti a ricevere due <abbr title="cookie">biscottini</abbr> che memorizzino l'account con cui hai fatto il login.<br>
</p> </p>
@ -26,12 +33,7 @@
} }
session["login_date"] = [la data e l'ora di adesso]</code></pre> session["login_date"] = [la data e l'ora di adesso]</code></pre>
<p> </div>
<script async src="https://telegram.org/js/telegram-widget.js?6" data-telegram-login="royalgamesbot" data-size="large" data-auth-url="{{ url_for("tglogin.tglogin_done") }}" data-request-access="write"></script>
</p>
<p>
Nota: per fare il login, devi aver <code>sync</code>ato il tuo account sul gruppo Telegram Royal Games!
</p>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -336,6 +336,13 @@ form.full label.label-big * {
.disabled { .disabled {
opacity: 0.3; opacity: 0.3;
} }
/*** Modifiers ***/
.tiny {
font-size: xx-small;
}
.center {
margin: auto;
}
/*** Custom elements ***/ /*** Custom elements ***/
.CodeMirror { .CodeMirror {
font-family: "Consolas", monospace !important; font-family: "Consolas", monospace !important;
@ -751,4 +758,8 @@ form.full label.label-big * {
.profile .profile-stats .stats-value { .profile .profile-stats .stats-value {
font-weight: bold; font-weight: bold;
} }
.tg-login-container {
width: 238px;
height: 40px;
}
/*# sourceMappingURL=ryg.css.map */ /*# sourceMappingURL=ryg.css.map */

File diff suppressed because one or more lines are too long

View file

@ -418,6 +418,15 @@ form.full {
} }
/*** Modifiers ***/
.tiny {
font-size: xx-small;
}
.center {
margin: auto;
}
/*** Custom elements ***/ /*** Custom elements ***/
@ -946,3 +955,8 @@ form.full {
} }
} }
} }
.tg-login-container {
width: 238px;
height: 40px;
}

View file

@ -46,7 +46,7 @@
</a> </a>
{% else %} {% else %}
<span class="nav-login"> <span class="nav-login">
<a class="no-icon" href="{{ url_for("login.login_index") }}"> <a class="no-icon" href="{{ url_for("tglogin.tglogin_index") }}">
Login Login
<img class="nav-image disabled" alt="" src="{{ url_for("static", filename="generic.png") }}"> <img class="nav-image disabled" alt="" src="{{ url_for("static", filename="generic.png") }}">
</a> </a>