add image renderer
[phorkie.git] / data / templates / edit-file.htm
index 8203920..53c2c01 100644 (file)
@@ -1,20 +1,31 @@
- <div class="well">
+ <div class="well filegroup" id="filegroup{{fileid}}">
   <div class="row-fluid">
    <div class="span6">
-    <label for="filename_1">Filename</label>
     <input type="hidden" name="files[{{fileid}}][original_name]" value="{{file.getFilename}}"/>
-    <input type="text" name="files[{{fileid}}][name]" id="filename_{{fileid}}" value="{{file.getFilename}}"/>
+    <input type="text" name="files[{{fileid}}][name]" id="filename_{{fileid}}" value="{{file.getFilename}}" placeholder="Filename (optional)" class="filename" onchange="filenameChange(this, {{fileid}})" onkeyup="filenameChange(this, {{fileid}})"/>
    </div>
-   <div class="span6" style="text-align: right">
-    <label for="type_{{fileid}}">Type</label>
-    <!-- fixme: preselect -->
+   <div class="span6 typeselect" style="text-align: right" id="typeselect_{{fileid}}">
+    <label for="type_{{fileid}}" class="inline">Type</label>
     <select name="files[{{fileid}}][type]" id="type_{{fileid}}">
-     <option value="css">CSS</option>
-     <option value="php">PHP</option>
-     <option value="xml">XML</option>
+     {{htmlhelper.getLanguageOptions(file)|raw}}
     </select>
    </div>
+   <div class="span6" style="display:none; text-align: right" id="typetext_{{fileid}}">
+    <p class="muted">Type determined from filename</p>
+   </div>
   </div>
   <textarea name="files[{{fileid}}][content]" id="content_{{fileid}}" cols="80" rows="15" class="content">{{file.getContent}}</textarea>
+  <div class="row-fluid">
+   <div class="span9">
+    <label for="upload_{{fileid}}" class="inline">Replace with upload:</label>
+    <input type="file" name="files[{{fileid}}][upload]" id="upload_{{fileid}}" class="btn"/>
+   </div>
+   {% if not newfile %}
+   <div class="span3" style="text-align: right">
+    <input type="checkbox" name="files[{{fileid}}][delete]" value="1" id="delete_{{fileid}}"/>
+    <label for="delete_{{fileid}}" class="inline">delete file</label>
+   </div>
+   {% endif %}
+  </div>
  </div>