Skip to content

Commit

Permalink
add color picker to theme admin
Browse files Browse the repository at this point in the history
use html input color
  • Loading branch information
ahmednoureldeen committed Mar 14, 2019
1 parent 2fa55a9 commit 3777548
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions geonode/themes/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#
#########################################################################

from django import forms
from django.contrib import admin

from .models import Partner, GeoNodeThemeCustomization
Expand All @@ -28,7 +29,20 @@ class PartnerAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'title', 'href',)


class GeonodeThemCustomizationForm(forms.ModelForm):
class Meta:
model = GeoNodeThemeCustomization
widgets = {
'body_color': forms.TextInput(attrs={'type': 'color'}),
'navbar_color': forms.TextInput(attrs={'type': 'color'}),
'jumbotron_color': forms.TextInput(attrs={'type': 'color'}),
'copyright_color': forms.TextInput(attrs={'type': 'color'}),
}
fields = '__all__'


@admin.register(GeoNodeThemeCustomization)
class GeoNodeThemeCustomizationAdmin(admin.ModelAdmin):
form = GeonodeThemCustomizationForm
list_display = ('id', 'is_enabled', 'name', 'date', 'description')
list_display_links = ('id', 'name',)

0 comments on commit 3777548

Please sign in to comment.