From b694b8013e5ba6695edaf16ed0e3c551b843bcec Mon Sep 17 00:00:00 2001 From: zhengxie Date: Thu, 19 Dec 2013 14:49:39 +0800 Subject: [PATCH] Use static download page --- seahub/base/models.py | 29 ---- seahub/templates/base.html | 3 +- seahub/templates/download.html | 16 -- seahub/templates/download_edit.html | 222 ---------------------------- seahub/urls.py | 1 - seahub/views/__init__.py | 21 --- 6 files changed, 1 insertion(+), 291 deletions(-) delete mode 100644 seahub/templates/download_edit.html diff --git a/seahub/base/models.py b/seahub/base/models.py index 9d4f1d6307..9611c0602c 100644 --- a/seahub/base/models.py +++ b/seahub/base/models.py @@ -533,35 +533,6 @@ class CommandsLastCheck(models.Model): command_type = models.CharField(max_length=100) last_check = models.DateTimeField() -class SystemCustomizeManager(models.Manager): - def set_download_content(self, content): - """ - - Arguments: - - `self`: - - `content`: - """ - m = self.model(custom_key="download", custom_val=content) - m.save(using=self._db) - return m - - def get_download_content(self): - """ - - Arguments: - - `self`: - """ - try: - return super(SystemCustomizeManager, self).get( - custom_key="download").custom_val - except SystemCustomize.DoesNotExist: - return None - -class SystemCustomize(models.Model): - custom_key = models.CharField(max_length=50) - custom_val = models.TextField() - objects = SystemCustomizeManager() - ###### Deprecated class InnerPubMsg(models.Model): """ diff --git a/seahub/templates/base.html b/seahub/templates/base.html index bdf50eded8..d20fa38c49 100644 --- a/seahub/templates/base.html +++ b/seahub/templates/base.html @@ -128,8 +128,7 @@

{% trans "Client" %}

diff --git a/seahub/templates/download.html b/seahub/templates/download.html index b1689184c4..f7e11dc16a 100644 --- a/seahub/templates/download.html +++ b/seahub/templates/download.html @@ -4,28 +4,12 @@ {% block sub_title %}{% trans "Download" %} - {% endblock %} {% block main_panel %} -{% if request.user.is_staff %} - -{% endif %} -
- {% if content %} - {{content|safe}} - {% else %} {% if LANGUAGE_CODE == 'zh-cn' %}

你可以从Seafile的官方下载页面下载Windows,Mac以及Linux的客户端。

{% else %}

You can download Seafile desktop client for Windows, Mac and Linux from Seafile's official download page.

{% endif %} - {% endif %}
{% endblock %} -{% block extra_script %} - -{% endblock %} - diff --git a/seahub/templates/download_edit.html b/seahub/templates/download_edit.html deleted file mode 100644 index 1476615272..0000000000 --- a/seahub/templates/download_edit.html +++ /dev/null @@ -1,222 +0,0 @@ -{% extends "myhome_base.html" %} -{% load i18n %} - -{% block extra_style %} - - -{% endblock %} - -{% block main_panel %} -
-
- - {% trans "Cancel" %} -
-
- -
-
-
- - -
- -
- - -
- -
- - - - - -
-
- - - - -
-
- - - - -
-
- - - -
-
- - -
-
- - -
-
- -

You can download from http://seafile.com/download/

- -
-{% endblock %} - -{% block extra_script %} - - - - - -{% endblock %} diff --git a/seahub/urls.py b/seahub/urls.py index 02e053a27d..4561dcc2bf 100644 --- a/seahub/urls.py +++ b/seahub/urls.py @@ -109,7 +109,6 @@ urlpatterns = patterns('', url(r'^user/(?P[^/]+)/shares/$', user_share_list, name='user_share_list'), url(r'^modules/toggle/$', toggle_modules, name="toggle_modules"), url(r'download/$', download, name="download"), - url(r'download/edit/$', download_edit, name="download_edit"), ### Ajax ### (r'^ajax/repo/(?P[-0-9a-f]{36})/remove/$', repo_remove), diff --git a/seahub/views/__init__.py b/seahub/views/__init__.py index d1ffb43a94..43125364e6 100644 --- a/seahub/views/__init__.py +++ b/seahub/views/__init__.py @@ -2062,26 +2062,5 @@ def download(request): """Show download page. """ - content = SystemCustomize.objects.get_download_content() - return render_to_response('download.html', { - 'content': content, }, context_instance=RequestContext(request)) - -@login_required -def download_edit(request): - """Edit download page. - """ - if request.method == 'POST': - content_type = 'application/json; charset=utf-8' - - content = request.POST.get('content', '') - SystemCustomize.objects.set_download_content(content) - - next = reverse('download') - return HttpResponse(json.dumps({'href': next}), - content_type=content_type) - return render_to_response('download_edit.html', { - }, context_instance=RequestContext(request)) - -