• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Revisionb6e24976941f65d0d3586a9bbb588d9811de996c (tree)
Time2012-03-23 17:34:07
AuthorYaroslav Luzin <jardev@gmai...>
CommiterYaroslav Luzin

Log Message

Merge branch 'dev' of ssh://git.code.sf.net/p/allura/git

Change Summary

Incremental Difference

--- a/Allura/allura/templates/widgets/repo/revision.html
+++ b/Allura/allura/templates/widgets/repo/revision.html
@@ -4,42 +4,53 @@
44 <div class="first-line">{{g.markdown.convert(h.really_unicode(value.message.split('\n')[0]))}}</div>
55 {{g.markdown.convert(h.really_unicode('\n'.join(value.message.split('\n')[1:])))}}
66 </div>
7- <h2 class="commit-details">
8- <ul class="commit-links">
9- <li><a class="commit-tree-link" href="{{value.url()}}tree/">Tree</a></li>
10- {% if prev %}
11- <li class="commit-parents">
12- Parent(s):
13- {% for ci in prev %}<a href="{{ci.url()}}">{{ci.shorthand_id()}}</a>{% endfor %}
14- </li>
15- {% endif %}
16- {% if next %}
17- <li class="commit-children">
18- Child(ren):
19- {% for ci in next %}<a href="{{ci.url()}}">{{ci.shorthand_id()}}</a>{% endfor %}
20- </li>
21- {% endif %}
22- </ul>
7+ <div class="commit-details">
238
24- Authored by
25- {% if value.author_url %}
26- <a href="{{value.author_url}}">{{email_gravatar(value.authored.email, title=h.really_unicode(value.authored.name), size=16)}}</a>
27- <a href="{{value.author_url}}">{{h.really_unicode(value.authored.name)}}</a>
28- {% else %}
29- {{email_gravatar(value.authored.email, title=h.really_unicode(value.authored.name), size=16)}} {{h.really_unicode(value.authored.name)}}
30- {% endif %}
9+ <div class="commit-authorship">
10+ <p>
11+ <label>Authored by:</label>
12+ {% if value.author_url %}
13+ <a href="{{value.author_url}}">{{email_gravatar(value.authored.email, title=h.really_unicode(value.authored.name), size=16)}}</a>
14+ <a href="{{value.author_url}}">{{h.really_unicode(value.authored.name)}}</a>
15+ {% else %}
16+ {{email_gravatar(value.authored.email, title=h.really_unicode(value.authored.name), size=16)}} {{h.really_unicode(value.authored.name)}}
17+ {% endif %}
3118
32- {% if value.authored.date %}{{abbr_date(value.authored.date)}}{% endif %}
19+ {% if value.authored.date %}{{abbr_date(value.authored.date)}}{% endif %}
20+ </p>
3321
34- {% if value.committed.email != value.authored.email %}
35- Committed by
36- {% if value.committer_url %}
37- <a href="{{value.committer_url}}">{{email_gravatar(value.committed.email, title=h.really_unicode(value.committed.name), size=16)}}</a>
38- <a href="{{value.committer_url}}">{{h.really_unicode(value.committed.name)}}</a>
39- {% else %}
40- {{email_gravatar(value.committed.email, title=h.really_unicode(value.committed.name), size=16)}} {{h.really_unicode(value.committed.name)}}
22+ {% if value.committed.email != value.authored.email %}
23+ <p>
24+ <label>Committed by:</label>
25+ {% if value.committer_url %}
26+ <a href="{{value.committer_url}}">{{email_gravatar(value.committed.email, title=h.really_unicode(value.committed.name), size=16)}}</a>
27+ <a href="{{value.committer_url}}">{{h.really_unicode(value.committed.name)}}</a>
28+ {% else %}
29+ {{email_gravatar(value.committed.email, title=h.really_unicode(value.committed.name), size=16)}} {{h.really_unicode(value.committed.name)}}
30+ {% endif %}
31+ {% if value.committed.date %}{{abbr_date(value.committed.date)}}{% endif %}
32+ </p>
4133 {% endif %}
42- {% if value.committed.date %}{{abbr_date(value.committed.date)}}{% endif %}
43- {% endif %}
44- </h2>
34+ </div>
35+
36+ <div class="commit-links">
37+ <a class="commit-tree-link" href="{{value.url()}}tree/">Tree</a>
38+ <div class="commit-ancestry">
39+ {% if prev %}
40+ <p class="commit-parents">
41+ Parent(s):
42+ {% for ci in prev %}<a href="{{ci.url()}}">{{ci.shorthand_id()}}</a>{% endfor %}
43+ </p>
44+ {% endif %}
45+ {% if next %}
46+ <p class="commit-children">
47+ Child(ren):
48+ {% for ci in next %}<a href="{{ci.url()}}">{{ci.shorthand_id()}}</a>{% endfor %}
49+ </p>
50+ {% endif %}
51+ </div>
52+ </div>
53+
54+ <div class="clearfix"></div>
55+ </div>
4556 </div>
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -85,7 +85,7 @@ class Globals(MappedClass):
8585 @property
8686 def not_closed_mongo_query(self):
8787 return dict(
88- status={'$in': list(self.set_of_open_status_names)})
88+ status={'$nin': list(self.set_of_closed_status_names)})
8989
9090 @property
9191 def closed_query(self):
--- a/ForgeTracker/forgetracker/templates/tracker/index.html
+++ b/ForgeTracker/forgetracker/templates/tracker/index.html
@@ -16,7 +16,7 @@
1616 {{c.subscribe_form.display(value=subscribed, action='subscribe', style='icon')}}
1717 {% endif %}
1818 {% if allow_edit %}
19- <a href="{{tg.url(c.app.url+'edit/', dict(q=url_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>
19+ <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>
2020 {% endif %}
2121 {% endblock %}
2222
--- a/ForgeTracker/forgetracker/templates/tracker/milestone.html
+++ b/ForgeTracker/forgetracker/templates/tracker/milestone.html
@@ -8,7 +8,7 @@
88
99 {% block actions %}
1010 {% if allow_edit %}
11- <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>
11+ <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>
1212 {% endif %}
1313 {% endblock %}
1414
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
@@ -3,7 +3,7 @@
33 {% if field.name == '_milestone' %}
44 <div class="grid-6">{{milestones}}
55 <label for="{{field.name}}" class="cr">{{field.label}}:</label>
6- <select name="{{field.name}}" class="wide">
6+ <select name="{{field.name}}" id="{{field.name}}" class="wide">
77 <option value="" selected="selected">no change</option>
88 {% for m in field.milestones %}
99 {% if not m.complete %}
@@ -16,7 +16,7 @@
1616 {% endfor %}
1717 <div class="grid-6">
1818 <label for="status" class="cr">Status:</label>
19- <select name="status" class="wide">
19+ <select name="status" id="status" class="wide">
2020 <option value="" selected="selected">no change</option>
2121 {% for option in globals.all_status_names.split() %}
2222 <option value="{{option}}">{{option}}</option>
@@ -25,7 +25,7 @@
2525 </div>
2626 <div class="grid-6">
2727 <label for="assigned_to" class="cr">Owner:</label>
28- {{c.user_select.display(name='assigned_to', value='', className='wide')}}
28+ {{c.user_select.display(name='assigned_to', id='assigned_to', value='', className='wide')}}
2929 </div>
3030 {% set cf_count = 0 %}
3131 {% for field in globals.custom_fields %}
@@ -36,7 +36,7 @@
3636 <div class="grid-6">
3737 <label for="{{field.id}}" class="cr">{{field.label}}:</label>
3838 {% if field.type == 'boolean' %}
39- <input name="{{field.name}}" type="checkbox" value="True"/>
39+ <input name="{{field.name}}" id="{{field.name}}" type="checkbox" value="True"/>
4040 {% elif field.type == 'select' %}
4141 <select name="{{field.name}}" class="wide">
4242 <option value="" selected="selected">no change</option>
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -4,7 +4,7 @@ import Image, StringIO
44 import allura
55
66 from mock import patch
7-from nose.tools import assert_true, assert_false, assert_equal
7+from nose.tools import assert_true, assert_false, assert_equal, assert_in
88 from formencode.variabledecode import variable_encode
99
1010 from alluratest.controller import TestController
@@ -692,6 +692,67 @@ class TestFunctionalController(TrackerTestController):
692692 r = self.app.get('/bugs/1/', dict(page=1, limit=2))
693693 assert_true('Page 2 of 2' in r)
694694
695+ def test_bulk_edit_index(self):
696+ self.new_ticket(summary='test first ticket', status='open')
697+ self.new_ticket(summary='test second ticket', status='accepted')
698+ self.new_ticket(summary='test third ticket', status='closed')
699+ ThreadLocalORMSession.flush_all()
700+ M.MonQTask.run_ready()
701+ ThreadLocalORMSession.flush_all()
702+ response = self.app.get('/p/test/bugs/?sort=summary+asc')
703+ ticket_rows = response.html.find('table', {'class':'ticket-list'}).find('tbody')
704+ assert_in('test first ticket', str(ticket_rows))
705+ assert_in('test second ticket', str(ticket_rows))
706+ edit_link = response.html.find('a',{'title':'Bulk Edit'})
707+ expected_link = "/p/test/bugs/edit/?q=%21status%3Awont-fix+%26%26+%21status%3Aclosed&sort=snippet_s+asc&limit=25&page=0"
708+ assert_equal(expected_link, edit_link['href'])
709+ response = self.app.get(edit_link['href'])
710+ ticket_rows = response.html.find('tbody', {'class':'ticket-list'})
711+ assert_in('test first ticket', str(ticket_rows))
712+ assert_in('test second ticket', str(ticket_rows))
713+
714+ def test_bulk_edit_milestone(self):
715+ self.new_ticket(summary='test first ticket', status='open', _milestone='1.0')
716+ self.new_ticket(summary='test second ticket', status='accepted', _milestone='1.0')
717+ self.new_ticket(summary='test third ticket', status='closed', _milestone='1.0')
718+ ThreadLocalORMSession.flush_all()
719+ M.MonQTask.run_ready()
720+ ThreadLocalORMSession.flush_all()
721+ response = self.app.get('/p/test/bugs/milestone/1.0/?sort=ticket_num+asc')
722+ ticket_rows = response.html.find('table', {'class':'ticket-list'}).find('tbody')
723+ assert_in('test first ticket', str(ticket_rows))
724+ assert_in('test second ticket', str(ticket_rows))
725+ assert_in('test third ticket', str(ticket_rows))
726+ edit_link = response.html.find('a',{'title':'Bulk Edit'})
727+ expected_link = "/p/test/bugs/edit/?q=_milestone%3A1.0&sort=ticket_num_i+asc&limit=25&page=0"
728+ assert_equal(expected_link, edit_link['href'])
729+ response = self.app.get(edit_link['href'])
730+ ticket_rows = response.html.find('tbody', {'class':'ticket-list'})
731+ assert_in('test first ticket', str(ticket_rows))
732+ assert_in('test second ticket', str(ticket_rows))
733+ assert_in('test third ticket', str(ticket_rows))
734+
735+ def test_bulk_edit_search(self):
736+ self.new_ticket(summary='test first ticket', status='open')
737+ self.new_ticket(summary='test second ticket', status='open')
738+ self.new_ticket(summary='test third ticket', status='closed', _milestone='1.0')
739+ ThreadLocalORMSession.flush_all()
740+ M.MonQTask.run_ready()
741+ ThreadLocalORMSession.flush_all()
742+ response = self.app.get('/p/test/bugs/search/?q=status%3Aopen')
743+ ticket_rows = response.html.find('table', {'class':'ticket-list'}).find('tbody')
744+ assert_in('test first ticket', str(ticket_rows))
745+ assert_in('test second ticket', str(ticket_rows))
746+ assert_false('test third ticket' in str(ticket_rows))
747+ edit_link = response.html.find('a',{'title':'Bulk Edit'})
748+ expected_link = "/p/test/bugs/edit/?q=status%3Aopen&limit=25&page=0"
749+ assert_equal(expected_link, edit_link['href'])
750+ response = self.app.get(edit_link['href'])
751+ ticket_rows = response.html.find('tbody', {'class':'ticket-list'})
752+ assert_in('test first ticket', str(ticket_rows))
753+ assert_in('test second ticket', str(ticket_rows))
754+ assert_false('test third ticket' in str(ticket_rows))
755+
695756 class TestMilestoneAdmin(TrackerTestController):
696757 def _post(self, params, **kw):
697758 params['open_status_names'] = 'aa bb'
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -57,6 +57,22 @@ search_validators = dict(
5757 page=validators.Int(if_empty=0),
5858 sort=validators.UnicodeString(if_empty=None))
5959
60+def _mongo_col_to_solr_col(name):
61+ if name == 'ticket_num':
62+ return 'ticket_num_i'
63+ elif name == 'summary':
64+ return 'snippet_s'
65+ elif name == '_milestone':
66+ return 'milestone_s'
67+ elif name == 'status':
68+ return 'status_s'
69+ elif name == 'assigned_to':
70+ return 'assigned_to_s'
71+ else:
72+ for field in c.app.globals.sortable_custom_fields_shown_in_search():
73+ if name == field['name']:
74+ return field['sortable_name']
75+
6076 class W:
6177 thread=w.Thread(
6278 page=None, limit=None, page_size=None, count=None,
@@ -382,7 +398,7 @@ class RootController(BaseController):
382398 @with_trailing_slash
383399 @h.vardec
384400 @expose('jinja:forgetracker:templates/tracker/index.html')
385- def index(self, limit=25, columns=None, page=0, sort='ticket_num_i asc', **kw):
401+ def index(self, limit=25, columns=None, page=0, sort='ticket_num desc', **kw):
386402 kw.pop('q', None) # it's just our original query mangled and sent back to us
387403 result = TM.Ticket.paged_query(c.app.globals.not_closed_mongo_query,
388404 sort=sort, limit=int(limit),
@@ -392,6 +408,11 @@ class RootController(BaseController):
392408 result['allow_edit'] = has_access(c.app, 'write')()
393409 result['help_msg'] = c.app.config.options.get('TicketHelpSearch')
394410 result['url_q'] = c.app.globals.not_closed_query
411+ result['url_sort'] = ''
412+ if sort:
413+ sort_split = sort.split(' ')
414+ solr_col = _mongo_col_to_solr_col(sort_split[0])
415+ result['url_sort'] = '%s %s' % (solr_col, sort_split[1])
395416 c.ticket_search_results = W.ticket_search_results
396417 return result
397418
@@ -1413,7 +1434,13 @@ class MilestoneController(BaseController):
14131434 field=self.field,
14141435 milestone=self.milestone,
14151436 total=progress['hits'],
1416- closed=progress['closed'])
1437+ closed=progress['closed'],
1438+ q=self.progress_key)
1439+ result['url_sort'] = ''
1440+ if sort:
1441+ sort_split = sort.split(' ')
1442+ solr_col = _mongo_col_to_solr_col(sort_split[0])
1443+ result['url_sort'] = '%s %s' % (solr_col, sort_split[1])
14171444 c.ticket_search_results = W.ticket_search_results
14181445 c.auto_resize_textarea = W.auto_resize_textarea
14191446 return result