{% extends "base_for_react.html" %}
{% load seahub_tags i18n %}
{% load render_bundle from webpack_loader %}

{% block extra_style %}
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}seafile-editor/seafile-editor-font.css" />
{% endblock %}

{% block extra_script %}
<script type="text/javascript">
	window.sysadmin = {
		config: {},
		pageOptions: {
			constance_enabled: {% if constance_enabled %} true {% else %} false {% endif %},
			multi_tenancy: {% if multi_tenancy %} true {% else %} false {% endif %},
			multi_institution: {% if multi_institution %} true {% else %} false {% endif %},
      institutions: (function() {
        var list = ['']; // institution can set to be ''
        {% for inst in institutions %}
        list.push('{{inst|escapejs}}');
        {% endfor %}
        return list;
      })(),
			sysadmin_extra_enabled: {% if sysadmin_extra_enabled %} true {% else %} false {% endif %},
			enable_guest_invitation: {% if enable_guest_invitation %} true {% else %} false {% endif %},
			enable_terms_and_conditions: {% if enable_terms_and_conditions %} true {% else %} false {% endif %},
			is_default_admin: {% if is_default_admin %} true {% else %} false {% endif %},
      enable_file_scan: {% if enable_file_scan %} true {% else %} false {% endif %},
      enable_work_weixin: {% if enable_work_weixin %} true {% else %} false {% endif %},
      enable_dingtalk: {% if enable_dingtalk %} true {% else %} false {% endif %},
      enableSysAdminViewRepo: {% if enable_sys_admin_view_repo %} true {% else %} false {% endif %},
      trashReposExpireDays: {{ trash_repos_expire_days }},
      send_email_on_adding_system_member: {% if send_email_on_adding_system_member %} true {% else %} false {% endif %},
      twoFactorAuthEnabled: {% if two_factor_auth_enabled %} true {% else %} false {% endif %},
      availableRoles: (function() {
        var list = [];
        {% for role in available_roles %}
        list.push('{{role|escapejs}}');
        {% endfor %}
        return list;
      })(),
      availableAdminRoles: (function() {
        var list = [];
        {% for role in available_admin_roles %}
        list.push('{{role|escapejs}}');
        {% endfor %}
        return list;
      })(),
      haveLDAP: {% if have_ldap %} true {% else %} false {% endif %},
      enable_share_link_report_abuse: {% if enable_share_link_report_abuse %} true {% else %} false {% endif %},
			admin_permissions: {
        "can_view_system_info": {% if user.admin_permissions.can_view_system_info %} true {% else %} false {% endif %},
        "can_view_statistic": {% if user.admin_permissions.can_view_statistic %} true {% else %} false {% endif %},
        "can_config_system": {% if user.admin_permissions.can_config_system %} true {% else %} false {% endif %},
        "can_manage_library": {% if user.admin_permissions.can_manage_library %} true {% else %} false {% endif %},
        "can_manage_user": {% if user.admin_permissions.can_manage_user %} true {% else %} false {% endif %},
        "can_manage_group": {% if user.admin_permissions.can_manage_group %} true {% else %} false {% endif %},
        "can_view_user_log": {% if user.admin_permissions.can_view_user_log %} true {% else %} false {% endif %},
        "can_view_admin_log": {% if user.admin_permissions.can_view_admin_log %} true {% else %} false {% endif %},
        "other_permission": {% if user.admin_permissions.other_permission %} true {% else %} false {% endif %},
			}
		}
	};
</script>
{% render_bundle 'sysAdmin' %}
{% endblock %}
