From 9ef63f93d662f8ba2a3988e5713e04696173d1d1 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 1 Feb 2012 14:47:29 +0530 Subject: [PATCH] moved back to 'index.cgi' model --- erpnext/patches/jan_mar_2012/website.py | 4 + index.cgi | 48 +++++---- index.html | 124 ------------------------ templates/index.html | 21 ---- version.num | 2 +- 5 files changed, 27 insertions(+), 172 deletions(-) delete mode 100644 index.html delete mode 100644 templates/index.html diff --git a/erpnext/patches/jan_mar_2012/website.py b/erpnext/patches/jan_mar_2012/website.py index 777e0ef06d..55a1aefabe 100644 --- a/erpnext/patches/jan_mar_2012/website.py +++ b/erpnext/patches/jan_mar_2012/website.py @@ -16,14 +16,18 @@ def execute(): reload_doc('website', 'doctype', 'top_bar_item') reload_doc('website', 'doctype', 'contact_us_settings') reload_doc('website', 'doctype', 'about_us_settings') + reload_doc('website', 'doctype', 'products_settings') reload_doc('website', 'doctype', 'blog') reload_doc('website', 'doctype', 'blog_subscriber') + reload_doc('website', 'doctype', 'product') + reload_doc('website', 'doctype', 'web_page') reload_doc('website', 'page', 'home') reload_doc('website', 'page', 'contact') reload_doc('website', 'page', 'about') reload_doc('website', 'page', 'blog') reload_doc('website', 'page', 'unsubscribe') + reload_doc('website', 'page', 'products') def add_website_manager(): """add website manager to system manager""" diff --git a/index.cgi b/index.cgi index 3d61c56052..a119daeeda 100755 --- a/index.cgi +++ b/index.cgi @@ -9,33 +9,29 @@ sys.path.append('lib/py') sys.path.append('erpnext') import webnotes +import webnotes.handler +import webnotes.auth -webnotes.form = cgi.FieldStorage() +def init(): + # make the form_dict + webnotes.form = cgi.FieldStorage(keep_blank_values=True) + for key in webnotes.form.keys(): + webnotes.form_dict[key] = webnotes.form.getvalue(key) -# make the form_dict -for key in webnotes.form.keys(): - webnotes.form_dict[key] = webnotes.form.getvalue(key) + # init request + webnotes.http_request = webnotes.auth.HTTPRequest() -# url comes with sid, redirect to html, sid set and all -if 'sid' in webnotes.form_dict: - import webnotes.auth - import webnotes.widgets.page_body - - webnotes.auth.HTTPRequest() - - print "Content-Type: text/html" - - # print cookies, if there ar additional cookies defined during the request, add them here - if webnotes.cookies or webnotes.add_cookies: - for c in webnotes.add_cookies.keys(): - webnotes.cookies[c] = webnotes.add_cookies[c] - - print webnotes.cookies - - print - print webnotes.widgets.page_body.redirect_template % ('Redirecting...', 'index.html') - -else: - # pass on to legacy handler - import webnotes.handler +def respond(): + import webnotes + if 'cmd' in webnotes.form_dict: + webnotes.handler.handle() + else: + import webnotes.index + print "Content-Type: text/html" + webnotes.handler.print_cookies() + print + print webnotes.index.get() +if __name__=="__main__": + init() + respond() \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index a75f24af93..0000000000 --- a/index.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - ERPNext - - - - -
-
- -
- -
- Loading... -
-
- - -
- diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index 84f05453d5..0000000000 --- a/templates/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - ERPNext - - - - -
-
- -
- -
- Loading... -
-
- - -
- diff --git a/version.num b/version.num index 8bc94cb760..9573848579 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -276 \ No newline at end of file +326 \ No newline at end of file