From 1c36262857389b9b3a5996c1fbb41dc64917d75e Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Wed, 12 Oct 2011 13:45:59 -0300 Subject: moved macros to macros folder --- askbot/skins/default/templates/answer_edit.html | 2 +- askbot/skins/default/templates/ask.html | 2 +- .../skins/default/templates/authopenid/macros.html | 58 -- .../skins/default/templates/authopenid/signin.html | 2 +- .../templates/authopenid/signup_with_password.html | 2 +- askbot/skins/default/templates/badge.html | 2 +- .../skins/default/templates/blocks/ask_form.html | 2 +- askbot/skins/default/templates/blocks/header.html | 2 +- .../skins/default/templates/blocks/paginator.html | 2 +- askbot/skins/default/templates/macros.html | 757 --------------------- .../templates/macros/authopenid_macros.html | 58 ++ askbot/skins/default/templates/macros/macros.html | 757 +++++++++++++++++++++ .../skins/default/templates/main_page/content.html | 2 +- .../default/templates/main_page/headline.html | 2 +- .../default/templates/main_page/paginator.html | 2 +- .../skins/default/templates/main_page/sidebar.html | 2 +- .../skins/default/templates/main_page/tab_bar.html | 2 +- askbot/skins/default/templates/question.html | 2 +- askbot/skins/default/templates/question_edit.html | 2 +- askbot/skins/default/templates/question_retag.html | 2 +- askbot/skins/default/templates/revisions.html | 2 +- .../default/templates/subscribe_for_tags.html | 2 +- askbot/skins/default/templates/tags.html | 2 +- .../default/templates/user_profile/user_edit.html | 2 +- .../default/templates/user_profile/user_inbox.html | 2 +- .../default/templates/user_profile/user_info.html | 2 +- .../templates/user_profile/user_network.html | 2 +- .../default/templates/user_profile/user_stats.html | 2 +- .../templates/user_profile/users_questions.html | 2 +- askbot/skins/default/templates/users.html | 2 +- 30 files changed, 841 insertions(+), 841 deletions(-) delete mode 100644 askbot/skins/default/templates/authopenid/macros.html delete mode 100644 askbot/skins/default/templates/macros.html create mode 100644 askbot/skins/default/templates/macros/authopenid_macros.html create mode 100644 askbot/skins/default/templates/macros/macros.html diff --git a/askbot/skins/default/templates/answer_edit.html b/askbot/skins/default/templates/answer_edit.html index e8cbc7ae..fbab0bc9 100644 --- a/askbot/skins/default/templates/answer_edit.html +++ b/askbot/skins/default/templates/answer_edit.html @@ -1,5 +1,5 @@ {% extends "two_column_body.html" %} -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %} {% block title %}{% spaceless %}{% trans %}Edit answer{% endtrans %}{% endspaceless %}{% endblock %} {% block forestyle %} diff --git a/askbot/skins/default/templates/ask.html b/askbot/skins/default/templates/ask.html index 9aaa7e8c..eaf840bb 100644 --- a/askbot/skins/default/templates/ask.html +++ b/askbot/skins/default/templates/ask.html @@ -1,5 +1,5 @@ {% extends "two_column_body.html" %} -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %} {% block title %}{% spaceless %}{% trans %}Ask a question{% endtrans %}{% endspaceless %}{% endblock %} {% block forestyle %} diff --git a/askbot/skins/default/templates/authopenid/macros.html b/askbot/skins/default/templates/authopenid/macros.html deleted file mode 100644 index 477d277c..00000000 --- a/askbot/skins/default/templates/authopenid/macros.html +++ /dev/null @@ -1,58 +0,0 @@ -{% macro login_provider_input(login_provider) %} - -{% endmacro %} - -{% macro provider_buttons( - login_form = None, - major_login_providers = None, - minor_login_providers = None, - hide_local_login = False, - settings = None, - logged_in = False - ) -%} -
- - -
- -{% endmacro %} diff --git a/askbot/skins/default/templates/authopenid/signin.html b/askbot/skins/default/templates/authopenid/signin.html index 49c447a1..554fcd3c 100644 --- a/askbot/skins/default/templates/authopenid/signin.html +++ b/askbot/skins/default/templates/authopenid/signin.html @@ -1,5 +1,5 @@ {% extends "two_column_body.html" %} -{% import "authopenid/macros.html" as login_macros %} +{% import "macros/authopenid_macros.html" as login_macros %} {% block title %}{% spaceless %}{% trans %}User login{% endtrans %}{% endspaceless %}{% endblock %} {% block forestyle %} diff --git a/askbot/skins/default/templates/authopenid/signup_with_password.html b/askbot/skins/default/templates/authopenid/signup_with_password.html index 047ff076..5009cb2c 100644 --- a/askbot/skins/default/templates/authopenid/signup_with_password.html +++ b/askbot/skins/default/templates/authopenid/signup_with_password.html @@ -1,5 +1,5 @@ {% extends "one_column_body.html" %} -{% import "authopenid/macros.html" as login_macros %} +{% import "macros/authopenid_macros.html" as login_macros %} {% block title %}{% spaceless %}{% trans %}Signup{% endtrans %}{% endspaceless %}{% endblock %} {% block forestyle %} diff --git a/askbot/skins/default/templates/badge.html b/askbot/skins/default/templates/badge.html index ee7f5360..cf79df9b 100644 --- a/askbot/skins/default/templates/badge.html +++ b/askbot/skins/default/templates/badge.html @@ -1,5 +1,5 @@ {% extends "two_column_body.html" %} -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %} {% block title %}{% spaceless %}{% trans name=badge.name %}{{name}}{% endtrans %} - {% trans %}Badge{% endtrans %}{% endspaceless %}{% endblock %} {% block content %} diff --git a/askbot/skins/default/templates/blocks/ask_form.html b/askbot/skins/default/templates/blocks/ask_form.html index 606aef78..802228f3 100644 --- a/askbot/skins/default/templates/blocks/ask_form.html +++ b/askbot/skins/default/templates/blocks/ask_form.html @@ -1,4 +1,4 @@ -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %}
{% csrf_token %}
diff --git a/askbot/skins/default/templates/blocks/header.html b/askbot/skins/default/templates/blocks/header.html index 340b9ef2..09d87344 100644 --- a/askbot/skins/default/templates/blocks/header.html +++ b/askbot/skins/default/templates/blocks/header.html @@ -1,5 +1,5 @@ -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %} +{%- endmacro -%} + +{%- macro edit_post( + post_form, + post_type = None, + mandatory_tags = None, + edit_title = False + ) +-%} + {% if edit_title %} +
+
+ {{ post_form.title }} {{ post_form.title.errors }} +
+ {{ post_form.title.help_text }} +
+
+ {% endif %} +
+
+ {{ post_form.text }}{# this element is resizable and will be wrapped by js #} + +
+ {# need label element for resizable input, b/c form validation won't find span #} + {% if post_type == 'question' %} +
+ {% if mandatory_tags %} + + {{ + tag_list_widget( + mandatory_tags, + make_links = False, + css_class = 'clearfix' + ) + }} + {% else %} + + {% endif %} + {{ post_form.tags.errors }}
+ {{ post_form.tags }} +
+ {{ post_form.tags.help_text }} +
+
+ {% endif %} + {% if 'summary' in post_form['fields'] %} +
+ {{ post_form.summary.label_tag() }}
+ {{ post_form.summary }} +
+ {{ post_form.summary.help_text }} +
+
{{ post_form.summary.errors }}
+
+ {% endif %} +
+ + [{% trans %}hide preview{% endtrans %}] + +
+
+{%- endmacro -%} + +{%- macro inbox_link(user) -%} + {% if user.new_response_count > 0 or user.seen_response_count > 0 %} + + {% trans username=user.username %}responses for {{username}}{% endtrans %} 0 %} + src="{{ "/images/mail-envelope-full.png"|media }}" + title="{% trans response_count=user.new_response_count %}you have a new response{% pluralize %}you have {{response_count}} new responses{% endtrans %}" + {% elif user.seen_response_count > 0 %} + src="{{ "/images/mail-envelope-empty.png"|media }}" + title="{% trans %}no new responses yet{% endtrans %}" + {% endif %} + /> + + {% endif %} +{%- endmacro -%} + +{%- macro moderation_items_link(user, moderation_items) -%} + {% if moderation_items %} + + {% if moderation_items['new_count'] > 0 %} + 0 %} + alt="{% trans new=moderation_items['new_count'], seen=moderation_items['seen_count']%}{{new}} new flagged posts and {{seen}} previous{% endtrans %}" + title="{% trans new=moderation_items['new_count'], seen=moderation_items['seen_count']%}{{new}} new flagged posts and {{seen}} previous{% endtrans %}" + {% else %} + alt="{% trans new=moderation_items['new_count'] %}{{new}} new flagged posts{% endtrans %}" + title="{% trans new=moderation_items['new_count'] %}{{new}} new flagged posts{% endtrans %}" + {% endif %} + /> + {% elif moderation_items['seen_count'] > 0 %} + {% trans seen=moderation_items['seen_count'] %}{{seen}} flagged posts{% endtrans %} + {% endif %} + + {% endif %} +{%- endmacro -%} + +{%- macro tag_autocomplete_js(id = '#id_tags') -%} + var tagAc = new AutoCompleter({ + url: '{% url "get_tag_list" %}', + preloadData: true, + minChars: 1, + useCache: true, + matchInside: true, + maxCacheLength: 100, + delay: 10 + }); + tagAc.decorate($("{{ id }}")); +{%- endmacro -%} diff --git a/askbot/skins/default/templates/main_page/content.html b/askbot/skins/default/templates/main_page/content.html index 72128cdc..e2edcfd6 100644 --- a/askbot/skins/default/templates/main_page/content.html +++ b/askbot/skins/default/templates/main_page/content.html @@ -1,4 +1,4 @@ -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %}
{% cache 0 "questions" questions search_tags scope sort query context.page context.page_size language_code %} {% for question in questions.object_list %} diff --git a/askbot/skins/default/templates/main_page/headline.html b/askbot/skins/default/templates/main_page/headline.html index 62d67ebb..94b249ba 100644 --- a/askbot/skins/default/templates/main_page/headline.html +++ b/askbot/skins/default/templates/main_page/headline.html @@ -1,4 +1,4 @@ -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %} {% if questions_count > 0 %}

