From 1d7915c585749f364aa38ef9237c08d721fe473c Mon Sep 17 00:00:00 2001 From: octavioamu Date: Fri, 3 May 2019 21:47:48 -0300 Subject: [PATCH 01/12] create accordion and structure --- app/assets/v2/css/submit_bounty.css | 27 ++ app/dashboard/templates/bounty/fund.html | 450 ++++++++++++++++++ .../templates/shared/issue_details.html | 60 --- app/dashboard/templates/shared/pricing.html | 1 - app/dashboard/views.py | 2 +- 5 files changed, 478 insertions(+), 62 deletions(-) create mode 100644 app/dashboard/templates/bounty/fund.html diff --git a/app/assets/v2/css/submit_bounty.css b/app/assets/v2/css/submit_bounty.css index 1d46e329dba..f45016fcc09 100644 --- a/app/assets/v2/css/submit_bounty.css +++ b/app/assets/v2/css/submit_bounty.css @@ -206,3 +206,30 @@ input:read-only { .new { color: #0FCE7C; } + +.collapse-header { + color: #7c7e81; + display: flex; + align-items: center; + justify-content: space-between; + padding: 1em 0; + font-weight: bold; + border-bottom: 1px solid #e5e5e5; + transition: all .3s linear; +} + +.collapse-header:hover { + text-decoration: none; +} + +.collapse-header.collapsed { + border-bottom-color: transparent; +} + +.collapse-header .fa:before { + content: "\f077"; +} + +.collapse-header.collapsed .fa:before { + content: "\f078"; +} diff --git a/app/dashboard/templates/bounty/fund.html b/app/dashboard/templates/bounty/fund.html new file mode 100644 index 00000000000..bf56e50765b --- /dev/null +++ b/app/dashboard/templates/bounty/fund.html @@ -0,0 +1,450 @@ +{% comment %} + 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 . +{% endcomment %} +{% load i18n static %} + + + + + {% include 'shared/head.html' %} + {% include 'shared/cards.html' %} + + + + + + + {% include 'shared/tag_manager_2.html' %} +
+ {% include 'shared/top_nav.html' with class='d-md-flex' %} + {% include 'shared/nav.html' %} +
+
+
+
+ {% include 'shared/no_issue_error.html' with page='submit_bounty' %} + {% include 'shared/no_metamask_error.html' %} + {% include 'shared/zero_balance_error.html' %} + {% include 'shared/unlock_metamask.html' %} + {% include 'shared/connect_metamask.html' %} +
+
+
+ + +
+
+

{% trans "Fund Issue" %}

+
+

Github Repo Type

+
+ + +
+ +
+ + +
+ +
+
+
Important Notes on Private Repo Bounties
+
    +
  • Please make sure you are the repo admin to fund the issue
  • +
  • Gitcoin will NOT have any access to your private repo
  • +
  • You have to approve and give repository access to each contributor before they can start work
  • +
  • You can upload an NDA that each contributor has to sign before they can start work
  • +
+
+
+ +
+
+
+ +
+
{% trans "About" %}
+ + +
+

{% trans "Last Synced " %}

+ +
+
+ +
+
+ + +

+ + +
+ {% include 'shared/pricing.html' %} + +
+
+ +
+
+ +
+
+ +
+
+
+ + + +
+ +
+
+ Add tags from your repo: +
+
+ +
+
+
+ +
+ {% include 'shared/issue_details.html' %} +
+ + +
+ {% include 'shared/issue_deadline.html' %} +
+
+ + + +
+ +
+
+ + +
+
+ +
+ +
+
+ {% if suggested_developers %} + Suggested Contributors: +
+ {% for contributor in suggested_developers %} +
  • + + {{ contributor.fulfiller_github_username }} + +
  • + {% endfor %} +
    + {% endif %} +
    +
    +
    +
    + +
    + +
    + +
    +
    + + +
    + + +
    + +
    +
    + + +
    + +
    + +
    +
    + +
    + +
    +
    {% trans "Contact" %}
    +
    + {% include 'shared/notification_email.html' with show_information_publicly_checkbox=1 %} + {% include 'shared/github_username.html' %} +
    +
    +
    + +
    + + +
    + + + + +
    +
    +
    {% trans "Gas Settings" %}
    +
    + {% include 'shared/bounty_actions_hidden_vars.html' %} + {% include 'shared/wallet_estimate.html' %} +
    +
    + + {% if FEE_PERCENTAGE != 0 %} +
    +
    + {% trans "No Suprises" %} +
    +
    +
    +

    + {% blocktrans %} + Simply pay the bounty amount ( plus a standard + 10% Gitcoin platform fee ). + This covers our costs for finding quality contributors to join our platform so that you get the best work. + If your business requires additional assistance, please contact us founders@gitcoin.co + {% endblocktrans %} +

    +
    +
    +
    +

    +

    + (10%) +

    +
    +
    +
    +
    + {% endif %} + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    +
    {% trans "Total"%}
    +
    +
    +

    {% trans "Payment Due = " %}

    + +

    + ( Bounty 0 + ETH + + + {% if FEE_PERCENTAGE != 0 %} + + + 0 + ETH Gitcoin Platform Fee + {% else %} + + No Fees + {% endif %} + ) +

    +

    + You will have to approve + + {% if FEE_PERCENTAGE == 0 %} 1 {% else %} 2 {% endif %} + + Metamask confirmations. +

    +
    +
    +
    + + + + +
    +
    + +
    +
    + {% include 'shared/bottom_notification.html' %} + {% include 'shared/analytics.html' %} + {% include 'shared/footer_scripts.html' %} + {% include 'shared/footer.html' %} + {% include 'shared/messages.html' %} + + +{% include 'shared/current_profile.html' %} + + + + + + + + + + + + + + + + + + + diff --git a/app/dashboard/templates/shared/issue_details.html b/app/dashboard/templates/shared/issue_details.html index 96f89781e89..f1841d70e1a 100644 --- a/app/dashboard/templates/shared/issue_details.html +++ b/app/dashboard/templates/shared/issue_details.html @@ -39,63 +39,3 @@
    {% trans "Details" %}
    -
    - - -
    -
    - -
    - -
    -
    - {% if suggested_developers %} - Suggested Contributors: -
    - {% for contributor in suggested_developers %} -
  • - - {{ contributor.fulfiller_github_username }} - -
  • - {% endfor %} -
    - {% endif %} -
    -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    diff --git a/app/dashboard/templates/shared/pricing.html b/app/dashboard/templates/shared/pricing.html index 4a2f63159da..34d7da8ad36 100644 --- a/app/dashboard/templates/shared/pricing.html +++ b/app/dashboard/templates/shared/pricing.html @@ -40,5 +40,4 @@
    {% trans "Pricing" %}
    -
    diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 2de3c17fe3f..d61141e2505 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -2371,7 +2371,7 @@ def new_bounty(request): update=bounty_params, ) params['FEE_PERCENTAGE'] = request.user.profile.fee_percentage if request.user.is_authenticated else 10 - return TemplateResponse(request, 'bounty/new.html', params) + return TemplateResponse(request, 'bounty/fund.html', params) @csrf_exempt From 7f2c7b03c0de2f4bdfeab92f974559fc24e0f87e Mon Sep 17 00:00:00 2001 From: octavioamu Date: Tue, 7 May 2019 00:44:51 -0300 Subject: [PATCH 02/12] format form --- app/assets/v2/css/buttons.css | 18 ++++ app/assets/v2/css/gitcoin.css | 4 + app/assets/v2/js/amounts.js | 6 +- app/assets/v2/js/pages/new_bounty.js | 16 ++- app/assets/v2/js/shared.js | 14 ++- app/dashboard/templates/bounty/fund.html | 101 ++++++++++-------- .../templates/shared/issue_details.html | 96 ++++++++++++++++- app/dashboard/templates/shared/pricing.html | 12 +-- 8 files changed, 201 insertions(+), 66 deletions(-) diff --git a/app/assets/v2/css/buttons.css b/app/assets/v2/css/buttons.css index a9beacf144e..3bf42c04481 100644 --- a/app/assets/v2/css/buttons.css +++ b/app/assets/v2/css/buttons.css @@ -247,3 +247,21 @@ button:focus { .btn-lg-padding { padding: 0.6rem 2rem; } + +.btn-radio { + border: 2px solid #D3D3D3; +} + +.btn-radio.active { + border-color: #3E00FF; +} + +.btn-radio i { + color: #3E00FF; +} + +.badge-greylight { + background-color: #F3F3F3; + color: #666666; + font-weight: 600; +} diff --git a/app/assets/v2/css/gitcoin.css b/app/assets/v2/css/gitcoin.css index 0e2b02752a1..636f5f71353 100644 --- a/app/assets/v2/css/gitcoin.css +++ b/app/assets/v2/css/gitcoin.css @@ -261,6 +261,10 @@ div.button-pink { background-color: #EFF3F6; } +.bg-lightpurple { + background-color: #F5F2FF; +} + .white-light-bg { background-color: white; background-image: url('/static/v2/images/light-bg.png'); diff --git a/app/assets/v2/js/amounts.js b/app/assets/v2/js/amounts.js index 75b5f551cb4..01dad43546a 100644 --- a/app/assets/v2/js/amounts.js +++ b/app/assets/v2/js/amounts.js @@ -48,13 +48,13 @@ const get_rates_estimate = function(usd_amount) { } if (hours) { - rates_addon.push('' + hours + ' hrs at $' + round_rate + '/hr ' + success_prob.toFixed(0) + '% success rate
    '); + rates_addon.push(`${hours} hrs at $${round_rate}/hr leads to ${success_prob.toFixed(0)}% success rate. `); } else { - rates_addon.push('' + hours + ' hrs at $∞/hr ' + success_prob.toFixed(0) + '% success rate
    '); + rates_addon.push(`${hours} hrs at $∞/hr leads to ${success_prob.toFixed(0)}% success rate. `); } rates_addon = rates_addon.join(', '); - const help_addon = ' [Read our pricing guide]'; + const help_addon = 'Read our pricing guide.'; return (rates_addon + help_addon); }; diff --git a/app/assets/v2/js/pages/new_bounty.js b/app/assets/v2/js/pages/new_bounty.js index 19d093fbda2..6537a07f85e 100644 --- a/app/assets/v2/js/pages/new_bounty.js +++ b/app/assets/v2/js/pages/new_bounty.js @@ -712,7 +712,9 @@ $(window).on('load', function() { let checked = params.get('type'); toggleCtaPlan(checked); - $(`input[name=repo_type][value=${checked}]`).prop('checked', 'true'); + // $(`input[name=repo_type][value=${checked}]`).prop('checked', 'true'); + $(`.${checked}`).button('toggle') + } else { params.append('type', 'public'); window.history.replaceState({}, '', location.pathname + '?' + params); @@ -819,8 +821,13 @@ const setPrivateForm = () => { $('#nda-upload').show(); $('#issueNDA').prop('required', true); - $('#project_type').select2().val('traditional'); - $('#permission_type').select2().val('approval'); + // $('#project_type').select2().val('traditional'); + $('.traditional').button('toggle') + // $('#permission_type').select2().val('approval'); + $('.approval').button('toggle'); + $('.permissionless').addClass('disabled'); + $('.permissionless').children('input').attr('disabled', true); + $('#project_type, #permission_type').select2().prop('disabled', true).trigger('change'); $('#keywords').select2({ placeholder: 'Select tags', @@ -846,6 +853,9 @@ const setPublicForm = () => { $('#nda-upload').hide(); $('#issueNDA').prop('required', false); + $('.permissionless').removeClass('disabled'); + $('.permissionless').children('input').attr('disabled', false); + $('#project_type, #permission_type').select2().prop('disabled', false).trigger('change'); retrieveIssueDetails(); }; diff --git a/app/assets/v2/js/shared.js b/app/assets/v2/js/shared.js index d53dc6e78e7..e7e52a60fd8 100644 --- a/app/assets/v2/js/shared.js +++ b/app/assets/v2/js/shared.js @@ -8,11 +8,11 @@ * */ var show_modal_handler = (modalUrl) => { const url = modalUrl; - + return (e) => { var modals = $('#modal'); var modalBody = $('#modal .modal-content'); - + modals.off('show.bs.modal'); modals.on('show.bs.modal', () => { $('#modal .modal-content').load(modalUrl); @@ -283,17 +283,17 @@ var waitingStateActive = function() { const notify_funder = (network, std_bounties_id, data) => { var request_url = '/actions/bounty/' + network + '/' + std_bounties_id + '/notify/funder_payout_reminder/'; - + showBusyOverlay(); $.post(request_url, data).then(result => { hideBusyOverlay(); - + _alert({message: gettext('Sent payout reminder')}, 'success'); $('#notifyFunder a').addClass('disabled'); return true; }).fail(result => { hideBusyOverlay(); - + _alert({ message: gettext('got an error. please try again, or contact support@gitcoin.co') }, 'error'); }); }; @@ -676,6 +676,8 @@ var retrieveIssueDetails = function() { $.each(target_eles, function(i, ele) { ele.addClass('loading'); }); + $('#sync-issue').children('.fas').addClass('fa-spin'); + $.get(request_url, function(result) { result = sanitizeAPIResults(result); if (result['keywords']) { @@ -697,6 +699,8 @@ var retrieveIssueDetails = function() { $.each(target_eles, function(i, ele) { ele.removeClass('loading'); }); + $('#sync-issue').children('.fas').removeClass('fa-spin'); + }).fail(function() { $.each(target_eles, function(i, ele) { ele.removeClass('loading'); diff --git a/app/dashboard/templates/bounty/fund.html b/app/dashboard/templates/bounty/fund.html index bf56e50765b..4e4c9991754 100644 --- a/app/dashboard/templates/bounty/fund.html +++ b/app/dashboard/templates/bounty/fund.html @@ -49,53 +49,54 @@
    -

    {% trans "Fund Issue" %}

    -
    -

    Github Repo Type

    -
    - - -
    -
    - - -
    +
    +

    {% trans "Fund Issue" %}

    +

    Fund your GitHub issue and work with talented developers!

    +
    +

    Github Repo Type

    + + +
    + +
    -
    - + +
    +
    +
    Important Notes on Private Repo Bounties
    +
      +
    • Please make sure you are the repo admin to fund the issue
    • +
    • Gitcoin will NOT have any access to your private repo
    • +
    • You have to approve and give repository access to each contributor before they can start work
    • +
    • You can upload an NDA that each contributor has to sign before they can start work
    • +
    +
    +
    + +
    -
    - -
    -
    {% trans "About" %}
    - +

    {% trans "Last Synced " %}

    -
    @@ -108,6 +109,20 @@
    {% trans "About" %}
    + + {% include 'shared/pricing.html' %}
    @@ -142,12 +157,8 @@
    {% trans "About" %}
    -
    - +
    +
    diff --git a/app/dashboard/templates/shared/issue_details.html b/app/dashboard/templates/shared/issue_details.html index f1841d70e1a..7ef1ace5854 100644 --- a/app/dashboard/templates/shared/issue_details.html +++ b/app/dashboard/templates/shared/issue_details.html @@ -16,21 +16,109 @@ {% endcomment %} {% load i18n %}
    {% trans "Details" %}
    +
    +
    + +
    + +
    + +
    +
    + +
    +
    + -
    + -
    +
    +
    + +
    +
    + +
    + +
    +
    diff --git a/app/dashboard/templates/shared/pricing.html b/app/dashboard/templates/shared/pricing.html index 34d7da8ad36..f833bac2f3a 100644 --- a/app/dashboard/templates/shared/pricing.html +++ b/app/dashboard/templates/shared/pricing.html @@ -17,27 +17,27 @@ {% load i18n %}
    {% trans "Pricing" %}
    -
    -
    +
    +
    -
    +
    -
    +
    -
    +
    - +
    From 81fa4ba06e75f6e68e1dc16b6e639d737d8aa264 Mon Sep 17 00:00:00 2001 From: octavioamu Date: Tue, 7 May 2019 20:22:57 -0300 Subject: [PATCH 03/12] add styles --- app/assets/v2/css/forms/select.css | 1 - app/assets/v2/css/gitcoin.css | 4 + app/assets/v2/css/submit_bounty.css | 10 +- app/assets/v2/js/pages/new_bounty.js | 4 +- app/dashboard/templates/bounty/fund.html | 272 +++++++++--------- app/dashboard/templates/shared/featured.html | 1 - .../templates/shared/issue_deadline.html | 30 +- .../templates/shared/issue_details.html | 6 +- app/dashboard/templates/shared/pricing.html | 6 +- 9 files changed, 170 insertions(+), 164 deletions(-) diff --git a/app/assets/v2/css/forms/select.css b/app/assets/v2/css/forms/select.css index 5bc92b278f1..368ea637567 100644 --- a/app/assets/v2/css/forms/select.css +++ b/app/assets/v2/css/forms/select.css @@ -6,7 +6,6 @@ .form__select2 { display: flex; - height: 100%; } .form__select__icon { diff --git a/app/assets/v2/css/gitcoin.css b/app/assets/v2/css/gitcoin.css index 636f5f71353..937a833fc70 100644 --- a/app/assets/v2/css/gitcoin.css +++ b/app/assets/v2/css/gitcoin.css @@ -50,6 +50,10 @@ h4, color: #3e24fb } +.text-darkblue { + color: var(--gc-purple); +} + .gitcoin-gray { color: lightgray !important; } diff --git a/app/assets/v2/css/submit_bounty.css b/app/assets/v2/css/submit_bounty.css index f45016fcc09..2f184928b60 100644 --- a/app/assets/v2/css/submit_bounty.css +++ b/app/assets/v2/css/submit_bounty.css @@ -167,11 +167,6 @@ input:read-only { color: #3E00FF; } -#total-section { - border-top: 1px solid #000000; - border-bottom: 1px solid #000000; -} - @media (max-width: 767.98px) { .select2-container { max-width: 100%; @@ -213,7 +208,6 @@ input:read-only { align-items: center; justify-content: space-between; padding: 1em 0; - font-weight: bold; border-bottom: 1px solid #e5e5e5; transition: all .3s linear; } @@ -233,3 +227,7 @@ input:read-only { .collapse-header.collapsed .fa:before { content: "\f078"; } + +.letter-spacing { + letter-spacing: 0.1em; +} diff --git a/app/assets/v2/js/pages/new_bounty.js b/app/assets/v2/js/pages/new_bounty.js index 6537a07f85e..a33302f88ff 100644 --- a/app/assets/v2/js/pages/new_bounty.js +++ b/app/assets/v2/js/pages/new_bounty.js @@ -204,8 +204,8 @@ $(document).ready(function() { waitforWeb3(function() { promptForAuth(); }); - $('select[name=permission_type]').on('change', function() { - var val = $('select[name=permission_type] option:selected').val(); + $('[name=permission_type]').on('change', function() { + var val = $('input[name=permission_type]:checked').val() if (val === 'approval') { $('#auto_approve_workers_container').show(); diff --git a/app/dashboard/templates/bounty/fund.html b/app/dashboard/templates/bounty/fund.html index 4e4c9991754..3a6305d8600 100644 --- a/app/dashboard/templates/bounty/fund.html +++ b/app/dashboard/templates/bounty/fund.html @@ -52,9 +52,9 @@

    {% trans "Fund Issue" %}

    -

    Fund your GitHub issue and work with talented developers!

    -
    -

    Github Repo Type

    +

    Fund your GitHub issue and work with talented developers!

    +
    +

    Github Repo Type

    - +