import { html } from "lit-html"; import { __ } from '@converse/headless/i18n'; import spinner from "./spinner.js"; import { modal_header_close_button } from "./buttons" const i18n_affiliation = __('Affiliation'); const i18n_change_affiliation = __('Change affiliation'); const i18n_change_role = __('Change role'); const i18n_moderator_tools = __('Moderator Tools'); const i18n_new_affiliation = __('New affiliation'); const i18n_new_role = __('New Role'); const i18n_no_users_with_aff = __('No users with that affiliation found.') const i18n_no_users_with_role = __('No users with that role found.'); const i18n_reason = __('Reason'); const i18n_filter = __('Type here to filter the search results'); const i18n_role = __('Role'); const i18n_show_users = __('Show users'); const i18n_helptext_role = __( "Roles are assigned to users to grant or deny them certain abilities in a multi-user chat. "+ "They're assigned either explicitly or implicitly as part of an affiliation. "+ "A role that's not due to an affiliation, is only valid for the duration of the user's session." ); const i18n_helptext_affiliation = __( "An affiliation is a long-lived entitlement which typically implies a certain role and which "+ "grants privileges and responsibilities. For example admins and owners automatically have the "+ "moderator role." ); function getRoleHelpText (role) { if (role === 'moderator') { return __("Moderators are privileged users who can change the roles of other users (except those with admin or owner affiliations."); } else if (role === 'participant') { return __("The default role, implies that you can read and write messages."); } else if (role == 'visitor') { return __("Visitors aren't allowed to write messages in a moderated multi-user chat."); } } function getAffiliationHelpText (aff) { if (aff === 'owner') { return __("Owner is the highest affiliation. Owners can modify roles and affiliations of all other users."); } else if (aff === 'admin') { return __("Admin is the 2nd highest affiliation. Admins can modify roles and affiliations of all other users except owners."); } else if (aff === 'outcast') { return __("To ban a user, you give them the affiliation of \"outcast\"."); } } const role_option = (o) => html` `; const affiliation_option = (o) => html` `; const tpl_set_role_form = (o) => html`
`; const role_list_item = (o) => html`