mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-01-20 11:30:11 +00:00
避免硬编码网站信息
This commit is contained in:
parent
a6bd787b86
commit
884d3ff980
@ -16,7 +16,7 @@
|
||||
{% block css_block %}{% endblock %}
|
||||
<!-- custom css end -->
|
||||
</head>
|
||||
|
||||
{% load website_info %}
|
||||
|
||||
<body>
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">qduoj</a>
|
||||
<a class="navbar-brand" href="/">{% show_website_info "website_name" %}</a>
|
||||
</div>
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
@ -88,7 +88,7 @@
|
||||
{% block js_block %}{% endblock %}
|
||||
<!-- footer begin -->
|
||||
<div class="footer">
|
||||
<p class="text-muted text-center">Copyright © 2015 青岛大学信息工程学院 创新实验室</p>
|
||||
<p class="text-muted text-center">Copyright © 2015 {% show_website_info "website_footer" %}</p>
|
||||
</div>
|
||||
<!-- footer end -->
|
||||
</body>
|
||||
|
8
utils/templatetags/website_info.py
Normal file
8
utils/templatetags/website_info.py
Normal file
@ -0,0 +1,8 @@
|
||||
# coding=utf-8
|
||||
from django import template
|
||||
register = template.Library()
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def show_website_info(name):
|
||||
return {"website_name": "qduoj", "website_footer": u"青岛大学创新实验室"}[name]
|
Loading…
x
Reference in New Issue
Block a user