forked from learningequality/ka-lite
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:jamalex/ka-lite into develop
- Loading branch information
Showing
50 changed files
with
1,084 additions
and
21 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 |
---|---|---|
|
@@ -19,4 +19,5 @@ build/ | |
virtualenv/ | ||
*.pid | ||
mergetomaster.sh | ||
videos/ | ||
videos/ | ||
content/* |
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
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
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
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
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,14 @@ | ||
{% extends base_template %} | ||
{% block faq_selected %}selected{% endblock faq_selected %} | ||
{% block basecss %} | ||
<style> | ||
.question { | ||
font-weight: bold; | ||
} | ||
|
||
#id-topics { | ||
margin-left: 25px; | ||
} | ||
</style> | ||
{% endblock basecss %} | ||
|
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,14 @@ | ||
{% extends "faq/base.html" %} | ||
|
||
{% block title %}{{ block.super }}: Question - {{ object.text|truncatewords:30}}{% endblock %} | ||
|
||
|
||
{% block content %}{{ block.super }} | ||
|
||
{{ object.text }} | ||
|
||
<br/> | ||
|
||
{{ object.answer }} | ||
|
||
{% 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% extends "faq/base.html" %} | ||
|
||
{% block title %}{{ block.super }}: Add Question{% endblock %} | ||
|
||
{% block content %}{{ block.super }} | ||
<h3>Submit Question</h3> | ||
<p> | ||
Use this form to submit a question (and optionally a corresponding answer) | ||
that you would like to see added to the FAQs on this site. | ||
</p> | ||
<form action="." method="POST"> | ||
{% csrf_token %} | ||
<table> | ||
{{ form.as_table }} | ||
</table> | ||
<input type="submit" value="Submit"/> | ||
</form> | ||
{% 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% extends "faq/base.html" %} | ||
|
||
{% block title %}{{ block.super }}: Thanks{% endblock %} | ||
{% block content %}{{ block.super }}<h3>Thanks!</h3>{% 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends "faq/base.html" %} | ||
|
||
{% block title %}{{ block.super }}: {{ topic }}{% endblock %} | ||
|
||
{% block content %}{{ block.super }} | ||
<h3>Frequently Asked Questions: {{ topic }}</h3> | ||
<dl> | ||
{% for question in questions %} | ||
<dt class="question">{{ question.text }}</dt> | ||
<dd class="answer">{{ question.answer }}</dd> | ||
{% endfor %} | ||
</dl> | ||
</br> | ||
<a href="{% url faq_topic_list %}">Back to topic list...</a> | ||
{% 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends "faq/base.html" %} | ||
|
||
{% block title %}{{ block.super }}Frequently Asked Questions: Topics{% endblock %} | ||
|
||
{% block content %}{{ block.super }} | ||
<h1>Frequently Asked Questions</h1> | ||
<div id="id-topics"> | ||
<h2>Topics</h2> | ||
<ul> | ||
{% for topic in topics %} | ||
<li><a href="{{ topic.get_absolute_url }}">{{ topic }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% 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
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
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 +1 @@ | ||
VERSION = "0.8.6" | ||
VERSION = "0.8.7" |
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,27 @@ | ||
Copyright (c) 2011 Kevin Fricovsky and contributors. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of this project nor the names of its contributors may | ||
be used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Empty file.
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,21 @@ | ||
""" | ||
Test support harness to make setup.py test work. | ||
""" | ||
|
||
import sys | ||
|
||
from django.conf import settings | ||
settings.configure( | ||
DATABASES = { | ||
'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory;'} | ||
}, | ||
INSTALLED_APPS = ['django.contrib.auth', 'django.contrib.contenttypes', 'faq'], | ||
ROOT_URLCONF = 'faq.urls', | ||
) | ||
|
||
def runtests(): | ||
import django.test.utils | ||
runner_class = django.test.utils.get_runner(settings) | ||
test_runner = runner_class(verbosity=1, interactive=True) | ||
failures = test_runner.run_tests(['faq']) | ||
sys.exit(failures) |
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,30 @@ | ||
from django.contrib import admin | ||
from models import Question, Topic | ||
|
||
class TopicAdmin(admin.ModelAdmin): | ||
prepopulated_fields = {'slug':('name',)} | ||
|
||
class QuestionAdmin(admin.ModelAdmin): | ||
list_display = ['text', 'sort_order', 'created_by', 'created_on', | ||
'updated_by', 'updated_on', 'status'] | ||
list_editable = ['sort_order', 'status'] | ||
|
||
def save_model(self, request, obj, form, change): | ||
''' | ||
Update created-by / modified-by fields. | ||
The date fields are upadated at the model layer, but that's not got | ||
access to the user. | ||
''' | ||
# If the object's new update the created_by field. | ||
if not change: | ||
obj.created_by = request.user | ||
|
||
# Either way update the updated_by field. | ||
obj.updated_by = request.user | ||
|
||
# Let the superclass do the final saving. | ||
return super(QuestionAdmin, self).save_model(request, obj, form, change) | ||
|
||
admin.site.register(Question, QuestionAdmin) | ||
admin.site.register(Topic, TopicAdmin) |
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 @@ | ||
faq |
Oops, something went wrong.