dashboard.gas_views

Copyright (C) 2021 Gitcoin Core

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

dashboard.tip_views

Define the tip related views.

Copyright (C) 2021 Gitcoin Core

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

send_tip

send_tip(request)

Handle the first stage of sending a tip.

receive_tip_v3

receive_tip_v3(request, key, txid, network)

Handle the receiving of a tip (the POST).

Returns: TemplateResponse: the UI with the tip confirmed.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

send_tip_4

send_tip_4(request)

Handle the fourth stage of sending a tip (the POST).

Returns: JsonResponse: response with success state.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

tipee_address

tipee_address(request, handle)

Return the address, if any, that someone would like to be tipped directly at.

Returns: list: The list of tipee address strings.

send_tip_3

send_tip_3(request)

Handle the third stage of sending a tip (the POST).

Returns: JsonResponse: response with success state.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

send_tip_2

send_tip_2(request)

Handle the second stage of sending a tip.

TODO: * Convert this view-based logic to a django form.

Returns: JsonResponse: If submitting tip, return response with success state. TemplateResponse: Render the submission form.

dashboard.views

Copyright (C) 2021 Gitcoin Core

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

record_bounty_activity

record_bounty_activity(bounty, user, event_name, interest=None, fulfillment=None)

Creates Activity object.

Args: bounty (dashboard.models.Bounty): Bounty user (string): User name event_name (string): Event name interest (dashboard.models.Interest): Interest

Raises: None

Returns: None

gh_login

gh_login(request)

Attempt to redirect the user to Github for authentication.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

new_interest

new_interest(request, bounty_id)

Claim Work for a Bounty.

:request method: POST

Args: bounty_id (int): ID of the Bounty.

Returns: dict: The success key with a boolean value and accompanying error.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

rating_modal

rating_modal(request, bounty_id, username)

Rating modal.

Args: pk (int): The primary key of the bounty to be rated.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The rate bounty view.

rating_capture

rating_capture(request)

Rating capture.

Args: pk (int): The primary key of the bounty to be rated.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The rate bounty capture modal.

unrated_bounties

unrated_bounties(request)

Rating capture.

Args: pk (int): The primary key of the bounty to be rated.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The rate bounty capture modal.

remove_interest

remove_interest(request, bounty_id)

Unclaim work from the Bounty.

Can only be called by someone who has started work

:request method: POST

post_id (int): ID of the Bounty.

Returns: dict: The success key with a boolean value and accompanying error.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

extend_expiration

extend_expiration(request, bounty_id)

Extend expiration of the Bounty.

Can only be called by funder or staff of the bounty.

:request method: POST

post_id (int): ID of the Bounty.

Returns: dict: The success key with a boolean value and accompanying error.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

cancel_reason

cancel_reason(request)

Add Cancellation Reason for Bounty during Cancellation

request method: POST

Params: pk (int): ID of the Bounty. canceled_bounty_reason (string): STRING with cancel reason

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

uninterested

uninterested(request, bounty_id, profile_id)

Remove party from given bounty

Can only be called by the bounty funder

:request method: GET

Args: bounty_id (int): ID of the Bounty profile_id (int): ID of the interested profile

Params: slashed (str): if the user will be slashed or not

Returns: dict: The success key with a boolean value and accompanying error.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

onboard

onboard(request, flow=None)

Handle displaying the first time user experience flow.

users_directory

users_directory(request)

Handle displaying users directory page.

users_directory_elastic

users_directory_elastic(request)

Handle displaying users directory page.

users_fetch

users_fetch(request)

Handle displaying users.

get_user_bounties

get_user_bounties(request)

Get user open bounties.

Args: request (int): get user by id or use authenticated.

Variables:

Returns: json: array of bounties.

dashboard

dashboard(request)

Handle displaying the dashboard.

accept_bounty

accept_bounty(request)

Process the bounty.

Args: pk (int): The primary key of the bounty to be accepted.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The accept bounty view.

invoice

invoice(request)

invoice view.

Args: pk (int): The primary key of the bounty to be accepted.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The invoice view.

social_contribution_modal

social_contribution_modal(request)

Social Contributuion to the bounty.

Args: pk (int): The primary key of the bounty to be accepted.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The accept bounty view.

bulk_invite

bulk_invite(request)

Invite users with matching skills to a bounty.

Args: bounty_id (int): The primary key of the bounty to be accepted. skills (string): Comma separated list of matching keywords.

Raises: Http403: The exception is raised if the user is not authenticated or the args are missing. Http401: The exception is raised if the user is not a staff member.

Returns: Http200: Json response with {'status': 200, 'msg': 'email_sent'}.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

social_contribution_email

social_contribution_email(request)

Social Contribution Email

Returns: JsonResponse: Success in sending email.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

payout_bounty

payout_bounty(request)

Payout the bounty.

Args: pk (int): The primary key of the bounty to be accepted.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The accept bounty view.

bulk_payout_bounty

bulk_payout_bounty(request)

Payout the bounty.

Args: pk (int): The primary key of the bounty to be accepted.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The accept bounty view.

fulfill_bounty

fulfill_bounty(request)

Fulfill a bounty.

Parameters: pk (int): The primary key of the Bounty. standard_bounties_id (int): The standard bounties ID of the Bounty. network (str): The network of the Bounty. githubUsername (str): The Github Username of the referenced user.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The fulfill bounty view.

increase_bounty

increase_bounty(request)

Increase a bounty as the funder.

Args: pk (int): The primary key of the bounty to be increased.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The increase bounty view.

cancel_bounty

cancel_bounty(request)

