Permalink
Browse files

Removed some unused code

  • Loading branch information...
1 parent 2a95a87 commit 99c1bc287d1354b987f2fe7a1e08195a8273b1bf @HonzaKral HonzaKral committed Feb 22, 2010
Showing with 0 additions and 82 deletions.
  1. +0 −37 mypage/pages/views.py
  2. +0 −40 mypage/rsswidgets/models.py
  3. +0 −3 mypage/xmlsourcewidgets/models.py
  4. +0 −2 mypage/youtubewidgets/models.py
View
@@ -118,10 +118,6 @@ def home_page(request):
not settab
and
(page.pk == settings.DEFAULT_PAGE_ID and not request.user.is_authenticated())
- and
- 'MPAS' not in request.COOKIES # FIXME terrible, terrible hack because of fucking atlas
- and
- 'uprofile' not in request.COOKIES # FIXME terrible, terrible hack because of fucking centrum
)
cache_key = RENDERED_PAGE_KEY % {
"pk": page.pk,
@@ -158,15 +154,6 @@ def skinit(request, skin):
page = get_page(request.user, request.session, defaults=defaults)
return http.HttpResponse(render_page(request, page, extra_context={"skinit": skin}))
-def show_welcome(request):
- request.session['show_welcome'] = True
- return http.HttpResponseRedirect( reverse('home_page') )
-
-def close_welcome(request):
- if 'show_welcome' in request.session:
- del request.session['show_welcome']
- return http.HttpResponseRedirect( reverse('home_page') )
-
def configure_widget(request, content_type_id, object_id):
"""
Get a widget in page and call it's configure method
@@ -388,19 +375,6 @@ def fill_my_page(request):
return http.HttpResponseRedirect(reverse('home_page'))
-@commit_on_success_response
-def empty_my_page(request):
- """
- Removes all widgets from a page
-
- This view updates the page.
- """
- page = get_page(request.user, request.session, for_update=True)
- widgets = Widget.objects.filter(pk__in=map(lambda x: x['widget_id'], page.layout.dynamic_widgets))
- page.remove_widgets(widgets)
- return http.HttpResponseRedirect(reverse('home_page'))
-
-
class SetupPageView(object):
template = None
@@ -475,17 +449,6 @@ def reset_page_template_config(request):
return http.HttpResponseRedirect(reverse('home_page'))
-def reset_page_chrome(request):
- page = get_page(request.user, request.session)
- if is_custom_page(page):
- default_page = Page.objects.get_for_id(settings.DEFAULT_PAGE_ID)
- page.template = default_page.template
- page.layout.template_config = default_page.layout.template_config
- page.layout.save()
- page.save()
- return hTtp.HttpResponseRedirect(reverse('home_page'))
-
-
# ===================
# Setup page widgets:
@@ -52,48 +52,8 @@ def _fetch_data(self):
return data
def modify_data(self, data=None, config={}):
-
item_count = config.get('item_count', settings.DEFAULT_ITEM_COUNT)
-
data['entries'] = data['entries'][:int(item_count)]
- data['entries_type_1'] = {'full': [], 'multiswitch': [], 'bullet': []}
- data['entries_type_2'] = {'full': [], 'multiswitch': [], 'bullet': []}
- data['entries_type_3'] = {'full': [], 'multiswitch': [], 'bullet': []}
- data['entries_type_4'] = {'full': [], 'multiswitch': [], 'bullet': []}
-
- c = 0
- for item in data['entries']:
- c = c +1
- if c == 1:
- data['entries_type_1']['full'].append(item)
- data['entries_type_2']['full'].append(item)
- data['entries_type_3']['multiswitch'].append(item)
- data['entries_type_4']['bullet'].append(item)
-
- elif c == 2:
- data['entries_type_1']['multiswitch'].append(item)
- data['entries_type_2']['bullet'].append(item)
- data['entries_type_3']['multiswitch'].append(item)
- data['entries_type_4']['bullet'].append(item)
-
- elif c == 3:
- data['entries_type_1']['multiswitch'].append(item)
- data['entries_type_2']['bullet'].append(item)
- data['entries_type_3']['multiswitch'].append(item)
- data['entries_type_4']['bullet'].append(item)
-
- elif c == 4:
- data['entries_type_1']['multiswitch'].append(item)
- data['entries_type_2']['bullet'].append(item)
- data['entries_type_3']['bullet'].append(item)
- data['entries_type_4']['bullet'].append(item)
-
- else:
- data['entries_type_1']['bullet'].append(item)
- data['entries_type_2']['bullet'].append(item)
- data['entries_type_3']['bullet'].append(item)
- data['entries_type_4']['bullet'].append(item)
-
return data
class MultiRSSWidget(Widget):
@@ -2,9 +2,6 @@
import logging
from cStringIO import StringIO
-from django.db import models
-from django.utils.translation import ugettext_lazy as _
-
from mypage.widgets.models import Widget, WidgetFetchDataFailedException
@@ -1,7 +1,5 @@
from django.db import models
from django import forms
-from django.template import loader
-from django import template
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
from django.utils.http import urlquote

0 comments on commit 99c1bc2

Please sign in to comment.