Change referrer url to the vote page

This commit is contained in:
Jeremy Zhang 2018-02-27 21:22:25 +00:00
parent 26aa56cc4e
commit cc0a0bf3bb
2 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@ def privacy():
@app.route("/vote") @app.route("/vote")
def vote(): def vote():
return render_template("discordbotsorg_vote.html.j2") return render_template("discordbotsorg_vote.html.j2", referrer=request.args.get("referrer", None))
@app.before_first_request @app.before_first_request
def before_first_request(): def before_first_request():

View File

@ -10,7 +10,7 @@
<p>You'll receive a <em class="orange-text">GOLDEN NAME</em> in chat and have <em>a chance to win</em> one of the <strong>heroic</strong> prizes!</p> <p>You'll receive a <em class="orange-text">GOLDEN NAME</em> in chat and have <em>a chance to win</em> one of the <strong>heroic</strong> prizes!</p>
<p>Prizes include (but not limited to) Titan Tokens and $4.99 Discord Nitro (Paypal)! Vote often, and <strong>daily</strong>, to increase your chances of winning!</p> <p>Prizes include (but not limited to) Titan Tokens and $4.99 Discord Nitro (Paypal)! Vote often, and <strong>daily</strong>, to increase your chances of winning!</p>
<br> <br>
<a class="waves-effect waves-light btn" href="https://discordbots.org/bot/Titan/vote" target="_blank">Visit Discord Bots!</a> <a class="waves-effect waves-light btn" href="https://discordbots.org/bot/Titan/vote{% if referrer %}?referrer={{ referrer }}{% endif %}" target="_blank">Visit Discord Bots!</a>
</div> </div>
</div> </div>
</div> </div>
@ -24,7 +24,7 @@
<p>Give your pals a personalized referral link and get rewarded for being a <em>great referrer</em>!</p> <p>Give your pals a personalized referral link and get rewarded for being a <em>great referrer</em>!</p>
<br> <br>
{% if "user_id" in session and not session["unauthenticated"] %} {% if "user_id" in session and not session["unauthenticated"] %}
<input readonly value="https://discordbots.org/bot/Titan/vote?referrer={{ session["user_id"] }}" id="disabled" type="text" onClick="this.setSelectionRange(0, this.value.length)"> <input readonly value="{{ url_for("vote", referrer=session["user_id"], _external=True) }}" id="disabled" type="text" onClick="this.setSelectionRange(0, this.value.length)">
{% else %} {% else %}
<p class="red-text">Please <a href="{{ url_for("user.login_authenticated", redirect=url_for("vote")) }}">Login</a> to view your personalized referral link.</p> <p class="red-text">Please <a href="{{ url_for("user.login_authenticated", redirect=url_for("vote")) }}">Login</a> to view your personalized referral link.</p>
{% endif %} {% endif %}