From ddca8f7c09e1dfc85735dfa3c982c2be8f527bc4 Mon Sep 17 00:00:00 2001 From: "Steve L. Nyemba" Date: Sat, 6 May 2017 22:33:22 -0500 Subject: [PATCH] Added context-handling --- src/api/index.py | 5 +++-- src/api/templates/bill.html | 2 +- src/api/templates/subscribe.html | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/api/index.py b/src/api/index.py index a5fa9e0..85e24f8 100644 --- a/src/api/index.py +++ b/src/api/index.py @@ -18,6 +18,7 @@ PORT = 8100 if 'port' not in PARAMS else int(PARAMS['port']) ; path = PARAMS['path'] #os.environ['CONFIG'] f = open(path) CONFIG = json.loads(f.read()) +CONTEXT= ('/'+PARAMS['context']) if 'context' in PARAMS else '' stripe_keys = { 'secret_key': CONFIG['stripe']['secret'].strip(), 'publishable_key': CONFIG['stripe']['pub'].strip() @@ -165,7 +166,7 @@ def get_plans(app_name) : # # @TODO: Mark the plans the current user is signed up for # - return render_template('subscribe.html',uid=uid,app_name=app_name,plans=plans,apikey=apikey) + return render_template('subscribe.html',context=CONTEXT,uid=uid,app_name=app_name,plans=plans,apikey=apikey) @app.route('/subscribe/',methods=['DELETE']) def cancel_subscribe(name) : @@ -199,7 +200,7 @@ def is_customer (app_name): apikey = CONFIG['stripe']['pub'].strip() amount = amount / 100 - return render_template('bill.html',apikey=apikey,app_name=app_name.replace('-',' '),plans=plans,total_amount=amount) + return render_template('bill.html',context=CONTEXT,apikey=apikey,app_name=app_name.replace('-',' '),plans=plans,total_amount=amount) if __name__ == '__main__' : app.debug = True ; diff --git a/src/api/templates/bill.html b/src/api/templates/bill.html index bc4d272..b4bff81 100644 --- a/src/api/templates/bill.html +++ b/src/api/templates/bill.html @@ -57,7 +57,7 @@
- +
The Phi Technology
{{ app_name }}
diff --git a/src/api/templates/subscribe.html b/src/api/templates/subscribe.html index 07e8591..da851f5 100644 --- a/src/api/templates/subscribe.html +++ b/src/api/templates/subscribe.html @@ -1,7 +1,7 @@ - + {{app_name.replace('-',' ')}}