From d7ead064414efec0e0d049842459e1a4d8a99edd Mon Sep 17 00:00:00 2001 From: Rosandra Cuello Date: Thu, 17 Nov 2011 11:22:26 -0400 Subject: most urls working except for the ones including page or page_size --- askbot/skins/default/media/js/live_search.js | 61 ++++++- askbot/skins/default/media/js/utils.js | 14 +- askbot/skins/default/templates/blocks/header.html | 2 +- .../skins/default/templates/blocks/input_bar.html | 2 +- askbot/skins/default/templates/macros.html | 2 +- .../default/templates/main_page/headline.html | 8 +- .../default/templates/main_page/nothing_found.html | 8 +- .../skins/default/templates/main_page/tab_bar.html | 4 +- askbot/skins/default/templates/question.html | 4 +- askbot/skins/default/templates/tags.html | 1 - .../default/templates/user_profile/user_stats.html | 2 +- .../templates/user_profile/users_questions.html | 2 +- askbot/templatetags/extra_filters.py | 63 ++++--- askbot/urls.py | 201 +++++++++++++++++++-- askbot/views/readers.py | 2 +- 15 files changed, 309 insertions(+), 67 deletions(-) diff --git a/askbot/skins/default/media/js/live_search.js b/askbot/skins/default/media/js/live_search.js index 919722dd..0682631d 100644 --- a/askbot/skins/default/media/js/live_search.js +++ b/askbot/skins/default/media/js/live_search.js @@ -23,6 +23,7 @@ var liveSearch = function(){ sortMethod = prevSortMethod; } refresh_x_button(); + search_url = askbot['urls']['questions'] + 'reset_query:true/'; reset_query(sortMethod); } ); @@ -318,12 +319,61 @@ var liveSearch = function(){ var create_relevance_tab = function(query_string){ relevance_tab = $(''); - relevance_tab.attr('href', '?sort=relevance-desc'); + href = '/questions/' + replace_in_url(query_string, 'sort:relevance-desc') + relevance_tab.attr('href', href); relevance_tab.attr('id', 'by_relevance'); relevance_tab.html('' + sortButtonData['relevance']['label'] + ''); return relevance_tab; } + var replace_in_url = function (query_string, param){ + values = param.split(':') + type = values[0] + value = values[1] + params = query_string.split('/') + url="" + + for (var i = 0; i < params.length; i++){ + if (params[i] !== ''){ + if (params[i].substring(0, type.length) == type){ + url += param + '/' + } + else{ + url += params[i] + '/' + } + } + } + + return url + + } + + var remove_from_url = function (query_string, type){ + params = query_string.split('/') + url="" + for (var i = 0; i < params.length; i++){ + if (params[i] !== ''){ + if (params[i].substring(0, type.length) !== type){ + url += params[i] + '/' + } + } + } + return url + } + + var set_section_tabs = function(query_string){ + var tabs = $('#section_tabs>a'); + tabs.each(function(index, element){ + var tab = $(element); + var tab_name = tab.attr('id').replace(/^by_/,''); + href = '/questions/' + replace_in_url(query_string, 'section:'+tab_name) + tab.attr( + 'href', + href + ); + }); + }; + var set_active_sort_tab = function(sort_method, query_string){ var tabs = $('#sort_tabs>a'); tabs.attr('class', 'off'); @@ -331,9 +381,10 @@ var liveSearch = function(){ var tab = $(element); var tab_name = tab.attr('id').replace(/^by_/,''); if (tab_name in sortButtonData){ + href = '/questions/' + replace_in_url(query_string, 'sort:'+tab_name+'-desc') tab.attr( 'href', - '?sort=' + tab_name + '-desc' + href ); tab.attr( 'title', @@ -444,6 +495,7 @@ var liveSearch = function(){ render_related_tags(data['related_tags'], data['query_string']); render_relevance_sort_tab(data['query_string']); set_active_sort_tab(sortMethod, data['query_string']); + set_section_tabs(data['query_string']); query.focus(); //show new div with a fadeIn effect @@ -475,7 +527,7 @@ var liveSearch = function(){ var reset_query = function(sort_method){ $.ajax({ url: search_url, - data: {reset_query: true, sort: sort_method}, + //data: {reset_query: true, sort: sort_method}, dataType: 'json', success: render_result, complete: try_again @@ -511,6 +563,7 @@ var liveSearch = function(){ sortMethod = 'relevance-desc'; } } + search_url = askbot['urls']['questions']; //resetting search_url every times params = query_string.split('/') for (var i = 0; i < params.length; i++){ if (params[i] !== ''){ @@ -523,11 +576,13 @@ var liveSearch = function(){ } } } + //search_url = '/questions/'+search_url send_query(cur_text, sortMethod); }; restart_query = function() { reset_sort_method(); refresh_x_button(); + search_url = askbot['urls']['questions'] + 'reset_query:true/'; reset_query(sortMethod); running = true; }; diff --git a/askbot/skins/default/media/js/utils.js b/askbot/skins/default/media/js/utils.js index 764d6770..fd67c9c0 100644 --- a/askbot/skins/default/media/js/utils.js +++ b/askbot/skins/default/media/js/utils.js @@ -356,6 +356,8 @@ Tag.prototype.createDom = function(){ this._inner_element = this.makeElement(this._inner_html_tag); if (this.isLinkable()){ var url = askbot['urls']['questions']; + var flag = false + var author = '' if (this._url_params !== null){ params = this._url_params.split('/') for (var i = 0; i < params.length; i++){ @@ -370,18 +372,26 @@ Tag.prototype.createDom = function(){ } new_tags += escape(this.getName()) url += 'tags:'+new_tags+'/' + flag = true + } + else if (params[i].substring(0, 7) == "author:"){ + author = params[i]; } else{ url += params[i] + '/'; } } } + if (flag == false) { + url += 'tags:'+escape(this.getName())+'/' + } + if (author !== '') { + url += author+'/' + } } else{ url += 'tags:' + escape(this.getName()) + '/'; } - - this._inner_element.attr('href', url); } this._inner_element.addClass('tag tag-right'); diff --git a/askbot/skins/default/templates/blocks/header.html b/askbot/skins/default/templates/blocks/header.html index f480d3c7..c4a09043 100644 --- a/askbot/skins/default/templates/blocks/header.html +++ b/askbot/skins/default/templates/blocks/header.html @@ -3,7 +3,7 @@
{% if settings.SHOW_LOGO %} - diff --git a/askbot/skins/default/templates/blocks/input_bar.html b/askbot/skins/default/templates/blocks/input_bar.html index 58849ca5..050fbb3b 100644 --- a/askbot/skins/default/templates/blocks/input_bar.html +++ b/askbot/skins/default/templates/blocks/input_bar.html @@ -28,7 +28,7 @@ value="x" name="reset_query" {# todo - make sure it works on Enter keypress #} - onclick="window.location.href='{% url questions %}reset_query:true/'" + onclick="window.location.href='{% url questions %}{{ query_string|remove_from_url('query') }}'" class="cancelSearchBtn"/> {% endif %} diff --git a/askbot/skins/default/templates/macros.html b/askbot/skins/default/templates/macros.html index fd1bcf57..0ee6f7e9 100644 --- a/askbot/skins/default/templates/macros.html +++ b/askbot/skins/default/templates/macros.html @@ -370,7 +370,7 @@ poor design of the data or methods on data objects #} <{% if not is_link or tag[-1] == '*' %}span{% else %}a{% endif %} class="tag tag-right{% if css_class %} {{ css_class }}{% endif %}" {% if is_link %} - href="{% url questions %}{{url_params|add_tag_to_url(tag|urlencode)}}" + href="{% url questions %}{% if url_params %}{{url_params|add_tag_to_url(tag|urlencode)}}{% else %}tags:{{ tag }}/{% endif %}" title="{% trans %}see questions tagged '{{ tag }}'{% endtrans %}" {% endif %} rel="tag" diff --git a/askbot/skins/default/templates/main_page/headline.html b/askbot/skins/default/templates/main_page/headline.html index 4b92ba35..a2132df3 100644 --- a/askbot/skins/default/templates/main_page/headline.html +++ b/askbot/skins/default/templates/main_page/headline.html @@ -28,16 +28,16 @@

{% trans %}Search tips:{% endtrans %} {% if reset_method_count > 1 %} {% if author_name %} - {% trans %}reset author{% endtrans %} + {% trans %}reset author{% endtrans %} {% endif %} {% if search_tags %}{% if author_name and query %}, {% elif author_name %}{% trans %} or {% endtrans %}{% endif %} - {% trans %}reset tags{% endtrans %} + {% trans %}reset tags{% endtrans %} {% endif %} {% if query %}{% trans %} or {% endtrans %} - {% trans %}start over{% endtrans %} + {% trans %}start over{% endtrans %} {% endif %} {% else %} - {% trans %}start over{% endtrans %} + {% trans %}start over{% endtrans %} {% endif %} {% trans %} - to expand, or dig in by adding more tags and revising the query.{% endtrans %}

diff --git a/askbot/skins/default/templates/main_page/nothing_found.html b/askbot/skins/default/templates/main_page/nothing_found.html index 1f590709..6a5b744a 100644 --- a/askbot/skins/default/templates/main_page/nothing_found.html +++ b/askbot/skins/default/templates/main_page/nothing_found.html @@ -13,16 +13,16 @@ {% trans %}You can expand your search by {% endtrans %} {% if reset_method_count > 1 %} {% if author_name %} - {% trans %}resetting author{% endtrans %} + {% trans %}resetting author{% endtrans %} {% endif %} {% if search_tags %}{% if author_name and query %}, {% elif author_name %}{% trans %} or {% endtrans %}{% endif %} - {% trans %}resetting tags{% endtrans %} + {% trans %}resetting tags{% endtrans %} {% endif %} {% if query %}{% trans %} or {% endtrans %} - {% trans %}starting over{% endtrans %} + {% trans %}starting over{% endtrans %} {% endif %} {% else %} - {% trans %}starting over{% endtrans %} + {% trans %}starting over{% endtrans %} {% endif %}

{% endif %} diff --git a/askbot/skins/default/templates/main_page/tab_bar.html b/askbot/skins/default/templates/main_page/tab_bar.html index 03146171..cb00bcab 100644 --- a/askbot/skins/default/templates/main_page/tab_bar.html +++ b/askbot/skins/default/templates/main_page/tab_bar.html @@ -2,11 +2,11 @@ {% load extra_filters %} {# cache 600 "scope_sort_tabs" search_tags request.user scope sort query context.page context.page_size language_code #}
-
+
{% trans %}In:{% endtrans %} {% trans %}all{% endtrans %} ' ) diff --git a/askbot/skins/default/templates/tags.html b/askbot/skins/default/templates/tags.html index 19383bb8..99eb5bf7 100644 --- a/askbot/skins/default/templates/tags.html +++ b/askbot/skins/default/templates/tags.html @@ -37,7 +37,6 @@
  • {{ macros.tag_widget( tag = tag.name, - url_params = 'start_over:true', html_tag = 'div', extra_content = '× ' ~ tag.used_count|intcomma ~ '' diff --git a/askbot/skins/default/templates/user_profile/user_stats.html b/askbot/skins/default/templates/user_profile/user_stats.html index 6e882199..2fd26f82 100644 --- a/askbot/skins/default/templates/user_profile/user_stats.html +++ b/askbot/skins/default/templates/user_profile/user_stats.html @@ -73,7 +73,7 @@ tag.name, html_tag = 'div', url_params = - "/start_over:true/author:" ~ view_user.id, + "author:" ~ view_user.id, extra_content = '× ' ~ tag.user_tag_usage_count|intcomma ~ diff --git a/askbot/skins/default/templates/user_profile/users_questions.html b/askbot/skins/default/templates/user_profile/users_questions.html index fc7bda60..41809a62 100644 --- a/askbot/skins/default/templates/user_profile/users_questions.html +++ b/askbot/skins/default/templates/user_profile/users_questions.html @@ -2,7 +2,7 @@ {% import "macros.html" as macros %}
    {% for question in questions %} - {{macros.question_summary(question, extra_class='narrow', query_string="start_over:true/")}} + {{macros.question_summary(question, extra_class='narrow')}} {% endfor %}
    diff --git a/askbot/templatetags/extra_filters.py b/askbot/templatetags/extra_filters.py index b6dee686..47825dee 100644 --- a/askbot/templatetags/extra_filters.py +++ b/askbot/templatetags/extra_filters.py @@ -160,24 +160,14 @@ def absolute_value(number): @register.filter def replace_in_url(query_string, param): - try: - type, value = param.split(':') - params = query_string.rstrip('/').split('/') + type, value = param.split(':') + params = query_string.rstrip('/').split('/') - for p in params: - if type in p: - params[params.index(p)] = param + for p in params: + if type in p: + params[params.index(p)] = param - query_string = '/'.join(params)+'/' - except: - type, value = param.split('=') - params = query_string.lstrip('?').split('&') - - for p in params: - if type in p: - params[params.index(p)] = param - - query_string = '?'+'&'.join(params) + query_string = '/'.join(params)+'/' return query_string @register.filter @@ -185,19 +175,36 @@ def add_tag_to_url(query_string, param): if query_string: params = query_string.rstrip('/').split('/') flag = False - for p in params: - if p.startswith('tags:'): - flag = True - type, value = p.split(':') - values = value.split('+') - if param in values: - return query_string - else: - values.append(param) - params[params.index(p)] = 'tags:'+'+'.join(values) + + tags = [s for s in params if "tags:" in s] + if tags: + tags = tags[0] + flag = True + type, value = tags.split(':') + values = value.split('+') + if param in values: + return query_string + else: + values.append(param) + params[params.index(tags)] = 'tags:'+'+'.join(values) + if not flag: - params.append('tags:'+param) + author = [s for s in params if "author:" in s] + if author: + author = author[0] + params.insert(params.index(author), 'tags:'+param) + else: + params.append('tags:'+param) query_string = '/'.join(params)+'/' return query_string - +@register.filter +def remove_from_url(query_string, param_type): + if query_string: + params = query_string.rstrip('/').split('/') + new_params = [] + for p in params: + if not p.startswith(param_type): + new_params.append(p) + query_string = '/'.join(new_params)+'/' + return query_string diff --git a/askbot/urls.py b/askbot/urls.py index 0cf36412..eba051c5 100644 --- a/askbot/urls.py +++ b/askbot/urls.py @@ -64,46 +64,217 @@ urlpatterns = patterns('', kwargs = {'object_name': 'Answer'}, name='answer_revisions' ), - url(#this url works both normally and through ajax + + # BEGIN Questions (main page) urls. All this urls work both normally and through ajax + + url( # section/sort/query/search/tags/author + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/search:search/tags:(?P[\w\d\-\+\#]+)/author:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/tags/author/page_size Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/tags:(?P[\w\d\-\+\#]+)/author:(?P\d+)/page_size:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/tags/author/page Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/tags:(?P[\w\d\-\+\#]+)/author:(?P\d+)/page:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/tags/author for use with ajax + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/tags:(?P[\w\d\-\+\#]+)/author:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/author/page_size Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/author:(?P\d+)/page_size:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/author/page Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/author:(?P\d+)/page:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/author for use with ajax + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/author:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/search/author + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/search:search/author:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/tags/page_size Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/tags:(?P[\w\d\-\+\#]+)/page_size:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/tags/page Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/tags:(?P[\w\d\-\+\#]+)/page:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/search/tags + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/search:search/tags:(?P[\w\d\-\+\#]+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/tags for use with ajax + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/tags:(?P[\w\d\-\+\#]+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + + url( # section/sort/query/search + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/search:search/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/page_size Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/page_size:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query/page Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/page:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/query for use with ajax + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/query:(?P[\w\d\-\+\#]+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/tags/author/page_size Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/tags:(?P[\w\d\-\+\#]+)/author:(?P\d+)/page_size:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/tags/author/page Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/tags:(?P[\w\d\-\+\#]+)/author:(?P\d+)/page:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/tags/author for use with ajax + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/tags:(?P[\w\d\-\+\#]+)/author:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/author/page_size Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/author:(?P\d+)/page_size:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/author/page Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/author:(?P\d+)/page:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/author for use with ajax + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/author:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/tags/page_size Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/tags:(?P[\w\d\-\+\#]+)/page_size:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # section/sort/tags/page Note:issues with default start_over + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/tags:(?P[\w\d\-\+\#]+)/page:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # include section/sort/tags r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/tags:(?P[\w\d\-\+\#]+)/$' % _('questions'), views.readers.questions, name='questions' ), - url(#this url works both normally and through ajax - r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/$' % _('questions'), + url( # tags/author/page_size Note:issues with default start_over + r'^%s/tags:(?P[\w\d\-\+\#]+)/author:(?P\d+)/page_size:(?P\d+)/$' % _('questions'), views.readers.questions, name='questions' ), - url( - r'^%s/remove_tag:(?P[\w\d\-\#]+)/$' % _('questions'), + url( # tags/author/page Note:issues with default start_over + r'^%s/tags:(?P[\w\d\-\+\#]+)/author:(?P\d+)/page:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # include tags/author + r'^%s/tags:(?P[\w\d\-\+\#]+)/author:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + + url( # author/page_size Note:issues with default start_over + r'^%s/author:(?P\d+)/page_size:(?P\d+)/$' % _('questions'), views.readers.questions, name='questions' ), - url( - r'^%s/reset_tags:(?P\w+)/$' % _('questions'), + url( # author/page Note:issues with default start_over + r'^%s/author:(?P\d+)/page:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # include author + r'^%s/author:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + + url( # tags/page_size Note:issues with default start_over + r'^%s/tags:(?P[\w\d\-\+\#]+)/page_size:(?P\d+)/$' % _('questions'), views.readers.questions, name='questions' ), - url( - r'^%s/reset_author:(?P\w+)/$' % _('questions'), + url( # tags/page Note:issues with default start_over + r'^%s/tags:(?P[\w\d\-\+\#]+)/page:(?P\d+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # include tags + r'^%s/tags:(?P[\w\d\-\+\#]+)/$' % _('questions'), + views.readers.questions, + name='questions' + ), + url( # include section/sort/page_size + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/page_size:(?P\d+)/$' % _('questions'), views.readers.questions, name='questions' ), - url( - r'^%s/reset_query:(?P\w+)/$' % _('questions'), + url( # include section/sort/page + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/page:(?P\d+)/$' % _('questions'), views.readers.questions, name='questions' ), - url( - r'^%s/start_over:(?P\w+)/$' % _('questions'), #Nota: hay start over con mas parametros + url( # include section/sort + r'^%s/section:(?P\w+)/sort:(?P[\w\-]+)/$' % _('questions'), views.readers.questions, name='questions' ), + url( # removes tag, this is used only with ajax and this parameters is always used alone + r'^%s/remove_tag:(?P[\w\d\-\#]+)/$' % _('questions'), + views.readers.questions, + {'start_over': (None)}, # this parameter is true by default, so we are making it false here + name='questions' + ), + url( # reset_query, for ajax use + r'^%s/reset_query:(?P\w+)/$' % _('questions'), + views.readers.questions, + {'start_over': (None)}, # this parameter is true by default, so we are making it false here + name='questions' + ), url( - r'^%s$' % _('questions/'), - views.readers.questions, + r'^%s$' % _('questions/'), + views.readers.questions, name='questions' ), + + # END main page urls + url( r'^api/get_questions/', views.commands.api_get_questions, diff --git a/askbot/views/readers.py b/askbot/views/readers.py index 3163ce61..f35a4e8b 100644 --- a/askbot/views/readers.py +++ b/askbot/views/readers.py @@ -64,7 +64,7 @@ def index(request):#generates front page - shows listing of questions sorted in def questions(request, scope=const.DEFAULT_POST_SCOPE, sort=const.DEFAULT_POST_SORT_METHOD, query=None, \ search=None, tags=None, author=None, page=None, reset_tags=None, \ - reset_author=None, reset_query=None, start_over=None, \ + reset_author=None, reset_query=None, start_over=True, \ remove_tag=None, page_size=None): """ List of Questions, Tagged questions, and Unanswered questions. -- cgit v1.2.3-1-g7c22