do not show text field for binary files
[phorkie.git] / data / templates / edit-file.htm
1  <div class="well filegroup" id="filegroup{{fileid}}">
2   <div class="row-fluid">
3    <div class="span6">
4     <input type="hidden" name="files[{{fileid}}][original_name]" value="{{file.getFilename}}"/>
5     <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}})"/>
6    </div>
7    <div class="span6 typeselect" style="text-align: right" id="typeselect_{{fileid}}">
8     <label for="type_{{fileid}}" class="inline">Type</label>
9     <select name="files[{{fileid}}][type]" id="type_{{fileid}}">
10      {{htmlhelper.getLanguageOptions(file)|raw}}
11     </select>
12    </div>
13    <div class="span6" style="display:none; text-align: right" id="typetext_{{fileid}}">
14     <p class="muted">Type determined from filename</p>
15    </div>
16   </div>
17   {% if not file or file.isText %}
18   <textarea name="files[{{fileid}}][content]" id="content_{{fileid}}" cols="80" rows="15" class="content">{{file.getContent}}</textarea>
19   {% else %}
20   <p style="text-align: center">
21    Binary files cannot be edited.
22   </p>
23   {% endif %}
24   <div class="row-fluid">
25    <div class="span9">
26     <label for="upload_{{fileid}}" class="inline">Replace with upload:</label>
27     <input type="file" name="files[{{fileid}}][upload]" id="upload_{{fileid}}" class="btn"/>
28    </div>
29    {% if not newfile %}
30    <div class="span3" style="text-align: right">
31     <input type="checkbox" name="files[{{fileid}}][delete]" value="1" id="delete_{{fileid}}"/>
32     <label for="delete_{{fileid}}" class="inline">delete file</label>
33    </div>
34    {% endif %}
35   </div>
36  </div>
37