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 2013/08/20 19:22:43 UTC

[1/5] git commit: Added Gittip macro for Wiki tool

Updated Branches:
  refs/heads/cj/6422 afb7bb4d3 -> 6ce8edf50


Added Gittip macro for Wiki tool


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

Branch: refs/heads/cj/6422
Commit: e81ffc0d0a4ce5bdc7d5bef0c93122f8a6995514
Parents: afb7bb4
Author: Wayne Witzel III <wa...@pieceofpy.com>
Authored: Thu Aug 15 15:23:41 2013 -0400
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Aug 19 19:40:13 2013 +0000

----------------------------------------------------------------------
 .../templates/admin_widgets/metadata_admin.html  |  2 ++
 Allura/allura/lib/macro.py                       |  7 +++++++
 Allura/allura/lib/utils.py                       |  3 ++-
 Allura/allura/lib/widgets/macros.py              |  6 ++++++
 Allura/allura/templates/jinja_master/lib.html    |  6 ++++++
 .../allura/templates/widgets/gittip_button.html  | 19 +++++++++++++++++++
 Allura/allura/tests/test_globals.py              |  6 ++++++
 7 files changed, 48 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e81ffc0d/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index 454f33a..bfce390 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -67,9 +67,11 @@
     {{ widget.display_label(widget.fields.twitter_handle) }}
     <br>
     {{widget.display_field(widget.fields.twitter_handle) }}
+
     {{ widget.display_label(widget.fields.facebook_page) }}
     <br>
     {{widget.display_field(widget.fields.facebook_page) }}
+
     {% if c.project.neighborhood.features['google_analytics'] %}
     {{ widget.display_label(widget.fields.tracking_id) }}
     <br>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e81ffc0d/Allura/allura/lib/macro.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/macro.py b/Allura/allura/lib/macro.py
index aac20ff..97d5206 100644
--- a/Allura/allura/lib/macro.py
+++ b/Allura/allura/lib/macro.py
@@ -294,6 +294,13 @@ def project_screenshots():
     response = ps.display(project=c.project)
     return response
 
+@macro()
+def gittip_button(username):
+    from allura.lib.widgets.macros import GittipButton
+    button = GittipButton(username=username)
+    g.resource_manager.register(button)
+    response = button.display(username=username)
+    return response
 
 # FIXME: this is SourceForge specific - need to provide a way for macros to come from other packages
 @macro()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e81ffc0d/Allura/allura/lib/utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index d6796e5..4bd1e3c 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -502,6 +502,7 @@ class ForgeHTMLSanitizer(_HTMLSanitizer):
     def unknown_starttag(self, tag, attrs):
         if 'iframe' in self.acceptable_elements:
             self.acceptable_elements.remove('iframe')
-        if (tag == 'iframe') and (dict(attrs).get('src', '').startswith('http://www.youtube.com/embed/')):
+        if (tag == 'iframe') and (dict(attrs).get('src', '').startswith('http://www.youtube.com/embed/') or
+				  dict(attrs).get('src', '').startswith('https://www.gittip.com/')):
             self.acceptable_elements.append('iframe')
         _HTMLSanitizer.unknown_starttag(self, tag, attrs)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e81ffc0d/Allura/allura/lib/widgets/macros.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/macros.py b/Allura/allura/lib/widgets/macros.py
index 0921ab9..5f93d2a 100644
--- a/Allura/allura/lib/widgets/macros.py
+++ b/Allura/allura/lib/widgets/macros.py
@@ -25,6 +25,12 @@ class Include(ew.Widget):
         'style':'width:270px;float:right;background-color:#ccc'
         }
 
+class GittipButton(ew.Widget):
+    template='jinja:allura:templates/widgets/gittip_button.html'
+    params=['username']
+    project=None
+
+
 class DownloadButton(ew.Widget):
     template='jinja:allura:templates/widgets/download_button.html'
     params=['project']

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e81ffc0d/Allura/allura/templates/jinja_master/lib.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/lib.html b/Allura/allura/templates/jinja_master/lib.html
index a3e8d6b..9d8b3c1 100644
--- a/Allura/allura/templates/jinja_master/lib.html
+++ b/Allura/allura/templates/jinja_master/lib.html
@@ -706,6 +706,12 @@ allowed, permitting basic styling and layout: &lt;div markdown style="float:left
 [[download_button]]
 </pre></div>
 
+<h2 id="md_ex_gittip_button{{id}}">Gittip Button</h2>
+<p>You can display a Gittip button in your wiki. You will need to set your gittip handle in the Metadata section of the Admin tool for your project.</p>
+<div class="codehilite"><pre>
+[[gittip_button username=foo]]
+</pre></div>
+
 <h2 id="md_ex_member{{id}}">Project Member List</h2>
 <p>You can display a list of project members. By default the list is limited to 20 members, and a link is provided to a page with the full list.</p>
 <div class="codehilite"><pre>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e81ffc0d/Allura/allura/templates/widgets/gittip_button.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/gittip_button.html b/Allura/allura/templates/widgets/gittip_button.html