Kill an expired bounty.

Args: pk (int): The primary key of the bounty to be cancelled.

Raises: Http404: The exception is raised if no associated Bounty is found.

Returns: TemplateResponse: The cancel bounty view.

bounty_invite_url

bounty_invite_url(request, invitecode)

Decode the bounty details and redirect to correct bounty

Args: invitecode (str): Unique invite code with bounty details and handle

Returns: django.template.response.TemplateResponse: The Bounty details template response.

bounty_details

bounty_details(request, ghuser='', ghrepo='', ghissue=0, stdbounties_id=None)

Display the bounty details.

Args: ghuser (str): The Github user. Defaults to an empty string. ghrepo (str): The Github repository. Defaults to an empty string. ghissue (int): The Github issue number. Defaults to: 0.

Raises: Exception: The exception is raised for any exceptions in the main query block.

Returns: django.template.response.TemplateResponse: The Bounty details template response.

quickstart

quickstart(request)

Display Quickstart Guide.

load_banners

load_banners(request)

Load profile banners

profile_details

profile_details(request, handle)

Display profile keywords.

Args: handle (str): The profile handle.

user_card

user_card(request, handle)

Display profile keywords.

Args: handle (str): The profile handle.

profile_keywords

profile_keywords(request, handle)

Display profile details.

Args: handle (str): The profile handle.

profile_quests

profile_quests(request, handle)

Display profile quest points details.

Args: handle (str): The profile handle.

profile_grants

profile_grants(request, handle)

Display profile grant contribution details.

Args: handle (str): The profile handle.

profile_activity

profile_activity(request, handle)

Display profile activity details.

Args: handle (str): The profile handle.

profile_spent

profile_spent(request, handle)

Display profile spent details.

Args: handle (str): The profile handle.

profile_ratings

profile_ratings(request, handle, attr)

Display profile ratings details.

Args: handle (str): The profile handle.

profile_earnings

profile_earnings(request, handle, direction='to')

Display profile earnings details.

Args: handle (str): The profile handle.

profile_viewers

profile_viewers(request, handle)

Display profile viewers details.

Args: handle (str): The profile handle.

profile_job_opportunity

profile_job_opportunity(request, handle)

Save profile job opportunity.

Args: handle (str): The profile handle.

profile_settings

profile_settings(request)

Toggle profile automatic backup flag.

Args: handle (str): The profile handle.

profile_backup

profile_backup(request)

Read the profile backup data.

Args: handle (str): The profile handle.

profile_tax_settings

profile_tax_settings(request, handle)

Save profile tax info (country location and address).

Args: handle (str): The profile handle.

profile_filter_activities

profile_filter_activities(activities, activity_name, activity_tabs)

A helper function to filter a ActivityQuerySet.

Args: activities (ActivityQuerySet): The ActivityQuerySet. activity_name (str): The activity_type to filter.

Returns: ActivityQuerySet: The filtered results.

profile

profile(request, handle, tab=None)

Display profile details.

Args: handle (str): The profile handle.

Variables: context (dict): The template context to be used for template rendering. profile (dashboard.models.Profile): The Profile object to be used. status (int): The status code of the response.

Returns: TemplateResponse: The profile templated view.

get_quickstart_video

get_quickstart_video(request)

Show quickstart video.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

extend_issue_deadline

extend_issue_deadline(request)

Show quickstart video.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

sync_web3

sync_web3(request)

Sync up web3 with the database.

This function has a few different uses. It is typically called from the front end using the javascript sync_web3 function. The issueURL is passed in first, followed optionally by a bountydetails argument.

Returns: JsonResponse: The JSON response following the web3 sync.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

new_bounty

new_bounty(request)

Create a new bounty.

new_hackathon_bounty

new_hackathon_bounty(request, hackathon='')

Create a new hackathon bounty.

dashboard_sponsors

dashboard_sponsors(request, hackathon='', panel='prizes')

Handle rendering of HackathonEvents. Reuses the dashboard template.

hackathon

hackathon(request, hackathon='', panel='prizes')

Handle rendering of HackathonEvents. Reuses the dashboard template.

get_hackathons

get_hackathons(request)

Handle rendering all Hackathons.

board

board(request)

Handle the board view.

funder_dashboard_bounty_info

funder_dashboard_bounty_info(request, bounty_id)

Per-bounty JSON data for the user dashboard

funder_dashboard

funder_dashboard(request, bounty_type)

JSON data for the funder dashboard

contributor_dashboard

contributor_dashboard(request, bounty_type)

JSON data for the contributor dashboard

change_user_profile_banner

change_user_profile_banner(request)

Handle Profile Banner Uploads

create_bounty_v1

create_bounty_v1(request)

ETC-TODO - evaluate validity of duplicate / redundant data in models - wire in email (invite + successful creation)

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

cancel_bounty_v1

cancel_bounty_v1(request)

ETC-TODO - wire in email (invite + successful cancellation)

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

fulfill_bounty_v1

fulfill_bounty_v1(request)

ETC-TODO - wire in email (invite + successful fulfillment) - evalute BountyFulfillment unused fields

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

payout_bounty_v1

payout_bounty_v1(request, fulfillment_id)

ETC-TODO - wire in email (invite + successful payout)

{ amount: , bounty_owner_address : , token_name : }

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

reverse_proxy_rpc_v1

reverse_proxy_rpc_v1(request, tenant)

Proxy payout transaction to external node to bypass CORS restriction on browser.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

close_bounty_v1

close_bounty_v1(request, bounty_id)

ETC-TODO - wire in email

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.