Skip to content

Commit

Permalink
Fix visiblility upload right on enabled upload feature
Browse files Browse the repository at this point in the history
  • Loading branch information
OzzieIsaacs committed Nov 20, 2021
1 parent 6f5390e commit 6aad937
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions cps/admin.py
Expand Up @@ -1348,7 +1348,9 @@ def _handle_new_user(to_save, content, languages, translations, kobo_support):
raise Exception(_(u"E-mail is not from valid domain"))
except Exception as ex:
flash(str(ex), category="error")
return render_title_template("user_edit.html", new_user=1, content=content, translations=translations,
return render_title_template("user_edit.html", new_user=1, content=content,
config=config,
translations=translations,
languages=languages, title=_(u"Add new user"), page="newuser",
kobo_support=kobo_support, registered_oauth=oauth_check)
try:
Expand Down Expand Up @@ -1463,6 +1465,7 @@ def _handle_edit_user(to_save, content, languages, translations, kobo_support):
kobo_support=kobo_support,
new_user=0,
content=content,
config=config,
registered_oauth=oauth_check,
title=_(u"Edit User %(nick)s", nick=content.name),
page="edituser")
Expand Down Expand Up @@ -1496,7 +1499,8 @@ def new_user():
content.sidebar_view = config.config_default_show
content.locale = config.config_default_locale
content.default_language = config.config_default_language
return render_title_template("user_edit.html", new_user=1, content=content, translations=translations,
return render_title_template("user_edit.html", new_user=1, content=content,
config=config, translations=translations,
languages=languages, title=_(u"Add new user"), page="newuser",
kobo_support=kobo_support, registered_oauth=oauth_check)

Expand Down Expand Up @@ -1584,6 +1588,7 @@ def edit_user(user_id):
languages=languages,
new_user=0,
content=content,
config=config,
registered_oauth=oauth_check,
mail_configured=config.get_mail_server_configured(),
kobo_support=kobo_support,
Expand Down
4 changes: 2 additions & 2 deletions cps/templates/admin.html
Expand Up @@ -16,7 +16,7 @@ <h2>{{_('Users')}}</h2>
<th>{{_('Downloads')}}</th>
<th class="hidden-xs ">{{_('Admin')}}</th>
<th class="hidden-xs hidden-sm">{{_('Password')}}</th>
{% if config.config_upload %}
{% if config.config_uploading %}
<th class="hidden-xs hidden-sm">{{_('Upload')}}</th>
{% endif %}
<th class="hidden-xs hidden-sm">{{_('Download')}}</th>
Expand All @@ -34,7 +34,7 @@ <h2>{{_('Users')}}</h2>
<td>{{user.downloads.count()}}</td>
<td class="hidden-xs">{{ display_bool_setting(user.role_admin()) }}</td>
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_passwd()) }}</td>
{% if config.config_upload %}
{% if config.config_uploading %}
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_upload()) }}</td>
{% endif %}
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_download()) }}</td>
Expand Down
2 changes: 1 addition & 1 deletion cps/templates/config_view_edit.html
Expand Up @@ -95,7 +95,7 @@ <h4 class="panel-title">
<input type="checkbox" name="viewer_role" id="viewer_role" {% if conf.role_viewer() %}checked{% endif %}>
<label for="viewer_role">{{_('Allow eBook Viewer')}}</label>
</div>
{% if config.config_upload %}
{% if conf.config_uploading %}
<div class="form-group">
<input type="checkbox" name="upload_role" id="upload_role" {% if conf.role_upload() %}checked{% endif %}>
<label for="upload_role">{{_('Allow Uploads')}}</label>
Expand Down
2 changes: 1 addition & 1 deletion cps/templates/user_edit.html
Expand Up @@ -101,7 +101,7 @@ <h1>{{title}}</h1>
<input type="checkbox" name="viewer_role" id="viewer_role" {% if content.role_viewer() %}checked{% endif %}>
<label for="viewer_role">{{_('Allow eBook Viewer')}}</label>
</div>
{% if config.config_upload %}
{% if config.config_uploading %}
<div class="form-group">
<input type="checkbox" name="upload_role" id="upload_role" {% if content.role_upload() %}checked{% endif %}>
<label for="upload_role">{{_('Allow Uploads')}}</label>
Expand Down

0 comments on commit 6aad937

Please sign in to comment.