浏览代码

[indexer] Make indexer lib work with its urls

Abraham Elmahrek 11 年之前
父节点
当前提交
beae907

+ 6 - 0
desktop/core/src/desktop/urls.py

@@ -113,6 +113,12 @@ if settings.OAUTH_AUTHENTICATION:
   static_patterns.append(static_pattern("liboauth_static",
         os.path.join(os.path.dirname(__file__), "..", '..', '..', "libs/liboauth/src/liboauth/static/")))
 
+# Add indexer app
+if 'search' in [app.name for app in appmanager.DESKTOP_APPS]:
+  dynamic_patterns.extend( patterns('', ('^indexer/', include('indexer.urls'))) )
+  static_patterns.append(static_pattern('indexer/static',
+                                        os.path.join(os.path.dirname(__file__), "..", '..', '..', "libs/indexer/static/")))
+
 # Root each app at /appname if they have a "urls" module
 for app in appmanager.DESKTOP_APPS:
   if app.urls:

+ 0 - 2
desktop/libs/indexer/src/indexer/api.py

@@ -291,8 +291,6 @@ def collections_data(request, collection_or_core):
   except Collection.DoesNotExist:
     raise Http404()
 
-  collection = json.loads(request.POST.get('collection', '{}'))
-
   if source == 'file':
     searcher = CollectionManagerController(request.user)
 

+ 1 - 2
desktop/libs/indexer/src/indexer/templates/collections.mako

@@ -86,7 +86,7 @@ ${ commonheader(_('Collection Manager'), "indexer", user, "29px") | n,unicode }
 
 
 <div class="search-bar" style="height: 30px">
-  <h4><a href="/indexer">${_('Collection Manager')}</a></h4>
+  <h4><a href="#manager">${_('Collection Manager')}</a></h4>
 </div>
 
 
@@ -381,7 +381,6 @@ ${ commonheader(_('Collection Manager'), "indexer", user, "29px") | n,unicode }
 <script src="/indexer/static/js/collections.js" type="text/javascript" charset="utf-8"></script>
 
 <script type="text/javascript">
-
 function validateAndUpdateCollection() {
   if (validateFields(ko.unwrap(vm.edit.collection))) {
     vm.edit.updateCollection().done(function(data) {