Merge branch 'master' into kimth/xqueue_callback_blocking
63
common/lib/mitxmako/mitxmako/makoloader.py
Normal file
@@ -0,0 +1,63 @@
|
||||
|
||||
from django.template.base import TemplateDoesNotExist
|
||||
from django.template.loader import make_origin, get_template_from_string
|
||||
from django.template.loaders.filesystem import Loader as FilesystemLoader
|
||||
from django.template.loaders.app_directories import Loader as AppDirectoriesLoader
|
||||
|
||||
from mitxmako.template import Template
|
||||
|
||||
class MakoLoader(object):
|
||||
"""
|
||||
This is a Django loader object which will load the template as a
|
||||
Mako template if the first line is "## mako". It is based off BaseLoader
|
||||
in django.template.loader.
|
||||
"""
|
||||
|
||||
is_usable = False
|
||||
|
||||
def __init__(self, base_loader):
|
||||
# base_loader is an instance of a BaseLoader subclass
|
||||
self.base_loader = base_loader
|
||||
|
||||
def __call__(self, template_name, template_dirs=None):
|
||||
return self.load_template(template_name, template_dirs)
|
||||
|
||||
def load_template(self, template_name, template_dirs=None):
|
||||
source, display_name = self.load_template_source(template_name, template_dirs)
|
||||
|
||||
if source.startswith("## mako\n"):
|
||||
# This is a mako template
|
||||
template = Template(text=source, uri=template_name)
|
||||
return template, None
|
||||
else:
|
||||
# This is a regular template
|
||||
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
|
||||
try:
|
||||
template = get_template_from_string(source, origin, template_name)
|
||||
return template, None
|
||||
except TemplateDoesNotExist:
|
||||
# If compiling the template we found raises TemplateDoesNotExist, back off to
|
||||
# returning the source and display name for the template we were asked to load.
|
||||
# This allows for correct identification (later) of the actual template that does
|
||||
# not exist.
|
||||
return source, display_name
|
||||
|
||||
def load_template_source(self, template_name, template_dirs=None):
|
||||
# Just having this makes the template load as an instance, instead of a class.
|
||||
return self.base_loader.load_template_source(template_name, template_dirs)
|
||||
|
||||
def reset(self):
|
||||
self.base_loader.reset()
|
||||
|
||||
|
||||
class MakoFilesystemLoader(MakoLoader):
|
||||
is_usable = True
|
||||
|
||||
def __init__(self):
|
||||
MakoLoader.__init__(self, FilesystemLoader())
|
||||
|
||||
class MakoAppDirectoriesLoader(MakoLoader):
|
||||
is_usable = True
|
||||
|
||||
def __init__(self):
|
||||
MakoLoader.__init__(self, AppDirectoriesLoader())
|
||||
@@ -12,18 +12,48 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from django.conf import settings
|
||||
from mako.template import Template as MakoTemplate
|
||||
|
||||
from . import middleware
|
||||
from mitxmako import middleware
|
||||
|
||||
django_variables = ['lookup', 'template_dirs', 'output_encoding',
|
||||
django_variables = ['lookup', 'output_encoding',
|
||||
'module_directory', 'encoding_errors']
|
||||
|
||||
|
||||
# TODO: We should make this a Django Template subclass that simply has the MakoTemplate inside of it? (Intead of inheriting from MakoTemplate)
|
||||
class Template(MakoTemplate):
|
||||
"""
|
||||
This bridges the gap between a Mako template and a djano template. It can
|
||||
be rendered like it is a django template because the arguments are transformed
|
||||
in a way that MakoTemplate can understand.
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Overrides base __init__ to provide django variable overrides"""
|
||||
if not kwargs.get('no_django', False):
|
||||
overrides = dict([(k, getattr(middleware, k, None),) for k in django_variables])
|
||||
overrides['lookup'] = overrides['lookup']['main']
|
||||
kwargs.update(overrides)
|
||||
super(Template, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
def render(self, context_instance):
|
||||
"""
|
||||
This takes a render call with a context (from Django) and translates
|
||||
it to a render call on the mako template.
|
||||
"""
|
||||
# collapse context_instance to a single dictionary for mako
|
||||
context_dictionary = {}
|
||||
|
||||
# In various testing contexts, there might not be a current request context.
|
||||
if middleware.requestcontext is not None:
|
||||
for d in middleware.requestcontext:
|
||||
context_dictionary.update(d)
|
||||
for d in context_instance:
|
||||
context_dictionary.update(d)
|
||||
context_dictionary['settings'] = settings
|
||||
context_dictionary['MITX_ROOT_URL'] = settings.MITX_ROOT_URL
|
||||
context_dictionary['django_context'] = context_instance
|
||||
|
||||
return super(Template, self).render(**context_dictionary)
|
||||
|
||||
|
||||
53
common/lib/mitxmako/mitxmako/templatetag_helpers.py
Normal file
@@ -0,0 +1,53 @@
|
||||
from django.template import loader
|
||||
from django.template.base import Template, Context
|
||||
from django.template.loader import get_template, select_template
|
||||
|
||||
def django_template_include(file_name, mako_context):
|
||||
"""
|
||||
This can be used within a mako template to include a django template
|
||||
in the way that a django-style {% include %} does. Pass it context
|
||||
which can be the mako context ('context') or a dictionary.
|
||||
"""
|
||||
|
||||
dictionary = dict( mako_context )
|
||||
return loader.render_to_string(file_name, dictionary=dictionary)
|
||||
|
||||
|
||||
def render_inclusion(func, file_name, takes_context, django_context, *args, **kwargs):
|
||||
"""
|
||||
This allows a mako template to call a template tag function (written
|
||||
for django templates) that is an "inclusion tag". These functions are
|
||||
decorated with @register.inclusion_tag.
|
||||
|
||||
-func: This is the function that is registered as an inclusion tag.
|
||||
You must import it directly using a python import statement.
|
||||
-file_name: This is the filename of the template, passed into the
|
||||
@register.inclusion_tag statement.
|
||||
-takes_context: This is a parameter of the @register.inclusion_tag.
|
||||
-django_context: This is an instance of the django context. If this
|
||||
is a mako template rendered through the regular django rendering calls,
|
||||
a copy of the django context is available as 'django_context'.
|
||||
-*args and **kwargs are the arguments to func.
|
||||
"""
|
||||
|
||||
if takes_context:
|
||||
args = [django_context] + list(args)
|
||||
|
||||
_dict = func(*args, **kwargs)
|
||||
if isinstance(file_name, Template):
|
||||
t = file_name
|
||||
elif not isinstance(file_name, basestring) and is_iterable(file_name):
|
||||
t = select_template(file_name)
|
||||
else:
|
||||
t = get_template(file_name)
|
||||
|
||||
nodelist = t.nodelist
|
||||
|
||||
new_context = Context(_dict)
|
||||
csrf_token = django_context.get('csrf_token', None)
|
||||
if csrf_token is not None:
|
||||
new_context['csrf_token'] = csrf_token
|
||||
|
||||
return nodelist.render(new_context)
|
||||
|
||||
|
||||
@@ -376,14 +376,17 @@ class CapaModule(XModule):
|
||||
'''
|
||||
For the "show answer" button.
|
||||
|
||||
TODO: show answer events should be logged here, not just in the problem.js
|
||||
|
||||
Returns the answers: {'answers' : answers}
|
||||
'''
|
||||
event_info = dict()
|
||||
event_info['problem_id'] = self.location.url()
|
||||
self.system.track_function('show_answer', event_info)
|
||||
if not self.answer_available():
|
||||
raise NotFoundError('Answer is not available')
|
||||
else:
|
||||
answers = self.lcp.get_question_answers()
|
||||
# answers (eg <solution>) may have embedded images
|
||||
answers = dict( (k,self.system.replace_urls(answers[k], self.metadata['data_dir'])) for k in answers )
|
||||
return {'answers': answers}
|
||||
|
||||
# Figure out if we should move these to capa_problem?
|
||||
|
||||
@@ -147,7 +147,7 @@ class CourseDescriptor(SequenceDescriptor):
|
||||
return self.location.course
|
||||
|
||||
@property
|
||||
def wiki_namespace(self):
|
||||
def wiki_slug(self):
|
||||
return self.location.course
|
||||
|
||||
@property
|
||||
|
||||
BIN
common/static/images/search-icon.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
common/static/images/wiki-icons.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
@@ -66,3 +66,9 @@ To run a single nose test:
|
||||
|
||||
|
||||
Very handy: if you uncomment the `--pdb` argument in `NOSE_ARGS` in `lms/envs/test.py`, it will drop you into pdb on error. This lets you go up and down the stack and see what the values of the variables are. Check out http://docs.python.org/library/pdb.html
|
||||
|
||||
## Content development
|
||||
|
||||
If you change course content, while running the LMS in dev mode, it is unnecessary to restart to refresh the modulestore.
|
||||
|
||||
Instead, hit /migrate/modules to see a list of all modules loaded, and click on links (eg /migrate/reload/edx4edx) to reload a course.
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
{% spaceless %}
|
||||
<span class="action-link">
|
||||
<a class="question-delete" id="answer-delete-link-{{answer.id}}">
|
||||
{% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}✖{% endif %}</a>
|
||||
{% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}delete{% endif %}</a>
|
||||
</span>
|
||||
{% endspaceless %}
|
||||
{% endif %}
|
||||
|
||||
@@ -40,6 +40,5 @@
|
||||
{% endif %}
|
||||
|
||||
{% if request.user|can_delete_post(question) %}{{ pipe() }}
|
||||
<a class="question-delete" id="question-delete-link-{{question.id}}">{% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}✖{% endif %}</a>
|
||||
|
||||
<a class="question-delete" id="question-delete-link-{{question.id}}">{% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}delete{% endif %}</a>
|
||||
{% endif %}
|
||||
|
||||
@@ -18,11 +18,14 @@
|
||||
{% include "widgets/system_messages.html" %}
|
||||
{% include "debug_header.html" %}
|
||||
{% include "widgets/header.html" %} {# Logo, user tool navigation and meta navitation #}
|
||||
{# include "widgets/secondary_header.html" #} {# Scope selector, search input and ask button #}
|
||||
|
||||
<section class="container">
|
||||
<section class="content-wrapper">
|
||||
{# include "widgets/secondary_header.html" #} {# Scope selector, search input and ask button #}
|
||||
|
||||
<section class="container">
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
</section>
|
||||
</section>
|
||||
|
||||
{% if settings.FOOTER_MODE == 'default' %}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{% load extra_filters_jinja %}
|
||||
<!--<link href="{{"/style/style.css"|media }}" rel="stylesheet" type="text/css" />-->
|
||||
{{ 'application' | compressed_css }}
|
||||
{{ 'course' | compressed_css }}
|
||||
|
||||
0
lms/djangoapps/course_wiki/__init__.py
Normal file
146
lms/djangoapps/course_wiki/course_nav.py
Normal file
@@ -0,0 +1,146 @@
|
||||
import re
|
||||
from urlparse import urlparse
|
||||
|
||||
from django.http import Http404
|
||||
from django.shortcuts import redirect
|
||||
|
||||
from wiki.models import reverse as wiki_reverse
|
||||
from courseware.courses import get_course_with_access
|
||||
|
||||
|
||||
IN_COURSE_WIKI_REGEX = r'/courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/wiki/(?P<wiki_path>.*|)$'
|
||||
|
||||
class Middleware(object):
|
||||
"""
|
||||
This middleware is to keep the course nav bar above the wiki while
|
||||
the student clicks around to other wiki pages.
|
||||
If it intercepts a request for /wiki/.. that has a referrer in the
|
||||
form /courses/course_id/... it will redirect the user to the page
|
||||
/courses/course_id/wiki/...
|
||||
|
||||
It is also possible that someone followed a link leading to a course
|
||||
that they don't have access to. In this case, we redirect them to the
|
||||
same page on the regular wiki.
|
||||
|
||||
If we return a redirect, this middleware makes sure that the redirect
|
||||
keeps the student in the course.
|
||||
|
||||
Finally, if the student is in the course viewing a wiki, we change the
|
||||
reverse() function to resolve wiki urls as a course wiki url by setting
|
||||
the _transform_url attribute on wiki.models.reverse.
|
||||
|
||||
Forgive me Father, for I have hacked.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.redirected = False
|
||||
|
||||
def process_request(self, request):
|
||||
self.redirected = False
|
||||
wiki_reverse._transform_url = lambda url: url
|
||||
|
||||
referer = request.META.get('HTTP_REFERER')
|
||||
destination = request.path
|
||||
|
||||
|
||||
if request.method == 'GET':
|
||||
new_destination = self.get_redirected_url(request.user, referer, destination)
|
||||
|
||||
if new_destination != destination:
|
||||
# We mark that we generated this redirection, so we don't modify it again
|
||||
self.redirected = True
|
||||
return redirect(new_destination)
|
||||
|
||||
course_match = re.match(IN_COURSE_WIKI_REGEX, destination)
|
||||
if course_match:
|
||||
course_id = course_match.group('course_id')
|
||||
prepend_string = '/courses/' + course_match.group('course_id')
|
||||
wiki_reverse._transform_url = lambda url: prepend_string + url
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def process_response(self, request, response):
|
||||
"""
|
||||
If this is a redirect response going to /wiki/*, then we might need
|
||||
to change it to be a redirect going to /courses/*/wiki*.
|
||||
"""
|
||||
if not self.redirected and response.status_code == 302: #This is a redirect
|
||||
referer = request.META.get('HTTP_REFERER')
|
||||
destination_url = response['LOCATION']
|
||||
destination = urlparse(destination_url).path
|
||||
|
||||
new_destination = self.get_redirected_url(request.user, referer, destination)
|
||||
|
||||
if new_destination != destination:
|
||||
new_url = destination_url.replace(destination, new_destination)
|
||||
response['LOCATION'] = new_url
|
||||
|
||||
return response
|
||||
|
||||
|
||||
def get_redirected_url(self, user, referer, destination):
|
||||
"""
|
||||
Returns None if the destination shouldn't be changed.
|
||||
"""
|
||||
if not referer:
|
||||
return destination
|
||||
referer_path = urlparse(referer).path
|
||||
|
||||
path_match = re.match(r'^/wiki/(?P<wiki_path>.*|)$', destination)
|
||||
if path_match:
|
||||
# We are going to the wiki. Check if we came from a course
|
||||
course_match = re.match(r'/courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/.*', referer_path)
|
||||
if course_match:
|
||||
course_id = course_match.group('course_id')
|
||||
|
||||
# See if we are able to view the course. If we are, redirect to it
|
||||
try:
|
||||
course = get_course_with_access(user, course_id, 'load')
|
||||
return "/courses/" + course.id + "/wiki/" + path_match.group('wiki_path')
|
||||
except Http404:
|
||||
# Even though we came from the course, we can't see it. So don't worry about it.
|
||||
pass
|
||||
|
||||
else:
|
||||
# It is also possible we are going to a course wiki view, but we
|
||||
# don't have permission to see the course!
|
||||
course_match = re.match(IN_COURSE_WIKI_REGEX, destination)
|
||||
if course_match:
|
||||
course_id = course_match.group('course_id')
|
||||
# See if we are able to view the course. If we aren't, redirect to regular wiki
|
||||
try:
|
||||
course = get_course_with_access(user, course_id, 'load')
|
||||
# Good, we can see the course. Carry on
|
||||
return destination
|
||||
except Http404:
|
||||
# We can't see the course, so redirect to the regular wiki
|
||||
return "/wiki/" + course_match.group('wiki_path')
|
||||
|
||||
return destination
|
||||
|
||||
|
||||
def context_processor(request):
|
||||
"""
|
||||
This is a context processor which looks at the URL while we are
|
||||
in the wiki. If the url is in the form
|
||||
/courses/(course_id)/wiki/...
|
||||
then we add 'course' to the context. This allows the course nav
|
||||
bar to be shown.
|
||||
"""
|
||||
|
||||
match = re.match(IN_COURSE_WIKI_REGEX, request.path)
|
||||
if match:
|
||||
course_id = match.group('course_id')
|
||||
|
||||
try:
|
||||
course = get_course_with_access(request.user, course_id, 'load')
|
||||
return {'course' : course}
|
||||
except Http404:
|
||||
# We couldn't access the course for whatever reason. It is too late to change
|
||||
# the URL here, so we just leave the course context. The middleware shouldn't
|
||||
# let this happen
|
||||
pass
|
||||
|
||||
return {}
|
||||
|
||||
1
lms/djangoapps/course_wiki/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
119
lms/djangoapps/course_wiki/tests/tests.py
Normal file
@@ -0,0 +1,119 @@
|
||||
from django.core.urlresolvers import reverse
|
||||
from override_settings import override_settings
|
||||
|
||||
import xmodule.modulestore.django
|
||||
|
||||
from courseware.tests.tests import PageLoader, TEST_DATA_XML_MODULESTORE
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.xml_importer import import_from_xml
|
||||
|
||||
|
||||
@override_settings(MODULESTORE=TEST_DATA_XML_MODULESTORE)
|
||||
class WikiRedirectTestCase(PageLoader):
|
||||
def setUp(self):
|
||||
xmodule.modulestore.django._MODULESTORES = {}
|
||||
courses = modulestore().get_courses()
|
||||
|
||||
def find_course(name):
|
||||
"""Assumes the course is present"""
|
||||
return [c for c in courses if c.location.course==name][0]
|
||||
|
||||
self.full = find_course("full")
|
||||
self.toy = find_course("toy")
|
||||
|
||||
# Create two accounts
|
||||
self.student = 'view@test.com'
|
||||
self.instructor = 'view2@test.com'
|
||||
self.password = 'foo'
|
||||
self.create_account('u1', self.student, self.password)
|
||||
self.create_account('u2', self.instructor, self.password)
|
||||
self.activate_user(self.student)
|
||||
self.activate_user(self.instructor)
|
||||
|
||||
|
||||
|
||||
def test_wiki_redirect(self):
|
||||
"""
|
||||
Test that requesting wiki URLs redirect properly to or out of classes.
|
||||
|
||||
An enrolled in student going from /courses/edX/toy/2012_Fall/profile
|
||||
to /wiki/some/fake/wiki/page/ will redirect to
|
||||
/courses/edX/toy/2012_Fall/wiki/some/fake/wiki/page/
|
||||
|
||||
An unenrolled student going to /courses/edX/toy/2012_Fall/wiki/some/fake/wiki/page/
|
||||
will be redirected to /wiki/some/fake/wiki/page/
|
||||
|
||||
"""
|
||||
self.login(self.student, self.password)
|
||||
|
||||
self.enroll(self.toy)
|
||||
|
||||
referer = reverse("profile", kwargs={ 'course_id' : self.toy.id })
|
||||
destination = reverse("wiki:get", kwargs={'path': 'some/fake/wiki/page/'})
|
||||
|
||||
redirected_to = referer.replace("profile", "wiki/some/fake/wiki/page/")
|
||||
|
||||
resp = self.client.get( destination, HTTP_REFERER=referer)
|
||||
self.assertEqual(resp.status_code, 302 )
|
||||
|
||||
self.assertEqual(resp['Location'], 'http://testserver' + redirected_to )
|
||||
|
||||
|
||||
# Now we test that the student will be redirected away from that page if the course doesn't exist
|
||||
# We do this in the same test because we want to make sure the redirected_to is constructed correctly
|
||||
|
||||
# This is a location like /courses/*/wiki/* , but with an invalid course ID
|
||||
bad_course_wiki_page = redirected_to.replace( self.toy.location.course, "bad_course" )
|
||||
|
||||
resp = self.client.get( bad_course_wiki_page, HTTP_REFERER=referer)
|
||||
self.assertEqual(resp.status_code, 302)
|
||||
self.assertEqual(resp['Location'], 'http://testserver' + destination )
|
||||
|
||||
|
||||
def create_course_page(self, course):
|
||||
"""
|
||||
Test that loading the course wiki page creates the wiki page.
|
||||
The user must be enrolled in the course to see the page.
|
||||
"""
|
||||
|
||||
course_wiki_home = reverse('course_wiki', kwargs={'course_id' : course.id})
|
||||
referer = reverse("profile", kwargs={ 'course_id' : self.toy.id })
|
||||
|
||||
resp = self.client.get(course_wiki_home, follow=True, HTTP_REFERER=referer)
|
||||
|
||||
course_wiki_page = referer.replace('profile', 'wiki/' + self.toy.wiki_slug + "/")
|
||||
|
||||
ending_location = resp.redirect_chain[-1][0]
|
||||
ending_status = resp.redirect_chain[-1][1]
|
||||
|
||||
self.assertEquals(ending_location, 'http://testserver' + course_wiki_page )
|
||||
self.assertEquals(resp.status_code, 200)
|
||||
|
||||
self.has_course_navigator(resp)
|
||||
|
||||
def has_course_navigator(self, resp):
|
||||
"""
|
||||
Ensure that the response has the course navigator.
|
||||
"""
|
||||
self.assertTrue( "course info" in resp.content.lower() )
|
||||
self.assertTrue( "courseware" in resp.content.lower() )
|
||||
|
||||
|
||||
def test_course_navigator(self):
|
||||
""""
|
||||
Test that going from a course page to a wiki page contains the course navigator.
|
||||
"""
|
||||
|
||||
self.login(self.student, self.password)
|
||||
self.enroll(self.toy)
|
||||
self.create_course_page(self.toy)
|
||||
|
||||
|
||||
course_wiki_page = reverse('wiki:get', kwargs={'path' : self.toy.wiki_slug + '/'})
|
||||
referer = reverse("courseware", kwargs={ 'course_id' : self.toy.id })
|
||||
|
||||
resp = self.client.get(course_wiki_page, follow=True, HTTP_REFERER=referer)
|
||||
|
||||
self.has_course_navigator(resp)
|
||||
|
||||
|
||||
128
lms/djangoapps/course_wiki/views.py
Normal file
@@ -0,0 +1,128 @@
|
||||
import logging
|
||||
import re
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.sites.models import Site
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.shortcuts import redirect
|
||||
from wiki.core.exceptions import NoRootURL
|
||||
from wiki.models import URLPath, Article
|
||||
|
||||
from courseware.courses import get_course_by_id
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
def root_create(request):
|
||||
"""
|
||||
In the edX wiki, we don't show the root_create view. Instead, we
|
||||
just create the root automatically if it doesn't exist.
|
||||
"""
|
||||
root = get_or_create_root()
|
||||
return redirect('wiki:get', path=root.path)
|
||||
|
||||
|
||||
def course_wiki_redirect(request, course_id):
|
||||
"""
|
||||
This redirects to whatever page on the wiki that the course designates
|
||||
as it's home page. A course's wiki must be an article on the root (for
|
||||
example, "/6.002x") to keep things simple.
|
||||
"""
|
||||
course = get_course_by_id(course_id)
|
||||
|
||||
course_slug = course.wiki_slug
|
||||
|
||||
valid_slug = True
|
||||
if not course_slug:
|
||||
log.exception("This course is improperly configured. The slug cannot be empty.")
|
||||
valid_slug = False
|
||||
if re.match('^[-\w\.]+$', course_slug) == None:
|
||||
log.exception("This course is improperly configured. The slug can only contain letters, numbers, periods or hyphens.")
|
||||
valid_slug = False
|
||||
|
||||
if not valid_slug:
|
||||
return redirect("wiki:get", path="")
|
||||
|
||||
|
||||
# The wiki needs a Site object created. We make sure it exists here
|
||||
try:
|
||||
site = Site.objects.get_current()
|
||||
except Site.DoesNotExist:
|
||||
new_site = Site()
|
||||
new_site.domain = settings.SITE_NAME
|
||||
new_site.name = "edX"
|
||||
new_site.save()
|
||||
if str(new_site.id) != str(settings.SITE_ID):
|
||||
raise ImproperlyConfigured("No site object was created and the SITE_ID doesn't match the newly created one. " + str(new_site.id) + "!=" + str(settings.SITE_ID))
|
||||
|
||||
try:
|
||||
urlpath = URLPath.get_by_path(course_slug, select_related=True)
|
||||
|
||||
results = list( Article.objects.filter( id = urlpath.article.id ) )
|
||||
if results:
|
||||
article = results[0]
|
||||
else:
|
||||
article = None
|
||||
|
||||
except (NoRootURL, URLPath.DoesNotExist):
|
||||
# We will create it in the next block
|
||||
urlpath = None
|
||||
article = None
|
||||
|
||||
if not article:
|
||||
# create it
|
||||
root = get_or_create_root()
|
||||
|
||||
if urlpath:
|
||||
# Somehow we got a urlpath without an article. Just delete it and
|
||||
# recerate it.
|
||||
urlpath.delete()
|
||||
|
||||
urlpath = URLPath.create_article(
|
||||
root,
|
||||
course_slug,
|
||||
title=course.title,
|
||||
content="This is the wiki for " + course.title + ".",
|
||||
user_message="Course page automatically created.",
|
||||
user=None,
|
||||
ip_address=None,
|
||||
article_kwargs={'owner': None,
|
||||
'group': None,
|
||||
'group_read': True,
|
||||
'group_write': True,
|
||||
'other_read': True,
|
||||
'other_write': True,
|
||||
})
|
||||
|
||||
return redirect("wiki:get", path=urlpath.path)
|
||||
|
||||
|
||||
def get_or_create_root():
|
||||
"""
|
||||
Returns the root article, or creates it if it doesn't exist.
|
||||
"""
|
||||
try:
|
||||
root = URLPath.root()
|
||||
if not root.article:
|
||||
root.delete()
|
||||
raise NoRootURL
|
||||
return root
|
||||
except NoRootURL:
|
||||
pass
|
||||
|
||||
starting_content = "\n".join((
|
||||
"Welcome to the edX Wiki",
|
||||
"===",
|
||||
"Visit a course wiki to add an article."))
|
||||
|
||||
root = URLPath.create_root(title="edX Wiki",
|
||||
content=starting_content)
|
||||
article = root.article
|
||||
article.group = None
|
||||
article.group_read = True
|
||||
article.group_write = False
|
||||
article.other_read = True
|
||||
article.other_write = False
|
||||
article.save()
|
||||
|
||||
return root
|
||||
|
||||
@@ -187,7 +187,7 @@ class PageLoader(ActivateLoginTestCase):
|
||||
def unenroll(self, course):
|
||||
"""Unenroll the currently logged-in user, and check that it worked."""
|
||||
resp = self.client.post('/change_enrollment', {
|
||||
'enrollment_action': 'enroll',
|
||||
'enrollment_action': 'unenroll',
|
||||
'course_id': course.id,
|
||||
})
|
||||
data = parse_json(resp)
|
||||
|
||||
@@ -131,6 +131,13 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
'askbot.user_messages.context_processors.user_messages',#must be before auth
|
||||
'django.contrib.auth.context_processors.auth', #this is required for admin
|
||||
'django.core.context_processors.csrf', #necessary for csrf protection
|
||||
|
||||
# Added for django-wiki
|
||||
'django.core.context_processors.media',
|
||||
'django.core.context_processors.tz',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
'sekizai.context_processors.sekizai',
|
||||
'course_wiki.course_nav.context_processor',
|
||||
)
|
||||
|
||||
STUDENT_FILEUPLOAD_MAX_SIZE = 4*1000*1000 # 4 MB
|
||||
@@ -288,6 +295,9 @@ djcelery.setup_loader()
|
||||
SIMPLE_WIKI_REQUIRE_LOGIN_EDIT = True
|
||||
SIMPLE_WIKI_REQUIRE_LOGIN_VIEW = False
|
||||
|
||||
################################# WIKI ###################################
|
||||
WIKI_ACCOUNT_HANDLING = False
|
||||
|
||||
################################# Jasmine ###################################
|
||||
JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee'
|
||||
|
||||
@@ -301,9 +311,13 @@ STATICFILES_FINDERS = (
|
||||
|
||||
# List of callables that know how to import templates from various sources.
|
||||
TEMPLATE_LOADERS = (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
'askbot.skins.loaders.filesystem_load_template_source',
|
||||
'mitxmako.makoloader.MakoFilesystemLoader',
|
||||
'mitxmako.makoloader.MakoAppDirectoriesLoader',
|
||||
|
||||
# 'django.template.loaders.filesystem.Loader',
|
||||
# 'django.template.loaders.app_directories.Loader',
|
||||
|
||||
#'askbot.skins.loaders.filesystem_load_template_source',
|
||||
# 'django.template.loaders.eggs.Loader',
|
||||
)
|
||||
|
||||
@@ -319,6 +333,8 @@ MIDDLEWARE_CLASSES = (
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'track.middleware.TrackMiddleware',
|
||||
'mitxmako.middleware.MakoMiddleware',
|
||||
|
||||
'course_wiki.course_nav.Middleware',
|
||||
|
||||
'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
|
||||
'askbot.middleware.forum_mode.ForumModeMiddleware',
|
||||
@@ -535,6 +551,15 @@ INSTALLED_APPS = (
|
||||
'track',
|
||||
'util',
|
||||
'certificates',
|
||||
|
||||
#For the wiki
|
||||
'wiki', # The new django-wiki from benjaoming
|
||||
'course_wiki', # Our customizations
|
||||
'django_notify',
|
||||
'mptt',
|
||||
'sekizai',
|
||||
'wiki.plugins.attachments',
|
||||
'wiki.plugins.notifications',
|
||||
|
||||
# For testing
|
||||
'django_jasmine',
|
||||
|
||||
@@ -65,5 +65,7 @@ DEBUG_TOOLBAR_PANELS = (
|
||||
# Django=1.3.1/1.4 where requests to views get duplicated (your method gets
|
||||
# hit twice). So you can uncomment when you need to diagnose performance
|
||||
# problems, but you shouldn't leave it on.
|
||||
# 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
|
||||
'debug_toolbar.panels.profiling.ProfilingDebugPanel',
|
||||
)
|
||||
|
||||
#PIPELINE = True
|
||||
|
||||
|
Before Width: | Height: | Size: 191 B |
|
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
BIN
lms/static/images/askbot/old/vote-arrow-down.png
Normal file
|
After Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 211 B |
BIN
lms/static/images/askbot/old/vote-arrow-up.png
Normal file
|
After Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 1.1 KiB |
218
lms/static/js/bootstrap-modal.js
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
/* =========================================================
|
||||
* bootstrap-modal.js v2.0.4
|
||||
* http://twitter.github.com/bootstrap/javascript.html#modals
|
||||
* =========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================= */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* MODAL CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var Modal = function (content, options) {
|
||||
this.options = options
|
||||
this.$element = $(content)
|
||||
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
||||
}
|
||||
|
||||
Modal.prototype = {
|
||||
|
||||
constructor: Modal
|
||||
|
||||
, toggle: function () {
|
||||
return this[!this.isShown ? 'show' : 'hide']()
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var that = this
|
||||
, e = $.Event('show')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
$('body').addClass('modal-open')
|
||||
|
||||
this.isShown = true
|
||||
|
||||
escape.call(this)
|
||||
backdrop.call(this, function () {
|
||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||
|
||||
if (!that.$element.parent().length) {
|
||||
that.$element.appendTo(document.body) //don't move modals dom position
|
||||
}
|
||||
|
||||
that.$element
|
||||
.show()
|
||||
|
||||
if (transition) {
|
||||
that.$element[0].offsetWidth // force reflow
|
||||
}
|
||||
|
||||
that.$element.addClass('in')
|
||||
|
||||
transition ?
|
||||
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
|
||||
that.$element.trigger('shown')
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
, hide: function (e) {
|
||||
e && e.preventDefault()
|
||||
|
||||
var that = this
|
||||
|
||||
e = $.Event('hide')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (!this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = false
|
||||
|
||||
$('body').removeClass('modal-open')
|
||||
|
||||
escape.call(this)
|
||||
|
||||
this.$element.removeClass('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade') ?
|
||||
hideWithTransition.call(this) :
|
||||
hideModal.call(this)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* MODAL PRIVATE METHODS
|
||||
* ===================== */
|
||||
|
||||
function hideWithTransition() {
|
||||
var that = this
|
||||
, timeout = setTimeout(function () {
|
||||
that.$element.off($.support.transition.end)
|
||||
hideModal.call(that)
|
||||
}, 500)
|
||||
|
||||
this.$element.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
hideModal.call(that)
|
||||
})
|
||||
}
|
||||
|
||||
function hideModal(that) {
|
||||
this.$element
|
||||
.hide()
|
||||
.trigger('hidden')
|
||||
|
||||
backdrop.call(this)
|
||||
}
|
||||
|
||||
function backdrop(callback) {
|
||||
var that = this
|
||||
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||
|
||||
if (this.isShown && this.options.backdrop) {
|
||||
var doAnimate = $.support.transition && animate
|
||||
|
||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||
.appendTo(document.body)
|
||||
|
||||
if (this.options.backdrop != 'static') {
|
||||
this.$backdrop.click($.proxy(this.hide, this))
|
||||
}
|
||||
|
||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||
|
||||
this.$backdrop.addClass('in')
|
||||
|
||||
doAnimate ?
|
||||
this.$backdrop.one($.support.transition.end, callback) :
|
||||
callback()
|
||||
|
||||
} else if (!this.isShown && this.$backdrop) {
|
||||
this.$backdrop.removeClass('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade')?
|
||||
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
|
||||
removeBackdrop.call(this)
|
||||
|
||||
} else if (callback) {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
function removeBackdrop() {
|
||||
this.$backdrop.remove()
|
||||
this.$backdrop = null
|
||||
}
|
||||
|
||||
function escape() {
|
||||
var that = this
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
$(document).on('keyup.dismiss.modal', function ( e ) {
|
||||
e.which == 27 && that.hide()
|
||||
})
|
||||
} else if (!this.isShown) {
|
||||
$(document).off('keyup.dismiss.modal')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* MODAL PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
$.fn.modal = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('modal')
|
||||
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
|
||||
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
else if (options.show) data.show()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.modal.defaults = {
|
||||
backdrop: true
|
||||
, keyboard: true
|
||||
, show: true
|
||||
}
|
||||
|
||||
$.fn.modal.Constructor = Modal
|
||||
|
||||
|
||||
/* MODAL DATA-API
|
||||
* ============== */
|
||||
|
||||
$(function () {
|
||||
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
|
||||
var $this = $(this), href
|
||||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
|
||||
|
||||
e.preventDefault()
|
||||
$target.modal(option)
|
||||
})
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
@@ -10,7 +10,6 @@ div.book-wrapper {
|
||||
font-size: em(14);
|
||||
|
||||
.chapter-number {
|
||||
|
||||
}
|
||||
|
||||
.chapter {
|
||||
@@ -81,9 +80,8 @@ div.book-wrapper {
|
||||
|
||||
section.book {
|
||||
@extend .content;
|
||||
padding-bottom: 0;
|
||||
padding-right: 0;
|
||||
padding-top: 0;
|
||||
padding-left: lh();
|
||||
|
||||
nav {
|
||||
@extend .clearfix;
|
||||
|
||||
@@ -2,7 +2,7 @@ body {
|
||||
min-width: 980px;
|
||||
}
|
||||
|
||||
body, h1, h2, h3, h4, h5, h6, p, p a:link, p a:visited, a {
|
||||
body, h1, h2, h3, h4, h5, h6, p, p a:link, p a:visited, a, label {
|
||||
text-align: left;
|
||||
font-family: $sans-serif;
|
||||
}
|
||||
@@ -27,6 +27,10 @@ form {
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
::selection, ::-moz-selection, ::-webkit-selection {
|
||||
background:#444;
|
||||
color:#fff;
|
||||
|
||||
@@ -12,10 +12,13 @@ h1.top-header {
|
||||
@include box-shadow(inset 0 1px 0 #fff);
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
font: normal $body-font-size $body-font-family;
|
||||
font: 400 $body-font-size $body-font-family;
|
||||
@include linear-gradient(#fff, lighten(#888, 40%));
|
||||
padding: 4px 8px;
|
||||
text-decoration: none;
|
||||
text-shadow: none;
|
||||
text-transform: none;
|
||||
letter-spacing: 0;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
&:hover, &:focus {
|
||||
@@ -28,7 +31,7 @@ h1.top-header {
|
||||
.content {
|
||||
@include box-sizing(border-box);
|
||||
display: table-cell;
|
||||
padding: lh();
|
||||
padding-right: lh();
|
||||
vertical-align: top;
|
||||
width: flex-grid(9) + flex-gutter();
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ div.course-wrapper {
|
||||
|
||||
section.course-content {
|
||||
@extend .content;
|
||||
@include border-radius(0 4px 4px 0);
|
||||
padding-right: 0;
|
||||
padding-left: lh();
|
||||
|
||||
h1 {
|
||||
margin: 0 0 lh();
|
||||
|
||||
@@ -7,9 +7,16 @@ div.answer-controls {
|
||||
padding-left: flex-grid(1.1);
|
||||
width: 100%;
|
||||
|
||||
|
||||
div.answer-count {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
|
||||
h1 {
|
||||
margin-bottom: 0;
|
||||
font-size: em(24);
|
||||
font-weight: 100;
|
||||
}
|
||||
}
|
||||
|
||||
div.answer-sort {
|
||||
@@ -18,7 +25,7 @@ div.answer-controls {
|
||||
|
||||
nav {
|
||||
float: right;
|
||||
margin-top: 34px;
|
||||
margin-top: 10px;
|
||||
|
||||
a {
|
||||
&.on span{
|
||||
@@ -44,8 +51,9 @@ div.answer-block {
|
||||
width: 100%;
|
||||
|
||||
img.answer-img-accept {
|
||||
margin: 10px 0px 10px 16px;
|
||||
margin: 10px 0px 10px 11px;
|
||||
}
|
||||
|
||||
div.answer-container {
|
||||
@extend div.question-container;
|
||||
|
||||
@@ -130,21 +138,19 @@ div.answer-own {
|
||||
|
||||
div.answer-actions {
|
||||
margin: 0;
|
||||
padding:8px 8px 8px 0;
|
||||
padding:8px 0 8px 8px;
|
||||
text-align: right;
|
||||
border-top: 1px solid #efefef;
|
||||
|
||||
span.sep {
|
||||
color: #EDDFAA;
|
||||
color: $border-color;
|
||||
}
|
||||
|
||||
a {
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
|
||||
&.question-delete {
|
||||
color: $mit-red;
|
||||
}
|
||||
@extend a:link;
|
||||
font-size: em(14);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ div#award-list{
|
||||
}
|
||||
|
||||
ul.badge-list {
|
||||
padding-left: 0;
|
||||
|
||||
li.badge {
|
||||
border-bottom: 1px solid #eee;
|
||||
@extend .clearfix;
|
||||
@@ -70,12 +72,17 @@ ul.badge-list {
|
||||
.bronze, .badge3 {
|
||||
color: #cc9933;
|
||||
}
|
||||
div.badge-desc {
|
||||
> div {
|
||||
margin-bottom: 20px;
|
||||
span {
|
||||
font-size: 18px;
|
||||
@include border-radius(10px);
|
||||
}
|
||||
|
||||
div.discussion-wrapper aside {
|
||||
div.badge-desc {
|
||||
border-top: 0;
|
||||
|
||||
> div {
|
||||
margin-bottom: 20px;
|
||||
span {
|
||||
font-size: 18px;
|
||||
@include border-radius(10px);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ body.askbot {
|
||||
@include box-sizing(border-box);
|
||||
display: table-cell;
|
||||
min-width: 650px;
|
||||
padding: lh();
|
||||
padding-right: lh();
|
||||
vertical-align: top;
|
||||
width: flex-grid(9) + flex-gutter();
|
||||
|
||||
|
||||
@@ -5,6 +5,11 @@ form.answer-form {
|
||||
border-top: 1px solid #ddd;
|
||||
overflow: hidden;
|
||||
padding-left: flex-grid(1.1);
|
||||
padding-top: lh();
|
||||
|
||||
p {
|
||||
margin-bottom: lh();
|
||||
}
|
||||
|
||||
textarea {
|
||||
@include box-sizing(border-box);
|
||||
@@ -121,7 +126,6 @@ form.question-form {
|
||||
border: none;
|
||||
padding: 15px 0 0 0;
|
||||
|
||||
|
||||
input[type="text"] {
|
||||
@include box-sizing(border-box);
|
||||
width: flex-grid(6);
|
||||
@@ -131,6 +135,11 @@ form.question-form {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
input[value="Cancel"] {
|
||||
@extend .light-button;
|
||||
float: right;
|
||||
}
|
||||
|
||||
div#question-list {
|
||||
background-color: rgba(255,255,255,0.95);
|
||||
@include box-sizing(border-box);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Style for modal boxes that pop up to notify the user of various events
|
||||
|
||||
.vote-notification {
|
||||
background-color: darken($mit-red, 7%);
|
||||
@include border-radius(4px);
|
||||
|
||||
@@ -9,9 +9,9 @@ body.user-profile-page {
|
||||
}
|
||||
|
||||
ul.sub-info {
|
||||
// border-top: 1px solid #ddd;
|
||||
margin-top: lh();
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
|
||||
> li {
|
||||
display: table-cell;
|
||||
@@ -57,6 +57,7 @@ body.user-profile-page {
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
|
||||
&.user-stats-table {
|
||||
list-style: none;
|
||||
@@ -72,37 +73,28 @@ body.user-profile-page {
|
||||
margin-bottom: 30px;
|
||||
|
||||
li {
|
||||
background-position: 10px center;
|
||||
background-position: 10px -10px;
|
||||
background-repeat: no-repeat;
|
||||
@include border-radius(4px);
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
padding: 10px 10px 10px 40px;
|
||||
padding: 2px 10px 2px 40px;
|
||||
margin-bottom: lh(.5);
|
||||
border: 1px solid lighten($border-color, 10%);
|
||||
|
||||
&.up {
|
||||
background-color:#d1e3a8;
|
||||
background-image: url(../images/askbot/vote-arrow-up-activate.png);
|
||||
background-image: url(../images/askbot/vote-arrow-up.png);
|
||||
margin-right: 6px;
|
||||
|
||||
span.vote-count {
|
||||
color: #3f6c3e;
|
||||
}
|
||||
}
|
||||
|
||||
&.down {
|
||||
background-image: url(../images/askbot/vote-arrow-down-activate.png);
|
||||
background-color:#eac6ad;
|
||||
|
||||
span.vote-count {
|
||||
color: $mit-red;
|
||||
}
|
||||
|
||||
background-image: url(../images/askbot/vote-arrow-down.png);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.badges {
|
||||
@include inline-block();
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
a {
|
||||
background-color: #e3e3e3;
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
// Styles for the single question view
|
||||
|
||||
div.question-header {
|
||||
@include clearfix();
|
||||
|
||||
div.official-stamp {
|
||||
background: $mit-red;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
margin-left: -1px;
|
||||
margin-top: 10px;
|
||||
padding: 2px 5px;
|
||||
text-align: center;
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
div.vote-buttons {
|
||||
@@ -19,40 +20,40 @@ div.question-header {
|
||||
width: flex-grid(0.7,9);
|
||||
|
||||
ul {
|
||||
li {
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
height: 20px;
|
||||
list-style: none;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
width: 70%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
&.post-vote {
|
||||
@include border-radius(4px);
|
||||
@include box-shadow(inset 0 1px 0px #fff);
|
||||
}
|
||||
li {
|
||||
background-repeat: no-repeat;
|
||||
color: #999;
|
||||
font-size: em(20);
|
||||
font-weight: bold;
|
||||
list-style: none;
|
||||
text-align: center;
|
||||
|
||||
&.question-img-upvote, &.answer-img-upvote {
|
||||
background-image: url(../images/askbot/vote-arrow-up.png);
|
||||
@include box-shadow(inset 0 1px 0px rgba(255, 255, 255, 0.5));
|
||||
background-position: center 0;
|
||||
cursor: pointer;
|
||||
height: 12px;
|
||||
margin-bottom: lh(.5);
|
||||
|
||||
&:hover, &.on {
|
||||
background-color:#d1e3a8;
|
||||
border-color: darken(#D1E3A8, 20%);
|
||||
background-image: url(../images/askbot/vote-arrow-up-activate.png);
|
||||
background-image: url(../images/askbot/vote-arrow-up.png);
|
||||
background-position: center -22px;
|
||||
}
|
||||
}
|
||||
|
||||
&.question-img-downvote, &.answer-img-downvote {
|
||||
cursor: pointer;
|
||||
background-image: url(../images/askbot/vote-arrow-down.png);
|
||||
background-position: center 0;
|
||||
height: 12px;
|
||||
margin-top: lh(.5);
|
||||
|
||||
&:hover, &.on {
|
||||
background-color:#EAC6AD;
|
||||
border-color: darken(#EAC6AD, 20%);
|
||||
background-image: url(../images/askbot/vote-arrow-down-activate.png);
|
||||
background-image: url(../images/askbot/vote-arrow-down.png);
|
||||
background-position: center -22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,12 +67,19 @@ div.question-header {
|
||||
|
||||
h1 {
|
||||
margin-top: 0;
|
||||
font-weight: 100;
|
||||
line-height: 1.1em;
|
||||
|
||||
a {
|
||||
font-weight: 100;
|
||||
line-height: 1.1em;
|
||||
}
|
||||
}
|
||||
|
||||
div.meta-bar {
|
||||
border-bottom: 1px solid #eee;
|
||||
display: block;
|
||||
margin: 10px 0;
|
||||
margin: lh(.5) 0 lh();
|
||||
overflow: hidden;
|
||||
padding: 5px 0 10px;
|
||||
|
||||
@@ -89,11 +97,8 @@ div.question-header {
|
||||
width: flex-grid(4,8);
|
||||
|
||||
a {
|
||||
&.question-delete {
|
||||
color: $mit-red;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@extend a:link;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
span.sep {
|
||||
@@ -155,7 +160,7 @@ div.question-header {
|
||||
}
|
||||
|
||||
div.change-date {
|
||||
font-size: 12px;
|
||||
font-size: em(14);
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
@@ -179,13 +184,13 @@ div.question-header {
|
||||
display: inline-block;
|
||||
padding: 0 0 3% 0;
|
||||
width: 100%;
|
||||
margin-top: lh(2);
|
||||
|
||||
div.comments-content {
|
||||
font-size: 13px;
|
||||
background: #efefef;
|
||||
border-top: 1px solid lighten($border-color, 10%);
|
||||
|
||||
.block {
|
||||
border-top: 1px solid #ddd;
|
||||
border-top: 1px solid lighten($border-color, 10%);
|
||||
padding: 15px;
|
||||
display: block;
|
||||
|
||||
@@ -197,10 +202,10 @@ div.question-header {
|
||||
padding-top: 10px;
|
||||
|
||||
span.official-comment {
|
||||
background: $mit-red;
|
||||
background: $pink;
|
||||
color: #fff;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
font-size: em(12);
|
||||
margin: 0 0 10px -5%;
|
||||
padding:2px 5px 2px 5%;
|
||||
text-align: left;
|
||||
@@ -212,6 +217,10 @@ div.question-header {
|
||||
form.post-comments {
|
||||
padding: 15px;
|
||||
|
||||
button {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
button:last-child {
|
||||
margin-left: 10px;
|
||||
@extend .light-button;
|
||||
@@ -232,7 +241,6 @@ div.question-header {
|
||||
border: none;
|
||||
@include box-shadow(none);
|
||||
display: inline-block;
|
||||
margin-top: -8px;
|
||||
padding:0 2% 0 0;
|
||||
text-align: center;
|
||||
width: 5%;
|
||||
@@ -278,16 +286,14 @@ div.question-header {
|
||||
}
|
||||
|
||||
div.comment-delete {
|
||||
// display: inline;
|
||||
color: $mit-red;
|
||||
@extend a:link;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
div.comment-edit {
|
||||
@include transform(rotate(50deg));
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
|
||||
a.edit-icon {
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
@@ -305,13 +311,13 @@ div.question-header {
|
||||
|
||||
div.comment-meta {
|
||||
text-align: right;
|
||||
margin-top: lh(.5);
|
||||
|
||||
a.author {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a.edit {
|
||||
font-size: 12px;
|
||||
padding: 2px 10px;
|
||||
}
|
||||
}
|
||||
@@ -334,12 +340,10 @@ div.question-header {
|
||||
}
|
||||
|
||||
div.controls {
|
||||
border-top: 1px solid #efefef;
|
||||
text-align: right;
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin: 10px 10px 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
// Styles for the default question list view
|
||||
|
||||
div.question-list-header {
|
||||
@extend h1.top-header;
|
||||
display: block;
|
||||
margin-bottom: 0px;
|
||||
padding-bottom: lh(.5);
|
||||
overflow: hidden;
|
||||
width: flex-grid(9,9);
|
||||
@extend h1.top-header;
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 1em;
|
||||
font-weight: 100;
|
||||
padding-bottom: lh(.5);
|
||||
|
||||
> a.light-button {
|
||||
float: right;
|
||||
font-size: em(14, 24);
|
||||
letter-spacing: 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,8 +56,11 @@ div.question-list-header {
|
||||
nav {
|
||||
@extend .action-link;
|
||||
float: right;
|
||||
font-size: em(16, 24);
|
||||
|
||||
a {
|
||||
font-size: 1em;
|
||||
|
||||
&.on span{
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -82,6 +92,7 @@ div.question-list-header {
|
||||
|
||||
a {
|
||||
color: #555;
|
||||
font-size: em(14, 24);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,12 +101,10 @@ div.question-list-header {
|
||||
}
|
||||
|
||||
ul.tags {
|
||||
li {
|
||||
background: #fff;
|
||||
|
||||
&:before {
|
||||
border-color: transparent #fff transparent transparent;
|
||||
}
|
||||
span, div {
|
||||
line-height: 1em;
|
||||
margin-left: 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,26 +112,15 @@ div.question-list-header {
|
||||
|
||||
ul.question-list, div#question-list {
|
||||
width: flex-grid(9,9);
|
||||
padding-left: 0;
|
||||
margin: 0;
|
||||
|
||||
li.single-question {
|
||||
border-bottom: 1px solid #eee;
|
||||
list-style: none;
|
||||
padding: 10px lh();
|
||||
margin-left: (-(lh()));
|
||||
padding: lh() 0;
|
||||
width: 100%;
|
||||
|
||||
&:hover {
|
||||
background: #F3F3F3;
|
||||
|
||||
ul.tags li {
|
||||
background: #ddd;
|
||||
|
||||
&:before {
|
||||
border-color: transparent #ddd transparent transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
border-top: 0;
|
||||
}
|
||||
@@ -133,14 +131,19 @@ ul.question-list, div#question-list {
|
||||
&.question-body {
|
||||
@include box-sizing(border-box);
|
||||
margin-right: flex-gutter();
|
||||
width: flex-grid(5.5,9);
|
||||
width: flex-grid(5,9);
|
||||
|
||||
h2 {
|
||||
font-size: 16px;
|
||||
font-size: em(20);
|
||||
font-weight: bold;
|
||||
letter-spacing: 0;
|
||||
margin: 0px 0 15px 0;
|
||||
margin: 0 0 lh() 0;
|
||||
text-transform: none;
|
||||
line-height: lh();
|
||||
|
||||
a {
|
||||
line-height: lh();
|
||||
}
|
||||
}
|
||||
|
||||
p.excerpt {
|
||||
@@ -151,40 +154,41 @@ ul.question-list, div#question-list {
|
||||
div.user-info {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-bottom: 10px;
|
||||
margin: lh() 0 0 0;
|
||||
line-height: lh();
|
||||
|
||||
span.relative-time {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $mit-red;
|
||||
line-height: lh();
|
||||
}
|
||||
}
|
||||
|
||||
ul.tags {
|
||||
display: inline-block;
|
||||
margin: lh() 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&.question-meta {
|
||||
float: right;
|
||||
margin-top: 10px;
|
||||
width: flex-grid(3.5,9);
|
||||
|
||||
width: flex-grid(3,9);
|
||||
|
||||
ul {
|
||||
text-align: right;
|
||||
@include clearfix;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
|
||||
li {
|
||||
border: 1px solid #ddd;
|
||||
border: 1px solid lighten($border-color, 10%);
|
||||
@include box-sizing(border-box);
|
||||
@include box-shadow(0 1px 0 #fff);
|
||||
display: inline-block;
|
||||
height:60px;
|
||||
@include linear-gradient(#fff, #f5f5f5);
|
||||
margin-right: 10px;
|
||||
width: 60px;
|
||||
float: left;
|
||||
margin-right: flex-gutter(3);
|
||||
width: flex-grid(1,3);
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0px;
|
||||
@@ -196,31 +200,22 @@ ul.question-list, div#question-list {
|
||||
}
|
||||
}
|
||||
|
||||
&.views {
|
||||
}
|
||||
|
||||
&.answers {
|
||||
&.accepted {
|
||||
|
||||
@include linear-gradient(#fff, lighten( #c4dfbe, 12% ));
|
||||
border-color: #c4dfbe;
|
||||
border-color: lighten($border-color, 10%);
|
||||
|
||||
span, div {
|
||||
color: darken(#c4dfbe, 35%);
|
||||
}
|
||||
}
|
||||
|
||||
&.no-answers {
|
||||
|
||||
|
||||
span, div {
|
||||
color: lighten($mit-red, 20%);
|
||||
color: $pink;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.votes {
|
||||
}
|
||||
|
||||
span, div {
|
||||
@include box-sizing(border-box);
|
||||
color: #888;
|
||||
|
||||
@@ -2,11 +2,8 @@
|
||||
|
||||
div.discussion-wrapper aside {
|
||||
@extend .sidebar;
|
||||
border-left: 1px solid #d3d3d3;
|
||||
@include border-radius(0 4px 4px 0);
|
||||
border-right: 1px solid #f6f6f6;
|
||||
@include box-shadow(inset 1px 0 0 #f6f6f6);
|
||||
padding: lh();
|
||||
border-left: 1px solid $border-color;
|
||||
border-right: 0;
|
||||
width: flex-grid(3);
|
||||
|
||||
&.main-sidebar {
|
||||
@@ -15,12 +12,16 @@ div.discussion-wrapper aside {
|
||||
|
||||
h1 {
|
||||
@extend .bottom-border;
|
||||
margin: (-(lh())) (-(lh())) 0;
|
||||
padding: lh(.5) lh();
|
||||
margin-bottom: em(16, 20);
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #4D4D4D;
|
||||
color: #3C3C3C;
|
||||
font-size: 1em;
|
||||
font-style: normal;
|
||||
font-weight: bold;
|
||||
margin-bottom: 1em;
|
||||
|
||||
&.first {
|
||||
margin-top: 0px;
|
||||
@@ -36,6 +37,9 @@ div.discussion-wrapper aside {
|
||||
input[type="submit"] {
|
||||
width: 27%;
|
||||
float: right;
|
||||
text-align: center;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
@@ -45,24 +49,30 @@ div.discussion-wrapper aside {
|
||||
|
||||
div.box {
|
||||
display: block;
|
||||
margin: lh(.5) 0;
|
||||
padding: lh(.5) lh();
|
||||
border-top: 1px solid lighten($border-color, 10%);
|
||||
|
||||
&:last-child {
|
||||
@include box-shadow(none);
|
||||
border: 0;
|
||||
&:first-child {
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
letter-spacing: 1px;
|
||||
ul#related-tags {
|
||||
position: relative;
|
||||
left: -10px;
|
||||
|
||||
&:not(.first) {
|
||||
@include box-shadow(inset 0 1px 0 #eee);
|
||||
border-top: 1px solid #d3d3d3;
|
||||
margin: 0 (-(lh())) 0;
|
||||
padding: lh(.5) lh();
|
||||
li {
|
||||
border-bottom: 0;
|
||||
background: #eee;
|
||||
padding: 6px 10px 6px 5px;
|
||||
|
||||
a {
|
||||
padding: 0;
|
||||
line-height: 12px;
|
||||
|
||||
&:hover {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,9 +95,6 @@ div.discussion-wrapper aside {
|
||||
}
|
||||
|
||||
}
|
||||
img.gravatar {
|
||||
@include border-radius(3px);
|
||||
}
|
||||
}
|
||||
|
||||
&.tag-selector {
|
||||
@@ -100,17 +107,19 @@ div.discussion-wrapper aside {
|
||||
|
||||
div.search-box {
|
||||
margin-top: lh(.5);
|
||||
|
||||
input {
|
||||
@include box-sizing(border-box);
|
||||
display: inline;
|
||||
}
|
||||
|
||||
input[type='submit'] {
|
||||
@include box-shadow(none);
|
||||
opacity: 0.5;
|
||||
background: url(../images/askbot/search-icon.png) no-repeat center;
|
||||
border: 0;
|
||||
@include box-shadow(none);
|
||||
margin-left: 3px;
|
||||
opacity: 0.5;
|
||||
padding: 6px 0 0;
|
||||
position: absolute;
|
||||
text-indent: -9999px;
|
||||
width: 24px;
|
||||
@@ -131,30 +140,26 @@ div.discussion-wrapper aside {
|
||||
}
|
||||
|
||||
input#clear {
|
||||
@include box-shadow(none);
|
||||
@include border-radius(15px);
|
||||
background: none;
|
||||
border: none;
|
||||
background: #bbb;
|
||||
color: #fff;
|
||||
@include border-radius(0);
|
||||
@include box-shadow(none);
|
||||
color: #999;
|
||||
display: inline;
|
||||
font-size: 10px;
|
||||
margin-left: -25px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
height: 19px;
|
||||
line-height: 1em;
|
||||
margin: {
|
||||
left: -25px;
|
||||
top: 8px;
|
||||
}
|
||||
padding: 2px 5px;
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
div#tagSelector {
|
||||
h2 {
|
||||
@include box-shadow(inset 0 1px 0 #eee);
|
||||
border-top: 1px solid #d3d3d3;
|
||||
margin: 0 (-(lh())) 0;
|
||||
padding: lh(.5) lh();
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
}
|
||||
@@ -167,11 +172,17 @@ div.discussion-wrapper aside {
|
||||
p.choice {
|
||||
@include inline-block();
|
||||
margin-right: lh(.5);
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
// Question view sopecific
|
||||
// Question view specific
|
||||
|
||||
div.follow-buttons {
|
||||
margin-top: 20px;
|
||||
@@ -187,12 +198,15 @@ div.discussion-wrapper aside {
|
||||
|
||||
|
||||
div.question-stats {
|
||||
border-top: 0;
|
||||
|
||||
ul {
|
||||
color: #777;
|
||||
list-style: none;
|
||||
|
||||
li {
|
||||
padding: 7px 0 0;
|
||||
border: 0;
|
||||
|
||||
&:last-child {
|
||||
@include box-shadow(none);
|
||||
@@ -216,19 +230,20 @@ div.discussion-wrapper aside {
|
||||
}
|
||||
|
||||
div.karma {
|
||||
background: #eee;
|
||||
border: 1px solid #D3D3D3;
|
||||
@include border-radius(3px);
|
||||
border: 1px solid $border-color;
|
||||
@include box-sizing(border-box);
|
||||
@include box-shadow(inset 0 0 0 1px #fff, 0 1px 0 #fff);
|
||||
padding: lh(.4) 0;
|
||||
text-align: center;
|
||||
width: flex-grid(1, 3);
|
||||
float: right;
|
||||
|
||||
strong {
|
||||
display: block;
|
||||
font-style: 20px;
|
||||
p {
|
||||
text-align: center;
|
||||
|
||||
strong {
|
||||
display: block;
|
||||
font-style: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,8 +270,6 @@ div.discussion-wrapper aside {
|
||||
overflow: visible;
|
||||
|
||||
ul {
|
||||
font-size: 14px;
|
||||
|
||||
h2 {
|
||||
margin:0 (-(lh())) 5px (-(lh()));
|
||||
padding: lh(.5) lh();
|
||||
@@ -265,40 +278,29 @@ div.discussion-wrapper aside {
|
||||
}
|
||||
|
||||
div.question-tips, div.markdown {
|
||||
ul {
|
||||
margin-left: 8%;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
margin-left: 8%;
|
||||
}
|
||||
}
|
||||
div.markdown ul li {
|
||||
margin: 20px 0;
|
||||
|
||||
&:first-child {
|
||||
margin: 0;
|
||||
}
|
||||
padding: 0;
|
||||
|
||||
ol li {
|
||||
margin: 0;
|
||||
li {
|
||||
border-bottom: 0;
|
||||
line-height: lh();
|
||||
margin-bottom: em(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div.view-profile {
|
||||
h2 {
|
||||
border-top: 0;
|
||||
@include box-shadow(none);
|
||||
}
|
||||
border-top: 0;
|
||||
|
||||
a {
|
||||
width: 100%;
|
||||
@include box-sizing(border-box);
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
display: block;
|
||||
margin-top: 10px;
|
||||
@extend .light-button;
|
||||
@include box-sizing(border-box);
|
||||
display: block;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
margin-top: lh(.5);
|
||||
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
ul.tags {
|
||||
list-style: none;
|
||||
display: inline;
|
||||
padding: 0;
|
||||
|
||||
li, a {
|
||||
position: relative;
|
||||
@@ -10,19 +11,17 @@ ul.tags {
|
||||
|
||||
li {
|
||||
background: #eee;
|
||||
@include border-radius(4px);
|
||||
@include box-shadow(0px 1px 0px #ccc);
|
||||
color: #555;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin-bottom: 5px;
|
||||
margin-left: 15px;
|
||||
padding: 3px 10px 5px 5px;
|
||||
padding: 6px 10px 6px 5px;
|
||||
|
||||
&:before {
|
||||
border-color:transparent #eee transparent transparent;
|
||||
border-style:solid;
|
||||
border-width:12px 12px 12px 0;
|
||||
border-width:12px 10px 12px 0;
|
||||
content:"";
|
||||
height:0;
|
||||
left:-10px;
|
||||
@@ -31,25 +30,6 @@ ul.tags {
|
||||
width:0;
|
||||
}
|
||||
|
||||
span.delete-icon, div.delete-icon {
|
||||
background: #555;
|
||||
@include border-radius(0 4px 4px 0);
|
||||
clear: none;
|
||||
color: #eee;
|
||||
cursor: pointer;
|
||||
display: inline;
|
||||
float: none;
|
||||
left: 10px;
|
||||
opacity: 0.5;
|
||||
padding: 4px 6px;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
@@ -61,11 +41,4 @@ ul.tags {
|
||||
|
||||
span.tag-number {
|
||||
display: none;
|
||||
// @include border-radius(3px);
|
||||
// background: #555;
|
||||
// font-size: 10px;
|
||||
// margin: 0 3px;
|
||||
// padding: 2px 5px;
|
||||
// color: #eee;
|
||||
// opacity: 0.5;
|
||||
}
|
||||
|
||||
@@ -1,158 +1,311 @@
|
||||
div.wiki-wrapper {
|
||||
display: table;
|
||||
width: 100%;
|
||||
section.wiki {
|
||||
padding-top: 25px;
|
||||
|
||||
section.wiki-body {
|
||||
@extend .clearfix;
|
||||
@extend .content;
|
||||
@include border-radius(0 4px 4px 0);
|
||||
position: relative;
|
||||
header {
|
||||
height: 33px;
|
||||
margin-bottom: 36px;
|
||||
padding-bottom: 26px;
|
||||
border-bottom: 1px solid $light-gray;
|
||||
}
|
||||
|
||||
header {
|
||||
@extend .topbar;
|
||||
@include border-radius(0 4px 0 0);
|
||||
height:46px;
|
||||
overflow: hidden;
|
||||
.pull-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
&:empty {
|
||||
border-bottom: 0;
|
||||
display: none !important;
|
||||
}
|
||||
.pull-right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-----------------
|
||||
|
||||
Breadcrumbs
|
||||
|
||||
-----------------*/
|
||||
|
||||
.breadcrumb {
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
margin: 0 0 0 flex-gutter();
|
||||
|
||||
li {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
font-size: 0.9em;
|
||||
line-height: 31px;
|
||||
|
||||
a {
|
||||
@extend .block-link;
|
||||
}
|
||||
|
||||
p {
|
||||
float: left;
|
||||
line-height: 46px;
|
||||
margin-bottom: 0;
|
||||
padding-left: lh();
|
||||
}
|
||||
|
||||
ul {
|
||||
float: right;
|
||||
list-style: none;
|
||||
|
||||
li {
|
||||
float: left;
|
||||
|
||||
input[type="button"] {
|
||||
@extend .block-link;
|
||||
background-position: 12px center;
|
||||
background-repeat: no-repeat;
|
||||
border: 0;
|
||||
border-left: 1px solid darken(#f6efd4, 20%);
|
||||
@include border-radius(0);
|
||||
@include box-shadow(inset 1px 0 0 lighten(#f6efd4, 5%));
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
letter-spacing: 1px;
|
||||
line-height: 46px;
|
||||
margin: 0;
|
||||
padding: 0 lh() 0 38px;
|
||||
text-shadow: none;
|
||||
text-transform: uppercase;
|
||||
@include transition();
|
||||
|
||||
&.view {
|
||||
background-image: url('../images/sequence-nav/view.png');
|
||||
}
|
||||
|
||||
&.history {
|
||||
background-image: url('../images/sequence-nav/history.png');
|
||||
}
|
||||
|
||||
&.edit {
|
||||
background-image: url('../images/sequence-nav/edit.png');
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
h2.wiki-title {
|
||||
@include box-sizing(border-box);
|
||||
display: inline-block;
|
||||
float: left;
|
||||
margin-bottom: 15px;
|
||||
margin-top: 0;
|
||||
padding-right: flex-gutter(9);
|
||||
vertical-align: top;
|
||||
width: flex-grid(2.5, 9);
|
||||
|
||||
@media screen and (max-width:900px) {
|
||||
border-right: 0;
|
||||
display: block;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
@media print {
|
||||
border-right: 0;
|
||||
display: block;
|
||||
width: auto;
|
||||
}
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
height: 30px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
||||
section.results {
|
||||
border-left: 1px dashed #ddd;
|
||||
@include box-sizing(border-box);
|
||||
display: inline-block;
|
||||
float: left;
|
||||
padding-left: 10px;
|
||||
width: flex-grid(6.5, 9);
|
||||
|
||||
@media screen and (max-width:900px) {
|
||||
border: 0;
|
||||
display: block;
|
||||
padding-left: 0;
|
||||
width: 100%;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
@media print {
|
||||
display: block;
|
||||
padding: 0;
|
||||
width: auto;
|
||||
|
||||
canvas, img {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
}
|
||||
|
||||
ul.article-list {
|
||||
margin-left: 15px;
|
||||
width: 100%;
|
||||
|
||||
@media screen and (max-width:900px) {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
li {
|
||||
border-bottom: 1px solid #eee;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 10px 0;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
&:after {
|
||||
content: '›';
|
||||
display: inline-block;
|
||||
margin-left: 10px;
|
||||
color: $base-font-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-----------------
|
||||
|
||||
Global Functions
|
||||
|
||||
-----------------*/
|
||||
|
||||
.global-functions {
|
||||
display: block;
|
||||
width: auto;
|
||||
margin-right: flex-gutter();
|
||||
}
|
||||
|
||||
.add-article-btn {
|
||||
@include button(simple, #eee);
|
||||
margin-left: 25px;
|
||||
padding: 7px 15px !important;
|
||||
font-size: 0.72em;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.search-wiki {
|
||||
margin-top: 3px;
|
||||
|
||||
input {
|
||||
width: 180px;
|
||||
height: 27px;
|
||||
padding: 0 15px 0 35px;
|
||||
background: url(../images/search-icon.png) no-repeat 9px center #f6f6f6;
|
||||
border: 1px solid #c8c8c8;
|
||||
border-radius: 14px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12) inset;
|
||||
font-family: $sans-serif;
|
||||
font-size: 12px;
|
||||
outline: none;
|
||||
@include transition(border-color .1s);
|
||||
|
||||
&:-webkit-input-placholder {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
border-color: $blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-----------------
|
||||
|
||||
Article
|
||||
|
||||
-----------------*/
|
||||
|
||||
.article-wrapper {
|
||||
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-weight: bold;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.main-article {
|
||||
float: left;
|
||||
width: flex-grid(9);
|
||||
margin-left: flex-gutter();
|
||||
color: $base-font-color;
|
||||
|
||||
h2 {
|
||||
padding-bottom: 8px;
|
||||
margin-bottom: 22px;
|
||||
border-bottom: 1px solid $light-gray;
|
||||
font-size: 1.33em;
|
||||
font-weight: bold;
|
||||
color: $base-font-color;
|
||||
text-transform: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-top: 40px;
|
||||
margin-bottom: 20px;
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
|
||||
}
|
||||
|
||||
h5 {
|
||||
|
||||
}
|
||||
|
||||
h6 {
|
||||
|
||||
}
|
||||
|
||||
ul {
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*-----------------
|
||||
|
||||
Sidebar
|
||||
|
||||
-----------------*/
|
||||
|
||||
.article-functions {
|
||||
float: left;
|
||||
width: flex-grid(2) + flex-gutter();
|
||||
margin-left: flex-grid(1);
|
||||
|
||||
.timestamp {
|
||||
margin: 4px 0 15px;
|
||||
padding: 0 0 15px 5px;
|
||||
border-bottom: 1px solid $light-gray;
|
||||
|
||||
.label {
|
||||
font-size: 0.7em;
|
||||
color: #aaa;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 0.9em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav-tabs {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
li {
|
||||
&.active {
|
||||
a {
|
||||
color: $blue;
|
||||
|
||||
.icon-view {
|
||||
background-position: -25px 0;
|
||||
}
|
||||
|
||||
.icon-edit {
|
||||
background-position: -25px -25px;
|
||||
}
|
||||
|
||||
.icon-changes {
|
||||
background-position: -25px -49px;
|
||||
}
|
||||
|
||||
.icon-attachments {
|
||||
background-position: -25px -73px;
|
||||
}
|
||||
|
||||
.icon-settings {
|
||||
background-position: -25px -99px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
display: block;
|
||||
padding: 2px 4px;
|
||||
border-radius: 3px;
|
||||
font-size: 0.9em;
|
||||
line-height: 25px;
|
||||
color: #8f8f8f;
|
||||
|
||||
.icon {
|
||||
float: left;
|
||||
display: block;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-right: 3px;
|
||||
background: url(../images/wiki-icons.png) no-repeat;
|
||||
}
|
||||
|
||||
.icon-view {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
.icon-edit {
|
||||
background-position: 0 -25px;
|
||||
}
|
||||
|
||||
.icon-changes {
|
||||
background-position: 0 -49px;
|
||||
}
|
||||
|
||||
.icon-attachments {
|
||||
background-position: 0 -73px;
|
||||
}
|
||||
|
||||
.icon-settings {
|
||||
background-position: 0 -99px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: #f6f6f6;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-----------------
|
||||
|
||||
Alerts
|
||||
|
||||
-----------------*/
|
||||
|
||||
.alert {
|
||||
position: relative;
|
||||
top: -35px;
|
||||
margin-bottom: 24px;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #EBE8BF;
|
||||
border-radius: 3px;
|
||||
background: $yellow;
|
||||
font-size: 0.9em;
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
font-size: 1.3em;
|
||||
top: 6px;
|
||||
color: #999;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ textarea {
|
||||
|
||||
input[type="submit"],
|
||||
input[type="button"],
|
||||
button,
|
||||
.button {
|
||||
@include border-radius(3px);
|
||||
@include button(shiny, $blue);
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<%page args="active_page" />
|
||||
## mako
|
||||
<%page args="active_page=None" />
|
||||
|
||||
<%
|
||||
if active_page == None and active_page_context is not UNDEFINED:
|
||||
# If active_page is not passed in as an argument, it may be in the context as active_page_context
|
||||
active_page = active_page_context
|
||||
|
||||
def url_class(url):
|
||||
if url == active_page:
|
||||
return "active"
|
||||
@@ -23,7 +28,7 @@ def url_class(url):
|
||||
% endif
|
||||
% endif
|
||||
% if settings.WIKI_ENABLED:
|
||||
<li class="wiki"><a href="${reverse('wiki_root', args=[course.id])}" class="${url_class('wiki')}">Wiki</a></li>
|
||||
<li class="wiki"><a href="${reverse('course_wiki', args=[course.id])}" class="${url_class('wiki')}">Wiki</a></li>
|
||||
% endif
|
||||
% if user.is_authenticated():
|
||||
<li class="profile"><a href="${reverse('profile', args=[course.id])}" class="${url_class('profile')}">Profile</a></li>
|
||||
@@ -34,4 +39,4 @@ def url_class(url):
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</nav>
|
||||
</nav>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
## mako
|
||||
<%! from django.core.urlresolvers import reverse %>
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
|
||||
|
||||
43
lms/templates/main_django.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
{% load compressed %}{% load sekizai_tags i18n %}{% load url from future %}
|
||||
<html>
|
||||
<head>
|
||||
{% block title %}<title>edX</title>{% endblock %}
|
||||
<link rel="icon" type="image/x-icon" href="${static.url('images/favicon.ico')}" />
|
||||
|
||||
{% compressed_css 'application' %}
|
||||
{% compressed_js 'main_vendor' %}
|
||||
|
||||
{% block headextra %}{% endblock %}
|
||||
{% render_block "css" %}
|
||||
|
||||
<meta name="path_prefix" content="{{MITX_ROOT_URL}}">
|
||||
</head>
|
||||
|
||||
|
||||
<body class="{% block bodyclass %}{% endblock %}">
|
||||
{% include "navigation.html" %}
|
||||
|
||||
<section class="content-wrapper">
|
||||
{% block body %}{% endblock %}
|
||||
|
||||
{% block bodyextra %}{% endblock %}
|
||||
</section>
|
||||
{% include "footer.html" %}
|
||||
|
||||
{% compressed_js 'application' %}
|
||||
{% compressed_js 'module-js' %}
|
||||
{% render_block "js" %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
{% comment %}
|
||||
This is a django template version of our main page from which all
|
||||
other pages inherit. This file should be rewritten to reflect any
|
||||
changes in main.html! Files used by {% include %} can be written
|
||||
as mako templates.
|
||||
|
||||
Inheriting from this file allows us to include apps that use the
|
||||
django templating system without rewriting all of their views in
|
||||
mako.
|
||||
{% endcomment %}
|
||||
@@ -1,3 +1,4 @@
|
||||
## mako
|
||||
## TODO: Split this into two files, one for people who are authenticated, and
|
||||
## one for people who aren't. Assume a Course object is passed to the former,
|
||||
## instead of using settings.COURSE_TITLE
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
<h2 class="problem-header">
|
||||
${ problem['name'] }
|
||||
% if problem['weight'] != 1:
|
||||
% if problem['weight'] != 1 and problem['weight'] != None:
|
||||
: ${ problem['weight'] } points
|
||||
% endif
|
||||
</h2>
|
||||
|
||||
39
lms/templates/wiki/article.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{% extends "wiki/base.html" %}
|
||||
{% load wiki_tags i18n %}
|
||||
{% load url from future %}
|
||||
|
||||
{% block pagetitle %}{{ article.current_revision.title }}{% endblock %}
|
||||
|
||||
{% block wiki_breadcrumbs %}
|
||||
{% include "wiki/includes/breadcrumbs.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block wiki_contents %}
|
||||
|
||||
<div class="article-wrapper">
|
||||
|
||||
<article class="main-article">
|
||||
<h1>{{ article.current_revision.title }}</h1>
|
||||
{% block wiki_contents_tab %}
|
||||
{% wiki_render article %}
|
||||
{% endblock %}
|
||||
</article>
|
||||
|
||||
<div class="article-functions">
|
||||
<div class="timestamp">
|
||||
<span class="label">{% trans "Last modified:" %}</span><br />
|
||||
<span class="date">{{ article.current_revision.modified }}</span>
|
||||
</div>
|
||||
<ul class="nav nav-tabs">
|
||||
{% include "wiki/includes/article_menu.html" %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block footer_prepend %}
|
||||
<p><em>{% trans "This article was last modified:" %} {{ article.current_revision.modified }}</em></p>
|
||||
{% endblock %}
|
||||
38
lms/templates/wiki/base.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{% extends "main_django.html" %}
|
||||
{% load compressed %}{% load sekizai_tags i18n %}{% load url from future %}
|
||||
|
||||
{% block title %}<title>{% block pagetitle %}{% endblock %} | edX Wiki</title>{% endblock %}
|
||||
|
||||
{% block headextra %}
|
||||
{% compressed_css 'course' %}
|
||||
<script src="{{ STATIC_URL }}js/bootstrap-modal.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
{% if course %}
|
||||
{% include "course_navigation.html" with active_page_context="wiki" %}
|
||||
{% endif %}
|
||||
|
||||
<section class="container wiki">
|
||||
|
||||
{% block wiki_body %}
|
||||
|
||||
{% block wiki_breadcrumbs %}{% endblock %}
|
||||
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.tags }}">
|
||||
<a class="close" data-dismiss="alert" href="#">×</a>
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% block wiki_contents %}{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
||||
47
lms/templates/wiki/includes/article_menu.html
Normal file
@@ -0,0 +1,47 @@
|
||||
{% load i18n wiki_tags %}{% load url from future %}
|
||||
|
||||
{% with selected_tab as selected %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="{% if selected == "view" %} active{% endif %}">
|
||||
<a href="{% url 'wiki:get' article_id=article.id path=urlpath.path %}">
|
||||
<span class="icon icon-view"></span>
|
||||
{% trans "View" %}
|
||||
</a>
|
||||
</li>
|
||||
<li class="{% if selected == "edit" %} active{% endif %}">
|
||||
<a href="{% url 'wiki:edit' article_id=article.id path=urlpath.path %}">
|
||||
<span class="icon icon-edit"></span>
|
||||
{% trans "Edit" %}
|
||||
</a>
|
||||
</li>
|
||||
<li class="{% if selected == "history" %} active{% endif %}">
|
||||
<a href="{% url 'wiki:history' article_id=article.id path=urlpath.path %}">
|
||||
<span class="icon icon-changes"></span>
|
||||
{% trans "Changes" %}
|
||||
</a>
|
||||
</li>
|
||||
{% for plugin in article_tabs %}
|
||||
<li class="{% if selected == plugin.slug %} active{% endif %}">
|
||||
<a href="{% url 'wiki:plugin' slug=plugin.slug article_id=article.id path=urlpath.path %}">
|
||||
<span class="icon icon-attachments {{ plugin.article_tab.1 }}"></span>
|
||||
{{ plugin.article_tab.0 }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
<li class="{% if selected == "settings" %} active{% endif %}">
|
||||
{% if not user.is_anonymous %}
|
||||
<a href="{% url 'wiki:settings' article_id=article.id path=urlpath.path %}">
|
||||
<span class="icon icon-settings"></span>
|
||||
{% trans "Settings" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
{% endwith %}
|
||||
52
lms/templates/wiki/includes/breadcrumbs.html
Normal file
@@ -0,0 +1,52 @@
|
||||
{% load i18n %}{% load url from future %}
|
||||
{% if urlpath %}
|
||||
|
||||
<header>
|
||||
<ul class="breadcrumb pull-left" class="">
|
||||
{% for ancestor in urlpath.get_ancestors.all %}
|
||||
<li><a href="{% url 'wiki:get' path=ancestor.path %}">{{ ancestor.article.current_revision.title }}</a></li>
|
||||
{% endfor %}
|
||||
<li class="active"><a href="{% url 'wiki:get' path=urlpath.path %}">{{ article.current_revision.title }}</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="pull-left" style="margin-left: 10px;">
|
||||
<div class="btn-group">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#" style="padding: 7px;" title="{% trans "Sub-articles for" %} {{ article.current_revision.title }}">
|
||||
<span class="icon-list"></span>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
{% for child in children_slice %}
|
||||
<li>
|
||||
<a href="{% url 'wiki:get' path=child.path %}">
|
||||
{{ child.article.current_revision.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% empty %}
|
||||
<li><a href="#"><em>{% trans "No sub-articles" %}</em></a></li>
|
||||
{% endfor %}
|
||||
{% if children_slice_more %}
|
||||
<li><a href="#"><em>{% trans "...and more" %}</em></a></li>
|
||||
{% endif %}
|
||||
<li class="divider"></li>
|
||||
<li>
|
||||
<a href="" onclick="alert('TODO')">{% trans "List sub-pages" %} »</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="global-functions pull-right">
|
||||
<form class="search-wiki pull-left">
|
||||
<input type="search" placeholder="search wiki" />
|
||||
</form>
|
||||
<a class="add-article-btn btn pull-left" href="{% url 'wiki:create' path=urlpath.path %}" style="padding: 7px;">
|
||||
<span class="icon-plus"></span>
|
||||
{% trans "Add article" %}
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% endif %}
|
||||
33
lms/templates/wiki/preview_inline.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
{% load wiki_tags i18n %}{% load compressed %}
|
||||
<html>
|
||||
<head>
|
||||
{% compressed_css 'course' %}
|
||||
</head>
|
||||
<body>
|
||||
<section class="content-wrapper">
|
||||
{% if revision %}
|
||||
<div class="alert alert-info">
|
||||
<strong>{% trans "Previewing revision" %}:</strong> {{ revision.created }} (#{{ revision.revision_number }}) by {% if revision.user %}{{ revision.user }}{% else %}{% if user|is_moderator %}{{ revision.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if merge %}
|
||||
<div class="alert alert-info">
|
||||
<strong>{% trans "Previewing merge between" %}:</strong>
|
||||
{{ merge1.created }} (#{{ merge1.revision_number }}) by {% if merge1.user %}{{ merge1.user }}{% else %}{% if user|is_moderator %}{{ merge1.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %}
|
||||
<strong>{% trans "and" %}</strong>
|
||||
{{ merge1.created }} (#{{ merge1.revision_number }}) by {% if merge1.user %}{{ merge1.user }}{% else %}{% if user|is_moderator %}{{ merge1.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h1 class="page-header">{{ title }}</h1>
|
||||
|
||||
{% wiki_render article content %}
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
22
lms/urls.py
@@ -156,9 +156,25 @@ if settings.COURSEWARE_ENABLED:
|
||||
|
||||
# Multicourse wiki
|
||||
if settings.WIKI_ENABLED:
|
||||
urlpatterns += (
|
||||
url(r'^wiki/', include('simplewiki.urls')),
|
||||
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/wiki/', include('simplewiki.urls')),
|
||||
from wiki.urls import get_pattern as wiki_pattern
|
||||
from django_notify.urls import get_pattern as notify_pattern
|
||||
|
||||
# Note that some of these urls are repeated in course_wiki.course_nav. Make sure to update
|
||||
# them together.
|
||||
urlpatterns += (
|
||||
# First we include views from course_wiki that we use to override the default views.
|
||||
# They come first in the urlpatterns so they get resolved first
|
||||
url('^wiki/create-root/$', 'course_wiki.views.root_create', name='root_create'),
|
||||
|
||||
|
||||
url(r'^wiki/', include(wiki_pattern())),
|
||||
url(r'^notify/', include(notify_pattern())),
|
||||
|
||||
# These urls are for viewing the wiki in the context of a course. They should
|
||||
# never be returned by a reverse() so they come after the other url patterns
|
||||
url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/course_wiki/?$',
|
||||
'course_wiki.views.course_wiki_redirect', name="course_wiki"),
|
||||
url(r'^courses/(?:[^/]+/[^/]+/[^/]+)/wiki/', include(wiki_pattern())),
|
||||
)
|
||||
|
||||
if settings.QUICKEDIT:
|
||||
|
||||
@@ -43,4 +43,6 @@ django-robots
|
||||
django-ses
|
||||
django-storages
|
||||
django-threaded-multihost
|
||||
django-sekizai<0.7
|
||||
git+git://github.com/benjaoming/django-wiki.git@484ff1ce49
|
||||
-r repo-requirements.txt
|
||||
|
||||