Fix up action commands for pseudonyms and quota

This commit is contained in:
Brian Read 2024-12-16 16:15:03 +00:00
parent 34e7331845
commit ff9a84dd29
3 changed files with 43 additions and 17 deletions

View File

@ -54,19 +54,35 @@
%= t td => (class => 'sme-border') => $pseudonym->key
%= t td => (class => 'sme-border') => $account
% my ($actionModify, $actionRemove) = ' ';
% if ($modifiable eq 'yes') {
% $actionModify = "<a href='pseudonyms2?CsrfDef=TOKEN&trt=UPD&pseudonym=" . $pseudonym->key . "'>" . "<button class='sme-modify-button' title=".l('MODIFY').">".l('MODIFY')."</button>" . "</a>";
% }
% if ($removable eq 'yes') {
% $actionRemove = "<a href='pseudonyms2?CsrfDef=TOKEN&trt=DEL&pseudonym=" . $pseudonym->key . "'>" . "<button class='sme-remove-button' title=".l('REMOVE').">".l('REMOVE')."</button>" . "</a>";
% }
<td class='sme-border'>
%my ($actionModify, $actionRemove) = '&nbsp;';
%if ($modifiable eq 'yes') {
%my $modify_text = l('MODIFY'); # Localized text
%my $csrf_token = "TOKEN"; # CSRF token for security
%my $pseudonyms_entry_name = $pseudonym->key; # pseudonyms_entry name extracted from the data structure
%$actionModify = qq{
% <button type='button' class='sme-modify-button' title='$modify_text'
% onclick="window.location.href='pseudonyms2?CsrfDef=$csrf_token&trt=UPD&pseudonym=$pseudonyms_entry_name'">
% $modify_text
% </button>
%};
%}
%if ($removable eq 'yes') {
%my $remove_text = l('REMOVE'); # Localized text
%my $csrf_token = "TOKEN"; # CSRF token for security
%my $pseudonyms_entry_name = $pseudonym->key; # pseudonyms_entry name extracted from the data structure
%$actionRemove = qq{
% <button type='button' class='sme-remove-button' title='$remove_text'
% onclick="window.location.href='pseudonyms2?CsrfDef=$csrf_token&trt=DEL&pseudonym=$pseudonyms_entry_name'">
% $remove_text
% </button>
%};
%}
<%= $c->render_to_string(inline => $actionModify) %> <%= $c->render_to_string(inline => $actionRemove) %>
<td class='sme-border' style="min-width:15em">
<%= $c->render_to_string(inline => $actionModify) %>&nbsp;<%= $c->render_to_string(inline => $actionRemove) %>
</td>
</tr>
% }
</tbody>
</table>
@ -76,4 +92,3 @@
</div>

View File

@ -57,7 +57,18 @@
%= t td => (class => 'sme-border') => sprintf("%.2f", $bs / 1024 )
%= t td => (class => 'sme-border') => sprintf("%.2f", $bh / 1024 )
%= t td => (class => 'sme-border') => sprintf("%.2f", $bc / 1024 )
<td class='sme-border'><a href="quotad?CsrfDef=TOKEN&trt=UPD&user=<%= $user->key%>"><button class='sme-modify-button' title="<%=l('MODIFY')%>"><%=l('MODIFY') %></button></a></td>
<td class='sme-border'>
%my $modify_text = l('MODIFY'); # Localized text
%my $csrf_token = "TOKEN"; # CSRF token for security
%my $quota_user_name = $user->key; # quotas_entry name extracted from the data structure
%my $actionModify = qq{
% <button type='button' class='sme-modify-button' title='$modify_text'
% onclick="window.location.href='quotad?CsrfDef=$csrf_token&trt=UPD&user=$quota_user_name'">
% $modify_text
% </button>
%};
<%= $c->render_to_string(inline => $actionModify) %>
</td>
</tr>
% }
</tbody>

View File

@ -37,7 +37,7 @@
%= $ic
%=l 'quo_FILES'
%=l 'quo_OCCUPYING'
%= $bc
%= $c->toMB($bc)
%=l 'quo_MEGABYTES'
</p>