Author: jure Date: Sun Mar 24 11:28:08 2013 New Revision: 1460314 URL: http://svn.apache.org/r1460314 Log: Sync merge from trunk
Modified: incubator/bloodhound/branches/bep_0003_multiproduct/ (props changed) incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_dashboard/bhdashboard/widgets/timeline.py incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_search/bhsearch/templates/bhsearch.html incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_search/setup.py incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/bloodhound.css incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html Propchange: incubator/bloodhound/branches/bep_0003_multiproduct/ ------------------------------------------------------------------------------ Merged /incubator/bloodhound/trunk:r1458693-1460312 Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_dashboard/bhdashboard/widgets/timeline.py URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_dashboard/bhdashboard/widgets/timeline.py?rev=1460314&r1=1460313&r2=1460314&view=diff ============================================================================== --- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_dashboard/bhdashboard/widgets/timeline.py (original) +++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_dashboard/bhdashboard/widgets/timeline.py Sun Mar 24 11:28:08 2013 @@ -37,6 +37,8 @@ from trac.resource import Resource, reso from trac.timeline.web_ui import TimelineModule from trac.ticket.api import TicketSystem from trac.ticket.model import Ticket +from trac.ticket.web_ui import TicketModule +from trac.util.datefmt import utc from trac.util.translation import _ from trac.web.chrome import add_stylesheet @@ -145,6 +147,15 @@ class TimelineWidget(WidgetBase): 'max', 'realm', 'id') start, days, user, precision, filters, count, realm, rid = \ self.bind_params(name, options, *params) + if context.resource.realm == 'ticket': + if days is None: + # calculate a long enough time daysback + ticket = Ticket(self.env, context.resource.id) + ticketage = datetime.now(utc) - ticket.time_created + days = ticketage.days + 1 + if count is None: + # ignore short count for ticket feeds + count = 0 if count is None: count = self.default_count @@ -225,6 +236,12 @@ class FilteredTimeline: process_request = TimelineModule.__dict__['process_request'] _provider_failure = TimelineModule.__dict__['_provider_failure'] _event_data = TimelineModule.__dict__['_event_data'] + max_daysback = TimelineModule.max_daysback + + @property + def max_daysback(self): + return (-1 if self.context.resource.realm == 'ticket' + else self.max_daysback) @property def event_providers(self): @@ -261,7 +278,17 @@ class TimelineFilterAdapter: # ITimelineEventProvider methods - #def get_timeline_filters(self, req): + def get_timeline_filters(self, req): + gen = self.provider.get_timeline_filters(req) + if (self.context.resource.realm == 'ticket' and + isinstance(self.provider, TicketModule) and + 'TICKET_VIEW' in req.perm): + # ensure ticket_details appears once if this is a query on a ticket + gen = list(gen) + if not [g for g in gen if g[0] == 'ticket_details']: + gen.append(('ticket_details', _("Ticket updates"), False)) + return gen + #def render_timeline_event(self, context, field, event): def get_timeline_events(self, req, start, stop, filters): Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_search/bhsearch/templates/bhsearch.html URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_search/bhsearch/templates/bhsearch.html?rev=1460314&r1=1460313&r2=1460314&view=diff ============================================================================== --- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_search/bhsearch/templates/bhsearch.html (original) +++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_search/bhsearch/templates/bhsearch.html Sun Mar 24 11:28:08 2013 @@ -126,7 +126,7 @@ <tr class="${'odd' if idx % 2 else 'even'} prio${result.priority_value}${ ' added' if 'added' in result else ''}${ ' changed' if 'changed' in result else ''}${ - ' removed' if 'removed' in result else ''} searchable"> + ' removed' if 'removed' in result else ''} highlight_matches"> <py:for each="idx, header in enumerate(headers)" py:choose=""> <py:with vars="name = header.name; value = result[name]; hilited_value=result['hilited_' + name]; title = _('View ')+ result['type']"> <td py:when="name == 'id'" class="id"><a href="$result.href" title="${title}" @@ -154,8 +154,8 @@ <!--Rendering results in free form--> <dl id="results"> <py:for each="result in results"> - <dt><a href="${result.href}" class="searchable">${result.title}</a></dt> - <dd class="searchable">${result.hilited_content or result.content}</dd> + <dt><a href="${result.href}" class="highlight_matches">${result.title}</a></dt> + <dd class="highlight_matches">${result.hilited_content or result.content}</dd> <dd> <py:if test="result.author"><span class="author" i18n:msg="author">By ${format_author(result.author)}</span> —</py:if> <span class="date">${result.date}</span> Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_search/setup.py URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_search/setup.py?rev=1460314&r1=1460313&r2=1460314&view=diff ============================================================================== --- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_search/setup.py (original) +++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_search/setup.py Sun Mar 24 11:28:08 2013 @@ -97,6 +97,10 @@ PKG_INFO = {'bhsearch' : ('bhsearch', 'htdocs/img/*.*', 'htdocs/js/*.js', 'templates/*', 'default-pages/*'], ), + 'bhsearch.search_resources' : ( + 'bhsearch/search_resources', # Package dir + [] + ), # 'search.widgets' : ('bhsearch/widgets', # Package dir # # Package data # ['templates/*', 'htdocs/*.css'], @@ -107,7 +111,12 @@ PKG_INFO = {'bhsearch' : ('bhsearch', # ), 'bhsearch.tests' : ('bhsearch/tests', # Package dir # Package data - ['data/**'], + ['data/*.*'], + ), + 'bhsearch.tests.search_resources' : ( + 'bhsearch/tests/search_resources', # Package dir + # Package data + ['data/*.*'], ), } @@ -139,7 +148,7 @@ setup( install_requires = [ 'setuptools>=0.6b1', 'Trac>=0.11', - 'whoosh>=2.4.1', + 'whoosh==2.4.1', ], package_dir = dict([p, i[0]] for p, i in PKG_INFO.iteritems()), packages = PKG_INFO.keys(), Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/bloodhound.css URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/bloodhound.css?rev=1460314&r1=1460313&r2=1460314&view=diff ============================================================================== --- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/bloodhound.css (original) +++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/htdocs/bloodhound.css Sun Mar 24 11:28:08 2013 @@ -476,7 +476,7 @@ span[contenteditable="true"]:focus { text-decoration: underline; } -.searchable em { +.highlight_matches em { font-style: inherit; font-weight: bold; } Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html?rev=1460314&r1=1460313&r2=1460314&view=diff ============================================================================== --- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html (original) +++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html Sun Mar 24 11:28:08 2013 @@ -98,7 +98,7 @@ method="get"> <div class="input-append"> <input type="text" class="span3" id="q" name="q" - placeholder="Search anything. Try #EF-492." + placeholder="Search all products. Try TracLinks." value="${req.search_query}" /> <input py:for="name, value in extra_search_fields" type="hidden"