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

Problems with parent powertag #5674

Open
publiclab-mimi opened this issue May 7, 2019 · 4 comments
Open

Problems with parent powertag #5674

publiclab-mimi opened this issue May 7, 2019 · 4 comments
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed

Comments

@publiclab-mimi
Copy link
Collaborator

I want to make this page (https://publiclab.org/wiki/student-led-community-science-in-the-classroom-a-curriculum) the parent page for this page (https://publiclab.org/notes/mimiss/05-07-2019/workshop-i-how-do-communities-respond-to-environmental-problems)

but I'm having trouble with the powertag.

I think it should be parent:student-led-community-science-in-the-classroom-a-curriculum but it doesn't link back to the wiki. Instead, using that parent tag gives me the following:

Screen Shot 2019-05-07 at 11 43 11 AM

Wondering if this is a powertag problem or a me problem

@jywarren
Copy link
Member

jywarren commented May 7, 2019 via email

@publiclab-mimi
Copy link
Collaborator Author

publiclab-mimi commented May 7, 2019 via email

@divyabaid16 divyabaid16 added the bug the issue is regarding one of our programs which faces problems when a certain task is executed label May 9, 2019
@jywarren jywarren added this to the Tagging and topics milestone Nov 20, 2019
@stale stale bot added the stale label Oct 7, 2020
@publiclab publiclab deleted a comment from stale bot Oct 8, 2020
@stale stale bot removed the stale label Oct 8, 2020
@jywarren
Copy link
Member

jywarren commented May 18, 2021

Hi @publiclab-mimi - I looked at this again and finally figured out that i had not noticed the "child" page was a note, not a wiki. We don't currently have parent page "backlinks" implemented on notes. I can add this (it's a pretty easy addition to the code segment below) but do you think it should "stack" below the existing This is part of a series on student-community-science. alert box? Or should the "series" alert box block a parent one?

Thanks!

<% if current_user && @node.tags.size == 0 && !@preview %><div class="alert alert-warning"><%= raw translation('notes.show.note_no_tags', url: 'javascript: document.getElementById("tags-open").click();') %></div><% end %>
<% if @node.has_power_tag('status:candidate') %><div class="alert alert-info">This was marked as a candidate activity -- <a href="https://publiclab.org/notes/warren/09-17-2016/what-makes-a-good-activity" >read about how to adapt its content</a> into a fully-fledged, step-by-step activity that can be easily replicated.</div><% end %>
<% if @node.has_power_tag('replication') %><div class="alert alert-info"><%= raw translation('notes.show.replication') %> <a href="/n/<% if !@preview %><%= @node.power_tag('replication') %><% end %>"><%= raw translation('notes.show.replication_link') %></a>.</div><% end %>
<% if @node.has_power_tag('series') %><div class="alert alert-info"><%= raw translation('notes.show.series') %> <a href="/tag/series:<% if !@preview %><%= @node.power_tag('series')%>"><%= @node.power_tag('series') %><% end %></a>.</div><% end %>
<% if @node.has_power_tag('build') %><div class="alert alert-info"><%= raw translation('notes.show.build') %> <a href="/n/<% if !@preview %><%= @node.power_tag('build') %><% end %>"><%= raw translation('notes.show.build_link') %></a>.</div><% end %>
<% if @node.has_power_tag('alert') && feature("alert-#{@node.power_tag('alert')}") != "" && !@preview %>
<%= feature("alert-#{@node.power_tag('alert')}") %>
<% end %>
<% if @node.has_power_tag('with') && current_user && @node&.coauthors&.collect(&:username)&.include?(current_user.username) && !@preview %> <div class="alert alert-success"> You are a coauthor of this post. This attributes your contribution, and gives you edit access to the note. <a href="https://publiclab.org/wiki/power-tags#Coauthorship"> Learn more </a></div><% end %>
<% if @node.has_power_tag('upgrade') %><div class="alert alert-success"> This is an upgrade for <% if !@preview %><a href="/<%= @node.power_tag('upgrade') %>"><%= @node.power_tag('upgrade') %></a>.<% end %> Try building it and <% if !@preview %><a href="/n/<%= @node.power_tag('upgrade') %>"><% end %> report back </a>how it goes.</div><% end %>

Here is the code from the wiki template that generates this alert. We can just copy it back over into the notes template:

<% if @node.has_power_tag('parent') %>
<% parent = Node.find_by(slug: @node.power_tag('parent')) %>
<% if parent %>
<div class="alert alert-success" style="border-color:#eee;background:#f8f8f8;color:#aaa;">&laquo; <%= raw translation('wiki.show.back_to_wiki', :url1 => parent.path, :title => parent.latest.title) %></a></div>
<% end %>
<% end %>

@publiclab-mimi
Copy link
Collaborator Author

publiclab-mimi commented May 18, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed
Projects
None yet
Development

No branches or pull requests

3 participants