Commit eb29f98c authored by Sli's avatar Sli

Merge branch 'bugfix' into 'master'

pedagogy: correctly fill star widget when editing comment

Closes #88

See merge request !223
parents 38ef13d9 d903dc58
Pipeline #1970 passed with stage
in 24 minutes and 36 seconds
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
</style> </style>
{# Do not vote button #}
<label class="star"> <label class="star">
<input type="radio" name="{{ widget.name }}" value="-1" onclick=' <input type="radio" name="{{ widget.name }}" value="-1" onclick='
var stars = document.getElementsByClassName("{{ widget.name }}"); var stars = document.getElementsByClassName("{{ widget.name }}");
...@@ -27,6 +28,8 @@ ...@@ -27,6 +28,8 @@
' checked> ' checked>
<span class="fa fa-times-circle"> {{ translations.do_not_vote }}</span> <span class="fa fa-times-circle"> {{ translations.do_not_vote }}</span>
</label> </label>
{# Star widget #}
{% for i in number_of_stars %} {% for i in number_of_stars %}
<label class="star"> <label class="star">
<input type="radio" name="{{ widget.name }}" value="{{ forloop.counter0 }}" onclick=' <input type="radio" name="{{ widget.name }}" value="{{ forloop.counter0 }}" onclick='
...@@ -47,4 +50,9 @@ ...@@ -47,4 +50,9 @@
</label> </label>
{% endfor %} {% endfor %}
{# Restaure previous (-1 is default) #}
<script type="text/javascript">
document.querySelector("input[name='{{ widget.name }}'][value='{{ widget.value }}']").click()
</script>
</div> </div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment