From c217bc7ead394bce7081446099d00b495acb9c1b Mon Sep 17 00:00:00 2001 From: Dominik George <nik@naturalnet.de> Date: Thu, 2 Aug 2018 13:31:33 +0200 Subject: [PATCH] Add stylesheet to replace labelcontent. --- django_starfield/templates/django_starfield/stars.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/django_starfield/templates/django_starfield/stars.html b/django_starfield/templates/django_starfield/stars.html index 664cdcf..d68168d 100644 --- a/django_starfield/templates/django_starfield/stars.html +++ b/django_starfield/templates/django_starfield/stars.html @@ -1,10 +1,14 @@ {% load static %} -<div class="django-starfield"> +<div class="django-starfield" id="django-starfield-{{ widget.name }}"> {% for i in stars %}<!-- --><input type="radio" name="{{ widget.name }}" id="{{ widget.name }}-{{ forloop.counter0 }}" value="{{ i }}" {% if widget.value == i %}checked="checked"{% endif %} /><!-- - --><label for="{{ widget.name }}-{{ forloop.counter0 }}" - style="content: '\{{ codepoint }}'">{{ i }}</label><!-- + --><label for="{{ widget.name }}-{{ forloop.counter0 }}">{{ i }}</label><!-- -->{% endfor %} </div> <link rel="stylesheet" href="{% static 'django_starfield.css' %}" /> +<style type="text/css"> + #django-starfield-{{ widget.name }} label { + content: '\{{ codepoint }}'; + } +</style> -- GitLab