Skip to content

Commit

Permalink
Tweak account moderation controls
Browse files Browse the repository at this point in the history
Move the popover with the request reason for a user in front of everything
else, and aside so that it doesn't overlap the side nav. Also add titles for
mouseover hints for the approve and reject buttons.
  • Loading branch information
theory committed May 18, 2021
1 parent f917376 commit f25973b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
16 changes: 11 additions & 5 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
Revision history for Perl extension PGXN::Manager

0.20.1
- Removed the `Capfile` and `eg` directory from the source (and distribution).
Examples for managing PGXN can now be found in the pgxn/pgxn-ops
repository on GitHub.
- Replaced all icons with SVG icons from the icons8/flat-color-icons project.
- Removed the `Capfile` and `eg` directory from the source (and
distribution). Examples for managing PGXN can now be found in the
pgxn/pgxn-ops repository on GitHub.
- Replaced all icons with SVG icons from the icons8/flat-color-icons
project.
- Updated the favicons for best support on modern browsers, including
SVG and ICO variants, as well as special cases for iOS and Android devices.
SVG and ICO variants, as well as special cases for iOS and Android
devices.
- Added titles to new account moderation buttons.
- Improved the layout of the new account request userinfo popover so
that it is in front of everything else and does not overlap with the
side nav.

0.20.0 2021-05-12T02:15:41Z
- Explicitly loading Email::Address in PGXN::Manager::Controller
Expand Down
2 changes: 2 additions & 0 deletions lib/PGXN/Manager/Locale.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ our %Lexicon = (
'"[_1]" is missing the required [numerate,_2,key] [qlist,_3] under [_4]' => '“[_1]” is missing the required [numerate,_2,key] [qlist,_3] under [_4]',
'"[_1]" is an invalid distribution name' => '“[_1]” is not a valid distribution name. Distribution names must be at least two characters and may not contain unprintable or whitespace characters or /, \\, or :.',
howto_page_title => 'How to create PostgreSQL extensions and distribute them on PGXN',
'Approve account for "[_1]"' => 'Approve account for “[_1]“',
'Reject account for "[_1]"' => 'Approve account for “[_1]“',
# multimarkdown doc/howto.md | perl -pe 's/([\[\]])/~$1/g'
howto_body => q`<p>PGXN is the PostgreSQL Extension Network. If you&#8217;re a PostgreSQL developer,
you&#8217;ve no doubt created customizations to make your life simpler. This is
Expand Down
5 changes: 3 additions & 2 deletions lib/PGXN/Manager/Templates.pm
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,8 @@ template moderate => sub {
cell {
class is 'actions';
for my $spec (
[accept => 'active' ],
[remove => 'deleted' ],
[accept => 'active', T 'Approve account for "[_1]"', $user->{nickname} ],
[remove => 'deleted', T 'Reject account for "[_1]"', $user->{nickname} ],
) {
form {
class is $spec->[0];
Expand All @@ -654,6 +654,7 @@ template moderate => sub {
class is 'button';
type is 'image';
name is 'submit';
title is $spec->[2];
src is $req->uri_for("/ui/img/$spec->[0].svg")
};
};
Expand Down
12 changes: 11 additions & 1 deletion t/moderate.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use 5.10.0;
use utf8;
BEGIN { $ENV{EMAIL_SENDER_TRANSPORT} = 'Test' }

use Test::More tests => 289;
use Test::More tests => 291;
#use Test::More 'no_plan';
use Plack::Test;
use HTTP::Request::Common;
Expand Down Expand Up @@ -269,6 +269,11 @@ test_psgi +PGXN::Manager::Router->app => sub {
$req->uri_for('/ui/img/accept.svg'),
'..................... Source should be accept.svg'
);
$tx->is(
'./@title',
$mt->maketext('Approve account for "[_1]"', 'bob'),
'..................... Title should be be to approve user',
);
}
);
});
Expand Down Expand Up @@ -330,6 +335,11 @@ test_psgi +PGXN::Manager::Router->app => sub {
$req->uri_for('/ui/img/remove.svg'),
'..................... Source should be remove.svg'
);
$tx->is(
'./@title',
$mt->maketext('Reject account for "[_1]"', 'bob'),
'..................... Title should be be to reject user',
);
}
);
});
Expand Down
6 changes: 1 addition & 5 deletions www/ui/js/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PGXN.init_moderate = function () {
var bub = $(this).next();
bub.css({
position:'absolute',
left:$(this).offset().left - 64,
// left:$(this).offset().left - 64,
top:$(this).offset().top + 21
}).toggle();
bub.click(function () { $(this).hide() });
Expand Down Expand Up @@ -79,7 +79,3 @@ PGXN.init_mirrors = function () {
$('.actions .button').click(function (e) { PGXN.ajax_click(e, this, '#mirrorlist') });
});
};




0 comments on commit f25973b

Please sign in to comment.