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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When will roadmap items be added? #3

Open
VarenSwaab opened this issue Jan 18, 2020 · 10 comments
Open

When will roadmap items be added? #3

VarenSwaab opened this issue Jan 18, 2020 · 10 comments
Labels
question Further information is requested

Comments

@VarenSwaab
Copy link

I really love the functionality of this plugin and will probably buy it for a site I'm working on but there are a few items listed in the Roadmap that I'd like to have. I'm wondering if these items will ever make it into the plugin?

@matthewbacon
Copy link

Yes the AJAX Follow/Unfollow would be top of my list as would be different lists per siteId.

@bymayo
Copy link
Owner

bymayo commented Apr 21, 2020

I'll add AJAX follow to the top of the list.

This plugin seems to be getting some traction and bug reports over the past few weeks. So i'll drop some features on it.

Any questions, hit me up on Discord (@bymayo)

@bymayo bymayo changed the title Is the plugin still being developed? When will roadmap items be added? Apr 21, 2020
@bymayo bymayo added the question Further information is requested label Apr 21, 2020
@VarenSwaab
Copy link
Author

Thanks for the reply bymayo, any guesstimate of when you will release an update?

@bymayo
Copy link
Owner

bymayo commented Jun 10, 2020

@VarenSwaab Which roadmap feature are you in need of?

@VarenSwaab
Copy link
Author

@bymayo Thanks for asking, this would be my preferred order:

Notifications
Ajax for follow buttons
Different lists per siteId
Accept / Deny the follow request
Limits on queries.
Auto output users elements, rather than passing a list (not really sure what this is)

@bymayo
Copy link
Owner

bymayo commented Jun 12, 2020

@VarenSwaab No problem.

Just FYI the accept/deny follow request will be added in the next week as this got added in due to a request from a client. Notifications will follow not long after.

Ajax for buttons, this will just be an example. I might also put an AlpineJS example in. I'm working on generating examples today.

@matthewbacon
Copy link

matthewbacon commented Jun 12, 2020 via email

@tom-byrom
Copy link

@VarenSwaab No problem.

Just FYI the accept/deny follow request will be added in the next week as this got added in due to a request from a client. Notifications will follow not long after.

Ajax for buttons, this will just be an example. I might also put an AlpineJS example in. I'm working on generating examples today.

looking forward to this update @bymayo

@JMKelley
Copy link

Following this, looking forward to the AJAX buttons.

@tom-byrom
Copy link

tom-byrom commented Aug 30, 2020

Seen a couple of you were interested in Ajax follow buttons (@JMKelley @VarenSwaab @var` ), I've just done this in Vanilla JS. @bymayo might be able to advise a better solution, not sure what your example was going to be mate? But this works well enough for me atm without dependencies. Might need to change things depending on your setup.
This would also work if JS didn't fire on the page for some reason as the links are standard.

HTML/TWIG

{% if currentUser %}
{% if craft.follow.check({ elementId: author.id }) %}
<a id="followBtn" data-author="{{ entry.author.id }}" class="unfollow btn btn-outline-primary btn-sm d-block" href="{{ craft.follow.unfollowUrl(author.id) }}">Unfollow</a>
{% else %}
<a id="followBtn" data-author="{{ entry.author.id }}" class="follow btn btn-primary btn-sm d-block" href="{{ craft.follow.followUrl(author.id) }}">Follow</a>
{% endif %}
{% else %}
<a id="followBtn" data-author="{{ entry.author.id }}" class="nofollow btn btn-primary btn-sm d-block" href="/register">Follow</a>
{% endif %}

JS

let followBtn = document.getElementById('followBtn')

followBtn.addEventListener('click', function(){

    let authorId = this.dataset.author

    if (followBtn.classList.contains('follow')) {
        event.preventDefault()
        fetch('/index.php?p=actions/follow/element/follow&elementId='+authorId)
        .then(function(response) {
            if(response.status) {
                followBtn.classList.remove('follow', 'btn-primary');
                followBtn.classList.add('unfollow', 'btn-outline-primary');
                followBtn.setAttribute('href', '/index.php?p=actions/follow/element/unfollow&elementId='+authorId);
                followBtn.innerHTML = 'Unfollow'
            }
        })
    }
    if (followBtn.classList.contains('unfollow')) {
        event.preventDefault()
        fetch('/index.php?p=actions/follow/element/unfollow&elementId='+authorId)
        .then(function(response) {
            if(response.status) {
                followBtn.classList.remove('unfollow', 'btn-outline-primary');
                followBtn.classList.add('follow', 'btn-primary');
                followBtn.setAttribute('href', '/index.php?p=actions/follow/element/follow&elementId='+authorId);
                followBtn.innerHTML = 'Follow'

            }
        })
    }
    else {
    }
})

FINAL EDIT

Updated - so now does not use inline JS and gets element id from a data attribute on the follow button itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants