From 4938deb4ec97691d8a8fb92df70dde8f5515c2bb Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 13 Oct 2017 17:10:06 -0400 Subject: [PATCH] Update header row Move login register and forgot into separate pages. --- css/front.css | 89 +++++++----- js/frontRegApp.js | 102 +++++++------- js/views/front/app.js | 90 ++++++------ js/views/front/regClass.js | 12 +- models/admin/ajax/account.php | 2 + models/front/registrations/cart.php | 3 +- models/front/registrations/forgot.php | 69 ++++++++++ models/front/registrations/index.php | 12 +- models/front/registrations/list.php | 3 + models/front/registrations/login.php | 103 ++++++++++++++ models/front/registrations/register.php | 144 ++++++++++++++++++++ models/front/registrations/registration.php | 3 + views/front/registrations/forgot.html | 13 ++ views/front/registrations/header.html | 9 ++ views/front/registrations/list.html | 1 + views/front/registrations/login.html | 15 ++ views/front/registrations/register.html | 39 ++++++ views/front/registrations/registration.html | 26 ++-- 18 files changed, 590 insertions(+), 145 deletions(-) create mode 100644 models/front/registrations/forgot.php create mode 100644 models/front/registrations/login.php create mode 100644 models/front/registrations/register.php create mode 100644 views/front/registrations/forgot.html create mode 100644 views/front/registrations/register.html diff --git a/css/front.css b/css/front.css index 7e1e659..8f4d0af 100644 --- a/css/front.css +++ b/css/front.css @@ -1,3 +1,4 @@ +/* Event Registration Edit Page */ .glm-reg-event-list { width: 100%; padding: 0; @@ -110,39 +111,7 @@ label.registrant-label { width: 80%; } -div.glm-reg-login { - background-color: white; - border: solid 1px black; - padding: 2rem; - width: 30rem; - position: absolute; - top: 10vh; - left: 10vw; -} -div.glm-reg-login h4 { - color: black; -} -div.glm-reg-register { - background-color: white; - border: solid 1px black; - padding: 2rem; - width: 30rem; - position: absolute; - top: 10vh; - left: 10vw; - z-index: 999; -} -div.glm-reg-register div { - clear: both; -} -div.glm-reg-register input { - width: 48% !important; - margin-right: 5px; - float: left; -} -div.glm-reg-register input.error { - border: 2px solid red !important; -} + .reg-class-detail { /* display: none; */ } @@ -251,3 +220,57 @@ div.glm-reg-register input.error { .glm-registrant-edit { cursor: pointer; } + +/* Login Page */ +div.glm-reg-login { + background-color: white; + border: solid 1px black; + padding: 2rem; + width: 30rem; +} +div.glm-reg-login h4 { + color: black; +} +.accountLogin { + padding: .5rem 1rem; +} +.forgotLogin { + float: right; +} +div.glm-reg-forgot { + background-color: white; + border: solid 1px black; + padding: 2rem; + width: 30rem; +} +div.glm-reg-forgot h4 { + color: black; +} +/* New register account form */ +div.glm-reg-register { + background-color: white; + border: solid 1px black; + padding: 2rem; + width: 30rem; +} +div.glm-reg-register div { + clear: both; +} +div.glm-reg-register input { + width: 48% !important; + margin-right: 5px; + float: left; +} +div.glm-reg-register input.error { + border: 2px solid red !important; +} +div.glm-reg-register div { + position: relative; +} +span.glm-error { + position: absolute; + bottom: -56px; + left: 0px; + color: red; + font-size: 10px; +} diff --git a/js/frontRegApp.js b/js/frontRegApp.js index 8d2da7b..6699f4f 100644 --- a/js/frontRegApp.js +++ b/js/frontRegApp.js @@ -486,22 +486,22 @@ app.Views.Front.App = Backbone.View.extend({ render: function(){ // Check to see if there's a login if ( loginAccount ) { - jQuery('#appLogin').hide(); + // jQuery('#appLogin').hide(); jQuery('#register').hide(); - this.accountView = new app.Views.Front.Account({ model: loginAccount }); - this.$el.append( this.accountView.render().el ); + // this.accountView = new app.Views.Front.Account({ model: loginAccount }); + // this.$el.append( this.accountView.render().el ); } this.$el.append( this.event.render().el ); return this; }, events: { - 'click #appLogin': 'login', + // 'click #appLogin': 'login', 'click #glm-reg-cart-continue': 'continue', - 'click #accountLogin': 'loginToAccount', - 'click #accountRegister': 'registerNewAccount', - 'click #accountLogout': 'logout', - 'click #register': 'register', + // 'click #accountLogin': 'loginToAccount', + // 'click #accountRegister': 'registerNewAccount', + // 'click #accountLogout': 'logout', + // 'click #register': 'register', }, continue: function(){ @@ -514,31 +514,31 @@ app.Views.Front.App = Backbone.View.extend({ // Need to update the cart }, - logout: function(){ - // Send data to Logout - jQuery.ajax({ - context: this, - url: appAccountUrl, - dataType: 'json', - data: 'option=logout' - }) - .done(function( msg ){ - // Here we can update. - loginAccount = ''; - this.accountView.remove(); - this.render(); - this.event.model.classes.map(function(item){ - item.set({ loggedIn: false }); - }); - jQuery('#appLogin').show(); - // Need to reload the page now - window.location.href = thisPageUrl; - }) - .fail(function(msg){ - console.log('Fail:'); - console.log( msg ); - }); - }, + // logout: function(){ + // // Send data to Logout + // jQuery.ajax({ + // context: this, + // url: appAccountUrl, + // dataType: 'json', + // data: 'option=logout' + // }) + // .done(function( msg ){ + // // Here we can update. + // loginAccount = ''; + // this.accountView.remove(); + // this.render(); + // this.event.model.classes.map(function(item){ + // item.set({ loggedIn: false }); + // }); + // jQuery('#appLogin').show(); + // // Need to reload the page now + // window.location.href = thisPageUrl; + // }) + // .fail(function(msg){ + // console.log('Fail:'); + // console.log( msg ); + // }); + // }, loginToAccount: function(){ this.$userInput = jQuery('.login'); @@ -632,19 +632,19 @@ app.Views.Front.App = Backbone.View.extend({ }); }, - login: function(){ - this.loginModel = new app.Models.Front.Login(); - this.loginView = new app.Views.Front.Login({ model: this.loginModel }); - this.$el.append( this.loginView.render().el ); - jQuery('#accountHeader').hide(); - }, + // login: function(){ + // this.loginModel = new app.Models.Front.Login(); + // this.loginView = new app.Views.Front.Login({ model: this.loginModel }); + // this.$el.append( this.loginView.render().el ); + // jQuery('#accountHeader').hide(); + // }, - register: function(){ - this.registerModel = new app.Models.Front.Register(); - this.registerView = new app.Views.Front.Register({ model: this.registerModel }); - this.$el.append( this.registerView.render().el ); - jQuery('#accountHeader').hide(); - }, + // register: function(){ + // this.registerModel = new app.Models.Front.Register(); + // this.registerView = new app.Views.Front.Register({ model: this.registerModel }); + // this.$el.append( this.registerView.render().el ); + // jQuery('#accountHeader').hide(); + // }, }); @@ -746,8 +746,9 @@ app.Views.Front.RegClass = Backbone.View.extend({ // If the model is already there then don't add var findById = this.model.registrants.where({account: accountId}); if ( findById.length === 0 ) { - this.model.registrants.create({ - option: 'add', + console.log( findById.length ); + // create the regRequestRegistrant for the account + registrant = new app.Models.Front.RegRequestRegistrant({ account: accountId, reg_request: regRequest.id, reg_event: this.model.get( 'reg_event' ), @@ -757,6 +758,13 @@ app.Views.Front.RegClass = Backbone.View.extend({ fname: loginAccount.get('fname'), lname: loginAccount.get('lname') }); + // this.newRegAccount = new app.Models.Front.RegRequestRegistrant(); + this.newRegAccountView = new app.Views.Front.RegistrantForm({model: registrant}); + this.$el.append( this.newRegAccountView.render().el ); + if ( app.timeSpecific ) { + app.calendar = app.initFullCalendar( true, false ); + // console.log('called app.initFullCalendar()'); + } } } } diff --git a/js/views/front/app.js b/js/views/front/app.js index b7d1317..8fb67dc 100644 --- a/js/views/front/app.js +++ b/js/views/front/app.js @@ -17,22 +17,22 @@ app.Views.Front.App = Backbone.View.extend({ render: function(){ // Check to see if there's a login if ( loginAccount ) { - jQuery('#appLogin').hide(); + // jQuery('#appLogin').hide(); jQuery('#register').hide(); - this.accountView = new app.Views.Front.Account({ model: loginAccount }); - this.$el.append( this.accountView.render().el ); + // this.accountView = new app.Views.Front.Account({ model: loginAccount }); + // this.$el.append( this.accountView.render().el ); } this.$el.append( this.event.render().el ); return this; }, events: { - 'click #appLogin': 'login', + // 'click #appLogin': 'login', 'click #glm-reg-cart-continue': 'continue', - 'click #accountLogin': 'loginToAccount', - 'click #accountRegister': 'registerNewAccount', - 'click #accountLogout': 'logout', - 'click #register': 'register', + // 'click #accountLogin': 'loginToAccount', + // 'click #accountRegister': 'registerNewAccount', + // 'click #accountLogout': 'logout', + // 'click #register': 'register', }, continue: function(){ @@ -45,31 +45,31 @@ app.Views.Front.App = Backbone.View.extend({ // Need to update the cart }, - logout: function(){ - // Send data to Logout - jQuery.ajax({ - context: this, - url: appAccountUrl, - dataType: 'json', - data: 'option=logout' - }) - .done(function( msg ){ - // Here we can update. - loginAccount = ''; - this.accountView.remove(); - this.render(); - this.event.model.classes.map(function(item){ - item.set({ loggedIn: false }); - }); - jQuery('#appLogin').show(); - // Need to reload the page now - window.location.href = thisPageUrl; - }) - .fail(function(msg){ - console.log('Fail:'); - console.log( msg ); - }); - }, + // logout: function(){ + // // Send data to Logout + // jQuery.ajax({ + // context: this, + // url: appAccountUrl, + // dataType: 'json', + // data: 'option=logout' + // }) + // .done(function( msg ){ + // // Here we can update. + // loginAccount = ''; + // this.accountView.remove(); + // this.render(); + // this.event.model.classes.map(function(item){ + // item.set({ loggedIn: false }); + // }); + // jQuery('#appLogin').show(); + // // Need to reload the page now + // window.location.href = thisPageUrl; + // }) + // .fail(function(msg){ + // console.log('Fail:'); + // console.log( msg ); + // }); + // }, loginToAccount: function(){ this.$userInput = jQuery('.login'); @@ -163,18 +163,18 @@ app.Views.Front.App = Backbone.View.extend({ }); }, - login: function(){ - this.loginModel = new app.Models.Front.Login(); - this.loginView = new app.Views.Front.Login({ model: this.loginModel }); - this.$el.append( this.loginView.render().el ); - jQuery('#accountHeader').hide(); - }, + // login: function(){ + // this.loginModel = new app.Models.Front.Login(); + // this.loginView = new app.Views.Front.Login({ model: this.loginModel }); + // this.$el.append( this.loginView.render().el ); + // jQuery('#accountHeader').hide(); + // }, - register: function(){ - this.registerModel = new app.Models.Front.Register(); - this.registerView = new app.Views.Front.Register({ model: this.registerModel }); - this.$el.append( this.registerView.render().el ); - jQuery('#accountHeader').hide(); - }, + // register: function(){ + // this.registerModel = new app.Models.Front.Register(); + // this.registerView = new app.Views.Front.Register({ model: this.registerModel }); + // this.$el.append( this.registerView.render().el ); + // jQuery('#accountHeader').hide(); + // }, }); diff --git a/js/views/front/regClass.js b/js/views/front/regClass.js index 9fab5f5..0f15aa6 100644 --- a/js/views/front/regClass.js +++ b/js/views/front/regClass.js @@ -56,8 +56,9 @@ app.Views.Front.RegClass = Backbone.View.extend({ // If the model is already there then don't add var findById = this.model.registrants.where({account: accountId}); if ( findById.length === 0 ) { - this.model.registrants.create({ - option: 'add', + console.log( findById.length ); + // create the regRequestRegistrant for the account + registrant = new app.Models.Front.RegRequestRegistrant({ account: accountId, reg_request: regRequest.id, reg_event: this.model.get( 'reg_event' ), @@ -67,6 +68,13 @@ app.Views.Front.RegClass = Backbone.View.extend({ fname: loginAccount.get('fname'), lname: loginAccount.get('lname') }); + // this.newRegAccount = new app.Models.Front.RegRequestRegistrant(); + this.newRegAccountView = new app.Views.Front.RegistrantForm({model: registrant}); + this.$el.append( this.newRegAccountView.render().el ); + if ( app.timeSpecific ) { + app.calendar = app.initFullCalendar( true, false ); + // console.log('called app.initFullCalendar()'); + } } } } diff --git a/models/admin/ajax/account.php b/models/admin/ajax/account.php index 09053fe..3d22c61 100644 --- a/models/admin/ajax/account.php +++ b/models/admin/ajax/account.php @@ -182,6 +182,7 @@ class GlmMembersAdmin_ajax_account extends GlmDataRegistrationsAccount } break; + case 'logout': unset( $_SESSION['LoginAccount'], @@ -189,6 +190,7 @@ class GlmMembersAdmin_ajax_account extends GlmDataRegistrationsAccount ); $return = array( 'valid' => false ); break; + case 'login': $username = filter_var( $_REQUEST['username'], FILTER_SANITIZE_STRING ); $password = filter_var( $_REQUEST['password'], FILTER_SANITIZE_STRING ); diff --git a/models/front/registrations/cart.php b/models/front/registrations/cart.php index 0fb52ea..fe81c5f 100644 --- a/models/front/registrations/cart.php +++ b/models/front/registrations/cart.php @@ -151,7 +151,8 @@ class GlmMembersFront_registrations_cart extends GlmRegCartSupport 'cartId' => $cartId, 'haveCart' => $haveCart, 'cart' => $this->cart, - 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/' + 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/', + 'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false, ); //echo "
".print_r($templateData,1)."
"; diff --git a/models/front/registrations/forgot.php b/models/front/registrations/forgot.php new file mode 100644 index 0000000..b4fd885 --- /dev/null +++ b/models/front/registrations/forgot.php @@ -0,0 +1,69 @@ +wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + /* + * Run constructor for the Registrations data class + * + * Note, the third parameter is a flag that indicates to the Contacts + * data class that it should flag a group of fields as 'view_only'. + */ + // parent::__construct(false, false, true); + } + + public function modelAction($actionData = false) + { + $view = 'forgot'; + $message = ''; + + // Check for $option + $option = ( isset( $_REQUEST['option'] ) ) ? filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING) : null; + switch ( $option ) { + case 'submit': + echo '
$_REQUEST: ' . print_r( $_REQUEST, true ) . '
'; + break; + default: + break; + } + + // Compile template data + $templateData = array( + 'message' => $message, + 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/', + 'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false, + ); + // Return status, any suggested view, and any data to controller + return array( + 'status' => true, + 'modelRedirect' => false, + 'view' => 'front/registrations/' . $view . '.html', + 'data' => $templateData + ); + + } + } diff --git a/models/front/registrations/index.php b/models/front/registrations/index.php index 3a5e84e..2f98255 100644 --- a/models/front/registrations/index.php +++ b/models/front/registrations/index.php @@ -88,7 +88,17 @@ class GlmMembersFront_registrations_index } // Make sure the specified page is valid or default to "list" - if (!in_array($page, array('list', 'registration', 'cart', 'checkout', 'summary', 'login', 'account'))) { + if (!in_array($page, array( + 'list', + 'registration', + 'cart', + 'checkout', + 'summary', + 'login', + 'account', + 'forgot', + 'register', + ))) { $page = 'list'; } diff --git a/models/front/registrations/list.php b/models/front/registrations/list.php index da1f705..19de3b2 100644 --- a/models/front/registrations/list.php +++ b/models/front/registrations/list.php @@ -153,7 +153,10 @@ 'nextStart' => $nextStart, 'start' => $start, 'limit' => $limit, + 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/', + 'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false, ); + // Return status, any suggested view, and any data to controller return array( 'status' => true, diff --git a/models/front/registrations/login.php b/models/front/registrations/login.php new file mode 100644 index 0000000..3a72794 --- /dev/null +++ b/models/front/registrations/login.php @@ -0,0 +1,103 @@ +wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + /* + * Run constructor for the Registrations data class + * + * Note, the third parameter is a flag that indicates to the Contacts + * data class that it should flag a group of fields as 'view_only'. + */ + // parent::__construct(false, false, true); + } + + public function modelAction($actionData = false) + { + $view = 'login'; + $message = ''; + + // Check for $option + $option = ( isset( $_REQUEST['option'] ) ) ? filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING) : null; + switch ( $option ) { + case 'logout': + unset( + $_SESSION['LoginAccount'], + $_SESSION['glm_reg_cart_id'] + ); + wp_redirect( GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/' ); + break; + case 'submit': + // check for password and email match + $username = filter_var( $_REQUEST['username'], FILTER_SANITIZE_STRING ); + $password = filter_var( $_REQUEST['password'], FILTER_SANITIZE_STRING ); + // Check accounts for ones that match + $returnData = $this->wpdb->get_row( + $this->wpdb->prepare( + "SELECT id,password,fname,lname + FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "account + WHERE email = %s + AND active = true", + $username + ), + ARRAY_A + ); + $returnPassword = $returnData['password']; + $returnId = $returnData['id']; + if ( $returnPassword == crypt( $password, $returnPassword ) ) { + // Add the user to the php session + $_SESSION['LoginAccount'] = array( + 'id' => $returnId, + 'email' => $username, + 'fname' => $returnData['fname'], + 'lname' => $returnData['lname'], + ); + wp_redirect( GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/' ); + } else { + $message = 'Login Fail!'; + } + break; + default: + break; + } + + // Compile template data + $templateData = array( + 'message' => $message, + 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/', + 'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false, + ); + // Return status, any suggested view, and any data to controller + return array( + 'status' => true, + 'modelRedirect' => false, + 'view' => 'front/registrations/' . $view . '.html', + 'data' => $templateData + ); + + } + } diff --git a/models/front/registrations/register.php b/models/front/registrations/register.php new file mode 100644 index 0000000..625aa9a --- /dev/null +++ b/models/front/registrations/register.php @@ -0,0 +1,144 @@ +wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + /* + * Run constructor for the Registrations data class + * + * Note, the third parameter is a flag that indicates to the Contacts + * data class that it should flag a group of fields as 'view_only'. + */ + // parent::__construct(false, false, true); + } + + public function modelAction($actionData = false) + { + $view = 'register'; + $emailError = ''; + // Create dummy reg array + $reg = array( + 'fname' => '', + 'lname' => '', + 'addr1' => '', + 'addr2' => '', + 'city' => '', + 'state' => '', + 'zip' => '', + 'country' => '', + ); + + // Check for $option + $option = ( isset( $_REQUEST['option'] ) ) ? filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING) : null; + + switch ( $option ) { + case 'submit': + $email = filter_var( $_REQUEST['email'], FILTER_VALIDATE_EMAIL ); + $password = filter_var( $_REQUEST['password'], FILTER_SANITIZE_STRING ); + $fname = filter_var( $_REQUEST['fname'], FILTER_SANITIZE_STRING ); + $lname = filter_var( $_REQUEST['lname'], FILTER_SANITIZE_STRING ); + $addr1 = filter_var( $_REQUEST['addr1'], FILTER_SANITIZE_STRING ); + $addr2 = filter_var( $_REQUEST['addr2'], FILTER_SANITIZE_STRING ); + $city = filter_var( $_REQUEST['city'], FILTER_SANITIZE_STRING ); + $state = filter_var( $_REQUEST['state'], FILTER_SANITIZE_STRING ); + $zip = filter_var( $_REQUEST['zip'], FILTER_SANITIZE_STRING ); + $country = filter_var( $_REQUEST['country'], FILTER_SANITIZE_STRING ); + if ( $email ) { + $accountId = $this->wpdb->get_var( + $this->wpdb->prepare( + "SELECT id + FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "account + WHERE email = %s", + $email + ) + ); + if ( $accountId ) { + // Already an account with that email address + $emailError = 'Already an account with that email address!'; + $reg = array( + 'fname' => $fname, + 'lname' => $lname, + 'addr1' => $addr1, + 'addr2' => $addr2, + 'city' => $city, + 'state' => $state, + 'zip' => $zip, + 'country' => $country, + ); + break; + } + // If they reach here then create a new account record + $this->wpdb->insert( + GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account', + array( + 'date_created' => date('Y-m-d'), + 'active' => 1, + 'email' => $email, + 'password' => crypt( $password ), + 'fname' => $fname, + 'lname' => $lname, + 'addr1' => $addr1, + 'addr2' => $addr2, + 'city' => $city, + 'state' => $state, + 'zip' => $zip, + 'country' => $country, + ), + '%s' + ); + $accountId = $this->wpdb->insert_id; + // Add the user to the php session + $_SESSION['LoginAccount'] = array( + 'id' => $accountId, + 'email' => $email, + 'fname' => $fname, + 'lname' => $lname, + ); + wp_redirect( GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/' ); + } + break; + default: + break; + } + + // Compile template data + $templateData = array( + 'reg' => $reg, + 'emailError' => $emailError, + 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/', + 'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false, + ); + // Return status, any suggested view, and any data to controller + return array( + 'status' => true, + 'modelRedirect' => false, + 'view' => 'front/registrations/' . $view . '.html', + 'data' => $templateData + ); + + } + } diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index 8d02298..86dfca2 100644 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -132,6 +132,7 @@ // Need to refresh the page } + // echo '
$cart: ' . print_r( $cart, true ) . '
'; // If we have a good cart, convert to JSON for view if ($haveCart) { @@ -308,6 +309,8 @@ 'loginAccount' => $loginAccount, 'termsJSON' => $termsJSON, 'regJSON' => json_encode( $registrants, JSON_NUMERIC_CHECK ), + 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/', + 'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false, ); // Return status, any suggested view, and any data to controller return array( diff --git a/views/front/registrations/forgot.html b/views/front/registrations/forgot.html new file mode 100644 index 0000000..35d7ad7 --- /dev/null +++ b/views/front/registrations/forgot.html @@ -0,0 +1,13 @@ +{include file='front/registrations/header.html'} +
+ + +
+

Forgot Password

+ {if $message} + {$message} + {/if} + + +
+
diff --git a/views/front/registrations/header.html b/views/front/registrations/header.html index a8254b8..c39a2d2 100644 --- a/views/front/registrations/header.html +++ b/views/front/registrations/header.html @@ -1,3 +1,12 @@ +
+ {if $loggedIn} + Logged in as {$loggedIn.fname} {$loggedIn.lname} + Logout + {else} + Login + Register + {/if} +
Register for Another Event (should be a button)
diff --git a/views/front/registrations/list.html b/views/front/registrations/list.html index adde015..8542400 100644 --- a/views/front/registrations/list.html +++ b/views/front/registrations/list.html @@ -1,3 +1,4 @@ +{include file='front/registrations/header.html'}
{foreach $regEvents as $event}
diff --git a/views/front/registrations/login.html b/views/front/registrations/login.html index e69de29..9732584 100644 --- a/views/front/registrations/login.html +++ b/views/front/registrations/login.html @@ -0,0 +1,15 @@ +{include file='front/registrations/header.html'} +
+ + + +
diff --git a/views/front/registrations/register.html b/views/front/registrations/register.html new file mode 100644 index 0000000..eb662e5 --- /dev/null +++ b/views/front/registrations/register.html @@ -0,0 +1,39 @@ +{include file='front/registrations/header.html'} +
+ + +
+ +

Register New Account

+
+ {$terms.reg_term_contact_information} +
+
+ + {if $emailError} + {$emailError} + {/if} + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+
diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index cab13d0..12940fe 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -98,9 +98,6 @@
<%- descr %>
-
Current Rate: <%= reg_rate_name %>
-
Base Price: <%= reg_rate_base_price %>
-
Per {/literal}{$terms.reg_term_attendee_cap}{literal}: <%= reg_rate_per_reg %>
<% if ( loggedIn ) { %> <% } %> @@ -127,24 +124,24 @@ {/literal}{$terms.reg_term_contact_information}{literal}
- - + +
(Email is optional)
- - + +
- - + +
- - + +
{/literal}{if $regEvent.time_specific.value}
@@ -186,7 +183,7 @@
- + disabled <% } %>> (Email is optional)
@@ -217,10 +214,7 @@ {/literal}

{$terms.reg_term_registrations_name}

-
- Login - Register -
+ {include file='front/registrations/header.html'}
{* Bootstrap the models needed on page load *} {* Need to have RegEvent model created *} -- 2.17.1