use Date_HumanDiff from PEAR to display changelog times
[phorkie.git] / data / templates / edit.htm
index 6c1899ff9817be32c09bd2407389152301e81f5b..f1f4a51f05011373526654baa0af8c12450e1e8d 100644 (file)
@@ -2,26 +2,17 @@
 {% 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 %}