嗨,这是一个仅限初学者的问题。 这意味着我们一直致力于让之前没有为我们的代码库做出贡献的人,甚至之前没有为开源做出贡献的人更容易阅读。
如果这就是您,我们有兴趣帮助您迈出第一步,并可以像您一样回答问题并帮助您解决问题。 请注意,我们对自由和开源软件中代表性不足的群体的贡献特别感兴趣!
如果您以前有过贡献,请考虑将这个留给新人,并查看我们的一般帮助需要的问题。 谢谢!
用户无法再次单击以下按钮来取消关注特定标签,而只是重定向到该标签页面。
应该发生什么:
如果用户已经在关注该主题,则再次单击此按钮应取消该用户对该主题的订阅。
实际发生了什么:
用户只是被重定向到特定的主题页面。
在哪里可以找到相关的代码行:
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
将它们更改为:
我们需要将data-method="delete"
到上面提到的两行中。
<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>
至<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>
和
<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>
至<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>
如果您有问题,请通过电子邮件发送开发人员列表(请参阅 https://publiclab.org/wiki/developers)或前往聊天室,并查看我们的首次登录页面了解更多信息!
我想解决这个问题
@namangupta01 - 欢迎你解决这个问题,但如果我记得你以前做过一个first-timers-only
问题; 完成此操作后,也许您想在 https://publiclab.github.io/community-toolbox/#r=all 上解决稍微不那么完整的问题之一,以便一个完整的新手可以处理first-timers-only
问题? 不要低估您的专业知识! :-)
谢谢!!!
和@rishabhptr - 伟大的第一
@jywarren当然,我会的!