|
|
@@ -19,6 +19,7 @@ from passlib.apps import custom_app_context as pwd_context
|
|
19
|
19
|
|
|
20
|
20
|
import strings
|
|
21
|
21
|
import utils
|
|
|
22
|
+import version
|
|
22
|
23
|
|
|
23
|
24
|
# pylint: disable=redefined-builtin
|
|
24
|
25
|
# pylint: disable=redefined-outer-name
|
|
|
@@ -67,7 +68,7 @@ ALLOWED_ATTRIBUTES = {
|
|
67
|
68
|
'img': ['src', 'alt'],
|
|
68
|
69
|
}
|
|
69
|
70
|
|
|
70
|
|
-# Default configuration
|
|
|
71
|
+# Default configuration.
|
|
71
|
72
|
DEFAULTS = [
|
|
72
|
73
|
( 'general', {
|
|
73
|
74
|
'dateformat': '%B %d, %Y',
|
|
|
@@ -76,6 +77,7 @@ DEFAULTS = [
|
|
76
|
77
|
'limit': 50,
|
|
77
|
78
|
'server_type': 'dev',
|
|
78
|
79
|
'user_fields': 'realname email homepage gravatar_email team location twitter facebook google_plus_ skype aim',
|
|
|
80
|
+ 'history_days': 7,
|
|
79
|
81
|
}),
|
|
80
|
82
|
( 'groups', {
|
|
81
|
83
|
'admins': '',
|
|
|
@@ -128,7 +130,7 @@ def get_features(config):
|
|
128
|
130
|
features = get_features(config)
|
|
129
|
131
|
|
|
130
|
132
|
def get_version():
|
|
131
|
|
- return subprocess.check_output('git describe --always --dirty --long'.split()).strip()
|
|
|
133
|
+ return version.__version__
|
|
132
|
134
|
|
|
133
|
135
|
def get_string(id):
|
|
134
|
136
|
"""Get a string gettext style. Splits the strings from the
|
|
|
@@ -376,9 +378,8 @@ class Model:
|
|
376
|
378
|
return '%d %ss' % (value, name)
|
|
377
|
379
|
|
|
378
|
380
|
def get_new(self):
|
|
379
|
|
- # Go back two days.
|
|
380
|
|
- since = now() - 60*60*24*3
|
|
381
|
|
- comments = db.select('1_comments', where='timestamp >= $since', vars={'since': since}, order='timestamp ASC')
|
|
|
381
|
+ since = now() - 60*60*24*config.get('general', 'history_days')
|
|
|
382
|
+ comments = db.select('1_comments', where='timestamp >= $since', order='timestamp ASC', limit=50, vars={'since': since}, )
|
|
382
|
383
|
# Pull out the unique links.
|
|
383
|
384
|
ids = {}
|
|
384
|
385
|
for comment in comments:
|