]> git.openstreetmap.org Git - osqa.git/commitdiff
Improving the statement for the user subscriptions tab management, putting the settin...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 21 Aug 2011 13:29:49 +0000 (13:29 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 21 Aug 2011 13:29:49 +0000 (13:29 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1162 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/views/users.py

index 82e817560cfbc9b3b053b847752c7394e1e8399e..9f039f790507516d0ddea0a7fe8119c29e995447 100644 (file)
@@ -398,7 +398,26 @@ def user_subscriptions(request, user, **kwargs):
 \r
     tab = request.GET.get('tab', "settings")\r
 \r
 \r
     tab = request.GET.get('tab', "settings")\r
 \r
-    if tab == 'settings':\r
+    # Manage tab\r
+    if tab == 'manage':\r
+        manage_open = True\r
+\r
+        auto = request.GET.get('auto', 'True')\r
+        if auto == 'True':\r
+            show_auto = True\r
+            subscriptions = QuestionSubscription.objects.filter(user=user).order_by('-last_view')\r
+        else:\r
+            show_auto = False\r
+            subscriptions = QuestionSubscription.objects.filter(user=user, auto_subscription=False).order_by('-last_view')\r
+\r
+        return pagination.paginated(request, ('subscriptions', SubscriptionListPaginatorContext()), {\r
+            'subscriptions':subscriptions,\r
+            'view_user':user,\r
+            "auto":show_auto,\r
+            'manage_open':manage_open,\r
+        })\r
+    # Settings Tab and everything else\r
+    else:\r
         manage_open = False\r
         if request.method == 'POST':\r
             manage_open = False\r
         manage_open = False\r
         if request.method == 'POST':\r
             manage_open = False\r
@@ -422,34 +441,6 @@ def user_subscriptions(request, user, **kwargs):
             'manage_open':manage_open,\r
         }\r
 \r
             'manage_open':manage_open,\r
         }\r
 \r
-    elif tab == 'manage':\r
-        manage_open = True\r
-\r
-        auto = request.GET.get('auto', 'True')\r
-        if auto == 'True':\r
-            show_auto = True\r
-            subscriptions = QuestionSubscription.objects.filter(user=user).order_by('-last_view')\r
-        else:\r
-            show_auto = False\r
-            subscriptions = QuestionSubscription.objects.filter(user=user, auto_subscription=False).order_by('-last_view')\r
-\r
-        return pagination.paginated(request, ('subscriptions', SubscriptionListPaginatorContext()), {\r
-            'subscriptions':subscriptions,\r
-            'view_user':user,\r
-            "auto":show_auto,\r
-            'manage_open':manage_open,\r
-        })\r
-\r
-    # else:\r
-        # todo: probably want to throw an error\r
-        # error = "error to throw"\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
 @user_view('users/preferences.html', 'preferences', _('preferences'), _('preferences'), True, tabbed=False)\r
 def user_preferences(request, user, **kwargs):\r
     if request.POST:\r
 @user_view('users/preferences.html', 'preferences', _('preferences'), _('preferences'), True, tabbed=False)\r
 def user_preferences(request, user, **kwargs):\r
     if request.POST:\r