mirror of
https://github.com/erpnext/foundation.git
synced 2026-10-17 02:10:45 +02:00
@@ -6,7 +6,7 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe.website.website_generator import WebsiteGenerator
|
from frappe.website.website_generator import WebsiteGenerator
|
||||||
from frappe.website.utils import get_comment_list
|
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
|
from frappe.website.utils import get_comment_list
|
||||||
|
|
||||||
class Bounty(WebsiteGenerator):
|
class Bounty(WebsiteGenerator):
|
||||||
@@ -24,6 +24,9 @@ class Bounty(WebsiteGenerator):
|
|||||||
if bounty_left > (self.goal * 0.1) or bounty_left < 0:
|
if bounty_left > (self.goal * 0.1) or bounty_left < 0:
|
||||||
bounty_left = self.goal * 0.1
|
bounty_left = self.goal * 0.1
|
||||||
|
|
||||||
|
# edit permission
|
||||||
|
can_edit = self.owner == frappe.session.user
|
||||||
|
|
||||||
context.no_cache = True
|
context.no_cache = True
|
||||||
context.no_breadcrumbs = False
|
context.no_breadcrumbs = False
|
||||||
context.days_to_go = date_diff(self.end_date, nowdate())
|
context.days_to_go = date_diff(self.end_date, nowdate())
|
||||||
@@ -32,6 +35,7 @@ class Bounty(WebsiteGenerator):
|
|||||||
context.fmt_money = fmt_money
|
context.fmt_money = fmt_money
|
||||||
context.bounty_left = bounty_left
|
context.bounty_left = bounty_left
|
||||||
context.comment_list = get_comment_list(self.doctype, self.name)
|
context.comment_list = get_comment_list(self.doctype, self.name)
|
||||||
|
context.can_edit = can_edit
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
from frappe.utils.user import get_user_fullname
|
from frappe.utils.user import get_user_fullname
|
||||||
@@ -54,13 +58,16 @@ class Bounty(WebsiteGenerator):
|
|||||||
bounty_backers.append(backer)
|
bounty_backers.append(backer)
|
||||||
self.bounty_backer = bounty_backers
|
self.bounty_backer = bounty_backers
|
||||||
|
|
||||||
|
if not self.end_date:
|
||||||
|
self.end_date = add_months(nowdate(), 1)
|
||||||
|
|
||||||
def get_list_context(context):
|
def get_list_context(context):
|
||||||
context.allow_guest = True
|
context.allow_guest = True
|
||||||
context.no_cache = True
|
context.no_cache = True
|
||||||
context.title = 'ERPNext Bounties'
|
context.title = 'ERPNext Bounties'
|
||||||
context.no_breadcrumbs = True
|
context.no_breadcrumbs = True
|
||||||
context.order_by = 'creation desc'
|
context.order_by = 'creation desc'
|
||||||
context.introduction = '<a href="new-bounty" class="btn btn-primary">Start a new Bounty</a>'
|
context.introduction = '<div style="margin-bottom: 20px;"><a href="new-bounty" class="btn btn-primary">Start a new Bounty</a><a style="margin-left: 10px;" href="/bounties-faq">FAQ</a></div>'
|
||||||
context.fmt_money = fmt_money
|
context.fmt_money = fmt_money
|
||||||
context.get_paid_backers = get_paid_backers
|
context.get_paid_backers = get_paid_backers
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<div class="main">
|
<div class="main">
|
||||||
<h1>
|
<h1>
|
||||||
{{ title }}
|
{{ title }}
|
||||||
{% if doc.owner == frappe.session.user %}
|
{% if can_edit %}
|
||||||
<a href="/new-bounty?name={{doc.name}}" class="btn btn-default btn-xs">Edit</a>
|
<a href="/new-bounty?name={{doc.name}}" class="btn btn-default btn-xs">Edit</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span style="font-size: 14px; line-height: 44px;" class="pull-right small">{{days_to_go}} days to go</span>
|
<span style="font-size: 14px; line-height: 44px;" class="pull-right small">{{days_to_go}} days to go</span>
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
"login_required": 1,
|
"login_required": 1,
|
||||||
"max_attachment_size": 0,
|
"max_attachment_size": 0,
|
||||||
"modified": "2017-08-23 18:04:50.092049",
|
"modified": "2017-08-29 13:03:00.918927",
|
||||||
"modified_by": "faris@erpnext.com",
|
"modified_by": "Administrator",
|
||||||
"module": "ERPNext Foundation",
|
"module": "ERPNext Foundation",
|
||||||
"name": "start-a-new-bounty",
|
"name": "start-a-new-bounty",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
@@ -45,22 +45,12 @@
|
|||||||
"fieldname": "goal",
|
"fieldname": "goal",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"label": "Goal",
|
"label": "Goal (in USD)",
|
||||||
"max_length": 0,
|
"max_length": 0,
|
||||||
"max_value": 0,
|
"max_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"reqd": 1
|
"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",
|
"fieldname": "description",
|
||||||
"fieldtype": "Text Editor",
|
"fieldtype": "Text Editor",
|
||||||
|
|||||||
40
foundation/www/bounties-faq.md
Normal file
40
foundation/www/bounties-faq.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
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?
|
||||||
|
|
||||||
|
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. 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 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.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 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.
|
||||||
Reference in New Issue
Block a user