mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed time-dependent jinja context
This commit is contained in:
parent
26f6a1af58
commit
ed1c595e20
@ -3,6 +3,7 @@ from . import filters
|
||||
|
||||
from .. import database, database_packed, malojatime, utilities, urihandler, malojauri
|
||||
from doreah import settings
|
||||
from doreah.regular import repeatdaily
|
||||
|
||||
import urllib
|
||||
import math
|
||||
@ -12,6 +13,16 @@ from jinja2 import Environment, PackageLoader, select_autoescape
|
||||
|
||||
dbp = database_packed.DB()
|
||||
|
||||
jinja_environment = Environment(
|
||||
loader=PackageLoader('maloja', "web/jinja"),
|
||||
autoescape=select_autoescape(['html', 'xml'])
|
||||
)
|
||||
|
||||
|
||||
@repeatdaily
|
||||
def update_jinja_environment():
|
||||
global JINJA_CONTEXT
|
||||
|
||||
JINJA_CONTEXT = {
|
||||
# maloja
|
||||
"db": database,
|
||||
@ -61,12 +72,9 @@ JINJA_CONTEXT = {
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
jinja_environment = Environment(
|
||||
loader=PackageLoader('maloja', "web/jinja"),
|
||||
autoescape=select_autoescape(['html', 'xml'])
|
||||
)
|
||||
jinja_environment.globals.update(JINJA_CONTEXT)
|
||||
|
||||
update_jinja_environment()
|
||||
jinja_environment.filters.update({k:filters.__dict__[k] for k in filters.__dict__ if not k.startswith("__")})
|
||||
|
||||
jinja_environment.trim_blocks = True
|
||||
|
@ -698,7 +698,7 @@ table.tiles_top td div {
|
||||
|
||||
table.tiles_top td span {
|
||||
background-color:rgba(0,0,0,0.7);
|
||||
display: inline-block;
|
||||
display: table-cell;
|
||||
padding: 3px;
|
||||
}
|
||||
table.tiles_top td a:hover {
|
||||
|
Loading…
Reference in New Issue
Block a user