1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-25 09:30:31 +00:00

Changed “have read” to checkbox

This commit is contained in:
Jack Darlington 2017-03-12 21:13:14 +00:00
parent 8f2088a3ea
commit 537977e497

View File

@ -109,14 +109,10 @@
{% endif %} {% endif %}
{% if not g.user.is_anonymous() %} {% if not g.user.is_anonymous() %}
<p> <p>
<div class="custom_columns" id="have_read"> <div class="custom_columns" id="have_read_container">
Read
{% if have_read %}
<span class="glyphicon glyphicon-ok"></span>
{% else %}
<span class="glyphicon glyphicon-remove"></span>
{% endif %}
<form id="have_read_form" action="{{ url_for('toggle_read', id=entry.id)}}" method="POST") > <form id="have_read_form" action="{{ url_for('toggle_read', id=entry.id)}}" method="POST") >
<input id="have_read_cb" type="checkbox" {% if have_read %}checked{% endif %} >
<label for="have_read_cb">{{_('Read')}}</label>
</form> </form>
</div> </div>
</p> </p>
@ -229,7 +225,7 @@
var haveReadForm = $('#have_read_form'); var haveReadForm = $('#have_read_form');
haveReadForm.ajaxForm(); haveReadForm.ajaxForm();
}); });
$("#have_read").attr('unselectable','on') $("#have_read_container").attr('unselectable','on')
.css({'-moz-user-select':'-moz-none', .css({'-moz-user-select':'-moz-none',
'-moz-user-select':'none', '-moz-user-select':'none',
'-o-user-select':'none', '-o-user-select':'none',
@ -238,7 +234,7 @@
'-ms-user-select':'none', '-ms-user-select':'none',
'user-select':'none' 'user-select':'none'
}).bind('selectstart', function(){ return false; }); }).bind('selectstart', function(){ return false; });
$("#have_read").click(function() { $("#have_read_container").click(function() {
var haveReadForm = $('#have_read_form'); var haveReadForm = $('#have_read_form');
if ($("#have_read").find('span').hasClass('glyphicon-ok')) { if ($("#have_read").find('span').hasClass('glyphicon-ok')) {
$("#have_read").find('span').removeClass('glyphicon-ok'); $("#have_read").find('span').removeClass('glyphicon-ok');