* Wed Apr 23 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme

- Add SM2 panel
This commit is contained in:
2025-04-26 06:29:05 +01:00
parent 3e47a72496
commit 99f466f10b
10 changed files with 845 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
/*
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-23 10:04:56
*/
.Userpanels-panel {}
.name {}
.rout {}
.head {}
.subh {}
.para1 {}
.tabl1 {}
thead .tabl1 {}
tbody .tabl1 {}
.name {}
.rout {}
.head {}
.subh {}
.tabl2 {}
thead .tabl2 {}
tbody .tabl2 {}
.subm {}

View File

@@ -0,0 +1,5 @@
//
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-23 10:04:56
//
$(document).ready(function() {
});

View File

@@ -0,0 +1,53 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-23 10:18:18
%#
<div id="Userpanels-PANELTABLE" class="partial Userpanels-PANELTABLE">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if (config->{debug} == 1) {
<pre>
%= dumper $usp_data
</pre>
% }
% my $btn = l('usp_APPLY');
%= form_for "userpanelsu" => (method => 'POST') => begin
%# param 'trt' => $usp_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $usp_data->{trt}
%= hidden_field 'accounts_key' => $c->stash('accounts_key');
%# Inputs etc in here.
<h1 class='head'><%=l('usp_Allocate_panels_to_a_user')%></h1>
<h2 class='subh'><%=l('usp_Select_panels_for_user')%></h2>
<br /><table class="sme-border TableSort sme-table tabl2 ">
<thead class='tabl2'>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Panel '><%=l('Panel')%></th>
<th class='sme-border table-head-col table-head-col-Description '><%=l('usp_Description')%></th>
<th class='sme-border table-head-col table-head-col-Select '><%=l('usp_Select')%></th>
</tr>
</thead>
<tbody class='tabl2'>
% my $control_data = $c->stash('panels');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Panel'><%=$c->render_to_string(inline=>$row->{'Panel'})%></td>
<td class='sme-border table-col table-col-Description'><%=$c->render_to_string(inline=>$row->{'Description'})%></td>
<td class='sme-border table-col table-col-Select'><%=$c->render_to_string(inline=>$row->{'Select'})%></td>
</tr>
%}
</tbody>
</table>
<span class='data'>
%= submit_button l('usp_Save'), class => 'action subm'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,52 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-23 10:04:56
%#
<div id="Userpanels-USERTABLE" class="partial Userpanels-USERTABLE">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if (config->{debug} == 1) {
<pre>
%= dumper $usp_data
</pre>
% }
% my $btn = l('usp_APPLY');
%= form_for "userpanelsu" => (method => 'POST') => begin
% param 'trt' => $usp_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $usp_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('usp_Allocate_panels_to_a_user')%></h1>
<h2 class='subh'><%=l('usp_Choose_a_user')%></h2>
<p class='paragraph para1'>
%=l('usp_You_can_modify_individual_users')
</p>
<br /><table class="sme-border TableSort sme-table tabl1 ">
<thead class='tabl1'>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Account '><%=l('usp_Account')%></th>
<th class='sme-border table-head-col table-head-col-Name/Description '><%=l('usp_Name/Description')%></th>
<th class='sme-border table-head-col table-head-col-Modify '><%=l('usp_Modify')%></th>
</tr>
</thead>
<tbody class='tabl1'>
% my $control_data = $c->stash('users');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Account'><%=$c->render_to_string(inline=>$row->{'Account'})%></td>
<td class='sme-border table-col table-col-Description'><%=$c->render_to_string(inline=>$row->{'Description'})%></td>
<td class='sme-border table-col table-col-Modify'><%=$c->render_to_string(inline=>$row->{'Modify'})%></td>
</tr>
%}
</tbody>
</table>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,62 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-23 10:18:18
%#
% layout 'default', title => "Sme server 2 - User panel access ", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/userpanels.css'
%= javascript '/js/userpanels.js'
<div id="module" class="module Userpanels-panel">
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $usp_data->{trt}
%= dumper stash('users')
%= dumper stash 'panels'
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><p>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</p>
%} elsif ($c->stash('success')) {
<div class='success '>
<p>
%= $c->l($c->stash('success'));
</p>
</div>
<br />
%} elsif ($c->stash('error')) {
<div class='sme-error'>
<p>
%= $c->l($c->stash('error'));
</p>
</div>
<br />
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($usp_data->{trt} eq "USERTABLE") {
%= include 'partials/_usp_USERTABLE'
%}
% if ($usp_data->{trt} eq "PANELTABLE") {
%= include 'partials/_usp_PANELTABLE'
%}
</div>
%end