Пример #1
0
def viewIssue(request, issue_id):
    issue = Issue.objects.get(pk=issue_id)
    myoffer = None
    mysolution = None
    show_alert = None

    if (request.user.is_authenticated()):
        myoffer = get_or_none(Offer,
                              issue=issue,
                              sponsor=request.user,
                              status__in=[Offer.OPEN, Offer.REVOKED])
        mysolution = get_or_none(Solution,
                                 issue=issue,
                                 programmer=request.user)

    show_sponsor_popup = (request.GET.get('show_sponsor') == 'true')
    alert = request.GET.get('alert')
    if alert == 'KICKSTART':
        show_alert = template_folder(
            request) + 'popup/popup_just_kickstarted.html'
    if alert == 'SPONSOR':
        show_alert = template_folder(
            request) + 'popup/popup_just_sponsored.html'
    alert_reputation_revoking = mysolution and mysolution.status == Solution.IN_PROGRESS and mysolution.get_received_payments(
    ).count() > 0

    invoke_parent_callback = (request.GET.get('c') == 's')

    is_watching = request.user.is_authenticated(
    ) and watch_services.is_watching_issue(request.user, issue.id)
    crumbs = [
        HOME_CRUMB, {
            'link': issue.trackerURL,
            'name': 'issue: ' + issue.title,
            'blank': True,
        }
    ]

    context = {
        'issue': issue,
        'is_watching': is_watching,
        'myoffer': myoffer,
        'mysolution': mysolution,
        'invoke_parent_callback': invoke_parent_callback,
        'show_sponsor_popup': show_sponsor_popup,
        'show_alert': show_alert,
        'alert_reputation_revoking': alert_reputation_revoking,
        'crumbs': crumbs,
        'actionbar': _actionbar(issue, myoffer, mysolution, request.user)
    }

    return render_to_response(template_folder(request) + 'issue.html',
                              context,
                              context_instance=RequestContext(request))
def viewOffer(request, offer_id):
    offer = Offer.objects.get(pk=offer_id)
    payment = None
    myoffer = None
    mysolution = None
    show_alert = None

    if request.user.is_authenticated():
        mysolution = get_or_none(Solution, issue=offer.issue, programmer=request.user)
        myoffer = get_or_none(Offer, issue=offer.issue, sponsor=request.user, status__in=[Offer.OPEN, Offer.REVOKED])

    alert = request.GET.get("alert")
    if alert == "SPONSOR" and offer.issue.project:
        show_alert = "core/popup/popup_just_sponsored.html"
    alert_reputation_revoking = (
        mysolution and mysolution.status == Solution.IN_PROGRESS and mysolution.get_received_payments().count() > 0
    )
    invoke_parent_callback = request.GET.get("c") == "s"

    is_watching = request.user.is_authenticated() and watch_services.is_watching_offer(request.user, offer.id)

    return render_to_response(
        template_folder(request) + "offer.html",
        {
            "offer": offer,
            "is_watching": is_watching,
            "issue": offer.issue,
            "show_alert": show_alert,
            "myoffer": myoffer,
            "mysolution": mysolution,
            "alert_reputation_revoking": alert_reputation_revoking,
            "invoke_parent_callback": invoke_parent_callback,
        },
        context_instance=RequestContext(request),
    )
def listIssues(request):
    project_id = request.GET.get("project_id")
    project_name = request.GET.get("project_name")
    search_terms = request.GET.get("s")
    operation = request.GET.get("operation", "")

    issues = _listIssues(request)
    if isinstance(issues, Issue):
        issue = issues
        return redirect(issue.get_view_link())
    if issues.count() == 1:
        issue = issues[0]
        return redirect(issue.get_view_link())

    return render_to_response(
        template_folder(request) + "issue_list.html",
        {
            "issues": issues,
            "s": search_terms,
            "project_id": project_id,
            "project_name": project_name,
            "operation": operation,
        },
        context_instance=RequestContext(request),
    )
Пример #4
0
def viewOffer(request, offer_id):
    offer = Offer.objects.get(pk=offer_id)
    payment = None
    myoffer = None
    mysolution = None
    show_alert = None

    if(request.user.is_authenticated()):
        mysolution = get_or_none(Solution, issue=offer.issue, programmer=request.user)
        myoffer = get_or_none(Offer, issue=offer.issue, sponsor=request.user, status__in=[Offer.OPEN, Offer.REVOKED])

    alert = request.GET.get('alert')
    if(alert == 'SPONSOR' and offer.issue.project):
        show_alert = 'core/popup/popup_just_sponsored.html'
    alert_reputation_revoking = mysolution and mysolution.status == Solution.IN_PROGRESS and mysolution.get_received_payments().count() > 0
    invoke_parent_callback = (request.GET.get('c') == 's')

    is_watching = request.user.is_authenticated() and watch_services.is_watching_offer(request.user, offer.id)

    return render_to_response(template_folder(request) + 'offer.html',
        {'offer':offer,
        'is_watching':is_watching,
        'issue':offer.issue,
        'show_alert':show_alert,
        'myoffer':myoffer,
        'mysolution':mysolution,
        'alert_reputation_revoking': alert_reputation_revoking,
        'invoke_parent_callback' : invoke_parent_callback},
        context_instance = RequestContext(request))
