Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

BP Members block #26

Merged
merged 12 commits into from Oct 3, 2020
Merged

BP Members block #26

merged 12 commits into from Oct 3, 2020

Conversation

imath
Copy link
Member

@imath imath commented Oct 2, 2020

Here's a new BP Block to select community members and feature them into a post or a page. It's a different approach than building blocks out of one or more of our Members widgets. These are sorting members rather than allow the site admin to pick the ones he'd like to display.

Block's initial state

bp-members-block-01

It looks very similar to the BP Member block at first sight 馃槈. From the block settings, you'll find some options you know from it: whether to display the user name, mention name, the full/thumb version of the avatar or no avatar at all.

Selecting members

bp-members-block-02

Just like the instruction says: Start typing the name of the member you want to add to the members list. Once a member is added, the Autocompleter control is shrinked to the minimum.

bp-members-block-03

List or Grid display?

bp-members-block-04

From the block's toolbar you can choose whether to display the featured members in list or into a grid layout. If you activated the Grid layout, you'll then be able to choose the number of columns (from 2 to 4) for this grid from the Block's settings.

bp-members-block-06

Extra BuddyPress information

When the list display is active, you can include 2 kinds of extra information about the members :

  • the last time they were active on the site,
  • the latest update they posted.

bp-members-block-08

When the grid display is active, you can only include the last time the members were active.

bp-members-block-07

Removing a member from the members list

bp-members-block-09

Simply click on the x button at the right of the member's line / cell.

We plan to include this block into BuddyPress 7.0.0 馃崟

imath and others added 12 commits September 26, 2020 21:27
The idea of this block is to let the post/page author to select the members he wants to add to the members list.

The BP Autocompleter make it easy to select members one by one. If we are using a dynamic block, we can't use the ServerSideRender component to output the block.
We need to deal with it using JavaScript so that it's possible to remove a member from the list.
- Remove the Cover Image, we will not use it for this block as we do not get it fromt the Members REST API endpoint
- Add styles
- Add a comment to think about using the data that we should get using the `populate_extras` argument of the Members REST API endpoint
Only display the autocompleter and the remove button if the block is selected
Handle member removal.
If buddypress/BP-REST#355 is merged, it then will be possible to include the last time members were active and the latest updated they posted into the Members block
Copy link
Member

@renatonascalves renatonascalves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice!

@imath
Copy link
Member Author

imath commented Oct 3, 2020

Thanks for your review @renatonascalves 馃憤 Let's have this in!

@imath imath merged commit 40a56e8 into master Oct 3, 2020
@imath imath deleted the add/members-block branch October 3, 2020 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants