Skip to content

Commit

Permalink
refactor: fixed JS warning
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejol committed May 18, 2023
1 parent b50777f commit 3b54905
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions script/rvd_front
Original file line number Diff line number Diff line change
Expand Up @@ -1448,12 +1448,14 @@ get '/user/grant/(:id_user)/(:grant)/(:value)' => sub($c) {
$USER->send_message($error);
} else {
my $grant = $c->stash('grant');
my $grant_type = $USER->grant_type($grant);
$grant =~ s/_/ /g;
if ( $value ) {
$info = "Permission granted to user"
} else {
$info = "Permission revoked from user";
}
$grant .= " $value" if $grant_type eq 'int';
$info = $c->stash->{i18n}->localize($info);

$USER->send_message($info." ".Encode::decode_utf8($user->name)
Expand Down
6 changes: 3 additions & 3 deletions templates/main/manage_user_grants.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
ng-click="toggle_grant('<%= $perm->{name} %>')"
>
% }
% my $hide = $perm->{name} eq 'start_limit';
% $hide = 0 if !$hide;
% if ($perm->{is_int}) {
<input type="number" name="perm_<%= $perm->{name} %>" min="0" ng-model="perm['<%= $perm->{name} %>']" max="999" style="margin-left: 15px; margin-bottom: 10px"
size="4"
ng-hide="<%= $perm->{name} eq 'start_limit' %> && perm['start_many']"
ng-hide="<%= $hide %> && perm['start_many']"
ng-change="update_grant('<%= $perm->{name} %>')"
>

% }
% my $hide = $perm->{name} eq 'start_limit';
% $hide = 0 if !$hide;
<label for="perm_<%= $perm->{name} %>"
ng-hide="<%= $hide %> && perm['start_many']"
>
Expand Down

0 comments on commit 3b54905

Please sign in to comment.