X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=blobdiff_plain;f=templates%2Fadmin%2Foption_config.html;fp=templates%2Fadmin%2Foption_config.html;h=02babe6bbe9139ff886e7b791321623c93c2e7f9;hp=1f921f6d0c9816f1cc1e4ccbf1f26f2284da35c8;hb=a7c8333f98f4030e02d434fa78e8fc79c0340939;hpb=2ff2f766737abf1615bca802677cb2386b32213d diff --git a/templates/admin/option_config.html b/templates/admin/option_config.html index 1f921f6..02babe6 100644 --- a/templates/admin/option_config.html +++ b/templates/admin/option_config.html @@ -28,6 +28,22 @@ $(buttonRow).appendTo(ourTable) } ); + $(function() { + $("#uploadFile").on("change", function() + { + var files = !!this.files ? this.files : []; + if (!files.length || !window.FileReader) return; // no file selected, or no FileReader support + + if (/^image/.test( files[0].type)){ // only image file + var reader = new FileReader(); // instance of the FileReader + reader.readAsDataURL(files[0]); // read the local file + + reader.onloadend = function(){ // set image data as background of div + $("#imagePreview").css("background-image", "url("+this.result+")"); + } + } + }); + }); {% endblock %} {% block main %} @@ -48,7 +64,7 @@
-
+ {% for k, v in config.iteritems() %}
@@ -63,6 +79,22 @@ disabled {%- endif -%} > + {% elif v.__class__.__name__ == 'Image' -%} + + {%- if value %} + + {%- endif -%} +

+ + +

+
{% elif v.__class__.__name__ == 'List' -%}