All files / app/mods modlist.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 0/0
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99117x         117x                                         117x                                   117x                                                   117x                                   117x                    
import { DateTime } from 'luxon';
import { Plugin } from '../model/plugin';
import { Mod } from '../model/tag';
import { Template } from '../model/template';
 
export const modlistConfig: Template = {
  tag: '_moderated',
  name: $localize`đŸ›Ąī¸ Modlist`,
  config: {
    mod: $localize`đŸ›Ąī¸ Mod Tools`,
    version: 1,
    type: 'config',
    generated: $localize`Generated by jasper-ui ${DateTime.now().toISO()}`,
    description: $localize`This tag marks posts as approved by a moderator. Adds a modlist tab to the inbox.`,
    icons: [
      { label: $localize`đŸ›Ąī¸`, title: $localize`Moderated`, order: -1 },
    ],
    actions: [
      { tag: '_moderated', labelOff: $localize`approve`, title: $localize`Mark this post as moderated.`, global: true, order: -1 },
    ],
    filters: [
      { query: '!_moderated', label: $localize`đŸ›Ąī¸ modlist`, title: $localize`New unmoderated posts`, group: $localize`Mod Tools đŸ›Ąī¸` },
    ],
  },
};
 
export const nsfwConfig: Template = {
  tag: 'nsfw',
  name: $localize`đŸ”žī¸ NSFW`,
  config: {
    mod: $localize`đŸ›Ąī¸ Mod Tools`,
    version: 1,
    type: 'config',
    generated: $localize`Generated by jasper-ui ${DateTime.now().toISO()}`,
    description: $localize`This tag marks posts as NSFW.`,
    advancedActions: [
      { tag: 'nsfw', labelOff: $localize`nsfw`, labelOn: $localize`sfw`, title: $localize`Mark posts as NSFW.`, global: true },
    ],
    filters: [
      { query: 'nsfw', label: $localize`đŸ”žī¸ nsfw`, title: $localize`Not safe for work`, group: $localize`Mod Tools đŸ›Ąī¸` },
    ],
  },
};
 
export const reportPlugin: Plugin = {
  tag: 'plugin/user/report',
  name: $localize`đŸ™…ī¸ Report`,
  config: {
    mod: $localize`đŸ›Ąī¸ Mod Tools`,
    version: 1,
    type: 'config',
    generated: $localize`Generated by jasper-ui ${DateTime.now().toISO()}`,
    description: $localize`This plugin reports Refs for moderation.`,
    icons: [
      { label: $localize`đŸ™…ī¸`, response: 'plugin/user/report', title: $localize`Reported`, global: true, order: -1 },
    ],
    actions: [
      { response: 'plugin/user/report', labelOn: $localize`unflag`, title: $localize`Discard report.`, global: true, order: -1 },
      { response: '+plugin/user/approve', labelOff: $localize`approve`, title: $localize`Silence report.`, global: true, order: -1 },
    ],
    advancedActions: [
      { response: 'plugin/user/report', labelOff: $localize`flag`, title: $localize`Report a problem with this post.`, confirm: $localize`Are you sure you want to report this post?`, global: true, order: 1 },
      { response: '+plugin/user/approve', labelOn: $localize`unapprove`, title: $localize`Unsilence report.`, global: true, order: -1 },
    ],
    filters: [
      { response: 'plugin/user/report', label: $localize`đŸ™…ī¸ reports`, title: $localize`Reported to Mods`, group: $localize`Mod Tools đŸ›Ąī¸` },
    ],
  },
};
 
export const approvePlugin: Plugin = {
  tag: '+plugin/user/approve',
  name: $localize`đŸ™†ī¸ Approve`,
  config: {
    mod: $localize`đŸ›Ąī¸ Mod Tools`,
    version: 1,
    type: 'config',
    generated: $localize`Generated by jasper-ui ${DateTime.now().toISO()}`,
    description: $localize`This plugin silences reports on a Ref.`,
    icons: [
      { label: $localize`đŸšŠī¸`, anyResponse: 'plugin/user/report', noResponse: '+plugin/user/approve', title: $localize`Flagged`, global: true, order: -1 },
    ],
    filters: [
      { response: '+plugin/user/approve', label: $localize`đŸ™†ī¸ approved`, title: $localize`Approved by Mod`, group: $localize`Mod Tools đŸ›Ąī¸` },
    ],
  },
};
 
export const modlistMod: Mod = {
  plugin: [
    reportPlugin,
    approvePlugin,
  ],
   template: [
    modlistConfig,
    nsfwConfig,
  ],
};