Ask Your Question
2

Can an admin mark question as answered?

asked 2011-02-17 22:31:06 -0600

mwise gravatar image

updated 2011-02-18 15:10:30 -0600

Evgeny gravatar image

We have a lot of new users who are not familiar with askbot and are not marking the questions as answered is there a way for an admin to mark a question as answered.

edit retag flag offensive close merge delete

Comments

any idea where in the code I should start looking to enable this feature.. basically I need to change the js to allow the icon to be shown when the admin is looking at a question
mwise gravatar imagemwise ( 2011-02-18 22:55:01 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2011-02-19 03:13:07 -0600

Evgeny gravatar image

updated 2011-02-19 19:42:07 -0600

Hello, to get it done quickly - please change these two things:

(1) - function askbot.models.user_assert_can_unaccept_best_answer in the file askbot/models/__init__.py - this assertion is used for both accepting and unaccepting the best answer.

(2) - show icon "accept answer" to admins - around line 207 in askbot/skins/default/templates/question.html by changing it from

{% if request.user == question.author %}
       <img id="answer-img-accept-{{ answer.id }} ...

to

{% if request.user == question.author or request.user.is_administrator() %}
       <img id="answer-img-accept-{{ answer.id }} ...

Properly it would require adding a couple of settings to the configuration and updating test cases and fix the rep awarding.

Edit: one more thing -

change file askbot/skins/default/media/js/post.js around line 288

var bindEvents = function(){
        // accept answers
        if(true){//edit on this line: was questionAuthorId == currentUserId){
            var acceptedButtons = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAccept +']';
edit flag offensive delete link more

Comments

that's a partial fix... the icon shows up and I made the edit to __init__.py but when I click on the accept icon nothing happens.. is there something I'm missing..
mwise gravatar imagemwise ( 2011-02-19 18:50:19 -0600 )edit
You are right, added another small change, seems to work then.
Evgeny gravatar imageEvgeny ( 2011-02-19 19:43:20 -0600 )edit
thanks everything is now working :)
mwise gravatar imagemwise ( 2011-02-19 20:14:20 -0600 )edit
0

answered 2011-02-20 13:40:09 -0600

viisik gravatar image

have these changes been made also to the Askbot latest release

edit flag offensive delete link more

Comments

Not yet, need to write test cases, the changes in my quick answers are just hacks that may be unreliable and have side effects.
Evgeny gravatar imageEvgeny ( 2011-02-20 13:58:13 -0600 )edit
What is the status on this now?
mether gravatar imagemether ( 2011-07-10 02:21:26 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-02-17 22:31:06 -0600

Seen: 213 times

Last updated: Feb 20 '11