-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
Following section #6301
Following section #6301
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6301 +/- ##
==========================================
+ Coverage 27.07% 27.08% +0.01%
==========================================
Files 291 291
Lines 26682 26702 +20
Branches 3948 3951 +3
==========================================
+ Hits 7223 7232 +9
- Misses 19192 19203 +11
Partials 267 267
Continue to review full report at Codecov.
|
Nice, Is this working? Asking because says "is not working yet" |
It will compile, but missing some of the features I'm using Also, the following button color seems inconsistent in the design. asking Alisa now. |
cool, send some screenshots here or video so we can check. Thanks man! |
@octavioamu should be good to go now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which master did this pull from?, I dont see if it made any changes
Just made an update to hide email button when no email is there, and fix blue follow button not working |
@octavioamu can we have this reviewed when you get a chance? thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jschiarizzi we need to remove the email button - we can't be exposing user emails like this. If we want user-to-user messaging, we need to just use chat. CC: @PixelantDesign @owocki
Okay, that was what was asked for. I thought that icon was already used in gitcoin profiles, but it turns out that is an invite link to this "https://gitcoin.co/users?invite=jschiarizzi" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danlipert here is the change you requested. No email, instead replaced with the invite to bounty button, like is on the top of a profile.
@danlipert Just a friendly reminder that this is ready for a review again. |
yay! excited for this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comments
app/assets/v2/js/pages/join_tribe.js
Outdated
$(elem).mouseenter(function(e) { | ||
if ($(elem).hasClass('btn-outline-gc-green')) { | ||
$(elem).addClass('btn-gc-outline-red').text('Unfollow'); | ||
$(elem).removeClass('btn-outline-gc-green'); | ||
} | ||
}).mouseleave(function(e) { | ||
if ($(elem).hasClass('btn-gc-outline-red')) { | ||
$(elem).removeClass('btn-gc-outline-red'); | ||
$(elem).addClass('btn-outline-gc-green').text('Following'); | ||
} | ||
}); | ||
|
||
$(elem).focus(function(e) { | ||
if ($(elem).hasClass('btn-outline-gc-green')) { | ||
$(elem).addClass('btn-gc-outline-red').text('Unfollow'); | ||
$(elem).removeClass('btn-outline-gc-green'); | ||
} | ||
}).focusout(function(e) { | ||
if ($(elem).hasClass('btn-gc-outline-red')) { | ||
$(elem).removeClass('btn-gc-outline-red'); | ||
$(elem).addClass('btn-outline-gc-green').text('Following'); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use multiple event to be more DRY .on( "mouseenter focus", fnc ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -4896,3 +4896,18 @@ class TribeMember(SuperModel): | |||
max_length=20, | |||
blank=True | |||
) | |||
|
|||
@property | |||
def mutual_follow(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tribesmembers is used for users following but also for orgs tribes seems this will show tribes orgs as following
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a handy method for Tribe Members, this method will be used as predicate to know if the current pair (org, profile) follow mutually.
app/dashboard/models.py
Outdated
@property | ||
def mutual_follow(self): | ||
return TribeMember.objects.filter(profile=self.org, org=self.profile).exists() | ||
|
||
@property | ||
def mutual_follower(self): | ||
tribe_following = TribeMember.objects.filter(profile=self.profile).values('org') | ||
return TribeMember.objects.filter(org=self.org, profile__in=tribe_following).exclude(profile=self.profile) | ||
|
||
@property | ||
def mutual_following(self): | ||
tribe_following = TribeMember.objects.filter(org=self.profile).values('profile') | ||
print(tribe_following) | ||
return TribeMember.objects.filter(org__in=tribe_following, profile=self.org) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about this logic, if you already have those who already following you why not better cross both and have the result to avoid many queries?
Also I see a missing print there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats the missing print? Is there a rule for printing objects here we have to follow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, only one query is executed on each of these methods using a subquery
<div class="mb-0 mt-1 col-5 d-flex flex-row align-items-center"> | ||
<div class="mr-5" style="height: fit-content"> | ||
<button class="btn btn-outline-gc-blue btn-sm flex-grow-1 font-smaller-5 position-relative quick-link" data-openchat="{{user.profile}}"> | ||
<i class="fas fa-comment-dots" data-placement="bottom" data-toggle="tooltip" data-html="true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets move the tooltip to the button to show it on all the button hover not just the icon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
{% if followers|length == 2 %} | ||
<div style="width: 60px" class="d-flex flex-row align-items-center"> | ||
<img class="rounded-circle" style="height: 25px; width: 25px; margin-right: -12px " src="/dynamic/avatar/{{ followers.0.profile.handle }}" alt=""> | ||
<img class="rounded-circle" style="height: 25px; width: 25px;" src="/dynamic/avatar/{{ followers.1.profile.handle }}" alt=""> | ||
</div> | ||
<p class="text-muted font-smaller-4 my-0">Followed by {{ followers.0.profile.handle }} and {{ followers.1.profile.handle }}</p> | ||
{% endif %} | ||
{% if followers|length >= 3 %} | ||
<div style="width: 60px" class="d-flex flex-row align-items-center"> | ||
<img class="rounded-circle" style="height: 25px; width: 25px; margin-right: -12px" src="/dynamic/avatar/{{ followers.0.profile.handle }}" alt=""> | ||
<img class="rounded-circle" style="height: 25px; width: 25px; margin-right: -12px" src="/dynamic/avatar/{{ followers.1.profile.handle }}" alt=""> | ||
<img class="rounded-circle" style="height: 25px; width: 25px;" src="/dynamic/avatar/{{ followers.2.profile.handle }}" alt=""> | ||
</div> | ||
<p class="text-muted font-smaller-4 my-0">Followed by {{ followers.0.profile.handle }}, {{ followers.1.profile.handle }} and {{ followers|length|add:-2}} others you follow</p> | ||
{% endif %} | ||
{% endwith %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets move this logic to a loop instead and limit the looping to be more DRY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this would be better as a loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
setInterval(function(){ | ||
if($ && $('.load-more').length && $(".load-more").isInViewport()){ | ||
$('.load-more').click(); | ||
} | ||
}, 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how this work? doesn't seems to be any ajax request handling this and if checking each second to click the button? Or I am missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
borrowed from a different tab, I think tab_kudos.html. Possibly didn't connect it, will check that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
app/dashboard/views.py
Outdated
|
||
print(f'===== TRIBES COUNT: {TribeMember.objects.filter(org=request.user.profile)}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing print
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
app/dashboard/views.py
Outdated
context['org_kudos'] = profile.get_org_kudos | ||
owned_kudos = profile.get_my_kudos.order_by('id', order_by) | ||
sent_kudos = profile.get_sent_kudos.order_by('id', order_by) | ||
kudos_limit = 8 | ||
context['kudos'] = owned_kudos[0:kudos_limit] | ||
context['sent_kudos'] = sent_kudos[0:kudos_limit] | ||
context['kudos_count'] = owned_kudos.count() | ||
context['sent_kudos_count'] = sent_kudos.count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this context here instead on the general context? shouldn't be here the follow data you need only for that tab?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -83,3 +83,59 @@ const tribeLeader = () => { | |||
}; | |||
|
|||
tribeLeader(); | |||
|
|||
const newManageTribe = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file is loaded in many pleases probably is better to move it to his own file or even loaded on that page only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we omit this at this moment? i'll move this in another PR due i'll be working this weeks on tribes functionality.
app/assets/v2/js/pages/join_tribe.js
Outdated
$(elem).on('click', function(e) { | ||
if (!document.contxt.github_handle) { | ||
e.preventDefault(); | ||
_alert('Please login first.', 'error'); | ||
return; | ||
} | ||
|
||
$(elem).attr('disabled', true); | ||
e.preventDefault(); | ||
const tribe = $(elem).data('tribe'); | ||
const url = `/tribe/${tribe}/join/`; | ||
const sendJoin = fetchData (url, 'POST', {}, {'X-CSRFToken': $("input[name='csrfmiddlewaretoken']").val()}); | ||
|
||
$.when(sendJoin).then(function(response) { | ||
$(elem).attr('disabled', false); | ||
$(elem).attr('member', response.is_member); | ||
if (response.is_member) { | ||
$(elem).addClass('btn-outline-gc-green').removeClass([ 'btn-gc-blue', 'btn-gc-outline-red' ]).text('Following'); | ||
} else { | ||
$(elem).removeClass([ 'btn-outline-gc-green', 'btn-gc-outline-red' ]).addClass('btn-gc-blue').text('Follow'); | ||
} | ||
}).fail(function(error) { | ||
$(elem).attr('disabled', false); | ||
}); | ||
}); | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you rebase this then you will see this file now have const followRequest = (handle, elem, cb, cbError)
function is just the request with a callback you can use it in a way you will have the handle, elem, response and in that way you don't need to copy paste the request part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done :)
@jschiarizzi I'm marking this as ready for review since you still have it set as a draft. Please remember to mark it ready so it notifies us when you finish a draft PR - thanks |
@jschiarizzi actually nvm I just saw @octavioamu set it as draft - disregard my comment |
Thanks for the notes Octavio, will get on this shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments about some things doesn't seeems to be related to this PR
app/assets/v2/css/town_square.css
Outdated
|
||
.new_grant { | ||
border-top: 6px solid rgba(13, 7, 100, 0.25); | ||
} | ||
|
||
.new_kudos { | ||
border-top: 6px solid rgba(0, 163, 255, 0.25); | ||
} | ||
|
||
.new_bounty { | ||
border-top: 6px solid rgba(62, 0, 255, 0.4); | ||
} | ||
|
||
.new_hackathon_project { | ||
border-top: 6px solid rgba(15, 206, 124, 0.25); | ||
} | ||
|
||
.bg-gc-blue { | ||
background-color: var(--gc-blue); | ||
} | ||
|
||
.bg-gc-green { | ||
background-color: var(--gc-green); | ||
} | ||
|
||
.bg-light-blue { | ||
background-color: #00A3FF; | ||
} | ||
|
||
.bg-gc-dark-blue { | ||
background-color: #0D0764; | ||
} | ||
|
||
.card-ribbon { | ||
margin-top: -14px; | ||
right: -10px; | ||
width: 110px; | ||
margin-bottom: 10px; | ||
position: absolute; | ||
} | ||
|
||
.logo-metacard { | ||
max-height: 4rem; | ||
max-width: 4rem; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is all of this here? Is related ?
@@ -15,14 +15,8 @@ | |||
along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
|
|||
{% endcomment %} | |||
{% load humanize i18n static %} | |||
{% load humanize i18n static grants_extra %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about this related
@jschiarizzi any interest in working on this follow up ticket? #6755 |
Looks like you already got to 6755. 🌮 |
Description
New tab on use profile for followers.
Refers/Fixes
#6095
Testing
Tested:
New Follow tab on profile, url addition for following and follower subtabs, inline follow buttons, grid of users, also following list, email and chat buttons, hidden email when None