From 5a097372f53ac79c3a1a9589a6d045e3d39988c1 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Sun, 13 May 2018 16:05:04 +0530 Subject: [PATCH] [wip] --- foundation/hooks.py | 2 +- foundation/migrate.py | 93 +------ .../v0_0/change_website_to_website_url.py | 2 +- .../patches/v0_0/update_erpnext_job_route.py | 1 - .../templates/includes/footer/footer.html | 118 ++++----- foundation/www/about.html | 101 ++++++-- foundation/www/about.py | 7 - foundation/www/conf/index.html | 2 +- .../docs/assets/img/subscription/__init__.py | 0 foundation/www/get-started.html | 111 ++++---- foundation/www/index.html | 241 +++++++++--------- foundation/www/members/index.html | 65 +++-- foundation/www/service-providers.html | 97 +++---- 13 files changed, 405 insertions(+), 435 deletions(-) delete mode 100644 foundation/www/about.py create mode 100644 foundation/www/docs/assets/img/subscription/__init__.py diff --git a/foundation/hooks.py b/foundation/hooks.py index a9de06b1..6ca08fb6 100644 --- a/foundation/hooks.py +++ b/foundation/hooks.py @@ -39,7 +39,7 @@ home_page = "index" template_apps = ['foundation', 'frappe_theme', 'erpnext', 'frappe'] website_context = { # "navbar_search": 1, - "brand_html": "Oensource ERP SoftwareERPNext.org", + "brand_html": "Oensource ERP SoftwareERPNext.org", "top_bar_items": [ {"label": "About", "url": "/about", "right":1}, {"label": "Blog", "url": "/blog", "right":1}, diff --git a/foundation/migrate.py b/foundation/migrate.py index c0d0c0de..c6dec762 100644 --- a/foundation/migrate.py +++ b/foundation/migrate.py @@ -5,95 +5,4 @@ from markdown2 import markdown from frappe.utils import validate_email_add def migrate(): - frappe.flags.mute_emails = True - source = Database(user='5a0a48926f6a52c6', password='ihUTM3eN3JgVoyGp') - - users = source.sql('select * from tabUser', as_dict=1) - for u in users: - if validate_email_add(u.email.strip()) and not frappe.db.exists("User", u.email): - frappe.get_doc(dict( - doctype='User', - name=u.name, - first_name=u.first_name, - last_name=u.last_name, - email=u.email - )).insert(ignore_if_duplicate=True) - - auth_details = source.sql('select * from __Auth where name = %s', u.email, as_dict=1) - - if auth_details: - auth = auth_details[0] - - if not frappe.db.sql("select doctype from __Auth where name = %s", auth.name): - frappe.db.sql("""insert into __Auth - (doctype, name, fieldname, password, salt, encrypted) - values (%s, %s, %s, %s, %s, %s)""", - (auth.doctype, auth.name, auth.fieldname, auth.password, auth.salt, auth.encrypted)) - - print u.name - - frappe.db.sql('delete from `tabService Provider`') - partners = source.sql('select * from `tabFrappe Partner`', as_dict=True) - for p in partners: - d = frappe.get_doc(dict( - doctype='Service Provider', - title=p.partner_name, - country=p.country, - image=p.logo, - introduction=p.introduction, - details=markdown(p.description), - address=p.partner_address, - discuss_ids=p.community_members, - website=p.partner_website, - github_id=p.github_id, - owner=p.owner, - creation=p.creation, - email= p.email, - phone=p.phone, - route=p.route, - show_in_website=p.show_in_website - )).insert(ignore_if_duplicate=True, ignore_mandatory=True) - print d.name - - jobs = source.sql('select * from `tabFrappe Job`', as_dict=True) - frappe.db.sql('delete from `tabPortal Job`') - for j in jobs: - if not frappe.db.exists('Country', j.country): - frappe.get_doc(dict(doctype='Country', country_name=j.country)).insert() - d = frappe.get_doc(dict( - doctype='Portal Job', - title=j.job_title, - company_name=j.company_name, - country=j.country, - status='Open' if j.status=='Assigned' else j.status, - job_type={ - 'ERP Implementation': 'Implementation', - 'Core Development': 'Feature Development', - 'Website Development': 'Website Development', - 'Other': 'App Development' - }.get(j.job_type, None) or j.job_type, - description= markdown(j.job_detail), - owner=j.owner, - creation=j.creation, - route=j.route, - show_in_website=j.show_in_website - )).insert(ignore_if_duplicate=True, ignore_mandatory=True) - print d.name - - apps = source.sql('select * from `tabFrappe App`', as_dict=True) - frappe.db.sql('delete from `tabFrappe App`') - for a in apps: - d = frappe.get_doc(dict( - doctype='Frappe App', - app_name = a.app_name, - badge = a.badge, - category = a.category, - route = a.route, - url = a.url, - repository_url = a.repository_url, - published = 1, - description = markdown(a.description), - owner=a.owner, - creation=a.creation, - )).insert(ignore_if_duplicate=True, ignore_mandatory=True) - print d.name \ No newline at end of file + pass \ No newline at end of file diff --git a/foundation/patches/v0_0/change_website_to_website_url.py b/foundation/patches/v0_0/change_website_to_website_url.py index f51b98c4..056d7203 100644 --- a/foundation/patches/v0_0/change_website_to_website_url.py +++ b/foundation/patches/v0_0/change_website_to_website_url.py @@ -3,4 +3,4 @@ import frappe def execute(): frappe.db.sql(''' ALTER TABLE `tabFoundation Fellowship` CHANGE `website` `website_url` varchar(140); - ''') + ''', ignore_ddl = True) diff --git a/foundation/patches/v0_0/update_erpnext_job_route.py b/foundation/patches/v0_0/update_erpnext_job_route.py index 9e9be002..f52647cd 100644 --- a/foundation/patches/v0_0/update_erpnext_job_route.py +++ b/foundation/patches/v0_0/update_erpnext_job_route.py @@ -2,6 +2,5 @@ import frappe def execute(): for job in frappe.get_all("Portal Job"): - print job.name frappe.db.set_value("Portal Job", job.name, "route", "erpnext-job/{0}".format(job.name.encode('utf-8')), update_modified=False) \ No newline at end of file diff --git a/foundation/templates/includes/footer/footer.html b/foundation/templates/includes/footer/footer.html index 5af7ce85..677ba997 100644 --- a/foundation/templates/includes/footer/footer.html +++ b/foundation/templates/includes/footer/footer.html @@ -1,121 +1,120 @@ -