From 38b76b7a23b845a5002866c115791a0ec0e6fbfd Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Fri, 3 Apr 2020 19:25:30 +0530 Subject: [PATCH] purge: milestones + updates --- app/app/fixtures/grants.json | 269 +++++++++++++++++- app/assets/v2/css/grants/detail.css | 4 - app/assets/v2/css/grants/milestones.css | 143 ---------- app/assets/v2/js/grants/milestones.js | 38 --- app/dashboard/models.py | 2 - app/grants/admin.py | 19 +- app/grants/forms.py | 31 +- app/grants/models.py | 59 ---- app/grants/serializers.py | 15 +- .../templates/grants/detail/summary.html | 81 ------ app/grants/templates/grants/detail/tabs.html | 6 - app/grants/templates/grants/milestones.html | 101 ------- app/grants/urls.py | 3 +- app/grants/views.py | 65 +---- app/inbox/models.py | 2 - scripts/debug/migrate_grant.py | 7 - scripts/debug/retry_kudostransfer.py | 39 --- 17 files changed, 275 insertions(+), 609 deletions(-) delete mode 100644 app/assets/v2/css/grants/milestones.css delete mode 100644 app/assets/v2/js/grants/milestones.js delete mode 100644 app/grants/templates/grants/detail/summary.html delete mode 100644 app/grants/templates/grants/milestones.html delete mode 100644 scripts/debug/retry_kudostransfer.py diff --git a/app/app/fixtures/grants.json b/app/app/fixtures/grants.json index 0c233b3c119..a1a71d80346 100644 --- a/app/app/fixtures/grants.json +++ b/app/app/fixtures/grants.json @@ -1 +1,268 @@ -[{"model": "grants.grant", "pk": 1, "fields": {"created_on": "2019-09-08T18:08:52Z", "modified_on": "2019-09-11T01:24:49.728Z", "active": true, "title": "Go Fund My Test Grant", "slug": "go-fund-my-test-grant", "description": "My test dapp", "description_rich": "{\"ops\":[{\"insert\":\"My test dapp\\t\\n\"}]}", "reference_url": "http://testdapp.com", "logo": "", "logo_svg": "", "admin_address": "0xBcAfdD642118e5536024675e776d32413728dd08", "contract_owner_address": "0xBcAfdD642118e5536024675e776d32413728dd08", "amount_goal": "50.0000", "monthly_amount_subscribed": "0.0000", "amount_received": "5.0000", "token_address": "0x8f2e097e79b1c51be9cba42658862f0192c3e487", "token_symbol": "DAI", "contract_address": "0x3DDDC3Bedc5e9E65139d3Ee89E25fa32022dbE2f", "deploy_tx_id": "0x4bfa9e3469d8e5feb66ee00f94b7eea7b0d3518bee00a797c2d8cb52a7b39c3c", "cancel_tx_id": "0x0", "contract_version": "1", "metadata": {}, "network": "rinkeby", "required_gas_price": "0", "admin_profile": 17, "image_css": "", "clr_matching": "0.00", "activeSubscriptions": "[]", "hidden": false, "team_members": [33]}}, {"model": "grants.grant", "pk": 2, "fields": {"created_on": "2019-09-08T18:09:55.040Z", "modified_on": "2019-09-12T20:00:27.777Z", "active": true, "title": "Another grant for me", "slug": "another-grant-for-me", "description": "Keep that ETH rolling in\n", "description_rich": "{\"ops\":[{\"insert\":\"Keep that ETH rolling in\\n\"}]}", "reference_url": "https://mygrantisbetterthanyours.com", "logo": "", "logo_svg": "", "admin_address": "0xE643cD48A9A902F6cE947324abE245b3Fe4106dc", "contract_owner_address": "0xBcAfdD642118e5536024675e776d32413728dd08", "amount_goal": "100000.0000", "monthly_amount_subscribed": "47.5000", "amount_received": "0.0000", "token_address": "0x0000000000000000000000000000000000000000", "token_symbol": "Any Token", "contract_address": "0x3DF0d9C54782fB6fbA3ca707a44f4F0bFA0E2816", "deploy_tx_id": "0xf5928a85110f95b3c98f50364fad83a3dea9af827beb5b4ec94fd6a9f01349ef", "cancel_tx_id": "0x0", "contract_version": "1", "metadata": {}, "network": "rinkeby", "required_gas_price": "0", "admin_profile": 33, "image_css": "", "clr_matching": "0.00", "activeSubscriptions": "[]", "hidden": false, "team_members": [33]}}, {"model": "grants.grant", "pk": 3, "fields": {"created_on": "2019-09-12T22:28:04.895Z", "modified_on": "2019-09-13T15:15:57.223Z", "active": true, "title": "My test grant x3!!", "slug": "my-test-grant-x3", "description": "I still want your money\n", "description_rich": "{\"ops\":[{\"insert\":\"I still want your money\\n\"}]}", "reference_url": "https://www.givemeallyourdai.com", "logo": "", "logo_svg": "", "admin_address": "0xCC4b3DE30576E161C8632786560Fa7DD3Fb33f77", "contract_owner_address": "", "amount_goal": "100000.0000", "monthly_amount_subscribed": "0.0000", "amount_received": "5.0000", "token_address": "0x0000000000000000000000000000000000000000", "token_symbol": "Any Token", "contract_address": "0x8EE490C5BfE279B5A09CA160032a6DE48eDB7897", "deploy_tx_id": "0x17e1c3ac6df1f930719c2013c78acc603601d394e54656faf448eaa7e9fd3ec8", "cancel_tx_id": "0x0", "contract_version": "1", "metadata": {}, "network": "rinkeby", "required_gas_price": "0", "admin_profile": 33, "image_css": "", "clr_matching": "0.00", "activeSubscriptions": "[]", "hidden": false, "team_members": [33]}}, {"model": "grants.milestone", "pk": 1, "fields": {"created_on": "2019-09-09T00:54:25.476Z", "modified_on": "2019-09-09T00:54:25.477Z", "title": "Milestone 1", "description": "Git paid", "due_date": "2099-10-10", "completion_date": null, "grant": 2}}, {"model": "grants.update", "pk": 1, "fields": {"created_on": "2019-09-09T00:54:06.387Z", "modified_on": "2019-09-09T00:54:06.387Z", "title": "Update 1 ", "description": "Still working on this!", "grant": 2}}, {"model": "grants.subscription", "pk": 1, "fields": {"created_on": "2019-09-11T01:24:15.569Z", "modified_on": "2019-09-11T01:24:49.719Z", "active": true, "error": true, "subminer_comments": "skipping subminer bc this is a 1 and done subscription, and tokens were alredy sent", "subscription_hash": "onetime", "contributor_signature": "onetime", "contributor_address": "0xCC4b3DE30576E161C8632786560Fa7DD3Fb33f77", "amount_per_period": "5.000000000000000000", "real_period_seconds": "0", "frequency_unit": "days", "frequency": "30", "token_address": "0x8f2e097e79b1c51be9cba42658862f0192c3e487", "token_symbol": "DAI", "gas_price": "250.0000", "new_approve_tx_id": "0xd89376ee2a96557f4e9038ae59610b590987e48994d45b55ba6588e171d0678b", "end_approve_tx_id": "0x0", "cancel_tx_id": "0x0", "num_tx_approved": "1.0000", "num_tx_processed": "1.0000", "network": "rinkeby", "grant": 1, "contributor_profile": 33, "last_contribution_date": "2019-09-11T01:24:15.576Z", "next_contribution_date": "2019-09-11T01:24:15.576Z", "amount_per_period_usdt": "4.999999999999999946"}}, {"model": "grants.subscription", "pk": 2, "fields": {"created_on": "2019-09-12T20:00:23.710Z", "modified_on": "2019-09-12T20:00:27.760Z", "active": true, "error": false, "subminer_comments": "", "subscription_hash": "0x7d23d7d35f024f4c40708c8b18948bff60b6e7715e41528e62434be2251a6252", "contributor_signature": "0xbbb8fbab1835a0b653b9c98618c2aac2991e62ef6bb3019fe2cd43770d3447712f1c1a7104595261eedb0bf9ad5b51873d1fd934d974251b638b0a9c112851831c", "contributor_address": "0xBcAfdD642118e5536024675e776d32413728dd08", "amount_per_period": "47.500000000000000000", "real_period_seconds": "2592000", "frequency_unit": "days", "frequency": "30", "token_address": "0x8f2e097e79b1c51be9cba42658862f0192c3e487", "token_symbol": "DAI", "gas_price": "2500.0000", "new_approve_tx_id": "0x49d52af7bdfaf14224f22f6466550ca61b8261593e68be4bd11ac42ddafcf99a", "end_approve_tx_id": "0x0", "cancel_tx_id": "0x0", "num_tx_approved": "12.0000", "num_tx_processed": "0.0000", "network": "rinkeby", "grant": 2, "contributor_profile": 30, "last_contribution_date": "1990-01-01T00:00:00Z", "next_contribution_date": "1990-01-01T00:00:00Z", "amount_per_period_usdt": "0E-18"}}, {"model": "grants.subscription", "pk": 3, "fields": {"created_on": "2019-09-13T15:15:23.038Z", "modified_on": "2019-09-13T15:15:57.205Z", "active": true, "error": true, "subminer_comments": "skipping subminer bc this is a 1 and done subscription, and tokens were alredy sent", "subscription_hash": "onetime", "contributor_signature": "onetime", "contributor_address": "0xCC4b3DE30576E161C8632786560Fa7DD3Fb33f77", "amount_per_period": "5.000000000000000000", "real_period_seconds": "0", "frequency_unit": "days", "frequency": "30", "token_address": "0x8f2e097e79b1c51be9cba42658862f0192c3e487", "token_symbol": "DAI", "gas_price": "250.0000", "new_approve_tx_id": "0x723b608a34521a9ddade1cc8d8f2b720edddd1db7dd2c2fdeb04b046fab32251", "end_approve_tx_id": "0x0", "cancel_tx_id": "0x0", "num_tx_approved": "1.0000", "num_tx_processed": "1.0000", "network": "rinkeby", "grant": 3, "contributor_profile": 30, "last_contribution_date": "2019-09-13T15:15:23.043Z", "next_contribution_date": "2019-09-13T15:15:23.043Z", "amount_per_period_usdt": "4.999999999999999946"}}, {"model": "grants.subscription", "pk": 4, "fields": {"created_on": "2019-09-13T15:16:15.929Z", "modified_on": "2019-09-13T15:16:15.929Z", "active": false, "error": false, "subminer_comments": "", "subscription_hash": "", "contributor_signature": "", "contributor_address": "0xCC4b3DE30576E161C8632786560Fa7DD3Fb33f77", "amount_per_period": "475.000000000000000000", "real_period_seconds": "2592000", "frequency_unit": "days", "frequency": "30", "token_address": "0x8f2e097e79b1c51be9cba42658862f0192c3e487", "token_symbol": "DAI", "gas_price": "25000.0000", "new_approve_tx_id": "0x980ce738853f454c83d5551dc086a29d2d89781fb041a9ce581474ffdf639de4", "end_approve_tx_id": "0x0", "cancel_tx_id": "0x0", "num_tx_approved": "12.0000", "num_tx_processed": "0.0000", "network": "rinkeby", "grant": 3, "contributor_profile": 30, "last_contribution_date": "1990-01-01T00:00:00Z", "next_contribution_date": "1990-01-01T00:00:00Z", "amount_per_period_usdt": "0E-18"}}, {"model": "grants.contribution", "pk": 1, "fields": {"created_on": "2019-09-11T01:24:15.576Z", "modified_on": "2019-09-11T01:24:15.576Z", "success": true, "tx_cleared": false, "tx_id": "0xd89376ee2a96557f4e9038ae59610b590987e48994d45b55ba6588e171d0678b", "subscription": 1}}, {"model": "grants.contribution", "pk": 2, "fields": {"created_on": "2019-09-13T15:15:23.043Z", "modified_on": "2019-09-13T15:15:23.043Z", "success": true, "tx_cleared": false, "tx_id": "0x723b608a34521a9ddade1cc8d8f2b720edddd1db7dd2c2fdeb04b046fab32251", "subscription": 3}}] \ No newline at end of file +[ + { + "model": "grants.grant", + "pk": 1, + "fields": { + "created_on": "2019-09-08T18:08:52Z", + "modified_on": "2019-09-11T01:24:49.728Z", + "active": true, + "title": "Go Fund My Test Grant", + "slug": "go-fund-my-test-grant", + "description": "My test dapp", + "description_rich": "{\"ops\":[{\"insert\":\"My test dapp\\t\\n\"}]}", + "reference_url": "http://testdapp.com", + "logo": "", + "logo_svg": "", + "admin_address": "0xBcAfdD642118e5536024675e776d32413728dd08", + "contract_owner_address": "0xBcAfdD642118e5536024675e776d32413728dd08", + "amount_goal": "50.0000", + "monthly_amount_subscribed": "0.0000", + "amount_received": "5.0000", + "token_address": "0x8f2e097e79b1c51be9cba42658862f0192c3e487", + "token_symbol": "DAI", + "contract_address": "0x3DDDC3Bedc5e9E65139d3Ee89E25fa32022dbE2f", + "deploy_tx_id": "0x4bfa9e3469d8e5feb66ee00f94b7eea7b0d3518bee00a797c2d8cb52a7b39c3c", + "cancel_tx_id": "0x0", + "contract_version": "1", + "metadata": {}, + "network": "rinkeby", + "required_gas_price": "0", + "admin_profile": 17, + "image_css": "", + "clr_matching": "0.00", + "activeSubscriptions": "[]", + "hidden": false, + "team_members": [ + 33 + ] + } + }, + { + "model": "grants.grant", + "pk": 2, + "fields": { + "created_on": "2019-09-08T18:09:55.040Z", + "modified_on": "2019-09-12T20:00:27.777Z", + "active": true, + "title": "Another grant for me", + "slug": "another-grant-for-me", + "description": "Keep that ETH rolling in\n", + "description_rich": "{\"ops\":[{\"insert\":\"Keep that ETH rolling in\\n\"}]}", + "reference_url": "https://mygrantisbetterthanyours.com", + "logo": "", + "logo_svg": "", + "admin_address": "0xE643cD48A9A902F6cE947324abE245b3Fe4106dc", + "contract_owner_address": "0xBcAfdD642118e5536024675e776d32413728dd08", + "amount_goal": "100000.0000", + "monthly_amount_subscribed": "47.5000", + "amount_received": "0.0000", + "token_address": "0x0000000000000000000000000000000000000000", + "token_symbol": "Any Token", + "contract_address": "0x3DF0d9C54782fB6fbA3ca707a44f4F0bFA0E2816", + "deploy_tx_id": "0xf5928a85110f95b3c98f50364fad83a3dea9af827beb5b4ec94fd6a9f01349ef", + "cancel_tx_id": "0x0", + "contract_version": "1", + "metadata": {}, + "network": "rinkeby", + "required_gas_price": "0", + "admin_profile": 33, + "image_css": "", + "clr_matching": "0.00", + "activeSubscriptions": "[]", + "hidden": false, + "team_members": [ + 33 + ] + } + }, + { + "model": "grants.grant", + "pk": 3, + "fields": { + "created_on": "2019-09-12T22:28:04.895Z", + "modified_on": "2019-09-13T15:15:57.223Z", + "active": true, + "title": "My test grant x3!!", + "slug": "my-test-grant-x3", + "description": "I still want your money\n", + "description_rich": "{\"ops\":[{\"insert\":\"I still want your money\\n\"}]}", + "reference_url": "https://www.givemeallyourdai.com", + "logo": "", + "logo_svg": "", + "admin_address": "0xCC4b3DE30576E161C8632786560Fa7DD3Fb33f77", + "contract_owner_address": "", + "amount_goal": "100000.0000", + "monthly_amount_subscribed": "0.0000", + "amount_received": "5.0000", + "token_address": "0x0000000000000000000000000000000000000000", + "token_symbol": "Any Token", + "contract_address": "0x8EE490C5BfE279B5A09CA160032a6DE48eDB7897", + "deploy_tx_id": "0x17e1c3ac6df1f930719c2013c78acc603601d394e54656faf448eaa7e9fd3ec8", + "cancel_tx_id": "0x0", + "contract_version": "1", + "metadata": {}, + "network": "rinkeby", + "required_gas_price": "0", + "admin_profile": 33, + "image_css": "", + "clr_matching": "0.00", + "activeSubscriptions": "[]", + "hidden": false, + "team_members": [ + 33 + ] + } + }, + { + "model": "grants.subscription", + "pk": 1, + "fields": { + "created_on": "2019-09-11T01:24:15.569Z", + "modified_on": "2019-09-11T01:24:49.719Z", + "active": true, + "error": true, + "subminer_comments": "skipping subminer bc this is a 1 and done subscription, and tokens were alredy sent", + "subscription_hash": "onetime", + "contributor_signature": "onetime", + "contributor_address": "0xCC4b3DE30576E161C8632786560Fa7DD3Fb33f77", + "amount_per_period": "5.000000000000000000", + "real_period_seconds": "0", + "frequency_unit": "days", + "frequency": "30", + "token_address": "0x8f2e097e79b1c51be9cba42658862f0192c3e487", + "token_symbol": "DAI", + "gas_price": "250.0000", + "new_approve_tx_id": "0xd89376ee2a96557f4e9038ae59610b590987e48994d45b55ba6588e171d0678b", + "end_approve_tx_id": "0x0", + "cancel_tx_id": "0x0", + "num_tx_approved": "1.0000", + "num_tx_processed": "1.0000", + "network": "rinkeby", + "grant": 1, + "contributor_profile": 33, + "last_contribution_date": "2019-09-11T01:24:15.576Z", + "next_contribution_date": "2019-09-11T01:24:15.576Z", + "amount_per_period_usdt": "4.999999999999999946" + } + }, + { + "model": "grants.subscription", + "pk": 2, + "fields": { + "created_on": "2019-09-12T20:00:23.710Z", + "modified_on": "2019-09-12T20:00:27.760Z", + "active": true, + "error": false, + "subminer_comments": "", + "subscription_hash": "0x7d23d7d35f024f4c40708c8b18948bff60b6e7715e41528e62434be2251a6252", + "contributor_signature": "0xbbb8fbab1835a0b653b9c98618c2aac2991e62ef6bb3019fe2cd43770d3447712f1c1a7104595261eedb0bf9ad5b51873d1fd934d974251b638b0a9c112851831c", + "contributor_address": "0xBcAfdD642118e5536024675e776d32413728dd08", + "amount_per_period": "47.500000000000000000", + "real_period_seconds": "2592000", + "frequency_unit": "days", + "frequency": "30", + "token_address": "0x8f2e097e79b1c51be9cba42658862f0192c3e487", + "token_symbol": "DAI", + "gas_price": "2500.0000", + "new_approve_tx_id": "0x49d52af7bdfaf14224f22f6466550ca61b8261593e68be4bd11ac42ddafcf99a", + "end_approve_tx_id": "0x0", + "cancel_tx_id": "0x0", + "num_tx_approved": "12.0000", + "num_tx_processed": "0.0000", + "network": "rinkeby", + "grant": 2, + "contributor_profile": 30, + "last_contribution_date": "1990-01-01T00:00:00Z", + "next_contribution_date": "1990-01-01T00:00:00Z", + "amount_per_period_usdt": "0E-18" + } + }, + { + "model": "grants.subscription", + "pk": 3, + "fields": { + "created_on": "2019-09-13T15:15:23.038Z", + "modified_on": "2019-09-13T15:15:57.205Z", + "active": true, + "error": true, + "subminer_comments": "skipping subminer bc this is a 1 and done subscription, and tokens were alredy sent", + "subscription_hash": "onetime", + "contributor_signature": "onetime", + "contributor_address": "0xCC4b3DE30576E161C8632786560Fa7DD3Fb33f77", + "amount_per_period": "5.000000000000000000", + "real_period_seconds": "0", + "frequency_unit": "days", + "frequency": "30", + "token_address": "0x8f2e097e79b1c51be9cba42658862f0192c3e487", + "token_symbol": "DAI", + "gas_price": "250.0000", + "new_approve_tx_id": "0x723b608a34521a9ddade1cc8d8f2b720edddd1db7dd2c2fdeb04b046fab32251", + "end_approve_tx_id": "0x0", + "cancel_tx_id": "0x0", + "num_tx_approved": "1.0000", + "num_tx_processed": "1.0000", + "network": "rinkeby", + "grant": 3, + "contributor_profile": 30, + "last_contribution_date": "2019-09-13T15:15:23.043Z", + "next_contribution_date": "2019-09-13T15:15:23.043Z", + "amount_per_period_usdt": "4.999999999999999946" + } + }, + { + "model": "grants.subscription", + "pk": 4, + "fields": { + "created_on": "2019-09-13T15:16:15.929Z", + "modified_on": "2019-09-13T15:16:15.929Z", + "active": false, + "error": false, + "subminer_comments": "", + "subscription_hash": "", + "contributor_signature": "", + "contributor_address": "0xCC4b3DE30576E161C8632786560Fa7DD3Fb33f77", + "amount_per_period": "475.000000000000000000", + "real_period_seconds": "2592000", + "frequency_unit": "days", + "frequency": "30", + "token_address": "0x8f2e097e79b1c51be9cba42658862f0192c3e487", + "token_symbol": "DAI", + "gas_price": "25000.0000", + "new_approve_tx_id": "0x980ce738853f454c83d5551dc086a29d2d89781fb041a9ce581474ffdf639de4", + "end_approve_tx_id": "0x0", + "cancel_tx_id": "0x0", + "num_tx_approved": "12.0000", + "num_tx_processed": "0.0000", + "network": "rinkeby", + "grant": 3, + "contributor_profile": 30, + "last_contribution_date": "1990-01-01T00:00:00Z", + "next_contribution_date": "1990-01-01T00:00:00Z", + "amount_per_period_usdt": "0E-18" + } + }, + { + "model": "grants.contribution", + "pk": 1, + "fields": { + "created_on": "2019-09-11T01:24:15.576Z", + "modified_on": "2019-09-11T01:24:15.576Z", + "success": true, + "tx_cleared": false, + "tx_id": "0xd89376ee2a96557f4e9038ae59610b590987e48994d45b55ba6588e171d0678b", + "subscription": 1 + } + }, + { + "model": "grants.contribution", + "pk": 2, + "fields": { + "created_on": "2019-09-13T15:15:23.043Z", + "modified_on": "2019-09-13T15:15:23.043Z", + "success": true, + "tx_cleared": false, + "tx_id": "0x723b608a34521a9ddade1cc8d8f2b720edddd1db7dd2c2fdeb04b046fab32251", + "subscription": 3 + } + } +] \ No newline at end of file diff --git a/app/assets/v2/css/grants/detail.css b/app/assets/v2/css/grants/detail.css index 18d1c43b42e..20bc96fdcdb 100644 --- a/app/assets/v2/css/grants/detail.css +++ b/app/assets/v2/css/grants/detail.css @@ -243,10 +243,6 @@ textarea.editable { padding-top: 0 !important; } -.milestones-list li:last-child { - padding-bottom: 0 !important; -} - .disable-tooltip { pointer-events: none; } diff --git a/app/assets/v2/css/grants/milestones.css b/app/assets/v2/css/grants/milestones.css deleted file mode 100644 index cede082d00a..00000000000 --- a/app/assets/v2/css/grants/milestones.css +++ /dev/null @@ -1,143 +0,0 @@ -.milestones-edit { - float: right; - font-weight: 600; -} - -.grant_milestones { - background-color: #f2f6f9; -} - -.grant_milestones .milestones-form { - background-color: #fff; -} - -.milestones-container { - border: 1px solid #CECECE; - border-radius: 3px; - padding: 30px; -} - -.grant_milestones .milestones-container { - border: none; - border-radius: 0; - border-bottom: 1px solid #CECECE; -} - -#completion_date-error { - margin-top: auto; - margin-bottom: auto; -} - -.grant_milestones a { - color: #0D0764; -} - -ul.milestones-list { - padding-left: 15px; - margin-top: -1px; -} - -ul.milestones-list li { - padding-left: 33px; - list-style: none; - position: relative; - margin-bottom: 0; - padding-bottom: 2.5em; -} - -ul.milestones-list li:last-child { - padding-bottom: 0; -} - -ul.milestones-list li:after { - content: url('/static/v2/images/list-icon-green.svg'); - position: absolute; - left: -25px; - top: 10px; -} - -ul.milestones-list li:before { - content: ""; - position: absolute; - left: -16px; - border-left: 2px solid #CACACA; - height: 100%; - width: 1px; -} - -ul.milestones-list li:first-child:before { - top: 15px; -} - -ul.milestones-list li:last-child:before { - height: 15px; -} - -ul.milestones-list .milestone-title { - font-size: 1.2rem; -} - -ul.milestones-list .milestone-date { - margin-bottom: 0.3rem; - font-size: 14px; - color: #000; -} - -ul.milestones-list .milestone-date form { - display: inline; -} - -ul.milestones-list .milestone-date input { - border: 1px solid; - font-size: 14px; - color: #999; -} - -ul.milestones-list .milestone-date .error { - color: #D50000; - font-size: 0.75rem; -} - -ul.milestones-list .milestone-date a { - float: right; - margin-right: 0.3rem; -} - -ul.milestones-list .milestone-description { - font-size: .85rem; - color: #43484D; -} - -.milestones-input input, -.milestones-input textarea { - margin-top: 20px; -} - -ul.milestones-list .button { - font-size: 0.75rem; - font-weight: 600; - color: #fff; -} - -ul.milestones-list .button:hover { - color: #fff; -} - -input[type="date"]:before { - content: attr(placeholder) !important; - color: #aaa; - margin-right: 0.5em; -} - -input[type="date"]:focus:before, -input[type="date"]:valid:before { - content: ""; -} - -#completed_label { - display: flex; -} - -#due_label { - margin: 0px; -} diff --git a/app/assets/v2/js/grants/milestones.js b/app/assets/v2/js/grants/milestones.js deleted file mode 100644 index 3bf4cae8636..00000000000 --- a/app/assets/v2/js/grants/milestones.js +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-disable no-console */ - -$(document).ready(function() { - - $('[data-form-method]').on('click', function(event) { - event.preventDefault(); - event.stopPropagation(); - - var form = $(this).parents('form:first'); - - var method = $(this).attr('data-form-method'); - - form.find('input[name="method"]').val(method); - - if (method == 'PUT') { - form.validate(); - } - - form.submit(); - }); - - - $('input[name="due_date"]').daterangepicker({ - singleDatePicker: true, - autoUpdateInput: false - }, function(chosen_date) { - $('input[name="due_date"]').val(chosen_date.format('YYYY-MM-DD')); - }); - - - $('input[name="completion_date"]').daterangepicker({ - singleDatePicker: true, - autoUpdateInput: false - }, function(chosen_date) { - $('input[name="completion_date"]').val(chosen_date.format('YYYY-MM-DD')); - }); - -}); diff --git a/app/dashboard/models.py b/app/dashboard/models.py index 2996b23fa1c..aa0eda1e0cc 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -2087,8 +2087,6 @@ class Activity(SuperModel): ('new_grant_contribution', 'Contributed to Grant'), ('new_grant_subscription', 'Subscribed to Grant'), ('killed_grant_contribution', 'Cancelled Grant Contribution'), - ('new_milestone', 'New Milestone'), - ('update_milestone', 'Updated Milestone'), ('new_kudos', 'New Kudos'), ('created_kudos', 'Created Kudos'), ('receive_kudos', 'Receive Kudos'), diff --git a/app/grants/admin.py b/app/grants/admin.py index 4e5a151981b..d7af061c5bb 100644 --- a/app/grants/admin.py +++ b/app/grants/admin.py @@ -22,9 +22,7 @@ from django.utils.html import format_html from django.utils.safestring import mark_safe -from grants.models import ( - CLRMatch, Contribution, Flag, Grant, MatchPledge, Milestone, PhantomFunding, Subscription, Update, -) +from grants.models import CLRMatch, Contribution, Flag, Grant, MatchPledge, PhantomFunding, Subscription class GeneralAdmin(admin.ModelAdmin): @@ -255,19 +253,6 @@ def etherscan_links(self, instance): html += f"SPLITTXID: {instance.split_tx_id}" return mark_safe(html) -class MilestoneAdmin(admin.ModelAdmin): - """Define the Milestone administration layout.""" - - ordering = ['-id'] - list_display =['pk', 'grant', 'title', 'created_on'] - - -class UpdateAdmin(admin.ModelAdmin): - """Define the Update administration layout.""" - - ordering = ['-id'] - list_display =['pk', 'grant', 'title', 'created_on'] - class PhantomFundingAdmin(admin.ModelAdmin): """Define the GeneralAdmin administration layout.""" @@ -295,5 +280,3 @@ def from_ip_address(self, instance): admin.site.register(CLRMatch, GeneralAdmin) admin.site.register(Subscription, SubscriptionAdmin) admin.site.register(Contribution, ContributionAdmin) -admin.site.register(Milestone, MilestoneAdmin) -admin.site.register(Update, UpdateAdmin) diff --git a/app/grants/forms.py b/app/grants/forms.py index fad0d4c63ca..2dacaf6b5d3 100644 --- a/app/grants/forms.py +++ b/app/grants/forms.py @@ -20,7 +20,7 @@ from django import forms from django.utils.translation import gettext_lazy as _ -from grants.models import Grant, Milestone +from grants.models import Grant class GrantForm(forms.ModelForm): @@ -35,32 +35,3 @@ class Meta: 'cancel_tx_id', 'amount_received', 'token_address', 'contract_address', 'metadata', 'network', 'required_gas_price', 'admin_profile', 'team_members' ) - - -class MilestoneForm(forms.ModelForm): - """Define the Milestone form logic.""" - - class Meta: - """Define the metadata for the Milestone model form.""" - - model = Milestone - fields = ('title', 'description', 'due_date', ) - widgets = { - 'title': forms.TextInput(attrs={ - 'class': 'form__input form__input-lg', - 'placeholder': _('Title') - }), - 'description': - forms.Textarea(attrs={ - 'class': 'form__input form__input-lg', - 'placeholder': _('Description') - }), - 'due_date': - forms.TextInput( - attrs={ - 'type': 'text', - 'class': 'form__input form__input-lg', - 'placeholder': _('Due Date for completion') - } - ) - } diff --git a/app/grants/models.py b/app/grants/models.py index 20db9fd680e..ca4628278bf 100644 --- a/app/grants/models.py +++ b/app/grants/models.py @@ -461,65 +461,6 @@ def contract(self): return grant_contract -class Milestone(SuperModel): - """Define the structure of a Grant Milestone""" - - title = models.CharField(max_length=255, help_text=_('The Milestone title.')) - description = models.TextField(help_text=_('The Milestone description.')) - due_date = models.DateField(help_text=_('The requested Milestone completion date.')) - completion_date = models.DateField( - default=None, - blank=True, - null=True, - help_text=_('The Milestone completion date.'), - ) - grant = models.ForeignKey( - 'Grant', - related_name='milestones', - on_delete=models.CASCADE, - null=True, - help_text=_('The associated Grant.'), - ) - - def __str__(self): - """Return the string representation of a Milestone.""" - return ( - f" id: {self.pk}, title: {self.title}, description: {self.description}, " - f"due_date: {self.due_date}, completion_date: {self.completion_date}, grant: {self.grant_id}" - ) - - -class UpdateQuerySet(models.QuerySet): - """Define the Update default queryset and manager.""" - - pass - - -class Update(SuperModel): - """Define the structure of a Grant Update.""" - title = models.CharField( - default='', - max_length=255, - help_text=_('The title of the Grant.') - ) - description = models.TextField( - default='', - blank=True, - help_text=_('The description of the Grant.') - ) - grant = models.ForeignKey( - 'grants.Grant', - related_name='updates', - on_delete=models.CASCADE, - null=True, - help_text=_('The associated Grant.'), - ) - - def __str__(self): - """Return the string representation of this object.""" - return self.title - - class SubscriptionQuerySet(models.QuerySet): """Define the Subscription default queryset and manager.""" diff --git a/app/grants/serializers.py b/app/grants/serializers.py index b6a3a570f2b..caacfaa8dca 100644 --- a/app/grants/serializers.py +++ b/app/grants/serializers.py @@ -1,17 +1,7 @@ from dashboard.router import ProfileSerializer from rest_framework import serializers -from .models import Contribution, Grant, Milestone, Subscription - - -class MilestoneSerializer(serializers.ModelSerializer): - """Handle serializing the Milestone object.""" - - class Meta: - """Define the milestone serializer metadata.""" - - model = Milestone - fields = ('title', 'description', 'due_date', 'completion_date') +from .models import Contribution, Grant, Subscription class GrantSerializer(serializers.ModelSerializer): @@ -19,7 +9,6 @@ class GrantSerializer(serializers.ModelSerializer): admin_profile = ProfileSerializer() team_members = ProfileSerializer(many=True) - milestones = MilestoneSerializer(many=True) class Meta: """Define the grant serializer metadata.""" @@ -28,7 +17,7 @@ class Meta: fields = ( 'active', 'title', 'slug', 'description', 'reference_url', 'logo', 'admin_address', 'amount_goal', 'amount_received', 'token_address', 'token_symbol', 'contract_address', 'metadata', - 'network', 'required_gas_price', 'admin_profile', 'team_members', 'percentage_done', 'milestones', + 'network', 'required_gas_price', 'admin_profile', 'team_members', 'percentage_done', ) diff --git a/app/grants/templates/grants/detail/summary.html b/app/grants/templates/grants/detail/summary.html deleted file mode 100644 index e18ab7bac45..00000000000 --- a/app/grants/templates/grants/detail/summary.html +++ /dev/null @@ -1,81 +0,0 @@ -{% load static humanize i18n grants_extra %} -
-
-
-
-
-
-
-

- {% trans "MILESTONES" %} - {% if is_team_member and not grant_is_inactive %}{% trans "Edit Milestones" %}{% endif %} -

- {% if milestones %} -
-
    - {% for milestone in milestones %} -
  • -
    -

    - {% trans 'Due: ' %}{{ milestone.due_date }} - {% if milestone.completion_date %} - / - {% trans 'Completed: ' %} {{ milestone.completion_date }} - {% endif %} -

    -
    -
    {{ milestone.title }}
    -
    {{ milestone.description }}
    -
  • - {% endfor %} -
-
- {% else %} -

{% trans "No milestones added" %}

- {% endif %} -
- -
-

{% trans "UPDATES" %}

-
- {% if is_team_member and not grant_is_inactive %} -
-
- {% csrf_token %} -
- -
- -
- -
- -
- -
-
-
- {% endif %} -
- {% for item in updates %} -
- -
{{ item.title }}
-
{{ item.description }}
-
- {% empty %} -

- {% trans "No updates added" %} -

- {% endfor %} -
-
-
-
-
-
-
-
-
\ No newline at end of file diff --git a/app/grants/templates/grants/detail/tabs.html b/app/grants/templates/grants/detail/tabs.html index 4b7242d3581..d899b2a01e8 100644 --- a/app/grants/templates/grants/detail/tabs.html +++ b/app/grants/templates/grants/detail/tabs.html @@ -87,12 +87,6 @@

{% trans "No Activity for th {% endif %} - {% if tab == "updates" %} -
- {% include 'grants/detail/summary.html' %} -
- {% endif %} - {% if tab == "stats" %} diff --git a/app/grants/templates/grants/milestones.html b/app/grants/templates/grants/milestones.html deleted file mode 100644 index 13d28076522..00000000000 --- a/app/grants/templates/grants/milestones.html +++ /dev/null @@ -1,101 +0,0 @@ -{% load static %} -{% load i18n %} - - - - {% include 'shared/head.html' with slim=1 %} - {% include 'shared/cards.html' %} - - - - {% include 'shared/tag_manager_2.html' %} -
- {% include 'shared/top_nav.html' with class='d-md-flex' %} - {% include 'grants/nav.html' %} -
- -
-
-
-
-

{% trans "Current Milestones" %}

- {% trans "Back to" %} {{ grant.title }} -
-
- {% if milestones %} -
    - {% for milestone in milestones %} -
  • -
    {{ milestone.title }}
    -
    -

    {% trans 'Due Date - ' %}{{ milestone.due_date }}

    - {% if milestone.completion_date %} - {% trans 'Date Completed - ' %}{{ milestone.completion_date }} - {% else %} -
    - {% csrf_token %} - - -

    {% trans 'Date Completed - ' %}

    - {% trans "Delete" %} - {% trans "Complete" %} -
    - {% endif %} -
    -

    {{ milestone.description }}

    -
  • - {% endfor %} -
- {% else %} -

- - {% trans "No milestones currently set for this grant." %} -

- {% endif %} -
-
-

{% trans "Create Milestones for " %}{{ grant.title }}

-
-
-
- {% csrf_token %} - -
-
-
- {{ form.title }} - {{ form.title.errors }} - {{ form.description }} - {{ form.description.errors }} - {{ form.due_date }} - {{ form.due_date.errors }} -
-
-
-
- -
-
-
-
-
-
- - {% include 'shared/bottom_notification.html' %} - {% include 'shared/analytics.html' %} - {% include 'shared/footer_scripts.html' %} - {% include 'shared/footer.html' %} - - - - - - - - - - - - - - diff --git a/app/grants/urls.py b/app/grants/urls.py index 95d1ff1e548..da8d3493c35 100644 --- a/app/grants/urls.py +++ b/app/grants/urls.py @@ -21,7 +21,7 @@ from grants.views import ( flag, grant_categories, grant_details, grant_fund, grant_new, grant_new_v0, grants, grants_addr_as_json, - grants_stats_view, invoice, leaderboard, milestones, new_matching_partner, predict_clr_v1, profile, quickstart, + grants_stats_view, invoice, leaderboard, new_matching_partner, predict_clr_v1, profile, quickstart, subscription_cancel, ) @@ -36,7 +36,6 @@ re_path(r'^new', grant_new, name='new'), re_path(r'^old', grant_new_v0, name='old'), re_path(r'^categories', grant_categories, name='grant_categories'), - path('//milestones', milestones, name='milestones'), path('//fund', grant_fund, name='fund'), path( '//subscription//cancel', diff --git a/app/grants/views.py b/app/grants/views.py index 787ea42952a..754a8d5983d 100644 --- a/app/grants/views.py +++ b/app/grants/views.py @@ -48,10 +48,7 @@ from economy.utils import convert_amount from gas.utils import conf_time_spread, eth_usd_conv_rate, gas_advisories, recommend_min_gas_price_to_confirm_in_time from grants.clr import predict_clr_live -from grants.forms import MilestoneForm -from grants.models import ( - Contribution, Flag, Grant, GrantCategory, MatchPledge, Milestone, PhantomFunding, Subscription, Update, -) +from grants.models import Contribution, Flag, Grant, GrantCategory, MatchPledge, PhantomFunding, Subscription from grants.utils import get_leaderboard, is_grant_team_member from inbox.utils import send_notification_to_user_from_gitcoinbot from kudos.models import BulkTransferCoupon, Token @@ -418,11 +415,9 @@ def grant_details(request, grant_id, grant_slug): profile = get_profile(request) add_cancel_params = False try: - grant = Grant.objects.prefetch_related('subscriptions', 'milestones', 'updates', 'team_members').get( + grant = Grant.objects.prefetch_related('subscriptions','team_members').get( pk=grant_id, slug=grant_slug ) - milestones = grant.milestones.order_by('due_date') - updates = grant.updates.order_by('-created_on') subscriptions = grant.subscriptions.filter(active=True, error=False, is_postive_vote=True).order_by('-created_on') cancelled_subscriptions = grant.subscriptions.filter(active=False, error=False, is_postive_vote=True).order_by('-created_on') @@ -467,14 +462,6 @@ def grant_details(request, grant_id, grant_slug): for sub in subscriptions: subscription_terminated(grant, sub) record_grant_activity_helper('killed_grant', grant, profile) - elif 'input-title' in request.POST: - update_kwargs = { - 'title': request.POST.get('input-title', ''), - 'description': request.POST.get('description', ''), - 'grant': grant - } - Update.objects.create(**update_kwargs) - record_grant_activity_helper('update_grant', grant, profile) elif 'edit-title' in request.POST: grant.title = request.POST.get('edit-title') grant.reference_url = request.POST.get('edit-reference_url') @@ -527,8 +514,6 @@ def grant_details(request, grant_id, grant_slug): 'user_non_errored_subscription': user_non_errored_subscription, 'is_admin': is_admin, 'grant_is_inactive': not grant.active, - 'updates': updates, - 'milestones': milestones, 'keywords': get_keywords(), 'target': f'/activity?what=grant:{grant.pk}', 'activity_count': activity_count, @@ -769,52 +754,6 @@ def grant_new_v0(request): return TemplateResponse(request, 'grants/newv0.html', params) - -@login_required -def milestones(request, grant_id, grant_slug): - profile = get_profile(request) - grant = Grant.objects.prefetch_related('milestones').get(pk=grant_id, slug=grant_slug) - - if not is_grant_team_member(grant, profile): - return redirect(reverse('grants:details', args=(grant.pk, grant.slug))) - - if request.method == "POST": - method = request.POST.get('method') - - if method == "POST": - form = MilestoneForm(request.POST) - milestone = form.save(commit=False) - milestone.grant = grant - milestone.save() - - if method == "PUT": - milestone_id = request.POST.get('milestone_id') - milestone = Milestone.objects.get(pk=milestone_id) - milestone.completion_date = request.POST.get('completion_date') - milestone.save() - - if method == "DELETE": - milestone_id = request.POST.get('milestone_id') - milestone = grant.milestones.get(pk=milestone_id) - milestone.delete() - - return redirect(reverse('grants:milestones', args=(grant.pk, grant.slug))) - - form = MilestoneForm() - milestones = grant.milestones.order_by('due_date') - - params = { - 'active': 'grant_milestones', - 'title': _('Grant Milestones'), - 'card_desc': _('Provide sustainable funding for Open Source with Gitcoin Grants'), - 'grant': grant, - 'milestones': milestones, - 'form': form, - 'keywords': get_keywords(), - } - return TemplateResponse(request, 'grants/milestones.html', params) - - @login_required def grant_fund(request, grant_id, grant_slug): """Handle grant funding.""" diff --git a/app/inbox/models.py b/app/inbox/models.py index 6c61b144a20..2ee16638054 100644 --- a/app/inbox/models.py +++ b/app/inbox/models.py @@ -52,8 +52,6 @@ class Notification(SuperModel): ('killed_grant', 'Cancelled Grant'), ('new_grant_contribution', 'Contributed to Grant'), ('killed_grant_contribution', 'Cancelled Grant Contribution'), - ('new_milestone', 'New Milestone'), - ('update_milestone', 'Updated Milestone'), ('new_kudos', 'New Kudos'), ('new_mention', 'New Mention'), ('new_post_comment', 'New comment'), diff --git a/scripts/debug/migrate_grant.py b/scripts/debug/migrate_grant.py index 97064d4a386..817421ae0e2 100644 --- a/scripts/debug/migrate_grant.py +++ b/scripts/debug/migrate_grant.py @@ -16,17 +16,10 @@ obj.grant = new_grant obj.save() -for obj in old_grant.milestones.all(): - obj.grant = new_grant - obj.save() - for obj in old_grant.activities.all(): obj.grant = new_grant obj.save() -for obj in old_grant.updates.all(): - obj.grant = new_grant - obj.save() for obj in old_grant.clr_matches.all(): obj.grant = new_grant diff --git a/scripts/debug/retry_kudostransfer.py b/scripts/debug/retry_kudostransfer.py deleted file mode 100644 index 97064d4a386..00000000000 --- a/scripts/debug/retry_kudostransfer.py +++ /dev/null @@ -1,39 +0,0 @@ -#migrates the info on one grant to another - -old_grant_id = 128 -new_grant_id = 200 - -from grants.models import Grant - -old_grant = Grant.objects.get(pk=old_grant_id) -new_grant = Grant.objects.get(pk=new_grant_id) - -for sub in old_grant.subscriptions.all(): - sub.grant = new_grant - sub.save() - -for obj in old_grant.phantom_funding.all(): - obj.grant = new_grant - obj.save() - -for obj in old_grant.milestones.all(): - obj.grant = new_grant - obj.save() - -for obj in old_grant.activities.all(): - obj.grant = new_grant - obj.save() - -for obj in old_grant.updates.all(): - obj.grant = new_grant - obj.save() - -for obj in old_grant.clr_matches.all(): - obj.grant = new_grant - obj.save() - -old_grant.hidden = True -old_grant.link_to_new_grant = new_grant - -old_grant.save() -new_grant.save()