Compare commits
3 commits
master
...
show-hosti
Author | SHA1 | Date | |
---|---|---|---|
|
e51af13a31 | ||
|
c6f05889ff | ||
|
ac139c8a99 |
4 changed files with 42 additions and 2 deletions
|
@ -3,6 +3,7 @@ from cms.admin.placeholderadmin import PlaceholderAdminMixin
|
|||
from cms.extensions import PageExtensionAdmin
|
||||
from .cms_models import CMSIntegration, CMSFaviconExtension
|
||||
from .models import VMPricing, VMTemplate
|
||||
from hosting.models import UserHostingKey
|
||||
|
||||
|
||||
class CMSIntegrationAdmin(PlaceholderAdminMixin, admin.ModelAdmin):
|
||||
|
@ -17,3 +18,4 @@ admin.site.register(CMSIntegration, CMSIntegrationAdmin)
|
|||
admin.site.register(CMSFaviconExtension, CMSFaviconExtensionAdmin)
|
||||
admin.site.register(VMPricing)
|
||||
admin.site.register(VMTemplate)
|
||||
admin.site.register(UserHostingKey)
|
||||
|
|
|
@ -79,9 +79,9 @@ SECRET_KEY = env('DJANGO_SECRET_KEY')
|
|||
|
||||
INSTALLED_APPS = (
|
||||
# 1st migrate
|
||||
'hosting',
|
||||
'membership',
|
||||
'djangocms_admin_style',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.humanize',
|
||||
|
@ -144,7 +144,6 @@ INSTALLED_APPS = (
|
|||
# ungleich
|
||||
'ungleich',
|
||||
'ungleich_page',
|
||||
'hosting',
|
||||
'digitalglarus',
|
||||
'nosystemd',
|
||||
'datacenterlight',
|
||||
|
@ -154,6 +153,7 @@ INSTALLED_APPS = (
|
|||
'opennebula_api',
|
||||
'django_celery_results',
|
||||
'webhook',
|
||||
'django.contrib.admin',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
|
@ -196,6 +196,7 @@ TEMPLATES = [
|
|||
os.path.join(PROJECT_DIR, 'cms_templates/'),
|
||||
os.path.join(PROJECT_DIR, 'cms_templates/djangocms_blog/'),
|
||||
os.path.join(PROJECT_DIR, 'templates/gdpr'),
|
||||
os.path.join(PROJECT_DIR, 'templates'),
|
||||
],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
|
|
|
@ -208,6 +208,25 @@ class UserHostingKey(models.Model):
|
|||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
name = models.CharField(max_length=100)
|
||||
|
||||
def __str__(self):
|
||||
username = "None"
|
||||
email = "None"
|
||||
if self.user:
|
||||
username = self.user.username
|
||||
email = self.user.email
|
||||
display_str = '''Username: %s,
|
||||
Email: %s,
|
||||
Key name: %s,
|
||||
Created at: %s,
|
||||
Public Key: %s''' % (
|
||||
username,
|
||||
email,
|
||||
self.name,
|
||||
self.created_at,
|
||||
self.public_key
|
||||
)
|
||||
return display_str
|
||||
|
||||
@staticmethod
|
||||
def generate_RSA(bits=2048):
|
||||
'''
|
||||
|
|
18
templates/admin/base_site.html
Normal file
18
templates/admin/base_site.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% block extrahead %}
|
||||
<style>
|
||||
table {
|
||||
width: 90%;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table thead th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
th {
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
Loading…
Reference in a new issue