summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--askbot/doc/source/changelog.rst2
-rw-r--r--askbot/skins/default/media/style/style.css1
-rw-r--r--askbot/skins/default/templates/question.html17
-rw-r--r--askbot/skins/default/templates/users.html8
-rw-r--r--askbot/views/writers.py11
5 files changed, 34 insertions, 5 deletions
diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst
index 77ff4a45..dd1488a0 100644
--- a/askbot/doc/source/changelog.rst
+++ b/askbot/doc/source/changelog.rst
@@ -4,6 +4,8 @@ Changes in Askbot
Development version (Not yet released)
--------------------------------------
* RSS feed for individual question (Sayan Chowdhury)
+* Allow pre-population of tags via ask a questios link (Adolfo)
+* Make answering own question one click harder (Adolfo)
0.7.24 (Current Version)
------------------------
diff --git a/askbot/skins/default/media/style/style.css b/askbot/skins/default/media/style/style.css
index 478f5116..6297721b 100644
--- a/askbot/skins/default/media/style/style.css
+++ b/askbot/skins/default/media/style/style.css
@@ -887,6 +887,7 @@ a:hover.medal {
margin: 5px 0 0 4px;
padding: 0 2px;
text-decoration: none;
+ font-size: 12.5px;
}
.tabsA .label, .tabsC .label {
diff --git a/askbot/skins/default/templates/question.html b/askbot/skins/default/templates/question.html
index 91287bdb..ae003ef4 100644
--- a/askbot/skins/default/templates/question.html
+++ b/askbot/skins/default/templates/question.html
@@ -305,7 +305,12 @@
<a href="mailto:?subject={{ settings.APP_SHORT_NAME|urlencode }}&amp;body={{ question_url }}">{% trans %}email{% endtrans %}</a>.
</h2>
{% endif %}
-<form id="fmanswer" action="{% url answer question.id %}" method="post">{% csrf_token %}
+<form
+ id="fmanswer"
+ {% if user == question.author %}style="display:none"{% endif %}
+ action="{% url answer question.id %}"
+ method="post"
+>{% csrf_token %}
{% if request.user.is_authenticated() %}
<p style="padding-left:3px">
{{ answer.email_notify }}
@@ -380,6 +385,9 @@
{% endif %}
{% endif %}
</form>
+ {% if request.user == question.author %}
+ <input type="button" class="submit after-editor" id="fmanswer_button" value="{% trans %}Answer Your Own Question{% endtrans %}"/>
+ {%endif%}
{% endblock %}
{% block sidebar %}
@@ -535,6 +543,13 @@
$('#fmanswer textarea').focus();
}
{% if settings.ENABLE_SHARING_GOOGLE %}$.getScript("http://apis.google.com/js/plusone.js"){% endif %}
+
+ {% if request.user == question.author %}
+ $("#fmanswer_button").click(function() {
+ $("#fmanswer").show();
+ $("#fmanswer_button").hide();
+ });
+ {%endif%}
});
function initEditor(){
diff --git a/askbot/skins/default/templates/users.html b/askbot/skins/default/templates/users.html
index 750b3abb..1d7d02dd 100644
--- a/askbot/skins/default/templates/users.html
+++ b/askbot/skins/default/templates/users.html
@@ -10,25 +10,25 @@
id="sort_reputation"
href="{% url users %}?sort=reputation"
{% if tab_id == 'reputation' %}class="on"{% endif %}
- title="{% trans %}reputation{% endtrans %}"
+ title="{% trans %}see people with the highest reputation{% endtrans %}"
><span>{% trans %}reputation{% endtrans %}</span></a>
<a
id="sort_newest"
href="{% url users %}?sort=newest"
{% if tab_id == 'newest' %}class="on"{% endif %}
- class="off" title="{% trans %}recent{% endtrans %}"
+ class="off" title="{% trans %}see people who joined most recently{% endtrans %}"
><span>{% trans %}recent{% endtrans %}</span></a>
<a
id="sort_last"
href="{% url users %}?sort=last"
{% if tab_id == 'last' %}class="on"{% endif %}
- class="off" title="{% trans %}oldest{% endtrans %}"
+ class="off" title="{% trans %}see people who joined the site first{% endtrans %}"
><span>{% trans %}oldest{% endtrans %}<span></a>
<a
id="sort_user"
href="{% url users %}?sort=user"
{% if tab_id == 'user' %}class="on"{% endif %}
- title="{% trans %}by username{% endtrans %}"
+ title="{% trans %}see people sorted by name{% endtrans %}"
><span>{% trans %}by username{% endtrans %}</span></a>
</div>
</div>
diff --git a/askbot/views/writers.py b/askbot/views/writers.py
index d64c9c02..8b07681a 100644
--- a/askbot/views/writers.py
+++ b/askbot/views/writers.py
@@ -267,6 +267,17 @@ def ask(request):#view used to ask a new question
query = search_state.query
form.initial['title'] = query
+ if 'tags' in request.GET:
+ #pre-populate tags.
+ clean_tags = request.GET['tags'].replace(',', ' ')
+ form.initial['tags'] = clean_tags
+ else:
+ #attemp to get tags from search state
+ search_state = request.session.get('search_state', None)
+ if search_state.tags:
+ tags = ' '.join(search_state.tags)
+ form.initial['tags'] = tags
+
data = {
'active_tab': 'ask',
'page_class': 'ask-page',