From 596da522bef06fc7c9b6d7eb84f6aee22e7dab25 Mon Sep 17 00:00:00 2001 From: Rosandra Cuello Date: Thu, 29 Sep 2011 17:12:45 -0700 Subject: Basic restfull urls that contain scope/sort/tags/page --- askbot/search/state_manager.py | 14 +++++++++++ askbot/skins/default/templates/macros.html | 27 +++++++++++----------- .../skins/default/templates/main_page/content.html | 2 +- .../default/templates/main_page/paginator.html | 2 +- .../skins/default/templates/main_page/sidebar.html | 7 +++--- .../skins/default/templates/main_page/tab_bar.html | 23 ++++++++++-------- askbot/templatetags/extra_filters.py | 26 +++++++++++++++++++++ askbot/views/readers.py | 7 ++++-- 8 files changed, 79 insertions(+), 29 deletions(-) diff --git a/askbot/search/state_manager.py b/askbot/search/state_manager.py index d441e33b..761724f0 100644 --- a/askbot/search/state_manager.py +++ b/askbot/search/state_manager.py @@ -295,6 +295,20 @@ class SearchState(object): def reset_scope(self): self.scope = const.DEFAULT_POST_SCOPE + def query_string(self): + out = 'scope=%s' % self.scope + out += '&sort=%s' % self.sort + if self.query: + out += '&query=%s' % self.query + if hasattr(self, 'search'): + if self.search == 'search': + out += '&search = search' + if self.tags: + for tag in self.tags: + out += '&tags=%s' % tag + #out += '&page=%d' % self.page + return '?'+out + class ViewLog(object): """The ViewLog helper obejcts store the trail of the page visits for a given user. The trail is recorded only up to a certain depth. diff --git a/askbot/skins/default/templates/macros.html b/askbot/skins/default/templates/macros.html index 5c035611..f6cab5ce 100644 --- a/askbot/skins/default/templates/macros.html +++ b/askbot/skins/default/templates/macros.html @@ -1,3 +1,4 @@ +{% load extra_filters %} {%- macro user_score_and_badge_summary(user) -%}