This commit is contained in:
jude 2022-05-14 12:02:46 +01:00
parent 8eb46f1f23
commit bfc2d71ca0
14 changed files with 248 additions and 13 deletions

View File

@ -294,6 +294,7 @@ ON
reminders.channel_id = channels.id reminders.channel_id = channels.id
WHERE WHERE
reminders.`utc_time` < NOW() reminders.`utc_time` < NOW()
LIMIT 25
"#, "#,
) )
.fetch_all(pool) .fetch_all(pool)

View File

@ -126,6 +126,9 @@ pub async fn initialize(
routes::help_timers, routes::help_timers,
routes::help_todo_lists, routes::help_todo_lists,
routes::help_macros, routes::help_macros,
routes::help_intervals,
routes::help_dashboard,
routes::help_iemanager,
], ],
) )
.mount("/login", routes![routes::login::discord_login, routes::login::discord_callback]) .mount("/login", routes![routes::login::discord_login, routes::login::discord_callback])

View File

@ -86,3 +86,21 @@ pub async fn help_macros() -> Template {
let map: HashMap<&str, String> = HashMap::new(); let map: HashMap<&str, String> = HashMap::new();
Template::render("support/macros", &map) Template::render("support/macros", &map)
} }
#[get("/intervals")]
pub async fn help_intervals() -> Template {
let map: HashMap<&str, String> = HashMap::new();
Template::render("support/intervals", &map)
}
#[get("/dashboard")]
pub async fn help_dashboard() -> Template {
let map: HashMap<&str, String> = HashMap::new();
Template::render("support/dashboard", &map)
}
#[get("/iemanager")]
pub async fn help_iemanager() -> Template {
let map: HashMap<&str, String> = HashMap::new();
Template::render("support/iemanager", &map)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -18,6 +18,7 @@ let roles = [];
let templates = {}; let templates = {};
let globalPatreon = false; let globalPatreon = false;
let guildPatreon = false;
function guildId() { function guildId() {
return document.querySelector(".guildList a.is-active").dataset["guild"]; return document.querySelector(".guildList a.is-active").dataset["guild"];
@ -78,6 +79,18 @@ function reset_guild_pane() {
.forEach((opt) => opt.remove()); .forEach((opt) => opt.remove());
} }
async function fetch_patreon(guild_id) {
fetch(`/dashboard/api/guild/${guild_id}/patreon`)
.then((response) => response.json())
.then((data) => {
if (data.error) {
show_error(data.error);
} else {
return data.patreon;
}
});
}
function fetch_roles(guild_id) { function fetch_roles(guild_id) {
fetch(`/dashboard/api/guild/${guild_id}/roles`) fetch(`/dashboard/api/guild/${guild_id}/roles`)
.then((response) => response.json()) .then((response) => response.json())
@ -370,6 +383,10 @@ function deserialize_reminder(reminder, frame, mode) {
document.addEventListener("guildSwitched", async (e) => { document.addEventListener("guildSwitched", async (e) => {
$loader.classList.remove("is-hidden"); $loader.classList.remove("is-hidden");
document
.querySelectorAll(".patreon-only")
.forEach((el) => el.classList.add("is-locked"));
let $anchor = document.querySelector( let $anchor = document.querySelector(
`.switch-pane[data-guild="${e.detail.guild_id}"]` `.switch-pane[data-guild="${e.detail.guild_id}"]`
); );
@ -378,6 +395,11 @@ document.addEventListener("guildSwitched", async (e) => {
reset_guild_pane(); reset_guild_pane();
$anchor.classList.add("is-active"); $anchor.classList.add("is-active");
if (globalPatreon || (await fetch_patreon(e.detail.guild_id))) {
document
.querySelectorAll(".patreon-only")
.forEach((el) => el.classList.remove("is-locked"));
}
fetch_roles(e.detail.guild_id); fetch_roles(e.detail.guild_id);
fetch_templates(e.detail.guild_id); fetch_templates(e.detail.guild_id);
await fetch_channels(e.detail.guild_id); await fetch_channels(e.detail.guild_id);

View File

@ -93,6 +93,65 @@
</article> </article>
</div> </div>
</div> </div>
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile is-child notification">
<p class="title">Intervals</p>
<p class="subtitle">Learn about repeating reminders</p>
<div class="content has-text-centered">
<a class="button is-size-4 is-rounded is-light" href="/help/intervals">
<p class="is-size-4">
Read <span class="icon"><i class="fas fa-chevron-right"></i></span>
</p>
</a>
</div>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child notification">
<p class="title">Dashboard</p>
<p class="subtitle">Learn to use the interactive web dashboard</p>
<div class="content has-text-centered">
<a class="button is-size-4 is-rounded is-light" href="/help/dashboard">
<p class="is-size-4">
Read <span class="icon"><i class="fas fa-chevron-right"></i></span>
</p>
</a>
</div>
</article>
</div>
<div class="tile is-parent is-vertical">
<article class="tile is-child notification">
<p class="title">Import/Export</p>
<p class="subtitle">Learn how to import and export data from the dashboard</p>
<div class="content has-text-centered">
<a class="button is-size-4 is-rounded is-light" href="/help/macros">
<p class="is-size-4">
Read <span class="icon"><i class="fas fa-chevron-right"></i></span>
</p>
</a>
</div>
</article>
</div>
</div>
</div> </div>
<section class="hero is-small">
<div class="hero-body">
<div class="container has-text-centered">
<p class="title">Need more help?</p>
<p class="content">
Feel free to come and ask us!
</p>
</div>
</div>
<div class="hero-foot has-text-centered">
<a class="button is-size-6 is-rounded is-primary" href="https://discord.jellywx.com">
<p class="is-size-6">
Join Discord <span class="icon"><i class="fas fa-chevron-right"></i></span>
</p>
</a>
</div>
</section>
{% endblock %} {% endblock %}

View File

@ -158,9 +158,9 @@
</div> </div>
<div class="collapses"> <div class="collapses">
<div class="is-locked"> <div class="patreon-only">
<div class="field"> <div class="field">
<label class="label">Interval <a class="foreground" href="/help/interval"><i class="fas fa-question-circle"></i></a></label> <label class="label">Interval <a class="foreground" href="/help/intervals"><i class="fas fa-question-circle"></i></a></label>
<div class="control intervalSelector" style="min-width: 400px;" > <div class="control intervalSelector" style="min-width: 400px;" >
<div class="input interval-group"> <div class="input interval-group">
<div class="interval-group-left"> <div class="interval-group-left">
@ -206,11 +206,6 @@
<label class="label">Enable TTS <input type="checkbox" name="tts"></label> <label class="label">Enable TTS <input type="checkbox" name="tts"></label>
</div> </div>
</div> </div>
<div class="column has-text-centered">
<div class="is-boxed">
<label class="label">Pin Message <input type="checkbox" name="pin"></label>
</div>
</div>
<div class="column has-text-centered"> <div class="column has-text-centered">
<div class="file is-small is-boxed"> <div class="file is-small is-boxed">
<label class="file-label"> <label class="file-label">

View File

@ -0,0 +1,22 @@
{% extends "base" %}
{% block init %}
{% set title = "Support" %}
{% set page_title = "Dashboard" %}
{% set page_subtitle = "" %}
{% endblock %}
{% block content %}
<section class="hero is-small">
<div class="hero-body">
<div class="container">
<p class="title">Accessing the dashboard</p>
<p class="content">
</p>
</div>
</div>
</section>
{% endblock %}

View File

@ -33,6 +33,24 @@
</div> </div>
</section> </section>
<section class="hero is-small">
<div class="hero-body">
<div class="container">
<p class="title">Deleting reminders you've just created</p>
<p class="content">
If you made a mistake, you can quickly delete a reminder you made by pressing "Cancel"
<br>
</p>
<figure>
<img src="/static/img/support/delete_reminder/cancel-1.png" alt="Cancel button">
</figure>
<figure>
<img src="/static/img/support/delete_reminder/cancel-2.png" alt="Reminder deleted">
</figure>
</div>
</div>
</section>
<section class="hero is-small"> <section class="hero is-small">
<div class="hero-body"> <div class="hero-body">
<div class="container"> <div class="container">

View File

@ -0,0 +1,26 @@
{% extends "base" %}
{% block init %}
{% set title = "Support" %}
{% set page_title = "Import/Export" %}
{% set page_subtitle = "" %}
{% endblock %}
{% block content %}
<section class="hero is-small">
<div class="hero-body">
<div class="container">
<p class="title">Export your data</p>
<p class="content">
You can create reminders with the <code>/remind</code> command.
<br>
Fill out the "time" and "content" fields. If you wish, press on "Optional" to view other options
for the reminder.
</p>
</div>
</div>
</section>
{% endblock %}

View File

@ -0,0 +1,70 @@
{% extends "base" %}
{% block init %}
{% set title = "Support" %}
{% set page_title = "Intervals" %}
{% set page_subtitle = "Interval reminders, or repeating reminders, are available to our Patreon supporters" %}
{% endblock %}
{% block content %}
<section class="hero is-small">
<div class="hero-body">
<div class="container">
<p class="title">Fixed intervals</p>
<p class="content">
The main type of interval is the fixed interval. Fixed intervals are ideal for hourly, daily, or
reminders repeating at any other fixed amount of time.
<br>
You can create fixed interval reminders via the dashboard or via the <code>/remind</code> command.
When you have filled out the "time" and "content" on the command, press <kbd>tab</kbd>. Select the
"interval" option. Then, write the interval you wish to use: for example, "1 day" for daily (starting
at the time specified in "time").
</p>
</div>
</div>
</section>
<section class="hero is-small">
<div class="hero-body">
<div class="container">
<p class="title">Daylight savings</p>
<p class="content">
If you live in a region that uses daylight savings (DST), then your interval reminders may become
offset by an hour due to clock changes.
<br>
Reminder Bot offers a quick solution to this via the <code>/offset</code> command. This command
moves all existing reminders on a server by a certain amount of time. You can use offset to move
your reminders forward or backward by an hour when daylight savings happens.
</p>
</div>
</div>
</section>
<section class="hero is-small">
<div class="hero-body">
<div class="container">
<p class="title">Monthly/yearly intervals</p>
<p class="content">
Monthly or yearly intervals are configured the same as fixed intervals. Instead of a fixed time
interval, these reminders repeat on a certain day each month or each year. This makes them ideal
for marking certain dates.
</p>
</div>
</div>
</section>
<section class="hero is-small">
<div class="hero-body">
<div class="container">
<p class="title">Interval expiration</p>
<p class="content">
An expiration time can also be specified, both via commands and dashboard, for repeating reminders.
This is optional, and if omitted, the reminder will repeat indefinitely.
</p>
</div>
</div>
</section>
{% endblock %}

View File

@ -3,8 +3,8 @@
{% block init %} {% block init %}
{% set title = "Support" %} {% set title = "Support" %}
{% set page_title = "Timezone Help" %} {% set page_title = "Timezones" %}
{% set page_subtitle = "Timezones are tricky. Read on for help" %} {% set page_subtitle = "" %}
{% set show_invite = false %} {% set show_invite = false %}
{% endblock %} {% endblock %}
@ -31,7 +31,7 @@
<div class="container"> <div class="container">
<p class="title">Selecting your timezone automatically</p> <p class="title">Selecting your timezone automatically</p>
<p class="content"> <p class="content">
A new feature we offer is the ability to configure Reminder Bot's timezone from your browser. To do You can also configure Reminder Bot's timezone from your browser. To do
this, go to our dashboard, press 'Timezone' in the bottom left (desktop) or at the bottom of the this, go to our dashboard, press 'Timezone' in the bottom left (desktop) or at the bottom of the
navigation menu (mobile). Then, choose 'Set Bot Timezone' to set Reminder Bot to use your browser's navigation menu (mobile). Then, choose 'Set Bot Timezone' to set Reminder Bot to use your browser's
timezone. timezone.

View File

@ -23,8 +23,8 @@
Reminder Bot or the Discord server. Reminder Bot or the Discord server.
<br> <br>
<br> <br>
The Terms of Service may be updated at any time, and should be considered a guideline for appropriate The Terms of Service may be updated at any time. Notice will be provided via the Discord server. You
behaviour. should consider the Terms of Service to be a guideline for appropriate behaviour.
</p> </p>
</div> </div>
</section> </section>
@ -35,7 +35,8 @@
<ul class="is-size-5 pl-6"> <ul class="is-size-5 pl-6">
<li>Reasonably disclose potential exploits or bugs to me by email or by Discord private message</li> <li>Reasonably disclose potential exploits or bugs to me by email or by Discord private message</li>
<li>Do not use the bot to harass other Discord users</li> <li>Do not use the bot to harass other Discord users</li>
<li>Do not use the bot to send more than 30 messages during a 60 second period</li> <li>Do not use the bot to transmit malware or other illegal content</li>
<li>Do not use the bot to send more than 15 messages during a 60 second period</li>
</ul> </ul>
</div> </div>
</section> </section>