Add login modal to subscribe to emails button
This issue is a continuation of #4132
On the requests page, there is a button to subscribe to emails:

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
@SidharthBansal where can one find the partial for the subscribe button?
Patiala are present in the app/views folder check them there
Partials I mean
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
So you need to ensure at least above 4 mentioned flows
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?
Integrated modal testing Please submit this task for review I should approve it now.
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
#4186
Please submit a PR for the rewards. I have already rewarded for the identification of this task in #4132
@JonathanXu1 you have received points for these suggestions. It is part of identication issue #4132
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.
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?
Oh I see. So all I have to do is provide an example solution for my fto issues regarding the modal?
You can provide it if you want. OR If you want to send us a pr. Then you can also do that.
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 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?
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 .
@JonathanXu1 how is it going? Do you need any help?
@Dsxv you were asking for issues to be assigned to you. Do you want to do this?