diff --git a/platypush/backend/http/__init__.py b/platypush/backend/http/__init__.py index dc7df536..cc0eb4a8 100644 --- a/platypush/backend/http/__init__.py +++ b/platypush/backend/http/__init__.py @@ -103,17 +103,22 @@ class HttpBackend(Backend): dashboard: background_image: https://site/image.png widgets: # Each row of the dashboard will have 6 columns - calendar: # Calendar widget + - + widget: calendar # Calendar widget columns: 6 - music: # Music widget + - + widget: music # Music widget columns: 3 - date-time-weather: # Date, time and weather widget + - + widget: date-time-weather # Date, time and weather widget columns: 3 - image-carousel: # Image carousel + - + widget: image-carousel # Image carousel columns: 6 images_path: ~/Dropbox/Photos/carousel # Absolute path (valid as long as it's a subdirectory of one of the available `resource_dirs`) refresh_seconds: 15 - rss-news: # RSS feeds widget + - + widget: rss-news # RSS feeds widget # Requires backend.http.poll to be enabled with some RSS sources and write them to sqlite db columns: 6 limit: 25 diff --git a/platypush/backend/http/templates/dashboard.html b/platypush/backend/http/templates/dashboard.html index 09d7a781..48a8b211 100644 --- a/platypush/backend/http/templates/dashboard.html +++ b/platypush/backend/http/templates/dashboard.html @@ -28,7 +28,7 @@ {% endif %} window.config = {{ config | safe }}; - window.widgets = {{ config['widgets'] | safe }}; + window.widgets = {{ config['widgets'] | safe }}.reduce(function(map, w) { map[w.widget] = w; return map }, {}) @@ -44,16 +44,16 @@
{% set used_columns = [0] %} - {% for widget_name, widget in config['widgets'].items() %} + {% for widget in config['widgets'] %} {% if used_columns[0] % 12 == 0 %}
{% endif %}
+ {% print(widget['widget']) %}" + id="{% print(widget['id'] if 'id' in widget else widget['widget']) %}"> {% with properties=widget %} - {% include 'widgets/' + widget_name + '.html' %} + {% include 'widgets/' + widget['widget'] + '.html' %} {% endwith %}