mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Replaced settings calls in jinja files
This commit is contained in:
parent
6ccbf68923
commit
df22a595b8
@ -1,8 +1,8 @@
|
||||
from .. import database_packed
|
||||
from . import filters
|
||||
from .globalconf import malojaconfig
|
||||
|
||||
from .. import database, database_packed, malojatime, utilities, malojauri
|
||||
from doreah import settings
|
||||
from doreah.regular import repeatdaily
|
||||
|
||||
import urllib
|
||||
@ -30,7 +30,7 @@ def update_jinja_environment():
|
||||
"malojatime": malojatime,
|
||||
"utilities": utilities,
|
||||
"mlj_uri": malojauri,
|
||||
"settings": settings.get_settings,
|
||||
"settings": malojaconfig,
|
||||
# external
|
||||
"urllib": urllib,
|
||||
"math":math,
|
||||
|
@ -48,7 +48,7 @@
|
||||
<span>Get your own Maloja scrobble server on <a target="_blank" rel="noopener noreferrer" href="https://pypi.org/project/malojaserver/">PyPI</a></span>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/"><span style="font-weight:bold;">Maloja {% if settings("DEV_MODE") %}[Developer Mode]{% endif %}</span></a>
|
||||
<a href="/"><span style="font-weight:bold;">Maloja {% if settings["DEV_MODE"] %}[Developer Mode]{% endif %}</span></a>
|
||||
</div>
|
||||
<div>
|
||||
<span><input id="searchinput" placeholder="Search for an artist or track..." oninput="search(this)" onblur="clearresults()" /></span>
|
||||
|
@ -35,7 +35,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
{% if settings('CHARTS_DISPLAY_TILES') %}
|
||||
{% if settings['CHARTS_DISPLAY_TILES'] %}
|
||||
{% include 'partials/charts_artists_tiles.jinja' %}
|
||||
<br/><br/>
|
||||
{% endif %}
|
||||
|
@ -37,7 +37,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
{% if settings('CHARTS_DISPLAY_TILES') %}
|
||||
{% if settings['CHARTS_DISPLAY_TILES'] %}
|
||||
{% include 'partials/charts_tracks_tiles.jinja' %}
|
||||
<br/><br/>
|
||||
{% endif %}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<td class='icon'><div style="background-image:url('{{ img }}')"></div></td>
|
||||
{% if "artists" in entity %}
|
||||
{% if settings('TRACK_SEARCH_PROVIDER') is not none %}
|
||||
{% if settings['TRACK_SEARCH_PROVIDER'] %}
|
||||
<td class='searchProvider'>{{ links.link_search(entity) }}</td>
|
||||
{% endif %}
|
||||
<td class='track'>
|
||||
|
@ -62,7 +62,7 @@
|
||||
{% macro link_search(entity) -%}
|
||||
{% set searchstr = (entity.artists + [entity.title]) | join(" ") | urlencode %}
|
||||
|
||||
{% set searchprovider = settings('TRACK_SEARCH_PROVIDER') | lower | replace(' ','') %}
|
||||
{% set searchprovider = settings['TRACK_SEARCH_PROVIDER'] | lower | replace(' ','') %}
|
||||
{% set searchproviders =
|
||||
{
|
||||
"youtube":'https://www.youtube.com/results?search_query=',
|
||||
|
@ -31,7 +31,7 @@
|
||||
{% for r in xcurrent %}
|
||||
{% if r.range == limitkeys.timerange %}
|
||||
<span class='stat_selector' style='opacity:0.5;'>{{ r.localisation }}</span>
|
||||
{% elif r.heavy and settings('DISCOURAGE_CPU_HEAVY_STATS') %}
|
||||
{% elif r.heavy and settings['DISCOURAGE_CPU_HEAVY_STATS'] %}
|
||||
<span class='stat_selector blocked' title="CPU heavy statistics are discouraged at the moment.">{{ r.localisation }}</span>
|
||||
{% else %}
|
||||
<a href='{{ mlj_uri.create_uri("",allkeys,{"timerange":r.range}) }}'><span class='stat_selector'>{{ r.localisation }}</span></a>
|
||||
@ -49,7 +49,7 @@
|
||||
{# {% if all(r.keys[k] == allkeys[k] for k in r.keys) %} #}
|
||||
{% if r.replacekeys | map('compare_key_in_dicts',r.replacekeys,allkeys) | alltrue %}
|
||||
<span class='stat_selector' style='opacity:0.5;'>{{ r.localisation }}</span>
|
||||
{% elif r.heavy and settings('DISCOURAGE_CPU_HEAVY_STATS') %}
|
||||
{% elif r.heavy and settings['DISCOURAGE_CPU_HEAVY_STATS'] %}
|
||||
<span class='stat_selector blocked' title="CPU heavy statistics are discouraged at the moment.">{{ r.localisation }}</span>
|
||||
{% else %}
|
||||
<a href='{{ mlj_uri.create_uri("",allkeys,r.replacekeys) }}'><span class='stat_selector'>{{ r.localisation }}</span></a>
|
||||
|
@ -4,9 +4,9 @@
|
||||
{% block scripts %}
|
||||
|
||||
<script>document.addEventListener('DOMContentLoaded',function() {
|
||||
showRange('topartists','{{ settings("DEFAULT_RANGE_CHARTS_ARTISTS") }}');
|
||||
showRange('toptracks','{{ settings("DEFAULT_RANGE_CHARTS_TRACKS") }}');
|
||||
showRange('pulse','{{ settings("DEFAULT_STEP_PULSE") }}');
|
||||
showRange('topartists','{{ settings["DEFAULT_RANGE_CHARTS_ARTISTS"] }}');
|
||||
showRange('toptracks','{{ settings["DEFAULT_RANGE_CHARTS_TRACKS"] }}');
|
||||
showRange('pulse','{{ settings["DEFAULT_STEP_PULSE"] }}');
|
||||
})</script>
|
||||
<script src="/rangeselect.js"></script>
|
||||
<script src="/cookies.js"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user