+
+
+{% macro file_data_form(file, unused_tags, page_names, flag_names=[], playlist_view=false) %}
+<form action="/{{page_names.file}}/{{file.digest.b64}}" method="POST" />
+<input type="hidden" name="redir" value="/{% if playlist_view %}{{page_names.playlist}}{% else %}{{page_names.file}}/{{file.digest.b64}}{% endif %}" />
+<table>
+<tr><th>path:</th><td class="top_field">{% if playlist_view %}<a href="/{{page_names.file}}/{{file.digest.b64}}">{% endif %}{{file.rel_path}}{% if playlist_view %}</a>{% endif %}</td></tr>
+{% if not playlist_view %}
+<tr><th>present:</th><td>{% if file.present %}<a href="/{{page_names.download}}/{{file.yt_id}}">yes</a>{% else %}no{% endif %}</td></tr>
+{% endif %}
+<tr><th>YouTube ID:</th><td><a href="/{{page_names.yt_result}}/{{file.yt_id}}">{{file.yt_id}}</a></tr>
+<tr>
+<th>tags</th>
+<td>
+<table>
+{% for tag in file.tags %}
+<tr><td class="tag_checkboxes"><input type="checkbox" name="tags" value="{{tag}}" checked /></td><td>{{tag}}</td></tr>
+{% endfor %}
+<tr><td class="tag_checkboxes">add:</td><td><input name="tags" list="unused_tags" autocomplete="off" /></td></tr>
+<datalist id="unused_tags" />
+{% for tag in unused_tags %}
+<option value="{{tag}}">{{tag}}</option>
+{% endfor %}
+</datalist>
+</table>
+</td>
+</tr>
+{% if not playlist_view %}
+<tr>
+<th>flags:</th>
+<td class="flags">
+{% for flag_name in flag_names %}
+{{ flag_name }}: <input type="checkbox" name="flags" value="{{flag_name}}" {% if file.is_flag_set(flag_name) %}checked {% endif %} /><br />
+{% endfor %}
+</td>
+</tr>
+{% endif %}
+</table>
+<input type="submit" />
+</form>
+{% endmacro %}