diff --git a/askbot/skins/default/templates/main_page/paginator.html b/askbot/skins/default/templates/main_page/paginator.html index 4a77060f..643d9242 100644 --- a/askbot/skins/default/templates/main_page/paginator.html +++ b/askbot/skins/default/templates/main_page/paginator.html @@ -1,4 +1,4 @@ -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %} {% if questions_count > 10 %}{# todo: remove magic number #}
{{ macros.paginator(context|setup_paginator, position='left') }} diff --git a/askbot/skins/default/templates/main_page/sidebar.html b/askbot/skins/default/templates/main_page/sidebar.html index aca8256f..34f3f422 100644 --- a/askbot/skins/default/templates/main_page/sidebar.html +++ b/askbot/skins/default/templates/main_page/sidebar.html @@ -1,4 +1,4 @@ -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %} {{ settings.SIDEBAR_MAIN_HEADER }} diff --git a/askbot/skins/default/templates/main_page/tab_bar.html b/askbot/skins/default/templates/main_page/tab_bar.html index 49e12204..302b0ed4 100644 --- a/askbot/skins/default/templates/main_page/tab_bar.html +++ b/askbot/skins/default/templates/main_page/tab_bar.html @@ -1,4 +1,4 @@ -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %} {% cache 0 "scope_sort_tabs" search_tags request.user scope sort query context.page context.page_size language_code %}
diff --git a/askbot/skins/default/templates/question.html b/askbot/skins/default/templates/question.html index 282b47b4..4631bd0f 100644 --- a/askbot/skins/default/templates/question.html +++ b/askbot/skins/default/templates/question.html @@ -1,5 +1,5 @@ {% extends "two_column_body.html" %} -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %} {% block title %}{% spaceless %}{{ question.get_question_title() }}{% endspaceless %}{% endblock %} {% block meta_description %} diff --git a/askbot/skins/default/templates/question_edit.html b/askbot/skins/default/templates/question_edit.html index feee2521..77a20e70 100644 --- a/askbot/skins/default/templates/question_edit.html +++ b/askbot/skins/default/templates/question_edit.html @@ -1,5 +1,5 @@ {% extends "two_column_body.html" %} -{% import "macros.html" as macros %} +{% import "macros/macros.html" as macros %} {% block title %}{% spaceless %}{% trans %}Edit question{% endtrans %}{% endspaceless %}{% endblock %} {% block forestyle %} diff --git a/askbot/skins/default/templates/question_retag.html b/askbot/skins/default/templates/question_retag.html index 883dc3aa..be27f5de 100644 --- a/askbot/skins/default/templates/question_retag.html +++ b/askbot/skins/default/templates/question_retag.html @@ -44,7 +44,7 @@