Commit 5e2966f7 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add a modal to warn they user they have created too many experiments

as a guest and that they have to apply for a real account.
parent c3f52c91
......@@ -5,11 +5,12 @@ require(window.APT_OPTIONS.configObject,
// jQuery modules
function (_, sup,
aboutString, verifyString, personalString,
projectString, signupString)
projectString, signupString, toomanyString)
'use strict';
......@@ -24,6 +25,7 @@ function (_, sup,
var fields = JSON.parse(_.unescape($('#form-json')[0].textContent));
var errors = JSON.parse(_.unescape($('#error-json')[0].textContent));
......@@ -48,6 +50,9 @@ function (_, sup,
$('#signup_panel_title').text("Start Project");
if (window.APT_OPTIONS.toomany) {
function renderForm(formfields, errors, joinproject, showVerify, thisUser)
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
......@@ -47,6 +47,7 @@ $optargs = OptionalPageArguments("create", PAGEARG_STRING,
"finished", PAGEARG_BOOLEAN,
"joinproject", PAGEARG_BOOLEAN,
"formfields", PAGEARG_ARRAY);
......@@ -55,7 +56,7 @@ $optargs = OptionalPageArguments("create", PAGEARG_STRING,
function SPITFORM($formfields, $showverify, $errors)
global $ACCOUNTWARNING, $EMAILWARNING, $this_user, $joinproject;
global $ACCOUNTWARNING, $EMAILWARNING, $this_user, $joinproject, $toomany;
$button_label = "Create Account";
echo "<link rel='stylesheet'
......@@ -64,6 +65,7 @@ function SPITFORM($formfields, $showverify, $errors)
echo "<div id='signup-body'></div>\n";
echo "<div id='toomany_div'></div>\n";
echo "<script type='text/plain' id='form-json'>\n";
echo htmlentities(json_encode($formfields)) . "\n";
echo "</script>\n";
......@@ -87,6 +89,12 @@ function SPITFORM($formfields, $showverify, $errors)
else {
echo "window.APT_OPTIONS.this_user = false;\n";
if ($toomany) {
echo "window.APT_OPTIONS.toomany = true;\n";
else {
echo "window.APT_OPTIONS.toomany = false;\n";
echo "</script>\n";
<div id='toomany_modal' class='modal fade'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
You have exceeded the number of experiments you can create as a
guest user!
<div class='modal-body'>
<p>Benefits of registering for an account include being able
to design your own experiments, have more then one active
experiment at a time, or extend the life of an experiment longer.
<button class='btn btn-primary align-center'
type='button name='register'>Close</button>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment