Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the /admin/email-domains page #2289

Merged
merged 6 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions js/10-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,21 @@ Liberapay.init = function() {
$(this).children('input[type="radio"]').prop('checked', true).trigger('change');
});

$('[data-toggle="enable"]').on('change', function() {
var $checkbox = $(this);
var $target = $($checkbox.data('target'));
$target.prop('disabled', !$checkbox.prop('checked'));
$('[data-toggle="enable"]').each(function() {
if (this.tagName == 'OPTION') {
var $option = $(this);
var $select = $option.parent();
$select.on('change', function() {
var $target = $($option.data('target'));
$target.prop('disabled', !$option.prop('selected'));
});
} else {
var $control = $(this);
$control.on('change', function() {
var $target = $($control.data('target'));
$target.prop('disabled', !$control.prop('checked'));
});
}
});

$('[data-email]').one('mouseover click', function () {
Expand Down
11 changes: 11 additions & 0 deletions liberapay/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ def check_bits(bits):

_ = lambda a: a

ACCOUNT_MARK_CLASSES = {
'trusted': 'success',
'okay': 'info',
'unsettling': 'info',
'controversial': 'warning',
'irrelevant': 'warning',
'misleading': 'warning',
'fraud': 'danger',
'spam': 'danger',
}

ASCII_ALLOWED_IN_USERNAME = set("0123456789"
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Expand Down
Loading