]> git.openstreetmap.org Git - osqa.git/commitdiff
some cleanup on the listing of subscriptions and changing how we fetch the subscriptions
authormatt <matt@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 16 Jul 2010 16:46:16 +0000 (16:46 +0000)
committermatt <matt@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 16 Jul 2010 16:46:16 +0000 (16:46 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@539 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/media/style/style.css
forum/skins/default/templates/question_list/subscription_item.html
forum/skins/default/templates/users/subscriptions.html
forum/skins/default/templates/users/subscriptions_management.html
forum/templatetags/question_list_tags.py
forum/views/users.py

index 2b20a0bb9fcfcdddbcdf75ea9748e6061e7e6394..dc35e8a089f498c48dbbc414e491fde50c0b31f2 100644 (file)
@@ -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 {
index 2aec8e60bf67917b363413767168e0bd48494d8d..2087392db4052f44d3cdeaec74bc2d09203cff09 100644 (file)
@@ -1,11 +1,9 @@
-
-
-
 {% load i18n humanize extra_filters extra_tags user_tags %}
 <div class="subscription_summary">
-    <div style="height:100%"><a class="sidebar_button subscription_unsubscribe_button" href="{% url subscribe id=question.id %}">
+    <div style="height:100%"><a class="sidebar_button subscription_unsubscribe_button" href="{% url subscribe id=subscription.question.id %}">
         {% trans "Unsubscribe" %}
     </a></div>
 
     <div class="subscription_title"><a title="{{ question.summary }}" href="{{ question.get_absolute_url }}">{{question.headline}}</a></div>
+    <div class="subscription_details"><span class="relativetime" title="{{subscription.last_view}}">{% trans "Last checked" %} {% diff_date subscription.last_view %}</span></div>
 </div>
\ No newline at end of file
index 6785cbd4b5a22b10501663d76dd05a5ce9ba135c..d115ae218c501ee9190d9e3eedc8d5e49743a25e 100644 (file)
@@ -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 @@
     <br/>
 
     <div id="navBar"><div class="tabsA">
-        <a HREF="javascript:enableSettings()" id="subscriptions_settings_button">Settings</a>
-        <a HREF="javascript:enableManagement()" id="subscriptions_management_button">Remove</a>
+        <a HREF="javascript:enableSettings()" {%  if not manage_open %}class="on"{% endif %} id="subscriptions_settings_button">Settings</a>
+        <a HREF="javascript:enableManagement()" {%  if manage_open %}class="on"{% endif %}  id="subscriptions_management_button">Manage</a>
     </div></div>
 
     <br/>
index f0f7e9b7af0504f563a089b919df2a82092a1320..2e918dda97ce18735275774b3babe79d19e1c56b 100644 (file)
@@ -1,12 +1,9 @@
 {% load i18n %}
 {% load question_list_tags %}
 
-<br />
-<br />
-
 <div id="subscription_list" align="left">
     <h2>
-        {% trans "Notifications and subscription settings" %}
+        {% trans "Manage your current subscriptions" %}
         <span style="font-size:11px">
             {% if auto %}
                 <a href='{% url user_subscriptions id=view_user.id slug=view_user.username|slugify %}?auto=False'>{% trans "don't show auto-subscribe" %}</a>
@@ -17,7 +14,7 @@
     </h2>
 
     {% for subscription in subscriptions.paginator.page %}
-        {% subscription_list_item subscription %}
+        {% subscription_list_item subscription subscription.question %}
     {% endfor %}
 
     <div class="pager">{{ subscriptions.paginator.page_numbers }}</div>
index 41c2539b9007a09615bcc8cb134ca1fb2545c90f..3ecf1f605a0e58b0e4b9176d4d799fe8d25fca69 100644 (file)
@@ -24,13 +24,15 @@ class QuestionItemNode(template.Node):
 class SubscriptionItemNode(template.Node):\r
     template = template.loader.get_template('question_list/subscription_item.html')\r
 \r
-    def __init__(self, question, options):\r
+    def __init__(self, subscription, question, options):\r
         self.question = template.Variable(question)\r
+        self.subscription = template.Variable(subscription)\r
         self.options = options\r
 \r
     def render(self, context):\r
         return self.template.render(template.Context({\r
             'question': self.question.resolve(context),\r
+            'subscription': self.subscription.resolve(context),\r
             'signature_type': self.options.get('signature_type', 'lite'),\r
         }))\r
 \r
@@ -42,7 +44,7 @@ def question_list_item(parser, token):
 @register.tag\r
 def subscription_list_item(parser, token):\r
     tokens = token.split_contents()[1:]\r
-    return SubscriptionItemNode(tokens[0], argument_parser(tokens[1:]))\r
+    return SubscriptionItemNode(tokens[0], tokens[1], argument_parser(tokens[2:]))\r
 \r
 @register.inclusion_tag('question_list/sort_tabs.html')\r
 def question_sort_tabs(sort_context):\r
index 836b62172ef5829f07aff78931221290eb4e1b3f..03745aeb35714aed60bd8b6b6cbfe6b4de721494 100644 (file)
@@ -329,10 +329,12 @@ def user_subscriptions(request, user):
         \r
     if auto == 'True':\r
         show_auto = True\r
-        subscriptions = user.subscriptions.all().order_by('-questionsubscription__last_view')\r
+        subscriptions = QuestionSubscription.objects.filter(user=user).order_by('-last_view')        \r
+        #subscriptions = user.subscriptions.all().order_by('-questionsubscription__last_view')\r
     else:\r
         show_auto = False\r
-        subscriptions = user.subscriptions.filter(questionsubscription__auto_subscription=False).order_by('-questionsubscription__last_view')\r
+        subscriptions = QuestionSubscription.objects.filter(user=user, auto_subscription=False).order_by('-last_view')\r
+        #subscriptions = user.subscriptions.filter(questionsubscription__auto_subscription=False).order_by('-questionsubscription__last_view')\r
 \r
     if request.method == 'POST':\r
         manage_open = False\r