allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#6495] Screenshot admin UI improvements
Date Fri, 11 Jul 2014 15:50:19 GMT
Repository: allura
Updated Branches:
  refs/heads/master e3ad3c3f6 -> dad51b0b6


[#6495] Screenshot admin UI improvements

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/dad51b0b
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/dad51b0b
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/dad51b0b

Branch: refs/heads/master
Commit: dad51b0b6a96f8dfcb644526b4689804bcff747f
Parents: e3ad3c3
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Sat Jun 28 18:33:44 2014 -0400
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Jul 11 15:50:10 2014 +0000

----------------------------------------------------------------------
 Allura/allura/ext/admin/widgets.py              |  8 ++++---
 .../lib/widgets/resources/css/screenshots.css   | 22 ++++++++++----------
 .../lib/widgets/resources/js/screenshots.js     | 10 ++++++++-
 .../templates/widgets/project_screenshots.html  |  2 +-
 4 files changed, 26 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/dad51b0b/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 7a78ee4..5fb5bbd 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -138,10 +138,12 @@ class NewGroupSettings(ff.AdminForm):
         name = ew.InputField(label='Name')
 
 
-class ScreenshotAdmin(ff.AdminForm):
+class ScreenshotAdmin(ff.ForgeForm):
     defaults = dict(
-        ff.AdminForm.defaults,
-        enctype='multipart/form-data')
+        ff.ForgeForm.defaults,
+        enctype='multipart/form-data',
+        submit_text='Upload',
+        )
 
     @property
     def fields(self):

http://git-wip-us.apache.org/repos/asf/allura/blob/dad51b0b/Allura/allura/lib/widgets/resources/css/screenshots.css
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/css/screenshots.css b/Allura/allura/lib/widgets/resources/css/screenshots.css
index 7c28adf..5acbff5 100644
--- a/Allura/allura/lib/widgets/resources/css/screenshots.css
+++ b/Allura/allura/lib/widgets/resources/css/screenshots.css
@@ -17,23 +17,23 @@
        under the License.
  */
 .sortable {
-    float: left;
+    margin: 0 1em;
 }
 .sortable .screenshot {
-    margin: 0 0 10px 10px;
+    margin: 0 0 1em 0;
     border: 1px solid #eee;
     background: #fff;
-    float: left;
+    padding: 1em;
 }
-.sortable .screenshot .image {
-    margin-left: 0;
-    float: left;
+.sortable .screenshot:hover {
+    border: 1px solid #ccc;
+    cursor: move;
 }
-.sortable .screenshot .image img {
-    display: block;
+.sortable .screenshot .image {
+    display: inline-block;
+    vertical-align: middle;
 }
 .sortable .screenshot .controls {
-    margin: 50px 15px 0 20px;
-    width: 190px;
-    float: left;
+    display: inline-block;
+    margin-left: 1em;
 }

http://git-wip-us.apache.org/repos/asf/allura/blob/dad51b0b/Allura/allura/lib/widgets/resources/js/screenshots.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/screenshots.js b/Allura/allura/lib/widgets/resources/js/screenshots.js
index 214393b..d2a3d33 100644
--- a/Allura/allura/lib/widgets/resources/js/screenshots.js
+++ b/Allura/allura/lib/widgets/resources/js/screenshots.js
@@ -22,7 +22,15 @@ $(function() {
     $(this).find('.screenshot').each(function(i) {
       params[$(this).data('ss-id')] = i;
     });
-    $.post('sort_screenshots', params);
+
+    $.post('sort_screenshots', params)
+      .done(function() {
+        flash('New sort order saved.', 'success');
+      })
+      .fail(function() {
+        flash('Sorting failed. Please refresh the page and try again.', 'error');
+      });
+
   });
 });
 

http://git-wip-us.apache.org/repos/asf/allura/blob/dad51b0b/Allura/allura/templates/widgets/project_screenshots.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/project_screenshots.html b/Allura/allura/templates/widgets/project_screenshots.html
index 94107c5..4bc1fc7 100644
--- a/Allura/allura/templates/widgets/project_screenshots.html
+++ b/Allura/allura/templates/widgets/project_screenshots.html
@@ -49,4 +49,4 @@
   </div>
   {% endfor %}
 </div>
-<div style="clear:both">&nbsp;</div>
+{% if screenshots.__len__() %}<hr>{% endif %}


Mime
View raw message