-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
add profile links from other communities #1409
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
718f5c4
checkpoint (not working)
cellio d1a7d88
adds partially-working network tab to user profile: links work, posts…
cellio a553e0d
Removed debugging output.
cellio 4c0206a
very basic working network profile
cellio acf015b
rubocop
cellio 31bdfc2
rubocop
cellio 70255a7
Merge branch 'develop' into cellio/284-basic-network-profile
Oaphi 56f5a7f
extra safety and style cleanup
cellio d8012df
Merge branch 'cellio/284-basic-network-profile' of https://github.com…
cellio ee97921
rubocop
cellio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<table class="table is-with-hover is-full-width"> | ||
<tr> | ||
<th>Profile on Community</th> | ||
<th>Posts</th> | ||
<th>Reputation</th> | ||
</tr> | ||
|
||
<% @communities.each do |c| %> | ||
<% if @user.has_profile_on(c) %> | ||
<tr> | ||
<td><%= user_link @user, { host: c.host}, anchortext: c.name %> | ||
<% if @user.is_moderator_on(c) %> | ||
(moderator) | ||
<% end %> | ||
</td> | ||
<td><%= @user.post_count_on(c) %> </td> | ||
<td><%= @user.reputation_on(c) %> </td> | ||
</tr> | ||
<% end %> | ||
<% end %> | ||
|
||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<%= render 'tabs', user: @user %> | ||
|
||
<h1>Profiles for <%= user_link @user %></h1> | ||
|
||
<p> | ||
Links to profiles on other communities on this network. | ||
</p> | ||
|
||
<%= render 'network' %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 going to be expensive when run for multiple users and/or communities on one page. We're probably alright at current scale, but we should ultimately cache this on the CommunityUser model for each community.
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.
It occurs to me that the community-specific post count shows up other places, including on the profile, where we call
@user.posts.undeleted.count
. But I'm not quite sure how to do that for a non-local user -- any advice? We're calling this from a user on site A and asking about the user on site B, C, D... .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.
Filed #1411 after discussion with @ArtOfCode- .