You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2014/02/13 16:05:45 UTC

[11/17] git commit: [#7075] ticket:530 Added "dragable" mode to screenshots macro

[#7075] ticket:530 Added "dragable" mode to screenshots macro


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

Branch: refs/heads/cj/7097
Commit: 984c22e0c70630ad2dd1922c82e66485ce1f0047
Parents: 9702f5c
Author: Ferens Dmitriy <fe...@gmail.com>
Authored: Wed Feb 5 18:17:29 2014 +0200
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Wed Feb 12 18:29:13 2014 +0000

----------------------------------------------------------------------
 Allura/allura/ext/admin/admin_main.py                    | 2 +-
 Allura/allura/lib/widgets/project_list.py                | 3 ++-
 Allura/allura/templates/widgets/project_screenshots.html | 8 +++++---
 3 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/984c22e0/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index 34641b9..4b75a13 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -65,7 +65,7 @@ class W:
     group_settings = aw.GroupSettings()
     new_group_settings = aw.NewGroupSettings()
     screenshot_admin = aw.ScreenshotAdmin()
-    screenshot_list = ProjectScreenshots()
+    screenshot_list = ProjectScreenshots(dragable=True)
     metadata_admin = aw.MetadataAdmin()
     audit = aw.AuditLog()
     page_list = ffw.PageList()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/984c22e0/Allura/allura/lib/widgets/project_list.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/project_list.py b/Allura/allura/lib/widgets/project_list.py
index af209cb..ba560e6 100644
--- a/Allura/allura/lib/widgets/project_list.py
+++ b/Allura/allura/lib/widgets/project_list.py
@@ -165,7 +165,8 @@ class ProjectScreenshots(ew_core.Widget):
     defaults = dict(
         ew_core.Widget.defaults,
         project=None,
-        edit=False)
+        edit=False,
+        dragable=False)
 
     def resources(self):
         yield ew.JSLink('js/screenshots.js')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/984c22e0/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 f1c5bca..53731a2 100644
--- a/Allura/allura/templates/widgets/project_screenshots.html
+++ b/Allura/allura/templates/widgets/project_screenshots.html
@@ -18,10 +18,12 @@
 -#}
 {% import 'allura:templates/jinja_master/lib.html' as lib with context %}
 {% set screenshots = project.get_screenshots() %}
-{% if screenshots.__len__() > 1 %}
-<p>Drag screenshots to sort.</p>
+{% if dragable %}
+  {% if screenshots.__len__() > 1 %}
+  <p>Drag screenshots to sort.</p>
+  {% endif %}
 {% endif %}
-<div class="sortable">
+<div class="{% if dragable %}sortable{% endif %}">
   {% for ss in screenshots %}
   <div data-ss-id="{{ ss._id }}" class="screenshot">
     <div class="image">