diff --git a/default.nix b/default.nix index b68f410..8821972 100644 --- a/default.nix +++ b/default.nix @@ -1,37 +1,42 @@ { stdenv, lib, - hugo, - go, - cargo, - rustc, - clippy, - rust-analyzer, - rustfmt, + # hugo, + # go, + # cargo, + # rustc, + # clippy, + # rust-analyzer, + # rustfmt, pkg-config, - # sbcl, - # sbclPackages, + gcc, + gnumake, + sbcl, + sbclPackages, makeWrapper, openssl, - rustPlatform + build-asdf-system, + pkgs, + ... }: -# let -# sbcl' = sbcl.withPackages (ps: with ps; [ -# hunchentoot -# dexador -# jzon -# serapeum -# deploy -# spinneret -# lass -# cl-smtp -# # pkgs.openssl -# # pkgs.openssl.out -# # pkgs.openssl.dev -# ]); -# in -rustPlatform.buildRustPackage rec { +let + sbcl' = sbcl.withPackages (ps: with ps; [ + hunchentoot + dexador + jzon + serapeum + deploy + spinneret + lass + cl-smtp + log4cl + pkgs.openssl + pkgs.openssl.out + pkgs.openssl.dev + ]); +in +build-asdf-system { name = "tfcconnection"; pname = "tfcconnection"; version = "0.0.1"; @@ -39,52 +44,67 @@ rustPlatform.buildRustPackage rec { src = ./.; # cargoHash = "sha256-jtBw4ahSl88L0iuCXxQgZVm1EcboWRJMNtjxLVTtzts="; - cargoLock = { - lockFile = ./Cargo.lock; - }; + # cargoLock = { + # lockFile = ./Cargo.lock; + # }; nativeBuildInputs = [ - makeWrapper + gcc + stdenv + gnumake pkg-config - rustc - cargo - ]; - - buildInputs = [ - # rustPlatform - # clippy - # rustfmt - openssl + makeWrapper + # openssl # openssl.out # openssl.dev ]; - # nativeLibs = [ - # openssl - # openssl.out - # openssl.dev + # buildInputs = [ + # # rustPlatform + # # clippy + # # rustfmt + # # openssl + # # openssl.out + # # openssl.dev + # sbcl' # ]; - # lispLibs = with sbclPackages; [ - # hunchentoot - # dexador - # jzon - # serapeum - # deploy - # spinneret - # lass - # cl-smtp - # ]; + nativeLibs = [ + openssl + openssl.out + openssl.dev + ]; - buildPhase = '' - export HOME=$(pwd) - ${cargo}/bin/cargo build - ''; + lispLibs = with sbclPackages; [ + hunchentoot + dexador + jzon + serapeum + deploy + spinneret + lass + cl-smtp + log4cl + ]; + # ${cargo}/bin/cargo build + # buildPhase = '' + # export HOME=$(pwd) + # ${sbcl'}/bin/sbcl --load build.lisp + # ''; + + systems = "tfcserver"; + + buildScript = ./build.lisp; + + # cp target/debug/tfcapi $out/bin installPhase = '' + mkdir -pv $out + cp -r * $out + rm -fv $out/tfcserver mkdir -p $out/bin - cp target/debug/tfcapi $out/bin - wrapProgram $out/bin/tfcapi \ + cp -v tfcserver $out/bin + wrapProgram $out/bin/tfcserver \ --prefix LD_LIBRARY_PATH : $LD_LIBRARY_PATH \ ''; diff --git a/flake.nix b/flake.nix index 7888105..ae133d9 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ in { devShell = import ./shell.nix { inherit pkgs; }; - defaultPackage = pkgs.callPackage ./default.nix { }; + defaultPackage = import ./default.nix { }; } ); } diff --git a/layouts/shortcodes/camp-form.html b/layouts/shortcodes/camp-form.html index 93ad9ff..bb9ba1a 100644 --- a/layouts/shortcodes/camp-form.html +++ b/layouts/shortcodes/camp-form.html @@ -22,9 +22,59 @@ document.getElementById('warning-email').style.height = '0'; document.getElementById('warning-email').style.margin = '0'; } + if (data.get("firstname") == "") { + document.getElementById('warning-name').style.visibility = 'visible'; + document.getElementById('warning-name').style.height = ''; + document.getElementById('warning-name').style.margin = ''; + return false; + } else { + document.getElementById('warning-name').style.visibility = 'hidden'; + document.getElementById('warning-name').style.height = '0'; + document.getElementById('warning-name').style.margin = '0'; + } + if (data.get("lastname") == "") { + document.getElementById('warning-name').style.visibility = 'visible'; + document.getElementById('warning-name').style.height = ''; + document.getElementById('warning-name').style.margin = ''; + return false; + } else { + document.getElementById('warning-name').style.visibility = 'hidden'; + document.getElementById('warning-name').style.height = '0'; + document.getElementById('warning-name').style.margin = '0'; + } + if (data.get("parentfirstname") == "") { + document.getElementById('warning-name').style.visibility = 'visible'; + document.getElementById('warning-name').style.height = ''; + document.getElementById('warning-name').style.margin = ''; + return false; + } else { + document.getElementById('warning-name').style.visibility = 'hidden'; + document.getElementById('warning-name').style.height = '0'; + document.getElementById('warning-name').style.margin = '0'; + } + if (data.get("parentlastname") == "") { + document.getElementById('warning-name').style.visibility = 'visible'; + document.getElementById('warning-name').style.height = ''; + document.getElementById('warning-name').style.margin = ''; + return false; + } else { + document.getElementById('warning-name').style.visibility = 'hidden'; + document.getElementById('warning-name').style.height = '0'; + document.getElementById('warning-name').style.margin = '0'; + } + if (data.get("final-agreement") == "") { + document.getElementById('warning-agreement').style.visibility = 'visible'; + document.getElementById('warning-agreement').style.height = ''; + document.getElementById('warning-agreement').style.margin = ''; + return false; + } else { + document.getElementById('warning-agreement').style.visibility = 'hidden'; + document.getElementById('warning-agreement').style.height = '0'; + document.getElementById('warning-agreement').style.margin = '0'; + } - /* let base = "http://localhost:4242/camp-form"; */ - let base = "https://api.tfcconnection.org/camp-form"; + let base = "http://localhost:4242/camp-form"; + /* let base = "https://api.tfcconnection.org/camp-form"; */ fetch(base, { method: "POST", @@ -61,6 +111,15 @@ document.getElementById('warning-email').style.visibility = 'hidden'; document.getElementById('warning-email').style.height = '0'; document.getElementById('warning-email').style.margin = '0'; + document.getElementById('warning-name').style.visibility = 'hidden'; + document.getElementById('warning-name').style.height = '0'; + document.getElementById('warning-name').style.margin = '0'; + document.getElementById('warning-agreement').style.visibility = 'hidden'; + document.getElementById('warning-agreement').style.height = '0'; + document.getElementById('warning-agreement').style.margin = '0'; + document.getElementById('warning-other').style.visibility = 'hidden'; + document.getElementById('warning-other').style.height = '0'; + document.getElementById('warning-other').style.margin = '0'; } document.addEventListener('DOMContentLoaded', process); @@ -243,5 +302,26 @@ +