buddypress / next-template-packs

is this the next BuddyPress template pack?
35 stars 9 forks source link

Invite All Members, use same member search and detail as Member directory #157

Open Jon007 opened 7 years ago

Jon007 commented 7 years ago

Currently the Group, Invite, All Members screen just shows the usernames (and picture if uploaded or broken picture if not uploaded). This may not be enough to corrrectly identify a user in All Members, there may be many people called jon123, jon456 etc

Why not allow the same features as Member directory? If searching All Members to invite, this should be the same as a search in the Member directory.

In the Member directory I enable advanced search with BP Profile Search, and add additional display information from XProfile fields, to make it easier to search for and correctly identify the person.

hnla commented 7 years ago

@Jon007 Yes this screen hasn't been updated yet to use the revised search markup yet & in general needs attention, it's on my todo list to overhaul.

I'll ping this ticket when it's updated, a further review would be helpful.

Jon007 commented 7 years ago

Great, I'll be happy to help review.

The Members directory and Group Members screens both work great with pre-existing non-Nouveau enhancements. Though the html is slightly different between the two throwing out some css... I probably need a completely different stylesheet if BP Nouveau is enabled, or make the stylesheet conditional dependent on the number of columns...).

hnla commented 7 years ago

@Jon007

Although possibly not directly related to your ticket here & concerns I have pushed up a revision of the screen to update the search form to mirror the the approach with the main dir searches also updated styles to re-gain icon display. https://github.com/buddypress/next-template-packs/commit/969b23585f2dadc8e75921697e41127a7889eb8b

Not sure if that addresses those concerns over the html question above?

However not sure we can do a lot about things like advanced profile search on these screens but if you want to look into it further and possibly patch or offer suggestions as to what would need doing to allow profile search we can examine further.

Again any/all feedback welcome.

Jon007 commented 7 years ago

Hi @hnla I got the latest code, but I'm not sure what the overall effect of the changes is supposed to be... At least from visual point of view, I still get a plain list of usernames (which might not be recognisable) and broken avatars [it could be a problem with the avatar plugin but the avatars are working on Member directory and Group Members so why would this screen be different].

The extension hooks I am using are:

  1. Add Member details to display
    
    add_action( 'bp_directory_members_item', 'display_member_profile_fields' );
    add_action( 'bp_group_members_list_item', 'display_member_profile_fields' );
which hooks into the member detail display in the Member directory and the Group Members screen to add a generic display_member_profile_fields() function that does what you might expect from the name.

2. **detail search**, implemented by BP Profile Search plugin for Members directory, I can hook this into the Group Members with:

add_action ('bp_before_group_members_content', 'bps_add_form'); add_action ('bp_before_group_members_content', 'bps_display_filters');


.. plus a couple of small hacks to get it to work right..
[at this moment actually applying the filter to the group members is not working now after the update]

So I would be looking to implement these types of hooks on the Invites member search functionality.
hnla commented 7 years ago

@jon007 Primarily the commit was to address fact that we had variance in our search markup form from the dir search examples to this invites screen which was built using Backbone so not calling the common include for search, this also addressed styling problems, in addition I did fix up things like icons (not tested cross browsers though)

No hooks were changed or should have been changed in that commit so not sure what is occurring there, but generally hooks were largely re-imagined for Nouveau, so would welcome any testing you can do to establish what's not working here or where broken and we can look to address it.

Jon007 commented 7 years ago

Hi, I'm not sure you understood the point I was attempting to make.

Currently the invitation screen looks like this, which is not usable for identifying members to invite: invite link

The finished invitation screen should look like the group members screen. In fact it should be the same as the Group Members screen, which is already searchable, it should just search for non-members instead, and with an extra button on the user to send the invite. For example a Group Members screen might look like this, with advanced search available and more details to be able to correctly identify and select the user to invite: members link

I hoped it might be possible to change next-template-packs/bp-templates/bp-nouveau/buddypress/_accessoires/invites/index.php

<script type="text/html" id="tmpl-bp-invites-users">
    <div class="item-avatar">
        <img src="{{data.avatar}}" class="avatar">
    </div>

    <div class="item">
        <div class="list-title member-name">
            {{data.name}}
        </div>

to make use of the code from next-template-packs/bp-templates/bp-nouveau/buddypress/groups/single/members-loop.php

            <li <?php bp_member_class( array('item-entry') ); ?> data-bp-item-id="<?php echo esc_attr( bp_get_group_member_id() ); ?>" data-bp-item-component="members">

                <div class="list-wrap">
                    <div class="item-avatar">
                        <a href="<?php bp_group_member_domain(); ?>">
                            <?php bp_group_member_avatar_thumb(); ?>
                        </a>
                    </div>

                    <div class="item">

                        <h2 class="list-title member-name"><?php bp_group_member_link(); ?></h2>

                        <p class="joined item-meta">
                            <?php bp_group_member_joined_since(); ?>
                        </p>

                        <?php bp_nouveau_group_hook( '', 'members_list_item' ); ?>

                        <?php bp_nouveau_members_loop_buttons(); ?>

                    </div>
                </div>

            </li>

but since one is php and the other seems to be a Backbone script, they're not compatible.

Without giving an opinion on which solution is best technologically:

Remember, the existing legacy BuddyPress invite was only for inviting from your existing friends, whose @ login name you have some change of remembering. When this is opened out to invite any user of the site, you need the same facilities as the Member directory for searching and identifying your invitees from a potentially massive list of users.

hnla commented 7 years ago

but since one is php and the other seems to be a Backbone script, they're not compatible.

This is what makes it slightly less than straightforward, I take your points though, I think the original intent was that users in this scenario didn't need to be quite as detailed as member directory or groups - we may be able to work something out though.

Jon007 commented 7 years ago

Well for my purposes, I added:

I'm not sure the Backbone scripts are a step forward. Ajax is great but these screens that load empty of data and then do another round trip to load up the data, seem clunky to me. (even on local install, admittedly with XDebug on)