diff --git a/foundation/__init__.py b/foundation/__init__.py index 95d1338e..09722870 100644 --- a/foundation/__init__.py +++ b/foundation/__init__.py @@ -3,3 +3,19 @@ from __future__ import unicode_literals __version__ = '0.0.1' +from frappe.utils import getdate +import frappe + +def get_last_membership(): + '''Returns last membership if exists''' + last_membership = frappe.get_all('Membership', 'name,to_date,membership_type', + dict(member=frappe.session.user), order_by='to_date desc', limit=1) + + return last_membership and last_membership[0] + +def is_member(): + '''Returns true if the user is still a member''' + last_membership = get_last_membership() + if last_membership and getdate(last_membership.to_date) > getdate(): + return True + return False \ No newline at end of file diff --git a/foundation/templates/generators/__init__.py b/foundation/erpnext_foundation/doctype/frappe_app/__init__.py similarity index 100% rename from foundation/templates/generators/__init__.py rename to foundation/erpnext_foundation/doctype/frappe_app/__init__.py diff --git a/foundation/erpnext_foundation/doctype/frappe_app/frappe_app.js b/foundation/erpnext_foundation/doctype/frappe_app/frappe_app.js new file mode 100644 index 00000000..97eaab5b --- /dev/null +++ b/foundation/erpnext_foundation/doctype/frappe_app/frappe_app.js @@ -0,0 +1,8 @@ +// Copyright (c) 2017, EOSSF and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Frappe App', { + refresh: function(frm) { + + } +}); diff --git a/foundation/erpnext_foundation/doctype/frappe_app/frappe_app.json b/foundation/erpnext_foundation/doctype/frappe_app/frappe_app.json new file mode 100644 index 00000000..6d9b900f --- /dev/null +++ b/foundation/erpnext_foundation/doctype/frappe_app/frappe_app.json @@ -0,0 +1,330 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 1, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:app_name", + "beta": 0, + "creation": "2017-03-06 14:32:24.677299", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "app_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 1, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "App Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "category", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Category", + "length": 0, + "no_copy": 0, + "options": "Domains\nDeveloper Tools\nFeature\nIntegrations\nPortal\nRegional Extensions", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "publisher", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 1, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Publisher", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "repository_url", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Repository URL", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "Community", + "fieldname": "badge", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Badge", + "length": 0, + "no_copy": 0, + "options": "Community\nOfficial\nExperimental", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "description", + "fieldtype": "Text Editor", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 1, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "url", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "URL", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "route", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Route", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "published", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Published", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + } + ], + "has_web_view": 1, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_published_field": "published", + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2017-03-06 15:55:42.139035", + "modified_by": "Administrator", + "module": "ERPNext Foundation", + "name": "Frappe App", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "route": "/apps", + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "title_field": "app_name", + "track_changes": 1, + "track_seen": 0 +} \ No newline at end of file diff --git a/foundation/erpnext_foundation/doctype/frappe_app/frappe_app.py b/foundation/erpnext_foundation/doctype/frappe_app/frappe_app.py new file mode 100644 index 00000000..9ee9e927 --- /dev/null +++ b/foundation/erpnext_foundation/doctype/frappe_app/frappe_app.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2017, EOSSF and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.website.website_generator import WebsiteGenerator + +class FrappeApp(WebsiteGenerator): + def validate(self): + if not self.route: + self.route = 'apps/' + self.scrub(self.app_name) + + def get_context(self, context): + context.parents = [dict(label='All Apps', route='apps')] + + +def get_list_context(context): + context.no_breadcrumbs = True + context.title = 'Apps / Extensions for ERPNext' \ No newline at end of file diff --git a/foundation/erpnext_foundation/doctype/frappe_app/templates/frappe_app.html b/foundation/erpnext_foundation/doctype/frappe_app/templates/frappe_app.html new file mode 100644 index 00000000..68c27bec --- /dev/null +++ b/foundation/erpnext_foundation/doctype/frappe_app/templates/frappe_app.html @@ -0,0 +1,48 @@ +{% extends "templates/web.html" %} + +{% block page_content %} +
| Code | +{{ repository_url }} | +
| Website | +{{ url }} | +
bench get-app {{ repository_url }}
+bench --site [yoursite] install-app {{ repository_url.split('/')[-1] }}
+
+
+Note: +
+ {{ doc.badge }} + {{ doc.category }} +
+ +{% endblock %} + + \ No newline at end of file diff --git a/foundation/erpnext_foundation/doctype/frappe_app/templates/frappe_app_row.html b/foundation/erpnext_foundation/doctype/frappe_app/templates/frappe_app_row.html new file mode 100644 index 00000000..cf912a9c --- /dev/null +++ b/foundation/erpnext_foundation/doctype/frappe_app/templates/frappe_app_row.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/foundation/erpnext_foundation/doctype/frappe_app/test_frappe_app.py b/foundation/erpnext_foundation/doctype/frappe_app/test_frappe_app.py new file mode 100644 index 00000000..e4d93932 --- /dev/null +++ b/foundation/erpnext_foundation/doctype/frappe_app/test_frappe_app.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2017, EOSSF and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +class TestFrappeApp(unittest.TestCase): + pass diff --git a/foundation/erpnext_foundation/doctype/membership/membership.json b/foundation/erpnext_foundation/doctype/membership/membership.json index 54134e8d..06b3d66c 100644 --- a/foundation/erpnext_foundation/doctype/membership/membership.json +++ b/foundation/erpnext_foundation/doctype/membership/membership.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, "autoname": "M-.YY.-.####", @@ -219,17 +220,17 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-03-02 11:48:11.912727", + "modified": "2017-03-07 16:44:47.066560", "modified_by": "Administrator", "module": "ERPNext Foundation", "name": "Membership", diff --git a/foundation/erpnext_foundation/doctype/membership/membership.py b/foundation/erpnext_foundation/doctype/membership/membership.py index 785e91a5..329ca10b 100644 --- a/foundation/erpnext_foundation/doctype/membership/membership.py +++ b/foundation/erpnext_foundation/doctype/membership/membership.py @@ -7,6 +7,7 @@ import frappe from frappe.model.document import Document from frappe.utils import add_days, add_years, nowdate, getdate from frappe import _ +import foundation class Membership(Document): def validate(self): @@ -24,15 +25,14 @@ class Membership(Document): self.member = member_name # get last membership (if active) - last_membership = frappe.get_all('Membership', 'name,to_date', dict(member=member_name), - order_by='to_date desc', limit=1) + last_membership = foundation.get_last_membership() if last_membership: # if last membership does not expire in 30 days, then do not allow to renew - if getdate(add_days(last_membership[-1].to_date, -30)) > getdate(nowdate()): + if getdate(add_days(last_membership.to_date, -30)) > getdate(nowdate()): frappe.throw(_('You can only renew if your membership expires within 30 days')) - self.from_date = add_days(last_membership[-1].to_date, 1) + self.from_date = add_days(last_membership.to_date, 1) else: self.from_date = nowdate() diff --git a/foundation/erpnext_foundation/doctype/portal_event/portal_event.json b/foundation/erpnext_foundation/doctype/portal_event/portal_event.json index 44d2fb27..f3e1e4ce 100644 --- a/foundation/erpnext_foundation/doctype/portal_event/portal_event.json +++ b/foundation/erpnext_foundation/doctype/portal_event/portal_event.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 1, "allow_import": 0, "allow_rename": 0, "autoname": "field:event_title", @@ -23,7 +24,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_global_search": 0, + "in_global_search": 1, "in_list_view": 0, "in_standard_filter": 0, "label": "Event Title", @@ -99,6 +100,35 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "details", + "fieldtype": "Text Editor", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 1, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Details", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -156,48 +186,20 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "details", - "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Details", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 } ], + "has_web_view": 1, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, "image_view": 0, "in_create": 0, - "in_dialog": 0, + "is_published_field": "published", "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-03-02 15:18:47.126672", + "modified": "2017-03-06 16:05:19.014553", "modified_by": "Administrator", "module": "ERPNext Foundation", "name": "Portal Event", @@ -228,9 +230,11 @@ "quick_entry": 1, "read_only": 0, "read_only_onload": 0, + "route": "events", "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", + "title_field": "event_title", "track_changes": 1, "track_seen": 0 } \ No newline at end of file diff --git a/foundation/erpnext_foundation/doctype/portal_event/portal_event.py b/foundation/erpnext_foundation/doctype/portal_event/portal_event.py index 0df6e376..bd2553ba 100644 --- a/foundation/erpnext_foundation/doctype/portal_event/portal_event.py +++ b/foundation/erpnext_foundation/doctype/portal_event/portal_event.py @@ -8,13 +8,21 @@ import frappe from frappe.website.website_generator import WebsiteGenerator class PortalEvent(WebsiteGenerator): + _website = dict( + page_title_field = 'event_title' + ) def validate(self): if not self.route: self.route = 'events/' + self.scrub(self.event_title) + def get_context(self, context): + context.parents = [dict(label='All Events', + route='/events')] + + def get_list_context(context): + context.allow_guest = True context.title = 'Upcoming Events' context.no_breadcrumbs = True - context.row_template = 'foundation/templates/includes/portal_event.html' context.order_by = 'creation desc' context.introduction = '' diff --git a/foundation/templates/generators/portal_event.html b/foundation/erpnext_foundation/doctype/portal_event/templates/doctype.html similarity index 100% rename from foundation/templates/generators/portal_event.html rename to foundation/erpnext_foundation/doctype/portal_event/templates/doctype.html diff --git a/foundation/erpnext_foundation/doctype/portal_event/templates/portal_event.html b/foundation/erpnext_foundation/doctype/portal_event/templates/portal_event.html new file mode 100644 index 00000000..fe8bdccf --- /dev/null +++ b/foundation/erpnext_foundation/doctype/portal_event/templates/portal_event.html @@ -0,0 +1,14 @@ +{% extends "templates/web.html" %} + +{% block page_content %} ++ {{ doc.place }} + {{ frappe.format_date(date) }} +
+{% endblock %} diff --git a/foundation/erpnext_foundation/doctype/portal_event/templates/portal_event_row.html b/foundation/erpnext_foundation/doctype/portal_event/templates/portal_event_row.html new file mode 100644 index 00000000..29730919 --- /dev/null +++ b/foundation/erpnext_foundation/doctype/portal_event/templates/portal_event_row.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/foundation/erpnext_foundation/doctype/portal_job/portal_job.json b/foundation/erpnext_foundation/doctype/portal_job/portal_job.json index 08a28518..8d045c28 100644 --- a/foundation/erpnext_foundation/doctype/portal_job/portal_job.json +++ b/foundation/erpnext_foundation/doctype/portal_job/portal_job.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 1, "allow_import": 0, "allow_rename": 0, "beta": 0, @@ -22,7 +23,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_global_search": 0, + "in_global_search": 1, "in_list_view": 0, "in_standard_filter": 0, "label": "Title", @@ -110,7 +111,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_global_search": 0, + "in_global_search": 1, "in_list_view": 0, "in_standard_filter": 0, "label": "Description", @@ -278,17 +279,18 @@ "unique": 0 } ], + "has_web_view": 1, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, "image_view": 0, "in_create": 0, - "in_dialog": 0, + "is_published_field": "show_in_website", "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-02-28 15:08:29.884966", + "modified": "2017-03-06 16:04:54.620681", "modified_by": "Administrator", "module": "ERPNext Foundation", "name": "Portal Job", @@ -319,6 +321,7 @@ "quick_entry": 1, "read_only": 0, "read_only_onload": 0, + "route": "/jobs", "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", diff --git a/foundation/erpnext_foundation/doctype/portal_job/portal_job.py b/foundation/erpnext_foundation/doctype/portal_job/portal_job.py index 1d843811..d9d9cf94 100644 --- a/foundation/erpnext_foundation/doctype/portal_job/portal_job.py +++ b/foundation/erpnext_foundation/doctype/portal_job/portal_job.py @@ -5,19 +5,21 @@ from __future__ import unicode_literals import frappe from frappe.website.website_generator import WebsiteGenerator +import foundation class PortalJob(WebsiteGenerator): - _website = dict( - condition_field = "show_in_website", - template = "templates/generators/portal_job.html" - ) + def get_context(self, context): + context.parents = [dict(label='View All Jobs', + route='jobs')] + context.is_member = foundation.is_member() + def validate(self): if not self.route: self.route = 'jobs/' + self.scrub(self.title) def get_list_context(context): + context.allow_guest = True context.title = 'ERPNext Jobs' context.no_breadcrumbs = True - context.row_template = 'foundation/templates/includes/portal_job.html' context.order_by = 'creation desc' context.introduction = 'Become an ERPNext Foundation member to view contact details
+Become an ERPNext Foundation member to view contact details
{% endif %} {% endblock %} \ No newline at end of file diff --git a/foundation/erpnext_foundation/doctype/portal_job/templates/portal_job_row.html b/foundation/erpnext_foundation/doctype/portal_job/templates/portal_job_row.html new file mode 100644 index 00000000..10312547 --- /dev/null +++ b/foundation/erpnext_foundation/doctype/portal_job/templates/portal_job_row.html @@ -0,0 +1,11 @@ + diff --git a/foundation/erpnext_foundation/doctype/service_provider/service_provider.json b/foundation/erpnext_foundation/doctype/service_provider/service_provider.json index 30fa657d..f2c23ee6 100644 --- a/foundation/erpnext_foundation/doctype/service_provider/service_provider.json +++ b/foundation/erpnext_foundation/doctype/service_provider/service_provider.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 1, "allow_import": 0, "allow_rename": 0, "autoname": "field:title", @@ -313,7 +314,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_global_search": 0, + "in_global_search": 1, "in_list_view": 0, "in_standard_filter": 0, "label": "Introduction", @@ -342,7 +343,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_global_search": 0, + "in_global_search": 1, "in_list_view": 0, "in_standard_filter": 0, "label": "Details", @@ -505,18 +506,19 @@ "unique": 0 } ], + "has_web_view": 1, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, "image_field": "image", "image_view": 0, "in_create": 0, - "in_dialog": 0, + "is_published_field": "show_in_website", "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-02-27 11:42:44.665961", + "modified": "2017-03-06 16:04:35.370822", "modified_by": "Administrator", "module": "ERPNext Foundation", "name": "Service Provider", diff --git a/foundation/erpnext_foundation/doctype/service_provider/service_provider.py b/foundation/erpnext_foundation/doctype/service_provider/service_provider.py index 7e768050..30371ec2 100644 --- a/foundation/erpnext_foundation/doctype/service_provider/service_provider.py +++ b/foundation/erpnext_foundation/doctype/service_provider/service_provider.py @@ -9,12 +9,13 @@ from frappe.website.website_generator import WebsiteGenerator class ServiceProvider(WebsiteGenerator): _website = frappe._dict( condition_field = "show_in_website", - template = "templates/generators/service_provider.html" ) def validate(self): if not self.route: self.route = 'service-providers/' + self.scrub(self.name) def get_context(self, context): + context.parents = [dict(label='All Service Providers in {0}'.format(self.country), + route='service-providers?country={0}'.format(self.country))] if not context.website.startswith('http'): context.website = 'http://' + context.website \ No newline at end of file diff --git a/foundation/erpnext_foundation/doctype/service_provider/templates/service_provider.html b/foundation/erpnext_foundation/doctype/service_provider/templates/service_provider.html new file mode 100644 index 00000000..4418f71b --- /dev/null +++ b/foundation/erpnext_foundation/doctype/service_provider/templates/service_provider.html @@ -0,0 +1,53 @@ +{% extends "templates/web.html" %} + +{% from "foundation/templates/includes/macros.html" import media %} + +{% block page_content %} +| Country | +{{ country }} | +
| Address | +{{ (address or '').replace('\n', ' ') }} |
+ Phone | +{{ phone }} | + + ++ {{ email }} | + + +Website | +{{ website }} | + +
- All ERPNext Serivce Providers in {{ country }}
-| Country | -{{ country }} | -
| Address | -{{ address.replace('\n', ' ') }} |
- Phone | -{{ phone }} | - - -{{ email }} | - - -Website | -{{ website }} | - -
{{ doc.place }} | {{ frappe.format_date(date) }}
-{{ html2text(doc.description[:200]) }}{% if doc.description|len > 200 %}...{% endif %}
-{{ doc.country }} | {{ doc.job_type }}
-{{ html2text(doc.description[:200]) }}{% if doc.description|len > 200 %}...{% endif %}
-Want to talk to someone in the foundation? Get in touch
+ {% endblock %} diff --git a/foundation/www/index.html b/foundation/www/index.html index aeba309c..fa096921 100644 --- a/foundation/www/index.html +++ b/foundation/www/index.html @@ -10,32 +10,16 @@Free and Open Source Business Software for Millions of Entrepreneurs Worldwide
-ERPNext is a modern, fully featured open source Enterprise Resource Planning (ERP) system that is designed for small and medium sized businesses. -
ERPNext is a modern, fully featured open source Enterprise Resource Planning (ERP) system that is designed for small and medium sized businesses that includes modules to help you manage Financial Accounting, Sales and CRM, Billing, Manufacturing, Inventory, HR and Payroll, Projects, E-Commerce and much more.
+ +ERPNext Foundation is a not-for-profit company registered with the objective of building and enhancing ERPNext as an open source project. The ERPNext Foundation is funded by annual memberships of individuals and companies who use ERPNext or support it.
- - -If you are looking to self host ERPNext, you should start with a remote Virtual Machine (VM) and install ERPNext using the Easy Install Script.
-Alternatively you can download the Virtual Machine and run it on your desktop
-You can also sign up for a free one user account on ERPNext hosting services like erpnext.com
-ERPNext is built by feedback and contributions of hundreds of companies and developers and is backed by an active community. Be a part of the community that shapes ERPNext and help millions of small businesses get the software they deserve.
- -You must first sign up and login to become a member
- +You must first sign up and login to become a member
+ +You have never been a member of ERPNext Foundation. Click on the button below to start a new membership
-{% elif frappe.utils.getdate(last_membership[-1].to_date) < frappe.utils.getdate(frappe.utils.nowdate()) %} + +{% elif frappe.utils.getdate(last_membership.to_date) < frappe.utils.getdate(frappe.utils.nowdate()) %}Your Membership has expired, Click the button below to start a new membership
-{% elif frappe.utils.getdate(frappe.utils.add_days(last_membership[-1].to_date, -30)) < frappe.utils.getdate(frappe.utils.nowdate())%} + +{% elif frappe.utils.getdate(frappe.utils.add_days(last_membership.to_date, -30)) < frappe.utils.getdate(frappe.utils.nowdate())%}Your Membership is due to expire soon. Click on the button below to renew
+ {% else %} -Welcome back {{ last_membership[-1].membership_type }} Member!
-Your membership is due to expire on {{ frappe.format_date(last_membership[-1].to_date) }}. +
Welcome back {{ last_membership.membership_type }} Member!
+Your membership is due to expire on {{ frappe.format_date(last_membership.to_date) }}.
{% endif %} diff --git a/foundation/www/members/details.py b/foundation/www/members/details.py index 3655db83..2e078a51 100644 --- a/foundation/www/members/details.py +++ b/foundation/www/members/details.py @@ -1,7 +1,7 @@ import frappe +import foundation def get_context(context): if frappe.session.user != 'Guest': context.show_sidebar = True - context.last_membership = frappe.get_all('Membership', 'name,to_date,membership_type', - dict(member=frappe.session.user), order_by='to_date desc', limit=1) + context.last_membership = foundation.get_last_membership() diff --git a/foundation/www/members/index.html b/foundation/www/members/index.html index 338571e0..43d8622a 100644 --- a/foundation/www/members/index.html +++ b/foundation/www/members/index.html @@ -14,19 +14,19 @@
The ERPNext Foundation aims to be driven by its members. By becoming a members, you get
a preferred listing on the ERPNext Job Board and access to incoming requests for implementation
- and customization jobs
+ and customization jobs
Information to help you get started on ERPNext
There are many ways you can start using ERPNext, either on your own machine or on a remote machine or on the cloud.
+ + {{ media("Download Virtual Machine", "Use ERPNext on your current machine by downloading the pre-set Virtual Machine. The Virtual Machine is updated daily and contains both the developer and production versions", + "manual.png", "https://erpnext.com/download") }} + + {{ media("Install and Setup Bench", "Bench is the tool you need to setup and manage ERPNext instances on your machine. To start a fresh install on a new machine or VM, just run the bench easy install on a fresh Linux installation (Ubuntu/CentOS/Debian). Warning: You need to be familiar with the Linux command line", + "manual.png", "https://github.com/frappe/bench") }} + + {{ media("Sign up on ERPNext.com", "ERPNext.com offers 1 user free for unlimited time. It is a great way to quickly evaluate ERPNext for the first time.", + "manual.png", "https://erpnext.com/pricing") }} + +ERPNext is easy to get started, if you are looking for specific functionality, dive into the user manual, or just search using your favorite search engine
{{ media("User Manual", "Deep dive into ERPNext functionality with the ERPNext manual. Covers all issues regarding setup, operations and customizations", "manual.png", "https://frappe.github.io/erpnext/user") }} diff --git a/foundation/www/service-providers.html b/foundation/www/service-providers.html index 21dfe13c..d9330ba2 100644 --- a/foundation/www/service-providers.html +++ b/foundation/www/service-providers.html @@ -4,7 +4,7 @@ {% macro gold_member(m) %}