Add templates for wunderground.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 7 Sep 2016 18:15:05 +0000 (14:15 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 7 Sep 2016 18:15:05 +0000 (14:15 -0400)
Templates to get rid of the search form and still show the location.

wunderground/current.html [new file with mode: 0644]
wunderground/search-form.html [new file with mode: 0644]

diff --git a/wunderground/current.html b/wunderground/current.html
new file mode 100644 (file)
index 0000000..5500d6b
--- /dev/null
@@ -0,0 +1,43 @@
+{#
+       This template is processed using the Twig template engine
+       Learn more at: http://twig.sensiolabs.org/doc/templates.html
+
+       You can override this output by copying this file into your
+       theme's directory, in a subfolder named "wunderground". The
+       path to the file would look like this:
+       /wp-content/themes/my-theme/wunderground/simple.html
+#}
+
+{# Escape the HTML in the passed data automatically #}
+{% autoescape 'html' %}
+
+<div class="wu-wrapper wu-current-conditions {{ class }}">
+
+       {% include 'alert.html' %}
+
+       {% include 'search-form.html' %}
+
+       <div class="wu-forecast-wrapper">
+
+               {% set day = wunderground.current_observation %}
+
+               <div class="wu-forecast-body">
+
+                       <div class="wu-day-title">
+                               <span class="wu-day-current-temp">{{ day.temperature|round }}<sup>&deg;</sup></span>
+                               <small>{% if wunderground.response.units == 'english' %}F{% else %}C{% endif %}</small>
+                       </div>
+
+                       {% include 'snippets/icon.html' with { 'tag' : 'div', 'iconsize' : '100' } %}
+
+                       {% include 'snippets/condition.html' with { 'tag' : 'div' } %}
+
+               </div>
+
+       </div>
+
+       {% include 'copyright.html' %}
+
+</div>
+
+{% endautoescape %}
diff --git a/wunderground/search-form.html b/wunderground/search-form.html
new file mode 100644 (file)
index 0000000..6f25617
--- /dev/null
@@ -0,0 +1,14 @@
+{#
+       This template is processed using the Twig template engine
+       Learn more at: http://twig.sensiolabs.org/doc/templates.html
+#}
+
+{# the .ui-front class tells jQuery UI to append search results here. #}
+
+{% if showdata.search is not empty %}
+<form class="wu-search ui-front">
+       <label>
+        {{ location_title }} Test
+    </label>
+</form>
+{% endif %}