From c469f96c2b178e5b9fad74260390a778e9c36218 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 29 Aug 2017 13:34:33 +0530 Subject: [PATCH 1/5] Add FAQ page, set end_date to 30 days --- .../doctype/bounty/bounty.py | 7 ++-- .../start_a_new_bounty.json | 16 ++-------- foundation/www/bounties-faq.md | 32 +++++++++++++++++++ 3 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 foundation/www/bounties-faq.md diff --git a/foundation/erpnext_foundation/doctype/bounty/bounty.py b/foundation/erpnext_foundation/doctype/bounty/bounty.py index 25c3c708..710b39b1 100644 --- a/foundation/erpnext_foundation/doctype/bounty/bounty.py +++ b/foundation/erpnext_foundation/doctype/bounty/bounty.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import frappe from frappe.website.website_generator import WebsiteGenerator from frappe.website.utils import get_comment_list -from frappe.utils import date_diff, nowdate, fmt_money +from frappe.utils import date_diff, nowdate, fmt_money, add_months from frappe.website.utils import get_comment_list class Bounty(WebsiteGenerator): @@ -54,13 +54,16 @@ class Bounty(WebsiteGenerator): bounty_backers.append(backer) self.bounty_backer = bounty_backers + if not self.end_date: + self.end_date = add_months(nowdate(), 1) + def get_list_context(context): context.allow_guest = True context.no_cache = True context.title = 'ERPNext Bounties' context.no_breadcrumbs = True context.order_by = 'creation desc' - context.introduction = 'Start a new Bounty' + context.introduction = '
Start a new BountyFAQ
' context.fmt_money = fmt_money context.get_paid_backers = get_paid_backers diff --git a/foundation/erpnext_foundation/web_form/start_a_new_bounty/start_a_new_bounty.json b/foundation/erpnext_foundation/web_form/start_a_new_bounty/start_a_new_bounty.json index 227756fc..7d35360d 100644 --- a/foundation/erpnext_foundation/web_form/start_a_new_bounty/start_a_new_bounty.json +++ b/foundation/erpnext_foundation/web_form/start_a_new_bounty/start_a_new_bounty.json @@ -18,8 +18,8 @@ "is_standard": 1, "login_required": 1, "max_attachment_size": 0, - "modified": "2017-08-23 18:04:50.092049", - "modified_by": "faris@erpnext.com", + "modified": "2017-08-29 13:03:00.918927", + "modified_by": "Administrator", "module": "ERPNext Foundation", "name": "start-a-new-bounty", "owner": "Administrator", @@ -45,22 +45,12 @@ "fieldname": "goal", "fieldtype": "Data", "hidden": 0, - "label": "Goal", + "label": "Goal (in USD)", "max_length": 0, "max_value": 0, "read_only": 0, "reqd": 1 }, - { - "fieldname": "end_date", - "fieldtype": "Date", - "hidden": 0, - "label": "End Date", - "max_length": 0, - "max_value": 0, - "read_only": 0, - "reqd": 0 - }, { "fieldname": "description", "fieldtype": "Text Editor", diff --git a/foundation/www/bounties-faq.md b/foundation/www/bounties-faq.md new file mode 100644 index 00000000..c5016a55 --- /dev/null +++ b/foundation/www/bounties-faq.md @@ -0,0 +1,32 @@ +# ERPNext Bounties FAQ + +### 1. What is ERPNext Bounties? + +ERPNext Bounties is the feature funding platform for development of ERPNext. Users can help improve this project by creating/backing bounties and pledging to fundraisers. + +--- + +### 2. How does it work? +> You need to have an account on https://erpnext.org, if you don't have one create one [here](https://erpnext.org/login#signup). + +You can start a new bounty by going to our [Bounties](https://erpnext.org/bounties) page. Enter the Bounty Title and set an achievable goal (in USD). Make sure to write a detailed description of the feature you are adding, so that it is easier for developers to understand the requirement who would later take on the bounty. A page will be created for this bounty where all these information will be listed. + +--- + +### 3. How do I contribute? + +After the bounty is created, you (and others) can back it by going to the Bounty page. We have 2 payments options, PayPal and Razorpay for International and Indian participants respectively. People can also discuss about the feature and provide feedback. + +--- + +### 4. What if the goal is not reached? + +If the goal is not reached, the bounty will be closed. Each participant who backed the bounty will have their amount refunded in full. + +But if any developer is happy with the Bounty Amount collected so far and is ready to start the development, it will not be closed. + +--- + +### 5. How to track the development of the feature? + +There is an option of linking the bounty to a GitHub Issue. You can see it on the Bounty page. \ No newline at end of file From d8a6e034d1a2167e7b6c28776f71df7e7918c455 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 29 Aug 2017 13:58:59 +0530 Subject: [PATCH 2/5] update faq --- foundation/www/bounties-faq.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/foundation/www/bounties-faq.md b/foundation/www/bounties-faq.md index c5016a55..e15412a6 100644 --- a/foundation/www/bounties-faq.md +++ b/foundation/www/bounties-faq.md @@ -19,7 +19,13 @@ After the bounty is created, you (and others) can back it by going to the Bounty --- -### 4. What if the goal is not reached? +### 4. I am a developer. How do I pitch for the Bounty? + +You can indicate your interest in taking on the bounty in the discussion section of the Bounty page. Once the goal is reached, you can start development of the feature by sending pull requests against the GitHub Issue for this feature. + +--- + +### 5. What if the goal is not reached? If the goal is not reached, the bounty will be closed. Each participant who backed the bounty will have their amount refunded in full. @@ -27,6 +33,6 @@ But if any developer is happy with the Bounty Amount collected so far and is rea --- -### 5. How to track the development of the feature? +### 6. How to track the development of the feature? There is an option of linking the bounty to a GitHub Issue. You can see it on the Bounty page. \ No newline at end of file From 15ef5ca554c1ffd0911cfbb939c3946cd6b4d29c Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 30 Aug 2017 11:43:48 +0530 Subject: [PATCH 3/5] update faq --- foundation/www/bounties-faq.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/foundation/www/bounties-faq.md b/foundation/www/bounties-faq.md index e15412a6..83de2a5e 100644 --- a/foundation/www/bounties-faq.md +++ b/foundation/www/bounties-faq.md @@ -11,6 +11,8 @@ ERPNext Bounties is the feature funding platform for development of ERPNext. Use You can start a new bounty by going to our [Bounties](https://erpnext.org/bounties) page. Enter the Bounty Title and set an achievable goal (in USD). Make sure to write a detailed description of the feature you are adding, so that it is easier for developers to understand the requirement who would later take on the bounty. A page will be created for this bounty where all these information will be listed. +These bounties will be moderated by the Frappé Team and other foundation members. Their details can also be edited as they see fit. + --- ### 3. How do I contribute? @@ -27,7 +29,7 @@ You can indicate your interest in taking on the bounty in the discussion section ### 5. What if the goal is not reached? -If the goal is not reached, the bounty will be closed. Each participant who backed the bounty will have their amount refunded in full. +If the goal is not reached, the bounty will be remain open until the moderators decide whether it should be closed. In that case, each participant who backed the bounty will have their amount refunded in full. But if any developer is happy with the Bounty Amount collected so far and is ready to start the development, it will not be closed. From 21fe63a52447098ffa4b9675438dffda47246d66 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 30 Aug 2017 11:57:21 +0530 Subject: [PATCH 4/5] Add edit permission to System Managers --- foundation/erpnext_foundation/doctype/bounty/bounty.py | 6 ++++++ .../erpnext_foundation/doctype/bounty/templates/bounty.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/foundation/erpnext_foundation/doctype/bounty/bounty.py b/foundation/erpnext_foundation/doctype/bounty/bounty.py index 710b39b1..a7bb06c3 100644 --- a/foundation/erpnext_foundation/doctype/bounty/bounty.py +++ b/foundation/erpnext_foundation/doctype/bounty/bounty.py @@ -24,6 +24,11 @@ class Bounty(WebsiteGenerator): if bounty_left > (self.goal * 0.1) or bounty_left < 0: bounty_left = self.goal * 0.1 + # edit permission + can_edit = False + if 'System Manager' in frappe.get_roles() or self.owner == frappe.session.user: + can_edit = True + context.no_cache = True context.no_breadcrumbs = False context.days_to_go = date_diff(self.end_date, nowdate()) @@ -32,6 +37,7 @@ class Bounty(WebsiteGenerator): context.fmt_money = fmt_money context.bounty_left = bounty_left context.comment_list = get_comment_list(self.doctype, self.name) + context.can_edit = can_edit def validate(self): from frappe.utils.user import get_user_fullname diff --git a/foundation/erpnext_foundation/doctype/bounty/templates/bounty.html b/foundation/erpnext_foundation/doctype/bounty/templates/bounty.html index 98dc311d..48b98485 100644 --- a/foundation/erpnext_foundation/doctype/bounty/templates/bounty.html +++ b/foundation/erpnext_foundation/doctype/bounty/templates/bounty.html @@ -33,7 +33,7 @@

{{ title }} - {% if doc.owner == frappe.session.user %} + {% if can_edit %} Edit {% endif %} {{days_to_go}} days to go From 0362cb1222484b1853813c2681d24e7a1e9abb52 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 30 Aug 2017 12:04:48 +0530 Subject: [PATCH 5/5] revert --- foundation/erpnext_foundation/doctype/bounty/bounty.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/foundation/erpnext_foundation/doctype/bounty/bounty.py b/foundation/erpnext_foundation/doctype/bounty/bounty.py index a7bb06c3..17055b13 100644 --- a/foundation/erpnext_foundation/doctype/bounty/bounty.py +++ b/foundation/erpnext_foundation/doctype/bounty/bounty.py @@ -25,9 +25,7 @@ class Bounty(WebsiteGenerator): bounty_left = self.goal * 0.1 # edit permission - can_edit = False - if 'System Manager' in frappe.get_roles() or self.owner == frappe.session.user: - can_edit = True + can_edit = self.owner == frappe.session.user context.no_cache = True context.no_breadcrumbs = False