diff options
author | Byron <byroncorrales@gmail.com> | 2011-10-16 15:22:06 -0600 |
---|---|---|
committer | Byron <byroncorrales@gmail.com> | 2011-10-16 15:22:06 -0600 |
commit | eda3047d53a6ec5e74bd5b56230cd15349d1ff4d (patch) | |
tree | 9139f29032ce8528caac809ce5d9f69d8bf211e4 | |
parent | d361bc1957a63d3af7a9eba79a7fbbe8bcbd91cc (diff) | |
parent | 19e68e917a653a8f1279ed694c871172cfb428d3 (diff) | |
download | askbot-eda3047d53a6ec5e74bd5b56230cd15349d1ff4d.tar.gz askbot-eda3047d53a6ec5e74bd5b56230cd15349d1ff4d.tar.bz2 askbot-eda3047d53a6ec5e74bd5b56230cd15349d1ff4d.zip |
Merge branch 'new-template' of https://github.com/ASKBOT/askbot-devel into askbot/new-template
12 files changed, 291 insertions, 267 deletions
diff --git a/askbot/skins/default/media/style/style.css b/askbot/skins/default/media/style/style.css index d1f4378c..f494e672 100644 --- a/askbot/skins/default/media/style/style.css +++ b/askbot/skins/default/media/style/style.css @@ -1150,6 +1150,7 @@ ul#searchTags { .answer-table { margin: 2px 0 10px 0; border-spacing: 0px; + width: 100%; } .answer-table { @@ -1157,6 +1158,18 @@ ul#searchTags { clear: both; } +.answer-table td, +#question-table td { + width:30px; + vertical-align:top; +} + +#questionTools { + font-size: 22px; + margin-top: 11px; + text-align: left; +} + /* badges */ a.medal { @@ -1196,6 +1209,7 @@ a:hover.medal { .question-status { margin-top: 10px; + margin-bottom:15px padding: 20px; background-color: #F5F5F5; text-align: center; diff --git a/askbot/skins/default/templates/macros/macros.html b/askbot/skins/default/templates/macros/macros.html index 40ca1e64..7cae28b3 100644 --- a/askbot/skins/default/templates/macros/macros.html +++ b/askbot/skins/default/templates/macros/macros.html @@ -122,13 +122,15 @@ poor design of the data or methods on data objects #} {%- endmacro -%} {%- macro tag_list_widget( - tags, - id = None, - deletable = False, - make_links = True, - url_params = None, - css_class = None - ) + tags, + id = None, + deletable = False, + make_links = True, + url_params = None, + css_class = None, + tag_css_class = None, + tag_html_tag = 'li' + ) -%} <ul {% if id %}id="{{ id }}"{% endif %} class="tags{% if css_class %} {{css_class}}{% endif %}" @@ -137,10 +139,11 @@ poor design of the data or methods on data objects #} {% for tag in tags %} {{ tag_widget( tag, + css_class = tag_css_class, deletable = deletable, is_link = make_links, url_params = url_params, - html_tag = 'li' + html_tag = tag_html_tag )}} {% endfor %} {% endif %} @@ -324,14 +327,22 @@ for the purposes of the AJAX comment editor #} {% endif %} {%- endmacro -%} -{%- macro post_comments_widget(post=None, show_post = None, show_comment = None, comment_order_number = None, user=None, max_comments=None) -%} +{%- macro post_comments_widget( + post=None, + show_post = None, + show_comment = None, + show_comment_position = None, + user=None, + max_comments=None + ) +-%} {% spaceless %} {% set widget_id = 'comments-for-' + post.post_type + '-' + post.id|string %} <div class="comments" id="{{widget_id}}"> <div class="content"> {% if show_post == post and show_comment %} - {% if comment_order_number > max_comments %} - {% set comments = post.get_comments(visitor = user)[:comment_order_number] %} + {% if show_comment_position > max_comments %} + {% set comments = post.get_comments(visitor = user)[:show_comment_position] %} {{ comment_list(comments = comments, user = user) }} {% else %} {% set comments = post.get_comments(visitor = user)[:max_comments] %} @@ -345,12 +356,12 @@ for the purposes of the AJAX comment editor #} <div class="controls"> {% set can_post = user|can_post_comment(post) %} {% if show_post == post and show_comment %} - {% if comment_order_number > max_comments %} + {% if show_comment_position > max_comments %} {{ add_or_show_comments_button( post = post, can_post = can_post, - max_comments = comment_order_number, + max_comments = show_comment_position, widget_id = widget_id ) }} diff --git a/askbot/skins/default/templates/question/answer_card.html b/askbot/skins/default/templates/question/answer_card.html new file mode 100644 index 00000000..b3790b33 --- /dev/null +++ b/askbot/skins/default/templates/question/answer_card.html @@ -0,0 +1,89 @@ +<a name="{{ answer.id }}"></a> +<div id="answer-container-{{ answer.id }}" class="answer {% if answer.accepted %}accepted-answer{% endif %} {% if answer.author_id==question.author_id %} answered-by-owner{% endif %} {% if answer.deleted %}deleted{% endif %}"> + <table class="answer-table"> + <tr> + <td> + <div class="vote-buttons"> + <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote" + {% if user_answer_votes[answer.id] == 1 %} + src="{{'/images/vote-arrow-up-on.png'|media}}" + {% else %} + src="{{'/images/vote-arrow-up.png'|media}}" + {% endif %} + alt="{% trans %}i like this answer (click again to cancel){% endtrans %}" + title="{% trans %}i like this answer (click again to cancel){% endtrans %}"/> + <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans %}current number of votes{% endtrans %}"> + {{ answer.score }} + </div> + <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote" + {% if user_answer_votes[answer.id] == -1 %} + src="{{'/images/vote-arrow-down-on.png'|media}}" + {% else %} + src="{{'/images/vote-arrow-down.png'|media}}" + {% endif %} + alt="{% trans %}i dont like this answer (click again to cancel){% endtrans %}" + title="{% trans %}i dont like this answer (click again to cancel){% endtrans %}" /> + {% if request.user == question.author %} + <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" + {% if answer.accepted %} + src="{{'/images/vote-accepted-on.png'|media}}" + {% else %} + src="{{'/images/vote-accepted.png'|media}}" + {% endif %} + alt="{% trans %}mark this answer as favorite (click again to undo){% endtrans %}" + title="{% trans %}mark this answer as favorite (click again to undo){% endtrans %}" /> + {% else %} + {% if answer.accepted %} + <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" + {% if answer.accepted %} + src="{{'/images/vote-accepted-on.png'|media}}" + {% else %} + src="{{'/images/vote-accepted.png'|media}}" + {% endif %} + alt="{% trans question_author=question.author.username %}{{question_author}} has selected this answer as correct{% endtrans %}" + title="{% trans questsion_author=question.author.username%}{{question_author}} has selected this answer as correct{% endtrans %}" + {% endif %} + {% endif %} + </div> + </td> + <td> + <div class="item-right"> + <div class="answer-body"> + {{ answer.html }} + </div> + <div class="answer-controls post-controls"> + {% include "widgets/answer_controls.html" %} + </div> + <div class="post-update-info-container"> + {{ + macros.post_contributor_info( + answer, + "original_author", + answer.wiki, + settings.MIN_REP_TO_EDIT_WIKI + ) + }} + {{ + macros.post_contributor_info( + answer, + "last_updater", + answer.wiki, + settings.MIN_REP_TO_EDIT_WIKI + ) + }} + </div> + {{ + macros.post_comments_widget( + post = answer, + show_post = show_post, + show_comment = show_comment, + show_comment_position = show_comment_position, + user = request.user, + max_comments = settings.MAX_COMMENTS_TO_SHOW + ) + }} + </div> + </td> + </tr> + </table> +</div> diff --git a/askbot/skins/default/templates/question/answer_tab_bar.html b/askbot/skins/default/templates/question/answer_tab_bar.html new file mode 100644 index 00000000..227a9f81 --- /dev/null +++ b/askbot/skins/default/templates/question/answer_tab_bar.html @@ -0,0 +1,20 @@ +<div class="tabBar"> + <h2 id="sort-top"> + {% trans counter=answers|length %} + {{counter}} Answer: + {% pluralize %} + {{counter}} Answers: + {% endtrans %} + </h2> + <div class="tabsA"> + <a id="oldest" href="{{ question.get_absolute_url() }}?sort=oldest#sort-top" + title="{% trans %}oldest answers will be shown first{% endtrans %}" + ><span>{% trans %}oldest answers{% endtrans %}</span></a> + <a id="latest" href="{{ question.get_absolute_url() }}?sort=latest#sort-top" + title="{% trans %}newest answers will be shown first{% endtrans %}" + ><span>{% trans %}newest answers{% endtrans %}</span></a> + <a id="votes" href="{{ question.get_absolute_url() }}?sort=votes#sort-top" + title="{% trans %}most voted answers will be shown first{% endtrans %}" + ><span>{% trans %}popular answers{% endtrans %}</span></a> + </div> +</div> diff --git a/askbot/skins/default/templates/question/closed_question_info.html b/askbot/skins/default/templates/question/closed_question_info.html new file mode 100644 index 00000000..db4b10ee --- /dev/null +++ b/askbot/skins/default/templates/question/closed_question_info.html @@ -0,0 +1,5 @@ +<div class="question-status"> +<h3>{% trans close_reason=question.get_close_reason_display() %}The question has been closed for the following reason "{{ close_reason }}" by{% endtrans %} +<a href="{{ question.closed_by.get_profile_url() }}">{{ question.closed_by.username }}</a> +{% trans closed_at=question.closed_at %}close date {{closed_at}}{% endtrans %}</h3> +</div> diff --git a/askbot/skins/default/templates/question/content.html b/askbot/skins/default/templates/question/content.html index c849e3b6..6e16a808 100644 --- a/askbot/skins/default/templates/question/content.html +++ b/askbot/skins/default/templates/question/content.html @@ -1,197 +1,20 @@ {% import "macros/macros.html" as macros %} {% import "macros/utils_macros.html" as utils_macros %} <h1><a href="{{ question.get_absolute_url() }}">{{ question.get_question_title() }}</a></h1> -<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"> - {% include "widgets/question_vote_buttons.html"%} - {% include "widgets/share_buttons.html"%} - </div> - </td> - <td> - <div class="question-body"> - {{question.html}} - </div> - <ul id="question-tags" class="post-tags tags"> - {% for tag in question.get_tag_names() %} - {{ macros.tag_widget( - tag, - css_class = 'post-tag', - html_tag = 'li' - ) - }} - {% endfor %} - </ul> - <div id="question-controls" class="post-controls"> - {% include "widgets/question_controls.html" %} - </div> - <div class="post-update-info-container"> - {{ - macros.post_contributor_info( - question, - "original_author", - question.wiki, - settings.MIN_REP_TO_EDIT_WIKI - ) - }} - {{ - macros.post_contributor_info( - question, - "last_updater", - question.wiki, - settings.MIN_REP_TO_EDIT_WIKI, - ) - }} - </div> - {{ - macros.post_comments_widget( - post = question, - show_post = show_post, - show_comment = show_comment, - comment_order_number = comment_order_number, - user = request.user, - max_comments = settings.MAX_COMMENTS_TO_SHOW - ) - }} - <!--/div--> - </td> - </tr> -</table> +{% include "question/question_card.html" %} {% if question.closed %} -<div class="question-status" style="margin-bottom:15px"> -<h3>{% trans close_reason=question.get_close_reason_display() %}The question has been closed for the following reason "{{ close_reason }}" by{% endtrans %} -<a href="{{ question.closed_by.get_profile_url() }}">{{ question.closed_by.username }}</a> -{% trans closed_at=question.closed_at %}close date {{closed_at}}{% endtrans %}</h3> -</div> + {% include "question/closed_question_info.html" %} {% endif %} {% if answers %} - <div class="tabBar"> - <h2 id="sort-top"> - {% trans counter=answers|length %} - {{counter}} Answer: - {% pluralize %} - {{counter}} Answers: - {% endtrans %} - </h2> - <div class="tabsA"> - <a id="oldest" href="{{ question.get_absolute_url() }}?sort=oldest#sort-top" - title="{% trans %}oldest answers will be shown first{% endtrans %}" - ><span>{% trans %}oldest answers{% endtrans %}</span></a> - <a id="latest" href="{{ question.get_absolute_url() }}?sort=latest#sort-top" - title="{% trans %}newest answers will be shown first{% endtrans %}" - ><span>{% trans %}newest answers{% endtrans %}</span></a> - <a id="votes" href="{{ question.get_absolute_url() }}?sort=votes#sort-top" - title="{% trans %}most voted answers will be shown first{% endtrans %}" - ><span>{% trans %}popular answers{% endtrans %}</span></a> - </div> - </div> - {{ utils_macros.paginator(paginator_context) }} + {% include "question/answer_tab_bar.html" %} + {{ utils_macros.paginator(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 %} {% if answer.author_id==question.author_id %} answered-by-owner{% endif %} {% if answer.deleted %}deleted{% endif %}"> - <table style="width:100%;" class="answer-table"> - <tr> - <td style="width:30px;vertical-align:top"> - <div class="vote-buttons"> - <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote" - {% if user_answer_votes[answer.id] == 1 %} - src="{{'/images/vote-arrow-up-on.png'|media}}" - {% else %} - src="{{'/images/vote-arrow-up.png'|media}}" - {% endif %} - alt="{% trans %}i like this answer (click again to cancel){% endtrans %}" - title="{% trans %}i like this answer (click again to cancel){% endtrans %}"/> - <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans %}current number of votes{% endtrans %}"> - {{ answer.score }} - </div> - <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote" - {% if user_answer_votes[answer.id] == -1 %} - src="{{'/images/vote-arrow-down-on.png'|media}}" - {% else %} - src="{{'/images/vote-arrow-down.png'|media}}" - {% endif %} - alt="{% trans %}i dont like this answer (click again to cancel){% endtrans %}" - title="{% trans %}i dont like this answer (click again to cancel){% endtrans %}" /> - {% if request.user == question.author %} - <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" - {% if answer.accepted %} - src="{{'/images/vote-accepted-on.png'|media}}" - {% else %} - src="{{'/images/vote-accepted.png'|media}}" - {% endif %} - alt="{% trans %}mark this answer as favorite (click again to undo){% endtrans %}" - title="{% trans %}mark this answer as favorite (click again to undo){% endtrans %}" /> - {% else %} - {% if answer.accepted %} - <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" - {% if answer.accepted %} - src="{{'/images/vote-accepted-on.png'|media}}" - {% else %} - src="{{'/images/vote-accepted.png'|media}}" - {% endif %} - alt="{% trans question_author=question.author.username %}{{question_author}} has selected this answer as correct{% endtrans %}" - title="{% trans questsion_author=question.author.username%}{{question_author}} has selected this answer as correct{% endtrans %}" - {% endif %} - {% endif %} - </div> - </td> - <td> - <div class="item-right"> - <div class="answer-body"> - {{ answer.html }} - </div> - <div class="answer-controls post-controls"> - {% include "widgets/answer_controls.html" %} - </div> - <div class="post-update-info-container"> - {{ - macros.post_contributor_info( - answer, - "original_author", - answer.wiki, - settings.MIN_REP_TO_EDIT_WIKI - ) - }} - {{ - macros.post_contributor_info( - answer, - "last_updater", - answer.wiki, - settings.MIN_REP_TO_EDIT_WIKI - ) - }} - </div> - {{ - macros.post_comments_widget( - post = answer, - show_post = show_post, - show_comment = show_comment, - comment_order_number = comment_order_number, - user = request.user, - max_comments = settings.MAX_COMMENTS_TO_SHOW - ) - }} - </div> - </td> - </tr> - </table> - </div> + {% include "question/answer_card.html" %} {% endfor %} {{ utils_macros.paginator(paginator_context) }} {% else %} - {% set question_url=settings.APP_URL+question.get_absolute_url()|urlencode %} - <h2 class="share-question">{% trans %}Know someone who can answer? Share a <a href="{{ question_url }}">link</a> to this question via{% endtrans %} - {% if settings.ENABLE_SHARING_TWITTER %}{{ macros.share(site = 'twitter', site_label = 'Twitter') }},{% endif %} - {% if settings.ENABLE_SHARING_FACEBOOK %}{{ macros.share(site = 'facebook', site_label = 'Facebook') }},{% endif %} - {% if settings.ENABLE_SHARING_LINKEDIN %}{{ macros.share(site = 'linkedin', site_label = 'LinkedIn') }},{% endif %} - {% if settings.ENABLE_SHARING_IDENTICA %}{{ macros.share(site = 'identica', site_label = 'Identi.ca') }},{% endif %} - {%- if settings.ENABLE_SHARING_TWITTER or settings.ENABLE_SHARING_FACEBOOK or settings.ENABLE_SHARING_LINKEDIN or settings.ENABLE_SHARING_IDENTICA -%} - {% trans %} or{% endtrans %} - {% endif %} - <a href="mailto:?subject={{ settings.APP_SHORT_NAME|urlencode }}&body={{ question_url }}">{% trans %}email{% endtrans %}</a>. - </h2> + {% include "question/sharing_prompt_phrase.html" %} {% endif %} <form id="fmanswer" @@ -199,31 +22,8 @@ action="{% url answer question.id %}" method="post" >{% csrf_token %} - {% if request.user.is_authenticated() %} - <p style="padding-left:3px"> - {{ answer.email_notify }} - <label for="question-subscribe-updates"> - {% set email_feed_frequency = request.user.get_followed_question_alert_frequency() %} - {% if email_feed_frequency =='n' %} - {% trans %}Notify me once a day when there are any new answers{% endtrans %} - {% elif email_feed_frequency =='d' %} - {% trans %}Notify me once a day when there are any new answers{% endtrans %} - {% elif email_feed_frequency =='w' %} - {% trans %}Notify me weekly when there are any new answers{% endtrans %} - {% elif email_feed_frequency =='i' %} - {% trans %}Notify me immediately when there are any new answers{% endtrans %} - {% endif %} - </label> - {% trans profile_url=request.user.get_profile_url() %}You can always adjust frequency of email updates from your {{profile_url}}{% endtrans %} - </p> - {% else %} - <p style="padding-left:3px"> - {{ answer.email_notify }} - <label>{% trans %}once you sign in you will be able to subscribe for any updates here{% endtrans %}</label> - </p> - {% endif %} - <div style="clear:both"> - </div> + {% include "question/subscribe_by_email_prompt.html" %} + <div style="clear:both"></div> {% if request.user.is_anonymous() and settings.ALLOW_POSTING_BEFORE_LOGGING_IN == False %} {% if not question.closed %} <a @@ -233,47 +33,10 @@ {% endif %} {% else %} {% if not question.closed %} - <div style="padding:10px 0 0 0;"> - {% spaceless %} - <h2> - {% if answers %} - {% trans %}Your answer{% endtrans %} - {% else %} - {% trans %}Be the first one to answer this question!{% endtrans %} - {% endif %} - </h2> - {% endspaceless %} - </div> - {% if request.user.is_anonymous() %} - <div class="message">{% trans %}you can answer anonymously and then login{% endtrans %}</div> - {% else %} - <p class="message"> - {% if request.user==question.author %} - {% trans %}answer your own question only to give an answer{% endtrans %} - {% else %} - {% trans %}please only give an answer, no discussions{% endtrans %} - {% endif %} - </p> - {% endif %} - {{ macros.edit_post(answer) }} - <input type="submit" - {% if user.is_anonymous() %} - value="{% trans %}Login/Signup to Post Your Answer{% endtrans %}" - {% else %} - {% if user == question.author %} - value="{% trans %}Answer Your Own Question{% endtrans %}" - {% else %} - value="{% trans %}Answer the question{% endtrans %}" - {% endif %} - {% endif %} - class="submit after-editor" style="float:left"/> - {% if settings.WIKI_ON %} - {{ macros.checkbox_in_div(answer.wiki) }} - {% endif %} + {% include "question/new_answer_input.html" %} {% endif %} {% endif %} - </form> +</form> {% if request.user == question.author %} - <input type="button" class="submit after-editor" id="fmanswer_button" value="{% trans %}Answer Your Own Question{% endtrans %}"/> + <input type="button" class="submit after-editor" id="fmanswer_button" value="{% trans %}Answer Your Own Question{% endtrans %}"/> {%endif%} - diff --git a/askbot/skins/default/templates/question/new_answer_input.html b/askbot/skins/default/templates/question/new_answer_input.html new file mode 100644 index 00000000..da4be08a --- /dev/null +++ b/askbot/skins/default/templates/question/new_answer_input.html @@ -0,0 +1,37 @@ +<div> + {% spaceless %} + <h2> + {% if answers %} + {% trans %}Your answer{% endtrans %} + {% else %} + {% trans %}Be the first one to answer this question!{% endtrans %} + {% endif %} + </h2> + {% endspaceless %} +</div> +{% if request.user.is_anonymous() %} + <div class="message">{% trans %}you can answer anonymously and then login{% endtrans %}</div> +{% else %} + <p class="message"> + {% if request.user==question.author %} + {% trans %}answer your own question only to give an answer{% endtrans %} + {% else %} + {% trans %}please only give an answer, no discussions{% endtrans %} + {% endif %} + </p> +{% endif %} +{{ macros.edit_post(answer) }} +<input type="submit" + {% if user.is_anonymous() %} + value="{% trans %}Login/Signup to Post Your Answer{% endtrans %}" + {% else %} + {% if user == question.author %} + value="{% trans %}Answer Your Own Question{% endtrans %}" + {% else %} + value="{% trans %}Answer the question{% endtrans %}" + {% endif %} + {% endif %} + class="submit after-editor" style="float:left"/> +{% if settings.WIKI_ON %} + {{ macros.checkbox_in_div(answer.wiki) }} +{% endif %} diff --git a/askbot/skins/default/templates/question/question_card.html b/askbot/skins/default/templates/question/question_card.html new file mode 100644 index 00000000..337c9018 --- /dev/null +++ b/askbot/skins/default/templates/question/question_card.html @@ -0,0 +1,53 @@ +<table id="question-table" {% if question.deleted %}class="deleted"{%endif%}> + <tr> + <td> + <div class="vote-buttons"> + {% include "widgets/question_vote_buttons.html"%} + {% include "widgets/share_buttons.html"%} + </div> + </td> + <td> + <div class="question-body"> + {{question.html}} + </div> + {{ macros.tag_list_widget( + tags = question.get_tag_names(), + id = 'question-tags', + css_class = 'post-tags tags', + tag_css_class = 'post-tag', + ) + }} + <div id="question-controls" class="post-controls"> + {% include "widgets/question_controls.html" %} + </div> + <div class="post-update-info-container"> + {{ + macros.post_contributor_info( + question, + "original_author", + question.wiki, + settings.MIN_REP_TO_EDIT_WIKI + ) + }} + {{ + macros.post_contributor_info( + question, + "last_updater", + question.wiki, + settings.MIN_REP_TO_EDIT_WIKI, + ) + }} + </div> + {{ + macros.post_comments_widget( + post = question, + show_post = show_post, + show_comment = show_comment, + show_comment_position = show_comment_position, + user = request.user, + max_comments = settings.MAX_COMMENTS_TO_SHOW + ) + }} + </td> + </tr> +</table> diff --git a/askbot/skins/default/templates/question/sharing_prompt_phrase.html b/askbot/skins/default/templates/question/sharing_prompt_phrase.html new file mode 100644 index 00000000..f7bd20af --- /dev/null +++ b/askbot/skins/default/templates/question/sharing_prompt_phrase.html @@ -0,0 +1,11 @@ +{% set question_url=settings.APP_URL+question.get_absolute_url()|urlencode %} +<h2 class="share-question">{% trans %}Know someone who can answer? Share a <a href="{{ question_url }}">link</a> to this question via{% endtrans %} + {% if settings.ENABLE_SHARING_TWITTER %}{{ macros.share(site = 'twitter', site_label = 'Twitter') }},{% endif %} + {% if settings.ENABLE_SHARING_FACEBOOK %}{{ macros.share(site = 'facebook', site_label = 'Facebook') }},{% endif %} + {% if settings.ENABLE_SHARING_LINKEDIN %}{{ macros.share(site = 'linkedin', site_label = 'LinkedIn') }},{% endif %} + {% if settings.ENABLE_SHARING_IDENTICA %}{{ macros.share(site = 'identica', site_label = 'Identi.ca') }},{% endif %} + {%- if settings.ENABLE_SHARING_TWITTER or settings.ENABLE_SHARING_FACEBOOK or settings.ENABLE_SHARING_LINKEDIN or settings.ENABLE_SHARING_IDENTICA -%} + {% trans %} or{% endtrans %} + {% endif %} + <a href="mailto:?subject={{ settings.APP_SHORT_NAME|urlencode }}&body={{ question_url }}">{% trans %}email{% endtrans %}</a>. +</h2> diff --git a/askbot/skins/default/templates/question/sidebar.html b/askbot/skins/default/templates/question/sidebar.html index 16952c79..4b9de05d 100644 --- a/askbot/skins/default/templates/question/sidebar.html +++ b/askbot/skins/default/templates/question/sidebar.html @@ -1,7 +1,7 @@ {% import "macros/macros.html" as macros %} {{ settings.SIDEBAR_QUESTION_HEADER }} <div class="boxC vote-buttons"> - <h2 style="font-size: 22px;margin-top: 11px; text-align: left;">{% trans %}Question tools{% endtrans %}</h2> + <h2 id="questionTools">{% trans %}Question tools{% endtrans %}</h2> {% if favorited %} <a class="button followed" alt="{% trans %}click to unfollow this question{% endtrans %}"> @@ -94,5 +94,3 @@ {% endif %} {{ settings.SIDEBAR_QUESTION_FOOTER }} - - diff --git a/askbot/skins/default/templates/question/subscribe_by_email_prompt.html b/askbot/skins/default/templates/question/subscribe_by_email_prompt.html new file mode 100644 index 00000000..8b0b6853 --- /dev/null +++ b/askbot/skins/default/templates/question/subscribe_by_email_prompt.html @@ -0,0 +1,23 @@ +{% if request.user.is_authenticated() %} + <p> + {{ answer.email_notify }} + <label for="question-subscribe-updates"> + {% set email_feed_frequency = request.user.get_followed_question_alert_frequency() %} + {% if email_feed_frequency =='n' %} + {% trans %}Notify me once a day when there are any new answers{% endtrans %} + {% elif email_feed_frequency =='d' %} + {% trans %}Notify me once a day when there are any new answers{% endtrans %} + {% elif email_feed_frequency =='w' %} + {% trans %}Notify me weekly when there are any new answers{% endtrans %} + {% elif email_feed_frequency =='i' %} + {% trans %}Notify me immediately when there are any new answers{% endtrans %} + {% endif %} + </label> + {% trans profile_url=request.user.get_profile_url() %}You can always adjust frequency of email updates from your {{profile_url}}{% endtrans %} + </p> +{% else %} + <p> + {{ answer.email_notify }} + <label>{% trans %}once you sign in you will be able to subscribe for any updates here{% endtrans %}</label> + </p> +{% endif %} diff --git a/askbot/views/readers.py b/askbot/views/readers.py index 1739a4ef..0f479332 100644 --- a/askbot/views/readers.py +++ b/askbot/views/readers.py @@ -507,10 +507,10 @@ def question(request, id):#refactor - long subroutine. display question body, an filtered_answers.append(answer) #resolve page number and comment number for permalinks - comment_order_number = None + show_comment_position = None if show_comment: show_page = show_comment.get_page_number(answers = filtered_answers) - comment_order_number = show_comment.get_order_number() + show_comment_position = show_comment.get_order_number() elif show_answer: show_page = show_post.get_page_number(answers = filtered_answers) @@ -597,7 +597,7 @@ def question(request, id):#refactor - long subroutine. display question body, an 'paginator_context' : paginator_context, 'show_post': show_post, 'show_comment': show_comment, - 'comment_order_number': comment_order_number + 'show_comment_position': show_comment_position } return render_into_skin('question.html', data, request) |