allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [11/38] git commit: [#4019] ticket:481 Apply filter to bulk move and bulk edit
Date Wed, 30 Apr 2014 18:15:43 GMT
[#4019] ticket:481 Apply filter to bulk move and bulk edit


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

Branch: refs/heads/master
Commit: 3effe7b435717e4d4acbb636995004f8cc4165f1
Parents: d7cf7f9
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Dec 19 15:45:41 2013 +0200
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Apr 30 15:55:10 2014 +0000

----------------------------------------------------------------------
 .../forgetracker/templates/tracker/index.html   |  4 +-
 .../templates/tracker/milestone.html            |  4 +-
 .../forgetracker/templates/tracker/search.html  |  4 +-
 ForgeTracker/forgetracker/tracker_main.py       | 40 ++++++++------------
 4 files changed, 21 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/3effe7b4/ForgeTracker/forgetracker/templates/tracker/index.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/index.html b/ForgeTracker/forgetracker/templates/tracker/index.html
index 16f3bc8..1f4cf52 100644
--- a/ForgeTracker/forgetracker/templates/tracker/index.html
+++ b/ForgeTracker/forgetracker/templates/tracker/index.html
@@ -36,10 +36,10 @@
     {{c.subscribe_form.display(value=subscribed, action='subscribe', style='icon')}}
   {% endif %}
   {% 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>
+    <a href="{{tg.url(c.app.url+'edit/', dict(q=url_q, limit=limit, sort=url_sort, page=page,
filter=filter))}}" 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>
+    <a href="{{tg.url(c.app.url + 'move/', dict(q=url_q, limit=limit, sort=url_sort, page=page,
filter=filter))}}" title="Bulk Move"><b data-icon="" class=""></b>Bulk Move</a>
   {% endif %}
 {% endblock %}
 

http://git-wip-us.apache.org/repos/asf/allura/blob/3effe7b4/ForgeTracker/forgetracker/templates/tracker/milestone.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/milestone.html b/ForgeTracker/forgetracker/templates/tracker/milestone.html
index 07d6969..b7364ff 100644
--- a/ForgeTracker/forgetracker/templates/tracker/milestone.html
+++ b/ForgeTracker/forgetracker/templates/tracker/milestone.html
@@ -28,10 +28,10 @@
 {% block actions %}
 {{ lib.maximize_content_button() }}
 {% 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>
+  <a href="{{tg.url(c.app.url+'edit/', dict(q=q, limit=limit, sort=url_sort, page=page,
filter=filter))}}" 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>
+  <a href="{{tg.url(c.app.url + 'move/', dict(q=q, limit=limit, sort=url_sort, page=page,
filter=filter))}}" title="Bulk Move"><b data-icon="" class=""></b>Bulk Move</a>
 {% endif %}
 {% endblock %}
 

http://git-wip-us.apache.org/repos/asf/allura/blob/3effe7b4/ForgeTracker/forgetracker/templates/tracker/search.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/search.html b/ForgeTracker/forgetracker/templates/tracker/search.html
index a7c11f8..8c651a7 100644
--- a/ForgeTracker/forgetracker/templates/tracker/search.html
+++ b/ForgeTracker/forgetracker/templates/tracker/search.html
@@ -33,10 +33,10 @@
   {{ lib.maximize_content_button() }}
   <a href="{{tg.url(c.app.url+'search_feed/', dict(q=q, limit=limit, sort=sort))}}" title="Feed"><b
data-icon="{{g.icons['feed'].char}}" class="ico {{g.icons['feed'].css}}"></b></a>
 {% 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>
+  <a href="{{tg.url(c.app.url+'edit/', dict(q=q, limit=limit, sort=sort, page=page, filter=filter))}}"
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>
+  <a href="{{tg.url(c.app.url + 'move/', dict(q=q, limit=limit, sort=sort, page=page,
filter=filter))}}" title="Bulk Move"><b data-icon="" class=""></b>Bulk Move</a>
 {% endif %}
 {% endblock %}
 

http://git-wip-us.apache.org/repos/asf/allura/blob/3effe7b4/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 4618b68..64e34c4 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -864,13 +864,16 @@ class RootController(BaseController, FeedController):
     @with_trailing_slash
     @expose('jinja:forgetracker:templates/tracker/mass_edit.html')
     @validate(dict(q=validators.UnicodeString(if_empty=None),
+                   filter=V.JsonConverter(if_empty={}),
                    limit=validators.Int(if_empty=10, if_invalid=10),
                    page=validators.Int(if_empty=0, if_invalid=0),
                    sort=validators.UnicodeString(if_empty='ticket_num_i asc')))
-    def edit(self, q=None, limit=None, page=None, sort=None, **kw):
+    def edit(self, q=None, limit=None, page=None, sort=None, filter=None, **kw):
         require_access(c.app, 'update')
-        result = TM.Ticket.paged_search(
-            c.app.config, c.user, q, sort=sort, limit=limit, page=page, show_deleted=False,
**kw)
+        result = TM.Ticket.paged_search(c.app.config, c.user, q, filter=filter,
+                                        sort=sort, limit=limit, page=page,
+                                        show_deleted=False, **kw)
+
         # if c.app.globals.milestone_names is None:
         #     c.app.globals.milestone_names = ''
         result['columns'] = solr_columns()
@@ -889,13 +892,16 @@ class RootController(BaseController, FeedController):
     @with_trailing_slash
     @expose('jinja:forgetracker:templates/tracker/mass_move.html')
     @validate(dict(q=validators.UnicodeString(if_empty=None),
+                   filter=V.JsonConverter(if_empty={}),
                    limit=validators.Int(if_empty=10, if_invalid=10),
                    page=validators.Int(if_empty=0, if_invalid=0),
                    sort=validators.UnicodeString(if_empty='ticket_num_i asc')))
-    def move(self, q=None, limit=None, page=None, sort=None, **kw):
+    def move(self, q=None, limit=None, page=None, sort=None, filter=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 = TM.Ticket.paged_search(c.app.config, c.user, q, filter=filter,
+                                        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()
@@ -1805,48 +1811,32 @@ class MilestoneController(BaseController):
         self.milestone = m
         self.progress_key = '%s:%s' % (fld.name, m.name.replace(':', '\:'))
         self.mongo_query = {
-<<<<<<< HEAD
             'custom_fields.%s' % fld.name: m.name}
-=======
-            'custom_fields.%s' % fld.name: m.name }
         self.solr_query = '%s:%s' % (_mongo_col_to_solr_col(fld.name), m.name)
->>>>>>> [#4019] ticket:481 Switch mongo/solr query based on filter
 
     @with_trailing_slash
     @h.vardec
     @expose('jinja:forgetracker:templates/tracker/milestone.html')
     @validate(validators=dict(
-<<<<<<< HEAD
         limit=validators.Int(if_invalid=None),
         page=validators.Int(if_empty=0, if_invalid=0),
-        sort=validators.UnicodeString(if_empty=None),
+        sort=validators.UnicodeString(if_empty=''),
+        filter=V.JsonConverter(if_empty={}),
         deleted=validators.StringBool(if_empty=False)))
-    def index(self, q=None, columns=None, page=0, query=None, sort=None, deleted=False, **kw):
-=======
-            limit=validators.Int(if_invalid=None),
-            page=validators.Int(if_empty=0, if_invalid=0),
-            sort=validators.UnicodeString(if_empty=''),
-            filter=V.JsonConverter(if_empty={}),
-            deleted=validators.StringBool(if_empty=False)))
     def index(self, q=None, columns=None, page=0, query=None, sort=None,
               deleted=False, filter=None, **kw):
->>>>>>> [#4019] ticket:481 Switch mongo/solr query based on filter
         require(has_access(c.app, 'read'))
         show_deleted = [False]
         if deleted and has_access(c.app, 'delete'):
             show_deleted = [False, True]
 
-<<<<<<< HEAD
-        result = TM.Ticket.paged_query(c.app.config, c.user,
-                                       self.mongo_query, page=page, sort=sort, deleted={'$in':
show_deleted}, **kw)
-=======
         result = TM.Ticket.paged_query_or_search(c.app.config, c.user,
                                                  self.mongo_query,
                                                  self.solr_query,
                                                  filter, sort=sort, page=page,
                                                  deleted={'$in': show_deleted},
                                                  show_deleted=deleted, **kw)
->>>>>>> [#4019] ticket:481 Switch mongo/solr query based on filter
+
         result['columns'] = columns or mongo_columns()
         result[
             'sortable_custom_fields'] = c.app.globals.sortable_custom_fields_shown_in_search()


Mime
View raw message