new file mode 100644
index 0000000..708793a
--- /dev/null
+++ b/Allura/allura/templates/widgets/gittip_button.html
@@ -0,0 +1,19 @@
+{#-
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+-#}
+<p><iframe style="border: 0; margin: 0; padding: 0;" src="https://www.gittip.com/{{username}}/widget.html" width="48pt" height="22pt"></iframe></p>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e81ffc0d/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index 60860a5..526af04 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -148,6 +148,12 @@ def test_macro_download_button():
         r = g.markdown_wiki.convert('[[download_button]]')
     assert_equal(r, '<div class="markdown_content"><p><span class="download-button-%s" style="margin-bottom: 1em; display: block;"></span></p>\n</div>' % p_test._id)
 
+def test_macro_gittip_button():
+    p_nbhd = M.Neighborhood.query.get(name='Projects')
+    p_test = M.Project.query.get(shortname='test', neighborhood_id=p_nbhd._id)
+    with h.push_config(c, project=p_test):
+        r = g.markdown_wiki.convert('[[gittip_button username=test]]')
+    assert_equal(r, u'<div class="markdown_content"><p><iframe height="22pt" src="https://www.gittip.com/test/widget.html" style="border: 0; margin: 0; padding: 0;" width="48pt"></iframe></p>\n</div>')
 
 def test_macro_neighborhood_feeds():
     p_nbhd = M.Neighborhood.query.get(name='Projects')


[5/5] git commit: [#6422] Added "incubating" to NOTICE files

Posted by jo...@apache.org.
[#6422] Added "incubating" to NOTICE files

Signed-off-by: Cory Johns <cj...@slashdotmedia.com>


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

Branch: refs/heads/cj/6422
Commit: 6ce8edf50e207013aa81fa2bb8bdf1b369751c8a
Parents: d924835
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Aug 20 17:22:13 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Aug 20 17:22:21 2013 +0000

----------------------------------------------------------------------
 Allura/NOTICE          | 2 +-
 ForgeDiscussion/NOTICE | 2 +-
 ForgeGit/NOTICE        | 2 +-
 ForgeLink/NOTICE       | 2 +-
 ForgeSVN/NOTICE        | 2 +-
 ForgeTracker/NOTICE    | 2 +-
 ForgeWiki/NOTICE       | 2 +-
 NOTICE                 | 2 +-
 NoWarnings/NOTICE      | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ce8edf5/Allura/NOTICE
----------------------------------------------------------------------
diff --git a/Allura/NOTICE b/Allura/NOTICE
index 7c72586..8157ed8 100644
--- a/Allura/NOTICE
+++ b/Allura/NOTICE
@@ -1,4 +1,4 @@
-      Apache Allura
+      Apache Allura (incubating)
       Copyright 2012-2013 The Apache Software Foundation
 
       This product includes software developed at

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ce8edf5/ForgeDiscussion/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/NOTICE b/ForgeDiscussion/NOTICE
index e8cbe57..e8ad3bb 100644
--- a/ForgeDiscussion/NOTICE
+++ b/ForgeDiscussion/NOTICE
@@ -1,4 +1,4 @@
-      Apache Allura
+      Apache Allura (incubating)
       Copyright 2012-2013 The Apache Software Foundation
 
       This product includes software developed at

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ce8edf5/ForgeGit/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeGit/NOTICE b/ForgeGit/NOTICE
index e8cbe57..e8ad3bb 100644
--- a/ForgeGit/NOTICE
+++ b/ForgeGit/NOTICE
@@ -1,4 +1,4 @@
-      Apache Allura
+      Apache Allura (incubating)
       Copyright 2012-2013 The Apache Software Foundation
 
       This product includes software developed at

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ce8edf5/ForgeLink/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeLink/NOTICE b/ForgeLink/NOTICE
index e8cbe57..e8ad3bb 100644
--- a/ForgeLink/NOTICE
+++ b/ForgeLink/NOTICE
@@ -1,4 +1,4 @@
-      Apache Allura
+      Apache Allura (incubating)
       Copyright 2012-2013 The Apache Software Foundation
 
       This product includes software developed at

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ce8edf5/ForgeSVN/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeSVN/NOTICE b/ForgeSVN/NOTICE
index e8cbe57..e8ad3bb 100644
--- a/ForgeSVN/NOTICE
+++ b/ForgeSVN/NOTICE
@@ -1,4 +1,4 @@
-      Apache Allura
+      Apache Allura (incubating)
       Copyright 2012-2013 The Apache Software Foundation
 
       This product includes software developed at

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ce8edf5/ForgeTracker/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeTracker/NOTICE b/ForgeTracker/NOTICE
index e8cbe57..e8ad3bb 100644
--- a/ForgeTracker/NOTICE
+++ b/ForgeTracker/NOTICE
@@ -1,4 +1,4 @@
-      Apache Allura
+      Apache Allura (incubating)
       Copyright 2012-2013 The Apache Software Foundation
 
       This product includes software developed at

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ce8edf5/ForgeWiki/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeWiki/NOTICE b/ForgeWiki/NOTICE
index e8cbe57..e8ad3bb 100644
--- a/ForgeWiki/NOTICE
+++ b/ForgeWiki/NOTICE
@@ -1,4 +1,4 @@
-      Apache Allura
+      Apache Allura (incubating)
       Copyright 2012-2013 The Apache Software Foundation
 
       This product includes software developed at

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ce8edf5/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 7c72586..8157ed8 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,4 +1,4 @@
-      Apache Allura
+      Apache Allura (incubating)
       Copyright 2012-2013 The Apache Software Foundation
 
       This product includes software developed at

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6ce8edf5/NoWarnings/NOTICE
----------------------------------------------------------------------
diff --git a/NoWarnings/NOTICE b/NoWarnings/NOTICE
index e8cbe57..e8ad3bb 100644
--- a/NoWarnings/NOTICE
+++ b/NoWarnings/NOTICE
@@ -1,4 +1,4 @@
-      Apache Allura
+      Apache Allura (incubating)
       Copyright 2012-2013 The Apache Software Foundation
 
       This product includes software developed at


[4/5] git commit: Fixed tab indents

Posted by jo...@apache.org.
Fixed tab indents


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

Branch: refs/heads/cj/6422
Commit: d9248352ac5e8dfe160a9d4d189b6be783c6e431
Parents: ba700e3
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Aug 19 20:31:01 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Aug 19 20:31:01 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d9248352/Allura/allura/lib/utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index 4bd1e3c..abd3fd4 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -503,6 +503,6 @@ class ForgeHTMLSanitizer(_HTMLSanitizer):
         if 'iframe' in self.acceptable_elements:
             self.acceptable_elements.remove('iframe')
         if (tag == 'iframe') and (dict(attrs).get('src', '').startswith('http://www.youtube.com/embed/') or
-				  dict(attrs).get('src', '').startswith('https://www.gittip.com/')):
+                                  dict(attrs).get('src', '').startswith('https://www.gittip.com/')):
             self.acceptable_elements.append('iframe')
         _HTMLSanitizer.unknown_starttag(self, tag, attrs)


[3/5] git commit: [#6532] ticket:412 ignore forks with non existing app_config_id

Posted by jo...@apache.org.
[#6532] ticket:412 ignore forks with non existing app_config_id


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

Branch: refs/heads/cj/6422
Commit: ba700e34e495ad7dfb673cc875e6f048645cc02e
Parents: ed2ca56
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Mon Aug 19 13:25:42 2013 +0300
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Aug 19 20:16:30 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ba700e34/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index e29cd0a..9db3747 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -533,7 +533,8 @@ class Repository(Artifact, ActivityObject):
 
     @property
     def forks(self):
-        return self.query.find({'upstream_repo.name': self.url()}).all()
+        all_forks = self.query.find({'upstream_repo.name': self.url()}).all()
+        return filter(lambda fork: fork.app_config is not None, all_forks)
 
     def tarball(self, revision, path=None):
         if path:


[2/5] git commit: Fixed syntax documentation of Gittip button for Wiki tool

Posted by jo...@apache.org.
Fixed syntax documentation of Gittip button for Wiki tool


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

Branch: refs/heads/cj/6422
Commit: ed2ca56a4364ea336ec8f1d4762033e30dd66cd1
Parents: e81ffc0
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Aug 19 19:59:34 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Aug 19 19:59:34 2013 +0000

----------------------------------------------------------------------
 Allura/allura/templates/jinja_master/lib.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ed2ca56a/Allura/allura/templates/jinja_master/lib.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/lib.html b/Allura/allura/templates/jinja_master/lib.html
index 9d8b3c1..4ca02e9 100644
--- a/Allura/allura/templates/jinja_master/lib.html
+++ b/Allura/allura/templates/jinja_master/lib.html
@@ -707,7 +707,7 @@ allowed, permitting basic styling and layout: &lt;div markdown style="float:left
 </pre></div>
 
 <h2 id="md_ex_gittip_button{{id}}">Gittip Button</h2>
-<p>You can display a Gittip button in your wiki. You will need to set your gittip handle in the Metadata section of the Admin tool for your project.</p>
+<p>You can display a Gittip button in your wiki. You will need to provide your gittip handle in the username parameter.</p>
 <div class="codehilite"><pre>
 [[gittip_button username=foo]]
 </pre></div>