将部分配置转移成配置表形式 close #101
parent
d3d3f8f895
commit
6f74859edc
@ -1,9 +1,14 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
from .models import OAuthUser
|
from .models import OAuthUser, OAuthConfig
|
||||||
|
|
||||||
|
|
||||||
class OAuthUserAdmin(admin.ModelAdmin):
|
class OAuthUserAdmin(admin.ModelAdmin):
|
||||||
list_display = ('id', 'author', 'nikename', 'type', 'picture', 'email',)
|
list_display = ('id', 'author', 'nikename', 'type', 'picture', 'email',)
|
||||||
list_display_links = ('id', 'nikename')
|
list_display_links = ('id', 'nikename')
|
||||||
list_filter = ('author', 'type',)
|
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 django.test import TestCase
|
||||||
|
from .models import OAuthConfig
|
||||||
|
|
||||||
|
|
||||||
# Create your tests here.
|
# 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">
|
<div class="widget-login">
|
||||||
<small>
|
{% if apps %}
|
||||||
快捷登录:
|
<small>
|
||||||
</small>
|
快捷登录:
|
||||||
{% for icon,url in apps %}
|
</small>
|
||||||
<a href="{{ url }}" rel="nofollow">
|
{% for icon,url in apps %}
|
||||||
<span class="icon-sn-{{ icon }}"></span>
|
<a href="{{ url }}" rel="nofollow">
|
||||||
</a>
|
<span class="icon-sn-{{ icon }}"></span>
|
||||||
{% endfor %}
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,14 +1,6 @@
|
|||||||
<aside id="text-2" class="widget widget_text"><h3 class="widget-title">Google AdSense</h3>
|
<aside id="text-2" class="widget widget_text"><h3 class="widget-title">Google AdSense</h3>
|
||||||
<div class="textwidget">
|
<div class="textwidget">
|
||||||
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
|
||||||
<!-- auto_size -->
|
{{ GOOGLE_ADSENSE_CODES }}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
Loading…
Reference in new issue