Donation goal banner

This commit is contained in:
Jeremy Zhang
2019-10-12 22:36:37 -07:00
parent b0c9e6c5ec
commit 0ec0b52501
10 changed files with 182 additions and 7 deletions

View File

@ -0,0 +1,30 @@
{% extends 'site_layout.html.j2' %}
{% set title="Manage Guilds as Administrator" %}
{% block content %}
<h1>Application Settings</h1>
<p class="flow-text">Manage Titan Embeds</p>
<div class="col s12">
<div class="card-panel indigo lighten-5 z-depth-3 hoverable">
<p class="black-text flow-text">Donation Goal</p>
<div class="row">
<div class="input-field col s12">
<input id="donation_goal_progress" type="number" class="black-text" value="{{ settings.donation_goal_progress }}">
<label for="donation_goal_progress">Current Goal Progress</label>
</div>
<div class="input-field col s12">
<input id="donation_goal_total" type="number" class="black-text" value="{{ settings.donation_goal_total }}">
<label for="donation_goal_total">Current Goal Total (set 0 to disable)</label>
</div>
<div class="input-field col s12">
<input id="donation_goal_end" type="text" class="black-text" {% if settings.donation_goal_end %}value="{{ settings.donation_goal_end.strftime('%m/%d/%Y') }}"{% endif %}>
<label for="donation_goal_end">Goal End Date (mm/dd/yyyy)</label>
</div>
</div>
<a class="waves-effect waves-light btn" id="submit">Submit</a>
</div>
</div>
{% endblock %}
{% block script %}
<script type="text/javascript" src="{{ url_for('static', filename='js/admin_application_settings.js') }}"></script>
{% endblock %}

View File

@ -56,5 +56,12 @@
<a class="waves-effect waves-light btn" href="{{ url_for('admin.get_disabled_guilds') }}">Manage</a>
</div>
</div>
<div class="col s12">
<div class="card-panel indigo lighten-5 z-depth-3 hoverable black-text">
<h4>Application Settings</h4>
<p class="flow-text">Configure Titan Embeds.</p>
<a class="waves-effect waves-light btn" href="{{ url_for('admin.application_settings_get') }}">Manage</a>
</div>
</div>
</div>
{% endblock %}

View File

@ -31,6 +31,7 @@
{% include 'google_analytics.html.j2' %}
</head>
<body>
{% if random.randrange(100) < 50 %}
<div id="dblbanner">
<span>
<strong>Hey!</strong> Upvote us on <a href="{{ url_for("vote") }}">Discord Bots List</a> to show your
@ -38,6 +39,17 @@
<span class="yellow-text">golden name</span></em> and rewards in return for your vote)
</span>
</div>
{% else %}
<div id="donbanner">
<span>
<strong>Hey! We need your help!</strong> Support the Titan Embeds project on <a href="http://patreon.com/TitanEmbeds" target="_blank">Patreon</a> to help us cover the cost of server hosting!
{% if application_settings.donation_goal_total %}
<br>
<strong>Goal: <span class="yellow-text">${{ application_settings.donation_goal_progress }} raised out of ${{ application_settings.donation_goal_total }}</span>{% if application_settings.donation_goal_end %} by {{ application_settings.donation_goal_end }}{% endif %}</strong>
{% endif %}
</span>
</div>
{% endif %}
<main>
{% if session['unauthenticated'] is defined and not session['unauthenticated'] %}
<ul id="menu_dropdown" class="dropdown-content">
@ -106,6 +118,9 @@
});
</script>
{% endif %}
<script>
$('#donbanner').delay(1000).slideDown("slow");
</script>
{% if af_mode_enabled %}
<script type="text/javascript" src="{{ url_for('static', filename='js/site.af.sausage.js') }}"></script>