move "add file" button to bottom button bar
[phorkie.git] / data / templates / edit.htm
index 6c1899ff9817be32c09bd2407389152301e81f5b..2237e10916079b3724cce56e6f8af2e87cc10ce2 100644 (file)
@@ -1,55 +1,42 @@
 {% extends "base.htm" %}
 {% block title %}Edit paste{% endblock %}
 
+{% block meta %}
+<meta name="robots" content="noindex"/>
+{% 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 %}
 
+ {% include 'edit-add.htm' %}
 
- <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'} %}
-
-
- <div class="well">
-  <div class="row-fluid">
-   <div class="span6">
+  <div class="row-fluid formbuttons">
+   <div class="span4">
     <a class="btn" href="{{repo.getLink('display')}}">Cancel</a>
    </div>
-   <div class="span6" style="text-align: right">
+   <div class="span4" style="text-align: center">
+    {% include 'edit-add-button.htm' %}
+   </div>
+   <div class="span4" style="text-align: right">
     <button class="btn btn-primary" type="submit">
      <i class="icon-check icon-white"></i>
      Save
     </button>
    </div>
   </div>
- </div>
 
 </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;
-    });
+    initEdit();
 });
 </script>
 {% endblock %}