Skip to content

Commit

Permalink
Merge pull request #2289 from liberapay/admin-email-domains++
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco authored Oct 29, 2023
2 parents f312a4c + 4507ecb commit 75b1486
Show file tree
Hide file tree
Showing 4 changed files with 286 additions and 82 deletions.
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

0 comments on commit 75b1486

Please sign in to comment.