{% block title %}Edit paste{% endblock %}
{% block content %}
-<form method="post" action="{{repo.getLink('edit')}}">
+<form method="post" action="{{repo.getLink('edit')}}" enctype="multipart/form-data">
<div class="control-group well pastedata">
<label for="description">Description</label>
<input type="text" name="description" id="description" value="{{repo.getDescription}}"/>
</div>
{% for fileid, file in repo.getFiles %}
- {% include 'edit-file.htm' with {'file': file, 'fileid': fileid} %}
+ {% include 'edit-file.htm' with {'file': file, 'fileid': fileid, 'newfile': false} %}
{% endfor %}
-
- <div class="well" style="text-align: center; display:none" id="add-button">
- <a class="btn" href="#">
- <i class="icon-plus"></i>
- Add file
- </a>
- </div>
-
- {% include 'edit-file.htm' with {'file': '', 'fileid': 'new'} %}
-
+ {% include 'edit-add.htm' %}
<div class="well">
<div class="row-fluid">
</form>
<script type="application/javascript">
$(document).ready(function() {
- $('#add-button').show();
- $('#filegroupnew').hide();
- $('#add-button a').bind('click', function() {
- $('#add-button').before("{% filter escape('js') %}
- {% include 'edit-file.htm' with {'file': '', 'fileid': '###'} %}
- {% endfilter %}"
- .replace(/###/g, $('.filegroup').length)
- );
- return false;
- });
+ initFilenames();
});
</script>
{% endblock %}