Plots2: Not able to unsubscribe after clicking following button of a tag.

Created on 15 Jan 2018  ·  4Comments  ·  Source: publiclab/plots2

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

The problem

A user is not able to click the following button again to unfollow the specific tag but is just redirected to that tag page.
screenshot from 2018-01-15 21-52-02

screenshot from 2018-01-15 22-01-25

What's supposed to happen:
If user is already following the topic this clicking this button again should unsubscribe the user from that topic.

What actually does happen:
User is just redirected to the specific topic page.

Solution

Where to find the relevant lines of code:
https://github.com/publiclab/plots2/blob/master/app/views/home/subscriptions.html.erb#L9
https://github.com/publiclab/plots2/blob/master/app/views/tag/show.html.erb#L47

What to change them to:

We need to add data-method="delete" to the above mentioned two lines.

<a rel="tooltip" title="<%= t('home.subscriptions.click_unfollow') %>" class="btn btn-default active" href="/unsubscribe/tag/everything"><i class="fa fa-eye"></i> <%= t('home.subscriptions.following') %> <b><%= t('home.subscriptions.research_notes') %></b></a>
to
<a rel="tooltip" title="<%= t('home.subscriptions.click_unfollow') %>" class="btn btn-default active" href="/unsubscribe/tag/everything" data-method="delete"><i class="fa fa-eye"></i> <%= t('home.subscriptions.following') %> <b><%= t('home.subscriptions.research_notes') %></b></a>

and

<a rel="tooltip" title="<%= t('home.subscriptions.click_unfollow') %>" class="btn btn-default active" href="/unsubscribe/tag/everything"><i class="fa fa-eye"></i> <%= t('home.subscriptions.following') %> <b><%= t('home.subscriptions.research_notes') %></b></a>
to
<a rel="tooltip" title="<%= t('home.subscriptions.click_unfollow') %>" class="btn btn-default active" href="/unsubscribe/tag/everything" data-method="delete"><i class="fa fa-eye"></i> <%= t('home.subscriptions.following') %> <b><%= t('home.subscriptions.research_notes') %></b></a>

Steps to Fix

  • [ ] claim this issue with a comment here, below, and ask any clarifying questions you need
  • [ ] set up a repository locally following the README instructions, and make sure that all tests pass
  • [ ] try to fix the issue following the steps above, but even before you're done, you can:
  • [ ] commit your changes and start a pull request (see contributing to Public Lab software) but mark it as "in progress" if you have questions or if you haven't finished
  • [ ] alert someone via the developers list (see below) to have your pull request merged. This may take a few extra steps depending on when you do it, but we'll help you out!

Please email the developers list (see https://publiclab.org/wiki/developers) or go to the chatroom if you have questions, and take a look at our first-timers landing page for more information!

HTML bug first-timers-only help wanted

All 4 comments

i want to work on this issue

@namangupta01 - you're welcome to tackle this one, but if I recall you've done a first-timers-only issue once before; once you're done with this, perhaps you'd like to tackle one of the slightly less fully-documented issues over at https://publiclab.github.io/community-toolbox/#r=all so that a complete newcomer could take the first-timers-only issues? Don't under-estimate your expertise! :-)

Thanks!!!

And @rishabhptr -- great first time first timer only issue! 👍 💯

@jywarren Sure, I will!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

grvsachdeva picture grvsachdeva  ·  3Comments

bronwen9 picture bronwen9  ·  3Comments

shapironick picture shapironick  ·  3Comments

RuthNjeri picture RuthNjeri  ·  3Comments

grvsachdeva picture grvsachdeva  ·  3Comments