将部分配置转移成配置表形式 close #101
parent
d3d3f8f895
commit
6f74859edc
@ -1,9 +1,14 @@
|
||||
from django.contrib import admin
|
||||
# Register your models here.
|
||||
from .models import OAuthUser
|
||||
from .models import OAuthUser, OAuthConfig
|
||||
|
||||
|
||||
class OAuthUserAdmin(admin.ModelAdmin):
|
||||
list_display = ('id', 'author', 'nikename', 'type', 'picture', 'email',)
|
||||
list_display_links = ('id', 'nikename')
|
||||
list_filter = ('author', 'type',)
|
||||
|
||||
|
||||
class OAuthConfigAdmin(admin.ModelAdmin):
|
||||
list_display = ('type', 'appkey', 'appsecret', 'is_enable')
|
||||
list_filter = ('type',)
|
||||
|
||||
@ -1,3 +1,12 @@
|
||||
from django.test import TestCase
|
||||
from .models import OAuthConfig
|
||||
|
||||
|
||||
# Create your tests here.
|
||||
class OAuthConfigTest(TestCase):
|
||||
def config_save_test(self):
|
||||
c = OAuthConfig()
|
||||
c.type = 'weibo'
|
||||
c.appkey = 'appkey'
|
||||
c.appsecret = 'appsecret'
|
||||
c.save()
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
<div class="widget-login">
|
||||
<small>
|
||||
快捷登录:
|
||||
</small>
|
||||
{% for icon,url in apps %}
|
||||
<a href="{{ url }}" rel="nofollow">
|
||||
<span class="icon-sn-{{ icon }}"></span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% if apps %}
|
||||
<small>
|
||||
快捷登录:
|
||||
</small>
|
||||
{% for icon,url in apps %}
|
||||
<a href="{{ url }}" rel="nofollow">
|
||||
<span class="icon-sn-{{ icon }}"></span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@ -1,14 +1,6 @@
|
||||
<aside id="text-2" class="widget widget_text"><h3 class="widget-title">Google AdSense</h3>
|
||||
<div class="textwidget">
|
||||
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
||||
<!-- auto_size -->
|
||||
<ins class="adsbygoogle"
|
||||
style="display:block"
|
||||
data-ad-client="ca-pub-3945824757398503"
|
||||
data-ad-slot="2462790325"
|
||||
data-ad-format="auto"></ins>
|
||||
<script>
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
</script>
|
||||
|
||||
{{ GOOGLE_ADSENSE_CODES }}
|
||||
</div>
|
||||
</aside>
|
||||
Loading…
Reference in new issue