renamed template/static files where they belong
[unfold.git] / engine / templates / plugin.html
diff --git a/engine/templates/plugin.html b/engine/templates/plugin.html
new file mode 100644 (file)
index 0000000..2039801
--- /dev/null
@@ -0,0 +1,30 @@
+{% if visible %}
+<div class='plugin-manage'>
+{% if hidable %}
+  {% if hidden %}
+<p id='show-{{ uuid }}' class='plugin-show'><a href='#'><span>&raquo; Show {{ classname }}</span></a></p>
+<p id='hide-{{ uuid }}' class='plugin-hide' style='display:none;'><a href='#'><span>&laquo; Hide {{ classname }}</span></a></p>
+  {% else %}
+<p id='show-{{ uuid }}' class='plugin-show' style='display:none;'><a href='#'><span>&raquo; Show {{ classname }}</span></a></p>
+<p id='hide-{{ uuid }}' class='plugin-hide'><a href='#'><span>&laquo; Hide {{ classname }}</span></a></p>
+  {% endif %}
+{% endif %}
+{% endif %}
+
+<div class='plugin {{ classname }}' id='plugin-{{ uuid }}'>
+{{ plugin_content|safe }}
+</div><!--plugin {{ classname }}-->
+
+{% if visible %}
+</div>
+{% endif %}
+
+{# Plugin initialization (if the plugin has the right structure) - from plugin.php #}
+{# note: that's the spirit but using {% insert %}  is not reliable enough #}
+{# so for now this doesn't make it back to the browser #}
+{% insert prelude_js %}
+if (typeof jQuery('#{{ uuid }}').$title != 'undefined') {
+  jQuery('#{{ uuid }}').$title({ {{ settings_json }} plugin_uuid: '{{ uuid }}' });
+  //jQuery('#{{ uuid }}').$title('show');
+  }; 
+{% endinsert %}