def editUserForm(request):
    userinfo = request.user.getUserInfo()
    available_languages = [
        {
            'code': 'en',
            'label': _('English')
        },
        {
            'code': 'pt-br',
            'label': _('Brazilian Portuguese')
        },
        {
            'code': 'es',
            'label': _('Spanish')
        },
    ]
    if (not userinfo):
        userinfo = UserInfo.newUserInfo(request.user)
        userinfo.save()
        mail_services.welcome(request.user)
        _notify_admin_new_user(request.user)
    return render_to_response(template_folder(request) + 'useredit.html', {
        'userinfo': userinfo,
        'available_languages': available_languages,
        'next': request.GET.get('next', '')
    },
                              context_instance=RequestContext(request))
def addIssue(request):
    try:
        offer = issue_services.sponsor_new_issue(request.POST, request.user)
        watch_services.watch_issue(request.user, offer.issue.id, IssueWatch.SPONSORED)
    except BaseException as ex:
        traceback.print_exc()
        return HttpResponse(_("ERROR: ") + ex.message)
    params = "?alert=SPONSOR"
    to = offer if template_folder(request) == "core/" else offer.issue
    return redirect(to.get_view_link() + params)
def viewIssue(request, issue_id):
    try:
        issue = Issue.objects.get(pk=issue_id)
    except:
        return HttpResponse(status=404, content='Issue not found')
    if issue.get_view_link() != request.path:
        return redirect(issue.get_view_link(), permanent=True)  # only allow one URL per issue
    myoffer = None
    mysolution = None
    show_alert = None

    if(request.user.is_authenticated()):
        myoffer = get_or_none(Offer, issue=issue, sponsor=request.user, status__in=[Offer.OPEN, Offer.REVOKED])
        mysolution = get_or_none(Solution, issue=issue,programmer=request.user)

    show_sponsor_popup = (request.GET.get('show_sponsor') == 'true')
    alert = request.GET.get('alert')
    if alert == 'KICKSTART':
        show_alert = template_folder(request) + 'popup/popup_just_kickstarted.html'
    if alert == 'SPONSOR':
        show_alert = template_folder(request) + 'popup/popup_just_sponsored.html'
    alert_reputation_revoking = mysolution and mysolution.status == Solution.IN_PROGRESS and mysolution.get_received_payments().count() > 0

    is_watching = request.user.is_authenticated() and watch_services.is_watching_issue(request.user, issue.id)
    crumbs = [HOME_CRUMB, {
        'link': issue.trackerURL,
        'name': 'issue: ' + issue.title,
        'blank': True,
    }]

    context = {
        'issue': issue,
        'is_watching': is_watching,
        'myoffer': myoffer,
        'mysolution': mysolution,
        'show_sponsor_popup': show_sponsor_popup,
        'show_alert': show_alert,
        'alert_reputation_revoking': alert_reputation_revoking,
        'crumbs': crumbs,
        'actionbar': _actionbar(issue, myoffer, mysolution, request.user)}

    return render_to_response(template_folder(request) + 'issue.html', context, context_instance=RequestContext(request))
Пример #8
0
def home(request):
    issues_sponsoring = issue_services.search_issues(is_public_suggestion=False)[0:3]
    issues_kickstarting = issue_services.search_issues(is_public_suggestion=True)[0:3]
    crumbs = [HOME_CRUMB]
    issues_sponsoring = json.dumps(issue_services.to_card_dict(issues_sponsoring))
    issues_kickstarting = json.dumps(issue_services.to_card_dict(issues_kickstarting))
    return render_to_response(template_folder(request) + 'home.html',
        {'issues_sponsoring': issues_sponsoring,
         'issues_kickstarting': issues_kickstarting,
         'crumbs': crumbs},
        context_instance=RequestContext(request))
Пример #9
0
def addIssue(request):
    try:
        offer = issue_services.sponsor_new_issue(request.POST, request.user)
        watch_services.watch_issue(request.user, offer.issue.id,
                                   IssueWatch.SPONSORED)
    except BaseException as ex:
        traceback.print_exc()
        return HttpResponse(_("ERROR: ") + ex.message)
    params = '?alert=SPONSOR'
    to = offer if template_folder(request) == 'core/' else offer.issue
    return redirect(to.get_view_link() + params)
