[AB-291] adding templates for new pagination system

adding templates for mutes command
This commit is contained in:
Sheldan
2021-12-01 01:13:44 +01:00
parent 4c988e6c3e
commit 02d5d7cc1c
22 changed files with 124 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
{
<#include "assignable_place_color">,
<#include "abstracto_color">,
<#assign text><#include "${commandName}_confirmation"></#assign>
"description": "${text?json_string}",
"buttons": [

View File

@@ -0,0 +1,60 @@
{
"label": "<@safe_include "paginator_exit_button_label"/>",
"id": "${exitButtonId}",
"buttonStyle": "secondary",
"emoteMarkdown": "⏹️",
"metaConfig": {
"persistCallback": false
}
}
<#if !exitOnly>
,
{
"label": "<@safe_include "paginator_start_button_label"/>",
"id": "${startButtonId}",
"buttonStyle": "secondary",
<#if counter = 0>
"disabled": true,
</#if>
"emoteMarkdown": "⏮",
"metaConfig": {
"persistCallback": false
}
},
{
"label": "<@safe_include "paginator_previous_button_label"/>",
"id": "${previousButtonId}",
"buttonStyle": "secondary",
<#if counter = 0>
"disabled": true,
</#if>
"emoteMarkdown": "◀️",
"metaConfig": {
"persistCallback": false
}
},
{
"label": "<@safe_include "paginator_next_button_label"/>",
"id": "${nextButtonId}",
"buttonStyle": "secondary",
<#if counter = chunks?size -1>
"disabled": true,
</#if>
"emoteMarkdown": "▶",
"metaConfig": {
"persistCallback": false
}
},
{
"label": "<@safe_include "paginator_last_button_label"/>",
"id": "${lastButtonId}",
"buttonStyle": "secondary",
<#if counter = chunks?size -1>
"disabled": true,
</#if>
"emoteMarkdown": "⏭",
"metaConfig": {
"persistCallback": false
}
}
</#if>

View File

@@ -0,0 +1,3 @@
<#assign page=page>
<#assign pageCount=pageCount>
<#include "paginator_footer_text">

View File

@@ -0,0 +1,11 @@
{
<#assign exitOnly=innerModel.mutes?size lt 6/>
"embedConfigs": [
<#assign chunks=innerModel.mutes?chunk(5)>
<#-- we have to separate the chunk, so we can re-use it to disable the last buttons, and also we have to assign the for loop value, -->
<#-- so it available in sub templates, also the counter needs to be defined, else it doesnt the detect its a loop variable it seems -->
<#list chunks as row><#assign row=row><#include "mutes_response_entry"><#sep>,</#list>
],
"timeoutSeconds": 120,
"restrictUser": true
}

View File

@@ -0,0 +1,10 @@
<#include "format_instant">
<#assign muteId>${mute.mute.muteId.id}</#assign>
<#assign reason>${mute.mute.reason}</#assign>
<#assign mutedUserText><#if mute.mutedUser.member??>${mute.mutedUser.member.asMention}(${mute.mutedUser.member.user.id})<#else>${mute.mutedUser.userId?c}</#if></#assign>
<#assign mutingUserText><#if mute.mutingUser.member??>${mute.mutingUser.member.asMention}(${mute.mutingUser.member.user.id})<#else>${mute.mutingUser.userId?c}</#if></#assign>
<#assign muteDate><@format_instant_date_time instant=mute.mute.muteDate/></#assign>
<#assign muteEnded>${mute.mute.muteEnded?string('✅', '❌')}</#assign>
<#assign muteDuration>${fmtDuration(mute.muteDuration)}</#assign>
<#include "mutes_mute_entry_text">

View File

@@ -0,0 +1,4 @@
{
<#include "moderation_action_color">,
"description": "<@safe_include "mutes_no_mutes_found_text"/>"
}

View File

@@ -0,0 +1,6 @@
{
"description": "<#list row as mute><#assign mute=mute><@safe_include "mutes_mute_entry"/></#list>",
"buttons": [
<#include "paginator_buttons">
]
}

View File

@@ -0,0 +1,9 @@
{
<#assign exitOnly=innerModel.warnings?size lt 6/>
"embedConfigs": [
<#assign chunks=innerModel.warnings?chunk(5)>
<#list chunks as row><#assign counter=row?counter><#assign row=row><#include "warnings_response_entry"><#sep>,</#list>
],
"timeoutSeconds": 120,
"restrictUser": true
}

View File

@@ -0,0 +1,6 @@
{
"description": "<#list row as warning><#assign warning=warning><@safe_include "warnings_warn_entry"/></#list>",
"buttons": [
<#include "paginator_buttons">
]
}

View File

@@ -1,7 +0,0 @@
{
<#assign warnCount>${warnings?size}</#assign>
"headerText": "<@safe_include "warnings_header_text"/>",
"items": [
<#list warnings as warning><#assign warning=warning/>"<@safe_include "warnings_warn_entry"/>"<#sep>,</#list>
]
}

View File

@@ -0,0 +1 @@
Page ${page}/${pageCount}

View File

@@ -0,0 +1 @@
Shows all the warnings on the server

View File

@@ -0,0 +1,2 @@
Shows all the still existing mutes on the server in a paginated way.
Optionally you can provide a member to show the mutes for.

View File

@@ -0,0 +1 @@
The member to show the mutes for.

View File

@@ -0,0 +1 @@
Amount of mutes: ${muteCount}.

View File

@@ -0,0 +1,2 @@
Mute #${muteId} of user ${mutedUserText} by user ${mutingUserText} on ${muteDate} which lasted ${muteDuration} (Mute ended: ${muteEnded}).
Reason: `${reason}`