Clarifying comment.

pull/7/head
Ferry Boender 10 years ago
parent 6214b2681e
commit a4f8e05832
  1. 16
      examples/megacorp_acc/job_signup_step1.sh
  2. 8
      examples/megacorp_acc/job_signup_step2.sh
  3. 61
      examples/megacorp_acc/megacorp_acc.json
  4. 2
      src/scriptform.py

@ -0,0 +1,16 @@
#!/bin/sh
cat << EOF
HTTP/1.1 301 Moved Permanently
Location: form?form_name=signup_step_2&first_name=$first_name&last_name=$last_name&email_address=$email_address
Content-Type: text/html
Content-Length: 174
<html>
<head>
<title>Redir</title>
</head>
<body>
</body>
</html>
EOF

@ -0,0 +1,8 @@
#!/bin/sh
echo "Signed up '$first_name $last_name <$email_address>' for the newsletter.\n"
echo "The following topics have been set:\n"
echo " - Company news: $check_company"
echo " - Products: $check_products"

@ -5,6 +5,67 @@
"admin": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"
},
"forms": [
{
"name": "signup_step_1",
"title": "Newsletter Sign up",
"description": "Test sign up for the newsletter",
"script": "job_signup_step1.sh",
"output": "raw",
"fields": [
{
"name": "first_name",
"title": "First name",
"type": "string"
},
{
"name": "last_name",
"title": "Last name",
"type": "string"
},
{
"name": "email_address",
"title": "What's your email address?",
"type": "string"
}
]
},
{
"name": "signup_step_2",
"hide": true,
"title": "Sign up: Your subscriptions",
"description": "Please check which topics you are interested in",
"script": "job_signup_step2.sh",
"fields": [
{
"name": "first_name",
"title": "First name",
"type": "string",
"hidden": true
},
{
"name": "last_name",
"title": "Last name",
"type": "string",
"hidden": true
},
{
"name": "email_address",
"title": "What's your email address?",
"type": "string",
"hidden": true
},
{
"name": "check_company",
"title": "Negacorp Company news",
"type": "checkbox"
},
{
"name": "check_products",
"title": "Product news",
"type": "checkbox"
}
]
},
{
"name": "clean_database",
"title": "Load clean database",

@ -304,6 +304,8 @@ class FormConfig:
for k, v in form_values.items():
env[k] = str(v)
# If the form output type is 'raw', we directly stream the output to
# the browser. Otherwise we store it for later displaying.
if form.output == 'raw':
p = subprocess.Popen(form.script, shell=True,
stdout=request.wfile,

Loading…
Cancel
Save