Skip to content

Commit

Permalink
[admin] Applied preformatted style to keys
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Jul 14, 2016
1 parent ede3e55 commit e62d143
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions django_x509/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.contrib import admin
from django.contrib.admin import ModelAdmin as BaseAdmin
from django.contrib.admin.templatetags.admin_static import static

from .models import Ca, Cert

Expand Down Expand Up @@ -32,6 +33,9 @@ class AbstractAdmin(BaseAdmin):
'public_key',
'private_key')

class Media:
css = {'all': (static('django-x509/css/admin.css'),)}

def __init__(self, *args, **kwargs):
self.readonly_fields += ('created', 'modified')
super(AbstractAdmin, self).__init__(*args, **kwargs)
Expand Down
16 changes: 16 additions & 0 deletions django_x509/static/django-x509/css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.field-public_key p,
.field-public_key .vLargeTextField,
.field-private_key p,
.field-private_key .vLargeTextField{
font-family: monospace;
white-space: pre;
}
.field-public_key .vLargeTextField,
.field-private_key .vLargeTextField{
height: 350px;
}
.field-public_key p.help,
.field-private_key p.help{
font-family: inherit;
white-space: normal;
}

0 comments on commit e62d143

Please sign in to comment.