dashboard.gas_views

Copyright (C) 2019 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) 2018 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) 2019 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)

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)

Extend expiration of the Bounty.

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

:request method: POST

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

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.

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)

Handle displaying the first time user experience flow.

users_directory

users_directory(request)

Handle displaying users directory page.

users_fetch

users_fetch(request)

Handle displaying users.

dashboard

dashboard(request)

Handle displaying the dashboard.

ethhack

ethhack(request)

Handle displaying ethhack landing page.

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.

contribute

contribute(request)

Contribute 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.

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

social_contribution(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.

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.

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.

refund_request

refund_request(request)

Request refund for 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 request refund view.

process_refund_request

process_refund_request(request, pk)

Request refund for 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: Admin view for request refund 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.

profile_keywords

profile_keywords(request, handle)

Display profile keywords.

Args: handle (str): The profile handle.

profile_job_opportunity

profile_job_opportunity(request, handle)

Save profile job opportunity.

Args: handle (str): The profile handle.

bounty_upload_nda

bounty_upload_nda(request)

Save Bounty related docs like NDA.

Args: bounty_id (int): The bounty id.

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.

profile_filter_activities

profile_filter_activities(activities, activity_name)

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)

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.

hackathon

hackathon(request, hackathon='')

Handle rendering of HackathonEvents. Reuses the dashboard template.

get_hackathons

get_hackathons(request)

Handle rendering all Hackathons.