Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove legacy links display & banner
  • Loading branch information
drusepth committed Oct 4, 2021
commit 70126b487cdb60bff5361fe9e349d89600f31b7c
36 changes: 0 additions & 36 deletions app/views/content/panels/_associations.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
TODO: everything here (probably) should move to the ContentSerializer so we don't have this
heavy logic in a random partial
%>
<%
relations = Rails.application.config.content_relations[content.class.name]
relations ||= []
%>

<div id="associations_panel" class="panel">
<%= render partial: 'notice_dismissal/messages/07' %>
Expand All @@ -29,37 +25,5 @@
locals: { value: link_codes, content: content }
%>
<% end %>

<% if user_signed_in? %>
<div class="card-panel yellow lighten-5 black-text">
Notice: The newest Notebook.ai release is adding the ability to create your own link
fields, which includes a rather large migration of all existing link fields into a new linking system.
Links that haven't been migrated yet can be seen below this message; links on the new system appear above.
<br /><br />
Thank you for your patience during this large rewrite! This notice will automatically disappear after the
migration has completed for everyone.
<br /><br />
&mdash; Andrew
</div>
<% end %>

<%# TODO: remove these after finishing link migration script %>
<% relations.each do |name, params| %>
<%
results = params[:related_class].where("#{params[:through_relation].downcase}_id": content.id)
.map { |content| content.send(params[:inverse_class].downcase) }
.select { |content| content && content.readable_by?(current_user || User.new) }
%>
<% next unless results.any? %>

<div class="uppercase grey-text">
<%= params[:relation_text].to_s.titleize.downcase %> of
</div>
<%=
link_codes = results.map { |page| "#{page.page_type}-#{page.id}" }
render partial: "content/display/attribute_value/link",
locals: { value: link_codes, content: content }
%>
<% end %>
</div>
</div>