From: matt Date: Fri, 16 Jul 2010 16:46:16 +0000 (+0000) Subject: some cleanup on the listing of subscriptions and changing how we fetch the subscriptions X-Git-Tag: live~595 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/ca804a9e3eebc769bfbe5bf1b7a4ace62cd4929b some cleanup on the listing of subscriptions and changing how we fetch the subscriptions git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@539 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/skins/default/media/style/style.css b/forum/skins/default/media/style/style.css index 2b20a0b..dc35e8a 100644 --- a/forum/skins/default/media/style/style.css +++ b/forum/skins/default/media/style/style.css @@ -1758,8 +1758,8 @@ div.dialog.prompt .dialog-content select, div.dialog.prompt .dialog-content text } div#subscription_list { - width: 500px; - float:left; + width: 100%; + /*float:left;*/ } div.subscription_summary { @@ -1768,28 +1768,24 @@ div.subscription_summary { padding: 3px 0px 5px 0; position: relative; width:100%; - margin-bottom:30px; + margin-top: 5px; } div.subscription_title { - float:left; - - width:350px; - - line-height:30px; - - font-size: 25px; + /*float:left; + line-height:30px;*/ + margin-top: 5px; + font-size: 16px; font-weight:bold; - font-family: Arial; } a.subscription_unsubscribe_button { float:left; - font-size: 15px; + font-size: 11px; font-weight:bold; margin-right:15px; - margin-top:5px; + margin-top: 5px; } div.subscription_userinfo { diff --git a/forum/skins/default/templates/question_list/subscription_item.html b/forum/skins/default/templates/question_list/subscription_item.html index 2aec8e6..2087392 100644 --- a/forum/skins/default/templates/question_list/subscription_item.html +++ b/forum/skins/default/templates/question_list/subscription_item.html @@ -1,11 +1,9 @@ - - - {% load i18n humanize extra_filters extra_tags user_tags %}
-
+
{% trans "Unsubscribe" %}
+
{% trans "Last checked" %} {% diff_date subscription.last_view %}
\ No newline at end of file diff --git a/forum/skins/default/templates/users/subscriptions.html b/forum/skins/default/templates/users/subscriptions.html index 6785cbd..d115ae2 100644 --- a/forum/skins/default/templates/users/subscriptions.html +++ b/forum/skins/default/templates/users/subscriptions.html @@ -10,8 +10,8 @@ $("div#subscriptions_settings").show(); $("div#subscriptions_management").hide(); - $("div#subscriptions_settings_button").context.activeElement.className = 'on'; - $("div#subscriptions_management_button").context.activeElement.className = ''; + $("a#subscriptions_settings_button").addClass('on'); + $("a#subscriptions_management_button").removeClass("on"); //location.reload(true); } @@ -20,8 +20,8 @@ $("div#subscriptions_settings").hide(); $("div#subscriptions_management").show(); - $("div#subscriptions_settings_button").context.activeElement.className = ''; - $("div#subscriptions_management_button").context.activeElement.className = 'on'; + $("a#subscriptions_settings_button").removeClass('on'); + $("a#subscriptions_management_button").addClass('on'); //location.reload(true); } @@ -32,8 +32,8 @@

diff --git a/forum/skins/default/templates/users/subscriptions_management.html b/forum/skins/default/templates/users/subscriptions_management.html index f0f7e9b..2e918dd 100644 --- a/forum/skins/default/templates/users/subscriptions_management.html +++ b/forum/skins/default/templates/users/subscriptions_management.html @@ -1,12 +1,9 @@ {% load i18n %} {% load question_list_tags %} -
-
-

- {% trans "Notifications and subscription settings" %} + {% trans "Manage your current subscriptions" %} {% if auto %} {% trans "don't show auto-subscribe" %} @@ -17,7 +14,7 @@

{% for subscription in subscriptions.paginator.page %} - {% subscription_list_item subscription %} + {% subscription_list_item subscription subscription.question %} {% endfor %}
{{ subscriptions.paginator.page_numbers }}
diff --git a/forum/templatetags/question_list_tags.py b/forum/templatetags/question_list_tags.py index 41c2539..3ecf1f6 100644 --- a/forum/templatetags/question_list_tags.py +++ b/forum/templatetags/question_list_tags.py @@ -24,13 +24,15 @@ class QuestionItemNode(template.Node): class SubscriptionItemNode(template.Node): template = template.loader.get_template('question_list/subscription_item.html') - def __init__(self, question, options): + def __init__(self, subscription, question, options): self.question = template.Variable(question) + self.subscription = template.Variable(subscription) self.options = options def render(self, context): return self.template.render(template.Context({ 'question': self.question.resolve(context), + 'subscription': self.subscription.resolve(context), 'signature_type': self.options.get('signature_type', 'lite'), })) @@ -42,7 +44,7 @@ def question_list_item(parser, token): @register.tag def subscription_list_item(parser, token): tokens = token.split_contents()[1:] - return SubscriptionItemNode(tokens[0], argument_parser(tokens[1:])) + return SubscriptionItemNode(tokens[0], tokens[1], argument_parser(tokens[2:])) @register.inclusion_tag('question_list/sort_tabs.html') def question_sort_tabs(sort_context): diff --git a/forum/views/users.py b/forum/views/users.py index 836b621..03745ae 100644 --- a/forum/views/users.py +++ b/forum/views/users.py @@ -329,10 +329,12 @@ def user_subscriptions(request, user): if auto == 'True': show_auto = True - subscriptions = user.subscriptions.all().order_by('-questionsubscription__last_view') + subscriptions = QuestionSubscription.objects.filter(user=user).order_by('-last_view') + #subscriptions = user.subscriptions.all().order_by('-questionsubscription__last_view') else: show_auto = False - subscriptions = user.subscriptions.filter(questionsubscription__auto_subscription=False).order_by('-questionsubscription__last_view') + subscriptions = QuestionSubscription.objects.filter(user=user, auto_subscription=False).order_by('-last_view') + #subscriptions = user.subscriptions.filter(questionsubscription__auto_subscription=False).order_by('-questionsubscription__last_view') if request.method == 'POST': manage_open = False