Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project_types (formerly work schemes) #1098

Merged
merged 49 commits into from
Jun 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
39c5bc3
work schemes
owocki May 7, 2018
958af75
work schemes
owocki May 7, 2018
d17cbd0
enforce limits on # ppl starting work
owocki May 8, 2018
0f2bf25
work scheme on profile
owocki May 8, 2018
d47279c
small copy change
owocki May 20, 2018
b026b09
Merge branch 'master' into kevin/application_schemes
owocki May 20, 2018
3a78bc2
thread the application
owocki May 20, 2018
9935daf
make fix
owocki May 20, 2018
47d23d4
syntax fixes vai make fix
owocki May 20, 2018
6d7f957
todos
owocki May 21, 2018
0754839
quick update
owocki May 22, 2018
b1139db
Merge branch 'master' into kevin/application_schemes
mbeacom May 23, 2018
27b8c22
Stickler fixes, move work scheme fulfillment to method, rebuild migra…
mbeacom May 23, 2018
46accfe
Merge branch 'master' into kevin/application_schemes
owocki May 30, 2018
2bacec1
Merge branch 'kevin/application_schemes' of github.com:gitcoinco/web …
owocki May 30, 2018
405b4e7
Merge mgiration, also migrates work type / schemes to project type
owocki May 30, 2018
5cef237
docker-compose was wrong
owocki May 30, 2018
bdee8b5
approval required as a default"
owocki May 30, 2018
5bd8d39
for contests, make it so it's open even if it's started
owocki May 30, 2018
39ea65b
all the app schema emails
owocki May 30, 2018
2b08d62
make fix
owocki May 30, 2018
48eb347
qa and notifications
owocki May 30, 2018
2f2bacb
Merge branch 'master' into kevin/application_schemes
owocki May 30, 2018
cb9424c
Merge branch 'master' into kevin/application_schemes
mbeacom May 31, 2018
c07282a
Update migrations
mbeacom May 31, 2018
236c6e0
Merge branch 'master' into kevin/application_schemes
owocki Jun 4, 2018
1594b31
merge migrations
owocki Jun 4, 2018
108111b
copy
owocki Jun 4, 2018
0e4d39d
code review
owocki Jun 4, 2018
97fbeff
dupe msgs
owocki Jun 4, 2018
000a522
copy update
owocki Jun 4, 2018
02a1cf3
copy
owocki Jun 4, 2018
e7c0d12
Stickler
mbeacom Jun 4, 2018
f92d7c2
Stickler
mbeacom Jun 4, 2018
74f7366
bugfxi
owocki Jun 4, 2018
2e2df39
Merge branch 'kevin/application_schemes' of github.com:gitcoinco/web …
owocki Jun 4, 2018
e250e8a
acceptance date
owocki Jun 4, 2018
403b5ee
acceptance date
owocki Jun 4, 2018
fd6d0c3
html tab sizing
owocki Jun 4, 2018
437e154
Remove merge migration and reorder migrations
mbeacom Jun 4, 2018
2d9a51c
show dibs still for traditional bounties
owocki Jun 4, 2018
b10d293
Merge branch 'kevin/application_schemes' of github.com:gitcoinco/web …
owocki Jun 4, 2018
e8e3041
alisa feedbak -- select forms
owocki Jun 4, 2018
9a9486b
Revert "alisa feedbak -- select forms"
owocki Jun 4, 2018
d3b0ebe
Add pending copy to test interest assertion
mbeacom Jun 4, 2018
7a7525d
Trim whitespace
mbeacom Jun 4, 2018
e1fdfea
removes tooltip from all select2, also removes searchbar from all but…
owocki Jun 4, 2018
1694d5a
Merge branch 'kevin/application_schemes' of github.com:gitcoinco/web …
owocki Jun 4, 2018
8e1bf64
Stickler
mbeacom Jun 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
- Epic 1 [\#1125](https://github.com/gitcoinco/web/issues/1125)
- nginx Doesn't Seem to Recognize \(or Direct Properly\) www.gitcoin.co [\#1122](https://github.com/gitcoinco/web/issues/1122)
- As a user, I want to be prompted to authenticate before seeing a start work modal [\#1107](https://github.com/gitcoinco/web/issues/1107)
- How to surface work schemes to the community [\#1106](https://github.com/gitcoinco/web/issues/1106)
- How to surface Project Types to the community [\#1106](https://github.com/gitcoinco/web/issues/1106)
- Make Image a Thumbnail for Long Descriptions [\#1105](https://github.com/gitcoinco/web/issues/1105)
- BUILD - As a funder \(Project recruiter\), I want a place where I can track all my stuff, so i can have a flow of web3.0 talent [\#1092](https://github.com/gitcoinco/web/issues/1092)
- As a member of the community, I want these Profile Privacy Features, so I can be more private [\#1091](https://github.com/gitcoinco/web/issues/1091)
Expand Down
33 changes: 32 additions & 1 deletion app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,38 @@
tdi.views.process_accesscode_request,
name='process_accesscode_request'
),
url(
re_path(
r'^_administration/process_faucet_request/(.*)$',
faucet.views.process_faucet_request,
name='process_faucet_request'
),
re_path(
r'^_administration/email/start_work_approved$', retail.emails.start_work_approved, name='start_work_approved'
),
re_path(
r'^_administration/email/start_work_rejected$', retail.emails.start_work_rejected, name='start_work_rejected'
),
re_path(
r'^_administration/email/start_work_new_applicant$',
retail.emails.start_work_new_applicant,
name='start_work_new_applicant'
),
re_path(
r'^_administration/email/start_work_applicant_about_to_expire$',
retail.emails.start_work_applicant_about_to_expire,
name='start_work_applicant_about_to_expire'
),
re_path(
r'^_administration/email/start_work_applicant_expired$',
retail.emails.start_work_applicant_expired,
name='start_work_applicant_expired'
),
re_path(
r'^_administration/process_accesscode_request/(.*)$',
tdi.views.process_accesscode_request,
name='process_accesscode_request'
),
re_path(
r'^_administration/process_faucet_request/(.*)$',
faucet.views.process_faucet_request,
name='process_faucet_request'
Expand Down
2 changes: 2 additions & 0 deletions app/assets/v2/css/bounty.css
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ body {
padding: 5px;
}

.red_warning,
#network {
background-color: #fbe0d6;
color: #fb9470;
Expand All @@ -200,6 +201,7 @@ body {
display: block;
}

.red_warning a,
#network a{
color: #fb9470;
font-weight: bold;
Expand Down
25 changes: 19 additions & 6 deletions app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ var rows = [
'token_value_time_peg',
'web3_created',
'status',
'project_type',
'permission_type',
'bounty_owner_address',
'bounty_owner_email',
'issue_description',
Expand Down Expand Up @@ -136,6 +138,15 @@ var callbacks = {
'bounty_owner_name': function(key, val, result) {
return [ 'bounty_owner_name', result.bounty_owner_name ];
},
'permission_type': function(key, val, result) {
if (val == 'approval') {
val = 'Approval Required';
}
return [ 'permission_type', ucwords(val) ];
},
'project_type': function(key, val, result) {
return [ 'project_type', ucwords(result.project_type) ];
},
'issue_keywords': function(key, val, result) {
if (!result.keywords || result.keywords.length == 0)
return [ 'issue_keywords', null ];
Expand Down Expand Up @@ -416,7 +427,7 @@ var attach_work_actions = function() {
e.preventDefault();
if ($(this).attr('href') == '/interested') {
show_interest_modal.call(this);
} else if (confirm(gettext('Are you sure you want to remove your interest?'))) {
} else if (confirm(gettext('Are you sure you want to stop work?'))) {
$(this).attr('href', '/interested');
$(this).find('span').text('Start Work');
remove_interest(document.result['pk']);
Expand All @@ -429,7 +440,9 @@ var show_interest_modal = function() {
var self = this;

setTimeout(function() {
$.get('/interest/modal?redirect=' + window.location.pathname, function(newHTML) {
var url = '/interest/modal?redirect=' + window.location.pathname + '&pk=' + document.result['pk'];

$.get(url, function(newHTML) {
var modal = $(newHTML).appendTo('body').modal({
modalClass: 'modal add-interest-modal'
});
Expand Down Expand Up @@ -538,7 +551,8 @@ var do_actions = function(result) {
pull_interest_list(result['pk'], function(is_interested) {

// which actions should we show?
var show_start_stop_work = is_still_on_happy_path;
var should_block_from_starting_work = !is_interested && result['project_type'] == 'traditional' && (result['status'] == 'started' || result['status'] == 'submitted');
var show_start_stop_work = is_still_on_happy_path && !should_block_from_starting_work;
var show_github_link = result['github_url'].substring(0, 4) == 'http';
var show_submit_work = true;
var show_kill_bounty = !is_status_done && !is_status_expired && !is_status_cancelled;
Expand Down Expand Up @@ -626,8 +640,7 @@ var do_actions = function(result) {
href: result['action_urls']['increase'],
text: gettext('Add Contribution'),
parent: 'right_actions',
title: gettext('Increase the funding for this issue'),
color: 'white'
title: gettext('Increase the funding for this issue')
};

actions.push(_entry);
Expand Down Expand Up @@ -746,7 +759,7 @@ var render_activity = function(result) {
activities.push({
profileId: _interested.profile.id,
name: _interested.profile.handle,
text: gettext('Work Started'),
text: _interested.pending ? gettext('Worker Applied') : gettext('Work Started'),
created_on: _interested.created,
age: timeDifference(new Date(result['now']), new Date(_interested.created)),
status: 'started',
Expand Down
9 changes: 6 additions & 3 deletions app/assets/v2/js/pages/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ var sidebar_keys = [
'bounty_filter',
'network',
'idx_status',
'tech_stack'
'tech_stack',
'project_type',
'permission_type'
];

var localStorage;
Expand Down Expand Up @@ -457,9 +459,10 @@ var refreshBounties = function(event) {
result.action = result['url'];
result['title'] = result['title'] ? result['title'] : result['github_url'];

var project_type = ucwords(result['project_type']) + ' • ';

result['p'] = ((result['experience_level'] ? result['experience_level'] + ' • ' : ''));

result['p'] = project_type + (result['experience_level'] ? result['experience_level'] + ' • ' : '');
if (result['status'] === 'done')
result['p'] += 'Done';
if (result['fulfillment_accepted_on']) {
Expand Down
35 changes: 34 additions & 1 deletion app/assets/v2/js/pages/new_bounty.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ $(document).ready(function() {
} else if (localStorage['issueURL']) {
$('input[name=issueURL]').val(localStorage['issueURL']);
}
if (localStorage['project_type']) {
$('select[name=project_type] option').prop('selected', false);
$(
"select[name=project_type] option[value='" +
localStorage['project_type'] +
"']"
).prop('selected', true);
}
if (localStorage['permission_type']) {
$('select[name=permission_type] option').prop('selected', false);
$(
"select[name=permission_type] option[value='" +
localStorage['permission_type'] +
"']"
).prop('selected', true);
}
if (localStorage['expirationTimeDelta']) {
$('select[name=expirationTimeDelta] option').prop('selected', false);
$(
Expand Down Expand Up @@ -84,10 +100,21 @@ $(document).ready(function() {
}
$('input[name=issueURL]').focus();

$('select[name=deonomination]').select2();
// all js select 2 fields
$('.js-select2').each(function() {
$(this).select2();
});
// removes tooltip
$('select').on('change', function(evt) {
$('.select2-selection__rendered').removeAttr('title');
});
// removes search field in all but the 'denomination' dropdown
$('.select2-container').click(function() {
$('.select2-container .select2-search__field').remove();
});
// denomination field
$('select[name=deonomination]').select2();


$('#advancedLink a').click(function(e) {
e.preventDefault();
Expand Down Expand Up @@ -172,6 +199,10 @@ $(document).ready(function() {
githubUsername: metadata.githubUsername,
address: '' // Fill this in later
},
schemes: {
project_type: data.project_type,
permission_type: data.permission_type
},
privacy_preferences: privacy_preferences,
funders: [],
categories: metadata.issueKeywords.split(','),
Expand All @@ -196,6 +227,8 @@ $(document).ready(function() {
$(this).attr('disabled', 'disabled');

// save off local state for later
localStorage['project_type'] = data.project_type;
localStorage['permission_type'] = data.permission_type;
localStorage['issueURL'] = issueURL;
localStorage['amount'] = amount;
localStorage['notificationEmail'] = notificationEmail;
Expand Down
22 changes: 14 additions & 8 deletions app/assets/v2/js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ var sanitizeAPIResults = function(results) {
return results;
};

function ucwords(str) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Php :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you know it !

return (str + '').replace(/^([a-z])|\s+([a-z])/g, function($1) {
return $1.toUpperCase();
});
}

var sanitize = function(str) {
if (typeof str != 'string') {
return str;
Expand Down Expand Up @@ -193,17 +199,17 @@ var mutate_interest = function(bounty_pk, direction, data) {
.toggleClass('button')
.toggleClass('button--primary');

if (direction === 'new') {
_alert({ message: gettext("Thanks for letting us know that you're ready to start work.") }, 'success');
$('#interest a').attr('id', 'btn-white');
} else if (direction === 'remove') {
_alert({ message: gettext("You've stopped working on this, thanks for letting us know.") }, 'success');
$('#interest a').attr('id', '');
}

$.post(request_url, data).then(function(result) {
result = sanitizeAPIResults(result);
if (result.success) {
if (direction === 'new') {
_alert({ message: result.msg }, 'success');
$('#interest a').attr('id', 'btn-white');
} else if (direction === 'remove') {
_alert({ message: result.msg }, 'success');
$('#interest a').attr('id', '');
}

pull_interest_list(bounty_pk);
return true;
}
Expand Down
2 changes: 2 additions & 0 deletions app/dashboard/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ def create_new_bounty(old_bounties, bounty_payload, bounty_details, bounty_id):
accepted=accepted,
interested_comment=interested_comment_id,
submissions_comment=submissions_comment_id,
project_type=bounty_payload.get('schemes', {}).get('project_type', 'traditional'),
permission_type=bounty_payload.get('schemes', {}).get('permission_type', 'permissionless'),
privacy_preferences=bounty_payload.get('privacy_preferences', {}),
# These fields are after initial bounty creation, in bounty_details.js
expires_date=timezone.make_aware(
Expand Down
39 changes: 39 additions & 0 deletions app/dashboard/migrations/0084_auto_20180604_1723.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 2.0.5 on 2018-06-04 17:23

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('dashboard', '0083_merge_20180601_1945'),
]

operations = [
migrations.AddField(
model_name='bounty',
name='permission_type',
field=models.CharField(choices=[('permissionless', 'permissionless'), ('approval', 'approval')], default='permissionless', max_length=50),
),
migrations.AddField(
model_name='bounty',
name='project_type',
field=models.CharField(choices=[('traditional', 'traditional'), ('contest', 'contest'), ('cooperative', 'cooperative')], default='traditional', max_length=50),
),
migrations.AddField(
model_name='interest',
name='acceptance_date',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AddField(
model_name='interest',
name='pending',
field=models.BooleanField(default=False, help_text='If this option is chosen, this interest is pending and not yet active'),
),
migrations.AlterField(
model_name='bounty',
name='bounty_owner_profile',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='bounties_funded', to='dashboard.Profile'),
),
]
Loading