diff options
Diffstat (limited to 'templates')
28 files changed, 1214 insertions, 1363 deletions
diff --git a/templates/about.html b/templates/about.html index db8c764e..66dcc3fd 100644 --- a/templates/about.html +++ b/templates/about.html @@ -12,43 +12,8 @@ </div> <div class="content"> -<<<<<<< HEAD:templates/about.html - <!-- default text - <p>edit file templates/about.html. Below are just suggestions of what can go here</p> - <p>what is your site for?</p> - <p>how does it work? what are roles of members?</p> - <p>is there a place to find out more about this website?</p> - --> - <p>{% blocktrans %}<strong>CNPROG <span class="orange">Q&A</span></strong> is a collaboratively edited question - and answer site created for the <strong>CNPROG</strong> community. - {% endblocktrans %} - </p> - <p>{% blocktrans %}Here you can <strong>ask</strong> and <strong>answer</strong> questions, <strong>comment</strong> - and <strong>vote</strong> for the questions of others and their answers. Both questions and answers - <strong>can be revised</strong> and improved. Questions can be <strong>tagged</strong> with - the relevant keywords to simplify future access and organize the accumulated material.{% endblocktrans %} - </p> + <p class="strong">Please customize file templates/about.html</p> - <p>{% blocktrans %}This <span class="orange">Q&A</span> site is moderated by its members, hopefully - including yourself! - Moderation rights are gradually assigned to the site users based on the accumulated <strong>"reputation"</strong> - points. These points are added to the users account when others vote for his/her questions or answers. - These points (very) roughly reflect the level of trust of the community.{% endblocktrans %} - </p> - <p>{% blocktrans %}No points are necessary to ask or answer the questions - so please - - <strong><a href="{% url user_signin %}">join us!</a></strong>{% endblocktrans %} - </p> - <p> - {% blocktrans %} - If you would like to find out more about this site - please see <strong><a href="{% url faq %}">frequently asked questions</a></strong>. - {% endblocktrans %} -======= - <p><strong>NMR Wiki <span class="orange">Q&A</span></strong> is a collaboratively edited question - and answer site created for the <strong>Magnetic Resonance</strong> community, i.e. those people who - work in the fields of <strong>NMR</strong>, <strong>EPR</strong>, <strong>MRI</strong></strong>, etc. - NMR Wiki Q&A is affiliated with <strong><a href="http://nmrwiki.org">NMR Wiki</a></strong> - - the public wiki knowledge base about the Magnetic Resonance, which currently counts ~300 registered users. The most useful information collected here - will be further distilled on the wiki site. - </p> <p>Here you can <strong>ask</strong> and <strong>answer</strong> questions, <strong>comment</strong> and <strong>vote</strong> for the questions of others and their answers. Both questions and answers <strong>can be revised</strong> and improved. Questions can be <strong>tagged</strong> with @@ -65,7 +30,6 @@ </p> <p> If you would like to find out more about this site - please see <strong><a href="{% url faq %}">frequently asked questions</a></strong>. ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/about.html </p> </div> {% endblock %} diff --git a/templates/authopenid/complete.html b/templates/authopenid/complete.html index e3c12ae5..85f6d8b1 100644 --- a/templates/authopenid/complete.html +++ b/templates/authopenid/complete.html @@ -11,7 +11,7 @@ parameters: * username (same as screen name or username in the models, and nickname in openid sreg) * form1 - OpenidRegisterForm * form2 - OpenidVerifyForm not clear what this form is supposed to do, not used for legacy -* email_feeds_form forum.forms.EditUserEmailFeedsForm +* email_feeds_form forum.forms.SimpleEmailSubscribeForm * openid_username_exists {% endcomment %} {% load i18n %} @@ -34,6 +34,8 @@ parameters: {% else %} {% blocktrans %}register new external {{provider}} account info, see {{gravatar_faq_url}}{% endblocktrans %} {% endif %} + {% else %} + {% blocktrans %}register new Facebook connect account info, see {{gravatar_faq_url}}{% endblocktrans %} {% endifequal %} {% endifequal %} </div> @@ -69,7 +71,11 @@ parameters: {% ifequal login_type 'openid' %} <form name="fregister" action="{% url user_register %}" method="POST"> {% else %} - <form name="fregister" action="{% url user_signin %}" method="POST"> + {% ifequal login_type 'facebook' %} + <form name="fregister" action="" method="POST"> + {% else %} + <form name="fregister" action="{% url user_signin %}" method="POST"> + {% endifequal %} {% endifequal %} {{ form1.next }} <div class="form-row-vertical"> @@ -86,12 +92,12 @@ parameters: {% endif %} {{ form1.email }} </div> - <p class='nomargin'>{% trans "receive updates motivational blurb" %}</p> - {% include "edit_user_email_feeds_form.html" %} -<<<<<<< HEAD:templates/authopenid/complete.html -======= <p class='nomargin'>{% trans "Tag filter tool will be your right panel, once you log in." %}</p> ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/authopenid/complete.html + <p>{% trans "receive updates motivational blurb" %}</p> + <div class='simple-subscribe-options'> + {{email_feeds_form.subscribe}} + </div> + <p class='space-above'>{% trans "Tag filter tool will be your right panel, once you log in." %}</p> <div class="submit-row"><input type="submit" class="submit" name="bnewaccount" value="{% trans "create account" %}"/></div> </form> </div> @@ -105,7 +111,9 @@ parameters: <div class="form-row"><label for="id_username">{% trans "user name" %}</label><br/>{{ form2.username }}</div> <div class="form-row"><label for="id_passwordl">{% trans "password" %}</label><br/>{{ form2.password }}</div> <p><span class='big strong'>(Optional) receive updates by email</span> - only sent when there are any.</p> - {% include "edit_user_email_feeds_form.html" %} + <div class='simple-subscribe-options'> + {{email_feeds_form.subscribe}} + </div> <!--todo double check translation from chinese 确认 = "Register" --> <div class="submit-row"> <input type="submit" class="submit" name="bverify" value="{% trans "Register" %}"/> diff --git a/templates/authopenid/external_legacy_login_info.html b/templates/authopenid/external_legacy_login_info.html index dda394c7..3318499c 100644 --- a/templates/authopenid/external_legacy_login_info.html +++ b/templates/authopenid/external_legacy_login_info.html @@ -8,14 +8,8 @@ </div> {% spaceless %} <div class="message"> -<<<<<<< HEAD:templates/authopenid/external_legacy_login_info.html -fill in template templates/authopenid/external_legacy_login_info.html -and explain how to change password, recover password, etc. <!--add info about your external login site here--> -======= -<!--add info about your external login site here--> -{% trans "how to login with password through external login website" %} ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/authopenid/external_legacy_login_info.html +{% blocktrans %}how to login with password through external login website or use {{feedback_url}}{% endblocktrans %} </div> {% endspaceless %} {% endblock %} diff --git a/templates/authopenid/signin.html b/templates/authopenid/signin.html index 1363661e..51b8aa7f 100644..100755 --- a/templates/authopenid/signin.html +++ b/templates/authopenid/signin.html @@ -1,173 +1,186 @@ -{% extends "base.html" %} -<!-- signin.html --> -{% load i18n %} -{% load extra_tags %} -{% block title %}{% spaceless %}{% trans "User login" %}{% endspaceless %}{% endblock %} -{% block forejs %} - <script type='text/javascript' src='{% href "/content/js/jquery.validate.pack.js" %}'></script> - - <link rel="stylesheet" type="text/css" media="screen" href="{% href "/content/jquery-openid/openid.css" %}"/> - <script type="text/javascript" src="{% href "/content/jquery-openid/jquery.openid.js" %}"></script> - <script type="text/javascript"> $().ready( function() { $("form.openid:eq(0)").openid(); })</script> - <!--<script type="text/javascript"> - $().ready(function(){ - openid.init('id_openid_url'); - setupFormValidation("#openid_form", {bsignin:{required: true}}); - }); - </script>--> -{% endblock %} -{% block content %} -<div class="headNormal"> - {% trans "User login" %} -</div> - {% if msg %} - <p class="warning">{{ msg }}</p> - {% endif %} - {% if answer %} - <div class="message"> - {% blocktrans with answer.question.title as title and answer.summary as summary %} - Your answer to {{title}} {{summary}} will be posted once you log in - {% endblocktrans %} - </div> - {% endif %} - {% if question %} - <div class="message"> - {% blocktrans with question.title as title and question.summary as summary %}Your question - {{title}} {{summary}} will be posted once you log in - {% endblocktrans %} - </div> - {% endif %} - <form id="openid_form" name="openid_form" class="openid" method="post" action="{% url user_signin %}"> - <div style="width:600px;float:left;margin-bottom:5px;"> - {% trans "Click to sign in through any of these services." %} - </div> - <ul class="providers"> - <li class="local" title="Local login"> - <div class="logo_box local_login_box"> - <img src="{% href "/content/jquery-openid/images/local-login.png" %}" alt="your icon here" /> - </div> - <span></span> - </li> - <li class="direct" title="Google"> - <div class="logo_box google_box"> - <img src="{% href "/content/jquery-openid/images/google.gif" %}" alt="icon" /><span>https://www.google.com/accounts/o8/id</span> - </div> - </li> - <li class="direct" title="Yahoo"> - <div class="logo_box yahoo_box"> - <img src="{% href "/content/jquery-openid/images/yahoo.gif" %}" alt="icon" /><span>http://yahoo.com/</span> - </div> - </li> - <li class="username" title="AOL screen name"> - <div class="logo_box aol_box"> - <img src="{% href "/content/jquery-openid/images/aol.gif" %}" alt="icon" /><span>http://openid.aol.com/<strong>username</strong></span> - </div> - </li> - </ul> - <ul class="providers"> - <!--<li class="openid" title="OpenID"> - <div class="logo_box openid_box"> - <img src="/content/jquery-openid/images/openid.gif" alt="icon" /> - </div> - <span><strong>http://{your-openid-url}</strong></span> - </li>--> - <li class="openid first_tiny_li" title="OpenID URL"> - <img src="{% href "/content/jquery-openid/images/openidico16.png" %}" alt="icon" /> - <span>http://{your-openid-url}</span> - </li> - <li class="username" title="MyOpenID user name"> - <img src="{% href "/content/jquery-openid/images/myopenid-2.png" %}" alt="icon" /> - <span>http://<strong>username</strong>.myopenid.com/</span> - </li> - <li class="username" title="Flickr user name"> - <img src="{% href "/content/jquery-openid/images/flickr.png" %}" alt="icon" /> - <span>http://flickr.com/<strong>username</strong>/</span> - </li> - <li class="username" title="Technorati user name"> - <img src="{% href "/content/jquery-openid/images/technorati-1.png" %}" alt="icon" /> - <span>http://technorati.com/people/technorati/<strong>username</strong>/</span> - </li> - <li class="username" title="Wordpress blog name"> - <img src="{% href "/content/jquery-openid/images/wordpress.png" %}" alt="icon" /> - <span>http://<strong>username</strong>.wordpress.com</span> - </li> - <li class="username" title="Blogger blog name"> - <img src="{% href "/content/jquery-openid/images/blogger-1.png" %}" alt="icon" /> - <span>http://<strong>username</strong>.blogspot.com/</span> - </li> - <li class="username" title="LiveJournal blog name"> - <img src="{% href "/content/jquery-openid/images/livejournal-1.png" %}" alt="icon" /> - <span>http://<strong>username</strong>.livejournal.com</span> - </li> - <li class="username" title="ClaimID user name"> - <img src="{% href "/content/jquery-openid/images/claimid-0.png" %}" alt="icon" /> - <span>http://claimid.com/<strong>username</strong></span> - </li> - <li class="username" title="Vidoop user name"> - <img src="{% href "/content/jquery-openid/images/vidoop.png" %}" alt="icon" /> - <span>http://<strong>username</strong>.myvidoop.com/</span> - </li> - <li class="username" title="Verisign user name"> - <img src="{% href "/content/jquery-openid/images/verisign-2.png" %}" alt="icon" /> - <span>http://<strong>username</strong>.pip.verisignlabs.com/</span> - </li> - </ul> - {{ form2.next }} - <fieldset> - <p id="provider_name_slot">{% trans 'Enter your <span id="enter_your_what">Provider user name</span>' %}</p> - <div><p><span></span> - <input id="openid_username" type="text" name="openid_username" /><span></span> - <input type="submit" value="Login" /> - </p></div> - </fieldset> - <fieldset> - <p>{% trans 'Enter your <a class="openid_logo" href="http://openid.net">OpenID</a> web address' %}</p> - <div><p><input id="openid_url" type="text" value="http://" name="openid_url" /> - <input id="bsignin" name="bsignin" type="submit" value="{% trans "Login" %}" /></p></div> - </fieldset> - <fieldset id='local_login_fs'> - <p>{% trans 'Enter your login name and password' %}</p> - {% if form1.errors %} - {{form1.non_field_errors.as_ul}} - {% endif %} - <div><p class="login"><label for="id_username">{% trans "Login name" %}</label> - {{form1.username}}</p> - <p class="login"><label for="id_password">{% trans "Password" %}</label> - {{form1.password}}</p> - <p id="local_login_buttons"> - <input id="blogin" name="blogin" type="submit" value="{% trans "Login" %}" /> - <a href="{% url user_signup %}">{% trans "Create account" %}</a><br/> - <a href="{% url user_sendpw %}">{% trans "Forgot your password?" %}</a> - </p> - </div> - </fieldset> - </form> -{% endblock %} - -{% block sidebar %} -<div class="boxC"> - <h3 class="subtitle">{% trans "Why use OpenID?" %}</h3> - <ul class="list-item"> - <li> - {% trans "with openid it is easier" %} - </li> - <li> - {% trans "reuse openid" %} - </li> - <li> - {% trans "openid is widely adopted" %} - </li> - <li> - {% trans "openid is supported open standard" %} - </li> - - </ul> - <p class="info-box-follow-up-links"> - <a href="http://openid.net/what/" target="_blank">{% trans "Find out more" %} »</a><br/> - <a href="http://openid.net/get/" target="_blank">{% trans "Get OpenID" %} »</a> - </p> -</div> -{% endblock%} - - <script type="text/javascript"> $( function() { $("form.openid:eq(0)").openid(); })</script> -<!-- end signin.html --> +{% extends "base.html" %}
+<!-- signin.html -->
+{% load i18n %}
+{% load extra_tags %}
+{% block title %}{% spaceless %}{% trans "User login" %}{% endspaceless %}{% endblock %}
+{% block forejs %}
+ <script type='text/javascript' src='{% href "/content/js/jquery.validate.pack.js" %}'></script>
+
+ <link rel="stylesheet" type="text/css" media="screen" href="{% href "/content/jquery-openid/openid.css" %}"/>
+ <script type="text/javascript" src="{% href "/content/jquery-openid/jquery.openid.js" %}"></script>
+ <script type="text/javascript"> $().ready( function() { $("form.openid:eq(0)").openid(); })</script>
+ <!--<script type="text/javascript">
+ $().ready(function(){
+ openid.init('id_openid_url');
+ setupFormValidation("#openid_form", {bsignin:{required: true}});
+ });
+ </script>-->
+{% endblock %}
+{% block content %}
+<div class="headNormal">
+ {% trans "User login" %}
+</div>
+ {% if msg %}
+ <p class="warning">{{ msg }}</p>
+ {% endif %}
+ {% if answer %}
+ <div class="message">
+ {% blocktrans with answer.question.title as title and answer.summary as summary %}
+ Your answer to {{title}} {{summary}} will be posted once you log in
+ {% endblocktrans %}
+ </div>
+ {% endif %}
+ {% if question %}
+ <div class="message">
+ {% blocktrans with question.title as title and question.summary as summary %}Your question
+ {{title}} {{summary}} will be posted once you log in
+ {% endblocktrans %}
+ </div>
+ {% endif %}
+ <form id="openid_form" name="openid_form" class="openid" method="post" action="{% url user_signin %}">
+ <div style="width:600px;float:left;margin-bottom:5px;">
+ {% trans "Click to sign in through any of these services." %}
+ </div>
+ <ul class="providers">
+ <li class="local" title="Local login">
+ <div class="logo_box local_login_box">
+ <img src="{% href "/content/jquery-openid/images/local-login.png" %}" alt="your icon here" />
+ </div>
+ <span></span>
+ </li>
+ <li class="direct" title="Google">
+ <div class="logo_box google_box">
+ <img src="{% href "/content/jquery-openid/images/google.gif" %}" alt="icon" /><span>https://www.google.com/accounts/o8/id</span>
+ </div>
+ </li>
+ <li class="direct" title="Yahoo">
+ <div class="logo_box yahoo_box">
+ <img src="{% href "/content/jquery-openid/images/yahoo.gif" %}" alt="icon" /><span>http://yahoo.com/</span>
+ </div>
+ </li>
+ <li class="username" title="AOL screen name">
+ <div class="logo_box aol_box">
+ <img src="{% href "/content/jquery-openid/images/aol.gif" %}" alt="icon" /><span>http://openid.aol.com/<strong>username</strong></span>
+ </div>
+ </li>
+ </ul>
+ <ul id="openid_small_providers" class="providers">
+ <!--<li class="openid" title="OpenID">
+ <div class="logo_box openid_box">
+ <img src="/content/jquery-openid/images/openid.gif" alt="icon" />
+ </div>
+ <span><strong>http://{your-openid-url}</strong></span>
+ </li>-->
+ <li class="direct first_tiny_li facebook" title="Facebook Connect">
+ {% if question %}
+ <fb:login-button onlogin="window.location = '{% url fb_signin_new_question %}'"></fb:login-button>
+ {% else %}
+ {% if answer %}
+ <fb:login-button onlogin="window.location = '{% url fb_signin_new_answer %}'"></fb:login-button>
+ {% else %}
+ <fb:login-button onlogin="window.location = '{% url fb_signin %}'"></fb:login-button>
+ {% endif %}
+ {% endif %}
+ </li>
+ <li class="openid" title="OpenID URL">
+ <img src="{% href "/content/jquery-openid/images/openidico16.png" %}" alt="icon" />
+ <span>http://{your-openid-url}</span>
+ </li>
+ <li class="username" title="MyOpenID user name">
+ <img src="{% href "/content/jquery-openid/images/myopenid-2.png" %}" alt="icon" />
+ <span>http://<strong>username</strong>.myopenid.com/</span>
+ </li>
+ <li class="username" title="Flickr user name">
+ <img src="{% href "/content/jquery-openid/images/flickr.png" %}" alt="icon" />
+ <span>http://flickr.com/<strong>username</strong>/</span>
+ </li>
+ <li class="username" title="Technorati user name">
+ <img src="{% href "/content/jquery-openid/images/technorati-1.png" %}" alt="icon" />
+ <span>http://technorati.com/people/technorati/<strong>username</strong>/</span>
+ </li>
+ <li class="username" title="Wordpress blog name">
+ <img src="{% href "/content/jquery-openid/images/wordpress.png" %}" alt="icon" />
+ <span>http://<strong>username</strong>.wordpress.com</span>
+ </li>
+ <li class="username" title="Blogger blog name">
+ <img src="{% href "/content/jquery-openid/images/blogger-1.png" %}" alt="icon" />
+ <span>http://<strong>username</strong>.blogspot.com/</span>
+ </li>
+ <li class="username" title="LiveJournal blog name">
+ <img src="{% href "/content/jquery-openid/images/livejournal-1.png" %}" alt="icon" />
+ <span>http://<strong>username</strong>.livejournal.com</span>
+ </li>
+ <li class="username" title="ClaimID user name">
+ <img src="{% href "/content/jquery-openid/images/claimid-0.png" %}" alt="icon" />
+ <span>http://claimid.com/<strong>username</strong></span>
+ </li>
+ <li class="username" title="Vidoop user name">
+ <img src="{% href "/content/jquery-openid/images/vidoop.png" %}" alt="icon" />
+ <span>http://<strong>username</strong>.myvidoop.com/</span>
+ </li>
+ <li class="username" title="Verisign user name">
+ <img src="{% href "/content/jquery-openid/images/verisign-2.png" %}" alt="icon" />
+ <span>http://<strong>username</strong>.pip.verisignlabs.com/</span>
+ </li>
+ </ul>
+ {{ form2.next }}
+ <fieldset>
+ <p id="provider_name_slot">{% trans 'Enter your <span id="enter_your_what">Provider user name</span>' %}</p>
+ <div><p><span></span>
+ <input id="openid_username" type="text" name="openid_username" /><span></span>
+ <input type="submit" value="Login" />
+ </p></div>
+ </fieldset>
+ <fieldset>
+ <p>{% trans 'Enter your <a class="openid_logo" href="http://openid.net">OpenID</a> web address' %}</p>
+ <div><p><input id="openid_url" type="text" value="http://" name="openid_url" />
+ <input id="bsignin" name="bsignin" type="submit" value="{% trans "Login" %}" /></p></div>
+ </fieldset>
+ <fieldset id='local_login_fs'>
+ <p>{% trans 'Enter your login name and password' %}</p>
+ {% if form1.errors %}
+ {{form1.non_field_errors.as_ul}}
+ {% endif %}
+ <div><p class="login"><label for="id_username">{% trans "Login name" %}</label>
+ {{form1.username}}</p>
+ <p class="login"><label for="id_password">{% trans "Password" %}</label>
+ {{form1.password}}</p>
+ <p id="local_login_buttons">
+ <input id="blogin" name="blogin" type="submit" value="{% trans "Login" %}" />
+ <a href="{% url user_signup %}">{% trans "Create account" %}</a><br/>
+ <a href="{% url user_sendpw %}">{% trans "Forgot your password?" %}</a>
+ </p>
+ </div>
+ </fieldset>
+ </form>
+{% endblock %}
+
+{% block sidebar %}
+<div class="boxC">
+ <h3 class="subtitle">{% trans "Why use OpenID?" %}</h3>
+ <ul class="list-item">
+ <li>
+ {% trans "with openid it is easier" %}
+ </li>
+ <li>
+ {% trans "reuse openid" %}
+ </li>
+ <li>
+ {% trans "openid is widely adopted" %}
+ </li>
+ <li>
+ {% trans "openid is supported open standard" %}
+ </li>
+
+ </ul>
+ <p class="info-box-follow-up-links">
+ <a href="http://openid.net/what/" target="_blank">{% trans "Find out more" %} »</a><br/>
+ <a href="http://openid.net/get/" target="_blank">{% trans "Get OpenID" %} »</a>
+ </p>
+</div>
+<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
+<script type="text/javascript"> FB.init("{{ fb_api_key }}","{% url xd_receiver %}");</script>
+{% endblock%}
+
+ <script type="text/javascript"> $( function() { $("form.openid:eq(0)").openid(); })</script>
+<!-- end signin.html -->
diff --git a/templates/authopenid/signup.html b/templates/authopenid/signup.html index 45dfb51b..d800eaf9 100644 --- a/templates/authopenid/signup.html +++ b/templates/authopenid/signup.html @@ -10,10 +10,18 @@ <p class="message">{% trans "Traditional signup info" %}</p> <form action="{% url user_signup %}" method="post" accept-charset="utf-8"> <ul class="form-horizontal-rows"> - {{form.as_ul}} + <li><label for="usename_id">{{form.username.label}}</label>{{form.username}}{{form.username.errors}}</li> + <li><label for="email_id">{{form.email.label}}</label>{{form.email}}{{form.email.errors}}</li> + <li><label for="password1_id">{{form.password1.label}}</label>{{form.password1}}{{form.password1.errors}}</li> + <li><label for="password2_id">{{form.password2.label}}</label>{{form.password2}}{{form.password2.errors}}</li> </ul> - <p style="margin:10px 0px 0px 3px;">{% trans "receive updates motivational blurb" %}</p> - {% include "edit_user_email_feeds_form.html" %} + <p class="signup_p">{% trans "receive updates motivational blurb" %}</p> + <p class="signup_p">{% trans "Please select your preferred email update schedule for the following groups of questions:" %}</p> + <div class='simple-subscribe-options'> + {{email_feeds_form.subscribe}} + </div> + <p class="signup_p">{% trans "Please read and type in the two words below to help us prevent automated account creation." %}</p> + {{form.recaptcha}} <div class="submit-row"><input type="submit" class="submit" value="{% trans "Create Account" %}" /> <strong>{% trans "or" %} <a href="{% url user_signin %}">{% trans "return to OpenID login" %}</a></strong></div> diff --git a/templates/badge.html b/templates/badge.html index 73cba4ba..af6aa2a2 100644 --- a/templates/badge.html +++ b/templates/badge.html @@ -28,7 +28,7 @@ </div> <div id="award-list" style="clear:both;margin-left:20px;line-height:25px;"> {% for award in awards %} - <p style="width:185px;float:left"><a href="{% url users %}{{ award.id }}/{{ award.name }}">{{ award.name }}</a> {% get_score_badge_by_details award.rep award.gold award.silver award.bronze %}</p> + <p style="width:180px;float:left"><a href="{% url users %}{{ award.id }}/{{ award.name }}">{{ award.name }}</a> {% get_score_badge_by_details award.rep award.gold award.silver award.bronze %}</p> {% endfor %} </div> diff --git a/templates/badges.html b/templates/badges.html index 1902a3b0..8de93df5 100644 --- a/templates/badges.html +++ b/templates/badges.html @@ -33,10 +33,10 @@ {% endifequal %} {% endfor %} </div> - <div style="float:left;width:180px;"> + <div style="float:left;width:230px;"> <a href="{{badge.get_absolute_url}}" title="{{ badge.get_type_display }} : {{ badge.description }}" class="medal"><span class="badge{{ badge.type }}">●</span> {{ badge.name }}</a><strong> × {{ badge.awarded_count|intcomma }}</strong> </div> - <p style="float:left;width:350px;"> + <p style="float:left;margin-top:8px;"> {{ badge.description }} </p> </div> diff --git a/templates/base.html b/templates/base.html index b4751be1..d4eb731b 100644..100755 --- a/templates/base.html +++ b/templates/base.html @@ -3,7 +3,7 @@ {% load extra_filters %} {% load extra_tags %} {% load i18n %} -<html xmlns="http://www.w3.org/1999/xhtml"> +<html xmlns="http://www.w3.org/1999/xhtml"{% if fb_api_key %} xmlns:fb="http://www.facebook.com/2008/fbml"{% endif %}> <head> <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE }}</title> {% spaceless %} @@ -11,7 +11,7 @@ {% endspaceless %} <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> {% if settings.GOOGLE_SITEMAP_CODE %} - <meta name="verify-v1" content="{{settings.GOOGLE_SITEMAP_CODE}}" /> + <meta name="google-site-verification" content="{{settings.GOOGLE_SITEMAP_CODE}}" /> {% endif %} <link rel="shortcut icon" href="{% href "/content/images/favicon.ico" %}" /> <link href="{% href "/content/style/style.css" %}" rel="stylesheet" type="text/css" /> @@ -50,7 +50,7 @@ body { margin-top:2.4em; } </style> <script type="text/javascript"> - $().ready(function() { + $(document).ready(function() { $('#validate_email_alert').click(function(){notify.close(true)}) notify.show(); }); @@ -65,7 +65,7 @@ {% autoescape off %} {% if user_messages %} {% for message in user_messages %} - <p class="darkred">{{ message }}<p> + <p class="darkred">{{ message }}</p> {% endfor %} {% endif %} {% endautoescape %} diff --git a/templates/base_content.html b/templates/base_content.html index 12297215..0ff4a9fd 100644 --- a/templates/base_content.html +++ b/templates/base_content.html @@ -10,7 +10,7 @@ <meta name="verify-v1" content="{{ settings.GOOGLE_SITEMAP_CODE }}" /> ======= {% if settings.GOOGLE_SITEMAP_CODE %} - <meta name="verify-v1" content="{{ settings.GOOGLE_SITEMAP_CODE }}" /> + <meta name="google-site-verification" content="{{ settings.GOOGLE_SITEMAP_CODE }}" /> {% endif %} >>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/base_content.html <link rel="shortcut icon" href="{% href "/content/images/favicon.ico" %}" /> @@ -56,7 +56,7 @@ body { margin-top:2.4em; } </style> <script type="text/javascript"> - $().ready(function() { + $(document).ready(function() { var element = $('#validate_email_alert') element.click(function(){notify.close(true);setTimeout(function(){},1000)}) notify.show(); @@ -72,7 +72,7 @@ {% autoescape off %} {% if user_messages %} {% for message in user_messages %} - <p class="darkred">{{ message }}<p> + <p class="darkred">{{ message }}</p> {% endfor %} {% endif %} {% endautoescape %} diff --git a/templates/content/images/logo.png b/templates/content/images/logo.png Binary files differindex b53732e3..6a250e35 100644 --- a/templates/content/images/logo.png +++ b/templates/content/images/logo.png diff --git a/templates/content/jquery-openid/images/local-login.png b/templates/content/jquery-openid/images/local-login.png Binary files differdeleted file mode 100644 index 258cedac..00000000 --- a/templates/content/jquery-openid/images/local-login.png +++ /dev/null diff --git a/templates/content/jquery-openid/jquery.openid.js b/templates/content/jquery-openid/jquery.openid.js index 763af2c6..8d1cd204 100644 --- a/templates/content/jquery-openid/jquery.openid.js +++ b/templates/content/jquery-openid/jquery.openid.js @@ -53,7 +53,7 @@ $.fn.openid = function() { $localfs.fadeOut('slow'); $idfs.fadeOut('slow'); $id.val($this.find("li.highlight span").text()); - setTimeout(function(){$('#bsignin').click()},1000); + setTimeout(function(){$('#bsignin').click();},1000); return false; }; diff --git a/templates/content/jquery-openid/openid.css b/templates/content/jquery-openid/openid.css index 88960b56..1b7aaf82 100644 --- a/templates/content/jquery-openid/openid.css +++ b/templates/content/jquery-openid/openid.css @@ -67,3 +67,9 @@ form.openid ul.errorlist li { float: none; color:blue; } +#openid_small_providers li { + margin-top:4px; +} +#openid_small_providers li.facebook { + margin-top:0px; +} diff --git a/templates/content/js/com.cnprog.admin.js b/templates/content/js/com.cnprog.admin.js index 7e91af79..974dce23 100644 --- a/templates/content/js/com.cnprog.admin.js +++ b/templates/content/js/com.cnprog.admin.js @@ -1,4 +1,4 @@ -$().ready( function(){ +$(document).ready( function(){ var options = { success: function(a,b){$('.admin #action_status').html($.i18n._('changes saved'));}, dataType:'json', diff --git a/templates/content/js/com.cnprog.editor.js b/templates/content/js/com.cnprog.editor.js index 6cfa2c74..18cc5166 100644 --- a/templates/content/js/com.cnprog.editor.js +++ b/templates/content/js/com.cnprog.editor.js @@ -65,4 +65,4 @@ function ajaxFileUpload(imageUrl) ) return false; -}
\ No newline at end of file +} diff --git a/templates/content/js/com.cnprog.i18n.js b/templates/content/js/com.cnprog.i18n.js index 018927aa..58cb8f16 100644 --- a/templates/content/js/com.cnprog.i18n.js +++ b/templates/content/js/com.cnprog.i18n.js @@ -1,3 +1,5 @@ + +//var i18nLang; var i18nZh = { 'insufficient privilege':'用户权限不在操作范围', 'cannot pick own answer as best':'不能设置自己的回答为最佳答案', diff --git a/templates/content/js/com.cnprog.post.js b/templates/content/js/com.cnprog.post.js index a884b571..668c80fe 100644 --- a/templates/content/js/com.cnprog.post.js +++ b/templates/content/js/com.cnprog.post.js @@ -27,6 +27,8 @@ var lanai = var Vote = function(){ // All actions are related to a question var questionId; + //question slug to build redirect urls + var questionSlug; // The object we operate on actually. It can be a question or an answer. var postId; var questionAuthorId; @@ -53,21 +55,13 @@ var Vote = function(){ var acceptAnonymousMessage = $.i18n._('insufficient privilege'); var acceptOwnAnswerMessage = $.i18n._('cannot pick own answer as best'); -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - var pleaseLogin = "<a href='" + $.i18n._("/") + $.i18n._("account/") + $.i18n._("signin/") - + "?next=" + $.i18n._("/") + $.i18n._("questions/") + "{{QuestionID}}'>" - + $.i18n._('please login') + "</a>"; - - var pleaseSeeFAQ = $.i18n._('please see') + "<a href='" + $.i18n._("/") + $.i18n._("faq/") + "'>faq</a>"; -======= var pleaseLogin = "<a href='" + scriptUrl + $.i18n._("account/") + $.i18n._("signin/") - + "?next=" + scriptUrl + $.i18n._("questions/") + "{{QuestionID}}'>" + + "?next=" + scriptUrl + $.i18n._("question/") + "{{QuestionID}}/{{questionSlug}}'>" + $.i18n._('please login') + "</a>"; var pleaseSeeFAQ = $.i18n._('please see') + "<a href='" + scriptUrl + $.i18n._("faq/") + "'>faq</a>"; ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js - var favoriteAnonymousMessage = $.i18n._('anonymous users cannot select favorite questions') + var favoriteAnonymousMessage = $.i18n._('anonymous users cannot select favorite questions'); var voteAnonymousMessage = $.i18n._('anonymous users cannot vote') + pleaseLogin; var upVoteRequiredScoreMessage = $.i18n._('>15 points requried to upvote') + pleaseSeeFAQ; var downVoteRequiredScoreMessage = $.i18n._('>100 points required to downvote') + pleaseSeeFAQ; @@ -159,30 +153,17 @@ var Vote = function(){ var setVoteImage = function(voteType, undo, object){ var flag = undo ? "" : "-on"; var arrow = (voteType == VoteType.questionUpVote || voteType == VoteType.answerUpVote) ? "up" : "down"; -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - object.attr("src", $.i18n._("/") + "content/images/vote-arrow-"+ arrow + flag +".png"); -======= object.attr("src", scriptUrl + "content/images/vote-arrow-"+ arrow + flag +".png"); ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js // if undo voting, then undo the pair of arrows. if(undo){ if(voteType == VoteType.questionUpVote || voteType == VoteType.questionDownVote){ -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - $(getQuestionVoteUpButton()).attr("src", $.i18n._("/") + "content/images/vote-arrow-up.png"); - $(getQuestionVoteDownButton()).attr("src", $.i18n._("/") + "content/images/vote-arrow-down.png"); - } - else{ - $(getAnswerVoteUpButton(postId)).attr("src", $.i18n._("/") + "content/images/vote-arrow-up.png"); - $(getAnswerVoteDownButton(postId)).attr("src", $.i18n._("/") + "content/images/vote-arrow-down.png"); -======= $(getQuestionVoteUpButton()).attr("src", scriptUrl + "content/images/vote-arrow-up.png"); $(getQuestionVoteDownButton()).attr("src", scriptUrl + "content/images/vote-arrow-down.png"); } else{ $(getAnswerVoteUpButton(postId)).attr("src", scriptUrl + "content/images/vote-arrow-up.png"); $(getAnswerVoteDownButton(postId)).attr("src", scriptUrl + "content/images/vote-arrow-down.png"); ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js } } }; @@ -258,14 +239,11 @@ var Vote = function(){ type: "POST", cache: false, dataType: "json", -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - url: $.i18n._("/") + $.i18n._("questions/") + questionId + "/" + $.i18n._("vote/"), -======= url: scriptUrl + $.i18n._("questions/") + questionId + "/" + $.i18n._("vote/"), ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js data: { "type": voteType, "postId": postId }, error: handleFail, - success: function(data){callback(object, voteType, data)}}); + success: function(data){callback(object, voteType, data);} + }); }; var handleFail = function(xhr, msg){ @@ -281,31 +259,19 @@ var Vote = function(){ showMessage(object, acceptOwnAnswerMessage); } else if(data.status == "1"){ -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - object.attr("src", $.i18n._("/") + "content/images/vote-accepted.png"); -======= object.attr("src", scriptUrl + "content/images/vote-accepted.png"); ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js $("#"+answerContainerIdPrefix+postId).removeClass("accepted-answer"); $("#"+commentLinkIdPrefix+postId).removeClass("comment-link-accepted"); } else if(data.success == "1"){ var acceptedButtons = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAccept +']'; -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - $(acceptedButtons).attr("src", $.i18n._("/") + "content/images/vote-accepted.png"); -======= $(acceptedButtons).attr("src", scriptUrl + "content/images/vote-accepted.png"); ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js var answers = ("div[id^="+answerContainerIdPrefix +"]"); $(answers).removeClass("accepted-answer"); var commentLinks = ("div[id^="+answerContainerIdPrefix +"] div[id^="+ commentLinkIdPrefix +"]"); $(commentLinks).removeClass("comment-link-accepted"); -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - object.attr("src", $.i18n._("/") + "content/images/vote-accepted-on.png"); -======= object.attr("src", scriptUrl + "content/images/vote-accepted-on.png"); ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js $("#"+answerContainerIdPrefix+postId).addClass("accepted-answer"); $("#"+commentLinkIdPrefix+postId).addClass("comment-link-accepted"); } @@ -319,23 +285,16 @@ var Vote = function(){ showMessage(object, favoriteAnonymousMessage.replace("{{QuestionID}}", questionId)); } else if(data.status == "1"){ -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - object.attr("src", $.i18n._("/") + "content/images/vote-favorite-off.png"); -======= object.attr("src", scriptUrl + "content/images/vote-favorite-off.png"); ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js var fav = getFavoriteNumber(); fav.removeClass("my-favorite-number"); - if(data.count == 0) + if(data.count === 0){ data.count = ''; + } fav.text(data.count); } else if(data.success == "1"){ -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - object.attr("src", $.i18n._("/") + "/content/images/vote-favorite-on.png"); -======= object.attr("src", scriptUrl + "content/images/vote-favorite-on.png"); ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js var fav = getFavoriteNumber(); fav.text(data.count); fav.addClass("my-favorite-number"); @@ -404,11 +363,7 @@ var Vote = function(){ } else if (data.success == "1"){ if (voteType == VoteType.removeQuestion){ -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - window.location.href = $.i18n._("/") + $.i18n._("questions/"); -======= window.location.href = scriptUrl + $.i18n._("questions/"); ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js } else { if (removeActionType == 'delete'){ @@ -426,8 +381,9 @@ var Vote = function(){ }; return { - init : function(qId, questionAuthor, userId){ + init : function(qId, qSlug, questionAuthor, userId){ questionId = qId; + questionSlug = qSlug; questionAuthorId = questionAuthor; currentUserId = userId; bindEvents(); @@ -449,7 +405,7 @@ var Vote = function(){ vote: function(object, voteType){ if (!currentUserId || currentUserId.toUpperCase() == "NONE"){ - showMessage(object, voteAnonymousMessage.replace("{{QuestionID}}", questionId)); + showMessage(object, voteAnonymousMessage.replace("{{QuestionID}}", questionId).replace("{{questionSlug}}", questionSlug)); return false; } if (voteType == VoteType.answerUpVote){ @@ -502,9 +458,12 @@ var Vote = function(){ submit($(object), voteType, callback_remove); } } - } + }; } (); +var questionComments = createComments('question'); +var answerComments = createComments('answer'); +var commentsFactory = {'question' : questionComments, 'answer' : answerComments}; // site comments function createComments(type) { @@ -528,12 +487,12 @@ function createComments(type) { $(jDiv).css('background','none'); $(jDiv).css('padding-left',0); if (canPostComments(id)) { - if (jDiv.find("#" + formId).length == 0) { + if (jDiv.find("#" + formId).length === 0) { var form = '<form id="' + formId + '" class="post-comments"><div>'; form += '<textarea name="comment" cols="60" rows="5" maxlength="300" onblur="'+ objectType +'Comments.updateTextCounter(this)" '; form += 'onfocus="' + objectType + 'Comments.updateTextCounter(this)" onkeyup="'+ objectType +'Comments.updateTextCounter(this)"></textarea>'; - form += '<input type="submit" value="' - + $.i18n._('add comment') + '" /><br><span class="text-counter"></span>'; + form += '<input type="submit" value="' + + $.i18n._('add comment') + '" /><br><span class="text-counter"></span>'; form += '<span class="form-error"></span></div></form>'; jDiv.append(form); @@ -545,28 +504,20 @@ function createComments(type) { } else { var divId = "comments-rep-needed-" + objectType + '-' + id; - if (jDiv.find("#" + divId).length == 0) { - jDiv.append('<p id="' + divId + '" class="comment">' - + $.i18n._('to comment, need') + ' ' + - + repNeededForComments + ' ' + $.i18n._('community karma points') -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - + '<a href="' + $.i18n._('/') + $.i18n._('faq/') + '" class="comment-user">' -======= - + '<a href="' + scriptUrl + $.i18n._('faq/') + '" class="comment-user">' ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js - + $.i18n._('please see') + 'faq</a></span></p>'); + if (jDiv.find("#" + divId).length === 0) { + jDiv.append('<p id="' + divId + '" class="comment">' + + $.i18n._('to comment, need') + ' ' + + repNeededForComments + ' ' + $.i18n._('community karma points') + + '<a href="' + scriptUrl + $.i18n._('faq/') + '" class="comment-user">' + + $.i18n._('please see') + 'faq</a></span></p>'); } } }; var getComments = function(id, jDiv) { //appendLoaderImg(id); -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - $.getJSON($.i18n._("/") + objectType + "s/" + id + "/" + $.i18n._("comments/") -======= - $.getJSON(scriptUrl + objectType + "s/" + id + "/" + $.i18n._("comments/") ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js - , function(json) { showComments(id, json); }); + $.getJSON(scriptUrl + objectType + "s/" + id + "/" + $.i18n._("comments/"), + function(json) { showComments(id, json); }); }; var showComments = function(id, json) { @@ -577,8 +528,9 @@ function createComments(type) { jDiv.children().remove(); removeLoader(); if (json && json.length > 0) { - for (var i = 0; i < json.length; i++) + for (var i = 0; i < json.length; i++){ renderComment(jDiv, json[i]); + } jDiv.children().show(); } }; @@ -586,22 +538,17 @@ function createComments(type) { var renderDeleteCommentIcon = function(post_id, delete_url){ if (canPostComments(post_id)){ var html = ''; -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - var img = $.i18n._("/") + "content/images/close-small.png"; - var imgHover = $.i18n._("/") + "content/images/close-small-hover.png"; -======= var img = scriptUrl + "content/images/close-small.png"; var imgHover = scriptUrl + "content/images/close-small-hover.png"; ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js html += '<img class="delete-icon" onclick="' + objectType + 'Comments.deleteComment($(this), ' + post_id + ', \'' + delete_url + '\')" src="' + img; - html += '" onmouseover="$(this).attr(\'src\', \'' + imgHover + '\')" onmouseout="$(this).attr(\'src\', \'' + img + html += '" onmouseover="$(this).attr(\'src\', \'' + imgHover + '\')" onmouseout="$(this).attr(\'src\', \'' + img; html += '\')" title="' + $.i18n._('delete this comment') + '" />'; return html; } else{ return ''; } - } + }; // {"Id":6,"PostId":38589,"CreationDate":"an hour ago","Text":"hello there!","UserDisplayName":"Jarrod Dixon","UserUrl":"/users/3/jarrod-dixon","DeleteUrl":null} var renderComment = function(jDiv, json) { @@ -631,11 +578,7 @@ function createComments(type) { //todo fix url translations!!! $.ajax({ type: "POST", -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - url: $.i18n._("/") + objectType + "s/" + id + "/" + $.i18n._("comments/"), -======= url: scriptUrl + objectType + "s/" + id + "/" + $.i18n._("comments/"), ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js dataType: "json", data: { comment: textarea.val() }, success: function(json) { @@ -667,12 +610,8 @@ function createComments(type) { $(this).children().each( function(i){ var comment_id = $(this).attr('id').replace('comment-',''); -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - var delete_url = $.i18n._('/') + objectType + 's/' + post_id + '/' -======= - var delete_url = scriptUrl + objectType + 's/' + post_id + '/' ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js - + $.i18n._('comments/') + comment_id + '/' + $.i18n._('delete/'); + var delete_url = scriptUrl + objectType + 's/' + post_id + '/' + + $.i18n._('comments/') + comment_id + '/' + $.i18n._('delete/'); var html = $(this).html(); var CommentsClass; if (objectType == 'question'){ @@ -685,20 +624,12 @@ function createComments(type) { delete_icon.click(function(){CommentsClass.deleteComment($(this),comment_id,delete_url);}); delete_icon.unbind('mouseover').bind('mouseover', function(){ -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - $(this).attr('src',$.i18n._('/') + 'content/images/close-small-hover.png'); -======= $(this).attr('src',scriptUrl + 'content/images/close-small-hover.png'); ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js } ); delete_icon.unbind('mouseout').bind('mouseout', function(){ -<<<<<<< HEAD:templates/content/js/com.cnprog.post.js - $(this).attr('src',$.i18n._('/') + 'content/images/close-small.png'); -======= $(this).attr('src',scriptUrl + 'content/images/close-small.png'); ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js } ); } @@ -713,14 +644,14 @@ function createComments(type) { jDiv.show(); var link = $('#comments-link-' + objectType + '-' + id); - if (canPostComments(id)) link.parent().find("textarea").get(0).focus(); + if (canPostComments(id)) { link.parent().find("textarea").get(0).focus(); } link.remove(); }, hide: function(id) { var jDiv = jDivInit(id); var len = jDiv.children("div.comments").children().length; - var anchorText = len == 0 ? $.i18n._('add a comment') : $.i18n._('comments') + ' (<b>' + len + "</b>)"; + var anchorText = len === 0 ? $.i18n._('add a comment') : $.i18n._('comments') + ' (<b>' + len + "</b>)"; jDiv.hide(); jDiv.siblings("a").unbind("click").click(function() { commentsFactory[objectType].show(id); }).html(anchorText); @@ -741,23 +672,18 @@ function createComments(type) { var length = textarea.value ? textarea.value.length : 0; var color = length > 270 ? "#f00" : length > 200 ? "#f60" : "#999"; var jSpan = $(textarea).siblings("span.text-counter"); - jSpan.html($.i18n._('can write') - + (300 - length) + ' ' - + $.i18n._('characters')).css("color", color); + jSpan.html($.i18n._('can write') + + (300 - length) + ' ' + + $.i18n._('characters')).css("color", color); } }; } -var questionComments = createComments('question'); -var answerComments = createComments('answer'); - -$().ready(function() { +$(document).ready(function() { questionComments.init(); answerComments.init(); }); -var commentsFactory = {'question' : questionComments, 'answer' : answerComments}; - /* Prettify http://www.apache.org/licenses/LICENSE-2.0 diff --git a/templates/content/js/com.cnprog.tag_selector.js b/templates/content/js/com.cnprog.tag_selector.js index f6c16c9c..06aefcfc 100644 --- a/templates/content/js/com.cnprog.tag_selector.js +++ b/templates/content/js/com.cnprog.tag_selector.js @@ -1,7 +1,8 @@ +//var scriptUrl, interestingTags, ignoredTags, tags, $; function pickedTags(){ var sendAjax = function(tagname, reason, action, callback){ - url = scriptUrl; + var url = scriptUrl; if (action == 'add'){ url += $.i18n._('mark-tag/'); if (reason == 'good'){ @@ -16,15 +17,15 @@ function pickedTags(){ } url = url + tagname + '/'; - call_settings = { + var call_settings = { type:'POST', url:url - } - if (callback != false){ - call_settings['success'] = callback; + }; + if (callback !== false){ + call_settings.success = callback; } $.ajax(call_settings); - } + }; var unpickTag = function(from_target ,tagname, reason, send_ajax){ @@ -32,7 +33,7 @@ function pickedTags(){ var deleteTagLocally = function(){ from_target[tagname].remove(); delete from_target[tagname]; - } + }; if (send_ajax){ sendAjax(tagname,reason,'remove',deleteTagLocally); } @@ -40,7 +41,7 @@ function pickedTags(){ deleteTagLocally(); } - } + }; var setupTagDeleteEvents = function(obj,tag_store,tagname,reason,send_ajax){ obj.unbind('mouseover').bind('mouseover', function(){ @@ -52,12 +53,13 @@ function pickedTags(){ obj.click( function(){ unpickTag(tag_store,tagname,reason,send_ajax); }); - } + }; var handlePickedTag = function(obj,reason){ var tagname = $.trim($(obj).prev().attr('value')); - to_target = interestingTags; - from_target = ignoredTags; + var to_target = interestingTags; + var from_target = ignoredTags; + var to_tag_container; if (reason == 'bad'){ to_target = ignoredTags; from_target = interestingTags; @@ -78,13 +80,13 @@ function pickedTags(){ //send ajax request to pick this tag sendAjax(tagname,reason,'add',function(){ - new_tag = $('<span></span>'); + var new_tag = $('<span></span>'); new_tag.addClass('deletable-tag'); - tag_link = $('<a></a>'); + var tag_link = $('<a></a>'); tag_link.attr('rel','tag'); tag_link.attr('href', scriptUrl + $.i18n._('tags/') + tagname); tag_link.html(tagname); - del_link = $('<img></img>'); + var del_link = $('<img></img>'); del_link.addClass('delete-icon'); del_link.attr('src', scriptUrl + 'content/images/close-small-dark.png'); @@ -97,7 +99,7 @@ function pickedTags(){ to_target[tagname] = new_tag; }); } - } + }; var collectPickedTags = function(){ var good_prefix = 'interesting-tag-'; @@ -108,7 +110,8 @@ function pickedTags(){ ignoredTags = {}; $('.deletable-tag').each( function(i,item){ - item_id = $(item).attr('id') + var item_id = $(item).attr('id'); + var tag_name, tag_store; if (good_re.test(item_id)){ tag_name = item_id.replace(good_prefix,''); tag_store = interestingTags; @@ -123,10 +126,10 @@ function pickedTags(){ return; } tag_store[tag_name] = $(item); - setupTagDeleteEvents($(item).find('img'),tag_store,tag_name,reason,true) + setupTagDeleteEvents($(item).find('img'),tag_store,tag_name,reason,true); } ); - } + }; var setupHideIgnoredQuestionsControl = function(){ $('#hideIgnoredTagsCb').unbind('click').click(function(){ @@ -138,7 +141,7 @@ function pickedTags(){ data: {command:'toggle-ignored-questions'} }); }); - } + }; return { init: function(){ collectPickedTags(); @@ -157,8 +160,8 @@ function pickedTags(){ } }); - $("#interestingTagAdd").click(function(){handlePickedTag(this,'good')}); - $("#ignoredTagAdd").click(function(){handlePickedTag(this,'bad')}); + $("#interestingTagAdd").click(function(){handlePickedTag(this,'good');}); + $("#ignoredTagAdd").click(function(){handlePickedTag(this,'bad');}); } }; } diff --git a/templates/content/js/com.cnprog.utils.js b/templates/content/js/com.cnprog.utils.js index 5c0c4a27..4c3aafba 100644 --- a/templates/content/js/com.cnprog.utils.js +++ b/templates/content/js/com.cnprog.utils.js @@ -1,6 +1,7 @@ +//var $, scriptUrl; var showMessage = function(object, msg) { - var div = $('<div class="vote-notification"><h3>' + msg + '</h3>(' - + $.i18n._('click to close') + ')</div>'); + var div = $('<div class="vote-notification"><h3>' + msg + '</h3>(' + + $.i18n._('click to close') + ')</div>'); div.click(function(event) { $(".vote-notification").fadeOut("fast", function() { $(this).remove(); }); @@ -23,11 +24,7 @@ var notify = function() { }, close: function(doPostback) { if (doPostback) { -<<<<<<< HEAD:templates/content/js/com.cnprog.utils.js - $.post($.i18n._("/") + $.i18n._("messages/") + -======= $.post(scriptUrl + $.i18n._("messages/") + ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.utils.js $.i18n._("markread/"), { formdata: "required" }); } $(".notify").fadeOut("fast"); @@ -39,22 +36,30 @@ var notify = function() { } (); function appendLoader(containerSelector) { - $(containerSelector).append('<img class="ajax-loader" ' -<<<<<<< HEAD:templates/content/js/com.cnprog.utils.js - +'src="' + $.i18n._('/') + 'content/images/indicator.gif" title="' -======= - +'src="' + scriptUrl + 'content/images/indicator.gif" title="' ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.utils.js - +$.i18n._('loading...') - +'" alt="' - +$.i18n._('loading...') - +'" />'); + $(containerSelector).append('<img class="ajax-loader" ' + + 'src="' + scriptUrl + 'content/images/indicator.gif" title="' + + $.i18n._('loading...') + + '" alt="' + + $.i18n._('loading...') + + '" />'); } function removeLoader() { $("img.ajax-loader").remove(); } +function setSubmitButtonDisabled(formSelector, isDisabled) { + $(formSelector).find("input[type='submit']").attr("disabled", isDisabled ? "true" : ""); +} + +function enableSubmitButton(formSelector) { + setSubmitButtonDisabled(formSelector, false); +} + +function disableSubmitButton(formSelector) { + setSubmitButtonDisabled(formSelector, true); +} + function setupFormValidation(formSelector, validationRules, validationMessages, onSubmitCallback) { enableSubmitButton(formSelector); $(formSelector).validate({ @@ -64,7 +69,7 @@ function setupFormValidation(formSelector, validationRules, validationMessages, errorClass: "form-error", errorPlacement: function(error, element) { var span = element.next().find("span.form-error"); - if (span.length == 0) { + if (span.length === 0) { span = element.parent().find("span.form-error"); } span.replaceWith(error); @@ -72,24 +77,16 @@ function setupFormValidation(formSelector, validationRules, validationMessages, submitHandler: function(form) { disableSubmitButton(formSelector); - if (onSubmitCallback) + if (onSubmitCallback){ onSubmitCallback(); - else + } + else{ form.submit(); + } } }); } -function enableSubmitButton(formSelector) { - setSubmitButtonDisabled(formSelector, false); -} -function disableSubmitButton(formSelector) { - setSubmitButtonDisabled(formSelector, true); -} -function setSubmitButtonDisabled(formSelector, isDisabled) { - $(formSelector).find("input[type='submit']").attr("disabled", isDisabled ? "true" : ""); -} - var CPValidator = function(){ return { getQuestionFormRules : function(){ @@ -116,11 +113,11 @@ var CPValidator = function(){ }, text: { required: " " + $.i18n._('content cannot be empty'), - minlength: jQuery.format(' ' + $.i18n._('content minchars')) + minlength: $.format(' ' + $.i18n._('content minchars')) }, title: { required: " " + $.i18n._('please enter title'), - minlength: jQuery.format(' ' + $.i18n._('title minchars')) + minlength: $.format(' ' + $.i18n._('title minchars')) } }; } diff --git a/templates/content/style/style.css b/templates/content/style/style.css index 0a928cd2..aba67eee 100644 --- a/templates/content/style/style.css +++ b/templates/content/style/style.css @@ -114,10 +114,6 @@ blockquote margin-left:20px;text-decoration:underline; font-size:12px; color:#333333;} #logo { padding: 5px 0px 0px 0px; -<<<<<<< HEAD:templates/content/style/style.css - margin-bottom:-3px; -======= ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css } #navBar {float:clear;position:relative;display:block;width:960px;} #navBar .nav {margin:20px 0px 0px 16px; @@ -166,11 +162,7 @@ blockquote border-right:1px solid #b4b48e; border-bottom:1px solid #b4b48e;*/ background: white;/* #f9f7ed;*/ -<<<<<<< HEAD:templates/content/style/style.css - margin:10px 0 10px 0; -======= /*margin:10px 0 10px 0;*/ ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css /*background:url(../images/quest-bg.gif) repeat-x top;*/ } #listA .qstA thumb {float:left; } @@ -212,9 +204,6 @@ blockquote /*border-bottom:1px solid #888a85;*/ } .evenMore {font-size:14px; font-weight:800;} -<<<<<<< HEAD:templates/content/style/style.css -.questions-count{font-size:32px;font-family:sans-serif;font-weight:600;padding:0 0 5px 7px;color:#a40000;} -======= .questions-count{ font-size:32px; font-family:sans-serif; @@ -223,7 +212,6 @@ blockquote color:#a40000; margin-top:3px; } ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css /*内容块*/ .boxA {background:#888a85; padding:6px; margin-bottom:8px;border 1px solid #babdb6;} @@ -235,11 +223,7 @@ blockquote .boxB .body {border:1px solid #aaaaaa; padding:8px; background:#FFF; font-size:13px; line-height:160%;} .boxB .more {padding:1px; text-align:right; font-weight:800;} .boxC { -<<<<<<< HEAD:templates/content/style/style.css - background:#babdb6;/*f9f7ed;*/ -======= background: #cacdc6;/*f9f7ed;*/ ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css padding:10px; margin-bottom:8px; border-top:1px solid #eeeeec; @@ -247,15 +231,12 @@ blockquote border-right:1px solid #a9aca5; border-bottom:1px solid #babdb6; } -<<<<<<< HEAD:templates/content/style/style.css -======= .boxC p { margin-bottom:8px; } .boxC p.nomargin { margin:0px; } ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css .boxC p.info-box-follow-up-links { text-align:right; margin:0; @@ -289,11 +270,7 @@ blockquote border:1px solid #fff; background-color:#fff; color:#777; -<<<<<<< HEAD:templates/content/style/style.css - padding:.3em; -======= padding:2px 4px 3px 4px; ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css font:bold 100% sans-serif; } @@ -344,21 +321,14 @@ blockquote /*标签*/ .tag {font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} .tags {font-family:sans-serif; line-height:200%; display:block; margin-top:5px;} -<<<<<<< HEAD:templates/content/style/style.css -.tags a {font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} -======= .tags a {white-space: nowrap; font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css .tags a:hover {background-color:#fFF;color:#333;} .tagsbox {line-height:200%;} .tagsbox a {font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} .tagsbox a:hover {background-color:#fFF;color:#333;} .tag-number {font-weight:700;font-family:sans-serif;} -<<<<<<< HEAD:templates/content/style/style.css -======= .marked-tags { margin-top: 0px;margin-bottom: 5px; } .deletable-tag { margin-right: 3px; white-space:nowrap; } ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css /*奖牌*/ a.medal { font-size:14px; line-height:250%; font-weight:800; color:#333; text-decoration:none; background:url(../images/medala.gif) no-repeat; border-left:1px solid #EEE; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:4px 12px 4px 6px;} @@ -716,7 +686,12 @@ table.form-as-table th { /*.form-row li label { display: inline }*/ -.submit-row{line-height:30px;padding-top:10px;} +.submit-row{ + line-height:30px; + padding-top:10px; + display: block; + clear: both; +} .errors{line-height:20px;color:red;} .error{ color:darkred; @@ -1188,12 +1163,9 @@ ul.bulleta li {background:url(../images/bullet_green.gif) no-repeat 0px 2px; pad .message p { margin-bottom:0px; } -<<<<<<< HEAD:templates/content/style/style.css -======= -.message p.space-above { +p.space-above { margin-top:10px; } ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css .warning{color:red;} .darkred{color:darkred;} @@ -1470,8 +1442,6 @@ ul.form-horizontal-rows li input { text-align:center; font-weight:bold; } -<<<<<<< HEAD:templates/content/style/style.css -======= #tagSelector { padding-bottom: 2px; } @@ -1481,4 +1451,16 @@ ul.form-horizontal-rows li input { #hideIgnoredTagsCb { margin: 0 2px 0 1px; } ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css +#recaptcha_widget_div { + width:318px; + float:left; + clear:both; +} +p.signup_p { + margin: 20px 0px 0px 0px; +} +.simple-subscribe-options ul { + list-style:none; + list-style-position:outside; + margin:0; +} diff --git a/templates/fbconnect/xd_receiver.html b/templates/fbconnect/xd_receiver.html new file mode 100755 index 00000000..c67c57b7 --- /dev/null +++ b/templates/fbconnect/xd_receiver.html @@ -0,0 +1 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <body> <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"></script> </body> </html>
diff --git a/templates/footer.html b/templates/footer.html index 9d19b41e..66feff8a 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -7,8 +7,6 @@ <div class="footerLinks" > <a href="{% url about %}">{% trans "about" %}</a><span class="link-separator"> |</span> <a href="{% url faq %}">{% trans "faq" %}</a><span class="link-separator"> |</span> - <!--<a href="{{ blog_url }}">{% trans "blog" %}</a><span class="link-separator"> |</span>--> - <!--<a href="{{ webmaster_email }}">{% trans "contact us" %}</a><span class="link-separator"> |</span>--> <a href="{% url privacy %}">{% trans "privacy policy" %}</a><span class="link-separator"> |</span> {% spaceless %} <a href= @@ -25,7 +23,6 @@ <p> <a href="http://github.com/cnprog/CNPROG/network" target="_blank"> powered by cnprog platform - <!--<img src="{% href "/content/images/djangomade124x25_grey.gif" %}" border="0" alt="Made with Django." title="Made with Django." >--> </a> </p> </div> @@ -36,14 +33,16 @@ </div> </div> <!-- 页面底部结束: --> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker('{{ settings.GOOGLE_ANALYTICS_KEY }}'); - pageTracker._trackPageview(); - } catch(err) {} + {% if settings.GOOGLE_ANALYTICS_KEY %} + <script type="text/javascript"> + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> + <script type="text/javascript"> + try { + var pageTracker = _gat._getTracker('{{ settings.GOOGLE_ANALYTICS_KEY }}'); + pageTracker._trackPageview(); + } catch(err) {} + </script> + {% endif %} <!-- end template footer.html --> diff --git a/templates/header.html b/templates/header.html index 42074763..466659de 100644 --- a/templates/header.html +++ b/templates/header.html @@ -32,12 +32,6 @@ {% endif %} <a id="nav_badges" href="{% url badges %}">{% trans "badges" %}</a> <a id="nav_unanswered" href="{% url unanswered %}">{% trans "unanswered questions" %}</a> - - {% comment %}<!-- i think this needs to be removed -e.f. --> - {% if request.user.is_authenticated %} - <a id="nav_profile" href="{% url user %}{{ request.user.id }}/{{ request.user.username }}/">{% trans "my profile" %}</a> - {% endif %} - {% endcomment %} <div class="focus"> <a id="nav_ask" href="{% url ask %}" class="special">{% trans "ask a question" %}</a> </div> diff --git a/templates/notarobot.html b/templates/notarobot.html new file mode 100644 index 00000000..698c5696 --- /dev/null +++ b/templates/notarobot.html @@ -0,0 +1,15 @@ +{% extends "base_content.html" %} +{% load i18n %} +{% block title %}{% spaceless %}{% trans "Please prove that you are a Human Being" %}{% endspaceless %}{% endblock %} +{% block content %} +{% comment %} this form is set up to be used in wizards {% endcomment %} +<form name="notarobot" action="." method="POST"> + <div> + {{form}} + </div> + <input type="submit" value="{% trans "I am a Human Being" %}" class="submit" style="float:left"/> + <input type="hidden" name="{{ step_field }}" value="{{ step0 }}" /> + {{ previous_fields|safe }} + </form> +</form> +{% endblock %} diff --git a/templates/question.html b/templates/question.html index e88f7ef1..3955c059 100644 --- a/templates/question.html +++ b/templates/question.html @@ -1,535 +1,510 @@ -{% extends "base.html" %} -<!-- question.html --> -{% load extra_tags %} -{% load extra_filters %} -{% load smart_if %} -{% load humanize %} -{% load i18n %} -{% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %} -{% block forejs %} - <meta name="description" content="{{question.summary}}" /> - <meta name="keywords" content="{{question.tagname_meta_generator}}" /> - <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" /> - {% if not question.closed %} - <script type='text/javascript' src='{% href "/content/js/com.cnprog.editor.js" %}'></script> - <script type='text/javascript' src='{% href "/content/js/wmd/showdown.js" %}'></script> - <script type='text/javascript' src='{% href "/content/js/wmd/wmd.js" %}'></script> - <link rel="stylesheet" type="text/css" href="{% href "/content/js/wmd/wmd.css" %}" /> - {% endif %} - <script type='text/javascript' src='{% href "/content/js/com.cnprog.post.js" %}'></script> - <script type='text/javascript' src='{% href "/content/js/jquery.validate.pack.js" %}'></script> - - <script type="text/javascript"> - // define reputation needs for comments - var repNeededForComments = 50; - $().ready(function(){ - $("#nav_questions").attr('className',"on"); - var answer_sort_tab = "{{ tab_id }}"; - $("#" + answer_sort_tab).attr('className',"on"); - - Vote.init({{ question.id }}, '{{ question.author.id }}','{{ request.user.id }}'); - - {% if not question.closed and request.user.is_authenticated %}initEditor();{% endif %} - - lanai.highlightSyntax(); - $('#btLogin').bind('click', function(){window.location.href='{% url user_signin %}'; } ) - }); - - function initEditor(){ - $('#editor').TextAreaResizer(); - //highlight code synctax when editor has new text - $("#editor").typeWatch({highlight: false, wait: 3000, - captureLength: 5, callback: lanai.highlightSyntax}); - - var display = true; - var txt = "[{% trans "hide preview" %}]"; - $('#pre-collapse').text(txt); - $('#pre-collapse').bind('click', function(){ - txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]"; - display = !display; - $('#previewer').toggle(); - $('#pre-collapse').text(txt); - }); - - setupFormValidation("#fmanswer", CPValidator.getQuestionFormRules(), CPValidator.getQuestionFormMessages()); - } - - </script> -{% endblock %} - -{% block content %} -<div class="headNormal"> - <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a> -</div> -<div id="main-body" class=""> - <div id="askform"> - <table style="width:100%;" id="question-table" {% if question.deleted %}class="deleted"{%endif%}> - <tr> - <td style="width:30px;vertical-align:top"> - <div class="vote-buttons"> - {% if question_vote %} - <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote" - {% if question_vote.is_upvote %} - src="{% href "/content/images/vote-arrow-up-on.png" %}" - {% else %} - src="{% href "/content/images/vote-arrow-up.png" %}" - {% endif %} - alt="{% trans "i like this post (click again to cancel)" %}" - title="{% trans "i like this post (click again to cancel)" %}" /> - <div id="question-vote-number-{{ question.id }}" class="vote-number" - title="{% trans "current number of votes" %}"> - {{ question.score }} - </div> - <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote" - {% if question_vote.is_downvote %} - src="{% href "/content/images/vote-arrow-down-on.png" %}" - {% else %} - src="{% href "/content/images/vote-arrow-down.png" %}" - {% endif %} - alt="{% trans "i dont like this post (click again to cancel)" %}" - title="{% trans "i dont like this post (click again to cancel)" %}" /> - - {% else %} - <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote" - alt="{% trans "i like this post (click again to cancel)" %}" - src="{% href "/content/images/vote-arrow-up.png" %}" - title="{% trans "i like this post (click again to cancel)" %}" /> - <div id="question-vote-number-{{ question.id }}" class="vote-number" - title="{% trans "current number of votes" %}"> - {{ question.score }} - </div> - <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote" - src="{% href "/content/images/vote-arrow-down.png" %}" - alt="{% trans "i dont like this post (click again to cancel)" %}" - title="{% trans "i dont like this post (click again to cancel)" %}" /> - - {% endif %} - {% if favorited %} - <img class="question-img-favorite" src="{% href "/content/images/vote-favorite-on.png" %}" - alt="{% trans "mark this question as favorite (click again to cancel)" %}" - title="{% trans "mark this question as favorite (click again to cancel)" %}" /> - <div id="favorite-number" class="favorite-number my-favorite-number"> - {{ question.favourite_count }} - </div> - {% else %} - <img class="question-img-favorite" src="{% href "/content/images/vote-favorite-off.png" %}" - alt="{% trans "remove favorite mark from this question (click again to restore mark)" %}" - title="{% trans "remove favorite mark from this question (click again to restore mark)" %}" /> - <div id="favorite-number" class="favorite-number"> - {% ifnotequal question.favourite_count 0 %}{{ question.favourite_count }}{% endifnotequal %} - </div> - - {% endif %} - - </div> - </td> - <td> - <div id="item-right"> - <div class="question-body"> - {{ question.html|safe }} - </div> - <div id="question-controls" class="post-controls"> - <div id="question-tags" class="tags"> - {% for tag in question.tagname_list %} - <a href="{% url forum.views.tag tag|urlencode %}" class="post-tag" - title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a> - {% endfor %} - </div> - {% joinitems using '<span class="action-link-separator">|</span>' %} - {% if request.user|can_edit_post:question %} - <span class="action-link"><a href="{% url edit_question question.id %}">{% trans 'edit' %}</a></span> - {% endif %} - {% separator %} -<<<<<<< HEAD:templates/question.html - {% if request.user|can_delete_post:question %} - <span class="action-link"><a id="question-delete-link-{{question.id}}">{% trans "delete" %}</a></span> - {% endif %} - {% separator %} -======= ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/question.html - {% if question.closed %} - {% if request.user|can_reopen_question:question %} - <span class="action-link"><a href="{% url reopen question.id %}">{% trans "reopen" %}</a></span> - {% endif %} - {% else %} - {% if request.user|can_close_question:question %} - <span class="action-link"><a href="{% url close question.id %}">{% trans "close" %}</a></span> - {% endif %} - {% endif %} - {% separator %} - {% if request.user|can_flag_offensive %} - <span id="question-offensive-flag-{{ question.id }}" class="offensive-flag" - title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}"> - <a>{% trans "flag offensive" %}</a> - {% if request.user|can_view_offensive_flags and question.offensive_flag_count %} - <span class="darkred">({{ question.offensive_flag_count }})</span> - {% endif %} - </span> - {% endif %} -<<<<<<< HEAD:templates/question.html -======= - {% separator %} - {% if request.user|can_delete_post:question %} - <span class="action-link"><a id="question-delete-link-{{question.id}}">{% trans "delete" %}</a></span> - {% endif %} ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/question.html - {% endjoinitems %} - </div> - <div class="post-update-info-container"> - {% post_contributor_info question "original_author" %} - {% post_contributor_info question "last_updater" %} - </div> - <div class="comments-container" id="comments-container-question-{{question.id}}"> - {% for comment in question.get_comments|slice:":5" %} - <p class="comment" id="comment-{{comment.id}}"> - {{comment.comment}} - - <a class="comment-user" href="{{comment.user.get_profile_url}}">{{comment.user}}</a> - {% spaceless %} - <span class="comment-age">({% diff_date comment.added_at %})</span> - {% if request.user|can_delete_comment:comment %} - <img class="delete-icon" - src="{% href "/content/images/close-small.png" %}" - title="{% trans "delete this comment" %}"/> - {% endif %} - {% endspaceless %} - </p> - {% endfor %} - </div> - <div class="post-comments" style="margin-bottom:20px"> - <input id="can-post-comments-question-{{question.id}}" type="hidden" value="{{ request.user|can_add_comments:question }}"/> - {% if request.user|can_add_comments:question or question.comment_count > 5 %} - <a id="comments-link-question-{{question.id}}" class="comments-link"> - {% if request.user|can_add_comments:question %} - {% trans "add comment" %} - {% endif %} - {% if question.comment_count > 5 %} - {% if request.user|can_add_comments:question %}/ - {% blocktrans count question.get_comments|slice:"5:"|length as counter %} - see <strong>one</strong> more - {% plural %} - see <strong>{{counter}}</strong> more - {% endblocktrans %} - {% else %} - {% blocktrans count question.get_comments|slice:"5:"|length as counter %} - see <strong>one</strong> more comment - {% plural %} - see <strong>{{counter}}</strong> more comments - {% endblocktrans %} - {% endif %} - {% endif %}</a> - {% endif %} - </div> - </div> - - </td> - </tr> - </table> - {% if question.closed %} - <div class="question-status" style="margin-bottom:15px"> - <h3>{% blocktrans with question.get_close_reason_display as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %} - <a href="{{ question.closed_by.get_profile_url }}">{{ question.closed_by.username }}</a> - {% blocktrans with question.closed_at as closed_at %}close date {{closed_at}}{% endblocktrans %}</h3> - </div> - {% endif %} - {% if answers %} - <hr/> - <div class="tabBar"> - <a name="sort-top"></a> - <div class="headQuestions"> - {% blocktrans count answers|length as counter %} - One Answer: - {% plural %} - {{counter}} Answers: - {% endblocktrans %} - </div> - <div class="tabsA"> - <a id="oldest" href="{% url question question.id %}?sort=oldest#sort-top" - title="{% trans "oldest answers will be shown first" %}">{% trans "oldest answers" %}</a> - <a id="latest" href="{% url question question.id %}?sort=latest#sort-top" - title="{% trans "newest answers will be shown first" %}">{% trans "newest answers" %}</a> - <a id="votes" href="{% url question question.id %}?sort=votes#sort-top" - title="{% trans "most voted answers will be shown first" %}">{% trans "popular answers" %}</a> - </div> - </div> - {% cnprog_paginator context %} - - {% for answer in answers %} - <a name="{{ answer.id }}"></a> - <div id="answer-container-{{ answer.id }}" class="answer {% if answer.accepted %}accepted-answer{% endif %} {% ifequal answer.author_id question.author_id %} answered-by-owner{% endifequal %} {% if answer.deleted %}deleted{% endif %}"> - <table style="width:100%;"> - <tr> - <td style="width:30px;vertical-align:top"> - <div class="vote-buttons"> - <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote" - src="{% blockresource %}/content/images/vote-arrow-up{% get_user_vote_image user_answer_votes answer.id 1 %}.png{% endblockresource %}" - alt="{% trans "i like this answer (click again to cancel)" %}" - title="{% trans "i like this answer (click again to cancel)" %}"/> - <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans "current number of votes" %}"> - {{ answer.score }} - </div> - <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote" - src="{% blockresource %}/content/images/vote-arrow-down{% get_user_vote_image user_answer_votes answer.id -1 %}.png{% endblockresource %}" - alt="{% trans "i dont like this answer (click again to cancel)" %}" - title="{% trans "i dont like this answer (click again to cancel)" %}" /> - - {% ifequal request.user question.author %} - <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" - src="{% blockresource %}/content/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png{% endblockresource %}" - alt="{% trans "mark this answer as favorite (click again to undo)" %}" - title="{% trans "mark this answer as favorite (click again to undo)" %}" /> - {% else %} - {% if answer.accepted %} - <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" - src="{% blockresource %}/content/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png{% endblockresource %}" - alt="{% trans "the author of the question has selected this answer as correct" %}" - title="{% trans "the author of the question has selected this answer as correct" %}" /> - {% endif %} - {% endifequal %} - </div> - </td> - <td> - <div class="item-right"> - <div class="answer-body"> - {{ answer.html|safe }} - </div> - <div class="answer-controls post-controls"> - {% joinitems using '<span class="action-link-separator">|</span>' %} - <span class="linksopt"> - <a href="#{{ answer.id }}" title="{% trans "answer permanent link" %}"> - {% trans "permanent link" %} - </a> - </span> - {% separator %} - {% if request.user|can_edit_post:answer %} - <span class="action-link"><a href="{% url edit_answer answer.id %}">{% trans 'edit' %}</a></span> - {% endif %} - {% separator %} -<<<<<<< HEAD:templates/question.html - {% if request.user|can_delete_post:answer %} - {% spaceless %} - <span class="action-link"> - <a id="answer-delete-link-{{answer.id}}"> - {% if answer.deleted %}{% trans "undelete" %}{% else %}{% trans "delete" %}{% endif %}</a> - </span> - {% endspaceless %} - {% endif %} - {% separator %} -======= ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/question.html - {% if request.user|can_flag_offensive %} - <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag" - title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}"> - <a>{% trans "flag offensive" %}</a> - {% if request.user|can_view_offensive_flags and answer.offensive_flag_count %} - <span class="darkred">({{ answer.offensive_flag_count }})</span> - {% endif %} - </span> - {% endif %} -<<<<<<< HEAD:templates/question.html -======= - {% separator %} - {% if request.user|can_delete_post:answer %} - {% spaceless %} - <span class="action-link"> - <a id="answer-delete-link-{{answer.id}}"> - {% if answer.deleted %}{% trans "undelete" %}{% else %}{% trans "delete" %}{% endif %}</a> - </span> - {% endspaceless %} - {% endif %} ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/question.html - {% endjoinitems %} - </div> - <div class="post-update-info-container"> - {% post_contributor_info answer "original_author" %} - {% post_contributor_info answer "last_updater" %} - </div> - <div class="comments-container" id="comments-container-answer-{{answer.id}}"> - {% for comment in answer.get_comments|slice:":5" %} - <p id="comment-{{comment.id}}" class="comment"> - {{comment.comment}} - - <a class="comment-user" href="{{comment.user.get_profile_url}}">{{comment.user}}</a> - {% spaceless %} - <span class="comment-age">({% diff_date comment.added_at %})</span> - {% if request.user|can_delete_comment:comment %} - <img class="delete-icon" - src="{% href "/content/images/close-small.png" %}" - title="{% trans "delete this comment" %}"/> - {% endif %} - {% endspaceless %} - </p> - {% endfor %} - </div> - <div class="post-comments" style="margin-bottom:20px"> - <input id="can-post-comments-answer-{{answer.id}}" type="hidden" value="{{ request.user|can_add_comments:answer}}"/> - {% if request.user|can_add_comments:answer or answer.comment_count > 5 %} - <a id="comments-link-answer-{{answer.id}}" class="comments-link"> - {% if request.user|can_add_comments:answer %} - {% trans "add comment" %} - {% endif %} - {% if answer.comment_count > 5 %} - {% if request.user|can_add_comments:answer %}/ - {% blocktrans count answer.get_comments|slice:"5:"|length as counter %} - see <strong>one</strong> more - {% plural %} - see <strong>{{counter}}</strong> more - {% endblocktrans %} - {% else %} - {% blocktrans count answer.get_comments|slice:"5:"|length as counter %} - see <strong>one</strong> more comment - {% plural %} - see <strong>{{counter}}</strong> more comments - {% endblocktrans %} - {% endif %} - {% endif %}</a> - {% endif %} - </div> - </div> - - </td> - </tr> - </table> - </div> - {% endfor %} - <div class="paginator-container-left"> - {% cnprog_paginator context %} - </div> - {% endif %} - <form id="fmanswer" action="{% url answer question.id %}" method="post"> - {% if request.user.is_authenticated %} - <p style="padding-left:3px"> - {{ answer.email_notify }} - <label for="question-subscribe-updates"> - {% ifequal request.user.get_q_sel_email_feed_frequency 'n' %} - {% trans "Notify me once a day when there are any new answers" %} - {% else %} - {% ifequal request.user.get_q_sel_email_feed_frequency 'd' %} - {% trans "Notify me once a day when there are any new answers" %} - {% else %} - {% ifequal request.user.get_q_sel_email_feed_frequency 'w' %} - {% trans "Notify me weekly when there are any new answers" %} - {% endifequal %} - {% endifequal %} - {% endifequal %} - </label> - {% blocktrans with request.user.get_profile_url as profile_url %} - You can always adjust frequency of email updates from your {{profile_url}} - {% endblocktrans %} - </p> - {% else %} - <p style="padding-left:3px"> - <input class="nomargin" type="checkbox" disabled="disabled" /> - <label>{% trans "once you sign in you will be able to subscribe for any updates here" %}</label> - </p> - {% endif %} - <div style="clear:both"> - </div> - - {% if not question.closed %} - <div style="padding:10px 0 0 0;"> - {% spaceless %} - <div class="headNormal"> - {% if answers %} - {% trans "Your answer" %} - {% else %} - {% trans "Be the first one to answer this question!" %} - {% endif %} - </div> - {% endspaceless %} - </div> - {% if not request.user.is_authenticated %} - <div class="message">{% trans "you can answer anonymously and then login" %}</div> - {% else %} - <p class="message"> - {% ifequal request.user question.author %} - {% trans "answer your own question only to give an answer" %} - {% else %} - {% trans "please only give an answer, no discussions" %} - {% endifequal %} - </p> - {% endif %} - - <div id="description" class="" > - <div id="wmd-button-bar" class="wmd-panel"></div> - {{ answer.text }} - <div class="preview-toggle"> - <table width="100%"> - <tr> - <td> - <span id="pre-collapse" - title="{% trans "Toggle the real time Markdown editor preview" %}"> - {% trans "toggle preview" %} - </span> - </td> - {% if settings.WIKI_ON %} - <td style="text-align:right;"> - {{ answer.wiki }} - <span style="font-weight:normal;cursor:help" - title="{{answer.wiki.help_text}}"> - {{ answer.wiki.label_tag }} - </span> - </td> - {% endif %} - </tr> - - </table> - </div> - <div id="previewer" class="wmd-preview"></div> - {{ answer.text.errors }} - </div> - <p><span class="form-error"></span></p> - <input type="submit" - {% if user.is_anonymous %} - value="{% trans "Login/Signup to Post Your Answer" %}" - {% else %} - {% if user == question.author %} - value="{% trans "Answer Your Own Question" %}" - {% else %} - value="{% trans "Answer the question" %}" - {% endif %} - {% endif %} - class="submit" style="float:left"/> - {% endif %} - </form> - </div> -</div> -{% endblock %} - -{% block sidebar %} -<div class="boxC"> - <p> - {% trans "Question tags" %}: - </p> - <p class="tags" > - {% for tag in tags %} - <a href="{% url forum.views.tag tag.name|urlencode %}" - title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}" - rel="tag">{{ tag.name }}</a> <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/> - {% endfor %} - </p> - <p> - {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong> - </p> - <p> - {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong> - </p> - <p> - {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong> - </p> -</div> - -<div class="boxC"> - <h3 class="subtitle">{% trans "Related questions" %}</h3> - <div class="questions-related"> - {% for question in similar_questions %} - <p> - <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a> - </p> - {% endfor %} - </div> -</div> - -{% endblock %} - -{% block endjs %} -{% endblock %} -<!-- end question.html --> +{% extends "base.html" %}
+<!-- question.html -->
+{% load extra_tags %}
+{% load extra_filters %}
+{% load smart_if %}
+{% load humanize %}
+{% load i18n %}
+{% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %}
+{% block forejs %}
+ <meta name="description" content="{{question.summary}}" />
+ <meta name="keywords" content="{{question.tagname_meta_generator}}" />
+ <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" />
+ {% if not question.closed %}
+ <script type='text/javascript' src='{% href "/content/js/com.cnprog.editor.js" %}'></script>
+ <script type='text/javascript' src='{% href "/content/js/wmd/showdown.js" %}'></script>
+ <script type='text/javascript' src='{% href "/content/js/wmd/wmd.js" %}'></script>
+ <link rel="stylesheet" type="text/css" href="{% href "/content/js/wmd/wmd.css" %}" />
+ {% endif %}
+ <script type='text/javascript' src='{% href "/content/js/com.cnprog.post.js" %}'></script>
+ <script type='text/javascript' src='{% href "/content/js/jquery.validate.pack.js" %}'></script>
+
+ <script type="text/javascript">
+ // define reputation needs for comments
+ var repNeededForComments = 50;
+ $().ready(function(){
+ $("#nav_questions").attr('className',"on");
+ var answer_sort_tab = "{{ tab_id }}";
+ $("#" + answer_sort_tab).attr('className',"on");
+
+ Vote.init({{ question.id }}, '{{ question.title|slugify }}', '{{ question.author.id }}','{{ request.user.id }}');
+
+ {% if not question.closed and request.user.is_authenticated %}initEditor();{% endif %}
+
+ lanai.highlightSyntax();
+ $('#btLogin').bind('click', function(){window.location.href='{% url user_signin %}'; } )
+ });
+
+ function initEditor(){
+ $('#editor').TextAreaResizer();
+ //highlight code synctax when editor has new text
+ $("#editor").typeWatch({highlight: false, wait: 3000,
+ captureLength: 5, callback: lanai.highlightSyntax});
+
+ var display = true;
+ var txt = "[{% trans "hide preview" %}]";
+ $('#pre-collapse').text(txt);
+ $('#pre-collapse').bind('click', function(){
+ txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";
+ display = !display;
+ $('#previewer').toggle();
+ $('#pre-collapse').text(txt);
+ });
+
+ setupFormValidation("#fmanswer", CPValidator.getQuestionFormRules(), CPValidator.getQuestionFormMessages());
+ }
+
+ </script>
+{% endblock %}
+
+{% block content %}
+<div class="headNormal">
+ <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a>
+</div>
+<div id="main-body" class="">
+ <div id="askform">
+ <table style="width:100%;" id="question-table" {% if question.deleted %}class="deleted"{%endif%}>
+ <tr>
+ <td style="width:30px;vertical-align:top">
+ <div class="vote-buttons">
+ {% if question_vote %}
+ <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote"
+ {% if question_vote.is_upvote %}
+ src="{% href "/content/images/vote-arrow-up-on.png" %}"
+ {% else %}
+ src="{% href "/content/images/vote-arrow-up.png" %}"
+ {% endif %}
+ alt="{% trans "i like this post (click again to cancel)" %}"
+ title="{% trans "i like this post (click again to cancel)" %}" />
+ <div id="question-vote-number-{{ question.id }}" class="vote-number"
+ title="{% trans "current number of votes" %}">
+ {{ question.score }}
+ </div>
+ <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote"
+ {% if question_vote.is_downvote %}
+ src="{% href "/content/images/vote-arrow-down-on.png" %}"
+ {% else %}
+ src="{% href "/content/images/vote-arrow-down.png" %}"
+ {% endif %}
+ alt="{% trans "i dont like this post (click again to cancel)" %}"
+ title="{% trans "i dont like this post (click again to cancel)" %}" />
+
+ {% else %}
+ <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote"
+ alt="{% trans "i like this post (click again to cancel)" %}"
+ src="{% href "/content/images/vote-arrow-up.png" %}"
+ title="{% trans "i like this post (click again to cancel)" %}" />
+ <div id="question-vote-number-{{ question.id }}" class="vote-number"
+ title="{% trans "current number of votes" %}">
+ {{ question.score }}
+ </div>
+ <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote"
+ src="{% href "/content/images/vote-arrow-down.png" %}"
+ alt="{% trans "i dont like this post (click again to cancel)" %}"
+ title="{% trans "i dont like this post (click again to cancel)" %}" />
+
+ {% endif %}
+ {% if favorited %}
+ <img class="question-img-favorite" src="{% href "/content/images/vote-favorite-on.png" %}"
+ alt="{% trans "mark this question as favorite (click again to cancel)" %}"
+ title="{% trans "mark this question as favorite (click again to cancel)" %}" />
+ <div id="favorite-number" class="favorite-number my-favorite-number">
+ {{ question.favourite_count }}
+ </div>
+ {% else %}
+ <img class="question-img-favorite" src="{% href "/content/images/vote-favorite-off.png" %}"
+ alt="{% trans "remove favorite mark from this question (click again to restore mark)" %}"
+ title="{% trans "remove favorite mark from this question (click again to restore mark)" %}" />
+ <div id="favorite-number" class="favorite-number">
+ {% ifnotequal question.favourite_count 0 %}{{ question.favourite_count }}{% endifnotequal %}
+ </div>
+
+ {% endif %}
+
+ </div>
+ </td>
+ <td>
+ <div id="item-right">
+ <div class="question-body">
+ {{ question.html|safe }}
+ </div>
+ <div id="question-controls" class="post-controls">
+ <div id="question-tags" class="tags">
+ {% for tag in question.tagname_list %}
+ <a href="{% url forum.views.tag tag|urlencode %}" class="post-tag"
+ title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>
+ {% endfor %}
+ </div>
+ {% joinitems using '<span class="action-link-separator">|</span>' %}
+ {% if request.user|can_edit_post:question %}
+ <span class="action-link"><a href="{% url edit_question question.id %}">{% trans 'edit' %}</a></span>
+ {% endif %}
+ {% separator %}
+ {% if question.closed %}
+ {% if request.user|can_reopen_question:question %}
+ <span class="action-link"><a href="{% url reopen question.id %}">{% trans "reopen" %}</a></span>
+ {% endif %}
+ {% else %}
+ {% if request.user|can_close_question:question %}
+ <span class="action-link"><a href="{% url close question.id %}">{% trans "close" %}</a></span>
+ {% endif %}
+ {% endif %}
+ {% separator %}
+ {% if request.user|can_flag_offensive %}
+ <span id="question-offensive-flag-{{ question.id }}" class="offensive-flag"
+ title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}">
+ <a>{% trans "flag offensive" %}</a>
+ {% if request.user|can_view_offensive_flags and question.offensive_flag_count %}
+ <span class="darkred">({{ question.offensive_flag_count }})</span>
+ {% endif %}
+ </span>
+ {% endif %}
+ {% separator %}
+ {% if request.user|can_delete_post:question %}
+ <span class="action-link"><a id="question-delete-link-{{question.id}}">{% trans "delete" %}</a></span>
+ {% endif %}
+ {% endjoinitems %}
+ </div>
+ <div class="post-update-info-container">
+ {% post_contributor_info question "original_author" %}
+ {% post_contributor_info question "last_updater" %}
+ </div>
+ <div class="comments-container" id="comments-container-question-{{question.id}}">
+ {% for comment in question.get_comments|slice:":5" %}
+ <p class="comment" id="comment-{{comment.id}}">
+ {{comment.comment}}
+ - <a class="comment-user" href="{{comment.user.get_profile_url}}">{{comment.user}}</a>
+ {% spaceless %}
+ <span class="comment-age">({% diff_date comment.added_at %})</span>
+ {% if request.user|can_delete_comment:comment %}
+ <img class="delete-icon"
+ src="{% href "/content/images/close-small.png" %}"
+ title="{% trans "delete this comment" %}"/>
+ {% endif %}
+ {% endspaceless %}
+ </p>
+ {% endfor %}
+ </div>
+ <div class="post-comments" style="margin-bottom:20px">
+ <input id="can-post-comments-question-{{question.id}}" type="hidden" value="{{ request.user|can_add_comments:question }}"/>
+ {% if request.user|can_add_comments:question or question.comment_count > 5 %}
+ <a id="comments-link-question-{{question.id}}" class="comments-link">
+ {% if request.user|can_add_comments:question %}
+ {% trans "add comment" %}
+ {% endif %}
+ {% if question.comment_count > 5 %}
+ {% if request.user|can_add_comments:question %}/
+ {% blocktrans count question.get_comments|slice:"5:"|length as counter %}
+ see <strong>one</strong> more
+ {% plural %}
+ see <strong>{{counter}}</strong> more
+ {% endblocktrans %}
+ {% else %}
+ {% blocktrans count question.get_comments|slice:"5:"|length as counter %}
+ see <strong>one</strong> more comment
+ {% plural %}
+ see <strong>{{counter}}</strong> more comments
+ {% endblocktrans %}
+ {% endif %}
+ {% endif %}</a>
+ {% endif %}
+ </div>
+ </div>
+
+ </td>
+ </tr>
+ </table>
+ {% if question.closed %}
+ <div class="question-status" style="margin-bottom:15px">
+ <h3>{% blocktrans with question.get_close_reason_display as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %}
+ <a href="{{ question.closed_by.get_profile_url }}">{{ question.closed_by.username }}</a>
+ {% blocktrans with question.closed_at as closed_at %}close date {{closed_at}}{% endblocktrans %}</h3>
+ </div>
+ {% endif %}
+ {% if answers %}
+ <hr/>
+ <div class="tabBar">
+ <a name="sort-top"></a>
+ <div class="headQuestions">
+ {% blocktrans count answers|length as counter %}
+ One Answer:
+ {% plural %}
+ {{counter}} Answers:
+ {% endblocktrans %}
+ </div>
+ <div class="tabsA">
+ <a id="oldest" href="{% url question question.id %}?sort=oldest#sort-top"
+ title="{% trans "oldest answers will be shown first" %}">{% trans "oldest answers" %}</a>
+ <a id="latest" href="{% url question question.id %}?sort=latest#sort-top"
+ title="{% trans "newest answers will be shown first" %}">{% trans "newest answers" %}</a>
+ <a id="votes" href="{% url question question.id %}?sort=votes#sort-top"
+ title="{% trans "most voted answers will be shown first" %}">{% trans "popular answers" %}</a>
+ </div>
+ </div>
+ {% cnprog_paginator context %}
+
+ {% for answer in answers %}
+ <a name="{{ answer.id }}"></a>
+ <div id="answer-container-{{ answer.id }}" class="answer {% if answer.accepted %}accepted-answer{% endif %} {% ifequal answer.author_id question.author_id %} answered-by-owner{% endifequal %} {% if answer.deleted %}deleted{% endif %}">
+ <table style="width:100%;">
+ <tr>
+ <td style="width:30px;vertical-align:top">
+ <div class="vote-buttons">
+ <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote"
+ src="{% blockresource %}/content/images/vote-arrow-up{% get_user_vote_image user_answer_votes answer.id 1 %}.png{% endblockresource %}"
+ alt="{% trans "i like this answer (click again to cancel)" %}"
+ title="{% trans "i like this answer (click again to cancel)" %}"/>
+ <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans "current number of votes" %}">
+ {{ answer.score }}
+ </div>
+ <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote"
+ src="{% blockresource %}/content/images/vote-arrow-down{% get_user_vote_image user_answer_votes answer.id -1 %}.png{% endblockresource %}"
+ alt="{% trans "i dont like this answer (click again to cancel)" %}"
+ title="{% trans "i dont like this answer (click again to cancel)" %}" />
+
+ {% ifequal request.user question.author %}
+ <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept"
+ src="{% blockresource %}/content/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png{% endblockresource %}"
+ alt="{% trans "mark this answer as favorite (click again to undo)" %}"
+ title="{% trans "mark this answer as favorite (click again to undo)" %}" />
+ {% else %}
+ {% if answer.accepted %}
+ <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept"
+ src="{% blockresource %}/content/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png{% endblockresource %}"
+ alt="{% trans "the author of the question has selected this answer as correct" %}"
+ title="{% trans "the author of the question has selected this answer as correct" %}" />
+ {% endif %}
+ {% endifequal %}
+ </div>
+ </td>
+ <td>
+ <div class="item-right">
+ <div class="answer-body">
+ {{ answer.html|safe }}
+ </div>
+ <div class="answer-controls post-controls">
+ {% joinitems using '<span class="action-link-separator">|</span>' %}
+ <span class="linksopt">
+ <a href="#{{ answer.id }}" title="{% trans "answer permanent link" %}">
+ {% trans "permanent link" %}
+ </a>
+ </span>
+ {% separator %}
+ {% if request.user|can_edit_post:answer %}
+ <span class="action-link"><a href="{% url edit_answer answer.id %}">{% trans 'edit' %}</a></span>
+ {% endif %}
+ {% separator %}
+ {% if request.user|can_flag_offensive %}
+ <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag"
+ title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}">
+ <a>{% trans "flag offensive" %}</a>
+ {% if request.user|can_view_offensive_flags and answer.offensive_flag_count %}
+ <span class="darkred">({{ answer.offensive_flag_count }})</span>
+ {% endif %}
+ </span>
+ {% endif %}
+ {% separator %}
+ {% if request.user|can_delete_post:answer %}
+ {% spaceless %}
+ <span class="action-link">
+ <a id="answer-delete-link-{{answer.id}}">
+ {% if answer.deleted %}{% trans "undelete" %}{% else %}{% trans "delete" %}{% endif %}</a>
+ </span>
+ {% endspaceless %}
+ {% endif %}
+ {% endjoinitems %}
+ </div>
+ <div class="post-update-info-container">
+ {% post_contributor_info answer "original_author" %}
+ {% post_contributor_info answer "last_updater" %}
+ </div>
+ <div class="comments-container" id="comments-container-answer-{{answer.id}}">
+ {% for comment in answer.get_comments|slice:":5" %}
+ <p id="comment-{{comment.id}}" class="comment">
+ {{comment.comment}}
+ - <a class="comment-user" href="{{comment.user.get_profile_url}}">{{comment.user}}</a>
+ {% spaceless %}
+ <span class="comment-age">({% diff_date comment.added_at %})</span>
+ {% if request.user|can_delete_comment:comment %}
+ <img class="delete-icon"
+ src="{% href "/content/images/close-small.png" %}"
+ title="{% trans "delete this comment" %}"/>
+ {% endif %}
+ {% endspaceless %}
+ </p>
+ {% endfor %}
+ </div>
+ <div class="post-comments" style="margin-bottom:20px">
+ <input id="can-post-comments-answer-{{answer.id}}" type="hidden" value="{{ request.user|can_add_comments:answer}}"/>
+ {% if request.user|can_add_comments:answer or answer.comment_count > 5 %}
+ <a id="comments-link-answer-{{answer.id}}" class="comments-link">
+ {% if request.user|can_add_comments:answer %}
+ {% trans "add comment" %}
+ {% endif %}
+ {% if answer.comment_count > 5 %}
+ {% if request.user|can_add_comments:answer %}/
+ {% blocktrans count answer.get_comments|slice:"5:"|length as counter %}
+ see <strong>one</strong> more
+ {% plural %}
+ see <strong>{{counter}}</strong> more
+ {% endblocktrans %}
+ {% else %}
+ {% blocktrans count answer.get_comments|slice:"5:"|length as counter %}
+ see <strong>one</strong> more comment
+ {% plural %}
+ see <strong>{{counter}}</strong> more comments
+ {% endblocktrans %}
+ {% endif %}
+ {% endif %}</a>
+ {% endif %}
+ </div>
+ </div>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+ {% endfor %}
+ <div class="paginator-container-left">
+ {% cnprog_paginator context %}
+ </div>
+ {% endif %}
+ <form id="fmanswer" action="{% url answer question.id %}" method="post">
+ {% if request.user.is_authenticated %}
+ <p style="padding-left:3px">
+ {{ answer.email_notify }}
+ <label for="question-subscribe-updates">
+ {% ifequal request.user.get_q_sel_email_feed_frequency 'n' %}
+ {% trans "Notify me once a day when there are any new answers" %}
+ {% else %}
+ {% ifequal request.user.get_q_sel_email_feed_frequency 'd' %}
+ {% trans "Notify me once a day when there are any new answers" %}
+ {% else %}
+ {% ifequal request.user.get_q_sel_email_feed_frequency 'w' %}
+ {% trans "Notify me weekly when there are any new answers" %}
+ {% endifequal %}
+ {% endifequal %}
+ {% endifequal %}
+ </label>
+ {% blocktrans with request.user.get_profile_url as profile_url %}
+ You can always adjust frequency of email updates from your {{profile_url}}
+ {% endblocktrans %}
+ </p>
+ {% else %}
+ <p style="padding-left:3px">
+ <input class="nomargin" type="checkbox" disabled="disabled" />
+ <label>{% trans "once you sign in you will be able to subscribe for any updates here" %}</label>
+ </p>
+ {% endif %}
+ <div style="clear:both">
+ </div>
+
+ {% if not question.closed %}
+ <div style="padding:10px 0 0 0;">
+ {% spaceless %}
+ <div class="headNormal">
+ {% if answers %}
+ {% trans "Your answer" %}
+ {% else %}
+ {% trans "Be the first one to answer this question!" %}
+ {% endif %}
+ </div>
+ {% endspaceless %}
+ </div>
+ {% if not request.user.is_authenticated %}
+ <div class="message">{% trans "you can answer anonymously and then login" %}</div>
+ {% else %}
+ <p class="message">
+ {% ifequal request.user question.author %}
+ {% trans "answer your own question only to give an answer" %}
+ {% else %}
+ {% trans "please only give an answer, no discussions" %}
+ {% endifequal %}
+ </p>
+ {% endif %}
+
+ <div id="description" class="" >
+ <div id="wmd-button-bar" class="wmd-panel"></div>
+ {{ answer.text }}
+ <div class="preview-toggle">
+ <table width="100%">
+ <tr>
+ <td>
+ <span id="pre-collapse"
+ title="{% trans "Toggle the real time Markdown editor preview" %}">
+ {% trans "toggle preview" %}
+ </span>
+ </td>
+ {% if settings.WIKI_ON %}
+ <td style="text-align:right;">
+ {{ answer.wiki }}
+ <span style="font-weight:normal;cursor:help"
+ title="{{answer.wiki.help_text}}">
+ {{ answer.wiki.label_tag }}
+ </span>
+ </td>
+ {% endif %}
+ </tr>
+
+ </table>
+ </div>
+ <div id="previewer" class="wmd-preview"></div>
+ {{ answer.text.errors }}
+ </div>
+ <p><span class="form-error"></span></p>
+ <input type="submit"
+ {% if user.is_anonymous %}
+ value="{% trans "Login/Signup to Post Your Answer" %}"
+ {% else %}
+ {% if user == question.author %}
+ value="{% trans "Answer Your Own Question" %}"
+ {% else %}
+ value="{% trans "Answer the question" %}"
+ {% endif %}
+ {% endif %}
+ class="submit" style="float:left"/>
+ {% endif %}
+ </form>
+ </div>
+</div>
+{% endblock %}
+
+{% block sidebar %}
+<div class="boxC">
+ <p>
+ {% trans "Question tags" %}:
+ </p>
+ <p class="tags" >
+ {% for tag in tags %}
+ <a href="{% url forum.views.tag tag.name|urlencode %}"
+ title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}"
+ rel="tag">{{ tag.name }}</a> <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/>
+ {% endfor %}
+ </p>
+ <p>
+ {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>
+ </p>
+ <p>
+ {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>
+ </p>
+ <p>
+ {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>
+ </p>
+</div>
+
+<div class="boxC">
+ <h3 class="subtitle">{% trans "Related questions" %}</h3>
+ <div class="questions-related">
+ {% for question in similar_questions %}
+ <p>
+ <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a>
+ </p>
+ {% endfor %}
+ </div>
+</div>
+
+{% endblock %}
+
+{% block endjs %}
+{% endblock %}
+<!-- end question.html -->
diff --git a/templates/questions.html b/templates/questions.html index 7cbcbd2b..67751996 100644 --- a/templates/questions.html +++ b/templates/questions.html @@ -1,271 +1,235 @@ -{% extends "base.html" %} -<!-- questions.html --> -{% load extra_tags %} -{% load i18n %} -{% load humanize %} -{% load extra_filters %} -{% load smart_if %} -{% block title %}{% spaceless %}{% trans "Questions" %}{% endspaceless %}{% endblock %} -{% block forejs %} - <script type="text/javascript"> - var tags = {{ tags_autocomplete|safe }}; - $().ready(function(){ - var tab_id = "{{ tab_id }}"; - $("#"+tab_id).attr('className',"on"); - var on_tab = {% if is_unanswered %}'#nav_unanswered'{% else %}'#nav_questions'{% endif %}; - $(on_tab).attr('className','on'); - Hilite.exact = false; - Hilite.elementid = "listA"; - Hilite.debug_referrer = location.href; - }); - </script> - <script type='text/javascript' src='{% href "/content/js/com.cnprog.editor.js" %}'></script> - <script type='text/javascript' src='{% href "/content/js/com.cnprog.tag_selector.js" %}'></script> -{% endblock %} -{% block content %} -<div class="tabBar"> -<<<<<<< HEAD:templates/questions.html - <div class="headQuestions">{% if searchtag %}{% trans "Found by tags" %}{% else %}{% if searchtitle %}{% trans "Found by title" %}{% else %}{% trans "All questions" %}{% endif %}{% endif %}</div> -======= - <div class="headQuestions"> - {% if searchtag %} - {% trans "Found by tags" %} - {% else %} - {% if searchtitle %} - {% if settings.USE_SPHINX_SEARCH %} - {% trans "Search results" %} - {% else %} - {% trans "Found by title" %} - {% endif %} - {% else %} - {% if is_unanswered %} - {% trans "Unanswered questions" %} - {% else %} - {% trans "All questions" %} - {% endif %} - {% endif %} - {% endif %} - </div> ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/questions.html - <div class="tabsA"> - <a id="latest" href="?sort=latest" class="off" title="{% trans "most recently asked questions" %}">{% trans "newest" %}</a> - <a id="active" href="?sort=active" class="off" title="{% trans "most recently updated questions" %}">{% trans "active" %}</a> - <a id="hottest" href="?sort=hottest" class="off" title="{% trans "hottest questions" %}">{% trans "hottest" %}</a> - <a id="mostvoted" href="?sort=mostvoted" class="off" title="{% trans "most voted questions" %}">{% trans "most voted" %}</a> - </div> -</div> -<div id="listA"> - {% for question in questions.object_list %} - <div class="qstA" - {% if request.user.is_authenticated %} - {% if question.interesting_score > 0 %} - style="background:#ffff99;" - {% else %} - {% if not request.user.hide_ignored_questions %} - {% if question.ignored_score > 0 %} - style="background:#f3f3f3;" - {% endif %} - {% endif %} - {% endif %} - {% endif %} - > - <h2> - <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a> - </h2> - <div class="stat"> - <table> - <tr> - <td><span class="num">{{ question.answer_count|intcomma }}</span> </td> - <td><span class="num">{{ question.score|intcomma }}</span> </td> - <td><span class="num">{{ question.view_count|cnprog_intword|safe }}</span> </td> - </tr> - <tr> - <td><span class="unit">{% trans "answers" %}</span></td> - <td><span class="unit">{% trans "votes" %}</span></td> - <td><span class="unit">{% trans "views" %}</span></td> - </tr> - </table> - </div> - - <div class="summary"> - {{ question.summary }}... - </div> - - {% ifequal tab_id 'active'%} - {% if question.wiki and settings.WIKI_ON %} - <span class="from wiki">{% trans "community wiki" %}</span> - <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span> - {% else %} - <div class="from"> - {% comment %}{% gravatar question.last_activity_by 24 %}{% endcomment %} - <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span> - <span class="score">{% get_score_badge question.last_activity_by %} </span> - <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span> - </div> - {% endif %} - {% else %} - {% if question.wiki and settings.WIKI_ON %} - <span class="from wiki">{% trans "community wiki" %}</span> - <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span> - {% else %} - <div class="from"> - {% comment %}{% gravatar question.author 24 %}{% endcomment %} - {% if question.last_activity_at != question.added_at %} - {% if question.author.id != question.last_activity_by.id %} - {% trans "Posted:" %} - <span class="author"><a href="{{ question.author.get_profile_url }}">{{ question.author }}</a></span> - <span class="score">{% get_score_badge question.author %} </span> - / {% trans "Updated:" %} - <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span> - <span class="score">{% get_score_badge question.last_activity_by %} </span> - <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span> - {% else %} - {% trans "Updated:" %} - <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span> - <span class="score">{% get_score_badge question.last_activity_by %} </span> - <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span> - {% endif %} - {% else %} - {% trans "Posted:" %} - <span class="author"><a href="{{ question.author.get_profile_url }}">{{ question.author }}</a></span> - <span class="score">{% get_score_badge question.author %} </span> - <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span> - {% endif %} - </div> - {% endif %} - {% endifequal %} - - <div class="tags"> - {% for tag in question.tagname_list %} - <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a> - {% endfor %} - </div> - </div> - {% endfor %} - {% if searchtitle %} - {% if questions_count == 0 %} - <p class="evenMore" style="padding-top:30px;text-align:center;"> - {% trans "Did not find anything?" %} - {% else %} - <p class="evenMore" style="padding-left:9px"> - {% trans "Did not find what you were looking for?" %} - {% endif %} - <a href="{% url ask %}">{% trans "Please, post your question!" %}</a> - </p> - {% endif %} -</div> -{% endblock %} - -{% block tail %} - <div class="pager">{% cnprog_paginator context %}</div> - <div class="pagesize">{% cnprog_pagesize context %}</div> -{% endblock %} - -{% block sidebar %} -<div class="boxC"> - {% if searchtag %} -<<<<<<< HEAD:templates/questions.html - {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num and searchtag as tagname %} - have total {{q_num}} questions tagged {{tagname}} - {% plural %} - have total {{q_num}} questions tagged {{tagname}} - {% endblocktrans %} - {% else %} - {% if searchtitle %} - {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %} - have total {{q_num}} questions containing {{searchtitle}} - {% plural %} - have total {{q_num}} questions containing {{searchtitle}} - {% endblocktrans %} - {% else %} - {% blocktrans count questions as cnt with questions_count|intcomma as q_num %} - have total {{q_num}} questions - {% plural %} - have total {{q_num}} questions - {% endblocktrans %} - {% endif %} - {% endif %} - <p> -======= - {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num and searchtag as tagname %} - have total {{q_num}} questions tagged {{tagname}} - {% plural %} - have total {{q_num}} questions tagged {{tagname}} - {% endblocktrans %} - {% else %} - {% if searchtitle %} - {% if settings.USE_SPHINX_SEARCH %} - {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %} - have total {{q_num}} questions containing {{searchtitle}} in full text - {% plural %} - have total {{q_num}} questions containing {{searchtitle}} in full text - {% endblocktrans %} - {% else %} - {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %} - have total {{q_num}} questions containing {{searchtitle}} - {% plural %} - have total {{q_num}} questions containing {{searchtitle}} - {% endblocktrans %} - {% endif %} - {% else %} - {% if is_unanswered %} - {% blocktrans count questions as cnt with questions_count|intcomma as q_num %} - have total {{q_num}} unanswered questions - {% plural %} - have total {{q_num}} unanswered questions - {% endblocktrans %} - {% else %} - {% blocktrans count questions as cnt with questions_count|intcomma as q_num %} - have total {{q_num}} questions - {% plural %} - have total {{q_num}} questions - {% endblocktrans %} - {% endif %} - {% endif %} - {% endif %} - <p class="nomargin"> ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/questions.html - {% ifequal tab_id "latest" %} - {% trans "latest questions info" %} - {% endifequal %} - - {% ifequal tab_id "active" %} - {% trans "Questions are sorted by the <strong>time of last update</strong>." %} - {% trans "Most recently answered ones are shown first." %} - {% endifequal %} - - {% ifequal tab_id "hottest" %} - {% trans "Questions sorted by <strong>number of responses</strong>." %} - {% trans "Most answered questions are shown first." %} - {% endifequal %} - - {% ifequal tab_id "mostvoted" %} - {% trans "Questions are sorted by the <strong>number of votes</strong>." %} - {% trans "Most voted questions are shown first." %} - {% endifequal %} - </p> -</div> -{% if request.user.is_authenticated %} -{% include "tag_selector.html" %} -{% endif %} -<div class="boxC"> - <h3 class="subtitle">{% trans "Related tags" %}</h3> - <div class="tags"> - {% for tag in tags %} -<<<<<<< HEAD:templates/questions.html - <a rel="tag" title="{% trans "see questions tagged" %}'{{ tag.name }}'{% trans "using tags" %}" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a> - <span class="tag-number">× {{ tag.used_count|intcomma }}</span> - <br /> - {% endfor %} - <br /> -======= - <a rel="tag" title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{ tag_name }}'{% endblocktrans %}" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a> - <span class="tag-number">× {{ tag.used_count|intcomma }}</span> - <br /> - {% endfor %} ->>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/questions.html - </div> -</div> - -{% endblock %} -<!-- end questions.html --> +{% extends "base.html" %}
+<!-- questions.html -->
+{% load extra_tags %}
+{% load i18n %}
+{% load humanize %}
+{% load extra_filters %}
+{% load smart_if %}
+{% block title %}{% spaceless %}{% trans "Questions" %}{% endspaceless %}{% endblock %}
+{% block forejs %}
+ <script type="text/javascript">
+ var tags = {{ tags_autocomplete|safe }};
+ $().ready(function(){
+ var tab_id = "{{ tab_id }}";
+ $("#"+tab_id).attr('className',"on");
+ var on_tab = {% if is_unanswered %}'#nav_unanswered'{% else %}'#nav_questions'{% endif %};
+ $(on_tab).attr('className','on');
+ Hilite.exact = false;
+ Hilite.elementid = "listA";
+ Hilite.debug_referrer = location.href;
+ });
+ </script>
+ <script type='text/javascript' src='{% href "/content/js/com.cnprog.editor.js" %}'></script>
+ <script type='text/javascript' src='{% href "/content/js/com.cnprog.tag_selector.js" %}'></script>
+{% endblock %}
+{% block content %}
+<div class="tabBar">
+ <div class="headQuestions">
+ {% if searchtag %}
+ {% trans "Found by tags" %}
+ {% else %}
+ {% if searchtitle %}
+ {% if settings.USE_SPHINX_SEARCH %}
+ {% trans "Search results" %}
+ {% else %}
+ {% trans "Found by title" %}
+ {% endif %}
+ {% else %}
+ {% if is_unanswered %}
+ {% trans "Unanswered questions" %}
+ {% else %}
+ {% trans "All questions" %}
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ </div>
+ <div class="tabsA">
+ <a id="latest" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=latest" class="off" title="{% trans "most recently asked questions" %}">{% trans "newest" %}</a>
+ <a id="active" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=active" class="off" title="{% trans "most recently updated questions" %}">{% trans "active" %}</a>
+ <a id="hottest" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=hottest" class="off" title="{% trans "hottest questions" %}">{% trans "hottest" %}</a>
+ <a id="mostvoted" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=mostvoted" class="off" title="{% trans "most voted questions" %}">{% trans "most voted" %}</a>
+ </div>
+</div>
+<div id="listA">
+ {% for question in questions.object_list %}
+ <div class="qstA"
+ {% if request.user.is_authenticated %}
+ {% if question.interesting_score > 0 %}
+ style="background:#ffff99;"
+ {% else %}
+ {% if not request.user.hide_ignored_questions %}
+ {% if question.ignored_score > 0 %}
+ style="background:#f3f3f3;"
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ >
+ <h2>
+ <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a>
+ </h2>
+ <div class="stat">
+ <table>
+ <tr>
+ <td><span class="num">{{ question.answer_count|intcomma }}</span> </td>
+ <td><span class="num">{{ question.score|intcomma }}</span> </td>
+ <td><span class="num">{{ question.view_count|cnprog_intword|safe }}</span> </td>
+ </tr>
+ <tr>
+ <td><span class="unit">{% trans "answers" %}</span></td>
+ <td><span class="unit">{% trans "votes" %}</span></td>
+ <td><span class="unit">{% trans "views" %}</span></td>
+ </tr>
+ </table>
+ </div>
+
+ <div class="summary">
+ {{ question.summary }}...
+ </div>
+
+ {% ifequal tab_id 'active'%}
+ {% if question.wiki and settings.WIKI_ON %}
+ <span class="from wiki">{% trans "community wiki" %}</span>
+ <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>
+ {% else %}
+ <div class="from">
+ {% comment %}{% gravatar question.last_activity_by 24 %}{% endcomment %}
+ <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>
+ <span class="score">{% get_score_badge question.last_activity_by %} </span>
+ <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>
+ </div>
+ {% endif %}
+ {% else %}
+ {% if question.wiki and settings.WIKI_ON %}
+ <span class="from wiki">{% trans "community wiki" %}</span>
+ <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>
+ {% else %}
+ <div class="from">
+ {% comment %}{% gravatar question.author 24 %}{% endcomment %}
+ {% if question.last_activity_at != question.added_at %}
+ {% if question.author.id != question.last_activity_by.id %}
+ {% trans "Posted:" %}
+ <span class="author"><a href="{{ question.author.get_profile_url }}">{{ question.author }}</a></span>
+ <span class="score">{% get_score_badge question.author %} </span>
+ / {% trans "Updated:" %}
+ <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>
+ <span class="score">{% get_score_badge question.last_activity_by %} </span>
+ <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>
+ {% else %}
+ {% trans "Updated:" %}
+ <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>
+ <span class="score">{% get_score_badge question.last_activity_by %} </span>
+ <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>
+ {% endif %}
+ {% else %}
+ {% trans "Posted:" %}
+ <span class="author"><a href="{{ question.author.get_profile_url }}">{{ question.author }}</a></span>
+ <span class="score">{% get_score_badge question.author %} </span>
+ <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>
+ {% endif %}
+ </div>
+ {% endif %}
+ {% endifequal %}
+
+ <div class="tags">
+ {% for tag in question.tagname_list %}
+ <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a>
+ {% endfor %}
+ </div>
+ </div>
+ {% endfor %}
+ {% if searchtitle %}
+ {% if questions_count == 0 %}
+ <p class="evenMore" style="padding-top:30px;text-align:center;">
+ {% trans "Did not find anything?" %}
+ {% else %}
+ <p class="evenMore" style="padding-left:9px">
+ {% trans "Did not find what you were looking for?" %}
+ {% endif %}
+ <a href="{% url ask %}">{% trans "Please, post your question!" %}</a>
+ </p>
+ {% endif %}
+</div>
+{% endblock %}
+
+{% block tail %}
+ <div class="pager">{% cnprog_paginator context %}</div>
+ <div class="pagesize">{% cnprog_pagesize context %}</div>
+{% endblock %}
+
+{% block sidebar %}
+<div class="boxC">
+ {% if searchtag %}
+ {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num and searchtag as tagname %}
+ have total {{q_num}} questions tagged {{tagname}}
+ {% plural %}
+ have total {{q_num}} questions tagged {{tagname}}
+ {% endblocktrans %}
+ {% else %}
+ {% if searchtitle %}
+ {% if settings.USE_SPHINX_SEARCH %}
+ {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %}
+ have total {{q_num}} questions containing {{searchtitle}} in full text
+ {% plural %}
+ have total {{q_num}} questions containing {{searchtitle}} in full text
+ {% endblocktrans %}
+ {% else %}
+ {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %}
+ have total {{q_num}} questions containing {{searchtitle}}
+ {% plural %}
+ have total {{q_num}} questions containing {{searchtitle}}
+ {% endblocktrans %}
+ {% endif %}
+ {% else %}
+ {% if is_unanswered %}
+ {% blocktrans count questions as cnt with questions_count|intcomma as q_num %}
+ have total {{q_num}} unanswered questions
+ {% plural %}
+ have total {{q_num}} unanswered questions
+ {% endblocktrans %}
+ {% else %}
+ {% blocktrans count questions as cnt with questions_count|intcomma as q_num %}
+ have total {{q_num}} questions
+ {% plural %}
+ have total {{q_num}} questions
+ {% endblocktrans %}
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ <p class="nomargin">
+ {% ifequal tab_id "latest" %}
+ {% trans "latest questions info" %}
+ {% endifequal %}
+
+ {% ifequal tab_id "active" %}
+ {% trans "Questions are sorted by the <strong>time of last update</strong>." %}
+ {% trans "Most recently answered ones are shown first." %}
+ {% endifequal %}
+
+ {% ifequal tab_id "hottest" %}
+ {% trans "Questions sorted by <strong>number of responses</strong>." %}
+ {% trans "Most answered questions are shown first." %}
+ {% endifequal %}
+
+ {% ifequal tab_id "mostvoted" %}
+ {% trans "Questions are sorted by the <strong>number of votes</strong>." %}
+ {% trans "Most voted questions are shown first." %}
+ {% endifequal %}
+ </p>
+</div>
+{% if request.user.is_authenticated %}
+{% include "tag_selector.html" %}
+{% endif %}
+<div class="boxC">
+ <h3 class="subtitle">{% trans "Related tags" %}</h3>
+ <div class="tags">
+ {% for tag in tags %}
+ <a rel="tag" title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{ tag_name }}'{% endblocktrans %}" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a>
+ <span class="tag-number">× {{ tag.used_count|intcomma }}</span>
+ <br />
+ {% endfor %}
+ </div>
+</div>
+
+{% endblock %}
+<!-- end questions.html -->
diff --git a/templates/tag_selector.html b/templates/tag_selector.html index 6edc5cc8..94d23f3c 100644 --- a/templates/tag_selector.html +++ b/templates/tag_selector.html @@ -37,6 +37,6 @@ <input id="ignoredTagAdd" type="submit" value="{% trans "Add" %}"/> <p id="hideIgnoredTagsControl"> <input id="hideIgnoredTagsCb" type="checkbox" {% if request.user.hide_ignored_questions %}checked="checked"{% endif %} /> - <label id="hideIgnoredTagsLabel" for="hideIgnoredTags">{% trans "keep ingored questions hidden" %}</label> + <label id="hideIgnoredTagsLabel" for="hideIgnoredTagsCb">{% trans "keep ingored questions hidden" %}</label> <p> </div> diff --git a/templates/user_edit.html b/templates/user_edit.html index 5886c071..bc5056f9 100644 --- a/templates/user_edit.html +++ b/templates/user_edit.html @@ -1,95 +1,95 @@ -{% extends "base_content.html" %} -<!-- user_edit.html --> -{% load extra_tags %} -{% load humanize %} -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Edit user profile" %}{% endspaceless %}{% endblock %} -{% block forejs %} - <script type="text/javascript"> - $().ready(function(){ - $("#nav_profile").attr('className',"on"); - $("#cancel").bind('click', function(){history.go(-1);}) - }); - </script> - {% block userjs %} - {% endblock %} -{% endblock %} -{% block content %} -<div id="main-bar" class="headNormal"> - {{ request.user.username }} - {% trans "edit profile" %} -</div> -<div id="main-body" style="width:100%;padding-top:10px"> - <form name="" action="{% url edit_user request.user.id %}" method="post"> - <div id="left" style="float:left;width:180px"> - {% if request.user.email %} - {% gravatar request.user 128 %} - {% else %} - <img src="{% href "/content/images/nophoto.png" %}"> - {% endif %} - <div style="padding:20px 0 0 20px;font-weight:bold;font-size:150%"> - <a href="http://www.gravatar.com/" target="_blank" - title="gravatar {% trans "image associated with your email address" %}">{% blocktrans %}avatar, see {{gravatar_faq_url}}{% endblocktrans %}</a> - </div> - </div> - - <div id="askform" style="float:right;width:750px;text-align:left;"> - <h2>{% trans "Registered user" %}</h2> - <table class="user-details"> - <tr> - <th width="100px"></th> - <th></th> - </tr> - <tr style="height:35px"> - <td>{{ form.username.label_tag }}:</td> - <td>{{ form.username }} <span class="form-error"></span> {{ form.username.errors }} </td> - </tr> - - <tr style="height:35px"> - <td>{{ form.email.label_tag }}:</td> - <td>{{ form.email }} <span class="form-error"></span> {{ form.email.errors }} </td> - </tr> - <tr style="height:35px"> - <td></td> - <td class="title-desc">{{ form.email.help_text }}</td> - </tr> - <tr style="height:35px"> - <td>{{ form.realname.label_tag }}:</td> - <td>{{ form.realname }} <span class="form-error"></span> {{ form.realname.errors }} </td> - </tr> - <tr style="height:35px"> - <td>{{ form.website.label_tag }}:</td> - <td>{{ form.website }} <span class="form-error"></span> {{ form.website.errors }} </td> - </tr> - <tr style="height:35px"> - <td>{{ form.city.label_tag }}:</td> - <td>{{ form.city }} <span class="form-error"></span> {{ form.city.errors }} </td> - </tr> - <tr style="height:35px"> - <td>{{ form.birthday.label_tag }}:</td> - <td>{{ form.birthday }} <span class="form-error"></span> {{ form.birthday.errors }} </td> - </tr> - <tr style="height:35px"> - <td></td> - <td class="title-desc">{{ form.birthday.help_text }}</td> - </tr> - <tr style="height:10px"> - <td colspan="2"> - </td> - </tr> - <tr> - <td style="vertical-align:top">{{ form.about.label_tag }}:</td> - <td>{{ form.about }} <span class="form-error"></span> {{ form.about.errors }} </td> - </tr> - - </table> - <div style="margin:30px 0 60px 0"> - <input type="submit" value="{% trans "Update" %}" class="submit" > - <input id="cancel" type="button" value="{% trans "Cancel" %}" class="submit" > - - </div> - </div> - </form> - -</div> -{% endblock %} -<!-- end user_edit.html --> +{% extends "base_content.html" %}
+<!-- user_edit.html -->
+{% load extra_tags %}
+{% load humanize %}
+{% load i18n %}
+{% block title %}{% spaceless %}{% trans "Edit user profile" %}{% endspaceless %}{% endblock %}
+{% block forejs %}
+ <script type="text/javascript">
+ $().ready(function(){
+ $("#nav_profile").attr('className',"on");
+ $("#cancel").bind('click', function(){history.go(-1);})
+ });
+ </script>
+ {% block userjs %}
+ {% endblock %}
+{% endblock %}
+{% block content %}
+<div id="main-bar" class="headNormal">
+ {{ request.user.username }} - {% trans "edit profile" %}
+</div>
+<div id="main-body" style="width:100%;padding-top:10px">
+ <form name="" action="{% url edit_user request.user.id %}" method="post">
+ <div id="left" style="float:left;width:180px">
+ {% if request.user.email %}
+ {% gravatar request.user 128 %}
+ {% else %}
+ <img src="{% href "/content/images/nophoto.png" %}">
+ {% endif %}
+ <div style="padding:20px 0 0 20px;font-weight:bold;font-size:150%">
+ <a href="http://www.gravatar.com/" target="_blank"
+ title="gravatar {% trans "image associated with your email address" %}">{% blocktrans %}avatar, see {{gravatar_faq_url}}{% endblocktrans %}</a>
+ </div>
+ </div>
+
+ <div id="askform" style="float:right;width:750px;text-align:left;">
+ <h2>{% trans "Registered user" %}</h2>
+ <table class="user-details">
+ <tr>
+ <th width="100px"></th>
+ <th></th>
+ </tr>
+ <tr style="height:35px">
+ <td>{% trans "Screen Name" %}:</td>
+ <td>{{ request.user.username }} <span class="form-error"></span> {{ form.username.errors }} </td>
+ </tr>
+
+ <tr style="height:35px">
+ <td>{{ form.email.label_tag }}:</td>
+ <td>{{ form.email }} <span class="form-error"></span> {{ form.email.errors }} </td>
+ </tr>
+ <tr style="height:35px">
+ <td></td>
+ <td class="title-desc">{{ form.email.help_text }}</td>
+ </tr>
+ <tr style="height:35px">
+ <td>{{ form.realname.label_tag }}:</td>
+ <td>{{ form.realname }} <span class="form-error"></span> {{ form.realname.errors }} </td>
+ </tr>
+ <tr style="height:35px">
+ <td>{{ form.website.label_tag }}:</td>
+ <td>{{ form.website }} <span class="form-error"></span> {{ form.website.errors }} </td>
+ </tr>
+ <tr style="height:35px">
+ <td>{{ form.city.label_tag }}:</td>
+ <td>{{ form.city }} <span class="form-error"></span> {{ form.city.errors }} </td>
+ </tr>
+ <tr style="height:35px">
+ <td>{{ form.birthday.label_tag }}:</td>
+ <td>{{ form.birthday }} <span class="form-error"></span> {{ form.birthday.errors }} </td>
+ </tr>
+ <tr style="height:35px">
+ <td></td>
+ <td class="title-desc">{{ form.birthday.help_text }}</td>
+ </tr>
+ <tr style="height:10px">
+ <td colspan="2">
+ </td>
+ </tr>
+ <tr>
+ <td style="vertical-align:top">{{ form.about.label_tag }}:</td>
+ <td>{{ form.about }} <span class="form-error"></span> {{ form.about.errors }} </td>
+ </tr>
+
+ </table>
+ <div style="margin:30px 0 60px 0">
+ <input type="submit" value="{% trans "Update" %}" class="submit" >
+ <input id="cancel" type="button" value="{% trans "Cancel" %}" class="submit" >
+
+ </div>
+ </div>
+ </form>
+
+</div>
+{% endblock %}
+<!-- end user_edit.html -->
|