diff --git a/base/context_processors.py b/base/context_processors.py index 08e2f2c8a6..1cb9bde363 100644 --- a/base/context_processors.py +++ b/base/context_processors.py @@ -6,7 +6,8 @@ and returns a dictionary to add to the context. These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ -import settings +from settings import SEAFILE_VERSION +from settings import SEAHUB_TITLE def base(request): """ @@ -14,8 +15,9 @@ def base(request): """ return { - 'seafile_version': settings.SEAFILE_VERSION, - 'seahub_title': settings.SEAHUB_TITLE, + 'seafile_version': SEAFILE_VERSION, + 'seahub_title': SEAHUB_TITLE, + 'official_mode': request.official_mode, # 'account_type': settings.ACCOUNT_TYPE, } diff --git a/organizations/middleware.py b/organizations/middleware.py index 3e74c1e7ff..197b2a0792 100644 --- a/organizations/middleware.py +++ b/organizations/middleware.py @@ -5,9 +5,9 @@ from seaserv import get_org_by_url_prefix, get_orgs_by_user from settings import ORG_CACHE_PREFIX try: - from seahub.settings import USE_ORG + from seahub.settings import OFFICIAL_MODE except ImportError: - USE_ORG = False + OFFICIAL_MODE = False class OrganizationMiddleware(object): """ @@ -16,8 +16,8 @@ class OrganizationMiddleware(object): """ def process_request(self, request): - if USE_ORG: - request.use_org = True + if OFFICIAL_MODE: + request.official_mode = True # Get current org context org = cache.get(ORG_CACHE_PREFIX + request.user.username) @@ -27,7 +27,7 @@ class OrganizationMiddleware(object): orgs = get_orgs_by_user(request.user.username) request.user.orgs = orgs else: - request.use_org = False + request.official_mode = False request.user.org = None request.user.orgs = None diff --git a/settings.py b/settings.py index 1f34ee7f99..8462dd1a4e 100644 --- a/settings.py +++ b/settings.py @@ -233,4 +233,4 @@ LOGIN_URL = SITE_ROOT + 'accounts/login' USER_TOTAL_SPACE = 2 * pow(2,30) -SEAFILE_VERSION = '0.9.4' +SEAFILE_VERSION = '0.9.5' diff --git a/templates/admin_base.html b/templates/admin_base.html index 301373701a..b1110d74ce 100644 --- a/templates/admin_base.html +++ b/templates/admin_base.html @@ -12,7 +12,7 @@
  • 小组管理
  • - {% if request.use_org %} + {% if request.official_mode %}
  • 团体管理
  • diff --git a/templates/base.html b/templates/base.html index a777f8eaff..d89861d25c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -27,7 +27,7 @@
    {% if request.user.is_authenticated %} - {% if request.use_org %} + {% if official_mode %} {% if org %} {{ org.org_name }} {% else %} 个人帐号 {% endif %} {% endif %} diff --git a/templates/myhome.html b/templates/myhome.html index a29146bf2f..33d1a0bf4b 100644 --- a/templates/myhome.html +++ b/templates/myhome.html @@ -22,7 +22,7 @@ {% endif %}

    已用空间

    -

    {{ quota_usage|filesizeformat }} / 2 GB

    +

    {{ quota_usage|filesizeformat }} {% if official_mode %}/ 2 GB {% endif %}

    我管理的小组

    {% if groups_manage %} diff --git a/templates/repo_update_file.html b/templates/repo_update_file.html index 970f432a9e..90e6638608 100644 --- a/templates/repo_update_file.html +++ b/templates/repo_update_file.html @@ -1,18 +1,8 @@ {% extends "myhome_base.html" %} {% load seahub_tags %} -{% block info_bar_message %} -{% if request.user.is_authenticated %} - {{ block.super }} -{% else %} -
    -{% endif %} -{% endblock %} - {% block main_panel %} -{% if used_space < total_space %} +{% if not official_mode or used_space < total_space %}

    更新文件 {% for name, link in zipped %} diff --git a/templates/repo_upload_file.html b/templates/repo_upload_file.html index 8142de371c..9788e95ca9 100644 --- a/templates/repo_upload_file.html +++ b/templates/repo_upload_file.html @@ -1,18 +1,8 @@ {% extends base_template %} {% load seahub_tags %} -{% block info_bar_message %} -{% if request.user.is_authenticated %} - {{ block.super }} -{% else %} -
    - 当前链接会在短期内失效,欢迎您 加入Seafile 体验更多功能。 -
    -{% endif %} -{% endblock %} - {% block main_panel %} -{% if used_space < total_space %} +{% if not official_mode or used_space < total_space %}

    上传文件到 {% for name, link in zipped %}