diff --git a/Targets/CreateStarterWebsite/CreateStarterWebsite-Custom.pm.new b/Targets/CreateStarterWebsite/CreateStarterWebsite-Custom.pm.new
index 303a329..b103766 100644
--- a/Targets/CreateStarterWebsite/CreateStarterWebsite-Custom.pm.new
+++ b/Targets/CreateStarterWebsite/CreateStarterWebsite-Custom.pm.new
@@ -1,5 +1,5 @@
#
-# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-18 11:44:06
+# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-18 15:44:18
#
#
# Routines to be edited by the developer to provide validation for parameters
diff --git a/Targets/CreateStarterWebsite/createstarterwebsite.css b/Targets/CreateStarterWebsite/createstarterwebsite.css
new file mode 100644
index 0000000..2beb7c9
--- /dev/null
+++ b/Targets/CreateStarterWebsite/createstarterwebsite.css
@@ -0,0 +1,3 @@
+/*
+ Generated by SM2Gen version: SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-18 15:44:18
+*/
diff --git a/Templates/layout.html.ep.tem b/Templates/layout.html.ep.tem
index 8ae894b..9873e4b 100644
--- a/Templates/layout.html.ep.tem
+++ b/Templates/layout.html.ep.tem
@@ -2,6 +2,8 @@
%# Generated by ${version}
%#
% layout 'default', title => "Sme server 2 - ${MenuDescription}", share_dir => './';
+% css specific to this panel:
+%= stylesheet '/css/{lcPackageName}.css'
% content_for 'module' => begin
diff --git a/copySM2.sh b/copySM2.sh
new file mode 100755
index 0000000..e0d949b
--- /dev/null
+++ b/copySM2.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+if [ $# -ne 3 ]; then
+ echo "Error: copySM2.sh requires two parameters."
+ echo "copySM2.sh
"
+ exit 1
+fi
+export REMOTE=/home/brianr/$1/usr/share/smanager
+cd ~/clients/SM2/SM2Gen/venv/Targets/$3
+echo `pwd`
+# controller file name is just capitalised
+cont_file=$(echo "$3" | awk '{
+ for(i=1; i<=NF; i++) {
+ $i = toupper(substr($i, 1, 1)) tolower(substr($i, 2))
+ }
+ print
+}' | tr ' ' '_')
+echo $cont_file
+#if [ ! -f "$cont_file.pm" ]; then
+# echo "no controller file $cont_file found in `pwd`"
+# exit 1
+#fi
+mkdir -p $REMOTE/lib/SrvMngr/Controller
+mkdir -p $REMOTE/themes/default/templates/partials/
+mkdir -p $REMOTE/lib/SrvMngr/I18N/Modules/Nfsshare
+mkdir -p $REMOTE/themes/default/templates/
+cp -fv *.pm $REMOTE/lib/SrvMngr/Controller
+cp -fv *.css $REMOTE/themes/default/public/css
+cp -fv _$2*.html.ep $REMOTE/themes/default/templates/partials/
+find . -maxdepth 1 -type f -name "[!_]*\.ep" | xargs -I% bash -c 'cp -fv % $REMOTE/themes/default/templates/'
+mkdir -p $REMOTE/lib/SrvMngr/I18N/Modules/$3
+cp -fv *.lex $REMOTE/lib/SrvMngr/I18N/Modules/$3
+rm -f $REMOTE/lib/SrvMngr/I18N/Modules/$3/*.pm
+ssh -p 1234 root@$1.thereadclan.me.uk 'signal-event smanager-refresh'
+exit 0
+
+
diff --git a/sm2gen.py b/sm2gen.py
index fbba736..6c051e6 100644
--- a/sm2gen.py
+++ b/sm2gen.py
@@ -469,7 +469,9 @@ if __name__ == "__main__":
routes = get_all_routes()
lc_routes = lc_get_all_routes()
+ #
# File names
+ #
# Define the path for the generated files
directory_path = Path("Targets/" + hl("PackageName"))
# Create the directory if it doesn't exist
@@ -478,8 +480,9 @@ if __name__ == "__main__":
controller_file = check_file_version(target_directory_path + hl("PackageName") + ".pm")
custom_controller_file = check_file_version(target_directory_path + hl("PackageName") + "-Custom.pm",3)
- print(custom_controller_file)
+ #print(custom_controller_file)
layout_file = check_file_version(target_directory_path + hl("PackageName").lower() + ".html.ep")
+ css_file = check_file_version(target_directory_path + hl("PackageName").lower() + ".css")
partial_files = list()
for panel in routes:
partial_files.append(check_file_version(
@@ -538,7 +541,8 @@ if __name__ == "__main__":
try:
try:
layout_mojo = layout_template.render(
- version=strVersion, **json5_dict, conditions=routes
+ version=strVersion, **json5_dict, conditions=routes,
+ lcPackageName=json5_dict["PackageName"].lower()
)
with open(layout_file, "w") as file:
file.write(layout_mojo)
@@ -547,7 +551,12 @@ if __name__ == "__main__":
print(f"A Chameleon render on layout file error occurred: {e}")
except Exception as e:
print(f"A Chameleon template layout file error occurred: {e}")
-
+
+ # Create the css file (empty for now, except the header)
+ # maybe it should have empty expamples of all the relevant classes?
+ with open(css_file, "w") as file:
+ file.write(f"/*\n Generated by SM2Gen version: {strVersion}\n*/\n")
+
# Generate a partial file for each of the entries in the html list
# Pull in the template code for each of the input types
# html_controls = json5_to_dict('Templates/html_controls.html.ep.tem')