incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [16/42] git commit: [#6088] ticket:457 removed lightbox and moved search help to a new page
Date Tue, 29 Oct 2013 22:23:17 GMT
[#6088] ticket:457 removed lightbox and moved search help to a new page


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

Branch: refs/heads/cj/6692
Commit: b0c1db0c85c0bfb19d08f3f950236cf27e9d1056
Parents: 5da3d1f
Author: coldmind <sokandpal@yandex.ru>
Authored: Mon Oct 21 16:13:48 2013 +0300
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Oct 24 20:22:58 2013 +0000

----------------------------------------------------------------------
 .../forgetracker/templates/tracker/bin.html     |  5 +-
 .../forgetracker/templates/tracker/search.html  |  5 +-
 .../templates/tracker/search_help.html          | 87 ++++++++++++++++++++
 ForgeTracker/forgetracker/tracker_main.py       | 16 ++--
 .../forgetracker/widgets/ticket_search.py       | 60 --------------
 5 files changed, 101 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b0c1db0c/ForgeTracker/forgetracker/templates/tracker/bin.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/bin.html b/ForgeTracker/forgetracker/templates/tracker/bin.html
index acbb03d..5f83356 100644
--- a/ForgeTracker/forgetracker/templates/tracker/bin.html
+++ b/ForgeTracker/forgetracker/templates/tracker/bin.html
@@ -50,7 +50,7 @@
             <td class="edit" style="{% if not bin.error %}display:none{% else %}vertical-align:top{%
endif %}"><input type="text" name="bins-{{loop.index0}}.summary" value="{{bin.summary}}"></td>
             <td class="edit" {% if not bin.error %}style="display:none"{% endif %}>
                 <input class="grid-8" type="text" name="bins-{{loop.index0}}.terms" value="{{bin.terms}}">
-                <span class="grid-3"><a href="#" class="btn search_help_modal"><b
data-icon="{{g.icons['help'].char}}" class="ico {{g.icons['help'].css}}"></b> Help</a></span>
+                <span class="grid-3"><a href="../../../tickets/search_help/" target="_blank"
class="btn search_help_modal"><b data-icon="{{g.icons['help'].char}}" class="ico {{g.icons['help'].css}}"></b>
Help</a></span>
                 {% if bin.error %}<br/><span style="color:red">{{bin.error}}</span>{%
endif %}
             </td>
             <td style="width:40px;">
@@ -70,7 +70,7 @@
           </td>
           <td>
             <input class="grid-8" type="text" name="bins-{{num_bins}}.terms" placeholder="Terms"
{% if new_bin %}value="{{new_bin.terms}}"{% endif %}>
-            <span class="grid-3"><a href="#" class="btn search_help_modal"><b
data-icon="{{g.icons['help'].char}}" class="ico {{g.icons['help'].css}}"></b> Help</a></span>
+            <span class="grid-3"><a href="../../../tickets/search_help/" target="_blank"
class="btn search_help_modal"><b data-icon="{{g.icons['help'].char}}" class="ico {{g.icons['help'].css}}"></b>
Help</a></span>
             {% if new_bin and new_bin.error %}<br/><span class="err" style="color:red">{{new_bin.error}}</span>{%
endif %}
           </td>
           <td>&nbsp;</td>
@@ -87,7 +87,6 @@
       {% endif %}
     </div>
   </form>
-  {{c.search_help_modal.display()}}
 {% endblock %}
 
 {% block extra_js %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b0c1db0c/ForgeTracker/forgetracker/templates/tracker/search.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/search.html b/ForgeTracker/forgetracker/templates/tracker/search.html
index dda451d..ba9ece6 100644
--- a/ForgeTracker/forgetracker/templates/tracker/search.html
+++ b/ForgeTracker/forgetracker/templates/tracker/search.html
@@ -73,7 +73,8 @@
   {% 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>
+<a href="{{tg.url(c.app.url + 'search_help/')}}" target="_blank" class="btn search_help_modal"><b
data-icon="{{g.icons['help'].char}}" class="ico {{g.icons['help'].css}}"></b> Help</a>
+
 </div>
 <div style="clear:both"></div>
 {{c.ticket_search_results.display(solr_error=solr_error,
@@ -85,7 +86,7 @@
   columns=columns,
   page=page,
   sort=sort)}}
-{{c.search_help_modal.display()}}
+
 {% endblock %}
 
 {% block extra_js %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b0c1db0c/ForgeTracker/forgetracker/templates/tracker/search_help.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/search_help.html b/ForgeTracker/forgetracker/templates/tracker/search_help.html
new file mode 100644
index 0000000..8f34549
--- /dev/null
+++ b/ForgeTracker/forgetracker/templates/tracker/search_help.html
@@ -0,0 +1,87 @@
+{#-
+       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 g.theme.master %}
+
+{% do g.register_forge_css('css/forge/hilite.css') %}
+{% do g.register_app_css('css/tracker.css') %}
+
+{% block head %}
+  <link rel="alternate" type="application/rss+xml" title="RSS" href="feed.rss"/>
+  <link rel="alternate" type="application/atom+xml" title="Atom" href="feed.atom"/>
+{% endblock %}
+
+{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Search help{%
endblock %}
+
+{% block header %}Search help{% endblock %}
+
+{% block content%}
+<div><h1>Searching for tickets</h1>
+<p>Searches use <a href="http://www.solrtutorial.com/solr-query-syntax.html" target="_blank">solr
lucene query syntax</a>. Use the following fields in tracker ticket searches:</p>
+<ul>
+<li>User who owns the ticket - assigned_to</li>
+<li>Labels assigned to the ticket - labels</li>
+<li>Milestone the ticket is assigned to - _milestone</li>
+<li>Last modified date - mod_date</li>
+<li>Created date - created_date</li>
+<li>Body of the ticket - text</li>
+<li>Number of ticket - ticket_num</li>
+<li>User who created the ticket - reported_by</li>
+<li>Status of the ticket - status</li>
+<li>Title of the ticket - summary</li>
+<li>Private ticket - private</li>
+<li>Votes up/down of the ticket - votes_up/votes_down (if enabled in tool options)</li>
+<li>Votes total of the ticket - votes_total</li>
+<li>Imported legacy id - import_id</li>
+<li>Custom field - the field name with an underscore in front, like _custom</li>
+</ul>
+
+<h2>Example searches</h2>
+<p>Any ticket that is not closed in the 1.0 milestone with "foo" in the title</p>
+<div class="codehilite"><pre>!status:closed AND summary:foo* AND _milestone:1.0</pre></div>
+<p>Tickets with the label "foo" but not the label "bar":</p>
+<div class="codehilite"><pre>labels:foo AND -labels:bar</pre></div>
+<p>Tickets assigned to or added by a user with the username "admin1" and the custom
field "size" set to 2</p>
+<div class="codehilite"><pre>(assigned_to_s:admin1 or reported_by_s:admin1) AND
_size:2</pre></div>
+<p>The ticket has "foo" as the title or the body with a number lower than 50</p>
+<div class="codehilite"><pre>(summary:foo or text:foo) AND ticket_num:[* TO 50]</pre></div>
+<p>Tickets last modified in April 2012</p>
+<div class="codehilite"><pre>mod_date_dt:[2012-04-01T00:00:00Z TO 2012-04-30T23:59:59Z]</pre></div>
+<p>Private tickets</p>
+<div class="codehilite"><pre>private:true</pre></div>
+
+<h2>Saving searches</h2>
+<p>Ticket searches may be saved for later use by project administrators. To save a
search, click "Edit Searches" in the tracker sidebar. Click "Add Bin" then enter a summary
and search terms for the saved search. Your search will now show up in the sidebar under "Searches"
with a count of how many tickets match the query.</p>
+<h2>Sorting search results</h2>
+<p>Ticket search results can be sorted by clicking the header of the column you want
to sort by. The first click will sort the results in ascending order. Clicking the header
again will sort the column in descending order. In addition to sorting by the column headers,
you can manually sort on these properties:</p>
+<ul>
+<li>Labels assigned to the ticket - labels_t</li>
+<li>Milestone the ticket is assigned to - _milestone_s</li>
+<li>Last modified date - mod_date_dt</li>
+<li>Created date - created_date_dt</li>
+<li>Body of the ticket - text_s</li>
+<li>Number of ticket - ticket_num_i</li>
+<li>User who created the ticket - reported_by_s</li>
+<li>Status of the ticket - status_s</li>
+<li>Title of the ticket - snippet_s</li>
+<li>Private ticket - private_b</li>
+<li>Custom field - the field name with an _ in front and _s at the end like _custom_s.
For Boolean custom fields use _b instead of _s. For Number custom fields use _i.</li>
+</ul>
+<p>You can use these properties by appending them to the url (only one sort allowed
at a time) like this:</p>
+<div class="codehilite"><pre>/p/yourproject/tickets/search/?q=_milestone:1.0&amp;sort=snippet_s+asc</pre></div></div>
+{% endblock %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b0c1db0c/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index b772e06..afb4079 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -72,7 +72,7 @@ from forgetracker import tasks
 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,
MassMoveForm, SearchHelp
+from forgetracker.widgets.ticket_search import TicketSearchResults, MassEdit, MassEditForm,
MassMoveForm
 from forgetracker.widgets.admin_custom_fields import TrackerFieldAdmin, TrackerFieldDisplay
 from forgetracker.import_support import ImportSupport
 
@@ -182,7 +182,6 @@ class W:
     field_display = TrackerFieldDisplay()
     ticket_custom_field = TicketCustomField
     options_admin = OptionsAdmin()
-    search_help_modal = SearchHelp()
     vote_form = w.VoteForm()
     move_ticket_form = w.forms.MoveTicketForm
     mass_move_form = MassMoveForm
@@ -710,7 +709,6 @@ class RootController(BaseController, FeedController):
         if query and not q:
             q = query
         c.bin_form = W.bin_form
-        c.search_help_modal = W.search_help_modal
         bin = None
         if q:
             bin = TM.Bin.query.find(dict(app_config_id=c.app.config._id,terms=q)).first()
@@ -762,6 +760,14 @@ class RootController(BaseController, FeedController):
         else:
             raise exc.HTTPNotFound
 
+
+    @with_trailing_slash
+    @expose('jinja:forgetracker:templates/tracker/search_help.html')
+    def search_help(self):
+        'Static page with search help'
+        return dict()
+
+
     @with_trailing_slash
     @expose('jinja:forgetracker:templates/tracker/new_ticket.html')
     def new(self, description=None, summary=None, labels=None, **kw):
@@ -982,14 +988,12 @@ class BinController(BaseController):
     @expose('jinja:forgetracker:templates/tracker/bin.html')
     def index(self, **kw):
         count = len(self.app.bins)
-        c.search_help_modal = W.search_help_modal
         return dict(bins=self.app.bins, count=count, app=self.app)
 
     @with_trailing_slash
     @expose('jinja:forgetracker:templates/tracker/bin.html')
     def bins(self):
         count = len(self.app.bins)
-        c.search_help_modal = W.search_help_modal
         return dict(bins=self.app.bins, count=count, app=self.app)
 
     @with_trailing_slash
@@ -1014,7 +1018,6 @@ class BinController(BaseController):
         so the user can fix.
         """
         # New search bin that the user is attempting to create
-        c.search_help_modal = W.search_help_modal
         new_bin = None
         bin = bin_form['_id']
         if bin is None:
@@ -1065,7 +1068,6 @@ class BinController(BaseController):
         page and display the error(s) so the user can fix.
         """
         require_access(self.app, 'save_searches')
-        c.search_help_modal = W.search_help_modal
         # Have any of the updated searches thrown an error?
         errors = False
         # Persistent search bins - will need this if we encounter errors

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b0c1db0c/ForgeTracker/forgetracker/widgets/ticket_search.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/ticket_search.py b/ForgeTracker/forgetracker/widgets/ticket_search.py
index fdc257a..2369512 100644
--- a/ForgeTracker/forgetracker/widgets/ticket_search.py
+++ b/ForgeTracker/forgetracker/widgets/ticket_search.py
@@ -92,63 +92,3 @@ class MassMoveForm(forms.MoveTicketForm):
 
     def resources(self):
         yield ew.JSLink('tracker_js/mass-edit.js')
-
-class SearchHelp(ffw.Lightbox):
-    defaults=dict(
-        ffw.Lightbox.defaults,
-        name='search_help_modal',
-        trigger='a.search_help_modal',
-        content="""<div style="height:400px; overflow:auto;"><h1>Searching for
tickets</h1>
-<p>Searches use <a href="http://www.solrtutorial.com/solr-query-syntax.html" target="_blank">solr
lucene query syntax</a>. Use the following fields in tracker ticket searches:</p>
-<ul>
-<li>User who owns the ticket - assigned_to</li>
-<li>Labels assigned to the ticket - labels</li>
-<li>Milestone the ticket is assigned to - _milestone</li>
-<li>Last modified date - mod_date</li>
-<li>Created date - created_date</li>
-<li>Body of the ticket - text</li>
-<li>Number of ticket - ticket_num</li>
-<li>User who created the ticket - reported_by</li>
-<li>Status of the ticket - status</li>
-<li>Title of the ticket - summary</li>
-<li>Private ticket - private</li>
-<li>Votes up/down of the ticket - votes_up/votes_down (if enabled in tool options)</li>
-<li>Votes total of the ticket - votes_total</li>
-<li>Imported legacy id - import_id</li>
-<li>Custom field - the field name with an underscore in front, like _custom</li>
-</ul>
-
-<h2>Example searches</h2>
-<p>Any ticket that is not closed in the 1.0 milestone with "foo" in the title</p>
-<div class="codehilite"><pre>!status:closed AND summary:foo* AND _milestone:1.0</pre></div>
-<p>Tickets with the label "foo" but not the label "bar":</p>
-<div class="codehilite"><pre>labels:foo AND -labels:bar</pre></div>
-<p>Tickets assigned to or added by a user with the username "admin1" and the custom
field "size" set to 2</p>
-<div class="codehilite"><pre>(assigned_to_s:admin1 or reported_by_s:admin1) AND
_size:2</pre></div>
-<p>The ticket has "foo" as the title or the body with a number lower than 50</p>
-<div class="codehilite"><pre>(summary:foo or text:foo) AND ticket_num:[* TO 50]</pre></div>
-<p>Tickets last modified in April 2012</p>
-<div class="codehilite"><pre>mod_date_dt:[2012-04-01T00:00:00Z TO 2012-04-30T23:59:59Z]</pre></div>
-<p>Private tickets</p>
-<div class="codehilite"><pre>private:true</pre></div>
-
-<h2>Saving searches</h2>
-<p>Ticket searches may be saved for later use by project administrators. To save a
search, click "Edit Searches" in the tracker sidebar. Click "Add Bin" then enter a summary
and search terms for the saved search. Your search will now show up in the sidebar under "Searches"
with a count of how many tickets match the query.</p>
-<h2>Sorting search results</h2>
-<p>Ticket search results can be sorted by clicking the header of the column you want
to sort by. The first click will sort the results in ascending order. Clicking the header
again will sort the column in descending order. In addition to sorting by the column headers,
you can manually sort on these properties:</p>
-<ul>
-<li>Labels assigned to the ticket - labels_t</li>
-<li>Milestone the ticket is assigned to - _milestone_s</li>
-<li>Last modified date - mod_date_dt</li>
-<li>Created date - created_date_dt</li>
-<li>Body of the ticket - text_s</li>
-<li>Number of ticket - ticket_num_i</li>
-<li>User who created the ticket - reported_by_s</li>
-<li>Status of the ticket - status_s</li>
-<li>Title of the ticket - snippet_s</li>
-<li>Private ticket - private_b</li>
-<li>Custom field - the field name with an _ in front and _s at the end like _custom_s.
For Boolean custom fields use _b instead of _s. For Number custom fields use _i.</li>
-</ul>
-<p>You can use these properties by appending them to the url (only one sort allowed
at a time) like this:</p>
-<div class="codehilite"><pre>/p/yourproject/tickets/search/?q=_milestone:1.0&amp;sort=snippet_s+asc</pre></div></div>
-""")


Mime
View raw message