123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>OCB - Stream Points and Rewards</title>
- <link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
- <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
- </head>
- <script src="/static/userpanel.js"></script>
-
- <div class="navbar">
- <div class="tab">
- <button class="tablinks" data-tab="ocbinfo" onclick="openTab(event, 'ocbinfo')">OwnchatBot Info</button>
- <button class="tablinks" data-tab="rewards" onclick="openTab(event, 'rewards')">Points and Rewards</button>
- <button class="tablinks" data-tab="queue" onclick="openTab(event, 'queue')">Redeems Queue</button>
- </div>
- <img src="/static/img/ownchatbotwide.png">
- </div>
- <div id='ocbinfo' class="tabcontent">
- <h3>OwnchatBot Info</h3>
- <h4>Reward types</h4>
- <ul>
- <li><u>Redeems</u> are standard stream point redeems. They get added to the queue for the streamer to fulfill.</li>
- <li><u>Votes</u> are just that, votes. You vote on them.</li>
- <li><u>Goals</u> are rewards that everyone in chat can contribute to. The streamer fulfills the reward when the goal is reached.</li>
- </ul>
- <h4>Chat commands</h4>
- <ul>
- <li>{{ prefix }}help - Shows the help message.</li>
- <li>{{ prefix }}points - Shows your current points.</li>
- <li>{{ prefix }}rewards - Shows you the list of active rewards.</li>
- </ul>
- </div>
-
- <div id='rewards' class="tabcontent">
- <body>
- <h3>Points and Rewards</h3>
- {% for user in users %}
-
- {% set points_label = 'point' if points_award == 1 else 'points' %}
- {% set minutes_label = 'minute' if points_interval == 1 else 'minutes' %}
- {{ user[0] }}, you currently have {{ user[1] }} {{ points_label }}.<br>
- You are accruing {{ points_award }} {{ points_label }} every {{ points_interval }} {{ minutes_label }}.
- {% endfor %}
- <h3>Active Votes</h3>
- <table>
- <thead>
- <tr>
- <th style="width: 20%;">Name</th>
- <th style="width: 40%;">Description</th>
- <th style="width: 20%;">Price</th>
- <th style="width: 20%;">Current Tally</th>
- </tr>
- </thead>
- <tbody>
- {% for vote in votes %}
- <tr>
- <td> {{ prefix }}{{ vote[0] }} </td>
- <td> {{ vote[2] }} </td>
-
- {% set points_label = 'point' if rewards[vote[0]]["price"] == 1 else 'points' %}
- <td> {{ rewards[vote[0]]["price"] }} {{ points_label }}</td>
-
- {% set votes_label = 'vote' if vote[1] == 1 else 'votes' %}
-
- <td> {{ vote[1] }} {{ votes_label }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- <h3>Active Goals</h3>
- {% if goals %}
- <table>
- <thead>
- <tr>
- <th style="width: 20%;">Name</th>
- <th style="width: 40%;">Description</th>
- <th style="width: 25%;">Progress</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- {% for goal in goals %}
- <tr>
- <td> {{ prefix }}{{ goal[0] }} </td>
- <td> {{ goal[3] }} </td>
- {% set progress = goal[1] / goal[2] * 100 %}
- <td><div class="bar-light-grey bar-tiny bar-round">
- <div class="bar-round bar-blue" style="text-align: center; width:{{ goal[1] / goal[2] * 100 }}%;">{{ '%0.0f'| format(progress| float) }}%</div></td>
- {% if goal[1] == goal[2] %}
- <td> {{ goal[1] }} / {{ goal[2] }} <img src=/static/img/tada.png style="width: 24px; height: 24px;"></td>
- {% else %}
- <td> {{ goal[1] }} / {{ goal[2] }} </td>
- {% endif %}
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% else %}
- There are currently no active goals
- <br>
- {% endif %}
- </body>
- <body>
- <h3>Active Redeems</h3>
- {% if rewards %}
- <table>
- <thead>
- <tr>
- <th style="width: 20%;">Name</th>
- <th style="width: 40%;">Description</th>
- <th>Cool down</th>
- <th style="width: 25%;">Price</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- {% for reward, reward_info in rewards.items() %}
- {% if reward_info["type"] == "redeem" or reward_info["type"] == "special" %}
- <tr>
- <td>{{ prefix }}{{ reward }}</td>
- <td>{{ reward_info["info"] }}</td>
- {% if reward_info["cooldown"] > 0 %}
-
- {% set minutes_label = 'minute' if reward_info["cooldown"] == 1 else 'minutes' %}
-
- <td>{{ reward_info["cooldown"] }} {{ minutes_label }}</td>
- {% else %}
- <td>None</td>
- {% endif %}
-
- {% set points_label = 'point' if reward_info["price"] == 1 else 'points' %}
-
- <td>{{ reward_info["price"] }} {{ points_label }}</td>
- <td></td>
- </tr>
- {% endif %}
- {% endfor %}
- </tbody>
- </table>
- {% else %}
- There are currently no active redeems
- {% endif %}
- <br><br>
- </body>
- </div>
- <div id='queue' class="tabcontent">
- <body>
- <h3>Queue</h3>
- {% if queue %}
- <table>
- <thead>
- <tr>
- <th>Time</th>
- <th>Name</th>
- <th>Description</th>
- <th>User</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- {% for row in queue %}
- {% if not row[4] %}
- <tr>
- <td>{{ row[1].replace(tzinfo=utc_timezone).astimezone().strftime("%H:%M") }}</td>
- <td>{{ prefix }}{{ row[2] }}</td>
- <td>{{ all_rewards[row[2]]["info"] }}</td>
- {% if row[6] %}
- <td>{{ row[6] }}</td>
- {% else %}
- <td></td>
- {% endif %}
- </tr>
- {% endif %}
- {% endfor %}
- </tbody>
- </table>
- {% else %}
- The queue is currently empty
- {% endif %}
- </body>
- <br><br>
- </div><script>
- setTimeout(refreshPage, 30 * 1000);
- </script>
- </html>
|