def viewIssue(request, issue_id):
    issue = Issue.objects.get(pk=issue_id)
    myoffer = None
    mysolution = None
    show_alert = None

    if request.user.is_authenticated():
        myoffer = get_or_none(Offer, issue=issue, sponsor=request.user, status__in=[Offer.OPEN, Offer.REVOKED])
        mysolution = get_or_none(Solution, issue=issue, programmer=request.user)

    show_sponsor_popup = request.GET.get("show_sponsor") == "true"
    alert = request.GET.get("alert")
    if alert == "KICKSTART":
        show_alert = template_folder(request) + "popup/popup_just_kickstarted.html"
    if alert == "SPONSOR":
        show_alert = template_folder(request) + "popup/popup_just_sponsored.html"
    alert_reputation_revoking = (
        mysolution and mysolution.status == Solution.IN_PROGRESS and mysolution.get_received_payments().count() > 0
    )

    invoke_parent_callback = request.GET.get("c") == "s"

    is_watching = request.user.is_authenticated() and watch_services.is_watching_issue(request.user, issue.id)
    crumbs = [HOME_CRUMB, {"link": issue.trackerURL, "name": "issue: " + issue.title, "blank": True}]

    context = {
        "issue": issue,
        "is_watching": is_watching,
        "myoffer": myoffer,
        "mysolution": mysolution,
        "invoke_parent_callback": invoke_parent_callback,
        "show_sponsor_popup": show_sponsor_popup,
        "show_alert": show_alert,
        "alert_reputation_revoking": alert_reputation_revoking,
        "crumbs": crumbs,
        "actionbar": _actionbar(issue, myoffer, mysolution, request.user),
    }

    return render_to_response(
        template_folder(request) + "issue.html", context, context_instance=RequestContext(request)
    )
def login(request):
    getparams = ''
    if request.GET.has_key('next'):
        getparams = '?next=' + request.GET['next']
    if request.user.is_authenticated():
        if getparams:
            return redirect(getparams)
        else:
            return redirect('/')
    return render_to_response(template_folder(request) + 'login.html',
                              {'getparams': getparams},
                              context_instance=RequestContext(request))
Пример #12
0
def login(request):
    getparams = ''
    if request.GET.has_key('next') : 
        getparams = '?next='+request.GET['next'];
    if request.user.is_authenticated():
        if getparams:
            return redirect(getparams)
        else:
            return redirect('/')
    return render_to_response(template_folder(request) + 'login.html',
        {'getparams':getparams},
        context_instance = RequestContext(request))
def payOffer(request, offer, payment):
    try:
        receive_address = bitcoin_services.get_available_receive_address()
        payment.bitcoin_receive_address = receive_address
        payment.save()
        return render_to_response(
            template_folder(request) + "waitPaymentBitcoin.html",
            {"payment": payment, "bitcoin_address": receive_address.address},
            context_instance=RequestContext(request),
        )
    except BitcoinFrespoException as e:
        messages.error(request, e.value)
        return redirect(offer.issue.get_view_link())
Пример #14
0
def listIssues(request):
    project_id = request.GET.get('project_id')
    project_name = request.GET.get('project_name')
    search_terms = request.GET.get('s')
    operation = request.GET.get('operation', '')
    return render_to_response(template_folder(request) + 'issue_list.html',
        {'issues':_listIssues(request),
         's':search_terms,
         'project_id':project_id,
         'project_name':project_name,
         'operation':operation,
        },
        context_instance = RequestContext(request))
Пример #15
0
def mailtest(request):
    to = ''
    if request.user.is_superuser:
        to = request.POST.get('to')
        test = request.POST.get('test')
        if test:
            testmail_service.mailtest(test, to)
            msg = 'test mail %s sent to %s.' % (test, to)
            messages.info(request, msg)
    else:
        messages.info(request, 'nice try :-). If you do find a hole, please have the finesse to let us know though.')
    return render_to_response(template_folder(request) + 'mailtest.html',
                              {'to': to},
                              context_instance = RequestContext(request))
def home(request):
    if request.user.is_authenticated() and request.user.getUserInfo() is None:
        return redirect('/core/user/edit')
    _is_new_layout = is_new_layout(request)
    size = 3 if _is_new_layout else 20
    issues_sponsoring = issue_services.search_issues(is_public_suggestion=False)[0:size]
    issues_kickstarting = issue_services.search_issues(is_public_suggestion=True)[0:size]
    if _is_new_layout:
        issues_sponsoring = json.dumps(issue_services.to_card_dict(issues_sponsoring))
        issues_kickstarting = json.dumps(issue_services.to_card_dict(issues_kickstarting))
    return render_to_response(template_folder(request) + 'home.html',
        {'issues_sponsoring': issues_sponsoring,
         'issues_kickstarting': issues_kickstarting},
        context_instance=RequestContext(request))
Пример #17
0
def addIssueForm(request):
    trackerURL = request.GET.get('trackerURL', '')
    operation = request.GET.get('operation', '')
    if(trackerURL):
        issues = Issue.objects.filter(trackerURL__iexact=trackerURL)
        issue_already_exists = issues.count() >= 1
        if(issues.count() > 1):
            logger.warning("Database inconsistency: more than one issue found with url = %s"%trackerURL)
        if(issue_already_exists):
            return redirect(issues[0].get_view_link()+'?show_sponsor=true&c=s')

    return render_to_response(template_folder(request) + 'add_issue.html',
        {'trackerURL' : trackerURL,
        'operation' : operation,},
        context_instance = RequestContext(request))
