ref: 163b61623ec16339da7713d6bc78ae94be452235
parent: 8c4772207e523a25f88d0752e85ded65b3d536be
author: Halfwit <halfwit@MacBook-Pro.hitronhub.home>
date: Wed Oct 23 01:57:50 PDT 2019
Update all paths to point to github
--- a/client.go
+++ b/client.go
@@ -3,15 +3,15 @@
import (
"net/http"
"log"
- _ "olmax/forms"
- _ "olmax/forms/doctor"
- _ "olmax/forms/patient"
- _ "olmax/pages"
- _ "olmax/pages/doctor"
- _ "olmax/pages/help"
- _ "olmax/pages/patient"
- "olmax/router"
- "olmax/session"
+ _ "github.com/olmaxmedical/olmax_go/forms"
+ _ "github.com/olmaxmedical/olmax_go/forms/doctor"
+ _ "github.com/olmaxmedical/olmax_go/forms/patient"
+ _ "github.com/olmaxmedical/olmax_go/pages"
+ _ "github.com/olmaxmedical/olmax_go/pages/doctor"
+ _ "github.com/olmaxmedical/olmax_go/pages/help"
+ _ "github.com/olmaxmedical/olmax_go/pages/patient"
+ "github.com/olmaxmedical/olmax_go/router"
+ "github.com/olmaxmedical/olmax_go/session"
)
//go:generate gotext -srclang=en-US update -out=catalog.go -lang=en-US
--- a/email/form.go
+++ b/email/form.go
@@ -44,6 +44,7 @@
</body>
</html>
`
+
var t *template.Template
func init() {
@@ -60,11 +61,11 @@
}
m := email.NewHTMLMessage("Form contents", body.String())
m.From = mail.Address{
- Name: "From",
+ Name: "From",
Address: "olmaxmedical@gmail.com",
}
m.AddTo(mail.Address{
- Name: "To",
+ Name: "To",
Address: address,
})
for name, buff := range attachments {
--- a/email/reset.go
+++ b/email/reset.go
@@ -8,14 +8,14 @@
"time"
"github.com/google/uuid"
+ "github.com/olmaxmedical/olmax_go/db"
"golang.org/x/text/message"
- "olmax/db"
)
func SendReset(email string, p *message.Printer) {
u, _ := uuid.NewRandom()
token := u.String()
- if db.UserExists(email) {
+ if db.UserExists(email) {
db.CreateTempEntry("", "", email, "", token)
resetemail(token, email, p)
go func() {
--- a/email/signup.go
+++ b/email/signup.go
@@ -9,14 +9,14 @@
"time"
"github.com/google/uuid"
+ "github.com/olmaxmedical/olmax_go/db"
"golang.org/x/text/message"
- "olmax/db"
)
var url = "http://192.168.1.101"
func SendSignup(first, last, email, pass string, p *message.Printer) {
- if ! db.UserExists(email) {
+ if !db.UserExists(email) {
u, _ := uuid.NewRandom()
token := u.String()
db.CreateTempEntry(first, last, email, pass, token)
--- a/forms/doctor/application.go
+++ b/forms/doctor/application.go
@@ -3,18 +3,19 @@
import (
"fmt"
"net/http"
+
"github.com/albrow/forms"
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Form{
- Access: router.GuestAuth,
- Path: "doctor/application",
+ Access: router.GuestAuth,
+ Path: "doctor/application",
Validator: Application,
- Redirect: "/index.html",
- After: router.EmailForm|router.ValidateCountries|router.ValidateSpecialties|router.ValidateToken,
+ Redirect: "/index.html",
+ After: router.EmailForm | router.ValidateCountries | router.ValidateSpecialties | router.ValidateToken,
}
router.AddPost(b)
}
@@ -35,7 +36,7 @@
val.AcceptFileExts("cv", "application/msword,applicationvnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf").Message(p.Sprint("Unsupported filetype for CV"))
val.RequireFile("diploma").Message(p.Sprint("Empty or missing Diploma/Board Certification"))
val.AcceptFileExts("cv", "application/msword,applicationvnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf").Message(p.Sprint("Unsupported filetype for Diploma/Board Certification"))
- for i := 1; i < 12; i++ {
+ for i := 1; i < 12; i++ {
num := fmt.Sprintf("q%d", i)
sel, ok := r.Form[num]
if !ok {
@@ -61,4 +62,4 @@
r.Form["sendto"] = []string{"olmaxmedical@gmail.com"}
delete(r.Form, "redFlag")
return errors
-}
\ No newline at end of file
+}
--- a/forms/doctor/profile.go
+++ b/forms/doctor/profile.go
@@ -5,17 +5,17 @@
"time"
"github.com/albrow/forms"
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Form{
- Access: router.DoctorAuth,
- Path: "doctor/profile",
+ Access: router.DoctorAuth,
+ Path: "doctor/profile",
Validator: DoctorProfile,
- Redirect: "/doctor/profile.html",
- After: router.ValidateToken|router.AddAppointment,
+ Redirect: "/doctor/profile.html",
+ After: router.ValidateToken | router.AddAppointment,
}
router.AddPost(b)
}
--- a/forms/login.go
+++ b/forms/login.go
@@ -2,18 +2,19 @@
import (
"net/http"
+
"github.com/albrow/forms"
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Form{
- Access: router.GuestAuth,
- Path: "login",
+ Access: router.GuestAuth,
+ Path: "login",
Validator: Login,
- After: router.ValidateLogin,
- Redirect: "/profile.html",
+ After: router.ValidateLogin,
+ Redirect: "/profile.html",
}
router.AddPost(b)
}
--- a/forms/newpassword.go
+++ b/forms/newpassword.go
@@ -2,18 +2,19 @@
import (
"net/http"
+
"github.com/albrow/forms"
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Form{
- Access: router.GuestAuth,
- Path: "newpassword",
+ Access: router.GuestAuth,
+ Path: "newpassword",
Validator: NewPassword,
- Redirect: "/login.html",
- After: router.SetPassword|router.ValidateToken,
+ Redirect: "/login.html",
+ After: router.SetPassword | router.ValidateToken,
}
router.AddPost(b)
}
--- a/forms/patient/offer.go
+++ b/forms/patient/offer.go
@@ -5,17 +5,17 @@
"time"
"github.com/albrow/forms"
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Form{
- Access: router.PatientAuth,
- Path: "patient/offer",
+ Access: router.PatientAuth,
+ Path: "patient/offer",
Validator: Offer,
- After: router.Search|router.ValidateSpecialty,
- Redirect: "results.html",
+ After: router.Search | router.ValidateSpecialty,
+ Redirect: "results.html",
}
router.AddPost(b)
}
--- a/forms/patient/profile.go
+++ b/forms/patient/profile.go
@@ -2,18 +2,19 @@
import (
"net/http"
+
"github.com/albrow/forms"
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Form{
- Access: router.PatientAuth,
- Path: "patient/profile",
+ Access: router.PatientAuth,
+ Path: "patient/profile",
Validator: PatientProfile,
- After: 0,
- Redirect: "/patient/profile.html",
+ After: 0,
+ Redirect: "/patient/profile.html",
}
router.AddPost(b)
}
--- a/forms/patient/symptoms.go
+++ b/forms/patient/symptoms.go
@@ -5,17 +5,17 @@
"time"
"github.com/albrow/forms"
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Form{
- Access: router.PatientAuth,
- Path: "patient/sympoms",
+ Access: router.PatientAuth,
+ Path: "patient/sympoms",
Validator: Symptoms,
- After: router.EmailForm|router.WithOffer,
- Redirect: "patient/profile.html",
+ After: router.EmailForm | router.WithOffer,
+ Redirect: "patient/profile.html",
}
router.AddPost(b)
}
@@ -59,7 +59,7 @@
"musSkel",
"neuro",
"psych",
- }{
+ } {
sel, ok := r.Form[i]
if !ok {
val.AddError(i, p.Sprintf("No selection for %s", i))
--- a/forms/resetpassword.go
+++ b/forms/resetpassword.go
@@ -2,18 +2,19 @@
import (
"net/http"
+
"github.com/albrow/forms"
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Form{
- Access: router.GuestAuth,
- Path: "resetpassword",
+ Access: router.GuestAuth,
+ Path: "resetpassword",
Validator: Reset,
- Redirect: "/login.html",
- After: router.SendReset,
+ Redirect: "/login.html",
+ After: router.SendReset,
}
router.AddPost(b)
}
--- a/forms/signup.go
+++ b/forms/signup.go
@@ -2,18 +2,19 @@
import (
"net/http"
+
"github.com/albrow/forms"
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Form{
- Access: router.GuestAuth,
- Path: "signup",
+ Access: router.GuestAuth,
+ Path: "signup",
Validator: Signin,
- Redirect: "/login.html",
- After: router.SendSignup,
+ Redirect: "/login.html",
+ After: router.SendSignup,
}
router.AddPost(b)
}
@@ -38,4 +39,4 @@
errors = append(errors, val.Messages()...)
}
return errors
-}
\ No newline at end of file
+}
--- a/pages/doctor/application.go
+++ b/pages/doctor/application.go
@@ -1,8 +1,8 @@
package doctor
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
@@ -11,7 +11,7 @@
Css: "",
Path: "doctor/application",
Data: Application,
- Extra: router.ListCountries|router.ListServices|router.FormErrors|router.FormToken,
+ Extra: router.ListCountries | router.ListServices | router.FormErrors | router.FormToken,
}
router.Add(b)
}
@@ -18,36 +18,36 @@
func Application(p *message.Printer) map[string]interface{} {
return map[string]interface{}{
- "fullname": p.Sprint("Full name"),
- "user": p.Sprint("Personal"),
- "email": p.Sprint("Email"),
- "title": p.Sprint("Olmax Medical | Application"),
- "offer": p.Sprint("Create A New Offer"),
- "area": p.Sprint("Location and specialties"),
+ "fullname": p.Sprint("Full name"),
+ "user": p.Sprint("Personal"),
+ "email": p.Sprint("Email"),
+ "title": p.Sprint("Olmax Medical | Application"),
+ "offer": p.Sprint("Create A New Offer"),
+ "area": p.Sprint("Location and specialties"),
"doccountry": p.Sprint("What country or countries do you practice medicine?"),
"docspecial": p.Sprint("What is your specialty, or specialties?"),
- "gender": p.Sprint("What is your biological gender?"),
- "male": p.Sprint("Male"),
- "female": p.Sprint("Female"),
- "documents": p.Sprint("Documents"),
- "cv": p.Sprint("Please copy and paste your CV:"),
- "diploma": p.Sprint("Please upload a copy of your medical school diploma and copy of your board certification:"),
- "complete": p.Sprint("Please complete the following"),
- "yes": p.Sprint("Yes"),
- "no": p.Sprint("No"),
- "q1": p.Sprint("Has your license to practive medicine in any jurisdiction, your Drug Enforcement Administration registration or any applicable narcotic registration in any jurisdiction ever been denied, limited, restricted, suspended, revoked, not renewed, or subject to probationary conditions, or have you voluntarily or involuntarily relinquished any such license or registration or voluntarily or involuntarily accepted any such actions or conditions, or have you ever been fined or received a letter of reprimand or is such action pending?"),
- "q2": p.Sprint("Have you ever been charged, suspended, fined, diciplined, or otherwise sanctioned, subject to probationary conditions, restricted or excluded, or have you voluntarily or involuntarily relinquished eligibility to provide services or accepted conditions on your eligibility to provide services by any form of medical insurance entity, or any public program, or is any such action pending?"),
- "q3": p.Sprint("Have your clinical privileges, membership, contractual participation or employment by any medical organization (e.g. hospital medical staff, medical group, independent practice association, health plan, health mantenance organization, preferred provider organization, private payer, medical society, professional association, medical school faculty position or other health delivery entity or system), ever been denied, suspended, restricted, reduced, subject to probationairy conditions, revoked or not renewed for any reason, or is any such action pending?"),
- "q4": p.Sprint("Have you ever voluntarily or involuntarily withdrawn a request for membership or clinical privileges, voluntarily or involuntarily relinquished membership or clinical privileges, allowed such membership or clinical privileges to expire, or resigned from any medical organization (e.g., hospital medical staff, medical group, independent practice association, health plan, health mantenance organization, preferred provider organization, private payer, medical society, professional association, medical school faculty position or other health delivery entity or system), for any reason, or in return for such an investigation not being conducted, or is any such action pending?"),
- "q5": p.Sprint("Have you ever terminated contractual participation or employment with any medical organization (e.g., hospital medical staff, medical group, independent practice association, health plan, health mantenance organization, preferred provider organization, private payer, medical society, professional association, medical school faculty position or other health delivery entity or system), or allowed such contract or employment to expire, for any reason, or in return for such an investigation not being conducted, or is any such action pending?"),
- "q6": p.Sprint("Have you ever surrendered, voluntarily withdrawn, or been requested or compelled to relinquish your status as a student in good standing in any internship, residency, fellowship, preceptorship, or other clinical education program, or is any such action pending?"),
- "q7": p.Sprint("Has your membership or fellowship in any local, county, state, regional, nation, or international professional organization ever been revoked, denied, reduced, limited, subject to probationary conditions, or not renewed, or is any such action pending?"),
- "q8": p.Sprint("Have you ever been denied certification/re-certification by a specialty board, or has your eligibility certification or re-certification status changed, or is any such action pending?"),
- "q9": p.Sprint("Have you ever been convicted of or pled <i>nolo contendre</i> to any crime (other than a minor traffic violation), or is any such action pending?"),
- "q10": p.Sprint("Do you currently use drugs illegally, or in the past five years have you participated in any treatment or diversion program related to drug use, alcohol dependency, or psychiatric problems?"),
- "q11": p.Sprint("Have any judgments been entered against you, or settlements been agreed to by you (including dismissals) within the last ten (10) years, in professional liability cases, or are there any filed and served professional liability lawsuits/arbitrations against you pending?"),
- "q12": p.Sprint("I hereby affirm that the information above and any addenda thereto is true, current, correct, and complete to the best of my knowledge and belief and is furnished in good faith, I understand that omissions or misrepresentations may result in denial of my application to participate in Olmax Medical web services."),
- "confirm": p.Sprint("Confirm"),
- "submit": p.Sprint("Submit"),
+ "gender": p.Sprint("What is your biological gender?"),
+ "male": p.Sprint("Male"),
+ "female": p.Sprint("Female"),
+ "documents": p.Sprint("Documents"),
+ "cv": p.Sprint("Please copy and paste your CV:"),
+ "diploma": p.Sprint("Please upload a copy of your medical school diploma and copy of your board certification:"),
+ "complete": p.Sprint("Please complete the following"),
+ "yes": p.Sprint("Yes"),
+ "no": p.Sprint("No"),
+ "q1": p.Sprint("Has your license to practive medicine in any jurisdiction, your Drug Enforcement Administration registration or any applicable narcotic registration in any jurisdiction ever been denied, limited, restricted, suspended, revoked, not renewed, or subject to probationary conditions, or have you voluntarily or involuntarily relinquished any such license or registration or voluntarily or involuntarily accepted any such actions or conditions, or have you ever been fined or received a letter of reprimand or is such action pending?"),
+ "q2": p.Sprint("Have you ever been charged, suspended, fined, diciplined, or otherwise sanctioned, subject to probationary conditions, restricted or excluded, or have you voluntarily or involuntarily relinquished eligibility to provide services or accepted conditions on your eligibility to provide services by any form of medical insurance entity, or any public program, or is any such action pending?"),
+ "q3": p.Sprint("Have your clinical privileges, membership, contractual participation or employment by any medical organization (e.g. hospital medical staff, medical group, independent practice association, health plan, health mantenance organization, preferred provider organization, private payer, medical society, professional association, medical school faculty position or other health delivery entity or system), ever been denied, suspended, restricted, reduced, subject to probationairy conditions, revoked or not renewed for any reason, or is any such action pending?"),
+ "q4": p.Sprint("Have you ever voluntarily or involuntarily withdrawn a request for membership or clinical privileges, voluntarily or involuntarily relinquished membership or clinical privileges, allowed such membership or clinical privileges to expire, or resigned from any medical organization (e.g., hospital medical staff, medical group, independent practice association, health plan, health mantenance organization, preferred provider organization, private payer, medical society, professional association, medical school faculty position or other health delivery entity or system), for any reason, or in return for such an investigation not being conducted, or is any such action pending?"),
+ "q5": p.Sprint("Have you ever terminated contractual participation or employment with any medical organization (e.g., hospital medical staff, medical group, independent practice association, health plan, health mantenance organization, preferred provider organization, private payer, medical society, professional association, medical school faculty position or other health delivery entity or system), or allowed such contract or employment to expire, for any reason, or in return for such an investigation not being conducted, or is any such action pending?"),
+ "q6": p.Sprint("Have you ever surrendered, voluntarily withdrawn, or been requested or compelled to relinquish your status as a student in good standing in any internship, residency, fellowship, preceptorship, or other clinical education program, or is any such action pending?"),
+ "q7": p.Sprint("Has your membership or fellowship in any local, county, state, regional, nation, or international professional organization ever been revoked, denied, reduced, limited, subject to probationary conditions, or not renewed, or is any such action pending?"),
+ "q8": p.Sprint("Have you ever been denied certification/re-certification by a specialty board, or has your eligibility certification or re-certification status changed, or is any such action pending?"),
+ "q9": p.Sprint("Have you ever been convicted of or pled <i>nolo contendre</i> to any crime (other than a minor traffic violation), or is any such action pending?"),
+ "q10": p.Sprint("Do you currently use drugs illegally, or in the past five years have you participated in any treatment or diversion program related to drug use, alcohol dependency, or psychiatric problems?"),
+ "q11": p.Sprint("Have any judgments been entered against you, or settlements been agreed to by you (including dismissals) within the last ten (10) years, in professional liability cases, or are there any filed and served professional liability lawsuits/arbitrations against you pending?"),
+ "q12": p.Sprint("I hereby affirm that the information above and any addenda thereto is true, current, correct, and complete to the best of my knowledge and belief and is furnished in good faith, I understand that omissions or misrepresentations may result in denial of my application to participate in Olmax Medical web services."),
+ "confirm": p.Sprint("Confirm"),
+ "submit": p.Sprint("Submit"),
}
}
--- a/pages/doctor/bookings.go
+++ b/pages/doctor/bookings.go
@@ -1,8 +1,8 @@
package doctor
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
--- a/pages/doctor/findpatients.go
+++ b/pages/doctor/findpatients.go
@@ -1,8 +1,8 @@
package doctor
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
--- a/pages/doctor/profile.go
+++ b/pages/doctor/profile.go
@@ -1,8 +1,8 @@
package doctor
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
@@ -11,7 +11,7 @@
Css: "",
Path: "doctor/profile",
Data: Profile,
- Extra: router.FormErrors|router.FormToken,
+ Extra: router.FormErrors | router.FormToken,
}
router.Add(b)
}
--- a/pages/help/appointments.go
+++ b/pages/help/appointments.go
@@ -1,13 +1,13 @@
package help
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.GuestAuth|router.PatientAuth|router.DoctorAuth,
+ Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
Css: "",
Path: "help/appointments",
Data: Appointments,
--- a/pages/help/catalog.go
+++ b/pages/help/catalog.go
@@ -1,13 +1,13 @@
package help
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.GuestAuth|router.PatientAuth|router.DoctorAuth,
+ Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
Css: "",
Path: "help/catalog",
Data: Catalog,
--- a/pages/help/contacting.go
+++ b/pages/help/contacting.go
@@ -1,13 +1,13 @@
package help
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.GuestAuth|router.PatientAuth|router.DoctorAuth,
+ Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
Css: "",
Path: "help/contacting",
Data: Contacting,
--- a/pages/help/help.go
+++ b/pages/help/help.go
@@ -1,13 +1,13 @@
package help
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.GuestAuth|router.PatientAuth|router.DoctorAuth,
+ Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
Css: "",
Path: "help/faq",
Data: Faq,
--- a/pages/help/paymentmethods.go
+++ b/pages/help/paymentmethods.go
@@ -1,13 +1,13 @@
package help
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.GuestAuth|router.PatientAuth|router.DoctorAuth,
+ Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
Css: "",
Path: "help/paymentmethods",
Data: Paymethod,
--- a/pages/help/pricesandfees.go
+++ b/pages/help/pricesandfees.go
@@ -1,13 +1,13 @@
package help
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.GuestAuth|router.PatientAuth|router.DoctorAuth,
+ Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
Css: "",
Path: "help/pricesandfees",
Data: Pricefee,
--- a/pages/help/provider.go
+++ b/pages/help/provider.go
@@ -1,13 +1,13 @@
package help
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.GuestAuth|router.PatientAuth|router.DoctorAuth,
+ Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
Css: "",
Path: "help/provider",
Data: Provider,
--- a/pages/help/verification.go
+++ b/pages/help/verification.go
@@ -1,13 +1,13 @@
package help
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.GuestAuth|router.PatientAuth|router.DoctorAuth,
+ Access: router.GuestAuth | router.PatientAuth | router.DoctorAuth,
Css: "",
Path: "help/verification",
Data: Verification,
--- a/pages/index.go
+++ b/pages/index.go
@@ -1,17 +1,17 @@
package pages
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.GuestAuth|router.DoctorAuth|router.PatientAuth,
+ Access: router.GuestAuth | router.DoctorAuth | router.PatientAuth,
Css: "index.css",
Path: "index",
Data: Index,
- Extra: router.ListDoctors|router.FormErrors,
+ Extra: router.ListDoctors | router.FormErrors,
}
router.Add(b)
}
--- a/pages/login.go
+++ b/pages/login.go
@@ -1,8 +1,8 @@
package pages
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
--- a/pages/messages.go
+++ b/pages/messages.go
@@ -1,13 +1,13 @@
package pages
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.PatientAuth|router.DoctorAuth,
+ Access: router.PatientAuth | router.DoctorAuth,
Css: "",
Path: "messages",
Data: Messages,
--- a/pages/newpassword.go
+++ b/pages/newpassword.go
@@ -1,8 +1,8 @@
package pages
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
@@ -11,7 +11,7 @@
Css: "",
Path: "newpassword",
Data: NewPassword,
- Extra: router.FormToken|router.FormErrors,
+ Extra: router.FormToken | router.FormErrors,
}
router.Add(b)
}
@@ -18,10 +18,10 @@
func NewPassword(p *message.Printer) map[string]interface{} {
return map[string]interface{}{
- "title": p.Sprintf("Olmax Medical | Login"),
- "reset": p.Sprint("Enter new password"),
- "password": p.Sprint("Enter password"),
- "reenter": p.Sprint("Re-enter password"),
- "update": p.Sprint("Update"),
+ "title": p.Sprintf("Olmax Medical | Login"),
+ "reset": p.Sprint("Enter new password"),
+ "password": p.Sprint("Enter password"),
+ "reenter": p.Sprint("Re-enter password"),
+ "update": p.Sprint("Update"),
}
}
--- a/pages/patient/appointments.go
+++ b/pages/patient/appointments.go
@@ -2,8 +2,9 @@
import (
"html/template"
+
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
@@ -18,7 +19,7 @@
}
func Appointments(p *message.Printer) map[string]interface{} {
- return map[string]interface{} {
+ return map[string]interface{}{
"title": p.Sprintf("Olmax Medical | Appointments"),
"mainHeader": p.Sprintf("You currently have no appointments pending."),
"mainBody": p.Sprintf("If you have submitted payment, and do not see appointment scheduled on this page; please refer to the %s section.", template.HTML(`<a href="help.html">help</a>`)),
--- a/pages/patient/offer.go
+++ b/pages/patient/offer.go
@@ -1,8 +1,8 @@
package patient
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
@@ -11,7 +11,7 @@
Css: "",
Path: "patient/offer",
Data: Createoffer,
- Extra: router.ListServices|router.FormErrors,
+ Extra: router.ListServices | router.FormErrors,
}
router.Add(b)
}
@@ -20,10 +20,10 @@
return map[string]interface{}{
"title": p.Sprint("Olmax Medical | Create Offer"),
"mainHeader": p.Sprint("Create An Offer"),
- "specialty": p.Sprint("Specialty"),
+ "specialty": p.Sprint("Specialty"),
"specialtyHeader": p.Sprint("Physician Specialty"),
"bcu": p.Sprint("Bitcoin Per Unit"),
- "rate": p.Sprint("15/min"),
+ "rate": p.Sprint("15/min"),
"dates": p.Sprint("Dates"),
"from": p.Sprint("From: "),
"to": p.Sprint("To: "),
--- a/pages/patient/profile.go
+++ b/pages/patient/profile.go
@@ -1,8 +1,8 @@
package patient
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
--- a/pages/patient/symptoms.go
+++ b/pages/patient/symptoms.go
@@ -1,8 +1,8 @@
package patient
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
@@ -11,7 +11,7 @@
Css: "",
Path: "patient/symptoms",
Data: Symptoms,
- Extra: router.FormErrors|router.SessionToken,
+ Extra: router.FormErrors | router.SessionToken,
}
router.Add(b)
}
--- a/pages/resetpassword.go
+++ b/pages/resetpassword.go
@@ -1,8 +1,8 @@
package pages
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
--- a/pages/signup.go
+++ b/pages/signup.go
@@ -1,8 +1,8 @@
package pages
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
--- a/pages/wallet.go
+++ b/pages/wallet.go
@@ -1,13 +1,13 @@
package pages
import (
+ "github.com/olmaxmedical/olmax_go/router"
"golang.org/x/text/message"
- "olmax/router"
)
func init() {
b := &router.Page{
- Access: router.PatientAuth|router.DoctorAuth,
+ Access: router.PatientAuth | router.DoctorAuth,
Css: "",
Path: "wallet",
Data: Wallet,
--- a/router/countries.go
+++ b/router/countries.go
@@ -78,4 +78,4 @@
}
}
return p.Sprint("No country entered/nil value entered")
-}
\ No newline at end of file
+}
--- a/router/forms.go
+++ b/router/forms.go
@@ -5,10 +5,11 @@
"log"
"mime/multipart"
"net/http"
+
+ "github.com/olmaxmedical/olmax_go/db"
+ "github.com/olmaxmedical/olmax_go/email"
+ "github.com/olmaxmedical/olmax_go/session"
"golang.org/x/text/message"
- "olmax/db"
- "olmax/email"
- "olmax/session"
)
var formlist map[string]*Form
@@ -44,7 +45,7 @@
}
func AddPost(f *Form) {
- formlist[f.Path + ".html"] = f
+ formlist[f.Path+".html"] = f
}
// This large ladder just adds conditional logic to forms for a more generic
@@ -53,13 +54,13 @@
var errors, errs []string
var e, msg string
form, ok := formlist[p.path]
- if ! ok {
+ if !ok {
errors = append(errors, "No such page")
return nil, errors
}
if form.After&ValidateToken != 0 {
t := r.PostFormValue("token")
- if ! validateToken(t) {
+ if !validateToken(t) {
return nil, []string{p.printer.Sprint("Invalid form token")}
}
}
@@ -148,7 +149,7 @@
return errors
}
token := r.PostFormValue("token")
- if ! db.FindTempEntry(token) {
+ if !db.FindTempEntry(token) {
errors = append(errors, p.Sprint("Session expired"))
return errors
}
--- a/router/run.go
+++ b/router/run.go
@@ -4,10 +4,10 @@
"fmt"
"net/http"
+ "github.com/olmaxmedical/olmax_go/db"
+ "github.com/olmaxmedical/olmax_go/email"
+ "github.com/olmaxmedical/olmax_go/session"
"golang.org/x/text/message"
- "olmax/db"
- "olmax/email"
- "olmax/session"
)
type handle struct {
@@ -15,7 +15,7 @@
}
func Route(manager *session.Manager) error {
- d := &handle {
+ d := &handle{
manager: manager,
}
css := http.FileServer(http.Dir("resources/css/"))
@@ -65,7 +65,7 @@
user string
status string
path string
- role db.Access
+ role db.Access
}
func (d *handle) normal(w http.ResponseWriter, r *http.Request) {
@@ -74,19 +74,19 @@
return
}
user, status, us, role := getUser(d, w, r)
- p := &page {
+ p := &page{
printer: userLang(r),
- status: status,
- user: user,
- role: role,
+ status: status,
+ user: user,
+ role: role,
session: us,
- path: r.URL.Path[1:],
+ path: r.URL.Path[1:],
}
switch r.Method {
case "GET":
get(p, w)
case "POST":
- post(p, us, w, r);
+ post(p, us, w, r)
}
}
@@ -93,7 +93,7 @@
func (d *handle) logout(w http.ResponseWriter, r *http.Request) {
d.manager.SessionDestroy(w, r)
http.Redirect(w, r, "/index.html", 302)
-
+
}
func post(p *page, us session.Session, w http.ResponseWriter, r *http.Request) {
@@ -126,7 +126,7 @@
http.Error(w, "Service Unavailable", 503)
return
}
- fmt.Fprintf(w, "%s", data)
+ fmt.Fprintf(w, "%s", data)
}
func userLang(r *http.Request) *message.Printer {
@@ -141,10 +141,10 @@
user, ok1 := us.Get("username").(string)
status, ok2 := us.Get("login").(string)
role, ok3 := us.Get("role").(db.Access)
- if ! ok1 || ! ok2 || status != "true" {
+ if !ok1 || !ok2 || status != "true" {
status = "false"
}
- if ! ok3 {
+ if !ok3 {
role = db.GuestAuth
}
return user, status, us, role
@@ -157,12 +157,12 @@
http.Error(w, "Unauthorized", 401)
return
}
- p := &page {
+ p := &page{
printer: userLang(r),
- status: status,
+ status: status,
session: us,
- user: user,
- role: role,
+ user: user,
+ role: role,
}
var data []byte
var err error
@@ -189,6 +189,5 @@
http.Error(w, "Service Unavailable", 503)
return
}
- fmt.Fprintf(w, "%s", data)
+ fmt.Fprintf(w, "%s", data)
}
-
--- a/router/tokens.go
+++ b/router/tokens.go
@@ -23,4 +23,4 @@
}
}
return false
-}
\ No newline at end of file
+}