hlfw.ca

webbing

Download patch

ref: efcf1704a5b76d5136a710f020ff7c0b0cf00152
parent: 6dcaa76c7cb8da52cb14de66688556934dca39ca
author: halfwit <michaelmisch1985@gmail.com>
date: Tue Nov 12 08:38:37 PST 2019

We no longer need the functions as globals

--- a/pages/doctor/application.go
+++ b/pages/doctor/application.go
@@ -11,14 +11,13 @@
 		Access: router.GuestAuth,
 		CSS:    "",
 		Path:   "doctor/application",
-		Data:   Application,
+		Data:   application,
 		Extra:  plugins.Countries | plugins.Services | plugins.FormErrors | plugins.FormToken,
 	}
 	router.AddPage(b)
 }
 
-// Application - olmaxmedical.com/doctor/application.html
-func Application(p *message.Printer) map[string]interface{} {
+func application(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"fullname":   p.Sprint("Full name"),
 		"user":       p.Sprint("Personal"),
--- a/pages/doctor/bookings.go
+++ b/pages/doctor/bookings.go
@@ -10,17 +10,16 @@
 		Access: router.DoctorAuth,
 		CSS:    "",
 		Path:   "doctor/bookings",
-		Data:   Bookings,
+		Data:   bookings,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Bookings - olmaxmedical.com/doctor/bookings.html
-func Bookings(p *message.Printer) map[string]interface{} {
+func bookings(p *message.Printer) map[string]interface{} {
+	//TODO(halfwit) populate with database
 	return map[string]interface{}{
 		"title":      p.Sprintf("Olmax Medical | Bookings"),
 		"mainHeader": p.Sprintf("Available patients"),
-		// more fields to populate when we have db access
 	}
 }
--- a/pages/doctor/findpatients.go
+++ b/pages/doctor/findpatients.go
@@ -10,14 +10,13 @@
 		Access: router.DoctorAuth,
 		CSS:    "",
 		Path:   "doctor/findpatients",
-		Data:   Findpatients,
+		Data:   findpatients,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Findpatients - olmaxmedical.com/doctor/findpatients.html
-func Findpatients(p *message.Printer) map[string]interface{} {
+func findpatients(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":      p.Sprintf("Olmax Medical | Find Patients"),
 		"mainHeader": p.Sprintf("Available patients"),
--- a/pages/doctor/profile.go
+++ b/pages/doctor/profile.go
@@ -11,14 +11,13 @@
 		Access: router.DoctorAuth,
 		CSS:    "",
 		Path:   "doctor/profile",
-		Data:   Profile,
+		Data:   profile,
 		Extra:  plugins.FormErrors | plugins.FormToken,
 	}
 	router.AddPage(b)
 }
 
-// Profile - olmaxmedical.com/doctor/profile.html
-func Profile(p *message.Printer) map[string]interface{} {
+func profile(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":          p.Sprint("Olmax Medical | Profile"),
 		"greetingHeader": p.Sprint("Hello "),
--- a/pages/help/appointments.go
+++ b/pages/help/appointments.go
@@ -10,14 +10,13 @@
 		Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
 		CSS:    "",
 		Path:   "help/appointments",
-		Data:   Appointments,
+		Data:   appointments,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Appointments - olmaxmedical.com/help/appointments.html
-func Appointments(p *message.Printer) map[string]interface{} {
+func appointments(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":             p.Sprintf("Olmax Medical | FAQ"),
 		"mainHeader":        p.Sprintf("Olmax Medical"),
--- a/pages/help/catalog.go
+++ b/pages/help/catalog.go
@@ -10,14 +10,13 @@
 		Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
 		CSS:    "",
 		Path:   "help/catalog",
-		Data:   Catalog,
+		Data:   catalog,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Catalog - olmaxmedical.com/help/catalog.html
-func Catalog(p *message.Printer) map[string]interface{} {
+func catalog(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":      p.Sprintf("Olmax Medical | Our Doctors"),
 		"mainHeader": p.Sprintf("Olmax Medical"),
--- a/pages/help/contacting.go
+++ b/pages/help/contacting.go
@@ -10,14 +10,13 @@
 		Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
 		CSS:    "",
 		Path:   "help/contacting",
-		Data:   Contacting,
+		Data:   contacting,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Contacting - olmaxmedical.com/help/contacting.html
-func Contacting(p *message.Printer) map[string]interface{} {
+func contacting(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":          p.Sprintf("Olmax Medical | FAQ"),
 		"mainHeader":     p.Sprintf("Olmax Medical"),
--- a/pages/help/help.go
+++ b/pages/help/help.go
@@ -10,14 +10,13 @@
 		Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
 		CSS:    "",
 		Path:   "help/faq",
-		Data:   Faq,
+		Data:   faq,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Faq - olmaxmedical.com/help/faq.html
-func Faq(p *message.Printer) map[string]interface{} {
+func faq(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":             p.Sprintf("Olmax Medical | Help"),
 		"mainHeader":        p.Sprintf("Olmax Medical"),
--- a/pages/help/paymentmethods.go
+++ b/pages/help/paymentmethods.go
@@ -10,14 +10,13 @@
 		Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
 		CSS:    "",
 		Path:   "help/paymentmethods",
-		Data:   Paymethod,
+		Data:   paymethod,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Paymethod - olmaxmedical.com/help/paymentmethods.html
-func Paymethod(p *message.Printer) map[string]interface{} {
+func paymethod(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":            p.Sprint("Olmax Medical | FAQ"),
 		"mainHeader":       p.Sprint("Olmax Medical"),
--- a/pages/help/pricesandfees.go
+++ b/pages/help/pricesandfees.go
@@ -10,14 +10,13 @@
 		Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
 		CSS:    "",
 		Path:   "help/pricesandfees",
-		Data:   Pricefee,
+		Data:   pricefee,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Pricefee - olmaxmedical.com/help/pricesandfees.html
-func Pricefee(p *message.Printer) map[string]interface{} {
+func pricefee(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":           p.Sprintf("Olmax Medical | FAQ"),
 		"mainHeader":      p.Sprintf("Olmax Medical"),
--- a/pages/help/provider.go
+++ b/pages/help/provider.go
@@ -12,14 +12,13 @@
 		Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
 		CSS:    "",
 		Path:   "help/provider",
-		Data:   Provider,
+		Data:   provider,
 		Extra:  plugins.Services,
 	}
 	router.AddPage(b)
 }
 
-// Provider - olmaxmedical.com/help/provider.html
-func Provider(p *message.Printer) map[string]interface{} {
+func provider(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":              p.Sprintf("Olmax Medical | Become A Provider"),
 		"specialtyHeader":    p.Sprintf("Specialty"),
--- a/pages/help/verification.go
+++ b/pages/help/verification.go
@@ -10,14 +10,13 @@
 		Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
 		CSS:    "",
 		Path:   "help/verification",
-		Data:   Verification,
+		Data:   verification,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Verification - olmaxmedical.com/help/verification.html
-func Verification(p *message.Printer) map[string]interface{} {
+func verification(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":        p.Sprintf("Olmax Medical | FAQ"),
 		"mainHeader":   p.Sprintf("Olmax Medical"),
--- a/pages/index.go
+++ b/pages/index.go
@@ -11,14 +11,13 @@
 		Access: router.GuestAuth | router.DoctorAuth | router.PatientAuth,
 		CSS:    "index.css",
 		Path:   "index",
-		Data:   Index,
+		Data:   index,
 		Extra:  plugins.ListDoctors | plugins.FormErrors,
 	}
 	router.AddPage(b)
 }
 
-// Index - olmaxmedical.com/index.html
-func Index(p *message.Printer) map[string]interface{} {
+func index(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":            p.Sprintf("Olmax Medical | Welcome"),
 		"name":             p.Sprintf("Olmax Medical"),
--- a/pages/login.go
+++ b/pages/login.go
@@ -11,15 +11,14 @@
 		Access: router.GuestAuth,
 		CSS:    "",
 		Path:   "login",
-		Data:   Login,
+		Data:   login,
 		Extra:  plugins.FormErrors,
 	}
-	//router.AddGet(b)
+
 	router.AddPage(b)
 }
 
-// Login - olmaxmedical.com/login.html
-func Login(p *message.Printer) map[string]interface{} {
+func login(p *message.Printer) map[string]interface{} {
 	// TODO: Also add in the error messages here
 	return map[string]interface{}{
 		"title":          p.Sprintf("Olmax Medical | Login"),
--- a/pages/messages.go
+++ b/pages/messages.go
@@ -10,14 +10,13 @@
 		Access: router.PatientAuth | router.DoctorAuth,
 		CSS:    "",
 		Path:   "messages",
-		Data:   Messages,
+		Data:   messages,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Messages - olmaxmedical.com/messages.html
-func Messages(p *message.Printer) map[string]interface{} {
+func messages(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":      p.Sprintf("Olmax Medical | Messages"),
 		"mainHeader": p.Sprintf("You currently have no messages."),
--- a/pages/newpassword.go
+++ b/pages/newpassword.go
@@ -11,14 +11,13 @@
 		Access: router.GuestAuth,
 		CSS:    "",
 		Path:   "newpassword",
-		Data:   NewPassword,
+		Data:   newPassword,
 		Extra:  plugins.FormToken | plugins.FormErrors,
 	}
 	router.AddPage(b)
 }
 
-// NewPassword - olmaxmedical.com/newpassword.html
-func NewPassword(p *message.Printer) map[string]interface{} {
+func newPassword(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":    p.Sprintf("Olmax Medical | Login"),
 		"reset":    p.Sprint("Enter new password"),
--- a/pages/patient/appointments.go
+++ b/pages/patient/appointments.go
@@ -12,14 +12,13 @@
 		Access: router.PatientAuth,
 		CSS:    "",
 		Path:   "patient/appointments",
-		Data:   Appointments,
+		Data:   appointments,
 		Extra:  0, // call function to look up appointments here
 	}
 	router.AddPage(b)
 }
 
-// Appointments - olmaxmedical.com/patient/appointments.html
-func Appointments(p *message.Printer) map[string]interface{} {
+func appointments(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":      p.Sprintf("Olmax Medical | Appointments"),
 		"mainHeader": p.Sprintf("You currently have no appointments pending."),
--- a/pages/patient/offer.go
+++ b/pages/patient/offer.go
@@ -11,14 +11,13 @@
 		Access: router.PatientAuth,
 		CSS:    "",
 		Path:   "patient/offer",
-		Data:   Createoffer,
+		Data:   offer,
 		Extra:  plugins.Services | plugins.FormErrors,
 	}
 	router.AddPage(b)
 }
 
-// Createoffer - olmaxmedical.com/patient/offer.html
-func Createoffer(p *message.Printer) map[string]interface{} {
+func offer(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":           p.Sprint("Olmax Medical | Create Offer"),
 		"mainHeader":      p.Sprint("Create An Offer"),
--- a/pages/patient/profile.go
+++ b/pages/patient/profile.go
@@ -10,14 +10,13 @@
 		Access: router.PatientAuth,
 		CSS:    "",
 		Path:   "patient/profile",
-		Data:   Profile,
+		Data:   profile,
 		Extra:  0, // listPendingAppointments
 	}
 	router.AddPage(b)
 }
 
-// Profile - olmaxmedical.com/patient/profile.html
-func Profile(p *message.Printer) map[string]interface{} {
+func profile(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":          p.Sprintf("Olmax Medical | Profile"),
 		"greetingHeader": p.Sprintf("Hello "),
--- a/pages/patient/symptoms.go
+++ b/pages/patient/symptoms.go
@@ -11,14 +11,13 @@
 		Access: router.PatientAuth,
 		CSS:    "",
 		Path:   "patient/symptoms",
-		Data:   Symptoms,
+		Data:   symptoms,
 		Extra:  plugins.FormErrors | plugins.SessionToken,
 	}
 	router.AddPage(b)
 }
 
-// Symptoms - olmaxmedical.com/patient/symptoms.html
-func Symptoms(p *message.Printer) map[string]interface{} {
+func symptoms(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":                p.Sprintf("Olmax Medical | Create Profile"),
 		"createHeader":         p.Sprintf("Create Patient Profile"),
--- a/pages/resetpassword.go
+++ b/pages/resetpassword.go
@@ -11,14 +11,13 @@
 		Access: router.GuestAuth,
 		CSS:    "",
 		Path:   "resetpassword",
-		Data:   ResetPassword,
+		Data:   resetPassword,
 		Extra:  plugins.FormErrors,
 	}
 	router.AddPage(b)
 }
 
-// ResetPassword - olmaxmedical.com/resetpassword.html
-func ResetPassword(p *message.Printer) map[string]interface{} {
+func resetPassword(p *message.Printer) map[string]interface{} {
 	// TODO: Also add in the error messages here
 	return map[string]interface{}{
 		"title":     p.Sprintf("Olmax Medical | Login"),
--- a/pages/signup.go
+++ b/pages/signup.go
@@ -11,14 +11,13 @@
 		Access: router.GuestAuth,
 		CSS:    "",
 		Path:   "signup",
-		Data:   Signup,
+		Data:   signup,
 		Extra:  plugins.FormErrors,
 	}
 	router.AddPage(b)
 }
 
-// Signup - olmaxmedical.com/signup.html
-func Signup(p *message.Printer) map[string]interface{} {
+func signup(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":      p.Sprintf("Olmax Medical | Sign Up"),
 		"mainHeader": p.Sprintf("Sign Up for free"),
--- a/pages/wallet.go
+++ b/pages/wallet.go
@@ -10,14 +10,13 @@
 		Access: router.PatientAuth | router.DoctorAuth,
 		CSS:    "",
 		Path:   "wallet",
-		Data:   Wallet,
+		Data:   wallet,
 		Extra:  0,
 	}
 	router.AddPage(b)
 }
 
-// Wallet - olmaxmedical.com/wallet.html
-func Wallet(p *message.Printer) map[string]interface{} {
+func wallet(p *message.Printer) map[string]interface{} {
 	return map[string]interface{}{
 		"title":      p.Sprintf("Olmax Medical | Wallet"),
 		"mainHeader": p.Sprintf("Wallet"),
--- a/plugins/offers.go
+++ b/plugins/offers.go
@@ -2,7 +2,7 @@
 
 import "github.com/olmaxmedical/olmax_go/router"
 
-// Offer - Request a time slot with doctor
+// MakeOffer - Request a time slot with doctor
 const MakeOffer router.PluginMask = 8
 
 func init() {