Пример #18
0
def payOfferForm(request, offer_id):
    offer = Offer.objects.get(pk=offer_id)
    is_brazilian = offer.sponsor.getUserInfo().brazilianPaypal

    solutions_accepting_payments = offer.issue.getSolutionsAcceptingPayments()
    if not solutions_accepting_payments:
        messages.error(
            request, 'No developers are accepting payments for this issue yet')
        return redirect(offer.get_view_link())

    solutions_dict = []
    for solution in solutions_accepting_payments:
        programmer_userinfo = solution.programmer.getUserInfo()
        try:
            accepts_paypal = paypal_services.accepts_paypal_payments(
                solution.programmer)
        except BaseException as e:
            traceback.print_exc()
            messages.error(request, 'Error communicating with Paypal: %s' % e)
            mail_services.notify_admin(
                'Error determining if user accepts paypal',
                traceback.format_exc())
            return redirect(offer.get_view_link())
        solutions_dict.append({
            'id':
            solution.id,
            'status':
            solution.status,
            'programmerScreenName':
            programmer_userinfo.screenName,
            'acceptsPaypal':
            accepts_paypal,
            'acceptsBitcoin':
            True and programmer_userinfo.bitcoin_receive_address,
            'imglink':
            solution.programmer.gravatar_url_small()
        })
    currency_options = _currency_options(offer)
    return render_to_response(
        template_folder(request) + 'pay_offer_angular.html', {
            'offer': offer,
            'count': len(solutions_dict),
            'currency_options': currency_options,
            'currency_options_json': json.dumps(currency_options),
            'is_brazilian': is_brazilian,
            'solutions_json': json.dumps(solutions_dict)
        },
        context_instance=RequestContext(request))
def addIssueForm(request):
    trackerURL = request.GET.get("trackerURL", "")
    operation = request.GET.get("operation", "")
    if trackerURL:
        issues = Issue.objects.filter(trackerURL__iexact=trackerURL)
        issue_already_exists = issues.count() >= 1
        if issues.count() > 1:
            logger.warning("Database inconsistency: more than one issue found with url = %s" % trackerURL)
        if issue_already_exists:
            return redirect(issues[0].get_view_link() + "?show_sponsor=true&c=s")

    return render_to_response(
        template_folder(request) + "add_issue.html",
        {"trackerURL": trackerURL, "operation": operation},
        context_instance=RequestContext(request),
    )
def editUserForm(request):
    userinfo = request.user.getUserInfo()
    available_languages = [
        {'code':'en', 'label':_('English')},
        {'code':'pt-br', 'label':_('Brazilian Portuguese')},
        {'code':'es', 'label':_('Spanish')},
    ]
    if(not userinfo):
        userinfo = UserInfo.newUserInfo(request.user)
        userinfo.save()
        mail_services.welcome(request.user)
        _notify_admin_new_user(request.user)
    return render_to_response(template_folder(request) + 'useredit.html',
        {'userinfo':userinfo,
         'available_languages' : available_languages,
        'next':request.GET.get('next', '')},
        context_instance = RequestContext(request))
def mailtest(request):
    to = ''
    if request.user.is_superuser:
        to = request.POST.get('to')
        test = request.POST.get('test')
        if test:
            testmail_service.mailtest(test, to)
            msg = 'test mail %s sent to %s.' % (test, to)
            messages.info(request, msg)
    else:
        messages.info(
            request,
            'nice try :-). If you do find a hole, please have the finesse to let us know though.'
        )
    return render_to_response(template_folder(request) + 'mailtest.html',
                              {'to': to},
                              context_instance=RequestContext(request))
Пример #22
0
def addIssueForm(request):
    trackerURL = request.GET.get('trackerURL', '')
    operation = request.GET.get('operation', '')
    if (trackerURL):
        issues = Issue.objects.filter(trackerURL__iexact=trackerURL)
        issue_already_exists = issues.count() >= 1
        if (issues.count() > 1):
            logger.warning(
                "Database inconsistency: more than one issue found with url = %s"
                % trackerURL)
        if (issue_already_exists):
            return redirect(issues[0].get_view_link() +
                            '?show_sponsor=true&c=s')

    return render_to_response(template_folder(request) + 'add_issue.html', {
        'trackerURL': trackerURL,
        'operation': operation,
    },
                              context_instance=RequestContext(request))
def viewUser(request, user_id, user_slug=None):
    user = User.objects.get(pk=user_id)
    unconnectedSocialAccounts = None
    if(user.id == request.user.id):
        unconnectedSocialAccounts = user.getUnconnectedSocialAccounts()
    alert_strings = user_services.getAlertsForViewUser(request.user, user,
        changedPrimaryEmail=request.GET.get('prim') == 'true',
        changedPaypalEmail=request.GET.get('payp') == 'true',
        emailVerified=request.GET.get('email_verified') == 'true')
    for alert in alert_strings:
        messages.info(request, alert)

    context = {'le_user':user,
        'stats': user.getStats(),
        'unconnectedSocialAccounts':unconnectedSocialAccounts,
        }
    return render_to_response(template_folder(request) + 'user.html',
        context,
        context_instance = RequestContext(request))
