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/05/28 18:00:53 UTC
[01/50] git commit: [#6046] ticket:350 Fix 'Download Snapshot' link
in repo subdirs
Updated Branches:
refs/heads/cj/5913 daf172b05 -> 961786ff0 (forced update)
[#6046] ticket:350 Fix 'Download Snapshot' link in repo subdirs
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/6e53ab07
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6e53ab07
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6e53ab07
Branch: refs/heads/cj/5913
Commit: 6e53ab07329fdd74cb6d1b2405bda677202c77b9
Parents: a5961a6
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri May 10 09:31:20 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu May 23 01:18:17 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 8 +++++++-
Allura/allura/templates/repo/tree.html | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6e53ab07/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 8ccd36d..6967685 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -516,6 +516,12 @@ class TreeBrowser(BaseController, DispatchIndex):
c.tree_widget = self.tree_widget
c.subscribe_form = self.subscribe_form
tool_subscribed = M.Mailbox.subscribed()
+ tarball_url = None
+ if asbool(tg.config.get('scm.repos.tarball.enable', False)):
+ cutout = len('tree' + self._path)
+ if request.path.endswith('/') and not self._path.endswith('/'):
+ cutout += 1
+ tarball_url = '%starball' % request.path[:-cutout]
return dict(
repo=c.app.repo,
commit=self._commit,
@@ -523,7 +529,7 @@ class TreeBrowser(BaseController, DispatchIndex):
path=self._path,
parent=self._parent,
tool_subscribed=tool_subscribed,
- tarball_enable = asbool(tg.config.get('scm.repos.tarball.enable', False)))
+ tarball_url=tarball_url)
@expose()
def _lookup(self, next, *rest):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6e53ab07/Allura/allura/templates/repo/tree.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/tree.html b/Allura/allura/templates/repo/tree.html
index 51b22f8..740ed04 100644
--- a/Allura/allura/templates/repo/tree.html
+++ b/Allura/allura/templates/repo/tree.html
@@ -30,8 +30,8 @@ Tree <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(co
{% endblock %}
{% block actions %}
-{% if tarball_enable %}
- <a href="{{request.path[:-5]}}tarball" rel="nofollow">
+{% if tarball_url %}
+ <a href="{{tarball_url}}" rel="nofollow">
<b data-icon="{{g.icons.folder.char}}" class="ico {{g.icons.folder.css}}" title="Snapshot"> </b> Download Snapshot
</a>
{% endif %}
[05/50] git commit: [#6105] ticket:348 Remove unnecessary escaping
Posted by jo...@apache.org.
[#6105] ticket:348 Remove unnecessary escaping
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/b5bca03b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b5bca03b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b5bca03b
Branch: refs/heads/cj/5913
Commit: b5bca03bc5aa4da9173a49ce854150034af09359
Parents: 76a1f1e
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue May 7 12:16:55 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 13:34:16 2013 +0000
----------------------------------------------------------------------
Allura/allura/lib/macro.py | 5 ++---
Allura/allura/tests/test_globals.py | 14 ++++++++++++--
2 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b5bca03b/Allura/allura/lib/macro.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/macro.py b/Allura/allura/lib/macro.py
index 88db722..1e6c353 100644
--- a/Allura/allura/lib/macro.py
+++ b/Allura/allura/lib/macro.py
@@ -23,7 +23,6 @@ import traceback
from operator import attrgetter
import pymongo
-import jinja2
from pylons import tmpl_context as c, app_globals as g
from pylons import request
from paste.deploy.converters import asint
@@ -346,7 +345,7 @@ def project_admins():
from allura.lib.widgets.macros import ProjectAdmins
output = ((dict(
url=user.url(),
- name=jinja2.escape(user.display_name)))
+ name=user.display_name))
for user in admins)
users = ProjectAdmins(users=output)
g.resource_manager.register(users)
@@ -361,7 +360,7 @@ def members(limit=20):
members = sorted(c.project.users(), key=attrgetter('display_name'))
output = [dict(
url=user.url(),
- name=jinja2.escape(user.display_name),
+ name=user.display_name,
admin=' (admin)' if user in admins else '',
)
for user in members[:limit]]
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b5bca03b/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index c1c221a..b4df060 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -183,11 +183,21 @@ def test_macro_members():
'</div>')
@with_setup(teardown=setUp) # reset everything we changed
+def test_macro_members_escaping():
+ user = M.User.by_username('test-admin')
+ user.display_name = u'Test Admin <script>'
+ r = g.markdown_wiki.convert('[[members]]')
+ assert_equal(r, u'<div class="markdown_content"><h6>Project Members:</h6>\n'
+ u'<ul class="md-users-list">\n'
+ u'<li><a href="/u/test-admin/">Test Admin <script></a> (admin)</li>\n'
+ u'</ul>\n</div>')
+
+@with_setup(teardown=setUp) # reset everything we changed
def test_macro_project_admins():
user = M.User.by_username('test-admin')
- user.display_name = u'Test Ådmin'
+ user.display_name = u'Test Ådmin <script>'
r = g.markdown_wiki.convert('[[project_admins]]')
- assert_equal(r, u'<div class="markdown_content"><h6>Project Admins:</h6>\n<ul class="md-users-list">\n<li><a href="/u/test-admin/">Test \xc5dmin</a></li>\n</ul>\n</div>')
+ assert_equal(r, u'<div class="markdown_content"><h6>Project Admins:</h6>\n<ul class="md-users-list">\n<li><a href="/u/test-admin/">Test \xc5dmin <script></a></li>\n</ul>\n</div>')
@with_setup(teardown=setUp) # reset everything we changed
def test_macro_project_admins_one_br():
[23/50] git commit: [#4740] ticket:331 Test ticket form preserves
custom fields values
Posted by jo...@apache.org.
[#4740] ticket:331 Test ticket form preserves custom fields values
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/6686bcfd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6686bcfd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6686bcfd
Branch: refs/heads/cj/5913
Commit: 6686bcfd00a4d3a69e65173467ef048206be95ca
Parents: 257f839
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 23 11:55:49 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri May 24 13:09:19 2013 +0000
----------------------------------------------------------------------
.../forgetracker/tests/functional/test_root.py | 33 +++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6686bcfd/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index a77e9c6..84b63e5 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -830,6 +830,39 @@ class TestFunctionalController(TrackerTestController):
response = self.app.get('/p/test/bugs/search/')
assert 'Edit All' not in response
+ def test_custom_fields_preserve_user_input_on_form_errors(self):
+ params = dict(
+ custom_fields=[
+ dict(name='_priority', label='Priority', type='select',
+ options='normal urgent critical'),
+ dict(name='_category', label='Category', type='string',
+ options='')],
+ open_status_names='aa bb',
+ closed_status_names='cc',
+ )
+ self.app.post(
+ '/admin/bugs/set_custom_fields', params=variable_encode(params))
+ # Test new ticket form
+ r = self.app.get('/bugs/new/')
+ form = r.forms[1]
+ form['ticket_form.custom_fields._priority'] = 'urgent'
+ form['ticket_form.custom_fields._category'] = 'bugs'
+ error_form = form.submit()
+ assert_equal(error_form.forms[1]['ticket_form.custom_fields._priority'].value, 'urgent')
+ assert_equal(error_form.forms[1]['ticket_form.custom_fields._category'].value, 'bugs')
+ # Test edit ticket form
+ self.new_ticket(summary='Test ticket')
+ response = self.app.get('/bugs/1/')
+ form = response.forms[1]
+ assert_equal(form['ticket_form.custom_fields._priority'].value, 'normal')
+ assert_equal(form['ticket_form.custom_fields._category'].value, '')
+ form['ticket_form.summary'] = ''
+ form['ticket_form.custom_fields._priority'] = 'urgent'
+ form['ticket_form.custom_fields._category'] = 'bugs'
+ error_form = form.submit()
+ assert_equal(error_form.forms[1]['ticket_form.custom_fields._priority'].value, 'urgent')
+ assert_equal(error_form.forms[1]['ticket_form.custom_fields._category'].value, 'bugs')
+
def test_new_ticket_validation(self):
summary = 'ticket summary'
response = self.app.get('/bugs/new/')
[42/50] git commit: [#5913] Project header should show admins,
not members
Posted by jo...@apache.org.
[#5913] Project header should show admins, not members
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/de2f4284
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/de2f4284
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/de2f4284
Branch: refs/heads/cj/5913
Commit: de2f4284b99307edc66ee4fa364b13d5ebde299a
Parents: 8af59b0
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue May 21 19:36:57 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue May 28 15:54:57 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/jinja_master/nav_menu.html | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/de2f4284/Allura/allura/templates/jinja_master/nav_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/nav_menu.html b/Allura/allura/templates/jinja_master/nav_menu.html
index 1b6a8f9..67c44ab 100644
--- a/Allura/allura/templates/jinja_master/nav_menu.html
+++ b/Allura/allura/templates/jinja_master/nav_menu.html
@@ -52,12 +52,12 @@
</a>
<div class="brought-by{% if c.project.icon %} with-icon{% endif %}">
Brought to you by:
- {% set users = c.project.users()|sort(attribute='display_name') %}
- {% for user in users[:4] %}
- <a href="{{ user.url() }}">{{ user.username }}</a>{{ ',' if not loop.last }}
+ {% set admins = c.project.admins()|sort(attribute='username') %}
+ {% for admin in admins[:4] %}
+ <a href="{{ admin.url() }}">{{ admin.username }}</a>{{ ',' if not loop.last }}
{%- endfor -%}
- {% if users|length > 4 -%}
- , and <a href="{{ c.project.url() }}_members/">{{ users|length - 4 }} others</a>
+ {% if admins|length > 4 -%}
+ , and <a href="{{ c.project.url() }}_members/">{{ admins|length - 4 }} others</a>
{% endif %}
</div>
{% endif %}
[06/50] git commit: [#6105] ticket:321 convert a description to
markdown for neighborhood_feeds
Posted by jo...@apache.org.
[#6105] ticket:321 convert a description to markdown for neighborhood_feeds
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/76a1f1ef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/76a1f1ef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/76a1f1ef
Branch: refs/heads/cj/5913
Commit: 76a1f1ef3f2455869937c759e7faaa907fea3c7e
Parents: 9293730
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Mon Apr 29 17:11:05 2013 +0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 13:34:16 2013 +0000
----------------------------------------------------------------------
Allura/allura/lib/macro.py | 2 +-
Allura/allura/tests/test_globals.py | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/76a1f1ef/Allura/allura/lib/macro.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/macro.py b/Allura/allura/lib/macro.py
index 496238e..88db722 100644
--- a/Allura/allura/lib/macro.py
+++ b/Allura/allura/lib/macro.py
@@ -94,7 +94,7 @@ def neighborhood_feeds(tool_name, max_number=5, sort='pubdate'):
title=item.title,
author=item.author_name,
ago=h.ago(item.pubdate),
- description=item.description))
+ description=g.markdown.convert(item.description)))
for item in feed)
feeds = NeighborhoodFeeds(feeds=output)
g.resource_manager.register(feeds)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/76a1f1ef/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index 69b840f..c1c221a 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -364,6 +364,7 @@ def test_macro_nbhd_feeds():
with h.push_context('--init--', 'wiki', neighborhood='Projects'):
r = g.markdown_wiki.convert('[[neighborhood_feeds tool_name=wiki]]')
assert 'Home modified by ' in r, r
+ assert '<div class="markdown_content">' not in r
def test_sort_alpha():
[07/50] git commit: [#6105] ticket:321 Remove unused imports
Posted by jo...@apache.org.
[#6105] ticket:321 Remove unused imports
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/92937302
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/92937302
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/92937302
Branch: refs/heads/cj/5913
Commit: 92937302d05061b9e3dfe5cd38a3240cc3d6a9a2
Parents: 9caef26
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Apr 29 09:50:46 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 13:34:16 2013 +0000
----------------------------------------------------------------------
Allura/allura/lib/macro.py | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/92937302/Allura/allura/lib/macro.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/macro.py b/Allura/allura/lib/macro.py
index be1f8fb..496238e 100644
--- a/Allura/allura/lib/macro.py
+++ b/Allura/allura/lib/macro.py
@@ -18,7 +18,6 @@
import cgi
import random
import shlex
-import string
import logging
import traceback
from operator import attrgetter
@@ -28,7 +27,6 @@ import jinja2
from pylons import tmpl_context as c, app_globals as g
from pylons import request
from paste.deploy.converters import asint
-from urlparse import urljoin
from . import helpers as h
from . import security
[27/50] git commit: [#5656] ticket:301 Skeleton for bulk move UI
Posted by jo...@apache.org.
[#5656] ticket:301 Skeleton for bulk move UI
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/c0797acc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c0797acc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c0797acc
Branch: refs/heads/cj/5913
Commit: c0797acc6d69a2a6cf55530f7e150721f94f4525
Parents: e375efb
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Apr 30 13:28:14 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:35:50 2013 +0000
----------------------------------------------------------------------
.../forgetracker/templates/tracker/index.html | 3 +
.../forgetracker/templates/tracker/mass_move.html | 38 +++++++++++++++
.../forgetracker/templates/tracker/milestone.html | 3 +
.../forgetracker/templates/tracker/search.html | 5 ++-
ForgeTracker/forgetracker/tracker_main.py | 23 ++++++++-
ForgeTracker/forgetracker/widgets/ticket_search.py | 9 ++++
6 files changed, 79 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c0797acc/ForgeTracker/forgetracker/templates/tracker/index.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/index.html b/ForgeTracker/forgetracker/templates/tracker/index.html
index 1d1145c..7b3ad36 100644
--- a/ForgeTracker/forgetracker/templates/tracker/index.html
+++ b/ForgeTracker/forgetracker/templates/tracker/index.html
@@ -36,6 +36,9 @@
{% if allow_edit %}
<a href="{{tg.url(c.app.url+'edit/', dict(q=url_q, limit=limit, sort=url_sort, page=page))}}" title="Bulk Edit"><b data-icon="{{g.icons['pencil'].char}}" class="ico {{g.icons['pencil'].css}}"></b></a>
{% endif %}
+ {% if allow_move %}
+ <a href="{{tg.url(c.app.url + 'move/', dict(q=url_q, limit=limit, sort=url_sort, page=page))}}" title="Bulk Move"><b data-icon="" class=""></b>Bulk Move</a>
+ {% endif %}
{% endblock %}
{% block content %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c0797acc/ForgeTracker/forgetracker/templates/tracker/mass_move.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/mass_move.html b/ForgeTracker/forgetracker/templates/tracker/mass_move.html
new file mode 100644
index 0000000..1953801
--- /dev/null
+++ b/ForgeTracker/forgetracker/templates/tracker/mass_move.html
@@ -0,0 +1,38 @@
+{#-
+ 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.
+-#}
+{% extends 'forgetracker:templates/tracker/mass_edit.html' %}
+
+{% block actions %}
+<a href="{{tg.url(c.app.url+'move/', dict(q=q, limit=limit, sort=sort, page=page))}}" title="Bulk Move" class="active"><b data-icon="" class=""></b>Bulk Move</a>
+{% endblock %}
+
+{% block edit_box %}
+<div class="editbox">
+ {{c.mass_move_form.display()}}
+</div>
+{% endblock %}
+
+{% block content %}
+ {{c.mass_move.display(count=count,
+ limit=limit,
+ query=q,
+ tickets=tickets,
+ sort=sort,
+ page=page)}}
+{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c0797acc/ForgeTracker/forgetracker/templates/tracker/milestone.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/milestone.html b/ForgeTracker/forgetracker/templates/tracker/milestone.html
index 4c1e61c..7c1cd00 100644
--- a/ForgeTracker/forgetracker/templates/tracker/milestone.html
+++ b/ForgeTracker/forgetracker/templates/tracker/milestone.html
@@ -28,6 +28,9 @@
{% if allow_edit %}
<a href="{{tg.url(c.app.url+'edit/', dict(q=q, limit=limit, sort=url_sort, page=page))}}" title="Bulk Edit"><b data-icon="{{g.icons['pencil'].char}}" class="ico {{g.icons['pencil'].css}}"></b></a>
{% endif %}
+{% if allow_move %}
+ <a href="{{tg.url(c.app.url + 'move/', dict(q=q, limit=limit, sort=url_sort, page=page))}}" title="Bulk Move"><b data-icon="" class=""></b>Bulk Move</a>
+{% endif %}
{% endblock %}
{% block edit_box %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c0797acc/ForgeTracker/forgetracker/templates/tracker/search.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/search.html b/ForgeTracker/forgetracker/templates/tracker/search.html
index 48516f8..dda451d 100644
--- a/ForgeTracker/forgetracker/templates/tracker/search.html
+++ b/ForgeTracker/forgetracker/templates/tracker/search.html
@@ -33,6 +33,9 @@
{% if allow_edit and count != 0 %}
<a href="{{tg.url(c.app.url+'edit/', dict(q=q, limit=limit, sort=sort, page=page))}}" title="Bulk Edit"><b data-icon="{{g.icons['pencil'].char}}" class="ico {{g.icons['pencil'].css}}"></b></a>
{% endif %}
+{% if allow_move and count != 0 %}
+ <a href="{{tg.url(c.app.url + 'move/', dict(q=q, limit=limit, sort=sort, page=page))}}" title="Bulk Move"><b data-icon="" class=""></b>Bulk Move</a>
+{% endif %}
{% endblock %}
{% if q and h.has_access(c.app, 'save_searches')() %}
@@ -67,7 +70,7 @@
<input type="text" name="q" value="{{q}}" style="width: 280px; float: left; margin-right: .5em" id="bin_terms">
{% if bin and h.has_access(c.app, 'save_searches')() %}
<input type="button" value="Update Search" id="save_search"/>
- {% endif %}
+ {% endif %}
<input type="submit" value="Search"/>
</form>
<a href="#" class="btn search_help_modal"><b data-icon="{{g.icons['help'].char}}" class="ico {{g.icons['help'].css}}"></b> Help</a>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c0797acc/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 17f3b6b..b1bd941 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -71,7 +71,7 @@ from forgetracker import version
from forgetracker.widgets.admin import OptionsAdmin
from forgetracker.widgets.ticket_form import TicketForm, TicketCustomField
from forgetracker.widgets.bin_form import BinForm
-from forgetracker.widgets.ticket_search import TicketSearchResults, MassEdit, MassEditForm, SearchHelp
+from forgetracker.widgets.ticket_search import TicketSearchResults, MassEdit, MassEditForm, MassMoveForm, SearchHelp
from forgetracker.widgets.admin_custom_fields import TrackerFieldAdmin, TrackerFieldDisplay
from forgetracker.import_support import ImportSupport
from forgetracker.plugins import ImportIdConverter
@@ -163,6 +163,7 @@ class W:
search_help_modal = SearchHelp()
vote_form = w.VoteForm()
move_ticket_form = w.forms.MoveTicketForm
+ mass_move_form = MassMoveForm
class ForgeTrackerApp(Application):
__version__ = version.__version__
@@ -547,6 +548,7 @@ class RootController(BaseController, FeedController):
result['sortable_custom_fields'] = c.app.globals.sortable_custom_fields_shown_in_search()
result['subscribed'] = M.Mailbox.subscribed()
result['allow_edit'] = has_access(c.app, 'update')()
+ result['allow_move'] = has_access(c.app, 'admin')()
result['help_msg'] = c.app.config.options.get('TicketHelpSearch','').strip()
result['url_q'] = c.app.globals.not_closed_query
result['url_sort'] = ''
@@ -650,6 +652,7 @@ class RootController(BaseController, FeedController):
result['columns'] = columns or solr_columns()
result['sortable_custom_fields'] = c.app.globals.sortable_custom_fields_shown_in_search()
result['allow_edit'] = has_access(c.app, 'update')()
+ result['allow_move'] = has_access(c.app, 'admin')()
result['bin'] = bin
result['help_msg'] = c.app.config.options.get('TicketHelpSearch', '').strip()
result['deleted'] = deleted
@@ -758,6 +761,23 @@ class RootController(BaseController, FeedController):
c.mass_edit_form = W.mass_edit_form
return result
+ @with_trailing_slash
+ @expose('jinja:forgetracker:templates/tracker/mass_move.html')
+ @validate(dict(q=validators.UnicodeString(if_empty=None),
+ limit=validators.Int(if_empty=10),
+ page=validators.Int(if_empty=0),
+ sort=validators.UnicodeString(if_empty='ticket_num_i asc')))
+ def move(self, q=None, limit=None, page=None, sort=None, **kw):
+ require_access(c.app, 'admin')
+ result = TM.Ticket.paged_search(c.app.config, c.user, q, sort=sort, limit=limit, page=page, show_deleted=False, **kw)
+ result['columns'] = solr_columns()
+ result['sortable_custom_fields'] = c.app.globals.sortable_custom_fields_shown_in_search()
+ result['globals'] = c.app.globals
+ result['cancel_href'] = url(c.app.url + 'search/', dict(q=q, limit=limit, sort=sort))
+ c.mass_move = W.mass_edit
+ c.mass_move_form = W.mass_move_form(tracker=[])
+ return result
+
@expose()
@require_post()
def update_tickets(self, **post_data):
@@ -1768,6 +1788,7 @@ class MilestoneController(BaseController):
result['columns'] = columns or mongo_columns()
result['sortable_custom_fields'] = c.app.globals.sortable_custom_fields_shown_in_search()
result['allow_edit'] = has_access(c.app, 'update')()
+ result['allow_move'] = has_access(c.app, 'admin')()
result['help_msg'] = c.app.config.options.get('TicketHelpSearch','').strip()
result['deleted'] = deleted
progress = c.app.globals.milestone_count(self.progress_key)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c0797acc/ForgeTracker/forgetracker/widgets/ticket_search.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/ticket_search.py b/ForgeTracker/forgetracker/widgets/ticket_search.py
index 38a91a7..fdc257a 100644
--- a/ForgeTracker/forgetracker/widgets/ticket_search.py
+++ b/ForgeTracker/forgetracker/widgets/ticket_search.py
@@ -23,6 +23,7 @@ import ew as ew_core
import ew.jinja2_ew as ew
from allura.lib.widgets import form_fields as ffw
+from allura.lib.widgets import forms
class TicketSearchResults(ew_core.SimpleForm):
template='jinja:forgetracker:templates/tracker_widgets/ticket_search_results.html'
@@ -84,6 +85,14 @@ class MassEditForm(ew_core.Widget):
def resources(self):
yield ew.JSLink('tracker_js/mass-edit.js')
+class MassMoveForm(forms.MoveTicketForm):
+ defaults=dict(
+ forms.MoveTicketForm.defaults,
+ action='.')
+
+ def resources(self):
+ yield ew.JSLink('tracker_js/mass-edit.js')
+
class SearchHelp(ffw.Lightbox):
defaults=dict(
ffw.Lightbox.defaults,
[08/50] git commit: [#6105] ticket:321 Refactor markdown macros
Posted by jo...@apache.org.
[#6105] ticket:321 Refactor markdown macros
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/9caef26c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9caef26c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9caef26c
Branch: refs/heads/cj/5913
Commit: 9caef26cb1f0862194c98074bd1d7daab6a2fd7d
Parents: 760cf5e
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Mon Apr 29 01:10:48 2013 +0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 13:34:16 2013 +0000
----------------------------------------------------------------------
Allura/allura/lib/macro.py | 80 +++++++--------
Allura/allura/lib/widgets/macros.py | 22 ++++
Allura/allura/templates/macro/__init__.py | 1 +
Allura/allura/templates/macro/blog_posts.html | 10 ++
Allura/allura/templates/macro/members.html | 9 ++
.../allura/templates/macro/neighborhood_feeds.html | 10 ++
Allura/allura/templates/macro/project_admins.html | 6 +
Allura/allura/tests/test_globals.py | 15 +--
8 files changed, 101 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9caef26c/Allura/allura/lib/macro.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/macro.py b/Allura/allura/lib/macro.py
index 2e51ecb..be1f8fb 100644
--- a/Allura/allura/lib/macro.py
+++ b/Allura/allura/lib/macro.py
@@ -82,53 +82,36 @@ class parse(object):
else:
return None
-template_neighborhood_feeds = string.Template('''
-<div class="neighborhood_feed_entry">
-<h3><a href="$href">$title</a></h3>
-<p>
-by <em>$author</em>
-<small>$ago</small>
-</p>
-<p>$description</p>
-</div>
-''')
@macro('neighborhood-wiki')
def neighborhood_feeds(tool_name, max_number=5, sort='pubdate'):
from allura import model as M
+ from allura.lib.widgets.macros import NeighborhoodFeeds
feed = M.Feed.query.find(
dict(
tool_name=tool_name,
neighborhood_id=c.project.neighborhood._id))
feed = feed.sort(sort, pymongo.DESCENDING).limit(int(max_number)).all()
- output = '\n'.join(
- template_neighborhood_feeds.substitute(dict(
+ output = ((dict(
href=item.link,
title=item.title,
author=item.author_name,
ago=h.ago(item.pubdate),
description=item.description))
for item in feed)
- return output
-
-template_neighborhood_blog_posts = string.Template('''
-<div class="neighborhood_feed_entry">
-<h3><a href="$href">$title</a></h3>
-<p>
-by <em>$author</em>
-<small>$ago</small>
-</p>
-$description
-</div>
-''')
+ feeds = NeighborhoodFeeds(feeds=output)
+ g.resource_manager.register(feeds)
+ response = feeds.display(feeds=output)
+ return response
+
@macro('neighborhood-wiki')
def neighborhood_blog_posts(max_number=5, sort='timestamp', summary=False):
from forgeblog import model as BM
+ from allura.lib.widgets.macros import BlogPosts
posts = BM.BlogPost.query.find(dict(
neighborhood_id=c.project.neighborhood._id,
state='published'))
posts = posts.sort(sort, pymongo.DESCENDING).limit(int(max_number)).all()
- output = '\n'.join(
- template_neighborhood_blog_posts.substitute(dict(
+ output = ((dict(
href=post.url(),
title=post.title,
author=post.author().display_name,
@@ -137,19 +120,23 @@ def neighborhood_blog_posts(max_number=5, sort='timestamp', summary=False):
for post in posts if post.app and
security.has_access(post, 'read', project=post.app.project)() and
security.has_access(post.app.project, 'read', project=post.app.project)())
- return output
+
+ posts = BlogPosts(posts=output)
+ g.resource_manager.register(posts)
+ response = posts.display(posts=output)
+ return response
@macro()
def project_blog_posts(max_number=5, sort='timestamp', summary=False, mount_point=None):
from forgeblog import model as BM
+ from allura.lib.widgets.macros import BlogPosts
app_config_ids = []
for conf in c.project.app_configs:
if conf.tool_name.lower() == 'blog' and (mount_point is None or conf.options.mount_point==mount_point):
app_config_ids.append(conf._id)
posts = BM.BlogPost.query.find({'state':'published','app_config_id':{'$in':app_config_ids}})
posts = posts.sort(sort, pymongo.DESCENDING).limit(int(max_number)).all()
- output = '\n'.join(
- template_neighborhood_blog_posts.substitute(dict(
+ output = ((dict(
href=post.url(),
title=post.title,
author=post.author().display_name,
@@ -157,7 +144,10 @@ def project_blog_posts(max_number=5, sort='timestamp', summary=False, mount_poin
description=summary and ' ' or g.markdown.convert(post.text)))
for post in posts if security.has_access(post, 'read', project=post.app.project)() and
security.has_access(post.app.project, 'read', project=post.app.project)())
- return output
+ posts = BlogPosts(posts=output)
+ g.resource_manager.register(posts)
+ response = posts.display(posts=output)
+ return response
def get_projects_for_macro(category=None, display_mode='grid', sort='last_updated',
show_total=False, limit=100, labels='', award='', private=False,
@@ -352,31 +342,35 @@ def img(src=None, **kw):
else:
return '<img src="./attachment/%s" %s/>' % (src, ' '.join(attrs))
-
-template_project_admins = string.Template('<li><a href="$url">$name</a></li>')
@macro()
def project_admins():
admins = c.project.users_with_role('Admin')
- output = ''.join(
- template_project_admins.substitute(dict(
+ from allura.lib.widgets.macros import ProjectAdmins
+ output = ((dict(
url=user.url(),
name=jinja2.escape(user.display_name)))
for user in admins)
- return u'<h6>Project Admins:</h6><ul class="md-users-list">{0}</ul>'.format(output)
+ users = ProjectAdmins(users=output)
+ g.resource_manager.register(users)
+ response = users.display(users=output)
+ return response
-template_members = string.Template('<li><a href="$url">$name</a>$admin</li>')
@macro()
def members(limit=20):
+ from allura.lib.widgets.macros import Members
limit = asint(limit)
admins = set(c.project.users_with_role('Admin'))
members = sorted(c.project.users(), key=attrgetter('display_name'))
- output = ''.join(
- template_members.substitute(dict(
+ output = [dict(
url=user.url(),
name=jinja2.escape(user.display_name),
admin=' (admin)' if user in admins else '',
- ))
- for user in members[:limit])
- if len(members) > limit:
- output = output + '<li class="md-users-list-more"><a href="%s_members">All Members</a></li>' % c.project.url()
- return u'<h6>Project Members:</h6><ul class="md-users-list">{0}</ul>'.format(output)
+ )
+ for user in members[:limit]]
+
+ over_limit = len(members) > limit
+ users = Members(users=output, over_limit=over_limit)
+ g.resource_manager.register(users)
+ response = users.display(users=output, over_limit=over_limit)
+ return response
+
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9caef26c/Allura/allura/lib/widgets/macros.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/macros.py b/Allura/allura/lib/widgets/macros.py
index 62a3487..0921ab9 100644
--- a/Allura/allura/lib/widgets/macros.py
+++ b/Allura/allura/lib/widgets/macros.py
@@ -34,3 +34,25 @@ class DownloadButton(ew.Widget):
yield ew.jinja2_ew.JSScript('''
$(function(){$(".download-button-%s").load("%s");
});''' % (self.project._id,self.project.best_download_url()))
+
+class NeighborhoodFeeds(ew.Widget):
+ template = 'jinja:allura:templates/macro/neighborhood_feeds.html'
+ params=['feeds']
+ feeds = None
+
+class BlogPosts(ew.Widget):
+ template = 'jinja:allura:templates/macro/blog_posts.html'
+ params = ['posts']
+ posts = None
+
+class ProjectAdmins(ew.Widget):
+ template = 'jinja:allura:templates/macro/project_admins.html'
+ params = ['users']
+ users = None
+
+class Members(ew.Widget):
+ template = 'jinja:allura:templates/macro/members.html'
+ params = ['users', 'over_limit']
+ users = None
+ over_limit = None
+
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9caef26c/Allura/allura/templates/macro/__init__.py
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/macro/__init__.py b/Allura/allura/templates/macro/__init__.py
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/Allura/allura/templates/macro/__init__.py
@@ -0,0 +1 @@
+
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9caef26c/Allura/allura/templates/macro/blog_posts.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/macro/blog_posts.html b/Allura/allura/templates/macro/blog_posts.html
new file mode 100644
index 0000000..c5213bb
--- /dev/null
+++ b/Allura/allura/templates/macro/blog_posts.html
@@ -0,0 +1,10 @@
+{% for post in posts %}
+ <div class="neighborhood_feed_entry">
+ <h3><a href="{{post.href}}">{{post.title}}</a></h3>
+ <p>
+ by <em>{{post.author}}</em>
+ <small>{{post.ago}}</small>
+ </p>
+ {{post.description}}
+ </div>
+{% endfor %}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9caef26c/Allura/allura/templates/macro/members.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/macro/members.html b/Allura/allura/templates/macro/members.html
new file mode 100644
index 0000000..440760c
--- /dev/null
+++ b/Allura/allura/templates/macro/members.html
@@ -0,0 +1,9 @@
+<h6>Project Members:</h6>
+ <ul class="md-users-list">
+ {% for user in users -%}
+ <li><a href="{{user.url}}">{{user.name}}</a>{{user.admin}}</li>
+ {%- endfor %}
+ {% if over_limit -%}
+ <li class="md-users-list-more"><a href="{{c.project.url()}}_members">All Members</a></li>
+ {%- endif %}
+ </ul>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9caef26c/Allura/allura/templates/macro/neighborhood_feeds.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/macro/neighborhood_feeds.html b/Allura/allura/templates/macro/neighborhood_feeds.html
new file mode 100644
index 0000000..7a23126
--- /dev/null
+++ b/Allura/allura/templates/macro/neighborhood_feeds.html
@@ -0,0 +1,10 @@
+<div class="neighborhood_feed_entry">
+{% for feed in feeds%}
+ <h3><a href="{{feed.href}}">{{feed.title}}</a></h3>
+ <p>
+ by <em>{{feed.author}}</em>
+ <small>{{feed.ago}}</small>
+ </p>
+ <p>{{feed.description}}</p>
+</div>
+{%endfor%}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9caef26c/Allura/allura/templates/macro/project_admins.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/macro/project_admins.html b/Allura/allura/templates/macro/project_admins.html
new file mode 100644
index 0000000..2b346bc
--- /dev/null
+++ b/Allura/allura/templates/macro/project_admins.html
@@ -0,0 +1,6 @@
+<h6>Project Admins:</h6>
+<ul class="md-users-list">
+ {% for user in users -%}
+ <li><a href="{{user.url}}">{{user.name}}</a></li>
+ {%- endfor %}
+</ul>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9caef26c/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index 71629ed..69b840f 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -175,14 +175,11 @@ def test_macro_members():
p_test.add_user(M.User.by_username('test-user-0'), ['Member'])
ThreadLocalORMSession.flush_all()
r = g.markdown_wiki.convert('[[members limit=2]]')
- assert_equal(r,
- '<div class="markdown_content">'
- '<h6>Project Members:</h6>'
- '<ul class="md-users-list">'
- '<li><a href="/u/test-admin/">Test Admin</a> (admin)</li>'
- '<li><a href="/u/test-user/">Test User</a></li>'
- '<li class="md-users-list-more"><a href="/p/test/_members">All Members</a></li>'
- '</ul>\n'
+ assert_equal(r, '<div class="markdown_content"><h6>Project Members:</h6>\n'
+ '<ul class="md-users-list">\n'
+ '<li><a href="/u/test-admin/">Test Admin</a> (admin)</li><li><a href="/u/test-user/">Test User</a></li>\n'
+ '<li class="md-users-list-more"><a href="/p/test/_members">All Members</a></li>\n'
+ '</ul>\n'
'</div>')
@with_setup(teardown=setUp) # reset everything we changed
@@ -190,7 +187,7 @@ def test_macro_project_admins():
user = M.User.by_username('test-admin')
user.display_name = u'Test Ådmin'
r = g.markdown_wiki.convert('[[project_admins]]')
- assert_equal(r, u'<div class="markdown_content"><h6>Project Admins:</h6><ul class="md-users-list"><li><a href="/u/test-admin/">Test Ådmin</a></li></ul>\n</div>')
+ assert_equal(r, u'<div class="markdown_content"><h6>Project Admins:</h6>\n<ul class="md-users-list">\n<li><a href="/u/test-admin/">Test \xc5dmin</a></li>\n</ul>\n</div>')
@with_setup(teardown=setUp) # reset everything we changed
def test_macro_project_admins_one_br():
[40/50] git commit: [#5656] ticket:358 Flash notification about move
task completion
Posted by jo...@apache.org.
[#5656] ticket:358 Flash notification about move task completion
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/ed74e25d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ed74e25d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ed74e25d
Branch: refs/heads/cj/5913
Commit: ed74e25d1b4c89cdafbd90d23f97c7ac36592096
Parents: 5198a83
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 23 14:03:53 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:42:27 2013 +0000
----------------------------------------------------------------------
ForgeTracker/forgetracker/model/ticket.py | 4 ++++
.../forgetracker/tests/functional/test_root.py | 13 +++++++++----
2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ed74e25d/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index b1144db..24a5d08 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -278,6 +278,10 @@ class Globals(MappedClass):
text = tmpl.render(tmpl_context),
destinations = [monitoring_email]))
mail_tasks.sendmail.post(**mail)
+ moved_from = '%s/%s' % (c.project.shortname, c.app.config.options.mount_point)
+ moved_to = '%s/%s' % (tracker.project.shortname, tracker.options.mount_point)
+ text = 'Tickets moved from %s to %s' % (moved_from, moved_to)
+ Notification.post_user(c.user, None, 'flash', text=text)
def filtered_by_subscription(self, tickets, project_id=None, app_config_id=None):
p_id = project_id if project_id else c.project._id
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ed74e25d/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 0d129a3..1f4acf4 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -2235,14 +2235,14 @@ class TestBulkMove(TrackerTestController):
M.MonQTask.run_ready()
def test_access_restriction(self):
- self.app.get('/bugs/move/', status=200)
- self.app.get('/bugs/move/',
+ self.app.get('/bugs/move/', status=200)
+ self.app.get('/bugs/move/',
extra_environ={'username': 'test-user-0'},
status=403)
- self.app.get('/bugs/move/',
+ self.app.get('/bugs/move/',
extra_environ={'username': '*anonymous'},
status=302)
- self.app.post('/bugs/move_tickets',
+ self.app.post('/bugs/move_tickets',
extra_environ={'username': 'test-user-0'},
status=403)
@@ -2353,6 +2353,11 @@ class TestBulkMove(TrackerTestController):
assert_in(first_ticket_changes, admin_email.kwargs.text)
assert_in(second_ticket_changes, admin_email.kwargs.text)
assert_in(third_ticket_changes, admin_email.kwargs.text)
+ # After tickets moved, user should see a flash
+ mbox = M.Mailbox.query.get(user_id=admin._id, is_flash=True)
+ notification_id = mbox.queue[-1]
+ notification = M.Notification.query.get(_id=notification_id)
+ assert_equal(notification.text, 'Tickets moved from test/bugs to test2/bugs2')
@td.with_tool('test2', 'Tickets', 'bugs2')
def test_monitoring_email(self):
[48/50] git commit: [#5913] Added breadcrumb navigation to project
header
Posted by jo...@apache.org.
[#5913] Added breadcrumb navigation to project header
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/d154a867
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d154a867
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d154a867
Branch: refs/heads/cj/5913
Commit: d154a867930d995a86c783ed81822078c4c35700
Parents: b4a9f1b
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue May 21 23:18:06 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue May 28 15:54:58 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/project.py | 18 ++++++++++++
Allura/allura/nf/allura/css/site_style.css | 22 +++++++++++++++
Allura/allura/templates/jinja_master/nav_menu.html | 2 +
.../templates/jinja_master/theme_macros.html | 18 ++++++++++++
4 files changed, 60 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d154a867/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index e98b44c..c11c148 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -117,6 +117,24 @@ class TroveCategory(MappedClass):
trove = trove.parent_category
return trove.shortname
+ @LazyProperty
+ def ancestors(self):
+ ancestors = []
+ trove = self
+ while trove:
+ ancestors.append(trove)
+ trove = trove.parent_category
+ return ancestors
+
+ @LazyProperty
+ def breadcrumbs(self):
+ url = '/directory/'
+ crumbs = []
+ for trove in reversed(self.ancestors[:-1]):
+ url += trove.shortname + '/'
+ crumbs.append((trove.fullname, url))
+ return crumbs
+
class ProjectMapperExtension(MapperExtension):
def after_insert(self, obj, st, sess):
g.zarkov_event('project_create', project=obj)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d154a867/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index b067f6d..cfbfc9e 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -2095,6 +2095,28 @@ nav .ico {
margin: 0 0 15px;
}
+#nav_menu_holder #breadcrumbs {
+ margin-bottom: 5px;
+}
+
+#nav_menu_holder #breadcrumbs ul {
+ list-style: none;
+ margin: 0;
+}
+
+#nav_menu_holder #breadcrumbs li {
+ display: inline;
+ font-size: 11px;
+}
+
+#nav_menu_holder #breadcrumbs li:after {
+ content: ' / ';
+}
+
+#nav_menu_holder #breadcrumbs li:last-child:after {
+ content: '';
+}
+
#nav_menu_holder h1.project_title {
line-height: 1em;
font-size: 32px;
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d154a867/Allura/allura/templates/jinja_master/nav_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/nav_menu.html b/Allura/allura/templates/jinja_master/nav_menu.html
index 74f7509..724ca1c 100644
--- a/Allura/allura/templates/jinja_master/nav_menu.html
+++ b/Allura/allura/templates/jinja_master/nav_menu.html
@@ -17,10 +17,12 @@
under the License.
-#}
{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
+{% import g.theme.jinja_macros as theme_macros with context %}
{% set n = c.project.neighborhood %}
{% if not c.project or (n.neighborhood_project == c.project and not n.show_title) %}
<div id="nav_menu_missing"></div>
{% else %}
+ {{ theme_macros.breadcrumbs(c.project, c.app) }}
{% if c.project.neighborhood.icon %}
<a href="{{c.project.neighborhood.url()}}"><img src="{{c.project.neighborhood.url()}}/icon" class="neighborhood_icon"
alt="Return to {{c.project.neighborhood.name}}" title="Return to {{c.project.neighborhood.name}}"></a>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d154a867/Allura/allura/templates/jinja_master/theme_macros.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/theme_macros.html b/Allura/allura/templates/jinja_master/theme_macros.html
index e1c9903..a493075 100644
--- a/Allura/allura/templates/jinja_master/theme_macros.html
+++ b/Allura/allura/templates/jinja_master/theme_macros.html
@@ -78,3 +78,21 @@
{%- macro extra_header(path_to_static) %}
{%- endmacro %}
+
+{%- macro breadcrumbs(project, app) %}
+ <nav id="breadcrumbs">
+ <ul>
+ <li><a href="/">Home</a></li>
+ {% for label,url in project.breadcrumbs() %}
+ {% if not loop.last or app %}
+ <li><a href="{{ url }}">{{ label }}</a></li>
+ {% else %}
+ <li>{{ label }}</li>
+ {% endif %}
+ {% endfor %}
+ {% if app %}
+ <li>{{ app.config.options.mount_label }}</li>
+ {% endif %}
+ </ul>
+ </nav>
+{%- endmacro %}
[29/50] git commit: [#5656] ticket:301 Refactor trackers collecting
in helper function and use it in both 'moves'
Posted by jo...@apache.org.
[#5656] ticket:301 Refactor trackers collecting in helper function and use it in both 'moves'
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/d1fc56e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d1fc56e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d1fc56e5
Branch: refs/heads/cj/5913
Commit: d1fc56e5dc000065d7f8926d709e4f69d45bcd4d
Parents: c0797ac
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Apr 30 15:04:22 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:35:51 2013 +0000
----------------------------------------------------------------------
ForgeTracker/forgetracker/tracker_main.py | 34 +++++++++++++++--------
1 files changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d1fc56e5/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index b1bd941..b2cc363 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -139,6 +139,25 @@ def get_change_text(name, new_value, old_value):
changelist=changes.get_changed())
+def _my_trackers(user, current_tracker_app_config):
+ '''Collect all 'Tickets' instances in all user's projects
+ for which user has admin permissions.
+
+ Returns list of 3-tuples (<tracker_id>, '<project>/<mount_point>', <is current tracker?>)
+ '''
+ trackers = []
+ projects = user.my_projects()
+ projects = ifilter(lambda p: has_access(p, 'admin')(), projects)
+ for p in projects:
+ for ac in p.app_configs:
+ if ac.tool_name.lower() == 'tickets':
+ trac = (str(ac._id),
+ '%s/%s' % (p.shortname, ac.options['mount_point']),
+ bool(current_tracker_app_config == ac))
+ trackers.append(trac)
+ return trackers
+
+
class W:
thread=w.Thread(
page=None, limit=None, page_size=None, count=None,
@@ -775,7 +794,8 @@ class RootController(BaseController, FeedController):
result['globals'] = c.app.globals
result['cancel_href'] = url(c.app.url + 'search/', dict(q=q, limit=limit, sort=sort))
c.mass_move = W.mass_edit
- c.mass_move_form = W.mass_move_form(tracker=[])
+ trackers = _my_trackers(c.user, c.app.config)
+ c.mass_move_form = W.mass_move_form(trackers=trackers)
return result
@expose()
@@ -1475,17 +1495,7 @@ class TicketController(BaseController, FeedController):
flash('Ticket successfully moved')
redirect(new_ticket.url())
- # collect all 'Tickets' instances in all user project for which his has admin perms
- trackers = []
- projects = c.user.my_projects()
- projects = ifilter(lambda p: has_access(p, 'admin')(), projects)
- for p in projects:
- for ac in p.app_configs:
- if ac.tool_name.lower() == 'tickets':
- trac = (str(ac._id),
- '%s/%s' % (p.shortname, ac.options['mount_point']),
- bool(self.ticket.app.config == ac))
- trackers.append(trac)
+ trackers = _my_trackers(c.user, self.ticket.app.config)
return {
'ticket': self.ticket,
'form': W.move_ticket_form(trackers=trackers),
[02/50] git commit: [#6046] ticket:350 Test 'Download Snapshot' link
in repo subdirs
Posted by jo...@apache.org.
[#6046] ticket:350 Test 'Download Snapshot' link in repo subdirs
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/a5961a6e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a5961a6e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a5961a6e
Branch: refs/heads/cj/5913
Commit: a5961a6edb651b366b8e27dc3e3a6724c06e85aa
Parents: 59f5867
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri May 10 08:32:30 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu May 23 01:18:17 2013 +0000
----------------------------------------------------------------------
.../forgegit/tests/functional/test_controllers.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a5961a6e/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 0d253e1..787cef1 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -347,6 +347,14 @@ class TestRootController(_TestCase):
r = self.app.get('/p/test/src-git/ci/master/tarball_status')
assert '{"status": "ready"}' in r
+ def test_tarball_link_in_subdirs(self):
+ '''Go to repo subdir and check 'Download Snapshot' link'''
+ self.setup_testgit_index_repo()
+ r = self.app.get('/p/test/testgit-index/ci/master/tree/index/')
+ links = r.html.findAll('a')
+ download_link = [a for a in links if a.text == 'Download Snapshot'][0]
+ assert_equal(download_link.get('href'), '/p/test/testgit-index/ci/master/tarball')
+
class TestRestController(_TestCase):
[17/50] git commit: add license to new files,
ignore some generated files
Posted by jo...@apache.org.
add license to new files, ignore some generated files
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/6702bc7b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6702bc7b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6702bc7b
Branch: refs/heads/cj/5913
Commit: 6702bc7bf1ff2ba53daf2fbe05bf1357217508ab
Parents: d412205
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu May 23 15:15:54 2013 -0400
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu May 23 15:45:27 2013 -0400
----------------------------------------------------------------------
Allura/allura/templates/macro/__init__.py | 17 +++++++++++++-
Allura/allura/templates/macro/blog_posts.html | 18 +++++++++++++++
Allura/allura/templates/macro/members.html | 18 +++++++++++++++
.../allura/templates/macro/neighborhood_feeds.html | 18 +++++++++++++++
Allura/allura/templates/macro/project_admins.html | 18 +++++++++++++++
Allura/docs/api/app.rst | 17 ++++++++++++++
Allura/docs/api/controllers.rst | 18 ++++++++++++++-
ForgeDiscussion/forgediscussion/site_stats.py | 17 ++++++++++++++
ForgeTracker/forgetracker/data/mass_report | 18 +++++++++++++++
ForgeTracker/forgetracker/site_stats.py | 17 ++++++++++++++
rat-excludes.txt | 4 ++-
11 files changed, 177 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/Allura/allura/templates/macro/__init__.py
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/macro/__init__.py b/Allura/allura/templates/macro/__init__.py
index 8b13789..144e298 100644
--- a/Allura/allura/templates/macro/__init__.py
+++ b/Allura/allura/templates/macro/__init__.py
@@ -1 +1,16 @@
-
+# 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.
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/Allura/allura/templates/macro/blog_posts.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/macro/blog_posts.html b/Allura/allura/templates/macro/blog_posts.html
index c5213bb..52d9aa9 100644
--- a/Allura/allura/templates/macro/blog_posts.html
+++ b/Allura/allura/templates/macro/blog_posts.html
@@ -1,3 +1,21 @@
+{#-
+ 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.
+-#}
{% for post in posts %}
<div class="neighborhood_feed_entry">
<h3><a href="{{post.href}}">{{post.title}}</a></h3>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/Allura/allura/templates/macro/members.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/macro/members.html b/Allura/allura/templates/macro/members.html
index 440760c..8ed27fc 100644
--- a/Allura/allura/templates/macro/members.html
+++ b/Allura/allura/templates/macro/members.html
@@ -1,3 +1,21 @@
+{#-
+ 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.
+-#}
<h6>Project Members:</h6>
<ul class="md-users-list">
{% for user in users -%}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/Allura/allura/templates/macro/neighborhood_feeds.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/macro/neighborhood_feeds.html b/Allura/allura/templates/macro/neighborhood_feeds.html
index 7a23126..530f950 100644
--- a/Allura/allura/templates/macro/neighborhood_feeds.html
+++ b/Allura/allura/templates/macro/neighborhood_feeds.html
@@ -1,3 +1,21 @@
+{#-
+ 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.
+-#}
<div class="neighborhood_feed_entry">
{% for feed in feeds%}
<h3><a href="{{feed.href}}">{{feed.title}}</a></h3>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/Allura/allura/templates/macro/project_admins.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/macro/project_admins.html b/Allura/allura/templates/macro/project_admins.html
index 2b346bc..0329b56 100644
--- a/Allura/allura/templates/macro/project_admins.html
+++ b/Allura/allura/templates/macro/project_admins.html
@@ -1,3 +1,21 @@
+{#-
+ 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.
+-#}
<h6>Project Admins:</h6>
<ul class="md-users-list">
{% for user in users -%}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/Allura/docs/api/app.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/app.rst b/Allura/docs/api/app.rst
index 7fcd90b..31a94f2 100644
--- a/Allura/docs/api/app.rst
+++ b/Allura/docs/api/app.rst
@@ -1,3 +1,20 @@
+.. 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.
+
.. _app_module:
:mod:`allura.app`
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/Allura/docs/api/controllers.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/controllers.rst b/Allura/docs/api/controllers.rst
index 5e56976..2595a07 100644
--- a/Allura/docs/api/controllers.rst
+++ b/Allura/docs/api/controllers.rst
@@ -1,3 +1,20 @@
+.. 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.
+
.. _controllers_module:
:mod:`allura.controllers`
@@ -9,4 +26,3 @@
.. autoclass:: RestController
:members:
-
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/ForgeDiscussion/forgediscussion/site_stats.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/site_stats.py b/ForgeDiscussion/forgediscussion/site_stats.py
index e76201d..6918137 100644
--- a/ForgeDiscussion/forgediscussion/site_stats.py
+++ b/ForgeDiscussion/forgediscussion/site_stats.py
@@ -1,3 +1,20 @@
+# 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.
+
from datetime import datetime, timedelta
from . import model as DM
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/ForgeTracker/forgetracker/data/mass_report
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/data/mass_report b/ForgeTracker/forgetracker/data/mass_report
index faddde2..7e8e47d 100644
--- a/ForgeTracker/forgetracker/data/mass_report
+++ b/ForgeTracker/forgetracker/data/mass_report
@@ -1,3 +1,21 @@
+{#-
+ 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.
+-#}
{{ data.header }}
{% for ticket, change_text in data.changes %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/ForgeTracker/forgetracker/site_stats.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/site_stats.py b/ForgeTracker/forgetracker/site_stats.py
index e0baa63..f9f36ce 100644
--- a/ForgeTracker/forgetracker/site_stats.py
+++ b/ForgeTracker/forgetracker/site_stats.py
@@ -1,3 +1,20 @@
+# 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.
+
from datetime import datetime, timedelta
from bson import ObjectId
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6702bc7b/rat-excludes.txt
----------------------------------------------------------------------
diff --git a/rat-excludes.txt b/rat-excludes.txt
index bae4984..5b3677a 100644
--- a/rat-excludes.txt
+++ b/rat-excludes.txt
@@ -5,7 +5,9 @@ rat-excludes.txt
**/*.egg-info/
requirements*
**/MANIFEST.in
-**/test.log
+**/*.log
+**/.coverage
+**/nosetests.xml
Allura/allura/controllers/controller.template
Allura/docs/_build/
Allura/allura/etc/mime.types
[10/50] git commit: [#4831] ticket:339 record tool's permission
changes in the project audit log
Posted by jo...@apache.org.
[#4831] ticket:339 record tool's permission changes in the project audit log
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/99a2fe00
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/99a2fe00
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/99a2fe00
Branch: refs/heads/cj/5913
Commit: 99a2fe009acf020dc9f64ba1a956983d97b8d21d
Parents: b5bca03
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Fri May 17 10:31:27 2013 +0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 14:29:11 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 14 ++++++++++++++
Allura/allura/ext/admin/admin_main.py | 4 ++--
Allura/allura/tests/functional/test_admin.py | 20 ++++++++++++++++++++
3 files changed, 36 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/99a2fe00/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 124f084..466f355 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -506,15 +506,29 @@ class DefaultAdminController(BaseController):
@h.vardec
@require_post()
def update(self, card=None, **kw):
+ old_acl = self.app.config.acl
self.app.config.acl = []
for args in card:
perm = args['id']
new_group_ids = args.get('new', [])
+ del_group_ids = []
group_ids = args.get('value', [])
if isinstance(new_group_ids, basestring):
new_group_ids = [ new_group_ids ]
if isinstance(group_ids, basestring):
group_ids = [ group_ids ]
+
+ for acl in old_acl:
+ if (acl['permission']==perm) and (str(acl['role_id']) not in group_ids):
+ del_group_ids.append(str(acl['role_id']))
+
+ if new_group_ids or del_group_ids:
+ model.AuditLog.log('updated "%s" permissions: "%s" => "%s" for %s' % (
+ perm,
+ ', '.join(map(lambda id: model.ProjectRole.query.get(_id=ObjectId(id)).name, group_ids+del_group_ids)),
+ ', '.join(map(lambda id: model.ProjectRole.query.get(_id=ObjectId(id)).name, group_ids+new_group_ids)),
+ self.app.config.options['mount_point']))
+
role_ids = map(ObjectId, group_ids + new_group_ids)
self.app.config.acl += [
model.ACE.allow(r, perm) for r in role_ids]
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/99a2fe00/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 433fade..6f6dcea 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -706,13 +706,13 @@ class GroupsController(BaseController):
@h.vardec
def change_perm(self, role_id, permission, allow="true", **kw):
if allow=="true":
- M.AuditLog.log('granted permission %s to group with id %s', permission, role_id)
+ M.AuditLog.log('granted permission %s to group %s', permission, M.ProjectRole.query.get(_id=ObjectId(role_id)).name)
c.project.acl.append(M.ACE.allow(ObjectId(role_id), permission))
else:
admin_group_id = str(M.ProjectRole.by_name('Admin')._id)
if admin_group_id == role_id and permission == 'admin':
return dict(error='You cannot remove the admin permission from the admin group.')
- M.AuditLog.log('revoked permission %s from group with id %s', permission, role_id)
+ M.AuditLog.log('revoked permission %s from group %s', permission, M.ProjectRole.query.get(_id=ObjectId(role_id)).name)
c.project.acl.remove(M.ACE.allow(ObjectId(role_id), permission))
g.post_event('project_updated')
return self._map_group_permissions()
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/99a2fe00/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index e23d49c..a2bcceb 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -385,6 +385,26 @@ class TestProjectAdmin(TestController):
assert_equals(p.labels, ['asdf'])
assert form['labels'].value == 'asdf'
+ @td.with_wiki
+ def test_log_permission(self):
+ r = self.app.get('/admin/wiki/permissions')
+ select = r.html.find('select', {'name': 'card-0.new'})
+ opt_admin = select.find(text='Admin').parent
+ opt_developer = select.find(text='Developer').parent
+ assert opt_admin.name == 'option'
+ assert opt_developer.name == 'option'
+
+ with audits('updated "admin" permissions: "Admin" => "Admin, Developer" for wiki'):
+ self.app.post('/admin/wiki/update', params={
+ 'card-0.new': opt_developer['value'],
+ 'card-0.value': opt_admin['value'],
+ 'card-0.id': 'admin'})
+
+ with audits('updated "admin" permissions: "Admin, Developer" => "Admin" for wiki'):
+ self.app.post('/admin/wiki/update', params={
+ 'card-0.value': opt_admin['value'],
+ 'card-0.id': 'admin'})
+
def test_project_permissions(self):
r = self.app.get('/admin/permissions/')
assert len(r.html.findAll('input', {'name': 'card-0.value'})) == 1
[50/50] git commit: [#5913] Minor IE fixes
Posted by jo...@apache.org.
[#5913] Minor IE fixes
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/595b205c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/595b205c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/595b205c
Branch: refs/heads/cj/5913
Commit: 595b205cd28301809d481d3c7412b61a22118a70
Parents: d154a86
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed May 22 17:07:44 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue May 28 15:54:58 2013 +0000
----------------------------------------------------------------------
Allura/allura/nf/allura/css/site_style.css | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/595b205c/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index cfbfc9e..b08330b 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -2133,6 +2133,8 @@ nav .ico {
}
#nav_menu_holder #dev-status {
+ display: inline-block;
+ line-height: 1em;
vertical-align: top;
text-transform: capitalize;
font-size: 10px;
[36/50] git commit: [#5656] ticket:353 refactored bulk move tickets
Posted by jo...@apache.org.
[#5656] ticket:353 refactored bulk move tickets
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/224499a9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/224499a9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/224499a9
Branch: refs/heads/cj/5913
Commit: 224499a93142cefe434b604602f27bdda2957fa0
Parents: f7e873b
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Mon May 20 13:07:41 2013 +0400
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:42:27 2013 +0000
----------------------------------------------------------------------
Allura/allura/tasks/tracker_task.py | 25 +++++
.../forgetracker/data/mass_move_report.html | 20 ++++-
ForgeTracker/forgetracker/data/mass_report | 2 +-
ForgeTracker/forgetracker/model/ticket.py | 79 ++++++++++++++-
.../forgetracker/tests/functional/test_root.py | 16 ++--
ForgeTracker/forgetracker/tracker_main.py | 79 +--------------
6 files changed, 135 insertions(+), 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/224499a9/Allura/allura/tasks/tracker_task.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/tracker_task.py b/Allura/allura/tasks/tracker_task.py
new file mode 100644
index 0000000..0a37850
--- /dev/null
+++ b/Allura/allura/tasks/tracker_task.py
@@ -0,0 +1,25 @@
+# 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.
+
+
+from allura.lib.decorators import task
+from pylons import tmpl_context as c
+
+
+@task
+def move_tickets(ticket_ids, destination_tracker_id):
+ c.app.globals.move_tickets(ticket_ids, destination_tracker_id)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/224499a9/ForgeTracker/forgetracker/data/mass_move_report.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/data/mass_move_report.html b/ForgeTracker/forgetracker/data/mass_move_report.html
index 3ace7c6..1312f54 100644
--- a/ForgeTracker/forgetracker/data/mass_move_report.html
+++ b/ForgeTracker/forgetracker/data/mass_move_report.html
@@ -1,5 +1,23 @@
+{#
+ 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.
+#}
Tickets were moved from [{{original_tracker}}] to [{{destination_tracker}}]
{% for t in tickets %}
-- [{{original_tracker}}:#{{t['original_num']}}] --> [{{destination_tracker}}:#{{t['destination_num']}}] {{t['summary']}}
+- {{original_tracker}}:#{{t['original_num']}} --> {{destination_tracker}}:#{{t['destination_num']}} {{t['summary']}}
{% endfor %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/224499a9/ForgeTracker/forgetracker/data/mass_report
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/data/mass_report b/ForgeTracker/forgetracker/data/mass_report
index 7e8e47d..70fe1f7 100644
--- a/ForgeTracker/forgetracker/data/mass_report
+++ b/ForgeTracker/forgetracker/data/mass_report
@@ -19,7 +19,7 @@
{{ data.header }}
{% for ticket, change_text in data.changes %}
-ticket: [{{ context.app.config.options.mount_point }}:#{{ ticket.ticket_num }}] {{ ticket.summary }}
+ticket: {{ context.app.config.options.mount_point }}:#{{ ticket.ticket_num }} {{ ticket.summary }}
{{ change_text }}
{% endfor %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/224499a9/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 75c8bca..3a6803d 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -20,6 +20,7 @@ import urllib
import json
import difflib
from datetime import datetime, timedelta
+from bson import ObjectId
import pymongo
from pymongo.errors import OperationFailure
@@ -33,7 +34,7 @@ from ming.orm import FieldProperty, ForeignIdProperty, RelationProperty
from ming.orm.declarative import MappedClass
from allura.model import (Artifact, VersionedArtifact, Snapshot,
- project_orm_session, BaseAttachment, VotableArtifact)
+ project_orm_session, BaseAttachment, VotableArtifact, AppConfig, Mailbox, User)
from allura.model import User, Feed, Thread, Notification, ProjectRole
from allura.model import ACE, ALL_PERMISSIONS, DENY_ALL
from allura.model.timeline import ActivityObject
@@ -42,6 +43,7 @@ from allura.lib import security
from allura.lib.search import search_artifact, SearchError
from allura.lib import utils
from allura.lib import helpers as h
+from allura.tasks import mail_tasks
from forgetracker.plugins import ImportIdConverter
@@ -225,6 +227,81 @@ class Globals(MappedClass):
return Ticket.query.find(dict(
app_config_id=c.app.config._id, deleted=True)).count() > 0
+ def move_tickets(self, ticket_ids, destination_tracker_id):
+ tracker = AppConfig.query.get(_id=destination_tracker_id)
+ tickets = Ticket.query.find(dict(
+ _id={'$in': [ObjectId(id) for id in ticket_ids]},
+ app_config_id=c.app.config._id)).all()
+ filtered = self.filtered_by_subscription({t._id: t for t in tickets})
+ original_ticket_nums = {t._id: t.ticket_num for t in tickets}
+ users = User.query.find({'_id': {'$in': filtered.keys()}}).all()
+ moved_tickets = {}
+ for ticket in tickets:
+ moved = ticket.move(tracker, notify=False)
+ moved_tickets[moved._id] = moved
+ mail = dict(
+ fromaddr = str(c.user.email_address_header()),
+ reply_to = str(c.user.email_address_header()),
+ subject = '%s:%s Mass ticket moving by %s' % (c.project.shortname,
+ c.app.config.options.mount_point,
+ c.user.display_name))
+ tmpl = g.jinja2_env.get_template('forgetracker:data/mass_move_report.html')
+
+ tmpl_context = {
+ 'original_tracker': '%s:%s' % (c.project.shortname,
+ c.app.config.options.mount_point),
+ 'destination_tracker': '%s:%s' % (tracker.project.shortname,
+ tracker.options.mount_point),
+ 'tickets': [],
+ }
+ for user in users:
+ tmpl_context['tickets'] = ({
+ 'original_num': original_ticket_nums[_id],
+ 'destination_num': moved_tickets[_id].ticket_num,
+ 'summary': moved_tickets[_id].summary
+ } for _id in filtered.get(user._id, []))
+ mail.update(dict(
+ message_id = h.gen_message_id(),
+ text = tmpl.render(tmpl_context),
+ destinations = [str(user._id)]))
+ mail_tasks.sendmail.post(**mail)
+
+ if c.app.config.options.get('TicketMonitoringType') == 'AllTicketChanges':
+ monitoring_email = c.app.config.options.get('TicketMonitoringEmail')
+ tmpl_context['tickets'] = ({
+ 'original_num': original_ticket_nums[_id],
+ 'destination_num': moved_tickets[_id].ticket_num,
+ 'summary': moved_tickets[_id].summary
+ } for _id in moved_tickets.keys())
+ mail.update(dict(
+ message_id = h.gen_message_id(),
+ text = tmpl.render(tmpl_context),
+ destinations = [monitoring_email]))
+ mail_tasks.sendmail.post(**mail)
+
+ def filtered_by_subscription(self, tickets, project_id=None, app_config_id=None):
+ p_id = project_id if project_id else c.project._id
+ ac_id = app_config_id if app_config_id else c.app.config._id
+ ticket_ids = tickets.keys()
+ users = Mailbox.query.find(dict(project_id=p_id, app_config_id=ac_id))
+ users = [u.user_id for u in users]
+ filtered = {}
+ for uid in users:
+ params = dict(
+ user_id=uid,
+ project_id=p_id,
+ app_config_id=ac_id)
+ if Mailbox.subscribed(**params):
+ filtered[uid] = set(ticket_ids) # subscribed to entire tool, will see all changes
+ continue
+ for t_id, ticket in tickets.iteritems():
+ params.update({'artifact': ticket})
+ if Mailbox.subscribed(**params):
+ if filtered.get(uid) is None:
+ filtered[uid] = set()
+ filtered[uid].add(t_id)
+ return filtered
+
class TicketHistory(Snapshot):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/224499a9/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index da6544b..37b3399 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -28,12 +28,12 @@ from mock import patch
from nose.tools import assert_true, assert_false, assert_equal, assert_in
from nose.tools import assert_raises, assert_not_in
from formencode.variabledecode import variable_encode
+from pylons import tmpl_context as c
from alluratest.controller import TestController
from allura import model as M
from forgewiki import model as wm
from forgetracker import model as tm
-from forgetracker.tracker_main import filtered_by_subscription
from allura.lib.security import has_access
from allura.lib import helpers as h
@@ -1264,17 +1264,17 @@ class TestFunctionalController(TrackerTestController):
- **Milestone**: 2.0
'''
- first_ticket_changes = '''ticket: [bugs:#1] test first ticket
+ first_ticket_changes = '''ticket: bugs:#1 test first ticket
- **Owner**: Anonymous --> Test Admin
- **Status**: open --> accepted
'''
- second_ticket_changes = '''ticket: [bugs:#2] test second ticket
+ second_ticket_changes = '''ticket: bugs:#2 test second ticket
- **Owner**: Anonymous --> Test Admin
- **Milestone**: 1.0 --> 2.0
'''
- third_ticket_changes = '''ticket: [bugs:#3] test third ticket
+ third_ticket_changes = '''ticket: bugs:#3 test third ticket
- **Owner**: Anonymous --> Test Admin
- **Status**: unread --> accepted
@@ -1432,7 +1432,7 @@ class TestFunctionalController(TrackerTestController):
tickets[0]._id: tickets[0],
tickets[1]._id: tickets[1],
}
- filtered_changes = filtered_by_subscription(changes)
+ filtered_changes = c.app.globals.filtered_by_subscription(changes)
filtered_users = [uid for uid, data in filtered_changes.iteritems()]
assert_equal(sorted(filtered_users), sorted([u._id for u in users[:-1] + [admin]]))
ticket_ids = [t._id for t in tickets]
@@ -2280,6 +2280,8 @@ class TestBulkMove(TrackerTestController):
'__ticket_ids': [t._id for t in tickets],
'__search': '',
})
+ M.MonQTask.run_ready()
+ ThreadLocalORMSession.flush_all()
ac_id = tracker.config._id
original_ac_id = original_tracker.config._id
moved_tickets = tm.Ticket.query.find({'app_config_id': ac_id}).all()
@@ -2319,7 +2321,7 @@ class TestBulkMove(TrackerTestController):
emails = M.MonQTask.query.find(dict(task_name='allura.tasks.mail_tasks.sendmail')).all()
assert_equal(len(emails), 3)
for email in emails:
- assert_equal(email.kwargs.subject, '[test:bugs] Mass ticket moving by Test Admin')
+ assert_equal(email.kwargs.subject, 'test:bugs Mass ticket moving by Test Admin')
first_user_email = M.MonQTask.query.find({
'task_name': 'allura.tasks.mail_tasks.sendmail',
'kwargs.destinations': str(first_user._id)
@@ -2374,7 +2376,7 @@ class TestBulkMove(TrackerTestController):
emails = M.MonQTask.query.find(dict(task_name='allura.tasks.mail_tasks.sendmail')).all()
assert_equal(len(emails), 2)
for email in emails:
- assert_equal(email.kwargs.subject, '[test:bugs] Mass ticket moving by Test Admin')
+ assert_equal(email.kwargs.subject, 'test:bugs Mass ticket moving by Test Admin')
admin_email = M.MonQTask.query.find({
'task_name': 'allura.tasks.mail_tasks.sendmail',
'kwargs.destinations': str(M.User.by_username('test-admin')._id)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/224499a9/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 845d380..62469a9 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -62,7 +62,7 @@ from allura.controllers import AppDiscussionController, AppDiscussionRestControl
from allura.controllers import attachments as ac
from allura.controllers import BaseController
from allura.controllers.feed import FeedArgs, FeedController
-from allura.tasks import mail_tasks
+from allura.tasks import mail_tasks, tracker_task
# Local imports
from forgetracker import model as TM
@@ -824,55 +824,7 @@ class RootController(BaseController, FeedController):
_id={'$in': [ObjectId(id) for id in ticket_ids]},
app_config_id=c.app.config._id)).all()
- filtered = filtered_by_subscription({t._id: t for t in tickets})
- original_ticket_nums = {t._id: t.ticket_num for t in tickets}
- users = M.User.query.find({'_id': {'$in': filtered.keys()}}).all()
- moved_tickets = {}
- for ticket in tickets:
- moved = ticket.move(tracker, notify=False)
- moved_tickets[moved._id] = moved
-
- mail = dict(
- fromaddr = str(c.user._id),
- reply_to = str(c.user._id),
- subject = '[%s:%s] Mass ticket moving by %s' % (c.project.shortname,
- c.app.config.options.mount_point,
- c.user.display_name))
- tmpl = jinja2.Environment(
- loader=jinja2.PackageLoader('forgetracker', 'data'),
- auto_reload=asbool(config.get('auto_reload_templates', True))
- ).get_template('mass_move_report.html')
- tmpl_context = {
- 'original_tracker': '%s:%s' % (c.project.shortname,
- c.app.config.options.mount_point),
- 'destination_tracker': '%s:%s' % (tracker.project.shortname,
- tracker.options.mount_point),
- 'tickets': [],
- }
- for user in users:
- tmpl_context['tickets'] = ({
- 'original_num': original_ticket_nums[_id],
- 'destination_num': moved_tickets[_id].ticket_num,
- 'summary': moved_tickets[_id].summary
- } for _id in filtered.get(user._id, []))
- mail.update(dict(
- message_id = h.gen_message_id(),
- text = tmpl.render(tmpl_context),
- destinations = [str(user._id)]))
- mail_tasks.sendmail.post(**mail)
-
- if c.app.config.options.get('TicketMonitoringType') == 'AllTicketChanges':
- monitoring_email = c.app.config.options.get('TicketMonitoringEmail')
- tmpl_context['tickets'] = ({
- 'original_num': original_ticket_nums[_id],
- 'destination_num': moved_tickets[_id].ticket_num,
- 'summary': moved_tickets[_id].summary
- } for _id in moved_tickets.keys())
- mail.update(dict(
- message_id = h.gen_message_id(),
- text = tmpl.render(tmpl_context),
- destinations = [monitoring_email]))
- mail_tasks.sendmail.post(**mail)
+ tracker_task.move_tickets.post(ticket_ids, destination_tracker_id)
c.app.globals.invalidate_bin_counts()
ThreadLocalORMSession.flush_all()
@@ -948,7 +900,7 @@ class RootController(BaseController, FeedController):
ticket.discussion_thread.post(message, notify=False)
ticket.commit()
- filtered_changes = filtered_by_subscription(changed_tickets)
+ filtered_changes = c.app.globals.filtered_by_subscription(changed_tickets)
users = M.User.query.find({'_id': {'$in': filtered_changes.keys()}}).all()
def changes_iter(user):
for t_id in filtered_changes.get(user._id, []):
@@ -1312,31 +1264,6 @@ class changelog(object):
t.append((key, (orig_value, curr_value)))
return t
-
-def filtered_by_subscription(tickets, project_id=None, app_config_id=None):
- p_id = project_id if project_id else c.project._id
- ac_id = app_config_id if app_config_id else c.app.config._id
- ticket_ids = tickets.keys()
- users = M.Mailbox.query.find(dict(project_id=p_id, app_config_id=ac_id))
- users = [u.user_id for u in users]
- filtered = {}
- for uid in users:
- params = dict(
- user_id=uid,
- project_id=p_id,
- app_config_id=ac_id)
- if M.Mailbox.subscribed(**params):
- filtered[uid] = set(ticket_ids) # subscribed to entire tool, will see all changes
- continue
- for t_id, ticket in tickets.iteritems():
- params.update({'artifact': ticket})
- if M.Mailbox.subscribed(**params):
- if filtered.get(uid) is None:
- filtered[uid] = set()
- filtered[uid].add(t_id)
- return filtered
-
-
class TicketController(BaseController, FeedController):
def __init__(self, ticket_num=None):
[03/50] git commit: [#6046] ticket:318 fixed symbolic refs for
snapshots
Posted by jo...@apache.org.
[#6046] ticket:318 fixed symbolic refs for snapshots
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/59f58678
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/59f58678
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/59f58678
Branch: refs/heads/cj/5913
Commit: 59f586781700b416441968164337488d7e6866b8
Parents: 79642a3
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Wed Apr 24 13:41:21 2013 +0400
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu May 23 01:18:17 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 10 ++++++----
Allura/allura/templates/repo/tree.html | 4 ++--
.../forgegit/tests/functional/test_controllers.py | 5 ++++-
3 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/59f58678/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 6c8cc7d..8ccd36d 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -454,16 +454,18 @@ class CommitBrowser(BaseController):
def tarball(self, **kw):
if not asbool(tg.config.get('scm.repos.tarball.enable', False)):
raise exc.HTTPNotFound()
- status = c.app.repo.get_tarball_status(self._revision)
+ rev = self._commit.url().split('/')[-2]
+ status = c.app.repo.get_tarball_status(rev)
if status is None:
- allura.tasks.repo_tasks.tarball.post(revision=self._revision)
- return dict(commit=self._commit, revision=self._revision, status=status)
+ allura.tasks.repo_tasks.tarball.post(revision=rev)
+ return dict(commit=self._commit, revision=rev, status=status)
@expose('json:')
def tarball_status(self):
if not asbool(tg.config.get('scm.repos.tarball.enable', False)):
raise exc.HTTPNotFound()
- return dict(status=c.app.repo.get_tarball_status(self._revision))
+ rev = self._commit.url().split('/')[-2]
+ return dict(status=c.app.repo.get_tarball_status(rev))
@expose('jinja:allura:templates/repo/log.html')
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/59f58678/Allura/allura/templates/repo/tree.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/tree.html b/Allura/allura/templates/repo/tree.html
index e1e6e86..51b22f8 100644
--- a/Allura/allura/templates/repo/tree.html
+++ b/Allura/allura/templates/repo/tree.html
@@ -31,8 +31,8 @@ Tree <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(co
{% block actions %}
{% if tarball_enable %}
-<a href="{{commit.url()}}tarball" rel="nofollow">
- <b data-icon="{{g.icons.folder.char}}" class="ico {{g.icons.folder.css}}" title="Snapshot"> </b> Download Snapshot
+ <a href="{{request.path[:-5]}}tarball" rel="nofollow">
+ <b data-icon="{{g.icons.folder.char}}" class="ico {{g.icons.folder.css}}" title="Snapshot"> </b> Download Snapshot
</a>
{% endif %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/59f58678/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 0552f8a..0d253e1 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -336,13 +336,16 @@ class TestRootController(_TestCase):
def test_tarball(self):
ci = self._get_ci()
r = self.app.get(ci + 'tree/')
+ assert '/p/test/src-git/ci/master/tarball' in r
assert 'Download Snapshot' in r
- r = self.app.get(ci + 'tarball')
+ r = self.app.get('/p/test/src-git/ci/master/tarball')
assert 'Generating snapshot...' in r
M.MonQTask.run_ready()
ThreadLocalORMSession.flush_all()
r = self.app.get(ci + 'tarball_status')
assert '{"status": "ready"}' in r
+ r = self.app.get('/p/test/src-git/ci/master/tarball_status')
+ assert '{"status": "ready"}' in r
class TestRestController(_TestCase):
[12/50] git commit: [#6208] Bumped Ming version for background
reindexes
Posted by jo...@apache.org.
[#6208] Bumped Ming version for background reindexes
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/621931fa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/621931fa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/621931fa
Branch: refs/heads/cj/5913
Commit: 621931faa2b7cecb576ebe543d33112876f66780
Parents: 338d69c
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed May 22 20:49:15 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu May 23 16:05:28 2013 +0000
----------------------------------------------------------------------
requirements-common.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/621931fa/requirements-common.txt
----------------------------------------------------------------------
diff --git a/requirements-common.txt b/requirements-common.txt
index 21ea929..2b5f8b5 100644
--- a/requirements-common.txt
+++ b/requirements-common.txt
@@ -22,7 +22,7 @@ iso8601==0.1.4
Jinja2==2.6
Markdown==2.2.0
mercurial==1.4.3
-Ming==0.3.3dev-20130322
+Ming==0.3.5dev-20130522
oauth2==1.5.170
# tg2 dep PasteDeploy must specified before TurboGears2, to avoid a version/allow-hosts problem
Paste==1.7.5.1
[37/50] git commit: [#5656] ticket:353 changed flash message and
subject
Posted by jo...@apache.org.
[#5656] ticket:353 changed flash message and subject
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/6c1eeccf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6c1eeccf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6c1eeccf
Branch: refs/heads/cj/5913
Commit: 6c1eeccf177a521187cd060cf317e515eb86f732
Parents: 224499a
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Mon May 20 14:53:02 2013 +0400
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:42:27 2013 +0000
----------------------------------------------------------------------
ForgeTracker/forgetracker/model/ticket.py | 2 +-
.../forgetracker/tests/functional/test_root.py | 4 ++--
ForgeTracker/forgetracker/tracker_main.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6c1eeccf/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 3a6803d..80a8eb2 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -242,7 +242,7 @@ class Globals(MappedClass):
mail = dict(
fromaddr = str(c.user.email_address_header()),
reply_to = str(c.user.email_address_header()),
- subject = '%s:%s Mass ticket moving by %s' % (c.project.shortname,
+ subject = '[%s:%s] Mass ticket moving by %s' % (c.project.shortname,
c.app.config.options.mount_point,
c.user.display_name))
tmpl = g.jinja2_env.get_template('forgetracker:data/mass_move_report.html')
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6c1eeccf/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 37b3399..0d129a3 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -2321,7 +2321,7 @@ class TestBulkMove(TrackerTestController):
emails = M.MonQTask.query.find(dict(task_name='allura.tasks.mail_tasks.sendmail')).all()
assert_equal(len(emails), 3)
for email in emails:
- assert_equal(email.kwargs.subject, 'test:bugs Mass ticket moving by Test Admin')
+ assert_equal(email.kwargs.subject, '[test:bugs] Mass ticket moving by Test Admin')
first_user_email = M.MonQTask.query.find({
'task_name': 'allura.tasks.mail_tasks.sendmail',
'kwargs.destinations': str(first_user._id)
@@ -2376,7 +2376,7 @@ class TestBulkMove(TrackerTestController):
emails = M.MonQTask.query.find(dict(task_name='allura.tasks.mail_tasks.sendmail')).all()
assert_equal(len(emails), 2)
for email in emails:
- assert_equal(email.kwargs.subject, 'test:bugs Mass ticket moving by Test Admin')
+ assert_equal(email.kwargs.subject, '[test:bugs] Mass ticket moving by Test Admin')
admin_email = M.MonQTask.query.find({
'task_name': 'allura.tasks.mail_tasks.sendmail',
'kwargs.destinations': str(M.User.by_username('test-admin')._id)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6c1eeccf/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 62469a9..1534f55 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -829,7 +829,7 @@ class RootController(BaseController, FeedController):
c.app.globals.invalidate_bin_counts()
ThreadLocalORMSession.flush_all()
count = len(tickets)
- flash('Moved {} ticket{}'.format(count, 's' if count != 1 else ''), 'ok')
+ flash('Move scheduled ({} ticket{})'.format(count, 's' if count != 1 else ''), 'ok')
redirect('move/' + search)
@expose()
[31/50] git commit: [#5656] ticket:301 Change mass-edit.js to process
move form also
Posted by jo...@apache.org.
[#5656] ticket:301 Change mass-edit.js to process move form also
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/75adfcc0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/75adfcc0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/75adfcc0
Branch: refs/heads/cj/5913
Commit: 75adfcc0785a592ce4ced6dba8c66c4421283e87
Parents: ffb9e7f
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed May 1 09:16:50 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:35:51 2013 +0000
----------------------------------------------------------------------
.../forgetracker/templates/tracker/mass_move.html | 1 +
.../forgetracker/widgets/resources/js/mass-edit.js | 13 ++++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/75adfcc0/ForgeTracker/forgetracker/templates/tracker/mass_move.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/mass_move.html b/ForgeTracker/forgetracker/templates/tracker/mass_move.html
index 1953801..ac5c515 100644
--- a/ForgeTracker/forgetracker/templates/tracker/mass_move.html
+++ b/ForgeTracker/forgetracker/templates/tracker/mass_move.html
@@ -25,6 +25,7 @@
{% block edit_box %}
<div class="editbox">
{{c.mass_move_form.display()}}
+ <div id="result" style="clear:both;"></div>
</div>
{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/75adfcc0/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js b/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
index 90a037e..83736c9 100644
--- a/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
+++ b/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
@@ -18,6 +18,13 @@
*/
$(function(){
+ $form = $('#update-values')
+ if ($form.length == 0) {
+ $form = $('.editbox > form');
+ }
+ if ($('#id_search').length == 0) {
+ $form.append('<input type="hidden" name="__search" id="id_search">');
+ }
$('#id_search').val(window.location.search);
$('#assigned_to').val('');
$('#select_all').click(function(){
@@ -28,16 +35,16 @@ $(function(){
$('tbody.ticket-list input[type=checkbox]').removeAttr('checked');
}
});
- $('#update-values').submit(function(){
+ $form.submit(function(){
var $checked=$('tbody.ticket-list input:checked'), count=$checked.length;
if ( !count ) {
- $('#result').text('No tickets selected for update.');
+ $('#result').text('No tickets selected.');
return false;
}
$checked.each(function() {
- $('#update-values').append('<input type="hidden" name="__ticket_ids" value="'+$(this).val()+'"/>');
+ $form.append('<input type="hidden" name="__ticket_ids" value="'+$(this).val()+'"/>');
});
});
});
[13/50] git commit: [#6208] add unique index to wiki
app_config_id+title
Posted by jo...@apache.org.
[#6208] add unique index to wiki app_config_id+title
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/338d69c9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/338d69c9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/338d69c9
Branch: refs/heads/cj/5913
Commit: 338d69c935490e7fd2ca4acb57e4489796509626
Parents: 65009be
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon May 13 16:23:13 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu May 23 16:05:28 2013 +0000
----------------------------------------------------------------------
ForgeWiki/forgewiki/model/wiki.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/338d69c9/ForgeWiki/forgewiki/model/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/model/wiki.py b/ForgeWiki/forgewiki/model/wiki.py
index 6f054a1..0321240 100644
--- a/ForgeWiki/forgewiki/model/wiki.py
+++ b/ForgeWiki/forgewiki/model/wiki.py
@@ -87,6 +87,7 @@ class Page(VersionedArtifact, ActivityObject):
class __mongometa__:
name='page'
history_class = PageHistory
+ unique_indexes = [('app_config_id', 'title')]
title=FieldProperty(str)
text=FieldProperty(schema.String, if_missing='')
[39/50] git commit: [#5656] ticket:358 Move move_tickets task to
ForgeTracker
Posted by jo...@apache.org.
[#5656] ticket:358 Move move_tickets task to ForgeTracker
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/5198a838
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/5198a838
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/5198a838
Branch: refs/heads/cj/5913
Commit: 5198a838d7895d41b3422b2a3526ce103512dbe8
Parents: 250337d
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 23 13:29:17 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:42:27 2013 +0000
----------------------------------------------------------------------
Allura/allura/tasks/tracker_task.py | 25 ------------------------
ForgeTracker/forgetracker/tasks.py | 5 ++++
ForgeTracker/forgetracker/tracker_main.py | 5 ++-
3 files changed, 8 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5198a838/Allura/allura/tasks/tracker_task.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/tracker_task.py b/Allura/allura/tasks/tracker_task.py
deleted file mode 100644
index 0a37850..0000000
--- a/Allura/allura/tasks/tracker_task.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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.
-
-
-from allura.lib.decorators import task
-from pylons import tmpl_context as c
-
-
-@task
-def move_tickets(ticket_ids, destination_tracker_id):
- c.app.globals.move_tickets(ticket_ids, destination_tracker_id)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5198a838/ForgeTracker/forgetracker/tasks.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tasks.py b/ForgeTracker/forgetracker/tasks.py
index fa0b7bc..6cbd42d 100644
--- a/ForgeTracker/forgetracker/tasks.py
+++ b/ForgeTracker/forgetracker/tasks.py
@@ -32,3 +32,8 @@ def update_bin_counts(app_config_id):
app = app_config.project.app_instance(app_config)
with h.push_config(c, app=app):
app.globals.update_bin_counts()
+
+
+@task
+def move_tickets(ticket_ids, destination_tracker_id):
+ c.app.globals.move_tickets(ticket_ids, destination_tracker_id)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5198a838/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 1534f55..7fbbe9c 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -62,11 +62,12 @@ from allura.controllers import AppDiscussionController, AppDiscussionRestControl
from allura.controllers import attachments as ac
from allura.controllers import BaseController
from allura.controllers.feed import FeedArgs, FeedController
-from allura.tasks import mail_tasks, tracker_task
+from allura.tasks import mail_tasks
# Local imports
from forgetracker import model as TM
from forgetracker import version
+from forgetracker import tasks
from forgetracker.widgets.admin import OptionsAdmin
from forgetracker.widgets.ticket_form import TicketForm, TicketCustomField
@@ -824,7 +825,7 @@ class RootController(BaseController, FeedController):
_id={'$in': [ObjectId(id) for id in ticket_ids]},
app_config_id=c.app.config._id)).all()
- tracker_task.move_tickets.post(ticket_ids, destination_tracker_id)
+ tasks.move_tickets.post(ticket_ids, destination_tracker_id)
c.app.globals.invalidate_bin_counts()
ThreadLocalORMSession.flush_all()
[30/50] git commit: [#5656] ticket:301 Tests for bulk move
Posted by jo...@apache.org.
[#5656] ticket:301 Tests for bulk move
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/a087f64a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a087f64a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a087f64a
Branch: refs/heads/cj/5913
Commit: a087f64a3f786cbd092c8b6e1321f26e28ac7d04
Parents: d1fc56e
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed May 1 08:04:41 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:35:51 2013 +0000
----------------------------------------------------------------------
.../forgetracker/tests/functional/test_root.py | 67 +++++++++++++++
1 files changed, 67 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a087f64a/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 84b63e5..7015cd4 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -2225,6 +2225,73 @@ class test_show_default_fields(TrackerTestController):
assert '<td>Labels</td> <td><input type="checkbox" name="labels" ></td>' in r
+class TestBulkMove(TrackerTestController):
+
+ def setUp(self):
+ super(TestBulkMove, self).setUp()
+ self.new_ticket(summary='A New Hope')
+ self.new_ticket(summary='The Empire Strikes Back')
+ self.new_ticket(summary='Return Of The Jedi')
+ M.MonQTask.run_ready()
+
+ def test_access_restriction(self):
+ self.app.get('/bugs/move/', status=200)
+ self.app.get('/bugs/move/', extra_environ={'username': 'test-user-0'},
+ status=403)
+ self.app.get('/bugs/move/', extra_environ={'username': '*anonymous'},
+ status=302)
+
+ def test_ticket_list(self):
+ r = self.app.get('/bugs/move/?q=The')
+ tickets_table = r.html.find('tbody', attrs={'class': 'ticket-list'})
+ tickets = tickets_table.findAll('tr')
+ assert_equal(len(tickets), 2)
+ assert_in('The Empire Strikes Back', tickets_table.text)
+ assert_in('Return Of The Jedi', tickets_table.text)
+
+ @td.with_tool('test', 'Tickets', 'bugs2')
+ @td.with_tool('test2', 'Tickets', 'bugs')
+ @td.with_tool('test2', 'Tickets', 'bugs2')
+ def test_controls_present(self):
+ r = self.app.get('/bugs/move/')
+ trackers = r.html.find('select', {'name': 'tracker'}).findAll('option')
+ trackers = set([t.text for t in trackers])
+ expected = set(['test/bugs', 'test/bugs2', 'test2/bugs', 'test2/bugs2'])
+ assert_equal(trackers, expected)
+ move_btn = r.html.find('input', attrs={'type': 'submit', 'value': 'Move'})
+ assert move_btn is not None
+
+ @td.with_tool('test2', 'Tickets', 'bugs')
+ def test_move(self):
+ tickets = [
+ tm.Ticket.query.find({'summary': 'The Empire Strikes Back'}).first(),
+ tm.Ticket.query.find({'summary': 'Return Of The Jedi'}).first()]
+ p = M.Project.query.get(shortname='test2')
+ original_p = M.Project.query.get(shortname='test')
+ tracker = p.app_instance('bugs')
+ original_tracker = original_p.app_instance('bugs')
+ r = self.app.post('/p/test/bugs/move_tickets', {
+ 'tracker': str(tracker.config._id),
+ '__ticket_ids': [t._id for t in tickets],
+ '__search': '',
+ })
+ ac_id = tracker.config._id
+ original_ac_id = original_tracker.config._id
+ moved_tickets = tm.Ticket.query.find({'app_config_id': ac_id}).all()
+ original_tickets = tm.Ticket.query.find({'app_config_id': original_ac_id}).all()
+ assert_equal(len(moved_tickets), 2)
+ assert_equal(len(original_tickets), 1)
+ for ticket in moved_tickets:
+ assert_equal(ticket.discussion_thread.app_config_id, ac_id)
+ assert_equal(ticket.discussion_thread.discussion.app_config_id, ac_id)
+ post = ticket.discussion_thread.last_post
+ assert_equal(post.text, 'Ticket moved from /p/test/bugs/1/')
+ for t in original_tickets:
+ assert_equal(t.discussion_thread.app_config_id, original_ac_id)
+ assert_equal(t.discussion_thread.discussion.app_config_id, original_ac_id)
+ assert t.discussion_thread.last_post is None
+
+
def sidebar_contains(response, text):
sidebar_menu = response.html.find('div', attrs={'id': 'sidebar'})
return text in str(sidebar_menu)
[35/50] git commit: [#5656] ticket:301 Fix missing semicolon in js
Posted by jo...@apache.org.
[#5656] ticket:301 Fix missing semicolon in js
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f7e873b5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f7e873b5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f7e873b5
Branch: refs/heads/cj/5913
Commit: f7e873b5addccfaa4577d58400a1d97e92b760d5
Parents: a770cdf
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed May 1 12:05:25 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:35:52 2013 +0000
----------------------------------------------------------------------
.../forgetracker/widgets/resources/js/mass-edit.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f7e873b5/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js b/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
index 83736c9..798473d 100644
--- a/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
+++ b/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
@@ -18,7 +18,7 @@
*/
$(function(){
- $form = $('#update-values')
+ $form = $('#update-values');
if ($form.length == 0) {
$form = $('.editbox > form');
}
[43/50] git commit: [#5913] Don't link entire project header
Posted by jo...@apache.org.
[#5913] Don't link entire project header
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/cfa200b4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/cfa200b4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/cfa200b4
Branch: refs/heads/cj/5913
Commit: cfa200b4bcf2647ec724da39f03a6b337057cd30
Parents: de2f428
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue May 21 19:53:17 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue May 28 15:54:57 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/jinja_master/nav_menu.html | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cfa200b4/Allura/allura/templates/jinja_master/nav_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/nav_menu.html b/Allura/allura/templates/jinja_master/nav_menu.html
index 67c44ab..15f7fac 100644
--- a/Allura/allura/templates/jinja_master/nav_menu.html
+++ b/Allura/allura/templates/jinja_master/nav_menu.html
@@ -35,21 +35,17 @@
{% endif %}
</div>
{% endif %}
- <a href="{{c.project.url()}}" class="project_link">
{% if c.project.user_project_of %}
{{lib.gravatar(c.project.user_project_of, size=48, className='project_icon')}}
{% elif c.project.icon %}
<img src="{{c.project.url()}}/icon?{{c.project.icon._id.generation_time}}" class="project_icon" alt="Project Logo">
{% endif %}
- <h1 class="project_title">
- {% if c.project.is_nbhd_project %}
- {{c.project.neighborhood.name}}
- {% else %}
- {{c.project.name}}
- {% endif %}
- </h1>
+ <h1 class="project_title">
+ <a href="{{c.project.url()}}" class="project_link">{{ c.project.neighborhood.name if c.project.is_nbhd_project else c.project.name }}</a>
+ </h1>
+ <h2>
{{c.project.summary}}
- </a>
+ </h2>
<div class="brought-by{% if c.project.icon %} with-icon{% endif %}">
Brought to you by:
{% set admins = c.project.admins()|sort(attribute='username') %}
[04/50] git commit: [#6256] use TMPDIR instead of /tmp everywhere
Posted by jo...@apache.org.
[#6256] use TMPDIR instead of /tmp everywhere
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/760cf5ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/760cf5ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/760cf5ee
Branch: refs/heads/cj/5913
Commit: 760cf5ee15f4894fcc98db8a9dce0bda03cd3468
Parents: 6e53ab0
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon May 20 14:21:58 2013 -0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 04:20:01 2013 +0000
----------------------------------------------------------------------
Allura/allura/lib/app_globals.py | 3 +
ForgeGit/forgegit/tests/model/test_repository.py | 66 ++++++++-------
ForgeSVN/forgesvn/model/svn.py | 2 +-
ForgeSVN/forgesvn/tests/model/test_repository.py | 33 ++++----
.../forgesvn/tests/model/test_svnimplementation.py | 9 +-
ForgeSVN/forgesvn/tests/test_tasks.py | 8 +-
ForgeWiki/forgewiki/tests/test_wiki2markdown.py | 25 +++---
7 files changed, 80 insertions(+), 66 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/760cf5ee/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index b030d6f..43493ae 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -27,6 +27,7 @@ import json
import datetime
from urllib import urlencode
from subprocess import Popen, PIPE
+import os
import activitystream
import pkg_resources
@@ -209,6 +210,8 @@ class Globals(object):
statslisteners.append(ep())
self.statsUpdater = PostEvent(statslisteners)
+ self.tmpdir = os.getenv('TMPDIR', '/tmp')
+
@LazyProperty
def spam_checker(self):
"""Return a SpamFilter implementation.
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/760cf5ee/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 795e4e3..1e472b3 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -137,7 +137,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
def test_init(self):
repo = GM.Repository(
name='testgit.git',
- fs_path='/tmp/',
+ fs_path=g.tmpdir+'/',
url_path = '/test/',
tool = 'git',
status = 'creating')
@@ -150,7 +150,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
def test_fork(self):
repo = GM.Repository(
name='testgit.git',
- fs_path='/tmp/',
+ fs_path=g.tmpdir + '/',
url_path = '/test/',
tool = 'git',
status = 'creating')
@@ -161,16 +161,16 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
shutil.rmtree(dirname)
repo.init()
repo._impl.clone_from(repo_path)
- assert not os.path.exists('/tmp/testgit.git/hooks/update')
- assert not os.path.exists('/tmp/testgit.git/hooks/post-receive-user')
- assert os.path.exists('/tmp/testgit.git/hooks/post-receive')
- assert os.stat('/tmp/testgit.git/hooks/post-receive')[0] & stat.S_IXUSR
+ assert not os.path.exists(os.path.join(g.tmpdir, 'testgit.git/hooks/update'))
+ assert not os.path.exists(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive-user'))
+ assert os.path.exists(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive'))
+ assert os.stat(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive'))[0] & stat.S_IXUSR
@mock.patch('forgegit.model.git_repo.g.post_event')
def test_clone(self, post_event):
repo = GM.Repository(
name='testgit.git',
- fs_path='/tmp/',
+ fs_path=g.tmpdir + '/',
url_path = '/test/',
tool = 'git',
status = 'creating')
@@ -182,11 +182,11 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
repo.init()
repo._impl.clone_from(repo_path)
assert len(repo.log())
- assert not os.path.exists('/tmp/testgit.git/hooks/update')
- assert not os.path.exists('/tmp/testgit.git/hooks/post-receive-user')
- assert os.path.exists('/tmp/testgit.git/hooks/post-receive')
- assert os.stat('/tmp/testgit.git/hooks/post-receive')[0] & stat.S_IXUSR
- with open('/tmp/testgit.git/hooks/post-receive') as f: c = f.read()
+ assert not os.path.exists(os.path.join(g.tmpdir, 'testgit.git/hooks/update'))
+ assert not os.path.exists(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive-user'))
+ assert os.path.exists(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive'))
+ assert os.stat(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive'))[0] & stat.S_IXUSR
+ with open(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive')) as f: c = f.read()
self.assertIn('curl -s http://localhost//auth/refresh_repo/p/test/src-git/\n', c)
self.assertIn('exec $DIR/post-receive-user\n', c)
shutil.rmtree(dirname)
@@ -197,7 +197,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
with h.push_config(tg.config, **{'scm.git.hotcopy': 'True'}):
repo = GM.Repository(
name='testgit.git',
- fs_path='/tmp/',
+ fs_path=g.tmpdir+'/',
url_path = '/test/',
tool = 'git',
status = 'creating')
@@ -211,11 +211,11 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
repo._impl.clone_from(repo_path)
assert not clone_from.called
assert len(repo.log())
- assert os.path.exists('/tmp/testgit.git/hooks/update')
- assert os.path.exists('/tmp/testgit.git/hooks/post-receive-user')
- assert os.path.exists('/tmp/testgit.git/hooks/post-receive')
- assert os.stat('/tmp/testgit.git/hooks/post-receive')[0] & stat.S_IXUSR
- with open('/tmp/testgit.git/hooks/post-receive') as f: c = f.read()
+ assert os.path.exists(os.path.join(g.tmpdir, 'testgit.git/hooks/update'))
+ assert os.path.exists(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive-user'))
+ assert os.path.exists(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive'))
+ assert os.stat(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive'))[0] & stat.S_IXUSR
+ with open(os.path.join(g.tmpdir, 'testgit.git/hooks/post-receive')) as f: c = f.read()
self.assertIn('curl -s http://localhost//auth/refresh_repo/p/test/src-git/\n', c)
self.assertIn('exec $DIR/post-receive-user\n', c)
shutil.rmtree(dirname)
@@ -259,12 +259,13 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
self.assertEqual(new_tree.other_ids, orig_tree.other_ids)
def test_tarball(self):
- if os.path.isfile("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.zip"):
- os.remove("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.zip")
- assert_equal(self.repo.tarball_path, '/tmp/tarball/git/t/te/test/testgit.git')
+ tmpdir = tg.config['scm.repos.tarball.root']
+ if os.path.isfile(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.zip")):
+ os.remove(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.zip"))
+ assert_equal(self.repo.tarball_path, os.path.join(tmpdir, 'git/t/te/test/testgit.git'))
assert_equal(self.repo.tarball_url('HEAD'), 'file:///git/t/te/test/testgit.git/test-src-git-HEAD.zip')
self.repo.tarball('HEAD')
- assert os.path.isfile("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.zip")
+ assert os.path.isfile(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.zip"))
def test_all_commit_ids(self):
cids = list(self.repo.all_commit_ids())
@@ -293,20 +294,21 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'name': u'README'}])
def test_tarball_status(self):
- if os.path.isfile("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.zip"):
- os.remove("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.zip")
- if os.path.isfile("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.tmp"):
- os.remove("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.tmp")
- if os.path.isdir("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD/"):
- os.removedirs("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD/")
+ tmpdir = tg.config['scm.repos.tarball.root']
+ if os.path.isfile(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.zip")):
+ os.remove(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.zip"))
+ if os.path.isfile(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.tmp")):
+ os.remove(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.tmp"))
+ if os.path.isdir(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD/")):
+ os.removedirs(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD/"))
self.repo.tarball('HEAD')
assert_equal(self.repo.get_tarball_status('HEAD'), 'ready')
- os.rename("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.zip",
- "/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.tmp")
+ os.rename(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.zip"),
+ os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.tmp"))
assert_equal(self.repo.get_tarball_status('HEAD'), 'busy')
- os.remove("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD.tmp")
+ os.remove(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.tmp"))
assert_equal(self.repo.get_tarball_status('HEAD'), None)
- os.makedirs("/tmp/tarball/git/t/te/test/testgit.git/test-src-git-HEAD")
+ os.makedirs(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD"))
assert_equal(self.repo.get_tarball_status('HEAD'), None)
def test_is_empty(self):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/760cf5ee/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index bc4da97..2189a7f 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -204,7 +204,7 @@ class SVNImplementation(M.RepositoryImplementation):
# make first commit with dir structure
if default_dirs:
tmp_working_dir = tempfile.mkdtemp(prefix='allura-svn-r1-',
- dir=tg.config.get('scm.svn.tmpdir', '/tmp'))
+ dir=tg.config.get('scm.svn.tmpdir', g.tmpdir))
log.info('tmp dir = %s', tmp_working_dir)
self._repo._impl._svn.checkout('file://'+fullname, tmp_working_dir)
os.mkdir(tmp_working_dir+'/trunk')
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/760cf5ee/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index fa4feb0..288a1b9 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -24,7 +24,7 @@ from datetime import datetime
from zipfile import ZipFile
from collections import defaultdict
-from pylons import tmpl_context as c
+from pylons import tmpl_context as c, app_globals as g
import mock
from nose.tools import assert_equal
import tg
@@ -127,7 +127,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
def test_init(self):
repo = SM.Repository(
name='testsvn',
- fs_path='/tmp/',
+ fs_path=g.tmpdir+'/',
url_path = '/test/',
tool = 'svn',
status = 'creating')
@@ -140,7 +140,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
def test_fork(self):
repo = SM.Repository(
name='testsvn',
- fs_path='/tmp/',
+ fs_path=g.tmpdir+'/',
url_path = '/test/',
tool = 'svn',
status = 'creating')
@@ -151,10 +151,11 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
shutil.rmtree(dirname)
repo.init()
repo._impl.clone_from('file://' + repo_path)
- assert not os.path.exists('/tmp/testsvn/hooks/pre-revprop-change')
- assert os.path.exists('/tmp/testsvn/hooks/post-commit')
- assert os.access('/tmp/testsvn/hooks/post-commit', os.X_OK)
- with open('/tmp/testsvn/hooks/post-commit') as f: c = f.read()
+ assert not os.path.exists(os.path.join(g.tmpdir, 'testsvn/hooks/pre-revprop-change'))
+ assert os.path.exists(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'))
+ assert os.access(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'), os.X_OK)
+ with open(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit')) as f:
+ c = f.read()
self.assertIn('curl -s http://localhost//auth/refresh_repo/p/test/src/\n', c)
self.assertIn('exec $DIR/post-commit-user "$@"\n', c)
@@ -186,7 +187,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
def test_clone(self, post_event):
repo = SM.Repository(
name='testsvn',
- fs_path='/tmp/',
+ fs_path=g.tmpdir+'/',
url_path = '/test/',
tool = 'svn',
status = 'creating')
@@ -197,10 +198,11 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
shutil.rmtree(dirname)
repo.init()
repo._impl.clone_from('file://' + repo_path)
- assert not os.path.exists('/tmp/testsvn/hooks/pre-revprop-change')
- assert os.path.exists('/tmp/testsvn/hooks/post-commit')
- assert os.access('/tmp/testsvn/hooks/post-commit', os.X_OK)
- with open('/tmp/testsvn/hooks/post-commit') as f: c = f.read()
+ assert not os.path.exists(os.path.join(g.tmpdir, 'testsvn/hooks/pre-revprop-change'))
+ assert os.path.exists(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'))
+ assert os.access(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'), os.X_OK)
+ with open(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit')) as f:
+ c = f.read()
self.assertIn('curl -s http://localhost//auth/refresh_repo/p/test/src/\n', c)
self.assertIn('exec $DIR/post-commit-user "$@"\n', c)
@@ -291,11 +293,12 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
@onlyif(os.path.exists(tg.config.get('scm.repos.tarball.zip_binary', '/usr/bin/zip')), 'zip binary is missing')
def test_tarball(self):
- assert_equal(self.repo.tarball_path, '/tmp/tarball/svn/t/te/test/testsvn')
+ tmpdir = tg.config['scm.repos.tarball.root']
+ assert_equal(self.repo.tarball_path, os.path.join(tmpdir, 'svn/t/te/test/testsvn'))
assert_equal(self.repo.tarball_url('1'), 'file:///svn/t/te/test/testsvn/test-src-1.zip')
self.repo.tarball('1')
- assert os.path.isfile("/tmp/tarball/svn/t/te/test/testsvn/test-src-1.zip")
- tarball_zip = ZipFile('/tmp/tarball/svn/t/te/test/testsvn/test-src-1.zip', 'r')
+ assert os.path.isfile(os.path.join(tmpdir, "svn/t/te/test/testsvn/test-src-1.zip"))
+ tarball_zip = ZipFile(os.path.join(tmpdir, 'svn/t/te/test/testsvn/test-src-1.zip'), 'r')
assert_equal(tarball_zip.namelist(), ['test-src-1/', 'test-src-1/README'])
def test_is_empty(self):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/760cf5ee/ForgeSVN/forgesvn/tests/model/test_svnimplementation.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_svnimplementation.py b/ForgeSVN/forgesvn/tests/model/test_svnimplementation.py
index 5a4b484..9b78c0c 100644
--- a/ForgeSVN/forgesvn/tests/model/test_svnimplementation.py
+++ b/ForgeSVN/forgesvn/tests/model/test_svnimplementation.py
@@ -18,6 +18,7 @@
from mock import Mock, MagicMock, patch
import pysvn
from nose.tools import assert_equal
+from pylons import app_globals as g
from allura.model.repo import Commit
from forgesvn.model.svn import Repository, SVNImplementation
@@ -36,7 +37,7 @@ class TestSVNImplementation(object):
@patch('allura.model.repo.Tree.upsert')
@patch('allura.model.repo.Tree.query.get')
def _test_compute_tree_new(self, path, tree_get, tree_upsert, treesdoc_partial, lcd_partial):
- repo = Mock(fs_path='/tmp/')
+ repo = Mock(fs_path=g.tmpdir+'/')
repo.name = 'code'
impl = SVNImplementation(repo)
impl._svn.info2 = Mock()
@@ -48,7 +49,7 @@ class TestSVNImplementation(object):
tree_id = impl.compute_tree_new(commit, path)
- assert_equal(impl._svn.info2.call_args[0][0], 'file:///tmp/code/trunk/foo')
+ assert_equal(impl._svn.info2.call_args[0][0], 'file://'+g.tmpdir+'/code/trunk/foo')
treesdoc_partial.assert_called()
lcd_partial.assert_called()
@@ -60,7 +61,7 @@ class TestSVNImplementation(object):
self._test_last_commit_ids('trunk/foo')
def _test_last_commit_ids(self, path):
- repo = Mock(fs_path='/tmp/')
+ repo = Mock(fs_path=g.tmpdir+'/')
repo.name = 'code'
repo._id = '5057636b9c1040636b81e4b1'
impl = SVNImplementation(repo)
@@ -72,4 +73,4 @@ class TestSVNImplementation(object):
entries = impl.last_commit_ids(commit, [path])
assert_equal(entries, {path.strip('/'): '5057636b9c1040636b81e4b1:1'})
- assert_equal(impl._svn.info2.call_args[0][0], 'file:///tmp/code/trunk')
+ assert_equal(impl._svn.info2.call_args[0][0], 'file://'+g.tmpdir+'/code/trunk')
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/760cf5ee/ForgeSVN/forgesvn/tests/test_tasks.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/test_tasks.py b/ForgeSVN/forgesvn/tests/test_tasks.py
index 36e7912..bd2f723 100644
--- a/ForgeSVN/forgesvn/tests/test_tasks.py
+++ b/ForgeSVN/forgesvn/tests/test_tasks.py
@@ -19,10 +19,11 @@
import shutil
import unittest
+import os
import tg
import mock
-from pylons import tmpl_context as c
+from pylons import tmpl_context as c, app_globals as g
from ming.orm import ThreadLocalORMSession
from paste.deploy.converters import asbool
@@ -42,7 +43,7 @@ class TestRepoTasks(unittest.TestCase):
if asbool(tg.config.get('smtp.mock')):
self.smtp_mock = mock.patch('allura.lib.mail_util.smtplib.SMTP')
self.smtp_mock.start()
-
+
def tearDown(self):
if asbool(tg.config.get('smtp.mock')):
self.smtp_mock.stop()
@@ -75,4 +76,5 @@ class TestRepoTasks(unittest.TestCase):
def test_uninstall(self):
with mock.patch.object(shutil, 'rmtree') as f:
repo_tasks.uninstall()
- f.assert_called_with('/tmp/svn/p/test/src', ignore_errors=True)
+ f.assert_called_with(os.path.join(tg.config['scm.repos.root'], 'svn/p/test/src'),
+ ignore_errors=True)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/760cf5ee/ForgeWiki/forgewiki/tests/test_wiki2markdown.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/test_wiki2markdown.py b/ForgeWiki/forgewiki/tests/test_wiki2markdown.py
index 7442ff2..ff5c662 100644
--- a/ForgeWiki/forgewiki/tests/test_wiki2markdown.py
+++ b/ForgeWiki/forgewiki/tests/test_wiki2markdown.py
@@ -15,10 +15,13 @@
# specific language governing permissions and limitations
# under the License.
-import mock
+import os
import json
from datetime import datetime
+
+import mock
from IPython.testing.decorators import module_not_available, skipif
+from pylons import app_globals as g
from forgewiki.scripts.wiki2markdown.extractors import MySQLExtractor
from forgewiki.scripts.wiki2markdown.loaders import MediawikiLoader
@@ -35,7 +38,7 @@ class TestMySQLExtractor(object):
def setUp(self):
setup_basic_test()
self.options = mock.Mock()
- self.options.dump_dir = '/tmp/w2m_test'
+ self.options.dump_dir = os.path.join(g.tmpdir, 'w2m_test')
# monkey-patch MySQLExtractor for test
def pages(self):
@@ -85,7 +88,7 @@ class TestMySQLExtractor(object):
self.extractor.extract_pages()
# rev 1 of page 1
- with open('/tmp/w2m_test/pages/1/history/1.json', 'r') as f:
+ with open(os.path.join(self.options.dump_dir, 'pages/1/history/1.json'), 'r') as f:
page = json.load(f)
res_page = {
'timestamp': 1,
@@ -97,7 +100,7 @@ class TestMySQLExtractor(object):
assert page == res_page
# rev 2 of page 1
- with open('/tmp/w2m_test/pages/1/history/2.json', 'r') as f:
+ with open(os.path.join(self.options.dump_dir, 'pages/1/history/2.json'), 'r') as f:
page = json.load(f)
res_page = {
'timestamp': 2,
@@ -109,7 +112,7 @@ class TestMySQLExtractor(object):
assert page == res_page
# rev 1 of page 2
- with open('/tmp/w2m_test/pages/2/history/1.json', 'r') as f:
+ with open(os.path.join(self.options.dump_dir, 'pages/2/history/1.json'), 'r') as f:
page = json.load(f)
res_page = {
'timestamp': 1,
@@ -121,7 +124,7 @@ class TestMySQLExtractor(object):
assert page == res_page
# rev 2 of page 2
- with open('/tmp/w2m_test/pages/2/history/2.json', 'r') as f:
+ with open(os.path.join(self.options.dump_dir, 'pages/2/history/2.json'), 'r') as f:
page = json.load(f)
res_page = {
'timestamp': 2,
@@ -133,7 +136,7 @@ class TestMySQLExtractor(object):
assert page == res_page
# rev 1 of page 3
- with open('/tmp/w2m_test/pages/3/history/1.json', 'r') as f:
+ with open(os.path.join(self.options.dump_dir, 'pages/3/history/1.json'), 'r') as f:
page = json.load(f)
res_page = {
'timestamp': 1,
@@ -145,7 +148,7 @@ class TestMySQLExtractor(object):
assert page == res_page
# rev 2 of page 3
- with open('/tmp/w2m_test/pages/3/history/2.json', 'r') as f:
+ with open(os.path.join(self.options.dump_dir, 'pages/3/history/2.json'), 'r') as f:
page = json.load(f)
res_page = {
'timestamp': 2,
@@ -166,21 +169,21 @@ class TestMySQLExtractor(object):
for page in pages:
self.extractor.extract_talk(page)
- with open('/tmp/w2m_test/pages/1/discussion.json', 'r') as f:
+ with open(os.path.join(self.options.dump_dir, 'pages/1/discussion.json'), 'r') as f:
page = json.load(f)
assert page == {
'text': 'Talk for page Test 1.',
'username': 'test-user',
'timestamp': 1}
- with open('/tmp/w2m_test/pages/2/discussion.json', 'r') as f:
+ with open(os.path.join(self.options.dump_dir, 'pages/2/discussion.json'), 'r') as f:
page = json.load(f)
assert page == {
'text': 'Talk for page Test 2.',
'timestamp': 1,
'username': 'test-user'}
- with open('/tmp/w2m_test/pages/3/discussion.json', 'r') as f:
+ with open(os.path.join(self.options.dump_dir, 'pages/3/discussion.json'), 'r') as f:
page = json.load(f)
assert page == {
'text': 'Talk for page Test 3.',
[15/50] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-allura
Posted by jo...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-allura
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/5f7d3823
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/5f7d3823
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/5f7d3823
Branch: refs/heads/cj/5913
Commit: 5f7d38233c52e512011ab5406ae5043dc4d356d6
Parents: df1fe08 621931f
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Thu May 23 12:09:58 2013 -0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 12:09:58 2013 -0400
----------------------------------------------------------------------
Allura/allura/app.py | 14 +++
Allura/allura/ext/admin/admin_main.py | 4 +-
Allura/allura/lib/macro.py | 89 +++++++--------
Allura/allura/lib/widgets/macros.py | 22 ++++
Allura/allura/templates/macro/__init__.py | 1 +
Allura/allura/templates/macro/blog_posts.html | 10 ++
Allura/allura/templates/macro/members.html | 9 ++
.../allura/templates/macro/neighborhood_feeds.html | 10 ++
Allura/allura/templates/macro/project_admins.html | 6 +
Allura/allura/tests/functional/test_admin.py | 20 ++++
Allura/allura/tests/test_globals.py | 28 +++--
ForgeWiki/forgewiki/model/wiki.py | 1 +
requirements-common.txt | 2 +-
requirements-optional.txt | 4 +
14 files changed, 158 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
[19/50] git commit: [#6125] ticket:342 tests for git repository
commit emails
Posted by jo...@apache.org.
[#6125] ticket:342 tests for git repository commit emails
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/22cb1a01
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/22cb1a01
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/22cb1a01
Branch: refs/heads/cj/5913
Commit: 22cb1a01d3ec16253b53bad078279c43b647d797
Parents: c42a258
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Wed May 15 09:00:17 2013 +0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 19:46:06 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/tests/model/test_repository.py | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/22cb1a01/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 1e472b3..150b6e2 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -35,6 +35,7 @@ from allura.lib import helpers as h
from allura.tests import decorators as td
from allura.tests.model.test_repo import RepoImplTestBase
from allura import model as M
+from allura.model.repo_refresh import send_notifications
from forgegit import model as GM
from forgegit.tests import with_git
from forgewiki import model as WM
@@ -258,6 +259,19 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
self.assertEqual(new_tree.blob_ids, orig_tree.blob_ids)
self.assertEqual(new_tree.other_ids, orig_tree.other_ids)
+ def test_notification_email(self):
+ send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ])
+ ThreadLocalORMSession.flush_all()
+ notifications = M.Notification.query.find().sort('pubdate')
+ n = notifications.all()[2]
+ assert_equal(n.subject, '[test:src-git] Rick Copeland committed revision 1e146e67985dcd71c74de79613719bef7bddca4a: Change README')
+ assert 'master,zz: ' in n.text
+ send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a'])
+ ThreadLocalORMSession.flush_all()
+ notifications = M.Notification.query.find().sort('pubdate')
+ n = notifications.all()[3]
+ assert_equal(n.subject, '[test:src-git] 2 new commits to test Git')
+
def test_tarball(self):
tmpdir = tg.config['scm.repos.tarball.root']
if os.path.isfile(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.zip")):
[26/50] git commit: Fix venv permissions problem
Posted by jo...@apache.org.
Fix venv permissions problem
Signed-off-by: Tim Van Steenburgh <tv...@gmail.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/e375efbf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/e375efbf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/e375efbf
Branch: refs/heads/cj/5913
Commit: e375efbf59058a977f05a616909c4b6ae9479ff6
Parents: 1e9c251
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Fri May 24 12:02:49 2013 -0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri May 24 12:02:49 2013 -0400
----------------------------------------------------------------------
vagrant/allura_setup.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e375efbf/vagrant/allura_setup.sh
----------------------------------------------------------------------
diff --git a/vagrant/allura_setup.sh b/vagrant/allura_setup.sh
index 4da7f8d..d9adf6b 100755
--- a/vagrant/allura_setup.sh
+++ b/vagrant/allura_setup.sh
@@ -63,8 +63,8 @@ then
chown vagrant:vagrant /home/vagrant/.bash_profile
fi
-# Make sure vagrant user can execute venv bin scripts
-sudo chown -R vagrant:vagrant /home/vagrant/env-allura/bin/
+# Make sure vagrant user has full ownership of venv
+sudo chown -R vagrant:vagrant /home/vagrant/env-allura/
# Setup Allura python packages
cd /home/vagrant/src/allura
[24/50] git commit: [#4740] ticket:331 Preserve values in custom
fields on form errors
Posted by jo...@apache.org.
[#4740] ticket:331 Preserve values in custom fields on form errors
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/257f839d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/257f839d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/257f839d
Branch: refs/heads/cj/5913
Commit: 257f839d14305fd73ec118a8da5f99e87e23a292
Parents: 62a27c3
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 23 11:32:56 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri May 24 13:09:19 2013 +0000
----------------------------------------------------------------------
ForgeTracker/forgetracker/widgets/ticket_form.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/257f839d/ForgeTracker/forgetracker/widgets/ticket_form.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/ticket_form.py b/ForgeTracker/forgetracker/widgets/ticket_form.py
index 5e3b61b..3a00389 100644
--- a/ForgeTracker/forgetracker/widgets/ticket_form.py
+++ b/ForgeTracker/forgetracker/widgets/ticket_form.py
@@ -33,6 +33,12 @@ class TicketCustomFields(ew.CompoundField):
def __init__(self, *args, **kwargs):
super(TicketCustomFields, self).__init__(*args, **kwargs)
self._fields = None
+ self._custom_fields_values = {}
+
+ def context_for(self, field):
+ response = super(TicketCustomFields, self).context_for(field)
+ response['value'] = self._custom_fields_values.get(field.name)
+ return response
@property
def fields(self):
@@ -59,6 +65,7 @@ class GenericTicketForm(ew.SimpleForm):
if idx == 'assigned_to':
self._add_current_value_to_user_field(field, ctx.get('value'))
elif idx == 'custom_fields':
+ field._custom_fields_values = ctx.get('value') or {}
for cf in c.app.globals.custom_fields:
if cf and cf.type == 'user':
val = ctx.get('value')
[16/50] git commit: match PyMollom to capitalization used on pypi
Posted by jo...@apache.org.
match PyMollom to capitalization used on pypi
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/d412205e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d412205e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d412205e
Branch: refs/heads/cj/5913
Commit: d412205ebc6a488aba9b44561919b6614408a736
Parents: 5f7d382
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu May 23 18:53:10 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu May 23 18:53:10 2013 +0000
----------------------------------------------------------------------
requirements-optional.txt | 2 +-
requirements-sf.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d412205e/requirements-optional.txt
----------------------------------------------------------------------
diff --git a/requirements-optional.txt b/requirements-optional.txt
index 9de8406..accdc43 100644
--- a/requirements-optional.txt
+++ b/requirements-optional.txt
@@ -14,4 +14,4 @@ MySQL-python # GPL
# One or the other is required to enable spam checking
akismet==0.2.0
-pymollom==0.1 # GPL
+PyMollom==0.1 # GPL
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d412205e/requirements-sf.txt
----------------------------------------------------------------------
diff --git a/requirements-sf.txt b/requirements-sf.txt
index a506fa4..6686610 100644
--- a/requirements-sf.txt
+++ b/requirements-sf.txt
@@ -17,7 +17,7 @@ sqlalchemy-migrate==0.7.1
wsgipreload==1.2
pyzmq==2.1.7
html2text==3.200.3dev-20121112
-pymollom==0.1
+PyMollom==0.1
# use version built from https://github.com/johnsca/GitPython/commits/tv/6000
# for unmerged fixes for [#5411], [#6000], and [#6078]
[14/50] git commit: Remove old matplotlib dependencies
Posted by jo...@apache.org.
Remove old matplotlib dependencies
Signed-off-by: Tim Van Steenburgh <tv...@gmail.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/df1fe082
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/df1fe082
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/df1fe082
Branch: refs/heads/cj/5913
Commit: df1fe082a7c5d6b9ad88bc22a77f35c2e50319b7
Parents: 760cf5e
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Thu May 23 12:08:33 2013 -0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 12:08:33 2013 -0400
----------------------------------------------------------------------
vagrant/manifests/ubuntu-1204-server-amd64.pp | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/df1fe082/vagrant/manifests/ubuntu-1204-server-amd64.pp
----------------------------------------------------------------------
diff --git a/vagrant/manifests/ubuntu-1204-server-amd64.pp b/vagrant/manifests/ubuntu-1204-server-amd64.pp
index e90d374..950f2af 100644
--- a/vagrant/manifests/ubuntu-1204-server-amd64.pp
+++ b/vagrant/manifests/ubuntu-1204-server-amd64.pp
@@ -38,9 +38,7 @@ $packages = [
"libsasl2-dev",
"libjpeg8-dev",
"zlib1g-dev",
- "python-pip",
- "libfreetype6-dev",
- "libpng-dev"
+ "python-pip"
]
package { $packages:
[47/50] git commit: [#5913] Add summary and members to project header
Posted by jo...@apache.org.
[#5913] Add summary and members to project header
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/c0fd8e83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c0fd8e83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c0fd8e83
Branch: refs/heads/cj/5913
Commit: c0fd8e834b85af1c7fdc7b0c90bb82063e7a2698
Parents: 82f675f
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed May 15 21:48:34 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue May 28 15:54:57 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/jinja_master/nav_menu.html | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c0fd8e83/Allura/allura/templates/jinja_master/nav_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/nav_menu.html b/Allura/allura/templates/jinja_master/nav_menu.html
index 76648a1..1b6a8f9 100644
--- a/Allura/allura/templates/jinja_master/nav_menu.html
+++ b/Allura/allura/templates/jinja_master/nav_menu.html
@@ -35,7 +35,7 @@
{% endif %}
</div>
{% endif %}
- <a href="{{c.project.url()}}">
+ <a href="{{c.project.url()}}" class="project_link">
{% if c.project.user_project_of %}
{{lib.gravatar(c.project.user_project_of, size=48, className='project_icon')}}
{% elif c.project.icon %}
@@ -48,5 +48,16 @@
{{c.project.name}}
{% endif %}
</h1>
- </a>
+ {{c.project.summary}}
+ </a>
+ <div class="brought-by{% if c.project.icon %} with-icon{% endif %}">
+ Brought to you by:
+ {% set users = c.project.users()|sort(attribute='display_name') %}
+ {% for user in users[:4] %}
+ <a href="{{ user.url() }}">{{ user.username }}</a>{{ ',' if not loop.last }}
+ {%- endfor -%}
+ {% if users|length > 4 -%}
+ , and <a href="{{ c.project.url() }}_members/">{{ users|length - 4 }} others</a>
+ {% endif %}
+ </div>
{% endif %}
[18/50] git commit: ignore two MIT-licensed JS libraries
Posted by jo...@apache.org.
ignore two MIT-licensed JS libraries
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/53d8b05c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/53d8b05c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/53d8b05c
Branch: refs/heads/cj/5913
Commit: 53d8b05c2e35ef00123703e8da8f71d9c605a898
Parents: 6702bc7
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu May 23 15:44:45 2013 -0400
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu May 23 15:45:28 2013 -0400
----------------------------------------------------------------------
rat-excludes.txt | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/53d8b05c/rat-excludes.txt
----------------------------------------------------------------------
diff --git a/rat-excludes.txt b/rat-excludes.txt
index 5b3677a..49e640b 100644
--- a/rat-excludes.txt
+++ b/rat-excludes.txt
@@ -16,6 +16,7 @@ Allura/allura/lib/widgets/resources/css/autocomplete.css
Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
Allura/allura/lib/widgets/resources/js/jqfontselector.js
Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
+Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
Allura/allura/lib/widgets/resources/js/jquery.tagsinput.js
Allura/allura/lib/widgets/resources/js/jquery.textarea.js
Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
@@ -27,6 +28,7 @@ Allura/allura/public/nf/js/jquery.daterangepicker.js
Allura/allura/public/nf/js/jquery.flot.js
Allura/allura/public/nf/js/jquery.maxlength.min.js
Allura/allura/public/nf/js/spin.min.js
+Allura/allura/public/nf/js/sylvester.js
Allura/allura/tests/data/genshi_hello_tmpl
Allura/allura/tests/data/test_mime/text_file.txt
Allura/run/dummy.txt
@@ -36,4 +38,3 @@ ForgeSVN/forgesvn/tests/data/testsvn/
solr_config/core0/conf/spellings.txt
solr_config/core1/conf/spellings.txt
solr_config/solr.xml
-
[25/50] git commit: [#6270] ticket:359 Change task state to error on
invalid args to paster command
Posted by jo...@apache.org.
[#6270] ticket:359 Change task state to error on invalid args to paster command
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/1e9c2510
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/1e9c2510
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/1e9c2510
Branch: refs/heads/cj/5913
Commit: 1e9c25102172da3c112cf00944e8039216ba5ea9
Parents: 6686bcf
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri May 24 08:07:07 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri May 24 13:22:14 2013 +0000
----------------------------------------------------------------------
Allura/allura/command/base.py | 8 +++++++-
Allura/allura/tests/test_commands.py | 9 +++++++++
2 files changed, 16 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1e9c2510/Allura/allura/command/base.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/base.py b/Allura/allura/command/base.py
index d433643..536159d 100644
--- a/Allura/allura/command/base.py
+++ b/Allura/allura/command/base.py
@@ -40,7 +40,13 @@ def run_command(command, args):
mod, cls = command.rsplit('.', 1)
mod = __import__(mod, fromlist=[str(cls)])
command = getattr(mod, cls)
- return command(command.__name__).run(shlex.split(args or ''))
+ command = command(command.__name__)
+ arg_list = shlex.split(args or '')
+ try:
+ command.parser.parse_args(arg_list)
+ except SystemExit:
+ raise Exception("Error parsing args: '%s'" % args)
+ return command.run(arg_list)
class EmptyClass(object): pass
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1e9c2510/Allura/allura/tests/test_commands.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_commands.py b/Allura/allura/tests/test_commands.py
index 5f4963c..fee6e21 100644
--- a/Allura/allura/tests/test_commands.py
+++ b/Allura/allura/tests/test_commands.py
@@ -341,6 +341,15 @@ class TestBackgroundCommand(object):
base.run_command(self.cmd, 'dev.ini -p "project 3"')
command(command.__name__).run.assert_called_with(['dev.ini', '-p', 'project 3'])
+ def test_invalid_args(self):
+ M.MonQTask.query.remove()
+ show_models.ReindexCommand.post('--invalid-option')
+ with td.raises(Exception):
+ M.MonQTask.run_ready()
+ task = M.MonQTask.query.get(task_name=self.task_name)
+ assert_equal(task.state, 'error')
+ assert_in('Error parsing args', task.result)
+
class TestReindexCommand(object):
[45/50] git commit: [#5913] Fixed styling of new project header
Posted by jo...@apache.org.
[#5913] Fixed styling of new project header
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/df9ca393
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/df9ca393
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/df9ca393
Branch: refs/heads/cj/5913
Commit: df9ca3934649538519571c8ffb8b40f0dbf03ed8
Parents: cfa200b
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue May 21 20:31:22 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue May 28 15:54:57 2013 +0000
----------------------------------------------------------------------
Allura/allura/nf/allura/css/site_style.css | 29 ++++++++++++++-
Allura/allura/templates/jinja_master/nav_menu.html | 2 +-
2 files changed, 28 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/df9ca393/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index 06b93ca..6623b94 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -2091,8 +2091,33 @@ nav .ico {
vertical-align: middle;
}
-.project_title {
- line-height: 48px;
+#nav_menu_holder {
+ margin: 0 0 15px;
+}
+
+#nav_menu_holder h1.project_title {
+ line-height: 1em;
+ font-size: 32px;
+ margin-bottom: 0;
+}
+
+#nav_menu_holder h1.project_title a,
+#nav_menu_holder h1.project_title a:hover,
+#nav_menu_holder h1.project_title a:visited,
+#nav_menu_holder h1.project_title a:focus {
+ color: #555;
+ text-decoration: none;
+}
+
+#nav_menu_holder h2.project_summary {
+ line-height: 1em;
+ font-size: 16px;
+ font-weight: normal;
+ margin-bottom: 0;
+}
+
+#nav_menu_holder .brought-by.with-icon {
+ margin-left: 55px;
}
.neighborhood_icon {
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/df9ca393/Allura/allura/templates/jinja_master/nav_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/nav_menu.html b/Allura/allura/templates/jinja_master/nav_menu.html
index 15f7fac..27c7b56 100644
--- a/Allura/allura/templates/jinja_master/nav_menu.html
+++ b/Allura/allura/templates/jinja_master/nav_menu.html
@@ -43,7 +43,7 @@
<h1 class="project_title">
<a href="{{c.project.url()}}" class="project_link">{{ c.project.neighborhood.name if c.project.is_nbhd_project else c.project.name }}</a>
</h1>
- <h2>
+ <h2 class="project_summary">
{{c.project.summary}}
</h2>
<div class="brought-by{% if c.project.icon %} with-icon{% endif %}">
[09/50] git commit: [#4831] ticket:339 Use singular form in log
messages
Posted by jo...@apache.org.
[#4831] ticket:339 Use singular form in log messages
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/67488c04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/67488c04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/67488c04
Branch: refs/heads/cj/5913
Commit: 67488c0464eae5a8c375c61d46959776fc275ca5
Parents: 99a2fe0
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 23 10:48:19 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 14:29:11 2013 +0000
----------------------------------------------------------------------
Allura/allura/app.py | 2 +-
Allura/allura/tests/functional/test_admin.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/67488c04/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 466f355..21099a1 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -523,7 +523,7 @@ class DefaultAdminController(BaseController):
del_group_ids.append(str(acl['role_id']))
if new_group_ids or del_group_ids:
- model.AuditLog.log('updated "%s" permissions: "%s" => "%s" for %s' % (
+ model.AuditLog.log('updated "%s" permission: "%s" => "%s" for %s' % (
perm,
', '.join(map(lambda id: model.ProjectRole.query.get(_id=ObjectId(id)).name, group_ids+del_group_ids)),
', '.join(map(lambda id: model.ProjectRole.query.get(_id=ObjectId(id)).name, group_ids+new_group_ids)),
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/67488c04/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index a2bcceb..9741d3c 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -394,13 +394,13 @@ class TestProjectAdmin(TestController):
assert opt_admin.name == 'option'
assert opt_developer.name == 'option'
- with audits('updated "admin" permissions: "Admin" => "Admin, Developer" for wiki'):
+ with audits('updated "admin" permission: "Admin" => "Admin, Developer" for wiki'):
self.app.post('/admin/wiki/update', params={
'card-0.new': opt_developer['value'],
'card-0.value': opt_admin['value'],
'card-0.id': 'admin'})
- with audits('updated "admin" permissions: "Admin, Developer" => "Admin" for wiki'):
+ with audits('updated "admin" permission: "Admin, Developer" => "Admin" for wiki'):
self.app.post('/admin/wiki/update', params={
'card-0.value': opt_admin['value'],
'card-0.id': 'admin'})
[21/50] git commit: [#6125] ticket:342 svn repository commit emails
includes revision number
Posted by jo...@apache.org.
[#6125] ticket:342 svn repository commit emails includes revision number
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/c42a258e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c42a258e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c42a258e
Branch: refs/heads/cj/5913
Commit: c42a258effd6f67fedd2ff64e1e5a2ce113ae242
Parents: 53d8b05
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Mon May 13 14:28:38 2013 +0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 19:46:06 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/repo_refresh.py | 14 +++++++---
ForgeSVN/forgesvn/tests/model/test_repository.py | 22 +++++++++++++++++
2 files changed, 32 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c42a258e/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 3d5f08b..823e09f 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -420,13 +420,19 @@ def send_notifications(repo, commit_ids):
len(commit_msgs), repo.app.project.name, repo.app.config.options.mount_label)
text='\n\n'.join(commit_msgs)
else:
- subject = '%s committed to %s %s: %s' % (
+ if c.app.tool_label.lower() == 'svn':
+ revision_id = c.app.repo._impl._revno(ci._id)
+ else:
+ revision_id = ci._id
+ subject = '%s committed revision %s: %s' % (
ci.authored.name,
- repo.app.project.name,
- repo.app.config.options.mount_label,
+ revision_id,
summary)
branches = repo.symbolics_for_commit(ci)[0]
- text = "%s: %s %s%s" % (",".join(b for b in branches),
+ text_branches = ''
+ if branches:
+ text_branches = '%s: ' % ",".join(b for b in branches)
+ text = "%s%s %s%s" % (text_branches,
ci.message,
base_url, ci.url())
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c42a258e/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 288a1b9..3ff7127 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -36,6 +36,7 @@ from IPython.testing.decorators import onlyif
from alluratest.controller import setup_basic_test, setup_global_objects
from allura import model as M
+from allura.model.repo_refresh import send_notifications
from allura.lib import helpers as h
from allura.tests import decorators as td
from allura.tests.model.test_repo import RepoImplTestBase
@@ -400,6 +401,27 @@ class TestSVNRev(unittest.TestCase):
commits = self.repo.commits_count('not/exist/')
assert commits == 0, commits
+ def test_notification_email(self):
+ setup_global_objects()
+ h.set_context('test', 'src', neighborhood='Projects')
+ repo_dir = pkg_resources.resource_filename(
+ 'forgesvn', 'tests/data/')
+ self.repo = SM.Repository(
+ name='testsvn',
+ fs_path=repo_dir,
+ url_path = '/test/',
+ tool = 'svn',
+ status = 'creating')
+ self.repo.refresh()
+ ThreadLocalORMSession.flush_all()
+ commits = self.repo.commits()
+ send_notifications(self.repo, [commits[4], ])
+ ThreadLocalORMSession.flush_all()
+ notifications = M.Notification.query.find().sort('pubdate')
+ n = notifications.all()[3]
+ assert_equal(n.subject, '[test:src] rick446 committed revision 1: Create readme')
+ assert_equal(n.text, 'Create readme http://localhost//p/test/src/1/')
+
class _Test(unittest.TestCase):
idgen = ( 'obj_%d' % i for i in count())
[32/50] git commit: [#5656] ticket:301 Bulk move tickets
Posted by jo...@apache.org.
[#5656] ticket:301 Bulk move tickets
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/ffb9e7f6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ffb9e7f6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ffb9e7f6
Branch: refs/heads/cj/5913
Commit: ffb9e7f685be99e9935e5315fc6fb02456b77f78
Parents: a087f64
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed May 1 08:48:35 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:35:51 2013 +0000
----------------------------------------------------------------------
.../forgetracker/tests/functional/test_root.py | 11 +++-
ForgeTracker/forgetracker/tracker_main.py | 35 ++++++++++++++-
2 files changed, 42 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ffb9e7f6/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 7015cd4..2a0e3e9 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -2236,10 +2236,15 @@ class TestBulkMove(TrackerTestController):
def test_access_restriction(self):
self.app.get('/bugs/move/', status=200)
- self.app.get('/bugs/move/', extra_environ={'username': 'test-user-0'},
+ self.app.get('/bugs/move/',
+ extra_environ={'username': 'test-user-0'},
status=403)
- self.app.get('/bugs/move/', extra_environ={'username': '*anonymous'},
+ self.app.get('/bugs/move/',
+ extra_environ={'username': '*anonymous'},
status=302)
+ self.app.post('/bugs/move_tickets',
+ extra_environ={'username': 'test-user-0'},
+ status=403)
def test_ticket_list(self):
r = self.app.get('/bugs/move/?q=The')
@@ -2285,7 +2290,7 @@ class TestBulkMove(TrackerTestController):
assert_equal(ticket.discussion_thread.app_config_id, ac_id)
assert_equal(ticket.discussion_thread.discussion.app_config_id, ac_id)
post = ticket.discussion_thread.last_post
- assert_equal(post.text, 'Ticket moved from /p/test/bugs/1/')
+ assert_in('Ticket moved from /p/test/bugs/', post.text)
for t in original_tickets:
assert_equal(t.discussion_thread.app_config_id, original_ac_id)
assert_equal(t.discussion_thread.discussion.app_config_id, original_ac_id)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ffb9e7f6/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index b2cc363..e5cf057 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -795,11 +795,44 @@ class RootController(BaseController, FeedController):
result['cancel_href'] = url(c.app.url + 'search/', dict(q=q, limit=limit, sort=sort))
c.mass_move = W.mass_edit
trackers = _my_trackers(c.user, c.app.config)
- c.mass_move_form = W.mass_move_form(trackers=trackers)
+ c.mass_move_form = W.mass_move_form(
+ trackers=trackers,
+ action=c.app.url + 'move_tickets')
return result
@expose()
@require_post()
+ def move_tickets(self, **post_data):
+ require_access(c.app, 'admin')
+ ticket_ids = aslist(post_data.get('__ticket_ids', []))
+ search = post_data.get('__search', '')
+ try:
+ destination_tracker_id = ObjectId(post_data.get('tracker', ''))
+ except InvalidId:
+ destination_tracker_id = None
+ tracker = M.AppConfig.query.get(_id=destination_tracker_id)
+ if tracker is None:
+ flash('Select valid tracker', 'error')
+ redirect('move/' + search)
+ if tracker == c.app.config:
+ flash('Ticket already in a selected tracker', 'info')
+ redirect('move/' + search)
+ if not has_access(tracker, 'admin')():
+ flash('You should have admin access to destination tracker', 'error')
+ redirect('move/' + search)
+ tickets = TM.Ticket.query.find(dict(
+ _id={'$in': [ObjectId(id) for id in ticket_ids]},
+ app_config_id=c.app.config._id)).all()
+ for ticket in tickets:
+ ticket.move(tracker)
+ c.app.globals.invalidate_bin_counts()
+ ThreadLocalORMSession.flush_all()
+ count = len(tickets)
+ flash('Moved {} ticket{}'.format(count, 's' if count != 1 else ''), 'ok')
+ redirect('move/' + search)
+
+ @expose()
+ @require_post()
def update_tickets(self, **post_data):
tickets = TM.Ticket.query.find(dict(
_id={'$in':[ObjectId(id) for id in aslist(post_data['__ticket_ids'])]},
[44/50] git commit: [#5913] Add development status badge to project
header
Posted by jo...@apache.org.
[#5913] Add development status badge to project header
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/b4a9f1bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b4a9f1bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b4a9f1bd
Branch: refs/heads/cj/5913
Commit: b4a9f1bd068db095c4be9dbbc3e4ed8ff87650e8
Parents: df9ca39
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue May 21 21:23:06 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue May 28 15:54:57 2013 +0000
----------------------------------------------------------------------
Allura/allura/nf/allura/css/site_style.css | 14 ++++++++++++++
Allura/allura/templates/jinja_master/nav_menu.html | 5 +++++
2 files changed, 19 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b4a9f1bd/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index 6623b94..b067f6d 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -2099,6 +2099,7 @@ nav .ico {
line-height: 1em;
font-size: 32px;
margin-bottom: 0;
+ display: inline;
}
#nav_menu_holder h1.project_title a,
@@ -2109,6 +2110,19 @@ nav .ico {
text-decoration: none;
}
+#nav_menu_holder #dev-status {
+ vertical-align: top;
+ text-transform: capitalize;
+ font-size: 10px;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ -o-border-radius: 2px;
+ border-radius: 2px;
+ background-color: #09c;
+ color: white;
+ padding: 2px;
+}
+
#nav_menu_holder h2.project_summary {
line-height: 1em;
font-size: 16px;
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b4a9f1bd/Allura/allura/templates/jinja_master/nav_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/nav_menu.html b/Allura/allura/templates/jinja_master/nav_menu.html
index 27c7b56..74f7509 100644
--- a/Allura/allura/templates/jinja_master/nav_menu.html
+++ b/Allura/allura/templates/jinja_master/nav_menu.html
@@ -43,6 +43,11 @@
<h1 class="project_title">
<a href="{{c.project.url()}}" class="project_link">{{ c.project.neighborhood.name if c.project.is_nbhd_project else c.project.name }}</a>
</h1>
+ {% set status = c.project.troves_by_type('developmentstatus')|sort(attribute='fullname') %}
+ {% set status = status[-1] %}
+ {% if status and status.shortname not in ['production', 'mature'] %}
+ <span id="dev-status" class="{{ status.shortname }}">{{ status.shortname }}</span>
+ {% endif %}
<h2 class="project_summary">
{{c.project.summary}}
</h2>
[28/50] git commit: [#5656] ticket:301 Send summary to monitoring
email, if set
Posted by jo...@apache.org.
[#5656] ticket:301 Send summary to monitoring email, if set
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/a770cdfa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a770cdfa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a770cdfa
Branch: refs/heads/cj/5913
Commit: a770cdfa77269140656088d9161882b2b1461fa5
Parents: 3dd4318
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed May 1 11:54:31 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:35:51 2013 +0000
----------------------------------------------------------------------
.../forgetracker/tests/functional/test_root.py | 37 +++++++++++++++
ForgeTracker/forgetracker/tracker_main.py | 13 +++++
2 files changed, 50 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a770cdfa/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index e346482..da6544b 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -2352,6 +2352,43 @@ class TestBulkMove(TrackerTestController):
assert_in(second_ticket_changes, admin_email.kwargs.text)
assert_in(third_ticket_changes, admin_email.kwargs.text)
+ @td.with_tool('test2', 'Tickets', 'bugs2')
+ def test_monitoring_email(self):
+ self.app.post('/admin/bugs/set_options', params={
+ 'TicketMonitoringEmail': 'monitoring@email.com',
+ 'TicketMonitoringType': 'AllTicketChanges',
+ })
+ tickets = [
+ tm.Ticket.query.find({'summary': 'A New Hope'}).first(),
+ tm.Ticket.query.find({'summary': 'The Empire Strikes Back'}).first(),
+ tm.Ticket.query.find({'summary': 'Return Of The Jedi'}).first()]
+ p = M.Project.query.get(shortname='test2')
+ tracker = p.app_instance('bugs2')
+ M.MonQTask.query.remove()
+ r = self.app.post('/p/test/bugs/move_tickets', {
+ 'tracker': str(tracker.config._id),
+ '__ticket_ids': [t._id for t in tickets],
+ '__search': '',
+ })
+ M.MonQTask.run_ready()
+ emails = M.MonQTask.query.find(dict(task_name='allura.tasks.mail_tasks.sendmail')).all()
+ assert_equal(len(emails), 2)
+ for email in emails:
+ assert_equal(email.kwargs.subject, '[test:bugs] Mass ticket moving by Test Admin')
+ admin_email = M.MonQTask.query.find({
+ 'task_name': 'allura.tasks.mail_tasks.sendmail',
+ 'kwargs.destinations': str(M.User.by_username('test-admin')._id)
+ }).all()
+ monitoring_email = M.MonQTask.query.find({
+ 'task_name': 'allura.tasks.mail_tasks.sendmail',
+ 'kwargs.destinations': 'monitoring@email.com'
+ }).all()
+ assert_equal(len(admin_email), 1)
+ assert_equal(len(monitoring_email), 1)
+ admin_email_text = admin_email[0].kwargs.text
+ monitoring_email_text = monitoring_email[0].kwargs.text
+ assert_equal(admin_email_text, monitoring_email_text)
+
def sidebar_contains(response, text):
sidebar_menu = response.html.find('div', attrs={'id': 'sidebar'})
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a770cdfa/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index c41db5e..845d380 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -861,6 +861,19 @@ class RootController(BaseController, FeedController):
destinations = [str(user._id)]))
mail_tasks.sendmail.post(**mail)
+ if c.app.config.options.get('TicketMonitoringType') == 'AllTicketChanges':
+ monitoring_email = c.app.config.options.get('TicketMonitoringEmail')
+ tmpl_context['tickets'] = ({
+ 'original_num': original_ticket_nums[_id],
+ 'destination_num': moved_tickets[_id].ticket_num,
+ 'summary': moved_tickets[_id].summary
+ } for _id in moved_tickets.keys())
+ mail.update(dict(
+ message_id = h.gen_message_id(),
+ text = tmpl.render(tmpl_context),
+ destinations = [monitoring_email]))
+ mail_tasks.sendmail.post(**mail)
+
c.app.globals.invalidate_bin_counts()
ThreadLocalORMSession.flush_all()
count = len(tickets)
[11/50] git commit: [#5571] Added akismet and pymollom to
requirements-optional.txt
Posted by jo...@apache.org.
[#5571] Added akismet and pymollom to requirements-optional.txt
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/65009bee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/65009bee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/65009bee
Branch: refs/heads/cj/5913
Commit: 65009beecca10394ff2da257bf69b46ee1fc61cf
Parents: 67488c0
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu May 23 14:42:11 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu May 23 16:04:40 2013 +0000
----------------------------------------------------------------------
requirements-optional.txt | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/65009bee/requirements-optional.txt
----------------------------------------------------------------------
diff --git a/requirements-optional.txt b/requirements-optional.txt
index 59653df..9de8406 100644
--- a/requirements-optional.txt
+++ b/requirements-optional.txt
@@ -11,3 +11,7 @@
# for ForgeWiki's mediawiki importer:
-e git://github.com/zikzakmedia/python-mediawiki.git#egg=python-mediawiki # GPL
MySQL-python # GPL
+
+# One or the other is required to enable spam checking
+akismet==0.2.0
+pymollom==0.1 # GPL
[49/50] git commit: [#5913] Fixed "and 1 others" corner-case on
project header admin list
Posted by jo...@apache.org.
[#5913] Fixed "and 1 others" corner-case on project header admin list
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/961786ff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/961786ff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/961786ff
Branch: refs/heads/cj/5913
Commit: 961786ff0343ea869bac52f9e465aa0ed1554c81
Parents: 595b205
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu May 23 20:11:22 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue May 28 15:54:58 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/jinja_master/nav_menu.html | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/961786ff/Allura/allura/templates/jinja_master/nav_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/nav_menu.html b/Allura/allura/templates/jinja_master/nav_menu.html
index 724ca1c..a34e20a 100644
--- a/Allura/allura/templates/jinja_master/nav_menu.html
+++ b/Allura/allura/templates/jinja_master/nav_menu.html
@@ -56,11 +56,12 @@
<div class="brought-by{% if c.project.icon %} with-icon{% endif %}">
Brought to you by:
{% set admins = c.project.admins()|sort(attribute='username') %}
- {% for admin in admins[:4] %}
- <a href="{{ admin.url() }}">{{ admin.username }}</a>{{ ',' if not loop.last }}
+ {% for admin in admins[:5] %}
+ {% if loop.last and admins|length > 5 -%}
+ and <a href="{{ c.project.url() }}_members/">{{ admins|length - 4 }} others</a>
+ {% else %}
+ <a href="{{ admin.url() }}">{{ admin.username }}</a>{{ ',' if not loop.last }}
+ {% endif %}
{%- endfor -%}
- {% if admins|length > 4 -%}
- , and <a href="{{ c.project.url() }}_members/">{{ admins|length - 4 }} others</a>
- {% endif %}
</div>
{% endif %}
[41/50] git commit: [#5656] ticket:358 Respect new email monitoring
types
Posted by jo...@apache.org.
[#5656] ticket:358 Respect new email monitoring types
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/82f675f7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/82f675f7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/82f675f7
Branch: refs/heads/cj/5913
Commit: 82f675f705b860fe3806f28d530dbb139e8156da
Parents: ed74e25
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 23 14:45:33 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:42:27 2013 +0000
----------------------------------------------------------------------
ForgeTracker/forgetracker/model/ticket.py | 22 +++--
.../forgetracker/tests/functional/test_root.py | 87 +++++++++++++++
2 files changed, 101 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/82f675f7/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 24a5d08..bc2d0c2 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -266,18 +266,24 @@ class Globals(MappedClass):
destinations = [str(user._id)]))
mail_tasks.sendmail.post(**mail)
- if c.app.config.options.get('TicketMonitoringType') == 'AllTicketChanges':
+ if c.app.config.options.get('TicketMonitoringType') in (
+ 'AllTicketChanges', 'AllPublicTicketChanges'):
monitoring_email = c.app.config.options.get('TicketMonitoringEmail')
- tmpl_context['tickets'] = ({
+ tmpl_context['tickets'] = [{
'original_num': original_ticket_nums[_id],
'destination_num': moved_tickets[_id].ticket_num,
'summary': moved_tickets[_id].summary
- } for _id in moved_tickets.keys())
- mail.update(dict(
- message_id = h.gen_message_id(),
- text = tmpl.render(tmpl_context),
- destinations = [monitoring_email]))
- mail_tasks.sendmail.post(**mail)
+ } for _id, t in moved_tickets.iteritems()
+ if (not t.private or
+ c.app.config.options.get('TicketMonitoringType') ==
+ 'AllTicketChanges')]
+ if len(tmpl_context['tickets']) > 0:
+ mail.update(dict(
+ message_id = h.gen_message_id(),
+ text = tmpl.render(tmpl_context),
+ destinations = [monitoring_email]))
+ mail_tasks.sendmail.post(**mail)
+
moved_from = '%s/%s' % (c.project.shortname, c.app.config.options.mount_point)
moved_to = '%s/%s' % (tracker.project.shortname, tracker.options.mount_point)
text = 'Tickets moved from %s to %s' % (moved_from, moved_to)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/82f675f7/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 1f4acf4..b7e7dd8 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -2396,6 +2396,93 @@ class TestBulkMove(TrackerTestController):
monitoring_email_text = monitoring_email[0].kwargs.text
assert_equal(admin_email_text, monitoring_email_text)
+ @td.with_tool('test2', 'Tickets', 'bugs2')
+ def test_monitoring_email_public_only(self):
+ """Test that private tickets are not included in bulk move
+ notifications if the "public only" option is selected.
+ """
+ self.app.post('/admin/bugs/set_options', params={
+ 'TicketMonitoringEmail': 'monitoring@email.com',
+ 'TicketMonitoringType': 'AllPublicTicketChanges',
+ })
+ self.new_ticket(summary='test first ticket', status='open')
+ self.new_ticket(summary='test second ticket', status='open', private=True)
+ ThreadLocalORMSession.flush_all()
+ M.MonQTask.run_ready()
+ ThreadLocalORMSession.flush_all()
+ tickets = [
+ tm.Ticket.query.find({'summary': 'test first ticket'}).first(),
+ tm.Ticket.query.find({'summary': 'test second ticket'}).first()]
+ M.MonQTask.query.remove()
+ p = M.Project.query.get(shortname='test2')
+ tracker = p.app_instance('bugs2')
+ self.app.post('/p/test/bugs/move_tickets', {
+ 'tracker': str(tracker.config._id),
+ '__ticket_ids': [t._id for t in tickets],
+ '__search': '',
+ })
+ M.MonQTask.run_ready()
+ emails = M.MonQTask.query.find(dict(task_name='allura.tasks.mail_tasks.sendmail')).all()
+ assert_equal(len(emails), 2) # one for admin and one for monitoring email
+ for email in emails:
+ assert_equal(email.kwargs.subject, '[test:bugs] Mass ticket moving by Test Admin')
+ admin = M.User.by_username('test-admin')
+ admin_email = M.MonQTask.query.find({
+ 'task_name': 'allura.tasks.mail_tasks.sendmail',
+ 'kwargs.destinations': str(admin._id)
+ }).all()
+ monitoring_email = M.MonQTask.query.find({
+ 'task_name': 'allura.tasks.mail_tasks.sendmail',
+ 'kwargs.destinations': 'monitoring@email.com'
+ }).all()
+ assert_equal(len(admin_email), 1)
+ assert_equal(len(monitoring_email), 1)
+ admin_email_text = admin_email[0].kwargs.text
+ monitoring_email_text = monitoring_email[0].kwargs.text
+ assert_in('second ticket', admin_email_text)
+ assert_not_in('second ticket', monitoring_email_text)
+
+ @td.with_tool('test2', 'Tickets', 'bugs2')
+ def test_monitoring_email_all_private_moved(self):
+ """Test that no monitoring email is sent if the "public only"
+ option is selected, and only private tickets were moved.
+ """
+ self.app.post('/admin/bugs/set_options', params={
+ 'TicketMonitoringEmail': 'monitoring@email.com',
+ 'TicketMonitoringType': 'AllPublicTicketChanges',
+ })
+ self.new_ticket(summary='test first ticket', status='open', private=True)
+ self.new_ticket(summary='test second ticket', status='open', private=True)
+ ThreadLocalORMSession.flush_all()
+ M.MonQTask.run_ready()
+ ThreadLocalORMSession.flush_all()
+ tickets = [
+ tm.Ticket.query.find({'summary': 'test first ticket'}).first(),
+ tm.Ticket.query.find({'summary': 'test second ticket'}).first()]
+ M.MonQTask.query.remove()
+ p = M.Project.query.get(shortname='test2')
+ tracker = p.app_instance('bugs2')
+ self.app.post('/p/test/bugs/move_tickets', {
+ 'tracker': str(tracker.config._id),
+ '__ticket_ids': [t._id for t in tickets],
+ '__search': '',
+ })
+ M.MonQTask.run_ready()
+ emails = M.MonQTask.query.find(dict(task_name='allura.tasks.mail_tasks.sendmail')).all()
+ assert_equal(len(emails), 1) # only admin email sent
+ for email in emails:
+ assert_equal(email.kwargs.subject, '[test:bugs] Mass ticket moving by Test Admin')
+ admin = M.User.by_username('test-admin')
+ admin_email = M.MonQTask.query.find({
+ 'task_name': 'allura.tasks.mail_tasks.sendmail',
+ 'kwargs.destinations': str(admin._id)
+ }).all()
+ monitoring_email = M.MonQTask.query.find({
+ 'task_name': 'allura.tasks.mail_tasks.sendmail',
+ 'kwargs.destinations': 'monitoring@email.com'
+ }).all()
+ assert_equal(len(admin_email), 1)
+ assert_equal(len(monitoring_email), 0)
def sidebar_contains(response, text):
sidebar_menu = response.html.find('div', attrs={'id': 'sidebar'})
[22/50] git commit: [#6125] Remove 'committed' from email subject
Posted by jo...@apache.org.
[#6125] Remove 'committed' from email subject
Signed-off-by: Tim Van Steenburgh <tv...@gmail.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/62a27c3c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/62a27c3c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/62a27c3c
Branch: refs/heads/cj/5913
Commit: 62a27c3c2ce821309d6ccb8bd74c8d8d7b1db0d9
Parents: e409b0e
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Thu May 23 20:18:21 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 20:18:21 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/repo_refresh.py | 2 +-
ForgeGit/forgegit/tests/model/test_repository.py | 2 +-
ForgeSVN/forgesvn/tests/model/test_repository.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/62a27c3c/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index e2821f6..52855b5 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -420,7 +420,7 @@ def send_notifications(repo, commit_ids):
len(commit_msgs), repo.app.project.name, repo.app.config.options.mount_label)
text='\n\n'.join(commit_msgs)
else:
- subject = '{0} - {1} committed: {2}'.format(
+ subject = '{0} - {1}: {2}'.format(
repo.shorthand_for_commit(ci._id),
ci.authored.name,
summary)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/62a27c3c/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 2eb90da..316f202 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -264,7 +264,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
ThreadLocalORMSession.flush_all()
notifications = M.Notification.query.find().sort('pubdate')
n = notifications.all()[2]
- assert_equal(n.subject, '[test:src-git] [1e146e] - Rick Copeland committed: Change README')
+ assert_equal(n.subject, '[test:src-git] [1e146e] - Rick Copeland: Change README')
assert 'master,zz: ' in n.text
send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a'])
ThreadLocalORMSession.flush_all()
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/62a27c3c/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 082d423..6026125 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -419,7 +419,7 @@ class TestSVNRev(unittest.TestCase):
ThreadLocalORMSession.flush_all()
notifications = M.Notification.query.find().sort('pubdate')
n = notifications.all()[3]
- assert_equal(n.subject, '[test:src] [r1] - rick446 committed: Create readme')
+ assert_equal(n.subject, '[test:src] [r1] - rick446: Create readme')
assert_equal(n.text, 'Create readme http://localhost//p/test/src/1/')
[20/50] git commit: [#6125] Change format of commit email subject line
Posted by jo...@apache.org.
[#6125] Change format of commit email subject line
Signed-off-by: Tim Van Steenburgh <tv...@gmail.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/e409b0ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/e409b0ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/e409b0ee
Branch: refs/heads/cj/5913
Commit: e409b0ee51523fe52e819af10408933aa96fd033
Parents: 22cb1a0
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Thu May 23 19:43:36 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 19:46:06 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/repo_refresh.py | 13 ++++---------
ForgeGit/forgegit/tests/model/test_repository.py | 2 +-
ForgeSVN/forgesvn/tests/model/test_repository.py | 2 +-
3 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e409b0ee/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 823e09f..e2821f6 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -420,18 +420,13 @@ def send_notifications(repo, commit_ids):
len(commit_msgs), repo.app.project.name, repo.app.config.options.mount_label)
text='\n\n'.join(commit_msgs)
else:
- if c.app.tool_label.lower() == 'svn':
- revision_id = c.app.repo._impl._revno(ci._id)
- else:
- revision_id = ci._id
- subject = '%s committed revision %s: %s' % (
+ subject = '{0} - {1} committed: {2}'.format(
+ repo.shorthand_for_commit(ci._id),
ci.authored.name,
- revision_id,
summary)
branches = repo.symbolics_for_commit(ci)[0]
- text_branches = ''
- if branches:
- text_branches = '%s: ' % ",".join(b for b in branches)
+ text_branches = ('%s: ' % ",".join(b for b in branches)
+ if branches else '')
text = "%s%s %s%s" % (text_branches,
ci.message,
base_url, ci.url())
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e409b0ee/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 150b6e2..2eb90da 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -264,7 +264,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
ThreadLocalORMSession.flush_all()
notifications = M.Notification.query.find().sort('pubdate')
n = notifications.all()[2]
- assert_equal(n.subject, '[test:src-git] Rick Copeland committed revision 1e146e67985dcd71c74de79613719bef7bddca4a: Change README')
+ assert_equal(n.subject, '[test:src-git] [1e146e] - Rick Copeland committed: Change README')
assert 'master,zz: ' in n.text
send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a'])
ThreadLocalORMSession.flush_all()
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e409b0ee/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 3ff7127..082d423 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -419,7 +419,7 @@ class TestSVNRev(unittest.TestCase):
ThreadLocalORMSession.flush_all()
notifications = M.Notification.query.find().sort('pubdate')
n = notifications.all()[3]
- assert_equal(n.subject, '[test:src] rick446 committed revision 1: Create readme')
+ assert_equal(n.subject, '[test:src] [r1] - rick446 committed: Create readme')
assert_equal(n.text, 'Create readme http://localhost//p/test/src/1/')
[38/50] git commit: [#5656] ticket:358 Fix indentation
Posted by jo...@apache.org.
[#5656] ticket:358 Fix indentation
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/250337d2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/250337d2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/250337d2
Branch: refs/heads/cj/5913
Commit: 250337d2378b345a18aadbfe53c80322482c0a61
Parents: 6c1eecc
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 23 13:17:57 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:42:27 2013 +0000
----------------------------------------------------------------------
ForgeTracker/forgetracker/model/ticket.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/250337d2/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 80a8eb2..b1144db 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -261,9 +261,9 @@ class Globals(MappedClass):
'summary': moved_tickets[_id].summary
} for _id in filtered.get(user._id, []))
mail.update(dict(
- message_id = h.gen_message_id(),
- text = tmpl.render(tmpl_context),
- destinations = [str(user._id)]))
+ message_id = h.gen_message_id(),
+ text = tmpl.render(tmpl_context),
+ destinations = [str(user._id)]))
mail_tasks.sendmail.post(**mail)
if c.app.config.options.get('TicketMonitoringType') == 'AllTicketChanges':
[33/50] git commit: [#5656] ticket:301 Fix original ticket nums in
the summary email
Posted by jo...@apache.org.
[#5656] ticket:301 Fix original ticket nums in the summary email
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/3dd43184
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/3dd43184
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/3dd43184
Branch: refs/heads/cj/5913
Commit: 3dd431842e1106e727066fac1b6d33bfb47b7525
Parents: 36234bd
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed May 1 10:45:31 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:35:51 2013 +0000
----------------------------------------------------------------------
ForgeTracker/forgetracker/tracker_main.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3dd43184/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 030d168..c41db5e 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -824,8 +824,8 @@ class RootController(BaseController, FeedController):
_id={'$in': [ObjectId(id) for id in ticket_ids]},
app_config_id=c.app.config._id)).all()
- original_tickets = {t._id: t for t in tickets}
- filtered = filtered_by_subscription(original_tickets)
+ filtered = filtered_by_subscription({t._id: t for t in tickets})
+ original_ticket_nums = {t._id: t.ticket_num for t in tickets}
users = M.User.query.find({'_id': {'$in': filtered.keys()}}).all()
moved_tickets = {}
for ticket in tickets:
@@ -851,7 +851,7 @@ class RootController(BaseController, FeedController):
}
for user in users:
tmpl_context['tickets'] = ({
- 'original_num': original_tickets[_id].ticket_num,
+ 'original_num': original_ticket_nums[_id],
'destination_num': moved_tickets[_id].ticket_num,
'summary': moved_tickets[_id].summary
} for _id in filtered.get(user._id, []))
[46/50] git commit: [#5913] Add triangle to indicate nav menus with
dropdowns
Posted by jo...@apache.org.
[#5913] Add triangle to indicate nav menus with dropdowns
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/8af59b03
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/8af59b03
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/8af59b03
Branch: refs/heads/cj/5913
Commit: 8af59b03a2862f557319b34e4a45c414e36cb78f
Parents: c0fd8e8
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu May 16 13:43:09 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue May 28 15:54:57 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/project.py | 2 +-
Allura/allura/tests/unit/test_project.py | 18 +++++++++---------
2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8af59b03/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index da36ada..e98b44c 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -498,7 +498,7 @@ class Project(MappedClass, ActivityNode, ActivityObject):
if tool_name not in grouped_nav:
child = deepcopy(e)
# change label to be the tool name (type)
- e.label = g.entry_points['tool'][tool_name].tool_label
+ e.label = g.entry_points['tool'][tool_name].tool_label + u' \u25be'
# add tool url to list of urls that will match this nav entry
# have to do this before changing the url to the list page
e.matching_urls.append(e.url)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8af59b03/Allura/allura/tests/unit/test_project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/test_project.py b/Allura/allura/tests/unit/test_project.py
index 7329dba..f83cfe9 100644
--- a/Allura/allura/tests/unit/test_project.py
+++ b/Allura/allura/tests/unit/test_project.py
@@ -38,10 +38,10 @@ class TestProject(unittest.TestCase):
p.sitemap = Mock(return_value=sitemap_entries)
entries = p.grouped_navbar_entries()
expected = [
- ('Tickets', 'proj_url/_list/tickets', 3),
- ('wiki', 'wiki url', 0),
- ('Discussion', 'proj_url/_list/discussion', 2),
- ('subproject', 'subproject url', 0),
+ (u'Tickets \u25be', 'proj_url/_list/tickets', 3),
+ (u'wiki', 'wiki url', 0),
+ (u'Discussion \u25be', 'proj_url/_list/discussion', 2),
+ (u'subproject', 'subproject url', 0),
]
expected_ticket_urls = ['bugs url', 'features url', 'support url']
actual = [(e.label, e.url, len(e.matching_urls)) for e in entries]
@@ -64,11 +64,11 @@ class TestProject(unittest.TestCase):
p.tool_data['allura'] = {'grouping_threshold': 2}
entries = p.grouped_navbar_entries()
expected = [
- ('Tickets', 'proj_url/_list/tickets', 3),
- ('wiki', 'wiki url', 0),
- ('discuss', 'discuss url', 0),
- ('subproject', 'subproject url', 0),
- ('help', 'help url', 0),
+ (u'Tickets \u25be', 'proj_url/_list/tickets', 3),
+ (u'wiki', 'wiki url', 0),
+ (u'discuss', 'discuss url', 0),
+ (u'subproject', 'subproject url', 0),
+ (u'help', 'help url', 0),
]
expected_ticket_urls = ['bugs url', 'features url', 'support url']
actual = [(e.label, e.url, len(e.matching_urls)) for e in entries]
[34/50] git commit: [#5656] ticket:301 Summary email for bulk ticket
move
Posted by jo...@apache.org.
[#5656] ticket:301 Summary email for bulk ticket move
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/36234bd7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/36234bd7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/36234bd7
Branch: refs/heads/cj/5913
Commit: 36234bd7ff5f1c84fd33d869a2e0f2582f0bd1b5
Parents: 75adfcc
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed May 1 10:39:23 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 24 18:35:51 2013 +0000
----------------------------------------------------------------------
.../forgetracker/data/mass_move_report.html | 5 ++
ForgeTracker/forgetracker/model/ticket.py | 6 +-
.../forgetracker/tests/functional/test_root.py | 56 +++++++++++++++
ForgeTracker/forgetracker/tracker_main.py | 38 ++++++++++-
4 files changed, 101 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/36234bd7/ForgeTracker/forgetracker/data/mass_move_report.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/data/mass_move_report.html b/ForgeTracker/forgetracker/data/mass_move_report.html
new file mode 100644
index 0000000..3ace7c6
--- /dev/null
+++ b/ForgeTracker/forgetracker/data/mass_move_report.html
@@ -0,0 +1,5 @@
+Tickets were moved from [{{original_tracker}}] to [{{destination_tracker}}]
+
+{% for t in tickets %}
+- [{{original_tracker}}:#{{t['original_num']}}] --> [{{destination_tracker}}:#{{t['destination_num']}}] {{t['summary']}}
+{% endfor %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/36234bd7/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index cf8249f..75c8bca 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -530,7 +530,7 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
o and o.username, n and n.username))
self.subscribe(user=n)
g.statsUpdater.ticketEvent("assigned", self, self.project, n)
- if o:
+ if o:
g.statsUpdater.ticketEvent("revoked", self, self.project, o)
if old.description != self.description:
changes.append('Description updated:')
@@ -635,7 +635,7 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
attach_thumb.discussion_id = app_config.discussion_id
attach_thumb.app_config_id = app_config._id
- def move(self, app_config):
+ def move(self, app_config, notify=True):
'''Move ticket from current tickets app to tickets app with given app_config'''
app = app_config.project.app_instance(app_config)
prior_url = self.url()
@@ -724,7 +724,7 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
message += '\n\nCan\'t be converted:\n\n'
message += '\n'.join(messages)
with h.push_context(ticket.project_id, app_config_id=app_config._id):
- ticket.discussion_thread.add_post(text=message)
+ ticket.discussion_thread.add_post(text=message, notify=notify)
return ticket
def __json__(self):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/36234bd7/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 2a0e3e9..e346482 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -2296,6 +2296,62 @@ class TestBulkMove(TrackerTestController):
assert_equal(t.discussion_thread.discussion.app_config_id, original_ac_id)
assert t.discussion_thread.last_post is None
+ @td.with_tool('test2', 'Tickets', 'bugs2')
+ def test_notifications(self):
+ tickets = [
+ tm.Ticket.query.find({'summary': 'A New Hope'}).first(),
+ tm.Ticket.query.find({'summary': 'The Empire Strikes Back'}).first(),
+ tm.Ticket.query.find({'summary': 'Return Of The Jedi'}).first()]
+ p = M.Project.query.get(shortname='test2')
+ tracker = p.app_instance('bugs2')
+ first_user = M.User.by_username('test-user-0')
+ second_user = M.User.by_username('test-user-1')
+ admin = M.User.by_username('test-admin')
+ tickets[0].subscribe(user=first_user)
+ tickets[1].subscribe(user=second_user)
+ M.MonQTask.query.remove()
+ r = self.app.post('/p/test/bugs/move_tickets', {
+ 'tracker': str(tracker.config._id),
+ '__ticket_ids': [t._id for t in tickets],
+ '__search': '',
+ })
+ M.MonQTask.run_ready()
+ emails = M.MonQTask.query.find(dict(task_name='allura.tasks.mail_tasks.sendmail')).all()
+ assert_equal(len(emails), 3)
+ for email in emails:
+ assert_equal(email.kwargs.subject, '[test:bugs] Mass ticket moving by Test Admin')
+ first_user_email = M.MonQTask.query.find({
+ 'task_name': 'allura.tasks.mail_tasks.sendmail',
+ 'kwargs.destinations': str(first_user._id)
+ }).all()
+ assert_equal(len(first_user_email), 1)
+ first_user_email = first_user_email[0]
+ second_user_email = M.MonQTask.query.find({
+ 'task_name': 'allura.tasks.mail_tasks.sendmail',
+ 'kwargs.destinations': str(second_user._id)
+ }).all()
+ assert_equal(len(second_user_email), 1)
+ second_user_email = second_user_email[0]
+ admin_email = M.MonQTask.query.find({
+ 'task_name': 'allura.tasks.mail_tasks.sendmail',
+ 'kwargs.destinations': str(admin._id)
+ }).all()
+ assert_equal(len(admin_email), 1)
+ admin_email = admin_email[0]
+
+ email_header = 'Tickets were moved from [test:bugs] to [test2:bugs2]\n'
+ first_ticket_changes = 'A New Hope'
+ second_ticket_changes = 'The Empire Strikes Back'
+ third_ticket_changes = 'Return Of The Jedi'
+ assert_in(email_header, first_user_email.kwargs.text)
+ assert_in(first_ticket_changes, first_user_email.kwargs.text)
+ assert_in(email_header, second_user_email.kwargs.text)
+ assert_in(second_ticket_changes, second_user_email.kwargs.text)
+ assert_in(email_header, admin_email.kwargs.text)
+ assert_in(first_ticket_changes, admin_email.kwargs.text)
+ assert_in(second_ticket_changes, admin_email.kwargs.text)
+ assert_in(third_ticket_changes, admin_email.kwargs.text)
+
def sidebar_contains(response, text):
sidebar_menu = response.html.find('div', attrs={'id': 'sidebar'})
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/36234bd7/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index e5cf057..030d168 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -823,8 +823,44 @@ class RootController(BaseController, FeedController):
tickets = TM.Ticket.query.find(dict(
_id={'$in': [ObjectId(id) for id in ticket_ids]},
app_config_id=c.app.config._id)).all()
+
+ original_tickets = {t._id: t for t in tickets}
+ filtered = filtered_by_subscription(original_tickets)
+ users = M.User.query.find({'_id': {'$in': filtered.keys()}}).all()
+ moved_tickets = {}
for ticket in tickets:
- ticket.move(tracker)
+ moved = ticket.move(tracker, notify=False)
+ moved_tickets[moved._id] = moved
+
+ mail = dict(
+ fromaddr = str(c.user._id),
+ reply_to = str(c.user._id),
+ subject = '[%s:%s] Mass ticket moving by %s' % (c.project.shortname,
+ c.app.config.options.mount_point,
+ c.user.display_name))
+ tmpl = jinja2.Environment(
+ loader=jinja2.PackageLoader('forgetracker', 'data'),
+ auto_reload=asbool(config.get('auto_reload_templates', True))
+ ).get_template('mass_move_report.html')
+ tmpl_context = {
+ 'original_tracker': '%s:%s' % (c.project.shortname,
+ c.app.config.options.mount_point),
+ 'destination_tracker': '%s:%s' % (tracker.project.shortname,
+ tracker.options.mount_point),
+ 'tickets': [],
+ }
+ for user in users:
+ tmpl_context['tickets'] = ({
+ 'original_num': original_tickets[_id].ticket_num,
+ 'destination_num': moved_tickets[_id].ticket_num,
+ 'summary': moved_tickets[_id].summary
+ } for _id in filtered.get(user._id, []))
+ mail.update(dict(
+ message_id = h.gen_message_id(),
+ text = tmpl.render(tmpl_context),
+ destinations = [str(user._id)]))
+ mail_tasks.sendmail.post(**mail)
+
c.app.globals.invalidate_bin_counts()
ThreadLocalORMSession.flush_all()
count = len(tickets)