8000 Feature/tribe v2 by sanchaymittal · Pull Request #7350 · gitcoinco/web · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feature/tribe v2 #7350

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

Merged
merged 6 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 0 additions & 5 deletions app/assets/v2/js/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ let hackathonId = document.hasOwnProperty('hackathon_id') ? document.hackathon_i
// let funderBounties = [];

Vue.mixin({
computed: {
orderedUsers: function() {
return _.orderBy(this.users, 'position_contributor', 'asc');
}
},
methods: {
chatWindow: function(channel) {
window.chatSidebar.chatWindow(channel);
Expand Down
31 changes: 10 additions & 21 deletions app/assets/v2/js/vue-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,11 +608,6 @@ Vue.component('project-card', {

Vue.component('suggested-profiles', {
props: ['id'],
computed: {
orderedUsers: function() {
return _.orderBy(this.users, 'position_contributor', 'asc');
}
},
data: function() {
return {
users: []
Expand Down Expand Up @@ -656,7 +651,7 @@ Vue.component('suggested-profiles', {
template: `<div class="townsquare_nav-list my-2 tribe">
<div id="suggested-tribes">
<ul class="nav d-inline-block font-body col-lg-4 col-lg-11 pr-2" style="padding-right: 0">
<suggested-profile v-for="profile in orderedUsers" :key="profile.id" :profile="profile" />
<suggested-profile v-for="profile in users" :key="profile.id" :profile="profile" />
</ul>
</div>
</div>`
Expand All @@ -667,8 +662,7 @@ Vue.component('suggested-profile', {
props: ['profile'],
data: function() {
return {
follow: this.profile.user_is_following || false,
follower_count: this.profile.followers_count || 0
follow: this.profile.user_is_following || false
};
},
computed: {
Expand Down Expand Up @@ -701,28 +695,23 @@ Vue.component('suggested-profile', {
}
},
template: `
<b-media tag="li" class="row mx-auto mx-md-n1">
<b-media tag="li" class="row mx-auto mx-md-n1 mb-1">
<template v-slot:aside>
<a :href="profile_url" class="d-flex nav-link nav-line pr-0 mr-0">
<b-img :src="avatar_url" class="nav_avatar"></b-img>
</a>
</template>
<div class="row">
<span class="col-6 col-md-12 col-xl-7 font-caption">
<div class="col">
<span class="row font-caption">
<a :href="profile_url" class="nav-title font-weight-semibold pt-0 mb-0 text-capitalize text-black">{{profile.name}}</a>
<p class="mb-0">
<i class="fas fa-user font-smaller-4 mr-1"></i>
<span class="font-weight-semibold">{{follower_count}}</span> followers
<span class="font-weight-semibold">{{profile.handle}}</span>
</p>
</span>
<span class="col-6 col-md-12 col-xl-5 p-0 my-auto text-center">
<a class="follow_tribe btn btn-sm btn-outline-green font-weight-bold font-smaller-6 px-3" href="#" @click="followTribe(profile.handle, $event)" v-if="follow">
<i v-bind:class="[follow ? 'fa-user-minus' : 'fa-user-plus', 'fas mr-1']"></i> following
</a>
<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> fol 8000 low
</a>
</span>
<p class="row font-caption mb-0 mt-1">
<b-button v-if="follow" @click="followTribe(profile.handle, $event)" class="btn btn-outline-green font-smaller-5">following</b-button>
<b-button v-else @click="followTribe(profile.handle, $event)" class="btn btn-gc-blue font-smaller-5">follow</b-button>
</p>
</div>
</b-media>
`
Expand Down
7 changes: 3 additions & 4 deletions app/dashboard/templates/profiles/tribes-vue.html
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@
<div class="row">
<div :id="tribe.handle" class="d-flex col-12 justify-content-between flex-column flex-md-row align-items-center p-3 header profile-header dash" v-bind:style="[{backgroundImage: `url(${tribe.profile_wallpaper})`}, {backgroundImage: `url(${headerFilePreview || tribe.tribes_cover_image})`}]">
{% csrf_token %}
<div class="mt-5 mt-sm-0 position-relative" v-if="is_my_org" style="height: 100%; width:100%;">
<div class="mt-5 mt-sm-0 position-relative" v-if="is_my_org || is_staff" style="height: 100%; width:100%;">
<div style="position:absolute;bottom:1rem;right:0;">
<b-button v-b-modal.change-tribe-header variant="info" class="btn profile-banner-cta text-center">
<i class="fa fa-camera"></i>
Expand Down Expand Up @@ -675,7 +675,7 @@ <h5 v-if="project.looking_members" class="info-card-title uppercase">Looking fo
<button class="btn blue" @click="params = {}; searchUsers()">Reset Filters</button>
</div>
<div class="grid-4">
<div v-for="user in orderedUsers" class="card card-user shadow-sm border-0" :key=`"user-${user.handle}"`>
<div v-for="user in users" class="card card-user shadow-sm border-0" :key=`"user-${user.handle}"`>
<div class="d-flex flex-column py-1 bg-lightblue">
<button class="btn position-absolute align-self-end" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"><i class="fas fa-ellipsis-v"></i></button>
<div class="dropdown-menu dropdown-menu-right font-caption bg-white">
Expand Down Expand Up @@ -1449,7 +1449,7 @@ <h4 class="px-2 pt-3 font-body font-weight-semibold text-muted">{% trans "Top id
</div>
</div>
</div>
<b-modal v-if="is_my_org" @hide="resetPreview" @close="resetPreview" @cancel="resetPreview" hide-backdrop content-class="shadow" id="change-tribe-header" tabindex="-1" role="dialog" aria-labelledby="changeProfileHeaderLabel" aria-hidden="true">
<b-modal v-if="is_my_org || is_staff" @hide="resetPreview" @close="resetPreview" @cancel="resetPreview" hide-backdrop content-class="shadow" id="change-tribe-header" tabindex="-1" role="dialog" aria-labelledby="changeProfileHeaderLabel" aria-hidden="true">
<template v-slot:modal-title>
{% trans "Update Tribe Header"%}
</template>
Expand Down Expand Up @@ -1543,7 +1543,6 @@ <h4 class="px-2 pt-3 font-body font-weight-semibold text-muted">{% trans "Top id
</script>
<script defer src='https://cdn.jsdelivr.net/npm/quill@1.3.6/dist/quill.min.js'></script>
<script defer src='https://cdn.jsdelivr.net/npm/vue-quill-editor@3.0.6/dist/vue-quill-editor.js'></script>
<script defer src='https://cdn.jsdelivr.net/npm/lodash@4.17.19/lodash.min.js'></script>
{{currentProfile|json_script:"current-profile"}}
<script src='{% static "v2/js/pages/profile-tribes.js" %}'></script>
<script src="{% static "v2/js/lib/jitsi.js" %}"></script>
Expand Down
3 changes: 2 additions & 1 deletion app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ def previous_worked():
all_pages = Paginator(profile_list, limit)
this_page = all_pages.page(page)

profile_list = Profile.objects_full.filter(pk__in=[ele for ele in this_page]).order_by('-earnings_count', 'id').exclude(handle__iexact='gitcoinbot')
profile_list = Profile.objects_full.filter(pk__in=[ele for ele in this_page]).order_by('-rank_coder', 'id').exclude(handle__iexact='gitcoinbot')

this_page = profile_list

Expand Down Expand Up @@ -1188,6 +1188,7 @@ def previous_worked():
profile_json['previously_worked'] = False # user.previous_worked_count > 0
profile_json['position_contributor'] = user.get_contributor_leaderboard_index()
profile_json['position_funder'] = user.get_funder_leaderboard_index()
profile_json['rank_coder'] = user.rank_coder
profile_json['work_done'] = count_work_completed
profile_json['verification'] = user.get_my_verified_check
profile_json['avg_rating'] = user.get_average_star_rating()
Expand Down
0