Fix up action commands for Groups and Host panels
This commit is contained in:
parent
1b1b99955b
commit
55269fd685
@ -39,8 +39,25 @@
|
||||
%= t td => (class => 'sme-border') => $group->key
|
||||
%= t td => (class => 'sme-border') => $group->prop('Description')
|
||||
<td class='sme-border' style="min-width:15em">
|
||||
<a href='groups2?CsrfDef=TOKEN&trt=UPD&group=<%= $group->key%>'><button class='sme-modify-button' title=<%=l('MODIFY')%>><%=l('MODIFY') %></button></a>
|
||||
<a href='groups2?CsrfDef=TOKEN&trt=DEL&group=<%= $group->key%>'><button class='sme-remove-button' title=<%=l('REMOVE')%>><%=l('REMOVE') %></button></a>
|
||||
%my $modify_text = l('MODIFY'); # Localized text
|
||||
%my $csrf_token = "TOKEN"; # CSRF token for security
|
||||
%my $group_name = $group->key; # group name extracted from the data structure
|
||||
%my $actionModify = qq{
|
||||
% <button type='button' class='sme-modify-button' title='$modify_text'
|
||||
% onclick="window.location.href='groups2?CsrfDef=$csrf_token&trt=UPD&group=$group_name'">
|
||||
% $modify_text
|
||||
% </button>
|
||||
%};
|
||||
%my $remove_text = l('REMOVE'); # Localized text
|
||||
%my $csrf_token = "TOKEN"; # CSRF token for security
|
||||
%my $group_name = $group->key; # group name extracted from the data structure
|
||||
%my $actionRemove = qq{
|
||||
% <button type='button' class='sme-remove-button' title='$remove_text'
|
||||
% onclick="window.location.href='groups2?CsrfDef=$csrf_token&trt=DEL&group=$group_name'">
|
||||
% $remove_text
|
||||
% </button>
|
||||
%};
|
||||
<%= $c->render_to_string(inline => $actionModify) %> <%= $c->render_to_string(inline => $actionRemove) %>
|
||||
</td>
|
||||
</tr>
|
||||
% }
|
||||
|
@ -49,25 +49,34 @@
|
||||
%= t td => (class => 'sme-border') => $_->{'IP'};
|
||||
%= t td => (class => 'sme-border') => $_->{'MACAddress'};
|
||||
%= t td => (class => 'sme-border') => $_->{'Comment'};
|
||||
% my ($actionModify, $actionRemove) = ' ';
|
||||
% if ($_->{'static'} ne 'yes') {
|
||||
% $actionModify = "<a href='hostentriesd?CsrfDef=TOKEN&trt=UPD&Hostname=" . $_->{'HostName'} . "'>" . "<button class='sme-modify-button' title=".l('MODIFY').">".l('MODIFY')."</button>" . "</a>";
|
||||
% $actionRemove = "<a href='hostentriesd?CsrfDef=TOKEN&trt=DEL&Hostname=" . $_->{'HostName'} . "'>" . "<button class='sme-remove-button' title=".l('REMOVE').">".l('REMOVE')."</button>" . "</a>";
|
||||
% }
|
||||
<td class='sme-border' style="min-width:15em">
|
||||
<%= $c->render_to_string(inline => $actionModify) %>
|
||||
<%= $c->render_to_string(inline => $actionRemove) %>
|
||||
% my ($actionModify, $actionRemove) = ' ';
|
||||
%my $static = $_->{'static'} || "no";
|
||||
% if ($static ne 'yes') {
|
||||
%my $modify_text = l('MODIFY'); # Localized text
|
||||
%my $csrf_token = "TOKEN"; # CSRF token for security
|
||||
%my $hostentries_name = $_->{'HostName'}; # hostentries name extracted from the data structure
|
||||
%$actionModify = qq{
|
||||
% <button type='button' class='sme-modify-button' title='$modify_text'
|
||||
% onclick="window.location.href='hostentriesd?CsrfDef=$csrf_token&trt=UPD&Hostname=$hostentries_name'">
|
||||
% $modify_text
|
||||
% </button>
|
||||
%};
|
||||
%my $remove_text = l('REMOVE'); # Localized text
|
||||
%my $csrf_token = "TOKEN"; # CSRF token for security
|
||||
%#my $hostentries_name = $_->{'HostName'}; # hostentries name extracted from the data structure
|
||||
%$actionRemove = qq{
|
||||
% <button type='button' class='sme-remove-button' title='$remove_text'
|
||||
% onclick="window.location.href='hostentriesd?CsrfDef=$csrf_token&trt=DEL&Hostname=$hostentries_name'">
|
||||
% $remove_text
|
||||
% </button>
|
||||
%};
|
||||
% }
|
||||
<%= $c->render_to_string(inline => $actionModify) %> <%= $c->render_to_string(inline => $actionRemove) %>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
% }
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
% }
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
% }
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user