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

{% block extra_style %}
{% render_bundle 'app' 'css' %}
{% endblock %}

{% block extra_script %}
<script type="text/javascript">
  var newOptions = {
    enableShareToDepartment: {% if enable_share_to_department %} true {% else %} false {% endif %},
    shareLinkExpireDaysDefault: {{ share_link_expire_days_default }},
    shareLinkExpireDaysMin: {{ share_link_expire_days_min }},
    shareLinkExpireDaysMax: {{ share_link_expire_days_max }},
    uploadLinkExpireDaysDefault: {{ upload_link_expire_days_default }},
    uploadLinkExpireDaysMin: {{ upload_link_expire_days_min }},
    uploadLinkExpireDaysMax: {{ upload_link_expire_days_max }}
  };
  for (var key in newOptions) {
    app.pageOptions[key] = newOptions[key];
  }
</script>
{% if request_from_onlyoffice_desktop_editor %}
<script type="text/javascript">
  var params = {
    "displayName": "{{request.user.username|email2nickname|escapejs}}",
    "email": "{{request.user.username|escapejs}}",
    "domain": "{{service_url}}",
    "provider": "seafile",
    "userId": "{{request.user.username|escapejs}}",
  };
  window.AscDesktopEditor.execCommand('portal:login', JSON.stringify(params));
</script>
{% endif %}
{% render_bundle 'app' 'js' %}
{% endblock %}
