{{ title }} {{days_to_go}} days to go
{% set bounty_progress = ((doc.bounty_collected/doc.goal)*100) %} --
{{ frappe.utils.fmt_money(doc.bounty_collected, currency="USD") }} - of {{ frappe.utils.fmt_money(doc.goal, currency="USD") }} - +
{{ fmt_money(doc.bounty_collected, currency="USD") }} + of {{ fmt_money(doc.goal, currency="USD") }} +
++ {{ no_of_backers }} +
+ -{{ doc.end_date }}
- -Back this bounty + ++
About this feature
+{{doc.description}}
+ +Discuss
{% include 'templates/includes/comments/comments.html' %} diff --git a/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html b/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html index c42a7bdf..632f974c 100644 --- a/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html +++ b/foundation/erpnext_foundation/doctype/bounty/templates/bounty_row.html @@ -2,9 +2,16 @@{{ doc.feature_name }}
- {{ frappe.format(doc.goal) }} + {{ fmt_money(doc.goal, currency="USD") }} {{ doc.end_date }} - {{ doc.bounty_backer }} Backers + + {{ doc.bounty_backer|len }} + {% if doc.bounty_backer|len > 1 %} + Backers + {% else %} + Backer + {% endif %} +
{{ html2text(doc.description[:200]) }}{% if doc.description|len > 200 %}...{% endif %}
diff --git a/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.js b/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.js index 7373ba61..8d110a16 100644 --- a/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.js +++ b/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.js @@ -1,15 +1,3 @@ frappe.ready(function() { - var bounty_name = getParameterByName('bounty'); - $('input[data-fieldname="bounty_name"]').val(bounty_name); - $('[data-fieldname="user"]').val(frappe.session.user); - function getParameterByName(name) { - var url = window.location.href; - name = name.replace(/[\[\]]/g, "\\$&"); - var regex = new RegExp("[?&]" + name + "(=([^]*)|&|#|$)"), - results = regex.exec(url); - if (!results) return null; - if (!results[2]) return ''; - return decodeURIComponent(results[2].replace(/\+/g, " ")); - } }) \ No newline at end of file diff --git a/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.json b/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.json index 0d9907d8..12b1d5c7 100644 --- a/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.json +++ b/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.json @@ -19,7 +19,7 @@ "is_standard": 1, "login_required": 1, "max_attachment_size": 0, - "modified": "2017-08-18 08:18:03.166262", + "modified": "2017-08-18 14:41:04.132808", "modified_by": "faris@erpnext.com", "module": "ERPNext Foundation", "name": "back-this-bounty", @@ -33,16 +33,6 @@ "success_url": "/bounty", "title": "Back this bounty", "web_form_fields": [ - { - "fieldname": "bounty_name", - "fieldtype": "Data", - "hidden": 0, - "label": "Bounty Name", - "max_length": 0, - "max_value": 0, - "read_only": 1, - "reqd": 0 - }, { "fieldname": "user", "fieldtype": "Link", @@ -54,6 +44,16 @@ "read_only": 1, "reqd": 0 }, + { + "fieldname": "bounty_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Bounty Name", + "max_length": 0, + "max_value": 0, + "read_only": 1, + "reqd": 0 + }, { "fieldname": "amount", "fieldtype": "Int", diff --git a/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.py b/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.py index d0064bde..2334f8b2 100644 --- a/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.py +++ b/foundation/erpnext_foundation/web_form/back_this_bounty/back_this_bounty.py @@ -3,6 +3,5 @@ from __future__ import unicode_literals import frappe def get_context(context): - print(context) - context.no_breadcrumbs = 1 - context.user = 'faris@erpnext.com' + # do your magic here + pass diff --git a/foundation/hooks.py b/foundation/hooks.py index dc08c7e4..6dda8aec 100644 --- a/foundation/hooks.py +++ b/foundation/hooks.py @@ -47,6 +47,7 @@ website_context = { {"label": "Services", "url": "/service-providers", "right": 1}, {"label": "Jobs", "url": "/erpnext-jobs", "right": 1}, {"label": "Chapters", "url": "/chapters", "right": 1}, + {"label": "Bounties", "url": "/bounty", "right": 1}, {"label": 'Conference', "url": "/conf/2017", "right": 1}, {"label": "About", "url": "/about", "right": 1}, ],