Skip to content

Commit

Permalink
Some style updates to the manage page, wired in the fund and cancel b…
Browse files Browse the repository at this point in the history
…uttons
  • Loading branch information
androolloyd committed May 4, 2020
1 parent d8c4229 commit 6391d28
Show file tree
Hide file tree
Showing 5 changed files with 978 additions and 946 deletions.
4 changes: 3 additions & 1 deletion app/assets/v2/js/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Vue.mixin({
if (featured) {
apiUrlBounties = `/api/v0.1/bounties/slim/?${searchParams.toString()}&is_featured=True`;
}

vm.bounties = [];
const getBounties = fetchData (apiUrlBounties, 'GET');

$.when(getBounties).then(function(response) {
Expand Down Expand Up @@ -212,6 +212,8 @@ Vue.component('bounty-explorer', Vue.extend({
};
},
mounted() {
vm.bounties = [];
vm.featuredBounties = [];
if (this.tribe && this.tribe.handle) {
this.params.org = this.tribe.handle;
}
Expand Down
32 changes: 31 additions & 1 deletion app/assets/v2/js/pages/profile-tribes.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,36 @@ const loadDynamicScript = (callback, url, id) => {
console.error('error: unable to creating bounty request', error);
});
},
rejectBountyRequest: function(idx, bounty_request_id) {
let vm = this;

const url = '/api/v1/bounty_request/update';

const createBountyRequest = fetchData(
url,
'POST',
{
'bounty_request_id': bounty_request_id,
'request_status': 'c'
},
{'X-CSRFToken': vm.csrf}
);

$.when(createBountyRequest).then(function(response) {

if (response.status === 200) {
_alert('Bounty Request has been rejected');
delete vm.tribe.suggested_bounties[idx];
} else {
_alert(`Error rejecting bounty request as ${response.message}`, 'error');
console.error(response.message);
}

}).fail(function(error) {
_alert(`Error rejecting bounty request. ${error}`, 'error');
console.error('error: unable to reject bounty request', error);
});
},
resetBountySuggestion: function() {
this.params.suggest = {};
},
Expand Down Expand Up @@ -200,7 +230,7 @@ const loadDynamicScript = (callback, url, id) => {
let vm = this;

vm.isLoading = false;
$("#preloader").remove()
$('#preloader').remove()
this.$watch('headerFile', function(newVal, oldVal) {
if (checkFileSize(this.headerFile, 4000000) === false) {
_alert(`Profile Header Image should not exceed ${(4000000 / 1024 / 1024).toFixed(2)} MB`, 'error');
Expand Down
4 changes: 2 additions & 2 deletions app/assets/v2/js/vue-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ Vue.component('suggested-profile', {
<a class="follow_tribe btn btn-sm btn-gc-blue font-weight-bold font-smaller-6 px-3" href="#" @click="followTribe(profile.handle, $event)" v-else>
<i v-bind:class="[follow ? 'fa-user-minus' : 'fa-user-plus', 'fas mr-1']"></i> follow
</a>
</span>
</div>
</span>
</div>
</b-media>
`
});
6 changes: 3 additions & 3 deletions app/dashboard/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def user_following(self, instance):

class Meta:
model = Profile
fields = ('name', 'handle', 'avatar_url', 'followers_count', 'user_is_following')
fields = ('id', 'name', 'handle', 'avatar_url', 'followers_count', 'user_is_following')
depth = 1


Expand All @@ -523,7 +523,7 @@ class BountyRequestSerializer(serializers.ModelSerializer):

class Meta:
model = BountyRequest
fields = ('id', 'token_name', 'comment', 'github_url', 'title', 'requested_by', 'status')
fields = ('id', 'created_on', 'token_name', 'amount', 'comment', 'github_url', 'title', 'requested_by', 'status')
depth = 1

class TribesSerializer(serializers.ModelSerializer):
Expand All @@ -540,7 +540,7 @@ def __init__(self, *args, **kwargs):
class Meta:
model = Profile
"""Define the profile serializer metadata."""
fields = ('profile_wallpaper', 'tribes_cover_image', 'name', 'linkedin_url', 'team_or_none_if_timeout', 'suggested_bounties', 'handle', 'tribe_description', 'avatar_url', 'follower_count', 'following_count', 'data', 'tribe_priority')
fields = ('profile_wallpaper', 'tribes_cover_image', 'rank_org','name', 'linkedin_url', 'team_or_none_if_timeout', 'suggested_bounties', 'handle', 'tribe_description', 'avatar_url', 'follower_count', 'following_count', 'data', 'tribe_priority')
depth = 1


Expand Down
Loading

0 comments on commit 6391d28

Please sign in to comment.