Compare commits
2 commits
e94a856a08
...
24bc7816f1
Author | SHA1 | Date | |
---|---|---|---|
24bc7816f1 | |||
f0678c3379 |
3 changed files with 44 additions and 5 deletions
|
@ -1,19 +1,23 @@
|
|||
from django.contrib.staticfiles.storage import staticfiles_storage
|
||||
from django.urls import reverse
|
||||
from jinja2 import Environment
|
||||
from compressor.contrib.jinja2ext import CompressorExtension
|
||||
|
||||
from compressor.contrib.jinja2ext import CompressorExtension
|
||||
from django_activeurl.ext.django_jinja import ActiveUrl
|
||||
|
||||
from entries.kinds import all as entry_kinds
|
||||
from .utils import load_package_json
|
||||
|
||||
|
||||
def environment(**options):
|
||||
env = Environment(
|
||||
extensions=[CompressorExtension],
|
||||
extensions=[ActiveUrl, CompressorExtension],
|
||||
trim_blocks=True,
|
||||
lstrip_blocks=True,
|
||||
**options
|
||||
)
|
||||
env.globals.update({
|
||||
'entry_kinds': entry_kinds,
|
||||
'package': load_package_json(),
|
||||
'static': staticfiles_storage.url,
|
||||
'url': reverse,
|
||||
|
|
|
@ -31,8 +31,43 @@
|
|||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbar">
|
||||
</div>
|
||||
{% activeurl %}<div class="collapse navbar-collapse" id="navbar">
|
||||
<ul class="navbar-nav">
|
||||
{% for kind in entry_kinds %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ kind.index }}">
|
||||
<i class="{{ kind.icon }} fa-fw" aria-hidden="true"></i>
|
||||
{{ kind.plural }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<ul class="navbar-nav">
|
||||
{% if request.user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url('admin:index') }}">
|
||||
<i class="fas fa-cog fa-fw" aria-hidden="true"></i>
|
||||
admin
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url('lemonauth:logout') }}">
|
||||
<i class="fas fa-sign-out-alt fa-fw" aria-hidden="true"></i>
|
||||
log out
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url('lemonauth:login') }}">
|
||||
<i class="fas fa-sign-in-alt fa-fw" aria-hidden="true"></i>
|
||||
log in
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>{% endactiveurl %}
|
||||
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "lemoncurry",
|
||||
"version": "1.9.8",
|
||||
"repository": "https://gitlab.com/00dani/lemoncurry",
|
||||
"repository": "https://git.00dani.me/00dani/lemoncurry",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"js-yaml": "^3.10.0",
|
||||
|
|
Loading…
Reference in a new issue