[new] Fixed Bounty Creation Issue

This commit is contained in:
Vishal
2017-10-09 15:31:52 +05:30
parent 1ec8287a51
commit 9d8ef5adbe
3 changed files with 14 additions and 13 deletions

View File

@@ -37,6 +37,7 @@ class Bounty(WebsiteGenerator):
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
@@ -70,14 +71,14 @@ def get_list_context(context):
context.introduction = '''
<div style="margin-bottom: 20px;">
<a href="new-bounty" class="btn btn-primary">
Start a new Bounty</a>
Start a new bounty</a>
</div>'''
context.list_footer = '''
<p><a class='text-muted small'
href="/bounties-faq">Bounty FAQ</a></p>
'''
context.fmt_money = fmt_money
context.get_paid_backers = get_paid_backers
def get_paid_backers(backers):
return [backer for backer in backers if backer.paid]

View File

@@ -107,6 +107,7 @@
<p>
<h6 class="text-muted uppercase">About this feature</h6>
<p>{{doc.description}}</p>
<p class="text-muted">Created by {{doc.owner}} </p>
</p>
<p>
<p><a href="/bounties-faq" class='text-muted'>Bounties FAQ</a></p>

View File

@@ -13,19 +13,18 @@
<p>
<span class="label">{{ fmt_money(doc.goal, currency="USD") }}</span>
{% if comments %}
<span class="label">{{ comments }} <i
class='octicon octicon-comment-discussion'></i></span>
<span class="label">{{ comments }} <i
class='octicon octicon-comment-discussion'></i></span>
{% endif %}
{% set paid_backers = get_paid_backers(doc.bounty_backer) %}
{% if paid_backers|len > 0 %}
<span class="label">
{{ paid_backers|len }}
{% if paid_backers|len > 1 %}
Backers
{% else %}
Backer
{% endif %}
</span>
<span class="label">
{{ paid_backers|len }}
{% if paid_backers|len > 1 %}
Backers
{% else %}
Backer
{% endif %}
</span>
{% endif %}
</p>
<p>{{ html2text(doc.description[:200]) }}{% if doc.description|len > 200 %}...{% endif %}</p>