Skip to content

Commit

Permalink
Fix viewing Publisher settings for other users
Browse files Browse the repository at this point in the history
Fix Visiblilty of read/unread category
  • Loading branch information
OzzieIsaacs committed Jan 26, 2019
1 parent 9128615 commit e8ce880
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cps/server.py
Expand Up @@ -25,7 +25,7 @@
import web

try:
from gevent.piwsgi import WSGIServer
from gevent.pywsgi import WSGIServer
from gevent.pool import Pool
from gevent import __version__ as geventVersion
gevent_present = True
Expand Down
4 changes: 3 additions & 1 deletion cps/templates/user_edit.html
Expand Up @@ -16,7 +16,7 @@ <h1>{{title}}</h1>
{% if ( g.user and g.user.role_passwd() or g.user.role_admin() ) and not content.role_anonymous() %}
{% if g.user and g.user.role_admin() and g.allow_registration and not new_user and not profile %}
<div class="btn btn-default" id="resend_password"><a href="{{url_for('reset_password', user_id = content.id) }}">{{_('Reset user Password')}}</a></div>
{% else %}
{% else %}
<div class="form-group">
<label for="password">{{_('Password')}}</label>
<input type="password" class="form-control" name="password" id="password" value="" autocomplete="off">
Expand Down Expand Up @@ -85,10 +85,12 @@ <h1>{{title}}</h1>
<input type="checkbox" name="show_publisher" id="show_publisher" {% if content.show_publisher() %}checked{% endif %}>
<label for="show_publisher">{{_('Show publisher selection')}}</label>
</div>
{% if not content.role_anonymous() %}
<div class="form-group">
<input type="checkbox" name="show_read_and_unread" id="show_read_and_unread" {% if content.show_read_and_unread() %}checked{% endif %}>
<label for="show_read_and_unread">{{_('Show read and unread')}}</label>
</div>
{% endif %}
<div class="form-group">
<input type="checkbox" name="show_detail_random" id="show_detail_random" {% if content.show_detail_random() %}checked{% endif %}>
<label for="show_detail_random">{{_('Show random books in detail view')}}</label>
Expand Down
5 changes: 5 additions & 0 deletions cps/web.py
Expand Up @@ -3280,6 +3280,11 @@ def edit_user(user_id):
elif "show_sorted" not in to_save and content.show_sorted():
content.sidebar_view -= ub.SIDEBAR_SORTED

if "show_publisher" in to_save and not content.show_publisher():
content.sidebar_view += ub.SIDEBAR_PUBLISHER
elif "show_publisher" not in to_save and content.show_publisher():
content.sidebar_view -= ub.SIDEBAR_PUBLISHER

if "show_hot" in to_save and not content.show_hot_books():
content.sidebar_view += ub.SIDEBAR_HOT
elif "show_hot" not in to_save and content.show_hot_books():
Expand Down

0 comments on commit e8ce880

Please sign in to comment.