mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-23 07:23:46 +00:00
feat(custom_link): rename variable and import settings correctly
This commit is contained in:
parent
313af3e7f4
commit
89ba77c528
4 changed files with 9 additions and 8 deletions
|
@ -100,5 +100,5 @@ OPTIONNAL_APPS_RE2O = ()
|
||||||
# Some Django apps you want to add in you local project
|
# Some Django apps you want to add in you local project
|
||||||
OPTIONNAL_APPS = OPTIONNAL_APPS_RE2O + ()
|
OPTIONNAL_APPS = OPTIONNAL_APPS_RE2O + ()
|
||||||
|
|
||||||
# Some optinnal link for the navbar in a tuple (link,class,text)
|
# Some optinnal link for the navbar in a tuple (link,icon class,text)
|
||||||
OPTIONNAL_LINK_RE2O = ()
|
NAVBAR_LINKS = ()
|
|
@ -118,8 +118,8 @@ OPTIONNAL_APPS_RE2O = ()
|
||||||
# Some Django apps you want to add in you local project
|
# Some Django apps you want to add in you local project
|
||||||
OPTIONNAL_APPS = OPTIONNAL_APPS_RE2O + ()
|
OPTIONNAL_APPS = OPTIONNAL_APPS_RE2O + ()
|
||||||
|
|
||||||
# Some optinnal link for the navbar in a tuple (link,class,text)
|
# Some optinnal link for the navbar in a tuple (link,icon class,text)
|
||||||
OPTIONNAL_LINK_RE2O = ()
|
NAVBAR_LINKS= ()
|
||||||
|
|
||||||
# Add statiffiles dir that were installed using system packaging
|
# Add statiffiles dir that were installed using system packaging
|
||||||
# Example to reproduce re2o2.9 behavior
|
# Example to reproduce re2o2.9 behavior
|
||||||
|
|
|
@ -17,12 +17,13 @@
|
||||||
# You should have received a copy of the GNU General Public License along
|
# You should have received a copy of the GNU General Public License along
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.from django import template
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.from django import template
|
||||||
from re2o.settings_local import OPTIONNAL_LINK_RE2O
|
from django import template
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def nav_link_nologin():
|
def nav_link():
|
||||||
template = """
|
template = """
|
||||||
<li>
|
<li>
|
||||||
<a href="{}">
|
<a href="{}">
|
||||||
|
@ -31,6 +32,6 @@ def nav_link_nologin():
|
||||||
</li>
|
</li>
|
||||||
"""
|
"""
|
||||||
res = ""
|
res = ""
|
||||||
for link in OPTIONNAL_LINK_RE2O:
|
for link in settings.NAVBAR_LINKS:
|
||||||
res += template.format(link[0],link[1],link[2])
|
res += template.format(link[0],link[1],link[2])
|
||||||
return res
|
return res
|
|
@ -266,7 +266,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</li>
|
</li>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% autoescape off %}
|
{% autoescape off %}
|
||||||
{% nav_link_nologin %}
|
{% nav_link %}
|
||||||
{% endautoescape %}
|
{% endautoescape %}
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
|
Loading…
Reference in a new issue