move "add file" button to bottom button bar
authorChristian Weiske <cweiske@cweiske.de>
Tue, 25 Sep 2012 18:44:02 +0000 (20:44 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 25 Sep 2012 18:44:02 +0000 (20:44 +0200)
data/templates/edit-add-button.htm [new file with mode: 0644]
data/templates/edit-add.htm
data/templates/edit.htm
data/templates/new.htm

diff --git a/data/templates/edit-add-button.htm b/data/templates/edit-add-button.htm
new file mode 100644 (file)
index 0000000..45e8873
--- /dev/null
@@ -0,0 +1,4 @@
+ <a class="btn" href="#" style="display:none" id="add-button">
+  <i class="icon-plus"></i>
+  Add file
+ </a>
index 4713b5e..3a3741b 100644 (file)
@@ -1,18 +1,11 @@
- <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': null, 'fileid': 'new', 'newfile': true} %}
+{% include 'edit-file.htm' with {'file': null, 'fileid': 'new', 'newfile': true} %}
 
 <script type="application/javascript">
 $(document).ready(function() {
     $('#add-button').show();
     $('#filegroupnew').hide();
-    $('#add-button a').bind('click', function() {
-        $('#add-button').before("{% filter escape('js') %}
+    $('#add-button').bind('click', function() {
+        $('.filegroup:last').before("{% filter escape('js') %}
             {% include 'edit-file.htm' with {'file': null, 'fileid': '###', 'newfile': true} %}
             {% endfilter %}"
             .replace(/###/g, $('.filegroup').length)
index 3f73fb6..2237e10 100644 (file)
 
  {% include 'edit-add.htm' %}
 
- <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">
index 8029b8c..bc6c762 100644 (file)
 
  {% include 'edit-add.htm' %}
 
- <div class="well" style="text-align: right">
-  <button class="btn btn-primary" type="submit">
-   <i class="icon-check icon-white"></i>
-   Create
-  </button>
+ <div class="row-fluid formbuttons">
+  <div class="span4"></div>
+  <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>
+    Create
+   </button>
+  </div>
  </div>
 
 </form>