Only show linked elements when they are loaded and not failed
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 31 Mar 2017 05:02:10 +0000 (07:02 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 31 Mar 2017 05:02:10 +0000 (07:02 +0200)
src/main/resources/templates/include/viewPost.html
src/main/resources/templates/include/viewReply.html

index ed6e5cc..e3c9aec 100644 (file)
                        <%if !shortText|match value=renderedText><%if !raw><a class="shrink-post-text hidden"><%= View.Post.ShowLess|l10n|html></a><%/if><%/if>
                        <% parsedText|linked-elements sone=post.sone|store key==linkedElements>
                        <% foreach linkedElements linkedElement>
-                               <% first>
-                                       <div class="linked-elements">
-                               <%/first>
-                               <% linkedElement|render-linked-element>
-                               <% last>
-                                       </div>
-                               <%/last>
+                               <%if !linkedElement.loading>
+                                       <%if !linkedElement.failed>
+                                               <% first>
+                                                       <div class="linked-elements">
+                                               <%/first>
+                                               <% linkedElement|render-linked-element>
+                                               <% last>
+                                                       </div>
+                                               <%/last>
+                                       <%/if>
+                               <%/if>
                        <%/foreach>
                </div>
                <div class="post-status-line status-line<%if !post.loaded> hidden<%/if>">
index 32fb73d..6aaf698 100644 (file)
                        <%if !shortText|match value=renderedText><%if !raw><a class="shrink-reply-text hidden"><%= View.Post.ShowLess|l10n|html></a><%/if><%/if>
                        <% parsedText|linked-elements sone=reply.sone|store key==linkedElements>
                        <% foreach linkedElements linkedElement>
-                               <% first>
-                                       <div class="linked-elements">
-                               <%/first>
-                               <% linkedElement|render-linked-element>
-                               <% last>
-                                       </div>
-                               <%/last>
+                               <%if !linkedElement.loading>
+                                       <%if !linkedElement.failed>
+                                               <% first>
+                                                       <div class="linked-elements">
+                                               <%/first>
+                                               <% linkedElement|render-linked-element>
+                                               <% last>
+                                                       </div>
+                                               <%/last>
+                                       <%/if>
+                               <%/if>
                        <%/foreach>
                </div>
                <div class="reply-status-line status-line">