Add discordio support in embed endpoint

This commit is contained in:
Jeremy Zhang 2017-06-04 05:48:38 +00:00
parent 0b96794120
commit ae52804a08
2 changed files with 8 additions and 3 deletions

View File

@ -34,7 +34,8 @@ def guild_embed(guild_id):
"id": guild.guild_id, "id": guild.guild_id,
"name": guild.name, "name": guild.name,
"unauth_users": guild.unauth_users, "unauth_users": guild.unauth_users,
"icon": guild.icon "icon": guild.icon,
"discordio": guild.discordio,
} }
return render_template("embed.html.j2", return render_template("embed.html.j2",
login_greeting=get_logingreeting(), login_greeting=get_logingreeting(),

View File

@ -42,7 +42,7 @@
{% if guild['icon'] %} {% if guild['icon'] %}
<img class="circle" src="{{ generate_guild_icon( guild['id'], guild['icon'] ) }}"> <img class="circle" src="{{ generate_guild_icon( guild['id'], guild['icon'] ) }}">
{% endif %} {% endif %}
<span class="name">{{ guild['name'] }}</span> <span class="name">{{ guild['name']|e }}</span>
</div> </div>
</li> </li>
@ -82,8 +82,12 @@
{% if guild['icon'] %} {% if guild['icon'] %}
<img id="modal_guildiconcircle" class="circle" src="{{ generate_guild_icon( guild['id'], guild['icon'] ) }}"> <img id="modal_guildiconcircle" class="circle" src="{{ generate_guild_icon( guild['id'], guild['icon'] ) }}">
{% endif %} {% endif %}
<p id="modal_guildname"><strong>{{ guild['name'] }}</strong></p> <p id="modal_guildname"><strong>{{ guild['name']|e }}</strong></p>
{% if guild["discordio"] %}
<a id="modal_invite_btn_discordio" class="waves-effect waves-light btn" target="_blank" href="http://discord.io/{{ guild["discordio"]|e }}">discord.io/{{ guild["discordio"]|e }}</a>
{% else %}
<a id="modal_invite_btn" class="waves-effect waves-light btn" target="_blank">discord.gg</a> <a id="modal_invite_btn" class="waves-effect waves-light btn" target="_blank">discord.gg</a>
{% endif %}
</div> </div>
<div class="col m9 s12"> <div class="col m9 s12">
<p class="flow-text">Please choose one of the following methods to authenticate!</p> <p class="flow-text">Please choose one of the following methods to authenticate!</p>