You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2014/06/29 00:34:21 UTC
git commit: [#6495] Screenshot admin UI improvements
Repository: allura
Updated Branches:
refs/heads/tv/6495 [created] 5849a6278
[#6495] Screenshot admin UI improvements
Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5849a627
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5849a627
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5849a627
Branch: refs/heads/tv/6495
Commit: 5849a6278b106cb84eb9b3f8d9dffe0e5a014e4c
Parents: 4ee0a8c
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Sat Jun 28 18:33:44 2014 -0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Sat Jun 28 18:33:44 2014 -0400
----------------------------------------------------------------------
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/5849a627/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/5849a627/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/5849a627/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/5849a627/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"> </div>
+{% if screenshots.__len__() %}<hr>{% endif %}