mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-06 17:33:18 +00:00
Change OFFICIAL_MODE to CLOUD_MODE
This commit is contained in:
@@ -17,7 +17,7 @@ def base(request):
|
||||
return {
|
||||
'seafile_version': SEAFILE_VERSION,
|
||||
'seahub_title': SEAHUB_TITLE,
|
||||
'official_mode': request.official_mode,
|
||||
'cloud_mode': request.cloud_mode,
|
||||
# 'account_type': settings.ACCOUNT_TYPE,
|
||||
}
|
||||
|
||||
|
@@ -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 OFFICIAL_MODE
|
||||
from seahub.settings import CLOUD_MODE
|
||||
except ImportError:
|
||||
OFFICIAL_MODE = False
|
||||
CLOUD_MODE = False
|
||||
|
||||
class OrganizationMiddleware(object):
|
||||
"""
|
||||
@@ -16,8 +16,8 @@ class OrganizationMiddleware(object):
|
||||
"""
|
||||
|
||||
def process_request(self, request):
|
||||
if OFFICIAL_MODE:
|
||||
request.official_mode = True
|
||||
if CLOUD_MODE:
|
||||
request.cloud_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.official_mode = False
|
||||
request.cloud_mode = False
|
||||
request.user.org = None
|
||||
request.user.orgs = None
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<li>
|
||||
<a href="{{ SITE_ROOT }}sys/groupadmin/" {% block nav_groupadmin_class %}{% endblock %}>小组管理</a>
|
||||
</li>
|
||||
{% if request.official_mode %}
|
||||
{% if request.cloud_mode %}
|
||||
<li>
|
||||
<a href="{{ SITE_ROOT }}sys/orgadmin/" {% block nav_orgadmin_class %}{% endblock %}>团体管理</a>
|
||||
</li>
|
||||
|
@@ -27,7 +27,7 @@
|
||||
<div class="top-bar-in">
|
||||
<div class="left">
|
||||
{% if request.user.is_authenticated %}
|
||||
{% if official_mode %}
|
||||
{% if cloud_mode %}
|
||||
<a href="#" id="team-account" data="no-popup">
|
||||
{% if org %} {{ org.org_name }} {% else %} 个人帐号 {% endif %}
|
||||
<span class="bg"></span></a>
|
||||
@@ -139,7 +139,7 @@
|
||||
<script type="text/javascript" src="{{ MEDIA_URL }}js/utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
$('.top-bar-in .left').css('width', $('.top-bar-in').width() - $('.top-bar-in .right').width() - 30);
|
||||
{% if request.user.is_authenticated and request.official_mode %}
|
||||
{% if request.user.is_authenticated and request.cloud_mode %}
|
||||
$('#team-account').click(function() {
|
||||
if ($(this).attr('data') == 'no-popup') {
|
||||
$(this).parent().css('position', 'relative');
|
||||
|
@@ -35,7 +35,7 @@
|
||||
{% endif %}
|
||||
|
||||
<h3>已用空间</h3>
|
||||
<p>{{ quota_usage|filesizeformat }} {% if official_mode %}/ 2 GB {% endif %}</p>
|
||||
<p>{{ quota_usage|filesizeformat }} {% if cloud_mode %}/ 2 GB {% endif %}</p>
|
||||
|
||||
<h3>我管理的小组</h3>
|
||||
{% if groups_manage %}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
{% load seahub_tags %}
|
||||
|
||||
{% block main_panel %}
|
||||
{% if not official_mode or used_space < total_space %}
|
||||
{% if not cloud_mode or used_space < total_space %}
|
||||
<div class="narrow-panel">
|
||||
<h3>更新文件
|
||||
{% for name, link in zipped %}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
{% load seahub_tags %}
|
||||
|
||||
{% block main_panel %}
|
||||
{% if not official_mode or used_space < total_space %}
|
||||
{% if not cloud_mode or used_space < total_space %}
|
||||
<div class="narrow-panel">
|
||||
<h3>上传文件到
|
||||
{% for name, link in zipped %}
|
||||
|
Reference in New Issue
Block a user