This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented questions template (bug 565367)
- Loading branch information
Showing
22 changed files
with
662 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# The number of answers per page. | ||
ANSWERS_PER_PAGE = 20 | ||
|
||
# The number of questions per page. | ||
QUESTIONS_PER_PAGE = 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{# vim: set ts=2 et sts=2 sw=2: #} | ||
{% extends "layout/base.html" %} | ||
{% set styles = ('questions',) %} | ||
{% set scripts = ('questions',) %} | ||
|
||
{% block content_area %} | ||
|
||
<div id="main-hdr"> | ||
<hgroup> | ||
<h1><a href="{{ url('questions.questions', forum_slug=forum.slug) }}">{{ _('Firefox Support Forum') }}</a></h1> | ||
<h2>{{ _('The Official Community-Driven Support Web Site for Firefox') }}</h2> | ||
</hgroup> | ||
|
||
<div id="support-search" role="search"> | ||
<form action="#{# TODO #}" method="get"> | ||
<div class="wrap"> | ||
<input type="text" class="text" name="q" placeholder="{{ _('Search Mozilla Support') }}" required="required" /> | ||
</div> | ||
<noscript> | ||
<input type="submit" class="submit" value="{{ _('Search') }}" /> | ||
</noscript> | ||
</form> | ||
</div> | ||
|
||
<div id="greeting"> | ||
{% if user.is_authenticated() %} | ||
{{ _('Welcome, <span class="user">{user}</span>.')|fe(user=user) }} | ||
<nav> | ||
<a href="{{ profile_url(user) }}">{{ _('Profile') }}</a> | ||
• | ||
<a href="{{ settings.LOGOUT_URL }}">{{ _('Sign Out') }}</a> | ||
</nav> | ||
{% else %} | ||
<p> | ||
{% trans login_url=settings.LOGIN_URL, register_url=settings.REGISTER_URL %} | ||
Want to contribute? <a href="{{ login_url }}">Sign In</a> or <a href="{{ register_url }}">Register</a> | ||
{% endtrans %} | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
{% block filter %} | ||
{% endblock %} | ||
|
||
<div id="main-content"> | ||
{% block content %} | ||
{% endblock %} | ||
</div> | ||
|
||
<div id="main-sd"> | ||
{% block side %} | ||
<div class="sd-module" id="ask-question"> | ||
<h3>{{ _("Can't Find an Answer?") }}</h3> | ||
<p>{{ _('Post your question to the support forum. The Firefox community is here to help!') }}</p> | ||
<div class="ask-question"> | ||
<a href="{{ url('questions.new_question', forum_slug=forum.slug) }}"> | ||
<span class="q">?</span> | ||
{{ _('Ask a Question') }} | ||
</a> | ||
</div> | ||
</div> | ||
<div class="sd-module" id="top-contributors"> | ||
<h3>{{ _('Top Contributors') }}</h3> | ||
<h4>{{ _('Most Solutions this Week') }}</h4> | ||
<ol> | ||
{# TODO #} | ||
<li>Lorem Ipsum</li> | ||
<li>Dolor sit Amet</li> | ||
<li>Consectetur Adipisicing</li> | ||
<li>Sed do Eiusmod</li> | ||
<li>Tempor Incididunt</li> | ||
<li>Labore Dolore</li> | ||
<li>Magna Aliqua</li> | ||
<li>Enim Minim</li> | ||
<li>Veniam Nostrud</li> | ||
<li>Exercitation Ullamco</li> | ||
</ol> | ||
</div> | ||
{% endblock %} | ||
</div> | ||
|
||
{% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
{% endblock %} | ||
|
||
{% block sidebar %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,152 @@ | ||
{# vim: set ts=2 et sts=2 sw=2: #} | ||
{% extends "common/base.html" %} | ||
{% extends "questions/base.html" %} | ||
{% set title = _('{f} | Questions')|f(f=forum.name) %} | ||
{% set crumbs = [(url('questions.question_forums'), _('Questions')), | ||
(None, forum.name)] %} | ||
{% set classes = 'questions' %} | ||
|
||
{% block filter %} | ||
<div id="filter"> | ||
<label>{{ _('Posts:') }}</label> | ||
<ul> | ||
{% if user.is_authenticated() %} | ||
<li> | ||
<a href="#{# TODO #}">{{ _('My Contributions') }}</a> | ||
</li> | ||
{% endif %} | ||
<li> | ||
<a href="#{# TODO #}">{{ _('Most Recent') }}</a> | ||
</li> | ||
<li class="active {# TODO: conditional logic #}"> | ||
<a href="#{# TODO #}">{{ _('Most Requested') }}</a> | ||
</li> | ||
<li> | ||
<a href="#{# TODO #}">{{ _('Unsolved') }}</a> | ||
</li> | ||
<li> | ||
<a href="#{# TODO #}">{{ _('Solved') }}</a> | ||
</li> | ||
<li> | ||
<a href="#{# TODO #}">{{ _('No Replies') }}</a> | ||
</li> | ||
</ul> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<h2>{{ forum.name }}</h2> | ||
|
||
{% if threads %} | ||
<ul> | ||
{% for question in questions %} | ||
<li><a href="{{ url('questions.answers', forum_slug=forum.slug, question_id=question.id) }}">{{ question.title }}</a><br/> | ||
Answers: {{ question.answers }} | Last answer by {{ question.last_answer.creator.username }}</li> | ||
{% if questions.object_list %} | ||
<ol class="questions"> | ||
{% for question in questions.object_list %} | ||
<li> | ||
<div class="people just-one {# possible classes are: just-one (==1), less-ten (<10), more-ten (>=10) #}"> | ||
{% trans %}{# TODO #}<strong>1 person</strong> <span>has this problem</span>{% endtrans %} | ||
</div> | ||
<div class="title"> | ||
<h2><a href="{{ url('questions.answers', forum_slug=forum.slug, question_id=question.id) }}">{{ question.title }}</a></h2> | ||
</div> | ||
<div class="asked-by"> | ||
{% trans creator=question.creator%}Asked by <span class="user">{{ creator }}</span>{% endtrans %} | ||
<time>{{ datetimeformat(question.created, format='longdatetime') }}</time> | ||
</div> | ||
<p>{{ question.content|striptags()|truncate(170) }}</p> | ||
<div class="meta"> | ||
<span>{# TODO #}Firefox Mobile 1.0</span> | ||
• | ||
<span>{# TODO #}Mac OS X 10.6</span> | ||
• | ||
<span>{{ _('Tagged') }} {# TODO #}lorem, ipsum, dolor, sit amet</span> | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
|
||
{# Some extra static questions with different variations #} | ||
<li> | ||
<div class="people less-ten"> | ||
{% trans %}{# TODO #}<strong>9 people</strong> <span>have this problem</span>{% endtrans %} | ||
</div> | ||
<div class="title"> | ||
<h2><a href="#">Lorem ipsum dolor sit amet, conectetur adipisicing elit, sed do eiusmod tempor</a></h2> | ||
<span class="badge replies">12 replies</span> | ||
</div> | ||
<div class="asked-by"> | ||
Asked by <span class="user">Noob</span> | ||
<time>today at 10:41am</time> | ||
</div> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation...</p> | ||
<div class="meta"> | ||
<span>Firefox Mobile 1.0</span> | ||
• | ||
<span>Mac OS X 10.6</span> | ||
• | ||
<span>{{ _('Tagged') }} lorem, ipsum, dolor, sit amet</span> | ||
</div> | ||
</li> | ||
<li> | ||
<div class="people more-ten"> | ||
{% trans %}{# TODO #}<strong>25 people</strong> <span>have this problem</span>{% endtrans %} | ||
</div> | ||
<div class="title"> | ||
<h2><a href="#">Lorem ipsum dolor sit amet, conectetur adipisicing elit, sed do eiusmod tempor</a></h2> | ||
<span class="badge solutions">3 solutions</span> | ||
</div> | ||
<div class="asked-by"> | ||
Asked by <span class="user">Noob</span> | ||
<time>today at 10:41am</time> | ||
</div> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation...</p> | ||
<div class="meta"> | ||
<span>Firefox Mobile 1.0</span> | ||
• | ||
<span>Mac OS X 10.6</span> | ||
• | ||
<span>{{ _('Tagged') }} lorem, ipsum, dolor, sit amet</span> | ||
</div> | ||
</li> | ||
<li> | ||
<div class="people more-ten"> | ||
{% trans %}{# TODO #}<strong>35 people</strong> <span>have this problem</span>{% endtrans %} | ||
</div> | ||
<div class="title"> | ||
<h2><a href="#">Lorem ipsum dolor sit amet, conectetur adipisicing elit, sed do eiusmod tempor</a></h2> | ||
<span class="badge solved">solved</span> | ||
</div> | ||
<div class="asked-by"> | ||
Asked by <span class="user">Noob</span> | ||
<time>today at 10:41am</time> | ||
</div> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation...</p> | ||
<div class="meta"> | ||
<span>Firefox Mobile 1.0</span> | ||
• | ||
<span>Mac OS X 10.6</span> | ||
• | ||
<span>{{ _('Tagged') }} lorem, ipsum, dolor, sit amet</span> | ||
</div> | ||
</li> | ||
<li> | ||
<div class="people more-ten"> | ||
{% trans %}{# TODO #}<strong>35 people</strong> <span>have this problem</span>{% endtrans %} | ||
</div> | ||
<div class="title"> | ||
<h2><a href="#">Lorem ipsum dolor sit amet, conectetur adipisicing elit, sed do eiusmod tempor</a></h2> | ||
<span class="badge contributed">contributed</span> | ||
</div> | ||
<div class="asked-by"> | ||
Asked by <span class="user">Noob</span> | ||
<time>today at 10:41am</time> | ||
</div> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation...</p> | ||
<div class="meta"> | ||
<span>Firefox Mobile 1.0</span> | ||
• | ||
<span>Mac OS X 10.6</span> | ||
• | ||
<span>{{ _('Tagged') }} lorem, ipsum, dolor, sit amet</span> | ||
</div> | ||
</li> | ||
</ol> | ||
{{ questions|paginator }} | ||
{% else %} | ||
{# Not localized because it's not worth localizers time. #} | ||
<p>There are no questions. Maybe you should ask some!</p> | ||
{% endif %} | ||
{% endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.