plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Add login modal to subscribe to emails button

Open jonxuxu opened this issue 7 years ago • 30 comments

This issue is a continuation of #4132

On the requests page, there is a button to subscribe to emails: image

However that cannot be done unless a user is logged in, so a warning popup is shown. What we want to do is make a login modal appear when the button is clicked and the user is not logged in.

Link: https://publiclab.org/wiki/requests

jonxuxu avatar Dec 08 '18 17:12 jonxuxu

@SidharthBansal where can one find the partial for the subscribe button?

jonxuxu avatar Dec 10 '18 04:12 jonxuxu

Patiala are present in the app/views folder check them there

SidharthBansal avatar Dec 10 '18 04:12 SidharthBansal

Partials I mean

SidharthBansal avatar Dec 10 '18 04:12 SidharthBansal

Great to see you working you on this. Basic flow User not logged in->presses the buttom-> login modal-> logs in successfully->email is subscribed with notification User already logged in wants to subscribe works well Alternate flow Subscription is already present so user gets subscribed with notification User already logged in wants to unsubscribe successfully

SidharthBansal avatar Dec 10 '18 04:12 SidharthBansal

So you need to ensure at least above 4 mentioned flows

SidharthBansal avatar Dec 10 '18 04:12 SidharthBansal

Ok. I'm using

<% if current_user %> 
   a
<% else %>
   b
<% end %>

to check if a user is logged in. However, a runs even if the user is logged out. Also is there a way to route the page back to the current one when the login is successful?

jonxuxu avatar Dec 10 '18 04:12 jonxuxu

Integrated modal testing Please submit this task for review I should approve it now.

SidharthBansal avatar Dec 10 '18 04:12 SidharthBansal

to check if a user is logged in. However, a runs even if the user is logged out. Also is there a way to route the page back to the current one when the login is successful?

Please look at @okonek's PR of linking like buttons it will help you

SidharthBansal avatar Dec 10 '18 04:12 SidharthBansal

#4186

SidharthBansal avatar Dec 10 '18 04:12 SidharthBansal

Please submit a PR for the rewards. I have already rewarded for the identification of this task in #4132

SidharthBansal avatar Dec 10 '18 06:12 SidharthBansal

@JonathanXu1 you have received points for these suggestions. It is part of identication issue #4132

SidharthBansal avatar Dec 10 '18 07:12 SidharthBansal

https://github.com/publiclab/plots2/pull/4209#issuecomment-445678224 Sorry I believe I misunderstood your statement. I thought it was one task per fto issue created.

jonxuxu avatar Dec 10 '18 07:12 jonxuxu

If you create a first timer issue with full fledged solution and the first timer template then you will get rewards. Is it now clear?

SidharthBansal avatar Dec 10 '18 13:12 SidharthBansal

Oh I see. So all I have to do is provide an example solution for my fto issues regarding the modal?

jonxuxu avatar Dec 10 '18 13:12 jonxuxu

You can provide it if you want. OR If you want to send us a pr. Then you can also do that.

SidharthBansal avatar Dec 10 '18 13:12 SidharthBansal

Just a note that this button is stored in the node body, not in the codebase. Still a great idea! Just may require either some clever filtering of body content or some kind of shortcode to show a subscription button?

On Sun, Dec 9, 2018 at 10:05 PM Jonathan Xu [email protected] wrote:

@SidharthBansal https://github.com/SidharthBansal where can one find the partial for the subscribe button?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/4192#issuecomment-445666561, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ5LIZisp7m6SvO_cBmHrFYNcI53Vks5u3d19gaJpZM4ZJvCX .

jywarren avatar Dec 10 '18 14:12 jywarren

@jywarren I think this might be similar to https://github.com/publiclab/plots2/issues/4170 Is it possible for us to get a copy of the node body and submit that to complete the task?

jonxuxu avatar Dec 10 '18 14:12 jonxuxu

if you click the edit button you'll be able to see the raw body -- try it!

On Mon, Dec 10, 2018 at 9:00 AM Jonathan Xu [email protected] wrote:

@jywarren https://github.com/jywarren I think this might be similar to #4170 https://github.com/publiclab/plots2/issues/4170 Is it possible for us to get a copy of the node body and submit that to complete the task?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/4192#issuecomment-445845154, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ6L7VOaAll5yjZRoxVsrQ3n8nupmks5u3nbhgaJpZM4ZJvCX .

jywarren avatar Dec 10 '18 15:12 jywarren

@JonathanXu1 how is it going? Do you need any help?

SidharthBansal avatar Dec 23 '18 12:12 SidharthBansal

@Dsxv you were asking for issues to be assigned to you. Do you want to do this?

SidharthBansal avatar Jan 10 '19 16:01 SidharthBansal