More group updates and quots done

This commit is contained in:
John Crisp 2025-05-16 11:57:27 +02:00
parent f90583b285
commit 613f17bb4f
8 changed files with 236 additions and 231 deletions

View File

@ -11,6 +11,8 @@
</div> </div>
% } % }
<!-- reetp error here -->
% if ( stash 'error' ) { % if ( stash 'error' ) {
<div class="text-danger"> <div class="text-danger">
<%= $c->render_to_string(inline => stash 'error') %> <%= $c->render_to_string(inline => stash 'error') %>

View File

@ -3,19 +3,13 @@
% my $btn = l('GROUP_ADD'); % my $btn = l('GROUP_ADD');
<form action="/smanager/groups2" method="POST"> <form action="/smanager/groups2" method="POST">
%#= form_for '/groups' => (method => 'POST') => begin <%= hidden_field 'trt' => 'ADD' %>
%= hidden_field 'trt' => 'ADD'
<br> <br>
<div> <div>
<button type="submit" class="btn btn-primary"><%= $btn %> </button> <button type="submit" class="btn btn-primary"><%= $btn %> </button>
</div> </div>
</form> </form>
%# end
<br> <br>
<h2><%=l 'grp_CURRENT_LIST' %></h2> <h2><%=l 'grp_CURRENT_LIST' %></h2>
<br><br> <br><br>

View File

@ -68,8 +68,8 @@
%= check_box 'groupMembers' => $key %= check_box 'groupMembers' => $key
&nbsp &nbsp
% } % }
%= $users->{$key} <%= $users->{$key} %>
%= " (" . $key . ")" <%= " (" . $key . ")" %>
<br> <br>
% } % }
@ -82,8 +82,8 @@
</div> </div>
%= hidden_field 'trt' => $grp_datas->{trt} <%= hidden_field 'trt' => $grp_datas->{trt} %>
%= hidden_field 'groupName' => $grp_datas->{group} <%= hidden_field 'groupName' => $grp_datas->{group} %>
</form> </form>

View File

@ -5,17 +5,11 @@
<form action="/smanager/pseudonyms2" method="POST"> <form action="/smanager/pseudonyms2" method="POST">
<h2><%= l 'pse_REMOVE_PSEUDONYM' %></h2> <h2><%= l 'pse_REMOVE_PSEUDONYM' %></h2>
<%#= $c->render_to_string(inline => l('pse_ABOUT_TO_REMOVE', $pse_datas->{pseudonym})); %> <!--This is the old test that needs fixing in the language files-->
Thisis the old test that needs fixing in the language files
<%= l('pse_ABOUT_TO_REMOVE') %>
<br> <br>
You are about to remove the pseudonym: <%= $pse_datas->{pseudonym} %> <%= $c->render_to_string(inline => l('pse_ABOUT_TO_REMOVE', $pse_datas->{pseudonym})); %>
<h6>Are you sure you wish to continue?</h6>
<br><br> <br><br>
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">

View File

@ -2,55 +2,70 @@
% my $btn = l('SAVE'); % my $btn = l('SAVE');
%= form_for '/pseudonyms2' => (method => 'POST') => begin <form action="/smanager/pseudonyms2" method="POST">
<p>
<h2> <h2><%=l 'pse_MODIFY_PSEUDONYM' %></h2>
%=l 'pse_MODIFY_PSEUDONYM'
</h2>
<br> <br>
%=l 'pse_DESC_PSEUDONYM_NAME'
</p>
<p> <div>
<span class=""> <%=l 'pse_DESC_PSEUDONYM_NAME' %>
%=l 'pse_PSEUDONYM_NAME', class => "" </div>
</span>
<span class="">
%= $pse_datas->{pseudonym}, class => ""
</span>
</p>
<p> <br>
<span class="">
%=l 'pse_SELECT_ACCOUNT', class => "" <div class="row g-3 align-items-center">
</span> <div class="col-md-2">
<span class=""> <%=l 'pse_PSEUDONYM_NAME' %>
</div>
<div class="col-auto">
<%= $pse_datas->{pseudonym} %>
</div>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<%=l 'pse_SELECT_ACCOUNT' %>
</div>
<div class="col-auto">
% param 'Account' => $pse_datas->{account} unless param 'Account'; % param 'Account' => $pse_datas->{account} unless param 'Account';
%= select_field 'Account' => $c->existing_accounts_list(), class => "" <%= select_field 'Account' => $c->existing_accounts_list(); %>
</span> </div>
</p>
</div>
% if ( $c->is_pseudonym_not_removable( $pse_datas->{pseudonym} ) ) { % if ( $c->is_pseudonym_not_removable( $pse_datas->{pseudonym} ) ) {
<p> <br>
<span class=""> <div class="row g-3 align-items-center">
%=l 'pse_SELECT_INTERNAL', class => "" <div class="col-md-2">
</span> <%= l 'pse_SELECT_INTERNAL' %>
<span class=""> </div>
<div class="col-auto">
% param 'Internal' => $pse_datas->{internal} unless param 'Internal'; % param 'Internal' => $pse_datas->{internal} unless param 'Internal';
%= select_field 'Internal' => [ [(l 'YES') => 'YES'], [(l 'NO') => 'NO'] ], class => "" <%= select_field 'Internal' => [ [(l 'YES') => 'YES'], [(l 'NO') => 'NO'] ] %>
</span> </div>
</p> </div>
% } % }
<p> <br><br>
%= submit_button "$btn", class => ""
</p> <div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
%= hidden_field 'trt' => $pse_datas->{trt} %= hidden_field 'trt' => $pse_datas->{trt}
%= hidden_field 'Pseudonym' => $pse_datas->{pseudonym} %= hidden_field 'Pseudonym' => $pse_datas->{pseudonym}
%end </form>
</div> </div>

View File

@ -1,17 +1,16 @@
<div> <div>
<p>
% my $modul = $c->render_to_string(inline => $c->l('quo_QUOTA_DESC')); % my $modul = $c->render_to_string(inline => $c->l('quo_QUOTA_DESC'));
%= $modul
<h3> <%= $modul %>
%=l 'quo_CURRENT_USAGE_AND_SETTINGS'
</h3> <h2><%= l 'quo_CURRENT_USAGE_AND_SETTINGS' %></h2>
<br> <br>
% my $numUsers = @$userAccounts; % my $numUsers = @$userAccounts;
% if ($numUsers == 0){ % if ($numUsers == 0){
%=l 'ACCOUNT_USER_NONE' <%= l 'ACCOUNT_USER_NONE' %>
% } else { % } else {
% my $limit = l('quo_LIMIT_WITH_GRACE_MB'); $limit =~ s#(graceX)#<br>$1#; % my $limit = l('quo_LIMIT_WITH_GRACE_MB'); $limit =~ s#(graceX)#<br>$1#;
@ -21,30 +20,18 @@
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th class=""> <th class="col-sm"><%= l 'ACCOUNT' %></th>
%=l 'ACCOUNT' <th class="col-sm"><%= l 'USER_NAME' %></th>
</th> <th class="col-sm"><%= $limit %></th>
<th class=""> <th class="col-sm"><%= $absolute %></th>
%=l 'USER_NAME' <th class="col-sm"><%= $current %></th>
</th> <th class="col-sm user-valign-center"><%= l 'ACTION' %></th>
<th class="">
%= $limit
</th>
<th class="">
%= $absolute
</th>
<th class="">
%= $current
</th>
<th class="">
%=l 'ACTION'
</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
% foreach my $user (@$userAccounts) % foreach my $user (@$userAccounts) {
% {
% my $uid = getpwnam($user->key); % my $uid = getpwnam($user->key);
% unless ($uid) { % unless ($uid) {
% warn($self->localise('COULD_NOT_GET_UID'),$user->key); % warn($self->localise('COULD_NOT_GET_UID'),$user->key);
@ -53,32 +40,33 @@
% my $name = $user->prop("FirstName")." ".$user->prop("LastName"); % my $name = $user->prop("FirstName")." ".$user->prop("LastName");
% my $dev = Quota::getqcarg('/home/e-smith/files'); % my $dev = Quota::getqcarg('/home/e-smith/files');
% my ($bc, $bs, $bh, $bt, $ic, $is, $ih, $it) = Quota::query($dev, $uid); % my ($bc, $bs, $bh, $bt, $ic, $is, $ih, $it) = Quota::query($dev, $uid);
<tr> <tr>
%= t td => (class => "") => $user->key <td><%= $user->key %></td>
%= t td => (class => "") => $name <td><%= $name %></td>
%= t td => (class => "") => sprintf("%.2f", $bs / 1024 ) <td><%= sprintf("%.2f", $bs / 1024 ) %></td>
%= t td => (class => "") => sprintf("%.2f", $bh / 1024 ) <td><%= sprintf("%.2f", $bh / 1024 ) %></td>
%= t td => (class => "") => sprintf("%.2f", $bc / 1024 ) <td><%= sprintf("%.2f", $bc / 1024 ) %></td>
<td class="">
% my $modify_text = l('MODIFY'); # Localized text % my $modify_text = l('MODIFY'); # Localized text
% my $csrf_token = "TOKEN"; # CSRF token for security % my $csrf_token = "TOKEN"; # CSRF token for security
% my $quota_user_name = $user->key; # quotas_entry name extracted from the data structure % my $quota_user_name = $user->key; # quotas_entry name extracted from the data structure
% my $actionModify = qq{ % my $actionModify = qq{
% <a href="quotad?CsrfDef=$csrf_token&trt=UPD&user=$quota_user_name"> % <a href="quotad?CsrfDef=$csrf_token&trt=UPD&user=$quota_user_name">
% <button type='button' class="" title='$modify_text' > % <button type='button' class="btn btn-primary" title='$modify_text' >
% $modify_text % $modify_text
% </button> % </button>
% </a> % </a>
%}; %};
<%= $c->render_to_string(inline => $actionModify) %>
</td> <td class="user-valign-center"><%= $c->render_to_string(inline => $actionModify) %></td>
</tr> </tr>
% } % }
</tbody> </tbody>
</table> </table>
<%} %>
</p>
%= hidden_field 'trt' => $quo_datas->{trt} % }
<%= hidden_field 'trt' => $quo_datas->{trt} %>
</div> </div>

View File

@ -2,12 +2,9 @@
% my $btn = l('SAVE'); % my $btn = l('SAVE');
%= form_for '/quota2' => (method => 'POST') => begin <form action="/smanager/quota2" method="POST">
<p>
<h2> <h2><%= l 'quo_MODIFY_USER_TITLE' %></h2>
%=l 'quo_MODIFY_USER_TITLE'
</h2>
</p>
% my $userid = $quo_datas->{user}; % my $userid = $quo_datas->{user};
% my $user = $quo_datas->{userRec}; % my $user = $quo_datas->{userRec};
@ -30,58 +27,71 @@
% my $dev = Quota::getqcarg('/home/e-smith/files'); % my $dev = Quota::getqcarg('/home/e-smith/files');
% my ($bc, $bs, $bh, $bt, $ic, $is, $ih, $it) = Quota::query($dev, $uid); % my ($bc, $bs, $bh, $bt, $ic, $is, $ih, $it) = Quota::query($dev, $uid);
<p> <div>
%=l 'quo_USER' <%= l 'quo_USER' %>&nbsp<%= "$name (\"$userid\")" %>
%= "$name (\"$userid\")" &nbsp
%=l 'quo_CURRENTLY_HAS' <%= l 'quo_CURRENTLY_HAS' %>&nbsp<%= $ic %>
%= $ic <%= l 'quo_FILES' %>
%=l 'quo_FILES' &nbsp
%=l 'quo_OCCUPYING' <%= l 'quo_OCCUPYING' %>&nbsp<%= $c->toMB($bc) %>&nbsp<%= l 'quo_MEGABYTES' %>
%= $c->toMB($bc) </div>
%=l 'quo_MEGABYTES' <br>
</p>
<p> <div>
%=l 'quo_INSTRUCTIONS' <%= l 'quo_INSTRUCTIONS' %>
</p> </div>
<br>
<p> <div class="row g-3 align-items-center">
<span class=""> <div class="col-md-2">
%=l 'quo_USER', class => "" <%= l 'quo_USER' %>
</span> </div>
<span class=""> <div class="col-auto">
%= $name, class => "" <%= $name %>
</span> </div>
</p> </div>
<br>
<p>
<span class="">
%=l 'quo_LIMIT_WITH_GRACE', class => ""
</span>
<span class="">
% param 'Soft' => $quo_datas->{softlim} unless param 'Soft'; % param 'Soft' => $quo_datas->{softlim} unless param 'Soft';
%= text_field 'Soft', class => ""
</span>
</p>
<p> <div class="row g-3 align-items-center">
<span class=""> <div class="col-md-2">
%=l 'quo_ABS_LIMIT', class => "" <label for="inputQuotaDesc" class="col-form-label"><%=l 'quo_LIMIT_WITH_GRACE' %></label>
</span> </div>
<span class=""> <div class="col-auto">
<!-- text_field 'Soft' -->
<input type="text" name="Soft" id="inputQuotaDesc" class="form-control" aria-describedby="QuotaDesc" value="<%= $quo_datas->{softlim} %>">
</div>
</div>
<br>
% param 'Hard' => $quo_datas->{hardlim} unless param 'Hard'; % param 'Hard' => $quo_datas->{hardlim} unless param 'Hard';
%= text_field 'Hard', class => ""
</span>
</p>
<p> <div class="row g-3 align-items-center">
<br><br> <div class="col-md-2">
%= submit_button "$btn", class => "" <label for="inputQuotaABS" class="col-form-label"><%= l 'quo_ABS_LIMIT' %></label>
</p> </div>
<div class="col-auto">
<!-- text_field 'Hard' -->
<input type="text" name="Hard" id="inputQuotaABS" class="form-control" aria-describedby="QuotaABS" value="<%= $quo_datas->{hardlim} %>">
%= hidden_field 'trt' => $quo_datas->{trt}
%= hidden_field 'user' => $quo_datas->{user} </div>
</div>
% end
<br><br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
<%= hidden_field 'trt' => $quo_datas->{trt} %>
<%= hidden_field 'user' => $quo_datas->{user} %>
</form>
</div> </div>

View File

@ -5,26 +5,28 @@
<div class="card-body"> <div class="card-body">
% if (config->{debug} == 1) { % if (config->{debug} == 1) {
<p> <div>
%= dumper $c->current_route %= dumper $c->current_route
%= dumper $quo_datas %= dumper $quo_datas
</p> </div>
% } % }
% if ( stash 'error' ) { % if ( stash 'error' ) {
<br><div class=""> <br>
%= $c->render_to_string(inline => stash 'error') <div class="text-danger">
<%= $c->render_to_string(inline => stash 'error') %>
</div> </div>
% } % }
<h1><%= $title%></h1> <h1><%= $title%></h1>
% if ($quo_datas->{trt} eq 'UPD') { % if ($quo_datas->{trt} eq 'UPD') {
%= include 'partials/_quo_upd' <%= include 'partials/_quo_upd' %>
% } else { % } else {
%= include 'partials/_quo_list' <%= include 'partials/_quo_list' %>
% } % }
</div> </div>
%end %end