### The ban log as the owner and moderators read it (R11 I11, I15; beta decision D2.5; RQ-021 A; ### RQ-030 B): /log, /history and /bans in the group or in private, one message per command with ### the newest ten entries (src/bot/README.md section 5; card 0085 built the joined view that ### card 0084 left open as OQ-B1). The keys are named in src/bot/messages.ts. Nothing here ### repeats a banned message or a written reason to the group (D2.4; Q4.1). ### Conventions: locales/en/common.ftl. An optional value ($reason, $until, $group, $user) is ### passed only when present and is referenced only in the variant its flag selects, because ### DATETIME refuses an empty string and a select cannot tell an empty string from a label ### (card 0084's finding). A flag is yes or no. ## The view (D2.5; RQ-021 A; card 0085) # The whole answer: the heading, then the entries, one per line, newest first, and history-more # as the last line when older entries exist. The bot renders each entry with history-entry, # joins the lines through history-lines and passes the result as $entries. history-view = { history-heading } { $entries } # $command is log, history or bans. $named is yes when the command names one person, and then # $user is a mention. $scope is customer for "all", every group of the customer (OQ-1 A), else # group. history-heading = { $command -> [bans] Current bans [history] Entries *[log] The newest entries }{ $named -> [yes] { " " }for { $user } *[no] { "" } }{ $scope -> [customer] { " " }in all your groups *[group] { "" } }: # Two rendered pieces on consecutive lines. The bot joins the entries through this message, two # at a time, so that the joined text still comes from the catalog and never from a literal # (test plan I18N-06). history-lines = { $first } { $rest } # The last line when the page is full and older entries exist. $count is the page size. history-more = Only the newest { $count } entries are shown. # $command as in history-heading. history-empty = { $command -> [bans] No current bans. *[other] No entries. } # One entry. $action is the stored event type of src/records/reasons.ts (ban, mute, # restriction, unban, unmute, unrestrict); $user is a mention. $has-reason is yes when $reason, # a rendered reason-label, is passed; $has-end is yes when $until, the sanction's end, is # passed; $has-group is yes when $group, the chat identifier of the entry's group, is passed # (only in the view over all groups, for an entry from another group than the command's, and # only to someone who may read that group: OQ-7); $elsewhere is yes when the ban came from # another group of the customer (OQ-7: a mark, never which group). The layout is assumed. history-entry = { DATETIME($time, dateStyle: "medium", timeStyle: "short") }: { $action -> [ban] ban [mute] mute [restriction] restriction [unban] unban [unmute] mute lifted [unrestrict] restriction lifted *[other] { $action } }, { $user }{ $has-reason -> [yes] , { $reason } *[no] { "" } }{ $has-end -> [yes] , until { DATETIME($until, dateStyle: "medium", timeStyle: "short") } *[no] { "" } }{ $has-group -> [yes] { " " }(in group { $group }) *[no] { "" } }{ $elsewhere -> [yes] { " " }(from another group) *[no] { "" } } ## The affected person's own message (beta decision Q10; src/bot/README.md OQ-B5) # Shown only to the person a mute or restriction was applied to, in private. The view is not # built yet; the text waits for it. The group is not named: open (OQ-B5). history-own-message = On { DATETIME($time, dateStyle: "medium", timeStyle: "short") } you wrote: { $text }