Add the ability to redirect to the resulting link, some styling
[bigly] / src / bigly / templates / bigly / link_info.html
index bdd5265..4eb7d1f 100644 (file)
@@ -1,23 +1,20 @@
-{% load static %}
-<!doctype html>
-<html lang='en'>
-  <head>
-    <title>bigly</title>
+{% extends 'bigly/_base.html' %}
 
-    <meta charset='utf-8'/>
-    <meta name='viewport' content='width=device-width, initial-scale=1'/>
-    <meta name='description' content='A tool for unshortening links that have been shortened with a link shortener.'/>
-    <meta name='author' content='David Kerkeslager'/>
-
-    <link rel='stylesheet' href='{% static "bigly/styles.css" %}'/>
-  </head>
-
-  <body>
-    <table>
-      <tr>
-        <td>Link:</td>
-        <td><a href='{{ link }}'>{{ link }}</a></td>
-      </tr>
-    </table>
-  </body>
-</html>
+{% block body %}
+<table>
+  <tr>
+    <td>Status:</td>
+    {% if 200 <= status and status < 300 %}
+      <td style='color: green;'>{{ status }}</td>
+    {% elif 400 <= status and status < 600 %}
+      <td style='color: red;'>{{ status }}</td>
+    {% else %}
+      <td>{{ status }}</td>
+    {% endif %}
+  </tr>
+  <tr>
+    <td>Link:</td>
+    <td><a href='{{ link }}'>{{ link }}</a></td>
+  </tr>
+</table>
+{% endblock %}