def payOfferForm(request, offer_id):
    offer = Offer.objects.get(pk=offer_id)
    is_brazilian = offer.sponsor.getUserInfo().brazilianPaypal

    solutions_accepting_payments = offer.issue.getSolutionsAcceptingPayments()
    if not solutions_accepting_payments:
        messages.error(request, "No developers are accepting payments for this issue yet")
        return redirect(offer.issue.get_view_link())

    solutions_dict = []
    for solution in solutions_accepting_payments:
        programmer_userinfo = solution.programmer.getUserInfo()
        try:
            accepts_paypal = paypal_services.accepts_paypal_payments(solution.programmer)
        except BaseException as e:
            traceback.print_exc()
            messages.error(request, "Error communicating with Paypal: %s" % e)
            mail_services.notify_admin("Error determining if user accepts paypal", traceback.format_exc())
            return redirect(offer.issue.get_view_link())
        solutions_dict.append(
            {
                "id": solution.id,
                "status": solution.status,
                "programmerScreenName": programmer_userinfo.screenName,
                "acceptsPaypal": accepts_paypal,
                "acceptsBitcoin": True and programmer_userinfo.bitcoin_receive_address,
                "imglink": solution.programmer.gravatar_url_small(),
            }
        )
    currency_options = _currency_options(offer)
    return render_to_response(
        template_folder(request) + "pay_offer_angular.html",
        {
            "offer": offer,
            "count": len(solutions_dict),
            "currency_options": currency_options,
            "currency_options_json": json.dumps(currency_options),
            "is_brazilian": is_brazilian,
            "solutions_json": json.dumps(solutions_dict),
        },
        context_instance=RequestContext(request),
    )
Пример #25
0
def admail(request):
    if request.user.is_superuser:
        mail_to = request.POST.get('mail_to')
        if mail_to:
            subject = request.POST.get('subject', '')
            body = request.POST.get('body', '')
            if mail_to == 'some':
                emails = request.POST.get('emails', '').split(',')
                count = 0
                for email in emails:
                    plain_send_mail(email.strip(), subject, body, settings.ADMAIL_FROM_EMAIL)
                    count += 1
            elif mail_to == 'all':
                count = send_mail_to_all_users(subject, body, settings.ADMAIL_FROM_EMAIL)
            messages.info(request, 'mail sent to %s users' % count)
    else:
        messages.info(request, 'nice try :-). If you do find a hole, please have the finesse to let us know though.')
    return render_to_response(template_folder(request) + 'admail.html',
                              {},
                              context_instance = RequestContext(request))
def viewUser(request, user_id):
    user = User.objects.get(pk=user_id)
    unconnectedSocialAccounts = None
    if (user.id == request.user.id):
        unconnectedSocialAccounts = user.getUnconnectedSocialAccounts()
    alert_strings = user_services.getAlertsForViewUser(
        request.user,
        user,
        changedPrimaryEmail=request.GET.get('prim') == 'true',
        changedPaypalEmail=request.GET.get('payp') == 'true',
        emailVerified=request.GET.get('email_verified') == 'true')
    for alert in alert_strings:
        messages.info(request, alert)

    context = {
        'le_user': user,
        'stats': user.getStats(),
        'unconnectedSocialAccounts': unconnectedSocialAccounts,
    }
    return render_to_response(template_folder(request) + 'user.html',
                              context,
                              context_instance=RequestContext(request))
Пример #27
0
def listIssues(request):
    project_id = request.GET.get('project_id')
    project_name = request.GET.get('project_name')
    search_terms = request.GET.get('s')
    operation = request.GET.get('operation', '')

    issues = _listIssues(request)
    if isinstance(issues, Issue):
        issue = issues
        return redirect(issue.get_view_link())
    if issues.count() == 1:
        issue = issues[0]
        return redirect(issue.get_view_link())

    return render_to_response(template_folder(request) + 'issue_list.html',
        {'issues': issues,
         's': search_terms,
         'project_id': project_id,
         'project_name': project_name,
         'operation': operation,
        },
        context_instance = RequestContext(request))
Пример #28
0
def listIssues(request):
    project_id = request.GET.get('project_id')
    project_name = request.GET.get('project_name')
    search_terms = request.GET.get('s')
    operation = request.GET.get('operation', '')

    issues = _listIssues(request)
    if isinstance(issues, Issue):
        issue = issues
        return redirect(issue.get_view_link())
    if issues.count() == 1:
        issue = issues[0]
        return redirect(issue.get_view_link())

    return render_to_response(template_folder(request) + 'issue_list.html', {
        'issues': issues,
        's': search_terms,
        'project_id': project_id,
        'project_name': project_name,
        'operation': operation,
    },
                              context_instance=RequestContext(request))
Пример #29
0
def payOfferForm(request, offer_id):
    offer = Offer.objects.get(pk=offer_id)
    is_brazilian = offer.sponsor.getUserInfo().brazilianPaypal

    solutions_accepting_payments = offer.issue.getSolutionsAcceptingPayments()
    if not solutions_accepting_payments:
        messages.error(request, 'No developers are accepting payments for this issue yet')
        return redirect(offer.get_view_link())

    solutions_dict = []
    for solution in solutions_accepting_payments:
        programmer_userinfo = solution.programmer.getUserInfo()
        try:
            accepts_paypal = paypal_services.accepts_paypal_payments(solution.programmer)
        except BaseException as e:
            traceback.print_exc()
            messages.error(request, 'Error communicating with Paypal: %s' % e)
            mail_services.notify_admin('Error determining if user accepts paypal', traceback.format_exc())
            return redirect(offer.get_view_link())
        solutions_dict.append({
            'id': solution.id,
            'status': solution.status,
            'programmerScreenName': programmer_userinfo.screenName,
            'acceptsPaypal': accepts_paypal,
            'acceptsBitcoin': True and programmer_userinfo.bitcoin_receive_address,
            'imglink': solution.programmer.gravatar_url_small()
        })
    currency_options = _currency_options(offer)
    return render_to_response(template_folder(request) + 'pay_offer_angular.html',
                              {
                                  'offer': offer,
                                  'count': len(solutions_dict),
                                  'currency_options': currency_options,
                                  'currency_options_json': json.dumps(currency_options),
                                  'is_brazilian': is_brazilian,
                                  'solutions_json': json.dumps(solutions_dict)
                              },
                              context_instance=RequestContext(request))
def viewIssue(request, issue_id):
    issue = Issue.objects.get(pk=issue_id)
    myoffer = None
    mysolution = None
    show_alert = None

    if(request.user.is_authenticated()):
        myoffer = get_or_none(Offer, issue=issue, sponsor=request.user, status__in=[Offer.OPEN, Offer.REVOKED])
        mysolution = get_or_none(Solution, issue=issue,programmer=request.user)

    show_sponsor_popup = (request.GET.get('show_sponsor') == 'true')
    alert = request.GET.get('alert')
    if(alert == 'KICKSTART'):
        show_alert = 'core/popup/popup_just_kickstarted.html'
    alert_reputation_revoking = mysolution and mysolution.status == Solution.IN_PROGRESS and mysolution.get_received_payments().count() > 0

    invoke_parent_callback = (request.GET.get('c') == 's')

    is_watching = request.user.is_authenticated() and watch_services.is_watching_issue(request.user, issue.id)
    crumbs = [HOME_CRUMB, {
        'link': issue.trackerURL,
        'name': 'issue: ' + issue.title,
        'blank': True,
    }]

    context = {
        'issue': issue,
        'is_watching': is_watching,
        'myoffer': myoffer,
        'mysolution': mysolution,
        'invoke_parent_callback': invoke_parent_callback,
        'show_sponsor_popup': show_sponsor_popup,
        'show_alert': show_alert,
        'alert_reputation_revoking': alert_reputation_revoking,
        'crumbs': crumbs,
        'actionbar': _actionbar(issue, myoffer, mysolution, request.user)}

    return render_to_response(template_folder(request) + 'issue.html', context, context_instance=RequestContext(request))
Пример #31
0
def viewOffer(request, offer_id):
    offer = Offer.objects.get(pk=offer_id)
    payment = None
    myoffer = None
    mysolution = None
    show_alert = None

    if (request.user.is_authenticated()):
        mysolution = get_or_none(Solution,
                                 issue=offer.issue,
                                 programmer=request.user)
        myoffer = get_or_none(Offer,
                              issue=offer.issue,
                              sponsor=request.user,
                              status__in=[Offer.OPEN, Offer.REVOKED])

    alert = request.GET.get('alert')
    if (alert == 'SPONSOR' and offer.issue.project):
        show_alert = 'core/popup/popup_just_sponsored.html'
    alert_reputation_revoking = mysolution and mysolution.status == Solution.IN_PROGRESS and mysolution.get_received_payments(
    ).count() > 0
    invoke_parent_callback = (request.GET.get('c') == 's')

    is_watching = request.user.is_authenticated(
    ) and watch_services.is_watching_offer(request.user, offer.id)

    return render_to_response(template_folder(request) + 'offer.html', {
        'offer': offer,
        'is_watching': is_watching,
        'issue': offer.issue,
        'show_alert': show_alert,
        'myoffer': myoffer,
        'mysolution': mysolution,
        'alert_reputation_revoking': alert_reputation_revoking,
        'invoke_parent_callback': invoke_parent_callback
    },
                              context_instance=RequestContext(request))
def admail(request):
    if request.user.is_superuser:
        mail_to = request.POST.get('mail_to')
        if mail_to:
            subject = request.POST.get('subject', '')
            body = request.POST.get('body', '')
            if mail_to == 'some':
                emails = request.POST.get('emails', '').split(',')
                count = 0
                for email in emails:
                    plain_send_mail(email.strip(), subject, body,
                                    settings.ADMAIL_FROM_EMAIL)
                    count += 1
            elif mail_to == 'all':
                count = send_mail_to_all_users(subject, body,
                                               settings.ADMAIL_FROM_EMAIL)
            messages.info(request, 'mail sent to %s users' % count)
    else:
        messages.info(
            request,
            'nice try :-). If you do find a hole, please have the finesse to let us know though.'
        )
    return render_to_response(template_folder(request) + 'admail.html', {},
                              context_instance=RequestContext(request))
Пример #33
0
def stats(request):
    stats = stats_services.get_stats()
    return render_to_response(template_folder(request) + 'stats.html',
        {'stats': stats},
        context_instance=RequestContext(request))
def listUsers(request):
    users = user_services.get_users_list()
    return render_to_response(template_folder(request) + 'userlist.html', {
        'users': users,
    },
                              context_instance=RequestContext(request))
Пример #35
0
def list(request):
    projects = Project.objects.all()
    projects = projects.order_by('name')
    return render_to_response(template_folder(request) + 'project_list.html',
                              {'projects': projects},
                              context_instance=RequestContext(request))
Пример #36
0
def myissues(request):
    if(request.user.is_authenticated() and request.user.getUserInfo() == None):
        return redirect('/core/user/edit')
    return render_to_response(template_folder(request) + 'myissues.html',
        {},
        context_instance = RequestContext(request))
def stats(request):
    stats = stats_services.get_stats()
    return render_to_response(template_folder(request) + 'stats.html',
                              {'stats': stats},
                              context_instance=RequestContext(request))
def listUsers(request):
    users = user_services.get_users_list()
    return render_to_response(template_folder(request) + 'userlist.html',
        {'users':users,},
        context_instance = RequestContext(request))
Пример #39
0
def payOffer(request, offer, payment):
    try:
        receive_address = bitcoin_services.get_available_receive_address()
        payment.bitcoin_receive_address = receive_address
        payment.save()
        return render_to_response(template_folder(request) + 'waitPaymentBitcoin.html',
            {'payment': payment,
             'bitcoin_address': receive_address.address},
            context_instance=RequestContext(request))
    except BitcoinFrespoException as e:
        messages.error(request, e.value)
        return redirect(offer.get_view_link())



# non-anonymous
# 2013-02-04 23:59:31,170 [INFO] core.views.bitcoin_views: ----- bitcoinIPN ------
# 2013-02-04 23:59:31,171 [INFO] core.views.bitcoin_views: value: 1242290114
# 2013-02-04 23:59:31,171 [INFO] core.views.bitcoin_views: input_address: 
# 2013-02-04 23:59:31,172 [INFO] core.views.bitcoin_views: confirmations: 0
# 2013-02-04 23:59:31,172 [INFO] core.views.bitcoin_views: transaction_hash: 071118d0292762049de691e60efe5296987b1763710a4cf1eee938cd36087a57
# 2013-02-04 23:59:31,172 [INFO] core.views.bitcoin_views: destination_address: 1pjA3VSnEB6LKmJeJy9Jp1QY7vureFS4D
# 2013-02-04 23:59:31,173 [INFO] core.views.bitcoin_views: input_transaction_hash: 
# 2013-02-04 23:59:31,173 [INFO] core.views.bitcoin_views: GET params: <QueryDict: 
# {u'transaction_hash': [u'071118d0292762049de691e60efe5296987b1763710a4cf1eee938cd36087a57'], 
# u'value': [u'1242290114'], 
# u'confirmations': [u'0'], 
# u'anonymous': [u'false'], 
# u'address': [u'1pjA3VSnEB6LKmJeJy9Jp1QY7vureFS4D'], 
# u'test': [u'true'], 
# u'destination_address': [u'1pjA3VSnEB6LKmJeJy9Jp1QY7vureFS4D']}>
# 2013-02-04 23:59:31,173 [INFO] core.views.bitcoin_views: ----- bitcoinIPN end ------



# anonymous
# 2013-02-04 23:58:41,188 [INFO] core.views.bitcoin_views: ----- bitcoinIPN ------
# 2013-02-04 23:58:41,189 [INFO] core.views.bitcoin_views: value: 7129632005
# 2013-02-04 23:58:41,189 [INFO] core.views.bitcoin_views: input_address: 
# 2013-02-04 23:58:41,189 [INFO] core.views.bitcoin_views: confirmations: 0
# 2013-02-04 23:58:41,190 [INFO] core.views.bitcoin_views: transaction_hash: 25371aa8d93184a6f47a8f267be5a23feac8c396e6a39f40eb4cf3415cc16e08
# 2013-02-04 23:58:41,190 [INFO] core.views.bitcoin_views: destination_address: 1pjA3VSnEB6LKmJeJy9Jp1QY7vureFS4D
# 2013-02-04 23:58:41,190 [INFO] core.views.bitcoin_views: input_transaction_hash: 
# 2013-02-04 23:58:41,190 [INFO] core.views.bitcoin_views: GET params: <QueryDict: 
# {u'transaction_hash': [u'25371aa8d93184a6f47a8f267be5a23feac8c396e6a39f40eb4cf3415cc16e08'], 
# u'value': [u'7129632005'], 
# u'confirmations': [u'0'], 
# u'anonymous': [u'false'], 
# u'address': [u'1pjA3VSnEB6LKmJeJy9Jp1QY7vureFS4D'], 
# u'test': [u'true'], 
# u'destination_address': [u'1pjA3VSnEB6LKmJeJy9Jp1QY7vureFS4D']}>
# 2013-02-04 23:58:41,191 [INFO] core.views.bitcoin_views: ----- bitcoinIPN end ------


##send test:
#console:
# >>> c.sendfrom('12EiAPTUZN4LStdP9nP7K8ZBfhrm5Mg2RW', '1KExeHvN1PoCrA87xGTPHBR3DhEYFgDQV1',0.001)
# u'c406122df4a18fd1af51da3ef3c4e86fee84a47a249b86c28d2e316791a9c145'
# >>> c2.getbalance()
# Decimal('0.0')
# >>> c2.getreceivedbyaccount('1KExeHvN1PoCrA87xGTPHBR3DhEYFgDQV1')
# Decimal('0.0')
# >>> c2.getbalance()
# Decimal('0.001')
# >>> c2.getreceivedbyaccount('1KExeHvN1PoCrA87xGTPHBR3DhEYFgDQV1')
# Decimal('0.001')

# 2013-02-05 00:34:18,266 [INFO] core.views.bitcoin_views: ----- bitcoinIPN ------
# 2013-02-05 00:34:18,267 [INFO] core.views.bitcoin_views: value: -150000
# 2013-02-05 00:34:18,268 [INFO] core.views.bitcoin_views: input_address: 12EiAPTUZN4LStdP9nP7K8ZBfhrm5Mg2RW
# 2013-02-05 00:34:18,268 [INFO] core.views.bitcoin_views: confirmations: 2
# 2013-02-05 00:34:18,268 [INFO] core.views.bitcoin_views: transaction_hash: c406122df4a18fd1af51da3ef3c4e86fee84a47a249b86c28d2e316791a9c145
# 2013-02-05 00:34:18,269 [INFO] core.views.bitcoin_views: destination_address: 12EiAPTUZN4LStdP9nP7K8ZBfhrm5Mg2RW
# 2013-02-05 00:34:18,269 [INFO] core.views.bitcoin_views: input_transaction_hash: 
# 2013-02-05 00:34:18,269 [INFO] core.views.bitcoin_views: GET params: <QueryDict: {u'transaction_hash': [u'c406122df4a18fd1af51da3ef3c4e86fee84a47a249b86c28d2e316791a9c145'], u'value': [u'-150000'], u'confirmations': [u'2'], u'anonymous': [u'false'], u'address': [u'12EiAPTUZN4LStdP9nP7K8ZBfhrm5Mg2RW'], u'input_address': [u'12EiAPTUZN4LStdP9nP7K8ZBfhrm5Mg2RW'], u'destination_address': [u'12EiAPTUZN4LStdP9nP7K8ZBfhrm5Mg2RW']}>
# 2013-02-05 00:34:18,269 [INFO] core.views.bitcoin_views: ----- bitcoinIPN end ------

# 2013-02-05 00:37:15,252 [INFO] core.views.bitcoin_views: ----- bitcoinIPN ------
# 2013-02-05 00:37:15,252 [INFO] core.views.bitcoin_views: value: 100000
# 2013-02-05 00:37:15,253 [INFO] core.views.bitcoin_views: input_address: 1KExeHvN1PoCrA87xGTPHBR3DhEYFgDQV1
# 2013-02-05 00:37:15,253 [INFO] core.views.bitcoin_views: confirmations: 3
# 2013-02-05 00:37:15,253 [INFO] core.views.bitcoin_views: transaction_hash: c406122df4a18fd1af51da3ef3c4e86fee84a47a249b86c28d2e316791a9c145
# 2013-02-05 00:37:15,253 [INFO] core.views.bitcoin_views: destination_address: 1KExeHvN1PoCrA87xGTPHBR3DhEYFgDQV1
# 2013-02-05 00:37:15,254 [INFO] core.views.bitcoin_views: input_transaction_hash: 
# 2013-02-05 00:37:15,254 [INFO] core.views.bitcoin_views: GET params: <QueryDict: {u'transaction_hash': [u'c406122df4a18fd1af51da3ef3c4e86fee84a47a249b86c28d2e316791a9c145'], u'value': [u'100000'], u'confirmations': [u'3'], u'anonymous': [u'false'], u'address': [u'1KExeHvN1PoCrA87xGTPHBR3DhEYFgDQV1'], u'input_address': [u'1KExeHvN1PoCrA87xGTPHBR3DhEYFgDQV1'], u'destination_address': [u'1KExeHvN1PoCrA87xGTPHBR3DhEYFgDQV1']}>
# 2013-02-05 00:37:15,254 [INFO] core.views.bitcoin_views: ----- bitcoinIPN end ------
Пример #40
0
def feedback(request):
    issues = Issue.objects.filter(is_feedback=True).order_by('-creationDate')
    return render_to_response(template_folder(request) + 'feedback.html', {
        'issues': issues,
    },
                              context_instance=RequestContext(request))
Пример #41
0
def list(request):
    projects = Project.objects.all()
    projects = projects.order_by('name')
    return render_to_response(template_folder(request) + 'project_list.html',
        {'projects':projects},
        context_instance = RequestContext(request))
Пример #42
0
def myissues(request):
    if (request.user.is_authenticated()
            and request.user.getUserInfo() == None):
        return redirect('/core/user/edit')
    return render_to_response(template_folder(request) + 'myissues.html', {},
                              context_instance=RequestContext(request))
def myissues(request):
    if request.user.is_authenticated() and request.user.getUserInfo() == None:
        return redirect("core.views.user_views.editUserForm")
    return render_to_response(template_folder(request) + "myissues.html", {}, context_instance=RequestContext(request))
def feedback(request):
    issues = Issue.objects.filter(is_feedback=True).order_by('-creationDate')
    return render_to_response(template_folder(request) + 'feedback.html',
        {'issues':issues,},
        context_instance = RequestContext(request))
def list(request):
    projects = Project.objects.all()
    projects = projects.order_by("name")
    return render_to_response(
        template_folder(request) + "project_list.html", {"projects": projects}, context_instance=RequestContext(request)
    )