22 TODO: everything here (probably) should move to the ContentSerializer so we don't have this
33 heavy logic in a random partial
44%>
5- <%
6- relations = Rails.application.config.content_relations[content.class.name]
7- relations ||= []
8- %>
95
106< div id ="associations_panel " class ="panel ">
117 <%= render partial : 'notice_dismissal/messages/07' %>
2925 locals : { value : link_codes , content : content }
3026 %>
3127 <% end %>
32-
33- <% if user_signed_in? %>
34- < div class ="card-panel yellow lighten-5 black-text ">
35- Notice: The newest Notebook.ai release is adding the ability to create your own link
36- fields, which includes a rather large migration of all existing link fields into a new linking system.
37- Links that haven't been migrated yet can be seen below this message; links on the new system appear above.
38- < br /> < br />
39- Thank you for your patience during this large rewrite! This notice will automatically disappear after the
40- migration has completed for everyone.
41- < br /> < br />
42- — Andrew
43- </ div >
44- <% end %>
45-
46- <%# TODO: remove these after finishing link migration script %>
47- <% relations . each do |name , params | %>
48- <%
49- results = params [ :related_class ] . where ( "#{ params [ :through_relation ] . downcase } _id" : content . id )
50- . map { |content | content . send ( params [ :inverse_class ] . downcase ) }
51- . select { |content | content && content . readable_by? ( current_user || User . new ) }
52- %>
53- <% next unless results . any? %>
54-
55- < div class ="uppercase grey-text ">
56- <%= params [ :relation_text ] . to_s . titleize . downcase %> of
57- </ div >
58- <%=
59- link_codes = results . map { |page | "#{ page . page_type } -#{ page . id } " }
60- render partial : "content/display/attribute_value/link" ,
61- locals : { value : link_codes , content : content }
62- %>
63- <% end %>
6428 </ div >
6529</ div >
0 commit comments