Skip to content

Commit

Permalink
change default kind for filter to 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
bukun committed Dec 1, 2022
1 parent ebcebae commit 7ec4459
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ database/whoosh
database/whoosh*

static/upload/
static/f2elib/
static/f2elib
static/tass/.sass-cache/
static/tass/sass/partial
templates/pycate/autogen/
templates/autogen/
templates/autogen

api_doc
api_html
Expand Down
19 changes: 14 additions & 5 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,35 @@
,
}

router_post = {'1': 'post',
}
router_post = {
'1': 'post',
'3': 'info',
}

post_type = {
'1': '''<span style="color:green;" class="glyphicon glyphicon-list-alt">[{0}]</span>
'''.format('Document'),
'3': '''<span style="color:blue;" class="glyphicon glyphicon-list-alt">[{0}]</span>
'''.format('Data'),
}
check_type = {
'1': 'Document',
'3': 'Filter',
}
post_cfg = {
'1': {
'': {
'router': 'post',
'html': '''<span style="color:green;" class="glyphicon glyphicon-list-alt">[{0}]</span>'''.format('Document'),
'checker': '1',
},

'3': {
'router': 'info',
'html': '''<span style="color:blue;" class="glyphicon glyphicon-list-alt">[{0}]</span>'''.format('Data'),
'checker': '10', # '10', '100', '1000', '10000'
}

}
kind_arr = ['1','9','m','s']
kind_arr = ['1', '3', 'm', 's']

from pathlib import Path

Expand Down
Binary file modified database/meta/info_tags.xlsx
Binary file not shown.
1 change: 0 additions & 1 deletion static/f2elib

This file was deleted.

6 changes: 2 additions & 4 deletions templates/theme/bage.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,8 @@
<a href="" class="dropdown-toggle" data-toggle="dropdown">{{ _('Data') }}
<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/meta_info_filter/2100">{{ _('Basic geographic') }}</a></li>
<li><a href="/meta_info_filter/2200">{{ _('Nature resources') }}</a></li>


<li><a href="/filter/2100">{{ _('Basic geographic') }}</a></li>
<li><a href="/filter/2200">{{ _('Nature resources') }}</a></li>
</ul>
</li>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@
{{ _('Most attention') }}
</div>
<ul class="list-group" id="mostall">
{% module post_most_view(5, with_date = False, with_catalog= False,kind='9') %}
{% module post_most_view(5, with_date = False, with_catalog= False,kind=postinfo.kind) %}
</ul>
</div>
<div class="panel panel-black">
<div class="panel-heading">
{{ _('Recent articles') }}
</div>
<ul class="list-group">
{% module post_recent(5, with_date = False, with_catalog= False,kind='9') %}
{% module post_recent(5, with_date = False, with_catalog= False,kind=postinfo.kind) %}
</ul>
</div>

Expand Down
2 changes: 1 addition & 1 deletion torcms/core/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

# For filter listing.
("/filter/(.*)", FilterHandler, {}),
("/info/(.*)", PostHandler, dict(kind='9', filter_view=True)),
("/info/(.*)", PostHandler, dict(kind='3', filter_view=True)),
("/label/(.*)", LabelHandler, {}),
("/user/(.*)", UserHandler, {}),
("/user_j/(.*)", UserPartialHandler, {}),
Expand Down
4 changes: 4 additions & 0 deletions torcms/handlers/filter_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ def echo_html(self, url_str):

num = (len(url_arr) - 2) // 2

print('=' * 40)
print(sig)
print('=' * 40)

catinfo = MCategory.get_by_uid(sig)

if catinfo.pid == '0000':
Expand Down
2 changes: 1 addition & 1 deletion torcms/modules/base_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class PostCategoryOf(tornado.web.UIModule):
def render(self, uid_with_str, **kwargs):
curinfo = MCategory.get_by_uid(uid_with_str)
sub_cats = MCategory.query_sub_cat(uid_with_str)
kind = kwargs.get('kind', '9')
kind = kwargs.get('kind', '2')
slug = kwargs.get('slug', False)
cat_dic = []
for cat in sub_cats:
Expand Down
2 changes: 0 additions & 2 deletions torcms_app/core/router.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding:utf-8 -*-
from torcms_metadata.handlers.meta_handler import MetadataHandler
from torcms_metadata.handlers.meta_filter_handler import MetaFilterHandler

_urls = [

Expand Down

0 comments on commit 7ec4459

Please sign in to comment.