175 lines
		
	
	
		
			5.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			175 lines
		
	
	
		
			5.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!DOCTYPE html>
 | 
						|
<html lang="en">
 | 
						|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
 | 
						|
 | 
						|
<head>
 | 
						|
    <title>Redeems Dashboard</title>
 | 
						|
</head>
 | 
						|
<div id="script">
 | 
						|
 | 
						|
    <script src="/static/dashboard.js"></script>
 | 
						|
 | 
						|
    <div class="tab">
 | 
						|
        <button class="tablinks" onclick="openTab(event, 'dashboard')" , id="defaultOpen">Tlapbot dashboard</button>
 | 
						|
        {% if not passive %}
 | 
						|
        {% if queue %}
 | 
						|
        <button class="tablinks" onclick="openTab(event, 'redeem-queue')">Redeem queue</button>
 | 
						|
        {% endif %}
 | 
						|
        <button class="tablinks" onclick="openTab(event, 'redeems-list')">Redeems help</button>
 | 
						|
        {% endif %}
 | 
						|
    </div>
 | 
						|
 | 
						|
    <div id='dashboard' class="tabcontent">
 | 
						|
 | 
						|
        <body>
 | 
						|
            <h3>Redeems Dashboard</h3>
 | 
						|
            {% if (username and users ) %}
 | 
						|
            <table>
 | 
						|
                <thead>
 | 
						|
                    <tr>
 | 
						|
                        <th>Your points balance</th>
 | 
						|
                    </tr>
 | 
						|
                </thead>
 | 
						|
                <tbody>
 | 
						|
                {% for user in users %}
 | 
						|
                    <tr>
 | 
						|
                        <td> {{ user[0] }} </td>
 | 
						|
                        <td> {{ user[1] }} </td>
 | 
						|
                    </tr>
 | 
						|
                {% endfor %}
 | 
						|
                </tbody>
 | 
						|
            </table>
 | 
						|
            {% endif %}
 | 
						|
 | 
						|
            {% if passive %}
 | 
						|
            <h3>Tlapbot is currently in passive mode.</h3>
 | 
						|
            <p>You can't make any redeems, but you will receive points for watching.</p>
 | 
						|
            {% endif %}
 | 
						|
 | 
						|
            {% if not passive %}
 | 
						|
            {% if counters %}
 | 
						|
            <table>
 | 
						|
                <thead>
 | 
						|
                    <tr>
 | 
						|
                        <th>Active counters</th>
 | 
						|
                    </tr>
 | 
						|
                </thead>
 | 
						|
                <tbody>
 | 
						|
                {% for counter in counters %}
 | 
						|
                    <tr>
 | 
						|
                        <td> {{ counter[0] }} </td>
 | 
						|
                        <td> {{ counter[1] }} </td>
 | 
						|
                    </tr>
 | 
						|
                {% endfor %}
 | 
						|
                </tbody>
 | 
						|
            </table>
 | 
						|
            {% endif %}
 | 
						|
            {% if milestones %}
 | 
						|
            <table>
 | 
						|
                <thead>
 | 
						|
                    <tr>
 | 
						|
                        <th colspan="2">Active milestones</th>
 | 
						|
                        <th>Progress</th>
 | 
						|
                    </tr>
 | 
						|
                </thead>
 | 
						|
                <tbody>
 | 
						|
                {% for milestone in milestones %}
 | 
						|
                    <tr>
 | 
						|
                        <td> {{ milestone[0] }} </td>
 | 
						|
                        <td> <progress id="file" max={{ milestone[2] }} value={{ milestone[1] }}></progress></td>
 | 
						|
                        <td> {{ milestone[1] }} / {{ milestone[2] }}</td>
 | 
						|
                    </tr>
 | 
						|
                {% endfor %}
 | 
						|
                </tbody>
 | 
						|
            </table>
 | 
						|
            {% endif %}
 | 
						|
            {% endif %}
 | 
						|
        </body>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <div id='redeem-queue' class="tabcontent">
 | 
						|
 | 
						|
        <body>
 | 
						|
            <h3>Redeems Queue</h3>
 | 
						|
            <p>Past redeemed redeems with timestamps and notes.</p>
 | 
						|
            {% if queue %}
 | 
						|
            <table>
 | 
						|
                <thead>
 | 
						|
                    <tr>
 | 
						|
                        <th colspan="2">Recent redeems</th>
 | 
						|
                    </tr>
 | 
						|
                    <tr>
 | 
						|
                        <th>Time</th>
 | 
						|
                        <th>Redeem</th>
 | 
						|
                        <th>Redeemer</th>
 | 
						|
                        <th>Note</th>
 | 
						|
                    </tr>
 | 
						|
                </thead>
 | 
						|
                <tbody>
 | 
						|
                {% for row in queue %}
 | 
						|
                    <tr>
 | 
						|
                        <td>{{ row[0].replace(tzinfo=utc_timezone).astimezone().strftime("%H:%M") }}</td>
 | 
						|
                        <td>{{ row[1] }}</td>
 | 
						|
                        <td>{{ row[3] }}</td>
 | 
						|
                        {% if row[2] %}
 | 
						|
                        <td>{{ row[2] }}</td>
 | 
						|
                        {% endif %}
 | 
						|
                    </tr>
 | 
						|
                {% endfor %}
 | 
						|
                </tbody>
 | 
						|
            </table>
 | 
						|
            {% endif %}
 | 
						|
        </body>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <div id='redeems-list' class="tabcontent">
 | 
						|
        <h3>Currently active redeems</h3>
 | 
						|
        <p>If you have enough points, you can redeem those redeems by typing the command in chat.</p>
 | 
						|
        <ul>
 | 
						|
            <li><strong>Counter</strong> redeems add +1 to their counter.</li>
 | 
						|
            <li><strong>List</strong> redeems get added to the list of recent redeems (without a note).</li>
 | 
						|
            <li><strong>Note</strong> redeems require you to send a message together with the redeem.</li>
 | 
						|
            <li><strong>Milestone</strong> redeems are long-term goals to which you can donate any amount of points you
 | 
						|
                want. They will be completed once the amount of points donated reaches the goal.</li>
 | 
						|
        </ul>
 | 
						|
 | 
						|
        <body>
 | 
						|
            {% if redeems %}
 | 
						|
            <table>
 | 
						|
                <thead>
 | 
						|
                    <tr>
 | 
						|
                        <th>Redeem</th>
 | 
						|
                        <th>Price</th>
 | 
						|
                        <th>Type</th>
 | 
						|
                        <th>Description</th>
 | 
						|
                    </tr>
 | 
						|
                </thead>
 | 
						|
                <tbody>
 | 
						|
                {% for redeem, redeem_info in redeems.items() %}
 | 
						|
                    <tr>
 | 
						|
                        <td>{{ prefix }}{{ redeem }}</td>
 | 
						|
                        {% if redeem_info["type"] == "milestone" %}
 | 
						|
                        <td></td>
 | 
						|
                        {% else %}
 | 
						|
                        <td>{{ redeem_info["price"] }}</td>
 | 
						|
                        {% endif %}
 | 
						|
                        <td>{{ redeem_info["type"] }}</td>
 | 
						|
                        {% if redeem_info["info"] %}
 | 
						|
                        <td>{{ redeem_info["info"] }}</td>
 | 
						|
                        {% endif %}
 | 
						|
                    </tr>
 | 
						|
                {% endfor %}
 | 
						|
                </tbody>
 | 
						|
            </table>
 | 
						|
            {% endif %}
 | 
						|
        </body>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <script>
 | 
						|
        document.getElementById("defaultOpen").click();
 | 
						|
        setTimeout(refreshPage, 30 * 1000);
 | 
						|
    </script>
 | 
						|
 | 
						|
</div>
 | 
						|
 | 
						|
</html> |