From 6bd3acfe902579c4945f2c6a44db0fa11812d1f9 Mon Sep 17 00:00:00 2001 From: Dominik George <nik@naturalnet.de> Date: Thu, 2 Aug 2018 12:48:52 +0200 Subject: [PATCH] Add stylesheet. --- django_starfield/static/django_starfield.css | 69 +++++++++++++++++++ .../templates/django_starfield/stars.html | 15 ++-- 2 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 django_starfield/static/django_starfield.css diff --git a/django_starfield/static/django_starfield.css b/django_starfield/static/django_starfield.css new file mode 100644 index 0000000..95171d4 --- /dev/null +++ b/django_starfield/static/django_starfield.css @@ -0,0 +1,69 @@ +/* + * Selectable CSS3 Rating Stars by Martin Ivanov (@wemakesitesnet) + * @version 1.0 + * @author Martin Ivanov + * @url portfolio http://wemakesites.net/ + * @url twitter https://twitter.com/wemakesitesnet + * @url blog http://acidmartin.wordpress.com/ + **/ + +/* Work was allegedly released into the public domain, + * as laid out by e-mail. + */ + +.django-starfield, +.django-starfield label::before +{ + display: inline-block; +} + +.django-starfield label:hover, +.django-starfield label:hover ~ label +{ + color: #189800; +} + +.django-starfield * +{ + margin: 0; + padding: 0; +} + +.django-starfield input +{ + display: none; +} + +.django-starfield +{ + unicode-bidi: bidi-override; + direction: rtl; +} + +.django-starfield label +{ + color: #ccc; +} + +.django-starfield label::before +{ + width: 18px; + line-height: 18px; + text-align: center; + font-size: 18px; + cursor: pointer; +} + +.django-starfield input:checked ~ label +{ + color: #f5b301; +} + +.acidjs-rating-disabled +{ + opacity: .50; + + -webkit-pointer-events: none; + -moz-pointer-events: none; + pointer-events: none; +} diff --git a/django_starfield/templates/django_starfield/stars.html b/django_starfield/templates/django_starfield/stars.html index 909ef27..89e1bfc 100644 --- a/django_starfield/templates/django_starfield/stars.html +++ b/django_starfield/templates/django_starfield/stars.html @@ -1,6 +1,9 @@ -{% for i in stars %}<!-- ---><input type="radio" name="{{ name }}" id="{{ name }}-{{ forloop.counter0 }}" - value="{{ i }}" {% if value == i %}checked="checked"{% endif %} /><!-- - --><label for="{{ name }}-{{ forloop.counter0 }}" - style="content: '\{{ codepoint }}'">{{ i }}</label><!-- --->{% endfor %} +<div class="django-starfield"> + {% for i in stars %}<!-- + --><input type="radio" name="{{ name }}" id="{{ name }}-{{ forloop.counter0 }}" + value="{{ i }}" {% if value == i %}checked="checked"{% endif %} /><!-- + --><label for="{{ name }}-{{ forloop.counter0 }}" + style="content: '\{{ codepoint }}'">{{ i }}</label><!-- + -->{% endfor %} +</div> +<link rel="stylesheet" url="{% static 'django_starfield/django_starfield.css' %}" /> -- GitLab