my eye

Dedent profile preview code

Committed 726e3e

--- a/webint_search/templates/results.html
+++ b/webint_search/templates/results.html

 
 $if iw_profile or ap_profile:
     <div class=profile
-        style="display:grid;grid-gap:1em;grid-template-columns:20% auto;margin:2em 0 0 0">
-        $if iw_profile:
-            $ profile = iw_profile
-            $if photos := profile.get("photo"):
-                <img src=$photos[0] style=width:100%>
-            <div>
-            <p style=margin:0><big><strong>$profile["name"][0]</strong></big><br>
-            $if urls := profile.get("url"):
-                <small>
-                $for url in urls:
-                    <a href=$url>$url</a>
-                    $if not loop.last:
-                        &bull;
-                </small></p>
-            <div class=profile_summary>$:profile["note"][0]</div>
-            $if tags := profile.get("category"):
-                <div style=font-size:.8em>
-                $for tag in tags:
-                    $if "value" in tag:
-                        $tag["value"]
-                    $else:
-                        $tag
-                    $if not loop.last:
-                        &bull;
-                </div>
+    style="display:grid;grid-gap:1em;grid-template-columns:20% auto;margin:2em 0 0 0">
+    $if iw_profile:
+        $ profile = iw_profile
+        $if photos := profile.get("photo"):
+            <img src=$photos[0] style=width:100%>
+        <div>
+        <p style=margin:0><big><strong>$profile["name"][0]</strong></big><br>
+        $if urls := profile.get("url"):
+            <small>
+            $for url in urls:
+                <a href=$url>$url</a>
+                $if not loop.last:
+                    &bull;
+            </small></p>
+        <div class=profile_summary>$:profile["note"][0]</div>
+        $if tags := profile.get("category"):
+            <div style=font-size:.8em>
+            $for tag in tags:
+                $if "value" in tag:
+                    $tag["value"]
+                $else:
+                    $tag
+                $if not loop.last:
+                    &bull;
             </div>
-        $elif ap_profile:
-            $ profile = ap_profile
-            $if photos := profile.get("icon"):
-                $if not isinstance(photos, list):
-                    $ photos = [photos]
-                <img src=$photos[0]["url"] style=width:100%>
-            <div>
-            <p style=margin:0><big><strong>
-            $ name = profile.get("name")
-            $ preferred_username = profile.get("preferredUsername")
-            $if name:
-                $profile["name"]
-            $if name and preferred_username:
-                <small>(
-            $if preferred_username:
-                $profile["preferredUsername"]
-            $if name and preferred_username:
-                )</small>
-            </strong></big><br>
-            $if "url" in profile:
-                $ urls = profile["url"]
-                $if not isinstance(urls, list):
-                    $ urls = [urls]
-                <small>
-                $for url in urls:
-                    <a href=$url>$url</a>
-                    $if not loop.last:
-                        &bull;
-                </small>
-            </p>
-            <div class=profile_summary>$:profile["summary"]</div>
-            $if "tag" in profile:
-                <div style=font-size:.8em>
-                $for tag in profile["tag"]:
-                    $tag["name"]
-                    $if not loop.last:
-                        &bull;
-                </div>
+        </div>
+    $elif ap_profile:
+        $ profile = ap_profile
+        $if photos := profile.get("icon"):
+            $if not isinstance(photos, list):
+                $ photos = [photos]
+            <img src=$photos[0]["url"] style=width:100%>
+        <div>
+        <p style=margin:0><big><strong>
+        $ name = profile.get("name")
+        $ preferred_username = profile.get("preferredUsername")
+        $if name:
+            $profile["name"]
+        $if name and preferred_username:
+            <small>(
+        $if preferred_username:
+            $profile["preferredUsername"]
+        $if name and preferred_username:
+            )</small>
+        </strong></big><br>
+        $if "url" in profile:
+            $ urls = profile["url"]
+            $if not isinstance(urls, list):
+                $ urls = [urls]
+            <small>
+            $for url in urls:
+                <a href=$url>$url</a>
+                $if not loop.last:
+                    &bull;
+            </small>
+        </p>
+        <div class=profile_summary>$:profile["summary"]</div>
+        $if "tag" in profile:
+            <div style=font-size:.8em>
+            $for tag in profile["tag"]:
+                $tag["name"]
+                $if not loop.last:
+                    &bull;
             </div>
+        </div>
     </div>
     $if tx.user.is_owner:
         <form action=/people method=post style=text-align:right>