Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
77b0954c
Commit
77b0954c
authored
Dec 13, 2019
by
Andrew Roberts
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use a macro for the display of boolean settings
parent
af7dbbf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
admin.html
cps/templates/admin.html
+12
-9
No files found.
cps/templates/admin.html
View file @
77b0954c
{% extends "layout.html" %}
{% macro display_bool_setting(setting_value) -%}
{% if setting_value %}
<span
class=
"glyphicon glyphicon-ok"
></span>
{% else %}
<span
class=
"glyphicon glyphicon-remove"
></span>
{% endif %}
{%- endmacro %}
{% block body %}
<div
class=
"container-fluid"
>
<div
class=
"row"
>
...
...
@@ -23,11 +26,11 @@
<td>
{{user.email}}
</td>
<td>
{{user.kindle_mail}}
</td>
<td>
{{user.downloads.count()}}
</td>
<td
class=
"hidden-xs"
>
{
% if user.role_admin() %}
<span
class=
"glyphicon glyphicon-ok"
></span>
{% else %}
<span
class=
"glyphicon glyphicon-remove"
></span>
{% endif %
}
</td>
<td
class=
"hidden-xs"
>
{
% if user.role_download() %}
<span
class=
"glyphicon glyphicon-ok"
></span>
{% else %}
<span
class=
"glyphicon glyphicon-remove"
></span>
{% endif %
}
</td>
<td
class=
"hidden-xs"
>
{
% if user.role_viewer() %}
<span
class=
"glyphicon glyphicon-ok"
></span>
{% else %}
<span
class=
"glyphicon glyphicon-remove"
></span>
{% endif %
}
</td>
<td
class=
"hidden-xs"
>
{
% if user.role_upload() %}
<span
class=
"glyphicon glyphicon-ok"
></span>
{% else %}
<span
class=
"glyphicon glyphicon-remove"
></span>
{% endif %
}
</td>
<td
class=
"hidden-xs"
>
{
% if user.role_edit() %}
<span
class=
"glyphicon glyphicon-ok"
></span>
{% else %}
<span
class=
"glyphicon glyphicon-remove"
></span>
{% endif %
}
</td>
<td
class=
"hidden-xs"
>
{
{ display_bool_setting(user.role_admin()) }
}
</td>
<td
class=
"hidden-xs"
>
{
{ display_bool_setting(user.role_download()) }
}
</td>
<td
class=
"hidden-xs"
>
{
{ display_bool_setting(user.role_viewer()) }
}
</td>
<td
class=
"hidden-xs"
>
{
{ display_bool_setting(user.role_upload()) }
}
</td>
<td
class=
"hidden-xs"
>
{
{ display_bool_setting(user.role_edit()) }
}
</td>
</tr>
{% endif %}
{% endfor %}
...
...
@@ -83,19 +86,19 @@
</div>
<div
class=
"row"
>
<div
class=
"col-xs-6 col-sm-7"
>
{{_('Uploading')}}
</div>
<div
class=
"col-xs-6 col-sm-5"
>
{
% if config.config_uploading %}
<span
class=
"glyphicon glyphicon-ok"
></span>
{% else %}
<span
class=
"glyphicon glyphicon-remove"
></span>
{% endif %
}
</div>
<div
class=
"col-xs-6 col-sm-5"
>
{
{ display_bool_setting(config.config_uploading) }
}
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-xs-6 col-sm-7"
>
{{_('Anonymous browsing')}}
</div>
<div
class=
"col-xs-6 col-sm-5"
>
{
% if config.config_anonbrowse %}
<span
class=
"glyphicon glyphicon-ok"
></span>
{% else %}
<span
class=
"glyphicon glyphicon-remove"
></span>
{% endif %
}
</div>
<div
class=
"col-xs-6 col-sm-5"
>
{
{ display_bool_setting(config.config_anonbrowse) }
}
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-xs-6 col-sm-7"
>
{{_('Public registration')}}
</div>
<div
class=
"col-xs-6 col-sm-5"
>
{
% if config.config_public_reg %}
<span
class=
"glyphicon glyphicon-ok"
></span>
{% else %}
<span
class=
"glyphicon glyphicon-remove"
></span>
{% endif %
}
</div>
<div
class=
"col-xs-6 col-sm-5"
>
{
{ display_bool_setting(config.config_public_reg) }
}
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-xs-6 col-sm-7"
>
{{_('Remote login')}}
</div>
<div
class=
"col-xs-6 col-sm-5"
>
{
% if config.config_remote_login %}
<span
class=
"glyphicon glyphicon-ok"
></span>
{% else %}
<span
class=
"glyphicon glyphicon-remove"
></span>
{% endif %
}
</div>
<div
class=
"col-xs-6 col-sm-5"
>
{
{ display_bool_setting(config.config_remote_login) }
}
</div>
</div>
</div>
<div
class=
"btn btn-default"
><a
id=
"basic_config"
href=
"{{url_for('admin.configuration')}}"
>
{{_('Basic Configuration')}}
</a></div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment