summaryrefslogtreecommitdiffstats
path: root/askbot/skins/default/templates/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'askbot/skins/default/templates/widgets')
-rw-r--r--askbot/skins/default/templates/widgets/answer_edit_tips.html46
-rw-r--r--askbot/skins/default/templates/widgets/ask_button.html5
-rw-r--r--askbot/skins/default/templates/widgets/ask_form.html7
-rw-r--r--askbot/skins/default/templates/widgets/groups_list.html4
-rw-r--r--askbot/skins/default/templates/widgets/markdown_help.html42
-rw-r--r--askbot/skins/default/templates/widgets/meta_nav.html17
-rw-r--r--askbot/skins/default/templates/widgets/question_edit_tips.html47
-rw-r--r--askbot/skins/default/templates/widgets/question_summary.html12
-rw-r--r--askbot/skins/default/templates/widgets/tag_category_selector.html3
-rw-r--r--askbot/skins/default/templates/widgets/tag_editor.html31
-rw-r--r--askbot/skins/default/templates/widgets/three_column_category_selector.html22
-rw-r--r--askbot/skins/default/templates/widgets/user_list.html8
-rw-r--r--askbot/skins/default/templates/widgets/user_navigation.html3
13 files changed, 141 insertions, 106 deletions
diff --git a/askbot/skins/default/templates/widgets/answer_edit_tips.html b/askbot/skins/default/templates/widgets/answer_edit_tips.html
index 1c2cdc60..2bb5b256 100644
--- a/askbot/skins/default/templates/widgets/answer_edit_tips.html
+++ b/askbot/skins/default/templates/widgets/answer_edit_tips.html
@@ -22,46 +22,6 @@
</p>
</div>
</div>
-
-<div class="box">
- <h2>{% trans %}Markdown basics{% endtrans %}</h2>
- <ul>
- {% if settings.MARKUP_CODE_FRIENDLY or settings.ENABLE_MATHJAX %}
- <li>
- {% trans %}*italic*{% endtrans %}
- </li>
- <li>
- {% trans %}**bold**{% endtrans %}
- </li>
- {% else %}
- <li>
- {% trans %}*italic* or _italic_{% endtrans %}
- </li>
- <li>
- {% trans %}**bold** or __bold__{% endtrans %}
- </li>
- {% endif %}
- <li>
- <b>{% trans %}link{% endtrans %}</b>:[{% trans %}text{% endtrans %}](http://url.com/ "{% trans %}title{% endtrans %}")
-
- </li>
- <li>
- <b>{% trans %}image{% endtrans %}</b>:![alt {% trans %}text{% endtrans %}](/path/img.jpg "{% trans %}title{% endtrans %}")
-
- </li>
- <li>
- {% trans %}numbered list:{% endtrans %}
- 1. Foo
- 2. Bar
- </li>
- <li>
- {% trans %}basic HTML tags are also supported{% endtrans %}
- </li>
- </ul>
- <p class='info-box-follow-up-links'>
-<!-- will be change to a popup windows
- <a href="http://en.wikipedia.org/wiki/Markdown" target="_blank">{% trans %}learn more about Markdown{% endtrans %} »</a>
--->
- </p>
-</div>
-<!-- end template answer_edit_tips.html -->
+{% if settings.EDITOR_TYPE == 'markdown' %}
+ {% include "widgets/markdown_help.html" %}
+{% endif %}
diff --git a/askbot/skins/default/templates/widgets/ask_button.html b/askbot/skins/default/templates/widgets/ask_button.html
index 31448b73..e202b110 100644
--- a/askbot/skins/default/templates/widgets/ask_button.html
+++ b/askbot/skins/default/templates/widgets/ask_button.html
@@ -2,5 +2,8 @@
{% if not search_state %} {# get empty SearchState() if there's none #}
{% set search_state=search_state|get_empty_search_state %}
{% endif %}
- <a id="askButton" href="{{ search_state.full_ask_url() }}">{% trans %}Ask Your Question{% endtrans %}</a>
+ <a
+ id="askButton"
+ href="{{ search_state.full_ask_url() }}{% if group %}{% if '?' in search_state.full_ask_url() %}&{% else %}?{% endif %}group_id={{ group.id }}{% endif %}"
+ >{% if group %}{% trans %}Ask the Group{% endtrans %}{% else %}{% trans %}Ask Your Question{% endtrans %}{% endif %}</a>
{% endif %}
diff --git a/askbot/skins/default/templates/widgets/ask_form.html b/askbot/skins/default/templates/widgets/ask_form.html
index 2ece84d5..d528609f 100644
--- a/askbot/skins/default/templates/widgets/ask_form.html
+++ b/askbot/skins/default/templates/widgets/ask_form.html
@@ -3,7 +3,6 @@
<div class="form-item">
<div id="askFormBar">
{% if not request.user.is_authenticated() %}
- <p>{% trans %}login to post question info{% endtrans %}</p>
<p>{% trans %}<span class=\"strong big\">You are welcome to start submitting your question anonymously</span>. When you submit the post, you will be redirected to the login/signup page. Your question will be saved in the current session and will be published after you log in. Login/signup process is very simple. Login takes about 30 seconds, initial signup takes a minute or less.{% endtrans %}</p>
{% else %}
{% if settings.EMAIL_VALIDATION %}
@@ -27,9 +26,12 @@
post_type = 'question',
edit_title = False,
mandatory_tags = mandatory_tags,
+ use_category_selector = (settings.TAG_SOURCE == 'category-tree'),
+ editor_type = settings.EDITOR_TYPE,
user = request.user
)
}}
+ {{ form.group_id }}
<div class="question-options">
{% if settings.WIKI_ON %}
{{ macros.checkbox_in_div(form.wiki) }}
@@ -37,6 +39,9 @@
{% if settings.ALLOW_ASK_ANONYMOUSLY %}
{{ macros.checkbox_in_div(form.ask_anonymously) }}
{% endif %}
+ {% if request.user.is_authenticated() and request.user.can_make_group_private_posts() %}
+ {{ macros.checkbox_in_div(form.post_privately) }}
+ {% endif %}
</div>
{% if not request.user.is_authenticated() %}
<input type="submit" name="post_anon" value="{% trans %}Login/Signup to Post{% endtrans %}" class="submit" />
diff --git a/askbot/skins/default/templates/widgets/groups_list.html b/askbot/skins/default/templates/widgets/groups_list.html
new file mode 100644
index 00000000..0669f34f
--- /dev/null
+++ b/askbot/skins/default/templates/widgets/groups_list.html
@@ -0,0 +1,4 @@
+{% import "macros.html" as macros %}
+{% for group in groups %}
+ <p>{{ macros.user_group(group) }}</p>
+{% endfor %}
diff --git a/askbot/skins/default/templates/widgets/markdown_help.html b/askbot/skins/default/templates/widgets/markdown_help.html
new file mode 100644
index 00000000..9816fe26
--- /dev/null
+++ b/askbot/skins/default/templates/widgets/markdown_help.html
@@ -0,0 +1,42 @@
+<div class="box">
+ <h2>{% trans %}Markdown basics{% endtrans %}</h2>
+ <ul>
+ {% if settings.MARKUP_CODE_FRIENDLY or settings.ENABLE_MATHJAX %}
+ <li>
+ {% trans %}*italic*{% endtrans %}
+ </li>
+ <li>
+ {% trans %}**bold**{% endtrans %}
+ </li>
+ {% else %}
+ <li>
+ {% trans %}*italic* or _italic_{% endtrans %}
+ </li>
+ <li>
+ {% trans %}**bold** or __bold__{% endtrans %}
+ </li>
+ {% endif %}
+ <li>
+ <b>{% trans %}link{% endtrans %}</b>:[{% trans %}text{% endtrans %}](http://url.com/ "{% trans %}title{% endtrans %}")
+
+ </li>
+ <li>
+ <b>{% trans %}image{% endtrans %}</b>:![alt {% trans %}text{% endtrans %}](/path/img.jpg "{% trans %}title{% endtrans %}")
+
+ </li>
+ <li>
+ {% trans %}numbered list:{% endtrans %}
+ 1. Foo
+ 2. Bar
+ </li>
+ <li>
+ {% trans %}basic HTML tags are also supported{% endtrans %}
+ </li>
+ </ul>
+ <p class='info-box-follow-up-links'>
+<!-- will be change to a popup windows
+ <a href="http://en.wikipedia.org/wiki/Markdown" target="_blank">{% trans %}learn more about Markdown{% endtrans %} »</a>
+-->
+ </p>
+</div>
+<!-- end template answer_edit_tips.html -->
diff --git a/askbot/skins/default/templates/widgets/meta_nav.html b/askbot/skins/default/templates/widgets/meta_nav.html
index 1b28c787..20c22491 100644
--- a/askbot/skins/default/templates/widgets/meta_nav.html
+++ b/askbot/skins/default/templates/widgets/meta_nav.html
@@ -1,20 +1,23 @@
+{% import "macros.html" as macros%}
<a
id="navTags"
href="{% url tags %}"
{% if active_tab == 'tags' %}class="on"{% endif %}
>{% trans %}tags{% endtrans %}</a>
+{% if settings.GROUPS_ENABLED %}
+<span class="dropdown">
+<a
+ id="navGroups" class='{% if active_tab == 'groups' %}"on"{% endif %}'
+ href="{% url groups %}" data-target="#" >
+ {% trans %}people & groups{% endtrans %}
+</a>
+</span>
+{%else%}
<a
id="navUsers"
href="{% url users %}"
{% if active_tab == 'users' %}class="on"{% endif %}
>{% trans %}users{% endtrans %}</a>
-{% if settings.GROUPS_ENABLED %}
-<a
- id="navGroups"
- href="{% url groups %}"
- {% if active_tab == 'groups' %}class="on"{% endif %}
->{% trans %}groups{% endtrans %}
-</a>
{% endif %}
{% if settings.BADGES_MODE == 'public' %}
<a
diff --git a/askbot/skins/default/templates/widgets/question_edit_tips.html b/askbot/skins/default/templates/widgets/question_edit_tips.html
index 842aa491..f60304c1 100644
--- a/askbot/skins/default/templates/widgets/question_edit_tips.html
+++ b/askbot/skins/default/templates/widgets/question_edit_tips.html
@@ -17,47 +17,6 @@
-->
</p>
</div>
-
-<div id="markdownHelp"class="box">
- <h2>{% trans %}Markdown basics{% endtrans %}</h2>
- <ul>
- {% if settings.MARKDUP_CODE_FRIENDLY or settings.ENABLE_MATHJAX %}
- <li>
- {% trans %}*italic*{% endtrans %}
- </li>
- <li>
- {% trans %}**bold**{% endtrans %}
- </li>
- {% else %}
- <li>
- {% trans %}*italic* or _italic_{% endtrans %}
- </li>
- <li>
- {% trans %}**bold** or __bold__{% endtrans %}
- </li>
- {% endif %}
- <li>
- <b>{% trans %}link{% endtrans %}</b>:[{% trans %}text{% endtrans %}](http://url.com/ "{% trans %}title{% endtrans %}")
-
- </li>
-
- <li>
- <b>{% trans %}image{% endtrans %}</b>:![alt {% trans %}text{% endtrans %}](/path/img.jpg "{% trans %}title{% endtrans %}")
-
- </li>
- <li>
- {% trans %}numbered list:{% endtrans %}
- 1. Foo
- 2. Bar
- </li>
- <li>
- {% trans %}basic HTML tags are also supported{% endtrans %}
- </li>
- </ul>
- <p class='info-box-follow-up-links'>
-<!-- will be change to a popup windows
- <a href="http://en.wikipedia.org/wiki/Markdown" target="_blank">{% trans %}learn more about Markdown{% endtrans %} »</a>
--->
- </p>
-</div>
-<!-- end question_edit_tips.html -->
+{% if settings.EDITOR_TYPE == 'markdown' %}
+ {% include "/widgets/markdown_help.html" %}
+{% endif %}
diff --git a/askbot/skins/default/templates/widgets/question_summary.html b/askbot/skins/default/templates/widgets/question_summary.html
index 5fd51e08..78aa2f0c 100644
--- a/askbot/skins/default/templates/widgets/question_summary.html
+++ b/askbot/skins/default/templates/widgets/question_summary.html
@@ -1,4 +1,4 @@
-{% from "macros.html" import user_country_flag, tag_list_widget, timeago %}
+{% from "macros.html" import user_country_flag, tag_list_widget, timeago, user_primary_group %}
<div class="short-summary{% if extra_class %} {{extra_class}}{% endif %}" id="question-{{question.id}}">
<div class="counts">
<div class="views
@@ -12,8 +12,9 @@
{% trans cnt=thread.view_count %}view{% pluralize %}views{% endtrans %}
</div>
</div>
+ {% set answer_count = thread.get_answer_count(visitor) %}
<div class="answers
- {% if thread.answer_count == 0 -%}
+ {% if answer_count == 0 -%}
no-answers
{% else -%}
{%- if thread.accepted_answer_id -%} {# INFO: Use _id to not fetch the whole answer post #}
@@ -24,9 +25,9 @@
{%- endif -%}">
<span
class="item-count"
- >{{thread.answer_count|humanize_counter}}{% if thread.accepted_answer_id %}{% endif %}</span>
+ >{{ answer_count|humanize_counter }}{% if thread.accepted_answer_id %}{% endif %}</span>
<div>
- {% trans cnt=thread.answer_count %}answer{% pluralize %}answers{% endtrans %}
+ {% trans cnt = answer_count %}answer{% pluralize %}answers{% endtrans %}
</div>
</div>
<div class="votes
@@ -49,9 +50,10 @@
<a href="{% url user_profile thread.last_activity_by.id, thread.last_activity_by.username|slugify %}">{{thread.last_activity_by.username|escape}}</a> {{ user_country_flag(thread.last_activity_by) }}
{#{user_score_and_badge_summary(thread.last_activity_by)}#}
{% endif %}
+ {% if thread.last_activity_by.get_primary_group() %}-{% endif %}
+ {{ user_primary_group(thread.last_activity_by) }}
</div>
</div>
<h2><a title="{{question.summary|escape}}" href="{{ question.get_absolute_url(thread=thread) }}">{{thread.get_title(question)|escape}}</a></h2>
{{ tag_list_widget(thread.get_tag_names(), search_state=search_state) }}
</div>
-
diff --git a/askbot/skins/default/templates/widgets/tag_category_selector.html b/askbot/skins/default/templates/widgets/tag_category_selector.html
new file mode 100644
index 00000000..9eabb6eb
--- /dev/null
+++ b/askbot/skins/default/templates/widgets/tag_category_selector.html
@@ -0,0 +1,3 @@
+{% include "widgets/three_column_category_selector.html" %}
+<div class="tags-desc">{% trans %}Tags{% endtrans %}</div>
+{% include "widgets/tag_editor.html" %}
diff --git a/askbot/skins/default/templates/widgets/tag_editor.html b/askbot/skins/default/templates/widgets/tag_editor.html
new file mode 100644
index 00000000..8f3fa8cd
--- /dev/null
+++ b/askbot/skins/default/templates/widgets/tag_editor.html
@@ -0,0 +1,31 @@
+{% import "macros.html" as macros %}
+<p style="margin:-18px 0 0 42px; color: brown; font-size: 13px; font-style: italic"
+ class="tag-editor-error-alert"
+>
+ <span for="id_tags" generated="true" class="form-error" style="float: left;"></span>
+</p>
+<div class="tag-editor" style="margin-top: 18px">{# there's a hack with the margin in js as well #}
+ {{ macros.tag_list_widget(
+ tag_names,
+ deletable = True,
+ make_links = False
+ )
+ }}
+ <input
+ class="new-tags-input"
+ type="text"
+ name="new_tags_input"
+ />
+ <div class="clearfix"></div>
+ <input
+ id="id_tags"
+ name="tags"
+ type="hidden"
+ value="{% if tag_names %}{{tag_names|join(' ')}}{% endif %}"
+ />
+ {#
+ tag input is hidden because we want to edit the list visually
+ we also want to eventually allow multiword tags, which are
+ not easy to enter into a simple input box
+ #}
+</div>
diff --git a/askbot/skins/default/templates/widgets/three_column_category_selector.html b/askbot/skins/default/templates/widgets/three_column_category_selector.html
new file mode 100644
index 00000000..ab0886c6
--- /dev/null
+++ b/askbot/skins/default/templates/widgets/three_column_category_selector.html
@@ -0,0 +1,22 @@
+{# just a skeleton for the category selector - filled by js #}
+<table class="category-selector">
+ <thead>
+ <th colspan="3">{% trans %}Categorize your question using this tag selector or entering text in tag box.{% endtrans %}
+ <a style="display:none;"
+ class='category-editor-toggle'
+ data-on-state-text='{% trans %}(done editing){% endtrans %}'
+ data-off-state-text='{% trans %}(edit categories){% endtrans %}'
+ data-on-prompt-text='{% trans %}(edit categories){% endtrans %}'
+ data-off-prompt-text='{% trans %}(done editing){% endtrans %}'
+ >{% trans %}(edit categories){% endtrans %}
+ </a>
+ </th>
+ </thead>
+ <tbody>
+ <tr>
+ <td><ul class="select-box cat-col-0"></ul></td>
+ <td><ul class="select-box cat-col-1"></ul></td>
+ <td><ul class="select-box cat-col-2"></ul></td>
+ </tr>
+ </tbody>
+</table>
diff --git a/askbot/skins/default/templates/widgets/user_list.html b/askbot/skins/default/templates/widgets/user_list.html
index e51abc5b..52cf8bd4 100644
--- a/askbot/skins/default/templates/widgets/user_list.html
+++ b/askbot/skins/default/templates/widgets/user_list.html
@@ -1,4 +1,4 @@
-{%from "macros.html" import gravatar %}
+{% import "macros.html" as macros %}
<div class="userList">
<table class="list-table">
<tr>
@@ -6,10 +6,10 @@
{% for user in users %}
<div class="user">
<ul>
- <li class="thumb">{{ gravatar(user, 32) }}</li>
- <li><a href="{% url user_profile user.id, user.username|slugify %}{% if profile_section %}?sort={{profile_section}}{% endif %}">{{user.username|escape}}</a>{{ user_country_flag(user) }}</li>
+ <li class="thumb">{{ macros.gravatar(user, 32) }}</li>
+ <li><a href="{% url user_profile user.id, user.username|slugify %}{% if profile_section %}?sort={{profile_section}}{% endif %}">{{user.username|escape}}</a>{{ macros.user_country_flag(user) }}</li>
<li>{{
- user_score_and_badge_summary(
+ macros.user_score_and_badge_summary(
user,
karma_mode = karma_mode,
badges_mode = badges_mode
diff --git a/askbot/skins/default/templates/widgets/user_navigation.html b/askbot/skins/default/templates/widgets/user_navigation.html
index 717cd7ee..06b0cdb9 100644
--- a/askbot/skins/default/templates/widgets/user_navigation.html
+++ b/askbot/skins/default/templates/widgets/user_navigation.html
@@ -17,9 +17,10 @@
<a href="{{ settings.LOGOUT_URL }}?next={{ settings.LOGOUT_REDIRECT_URL }}">{% trans %}sign out{% endtrans %}</a>
{% endif %}
{% elif settings.USE_ASKBOT_LOGIN_SYSTEM %}
- <a href="{{ settings.LOGIN_URL }}?next={{request.path|clean_login_url}}">{% trans %}Hi, there! Please sign in{% endtrans %}</a>
+ <a href="{{ settings.LOGIN_URL }}?next={{request.path|clean_login_url}}">{% trans %}Hi there! Please sign in{% endtrans %}</a>
{% endif %}
{% if request.user.is_authenticated() and request.user.is_administrator() %}
<a href="{% url site_settings %}">{% trans %}settings{% endtrans %}</a>
+ <a href="{% url widgets %}">{% trans %}widgets{% endtrans %}</a>
{% endif %}
<a href="{% url "help" %}" title="{% trans %}help{% endtrans %}">{% trans %}help{% endtrans %}</a>