diff --git a/.travis.yml b/.travis.yml index db0194a2c2c..73eb45ba391 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ before_script: - mysql -e 'create database kuma;' script: - - coverage run --include=`pwd`/kuma/*,`pwd`/apps/* manage.py test --noinput -v2 actioncounters contentflagging dashboards kuma.demos devmo kpi landing search kuma.users wiki kuma.events + - coverage run --include=`pwd`/kuma/*,`pwd`/apps/* manage.py test --noinput -v2 actioncounters contentflagging dashboards kuma.demos devmo kpi landing search kuma.users kuma.wiki kuma.events after_success: - coveralls diff --git a/apps/authkeys/urls.py b/apps/authkeys/urls.py index 3777d21fa26..c0dcd37d6a6 100644 --- a/apps/authkeys/urls.py +++ b/apps/authkeys/urls.py @@ -2,7 +2,7 @@ urlpatterns = patterns('authkeys.views', url(r'^$', 'list', name='authkeys.list'), - url(r'^new$', 'new', name='authkeys.new'), - url(r'^(?P\d+)/history$', 'history', name='authkeys.history'), - url(r'^(?P\d+)/delete$', 'delete', name='authkeys.delete'), + url(r'^/new$', 'new', name='authkeys.new'), + url(r'^/(?P\d+)/history$', 'history', name='authkeys.history'), + url(r'^/(?P\d+)/delete$', 'delete', name='authkeys.delete'), ) diff --git a/apps/contentflagging/tests.py b/apps/contentflagging/tests.py index 59fca1d1ec9..f513f1bad5f 100644 --- a/apps/contentflagging/tests.py +++ b/apps/contentflagging/tests.py @@ -21,11 +21,10 @@ from sumo.urlresolvers import reverse +from devmo.tests import LocalizingClient from kuma.demos.models import Submission from kuma.demos.tests.test_models import save_valid_submission -from devmo.tests import LocalizingClient -from wiki.models import Document - +from kuma.wiki.models import Document from .models import ContentFlag from .utils import get_ip, get_unique diff --git a/apps/dashboards/views.py b/apps/dashboards/views.py index a36d5b02bef..1bf8e071a81 100644 --- a/apps/dashboards/views.py +++ b/apps/dashboards/views.py @@ -1,17 +1,16 @@ -import json import datetime +import json from django.contrib.auth.models import User from django.http import HttpResponse from django.shortcuts import render from django.views.decorators.http import require_GET -from sumo.utils import paginate - -from wiki.models import Document, Revision - -from dashboards.forms import RevisionDashboardForm - +from kuma.users.helpers import ban_link +from kuma.wiki.models import Document, Revision +from sumo.urlresolvers import reverse +from sumo.utils import paginate, smart_int +from .forms import RevisionDashboardForm from . import PAGE_SIZE diff --git a/apps/devmo/helpers.py b/apps/devmo/helpers.py index 990a046857a..abecaae3cfe 100644 --- a/apps/devmo/helpers.py +++ b/apps/devmo/helpers.py @@ -1,10 +1,16 @@ import datetime +import os import re import urllib + +import bleach +import jinja2 +import pytz from urlobject import URLObject -import os from django.conf import settings + +from django.contrib.staticfiles.storage import staticfiles_storage from django.core.cache import cache from django.template import defaultfilters from django.utils.encoding import force_text @@ -12,17 +18,12 @@ from django.utils.safestring import mark_safe from django.contrib.messages.storage.base import LEVEL_TAGS -import bleach from jingo import register -import jinja2 -import pytz from soapbox.models import Message from statici18n.utils import get_filename -from django.contrib.staticfiles.storage import staticfiles_storage +from kuma.wiki.models import Document from sumo.urlresolvers import split_path, reverse -from wiki.models import Document - from .utils import entity_decode diff --git a/apps/kpi/cron.py b/apps/kpi/cron.py index b3615c9e083..441a3a75a2b 100644 --- a/apps/kpi/cron.py +++ b/apps/kpi/cron.py @@ -3,7 +3,7 @@ import cronjobs from kpi.models import Metric, MetricKind, L10N_METRIC_CODE -from wiki.models import Document +from kuma.wiki.models import Document @cronjobs.register diff --git a/apps/kpi/tests/test_cron.py b/apps/kpi/tests/test_cron.py index a2690f488cf..583f76d568d 100644 --- a/apps/kpi/tests/test_cron.py +++ b/apps/kpi/tests/test_cron.py @@ -6,8 +6,8 @@ from kpi.cron import update_l10n_metric from kpi.models import Metric, L10N_METRIC_CODE from kpi.tests import metric_kind +from kuma.wiki.tests import document, revision from sumo.tests import TestCase -from wiki.tests import document, revision class CronJobTests(TestCase): diff --git a/apps/landing/templates/landing/homepage.html b/apps/landing/templates/landing/homepage.html index 7db22b63ea3..a06f0fe27cd 100644 --- a/apps/landing/templates/landing/homepage.html +++ b/apps/landing/templates/landing/homepage.html @@ -169,5 +169,8 @@

{{ _('Help improve MDN') }}< {% block js %} {{ super() }} - {{ js('home', async=True) }} + {% endblock %} diff --git a/apps/landing/templates/landing/learn_html.html b/apps/landing/templates/landing/learn_html.html index c4d88791b83..932a131916e 100644 --- a/apps/landing/templates/landing/learn_html.html +++ b/apps/landing/templates/landing/learn_html.html @@ -28,11 +28,6 @@

{{ _('Learn HTML') }}

{{ _('Introductory Level') }}

diff --git a/apps/wiki/templates/wiki/includes/document_toc_field.html b/kuma/wiki/templates/wiki/includes/document_toc_field.html similarity index 100% rename from apps/wiki/templates/wiki/includes/document_toc_field.html rename to kuma/wiki/templates/wiki/includes/document_toc_field.html diff --git a/apps/wiki/templates/wiki/includes/guide_links.html b/kuma/wiki/templates/wiki/includes/guide_links.html similarity index 100% rename from apps/wiki/templates/wiki/includes/guide_links.html rename to kuma/wiki/templates/wiki/includes/guide_links.html diff --git a/apps/wiki/templates/wiki/includes/kumascript_errors.html b/kuma/wiki/templates/wiki/includes/kumascript_errors.html similarity index 100% rename from apps/wiki/templates/wiki/includes/kumascript_errors.html rename to kuma/wiki/templates/wiki/includes/kumascript_errors.html diff --git a/apps/wiki/templates/wiki/includes/more_help.html b/kuma/wiki/templates/wiki/includes/more_help.html similarity index 100% rename from apps/wiki/templates/wiki/includes/more_help.html rename to kuma/wiki/templates/wiki/includes/more_help.html diff --git a/apps/wiki/templates/wiki/includes/page_buttons.html b/kuma/wiki/templates/wiki/includes/page_buttons.html similarity index 93% rename from apps/wiki/templates/wiki/includes/page_buttons.html rename to kuma/wiki/templates/wiki/includes/page_buttons.html index ec5189d2b82..0311fc32257 100644 --- a/apps/wiki/templates/wiki/includes/page_buttons.html +++ b/kuma/wiki/templates/wiki/includes/page_buttons.html @@ -26,9 +26,11 @@
  • + {% if (not document and not is_template) or (document and not document.is_template) %}
  • + {% endif %}
  • {{ _('Discard Changes') }}
  • diff --git a/apps/wiki/templates/wiki/includes/review_tags.html b/kuma/wiki/templates/wiki/includes/review_tags.html similarity index 100% rename from apps/wiki/templates/wiki/includes/review_tags.html rename to kuma/wiki/templates/wiki/includes/review_tags.html diff --git a/apps/wiki/templates/wiki/includes/revision_comment.html b/kuma/wiki/templates/wiki/includes/revision_comment.html similarity index 100% rename from apps/wiki/templates/wiki/includes/revision_comment.html rename to kuma/wiki/templates/wiki/includes/revision_comment.html diff --git a/apps/wiki/templates/wiki/includes/revision_diff.html b/kuma/wiki/templates/wiki/includes/revision_diff.html similarity index 100% rename from apps/wiki/templates/wiki/includes/revision_diff.html rename to kuma/wiki/templates/wiki/includes/revision_diff.html diff --git a/apps/wiki/templates/wiki/includes/revision_diff_table.html b/kuma/wiki/templates/wiki/includes/revision_diff_table.html similarity index 100% rename from apps/wiki/templates/wiki/includes/revision_diff_table.html rename to kuma/wiki/templates/wiki/includes/revision_diff_table.html diff --git a/apps/wiki/templates/wiki/includes/tag_suggestions.html b/kuma/wiki/templates/wiki/includes/tag_suggestions.html similarity index 100% rename from apps/wiki/templates/wiki/includes/tag_suggestions.html rename to kuma/wiki/templates/wiki/includes/tag_suggestions.html diff --git a/apps/wiki/templates/wiki/includes/translate_description.html b/kuma/wiki/templates/wiki/includes/translate_description.html similarity index 100% rename from apps/wiki/templates/wiki/includes/translate_description.html rename to kuma/wiki/templates/wiki/includes/translate_description.html diff --git a/apps/wiki/templates/wiki/list_documents.html b/kuma/wiki/templates/wiki/list_documents.html similarity index 100% rename from apps/wiki/templates/wiki/list_documents.html rename to kuma/wiki/templates/wiki/list_documents.html diff --git a/apps/wiki/templates/wiki/list_documents_for_review.html b/kuma/wiki/templates/wiki/list_documents_for_review.html similarity index 100% rename from apps/wiki/templates/wiki/list_documents_for_review.html rename to kuma/wiki/templates/wiki/list_documents_for_review.html diff --git a/apps/wiki/templates/wiki/list_documents_with_localization_tags.html b/kuma/wiki/templates/wiki/list_documents_with_localization_tags.html similarity index 100% rename from apps/wiki/templates/wiki/list_documents_with_localization_tags.html rename to kuma/wiki/templates/wiki/list_documents_with_localization_tags.html diff --git a/apps/wiki/templates/wiki/list_files.html b/kuma/wiki/templates/wiki/list_files.html similarity index 100% rename from apps/wiki/templates/wiki/list_files.html rename to kuma/wiki/templates/wiki/list_files.html diff --git a/apps/wiki/templates/wiki/list_tags.html b/kuma/wiki/templates/wiki/list_tags.html similarity index 100% rename from apps/wiki/templates/wiki/list_tags.html rename to kuma/wiki/templates/wiki/list_tags.html diff --git a/apps/wiki/templates/wiki/move_document.html b/kuma/wiki/templates/wiki/move_document.html similarity index 100% rename from apps/wiki/templates/wiki/move_document.html rename to kuma/wiki/templates/wiki/move_document.html diff --git a/apps/wiki/templates/wiki/move_requested.html b/kuma/wiki/templates/wiki/move_requested.html similarity index 100% rename from apps/wiki/templates/wiki/move_requested.html rename to kuma/wiki/templates/wiki/move_requested.html diff --git a/apps/wiki/templates/wiki/new_document.html b/kuma/wiki/templates/wiki/new_document.html similarity index 97% rename from apps/wiki/templates/wiki/new_document.html rename to kuma/wiki/templates/wiki/new_document.html index dace61654c3..e5588c2792a 100644 --- a/apps/wiki/templates/wiki/new_document.html +++ b/kuma/wiki/templates/wiki/new_document.html @@ -1,6 +1,6 @@ {% extends "wiki/base.html" %} {% from "includes/error_list.html" import errorlist %} -{% from 'wiki/includes/page_buttons.html' import page_buttons %} +{% from 'wiki/includes/page_buttons.html' import page_buttons with context %} {% from "includes/common_macros.html" import content_editor %} {% set title = _('Create a New {title}')|fe(title=('Template' if is_template else 'Article')) %} {% block title %}{{ page_title(title) }}{% endblock %} diff --git a/apps/wiki/templates/wiki/preview.html b/kuma/wiki/templates/wiki/preview.html similarity index 100% rename from apps/wiki/templates/wiki/preview.html rename to kuma/wiki/templates/wiki/preview.html diff --git a/apps/wiki/templates/wiki/revision.html b/kuma/wiki/templates/wiki/revision.html similarity index 100% rename from apps/wiki/templates/wiki/revision.html rename to kuma/wiki/templates/wiki/revision.html diff --git a/apps/wiki/templates/wiki/select_locale.html b/kuma/wiki/templates/wiki/select_locale.html similarity index 100% rename from apps/wiki/templates/wiki/select_locale.html rename to kuma/wiki/templates/wiki/select_locale.html diff --git a/apps/wiki/templates/wiki/sitemap.xml b/kuma/wiki/templates/wiki/sitemap.xml similarity index 100% rename from apps/wiki/templates/wiki/sitemap.xml rename to kuma/wiki/templates/wiki/sitemap.xml diff --git a/apps/wiki/templates/wiki/sphinx.html b/kuma/wiki/templates/wiki/sphinx.html similarity index 100% rename from apps/wiki/templates/wiki/sphinx.html rename to kuma/wiki/templates/wiki/sphinx.html diff --git a/apps/wiki/templates/wiki/translate.html b/kuma/wiki/templates/wiki/translate.html similarity index 100% rename from apps/wiki/templates/wiki/translate.html rename to kuma/wiki/templates/wiki/translate.html diff --git a/apps/wiki/templates/wikiparser/hook_video.html b/kuma/wiki/templates/wikiparser/hook_video.html similarity index 100% rename from apps/wiki/templates/wikiparser/hook_video.html rename to kuma/wiki/templates/wikiparser/hook_video.html diff --git a/apps/wiki/tests/__init__.py b/kuma/wiki/tests/__init__.py similarity index 98% rename from apps/wiki/tests/__init__.py rename to kuma/wiki/tests/__init__.py index cba7854d5c2..4aa48422258 100644 --- a/apps/wiki/tests/__init__.py +++ b/kuma/wiki/tests/__init__.py @@ -10,9 +10,9 @@ from waffle.models import Flag from devmo.tests import LocalizingClient +import kuma.wiki.content +from kuma.wiki.models import Document, Revision from sumo.tests import TestCase, get_user -import wiki.content -from wiki.models import Document, Revision class TestCaseBase(TestCase): @@ -151,7 +151,7 @@ def __iter__(self): continue yield token - return (wiki.content + return (kuma.wiki.content .parse(unicode(input)) .filter(WhitespaceRemovalFilter) .serialize()) diff --git a/apps/wiki/tests/test_content.py b/kuma/wiki/tests/test_content.py similarity index 95% rename from apps/wiki/tests/test_content.py rename to kuma/wiki/tests/test_content.py index 8a293b67f65..ff3af26013d 100644 --- a/apps/wiki/tests/test_content.py +++ b/kuma/wiki/tests/test_content.py @@ -1,27 +1,27 @@ # This Python file uses the following encoding: utf-8 # see also: http://www.python.org/dev/peps/pep-0263/ from urlparse import urljoin -from jinja2 import escape, Markup +import bleach +from jinja2 import escape, Markup from nose.tools import eq_, ok_ from nose.plugins.attrib import attr - from pyquery import PyQuery as pq -import bleach + +import kuma.wiki.content +from kuma.wiki.content import (CodeSyntaxFilter, DekiscriptMacroFilter, + SectionTOCFilter, SectionIDFilter, + H2TOCFilter, H3TOCFilter, + SECTION_TAGS, get_seo_description, + get_content_sections, extract_css_classnames, + extract_html_attributes, + extract_kumascript_macro_names) +from kuma.wiki.constants import ALLOWED_TAGS, ALLOWED_ATTRIBUTES +from kuma.wiki.models import Document +from kuma.wiki.tests import normalize_html, doc_rev, document +from kuma.wiki.helpers import bugize_text from sumo.tests import TestCase -import wiki.content -from wiki.content import (CodeSyntaxFilter, DekiscriptMacroFilter, - SectionTOCFilter, SectionIDFilter, - H2TOCFilter, H3TOCFilter, - SECTION_TAGS, get_seo_description, - get_content_sections, extract_css_classnames, - extract_html_attributes, - extract_kumascript_macro_names) -from wiki.constants import ALLOWED_TAGS, ALLOWED_ATTRIBUTES -from wiki.models import Document -from wiki.tests import normalize_html, doc_rev, document -from wiki.helpers import bugize_text class ContentSectionToolTests(TestCase): @@ -57,7 +57,7 @@ def test_section_ids(self): """ - result_src = (wiki.content + result_src = (kuma.wiki.content .parse(doc_src) .injectSectionIDs() .serialize()) @@ -93,7 +93,7 @@ def test_incremented_section_ids(self):

    Header Two

    """ - result_src = (wiki.content + result_src = (kuma.wiki.content .parse(doc_src) .injectSectionIDs() .serialize()) @@ -109,7 +109,7 @@ def test_incremented_section_ids(self): eq_(result_src, expected) # Ensure 1, 2 doesn't turn into 3, 4 - result_src = (wiki.content + result_src = (kuma.wiki.content .parse(expected) .injectSectionIDs() .serialize()) @@ -130,7 +130,7 @@ def test_simple_implicit_section_extract(self):

    test

    test

    """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .extractSection(id="s1") .serialize()) @@ -171,7 +171,7 @@ def test_contained_implicit_section_extract(self):

    test

    test

    """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .extractSection(id="s5") .serialize()) @@ -215,7 +215,7 @@ def test_explicit_section_extract(self):

    test

    test

    """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .extractSection(id="parent-s5") .serialize()) @@ -249,7 +249,7 @@ def test_multilevel_implicit_section_extract(self):

    test

    test

    """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .extractSection(id="s4") .serialize()) @@ -296,7 +296,7 @@ def test_morelevels_implicit_section_extract(self):

    Head

    test

    """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .extractSection(id="s8") .serialize()) @@ -328,7 +328,7 @@ def test_basic_section_replace(self):

    test

    test

    """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .replaceSection(id="s2", replace_src=replace_src) .serialize()) @@ -357,7 +357,7 @@ def test_section_edit_links(self):

    test

    test

    """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .injectSectionEditingLinks('some-slug', 'en-US') .serialize()) @@ -388,7 +388,7 @@ def test_code_syntax_conversion(self): .dek-trans { color: red; } """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .filter(CodeSyntaxFilter).serialize()) eq_(normalize_html(expected), normalize_html(result)) @@ -465,7 +465,7 @@ def test_generate_toc(self): """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .filter(SectionTOCFilter).serialize()) eq_(normalize_html(expected), normalize_html(result)) @@ -493,7 +493,7 @@ def test_generate_toc_h2(self):
  • CSS
  • """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .filter(H2TOCFilter).serialize()) eq_(normalize_html(expected), normalize_html(result)) @@ -532,7 +532,7 @@ def test_generate_toc_h3(self): """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .filter(H3TOCFilter).serialize()) eq_(normalize_html(expected), normalize_html(result)) @@ -548,7 +548,7 @@ def test_bug_925043(self): Masteringprint """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .filter(SectionTOCFilter).serialize()) eq_(normalize_html(expected), normalize_html(result)) @@ -585,13 +585,13 @@ def test_dekiscript_macro_conversion(self): doc_src_lines = doc_src.split("\n") expected_lines = expected.split("\n") for i in range(0, len(doc_src_lines)): - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src_lines[i]) .filter(DekiscriptMacroFilter).serialize()) eq_(normalize_html(expected_lines[i]), normalize_html(result)) # But, the whole thing should work in the filter, as well. - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .filter(DekiscriptMacroFilter).serialize()) eq_(normalize_html(expected), normalize_html(result)) @@ -615,7 +615,7 @@ def test_noinclude(self):
    Przykłady 例 예제 示例
    """ - result = (wiki.content.filter_out_noinclude(doc_src)) + result = (kuma.wiki.content.filter_out_noinclude(doc_src)) eq_(normalize_html(expected), normalize_html(result)) def test_noinclude_empty_content(self): @@ -623,7 +623,7 @@ def test_noinclude_empty_content(self): empty string as input""" doc_src = '' try: - result = wiki.content.filter_out_noinclude(doc_src) + result = kuma.wiki.content.filter_out_noinclude(doc_src) eq_('', result) except: ok_(False, "There should not have been an exception") @@ -688,31 +688,31 @@ def test_sample_code_extraction(self): """ % (escape(sample_html), escape(sample_css), escape(sample_js)) # live sample using the section logic - result = wiki.content.extract_code_sample('sample0', doc_src) + result = kuma.wiki.content.extract_code_sample('sample0', doc_src) eq_('section html', result['html'].strip()) eq_('section css', result['css'].strip()) eq_('section js', result['js'].strip()) # pull out a complete sample. - result = wiki.content.extract_code_sample('sample2', doc_src) + result = kuma.wiki.content.extract_code_sample('sample2', doc_src) eq_(sample_html.strip(), result['html'].strip()) eq_(sample_css.strip(), result['css'].strip()) eq_(sample_js.strip(), result['js'].strip()) # a sample missing one part. - result = wiki.content.extract_code_sample('sample3', doc_src) + result = kuma.wiki.content.extract_code_sample('sample3', doc_src) eq_('Ignore me', result['html'].strip()) eq_(None, result['css']) eq_('Ignore me', result['js'].strip()) # a sample with only one part. - result = wiki.content.extract_code_sample('sample4', doc_src) + result = kuma.wiki.content.extract_code_sample('sample4', doc_src) eq_(None, result['html']) eq_(None, result['css']) eq_('Ignore me', result['js'].strip()) # a "sample" with no code listings. - result = wiki.content.extract_code_sample('not-a-sample', doc_src) + result = kuma.wiki.content.extract_code_sample('not-a-sample', doc_src) eq_(None, result['html']) eq_(None, result['css']) eq_(None, result['js']) @@ -732,7 +732,7 @@ def test_bug819999(self): } """ - result = wiki.content.extract_code_sample('bug819999', doc_src) + result = kuma.wiki.content.extract_code_sample('bug819999', doc_src) ok_(result['css'].find(u'\xa0') == -1) def test_bugize_text(self): @@ -757,7 +757,7 @@ def test_iframe_host_filter(self):

    test

    """ % dict(embed_url=embed_url) - result_src = (wiki.content.parse(doc_src) + result_src = (kuma.wiki.content.parse(doc_src) .filterIframeHosts('^https?\:\/\/sampleserver') .serialize()) page = pq(result_src) @@ -782,7 +782,7 @@ def test_iframe_host_filter_invalid_host(self):

    test

    """ - result_src = (wiki.content.parse(doc_src) + result_src = (kuma.wiki.content.parse(doc_src) .filterIframeHosts('^https?\:\/\/(sample|test)server') .serialize()) page = pq(result_src) @@ -804,9 +804,9 @@ def test_iframe_host_filter_youtube(self):

    test

    """ % tubes - result_src = (wiki.content.parse(doc_src) - .filterIframeHosts('^https?\:\/\/(www.)?youtube.com\/embed\/(\.*)') - .serialize()) + result_src = (kuma.wiki.content.parse(doc_src) + .filterIframeHosts('^https?\:\/\/(www.)?youtube.com\/embed\/(\.*)') + .serialize()) page = pq(result_src) eq_(page.find('#if1').attr('src'), tubes[0]) @@ -824,7 +824,7 @@ def test_iframe_host_contents_filter(self): """ - result_src = (wiki.content.parse(doc_src) + result_src = (kuma.wiki.content.parse(doc_src) .filterIframeHosts('^https?\:\/\/sampleserver') .serialize()) eq_(normalize_html(expected_src), normalize_html(result_src)) @@ -913,7 +913,7 @@ def test_link_annotation(self): for idx in range(0, len(doc_lines)): doc_line = doc_lines[idx] expected_line = expected_lines[idx] - result_line = (wiki.content.parse(doc_line) + result_line = (kuma.wiki.content.parse(doc_line) .annotateLinks(base_url=vars['base_url']) .serialize()) eq_(normalize_html(expected_line), normalize_html(result_line)) @@ -943,7 +943,7 @@ def test_editor_safety_filter(self):

    Header Three

    test

    """ - result_src = (wiki.content.parse(doc_src) + result_src = (kuma.wiki.content.parse(doc_src) .filterEditorSafety() .serialize()) eq_(normalize_html(expected_src), normalize_html(result_src)) @@ -965,7 +965,7 @@ def test_ignore_heading_section_extract(self):

    Head 4-1-1

    test s4-2

    """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .extractSection(id="s4-1", ignore_heading=True) .serialize()) @@ -996,7 +996,7 @@ def test_ignore_heading_section_replace(self):

    test

    test

    """ - result = (wiki.content + result = (kuma.wiki.content .parse(doc_src) .replaceSection(id="s2", replace_src=replace_src, diff --git a/apps/wiki/tests/test_cron.py b/kuma/wiki/tests/test_cron.py similarity index 94% rename from apps/wiki/tests/test_cron.py rename to kuma/wiki/tests/test_cron.py index 42933db1a0a..e5cc33375d8 100644 --- a/apps/wiki/tests/test_cron.py +++ b/kuma/wiki/tests/test_cron.py @@ -2,9 +2,9 @@ from django.conf import settings +from kuma.wiki.cron import build_sitemaps +from kuma.wiki.models import Document from sumo.tests import TestCase -from wiki.cron import build_sitemaps -from wiki.models import Document class SitemapsTestCase(TestCase): diff --git a/apps/wiki/tests/test_events.py b/kuma/wiki/tests/test_events.py similarity index 78% rename from apps/wiki/tests/test_events.py rename to kuma/wiki/tests/test_events.py index ec871e3a6d0..b0643bda6b2 100644 --- a/apps/wiki/tests/test_events.py +++ b/kuma/wiki/tests/test_events.py @@ -1,7 +1,7 @@ from nose.tools import eq_ -from wiki.tests import TestCaseBase, revision -from wiki.events import context_dict +from kuma.wiki.events import context_dict +from kuma.wiki.tests import TestCaseBase, revision class NotificationEmailTests(TestCaseBase): diff --git a/apps/wiki/tests/test_feeds.py b/kuma/wiki/tests/test_feeds.py similarity index 98% rename from apps/wiki/tests/test_feeds.py rename to kuma/wiki/tests/test_feeds.py index 9cee233690b..7af8bff6a08 100644 --- a/apps/wiki/tests/test_feeds.py +++ b/kuma/wiki/tests/test_feeds.py @@ -2,17 +2,17 @@ # This Python file uses the following encoding: utf-8 # see also: http://www.python.org/dev/peps/pep-0263/ -import time import datetime import json import hashlib +import time from nose.tools import eq_, ok_ from pyquery import PyQuery as pq +from kuma.wiki.tests import (TestCaseBase, document, revision, make_translation, + wait_add_rev) from sumo.urlresolvers import reverse -from wiki.tests import (TestCaseBase, document, revision, make_translation, - wait_add_rev) class FeedTests(TestCaseBase): diff --git a/apps/wiki/tests/test_forms.py b/kuma/wiki/tests/test_forms.py similarity index 96% rename from apps/wiki/tests/test_forms.py rename to kuma/wiki/tests/test_forms.py index 0b7095dbc1e..3bbbe7546f6 100644 --- a/apps/wiki/tests/test_forms.py +++ b/kuma/wiki/tests/test_forms.py @@ -1,9 +1,9 @@ from nose.tools import eq_, ok_ from nose.plugins.attrib import attr +from kuma.wiki.forms import RevisionForm, RevisionValidationForm, TreeMoveForm +from kuma.wiki.tests import doc_rev, normalize_html from sumo.tests import TestCase -from wiki.forms import RevisionForm, RevisionValidationForm, TreeMoveForm -from wiki.tests import doc_rev, normalize_html class FormEditorSafetyFilterTests(TestCase): diff --git a/apps/wiki/tests/test_helpers.py b/kuma/wiki/tests/test_helpers.py similarity index 93% rename from apps/wiki/tests/test_helpers.py rename to kuma/wiki/tests/test_helpers.py index d2cc71b2a59..76af5da5775 100644 --- a/apps/wiki/tests/test_helpers.py +++ b/kuma/wiki/tests/test_helpers.py @@ -2,10 +2,10 @@ from django.contrib.auth.models import User -from wiki.tests import TestCaseBase, revision -from wiki.helpers import (revisions_unified_diff, - document_zone_management_links, tojson) -from wiki.models import DocumentZone +from kuma.wiki.models import DocumentZone +from kuma.wiki.helpers import (revisions_unified_diff, + document_zone_management_links, tojson) +from kuma.wiki.tests import TestCaseBase, revision class HelpTests(TestCaseBase): diff --git a/apps/wiki/tests/test_kumascript.py b/kuma/wiki/tests/test_kumascript.py similarity index 96% rename from apps/wiki/tests/test_kumascript.py rename to kuma/wiki/tests/test_kumascript.py index 77a34eb0fb4..21d2e120cf4 100644 --- a/apps/wiki/tests/test_kumascript.py +++ b/kuma/wiki/tests/test_kumascript.py @@ -2,10 +2,11 @@ # see also: http://www.python.org/dev/peps/pep-0263/ import json import base64 + from nose.tools import eq_ from . import TestCaseBase -from wiki import kumascript +from kuma.wiki import kumascript class KumascriptClientTests(TestCaseBase): diff --git a/apps/wiki/tests/test_middleware.py b/kuma/wiki/tests/test_middleware.py similarity index 97% rename from apps/wiki/tests/test_middleware.py rename to kuma/wiki/tests/test_middleware.py index b5f3b653d12..ad8901ed7eb 100644 --- a/apps/wiki/tests/test_middleware.py +++ b/kuma/wiki/tests/test_middleware.py @@ -4,11 +4,11 @@ from nose.tools import eq_ from sumo.urlresolvers import reverse -from . import TestCaseBase +from kuma.wiki.constants import SECONDARY_CACHE_ALIAS +from kuma.wiki.models import DocumentZone +from kuma.wiki.tests import revision -from wiki.constants import SECONDARY_CACHE_ALIAS -from wiki.models import DocumentZone -from wiki.tests import revision +from . import TestCaseBase class DocumentZoneMiddlewareTestCase(TestCaseBase): diff --git a/apps/wiki/tests/test_models.py b/kuma/wiki/tests/test_models.py similarity index 98% rename from apps/wiki/tests/test_models.py rename to kuma/wiki/tests/test_models.py index 641f3a5b402..8278130460c 100644 --- a/apps/wiki/tests/test_models.py +++ b/kuma/wiki/tests/test_models.py @@ -1,41 +1,37 @@ +from cStringIO import StringIO from datetime import datetime, timedelta import json import time from xml.sax.saxutils import escape -from django.conf import settings - -from cStringIO import StringIO import mock from nose.tools import eq_, ok_ from nose.plugins.attrib import attr from nose import SkipTest +from django.conf import settings from django.core.exceptions import ValidationError from django.contrib.auth.models import User, Group, Permission from django.contrib.contenttypes.models import ContentType import constance.config - from waffle.models import Switch -from sumo import ProgrammingError -from sumo.tests import TestCase - from devmo.utils import MemcacheLock from devmo.tests import override_constance_settings - -from wiki.cron import calculate_related_documents -from wiki.exceptions import (PageMoveError, - DocumentRenderedContentNotAvailable, - DocumentRenderingInProgress) -from wiki.models import (Document, Revision, - Attachment, DocumentZone, - TaggedDocument,) -from wiki.tests import (document, revision, doc_rev, normalize_html, - create_template_test_users, - create_topical_parents_docs) -from wiki import tasks +from kuma.wiki.cron import calculate_related_documents +from kuma.wiki.exceptions import (PageMoveError, + DocumentRenderedContentNotAvailable, + DocumentRenderingInProgress) +from kuma.wiki.models import (Document, Revision, + Attachment, DocumentZone, + TaggedDocument,) +from kuma.wiki import tasks +from kuma.wiki.tests import (document, revision, doc_rev, normalize_html, + create_template_test_users, + create_topical_parents_docs) +from sumo import ProgrammingError +from sumo.tests import TestCase def _objects_eq(manager, list_): @@ -939,7 +935,7 @@ def test_rendering_fields(self): ok_(not self.d1.is_rendering_in_progress) @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_get_rendered(self, mock_kumascript_get): """get_rendered() should return rendered content when available, attempt a render() when it's not""" @@ -969,7 +965,7 @@ def test_get_rendered(self, mock_kumascript_get): @attr('bug875349') @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_build_json_on_render(self, mock_kumascript_get): """ A document's json field is refreshed on render(), but not on save() @@ -995,7 +991,7 @@ def test_build_json_on_render(self, mock_kumascript_get): self.d1.render() eq_(self.d1.title, self.d1.get_json_data()['title']) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_get_summary(self, mock_kumascript_get): """get_summary() should attempt to use rendered""" raise SkipTest("Transient failures here, skip for now") @@ -1010,7 +1006,7 @@ def test_get_summary(self, mock_kumascript_get): constance.config.KUMASCRIPT_TIMEOUT = 0.0 - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_one_render_at_a_time(self, mock_kumascript_get): """Only one in-progress rendering should be allowed for a Document""" mock_kumascript_get.return_value = (self.rendered_content, None) @@ -1023,7 +1019,7 @@ def test_one_render_at_a_time(self, mock_kumascript_get): except DocumentRenderingInProgress: pass - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_render_timeout(self, mock_kumascript_get): """ A rendering that has taken too long is no longer considered in progress @@ -1040,7 +1036,7 @@ def test_render_timeout(self, mock_kumascript_get): ok_(False, "A timed-out rendering should not be considered as " "still in progress") - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_long_render_sets_deferred(self, mock_kumascript_get): """A rendering that takes more than a desired response time marks the document as in need of deferred rendering in the future.""" @@ -1062,7 +1058,7 @@ def my_kumascript_get(self, cache_control, base_url, timeout): ok_(self.d1.defer_rendering) constance.config.KUMASCRIPT_TIMEOUT = 0.0 - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') @mock.patch_object(tasks.render_document, 'delay') def test_schedule_rendering(self, mock_render_document_delay, mock_kumascript_get): @@ -1097,7 +1093,7 @@ def test_schedule_rendering(self, mock_render_document_delay, ok_(self.d1.is_rendering_scheduled) ok_(not self.d1.is_rendering_in_progress) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') @mock.patch_object(tasks.render_document, 'delay') def test_deferred_vs_immediate_rendering(self, mock_render_document_delay, mock_kumascript_get): @@ -1139,7 +1135,7 @@ def test_deferred_vs_immediate_rendering(self, mock_render_document_delay, pass ok_(mock_render_document_delay.called) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_errors_stored_correctly(self, mock_kumascript_get): errors = [ {'level': 'error', 'message': 'This is a fake error', @@ -1178,7 +1174,7 @@ def test_find_stale_documents(self): sorted([x.pk for x in stale_docs])) @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_update_expires_with_max_age(self, mock_kumascript_get): mock_kumascript_get.return_value = ('MOCK CONTENT', None) @@ -1196,7 +1192,7 @@ def test_update_expires_with_max_age(self, mock_kumascript_get): ok_(d1.render_expires < later + timedelta(seconds=1)) @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_update_expires_without_max_age(self, mock_kumascript_get): mock_kumascript_get.return_value = ('MOCK CONTENT', None) @@ -1209,7 +1205,7 @@ def test_update_expires_without_max_age(self, mock_kumascript_get): ok_(not d1.render_expires) @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_render_stale(self, mock_kumascript_get): mock_kumascript_get.return_value = ('MOCK CONTENT', None) @@ -1232,7 +1228,7 @@ def test_render_stale(self, mock_kumascript_get): ok_(d1_fresh.last_rendered_at > earlier) @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') @mock.patch_object(tasks.render_document, 'delay') def test_render_stale_immediate(self, mock_render_document_delay, mock_kumascript_get): diff --git a/apps/wiki/tests/test_templates.py b/kuma/wiki/tests/test_templates.py similarity index 98% rename from apps/wiki/tests/test_templates.py rename to kuma/wiki/tests/test_templates.py index b3be13323de..a9b0b7f21dd 100644 --- a/apps/wiki/tests/test_templates.py +++ b/kuma/wiki/tests/test_templates.py @@ -1,7 +1,14 @@ # This Python file uses the following encoding: utf-8 from datetime import datetime, timedelta -import urllib import time +import urllib + +from BeautifulSoup import BeautifulSoup +import mock +from nose import SkipTest +from nose.tools import eq_, ok_ +from nose.plugins.attrib import attr +from pyquery import PyQuery as pq from django.conf import settings from django.contrib.auth.models import User @@ -11,26 +18,19 @@ from django.test.client import Client from django.test.utils import override_settings -import mock -from BeautifulSoup import BeautifulSoup -from nose import SkipTest -from nose.tools import eq_, ok_ -from nose.plugins.attrib import attr -from pyquery import PyQuery as pq -from waffle.models import Flag - import constance.config +from waffle.models import Flag +from devmo.tests import SkippedTestCase +from kuma.wiki.events import EditDocumentEvent +from kuma.wiki.constants import REDIRECT_CONTENT, TEMPLATE_TITLE_PREFIX +from kuma.wiki.models import (Document, Revision, HelpfulVote, + DocumentTag, Attachment) +from kuma.wiki.tests import (TestCaseBase, document, revision, new_document_data, + create_topical_parents_docs, make_test_file) from sumo.urlresolvers import reverse from sumo.helpers import urlparams from sumo.tests import post, get -from wiki.events import EditDocumentEvent -from wiki.constants import REDIRECT_CONTENT -from wiki.models import (Document, Revision, HelpfulVote, - DocumentTag, Attachment) -from wiki.tests import (TestCaseBase, document, revision, new_document_data, - create_topical_parents_docs, make_test_file) -from devmo.tests import SkippedTestCase DOCUMENT_EDITED_EMAIL_CONTENT = """ @@ -307,6 +307,20 @@ def test_new_document_GET_with_perm(self): doc = pq(response.content) eq_(1, len(doc('form#wiki-page-edit input[name="title"]'))) + def test_new_document_preview_button(self): + """HTTP GET to new document URL shows preview button for basic doc + and not for template doc""" + self.client.login(username='admin', password='testpass') + response = self.client.get(reverse('wiki.new_document')) + eq_(200, response.status_code) + doc = pq(response.content) + ok_(len(doc('.btn-preview')) > 0) + + response = self.client.get(reverse('wiki.new_document') + + '?slug=' + TEMPLATE_TITLE_PREFIX) + doc = pq(response.content) + eq_(0, len(doc('.btn-preview'))) + def test_new_document_form_defaults(self): """The new document form should have all all 'Relevant to' options checked by default.""" diff --git a/apps/wiki/tests/test_views.py b/kuma/wiki/tests/test_views.py similarity index 99% rename from apps/wiki/tests/test_views.py rename to kuma/wiki/tests/test_views.py index f1658831b69..fd763609fa5 100644 --- a/apps/wiki/tests/test_views.py +++ b/kuma/wiki/tests/test_views.py @@ -1,9 +1,15 @@ # coding=utf-8 +import base64 import datetime import json -import base64 -import time import logging +import time + +import mock +from nose import SkipTest +from nose.tools import eq_, ok_ +from nose.plugins.attrib import attr +from pyquery import PyQuery as pq from urlparse import urlparse @@ -19,36 +25,26 @@ from django.http import Http404 from django.utils.encoding import smart_str -import mock -from nose import SkipTest -from nose.tools import eq_, ok_ -from nose.plugins.attrib import attr -from pyquery import PyQuery as pq - import constance.config - from waffle.models import Flag +from authkeys.models import Key +from devmo.tests import override_constance_settings +from . import TestCaseBase, FakeResponse, make_test_file +from kuma.wiki.constants import DOCUMENT_LAST_MODIFIED_CACHE_KEY_TMPL +import kuma.wiki.content +from kuma.wiki.content import get_seo_description +from kuma.wiki.events import EditDocumentEvent +from kuma.wiki.models import (Document, Revision, Attachment, DocumentZone, + AttachmentRevision, DocumentAttachment) +from kuma.wiki.tests import (doc_rev, document, new_document_data, revision, + normalize_html, create_template_test_users, + make_translation) +from kuma.wiki.forms import MIDAIR_COLLISION from sumo.tests import post, get from sumo.helpers import urlparams from sumo.urlresolvers import reverse -from devmo.tests import override_constance_settings - -from . import TestCaseBase, FakeResponse, make_test_file - -from authkeys.models import Key - -from wiki.constants import DOCUMENT_LAST_MODIFIED_CACHE_KEY_TMPL -from wiki.content import get_seo_description -from wiki.events import EditDocumentEvent -from wiki.models import (Document, Revision, Attachment, DocumentZone, - AttachmentRevision, DocumentAttachment) -from wiki.tests import (doc_rev, document, new_document_data, revision, - normalize_html, create_template_test_users, - make_translation) -from wiki.forms import MIDAIR_COLLISION - class RedirectTests(TestCaseBase): """Tests for the REDIRECT wiki directive""" @@ -578,7 +574,7 @@ def setUp(self): # TODO: upgrade mock to 0.8.0 so we can do this. # self.mock_kumascript_get = ( - # mock.patch('wiki.kumascript.get')) + # mock.patch('kuma.wiki.kumascript.get')) # self.mock_kumascript_get.return_value = self.d.html def tearDown(self): @@ -589,7 +585,7 @@ def tearDown(self): # self.mock_kumascript_get.stop() @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_basic_view(self, mock_kumascript_get): """When kumascript timeout is non-zero, the service should be used""" mock_kumascript_get.return_value = (self.d.html, None) @@ -598,7 +594,7 @@ def test_basic_view(self, mock_kumascript_get): "kumascript should have been used") @override_constance_settings(KUMASCRIPT_TIMEOUT=0.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_disabled(self, mock_kumascript_get): """When disabled, the kumascript service should not be used""" mock_kumascript_get.return_value = (self.d.html, None) @@ -607,7 +603,7 @@ def test_disabled(self, mock_kumascript_get): "kumascript not should have been used") @override_constance_settings(KUMASCRIPT_TIMEOUT=0.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_disabled_rendering(self, mock_kumascript_get): """When disabled, the kumascript service should not be used in rendering""" @@ -618,7 +614,7 @@ def test_disabled_rendering(self, mock_kumascript_get): "kumascript not should have been used") @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_nomacros(self, mock_kumascript_get): mock_kumascript_get.return_value = (self.d.html, None) self.client.get('%s?nomacros' % self.url, follow=False) @@ -626,7 +622,7 @@ def test_nomacros(self, mock_kumascript_get): "kumascript should not have been used") @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_raw(self, mock_kumascript_get): mock_kumascript_get.return_value = (self.d.html, None) self.client.get('%s?raw' % self.url, follow=False) @@ -634,7 +630,7 @@ def test_raw(self, mock_kumascript_get): "kumascript should not have been used") @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_raw_macros(self, mock_kumascript_get): mock_kumascript_get.return_value = (self.d.html, None) self.client.get('%s?raw¯os' % self.url, follow=False) @@ -2286,7 +2282,7 @@ def _create_doc(slug, locale): locale=settings.WIKI_DEFAULT_LANGUAGE)) @override_constance_settings(KUMASCRIPT_TIMEOUT=1.0) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_revert(self, mock_kumascript_get): self.client.login(username='admin', password='testpass') @@ -3124,7 +3120,7 @@ def tearDown(self): constance.config.KUMASCRIPT_TIMEOUT = 0 constance.config.KUMASCRIPT_MAX_AGE = 0 - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_rendered_content(self, mock_kumascript_get): """Document view should serve up rendered content when available""" mock_kumascript_get.return_value = (self.rendered_content, None) @@ -3160,7 +3156,7 @@ def test_rendering_in_progress_warning(self): p = pq(resp.content) eq_(1, p.find('#doc-rendering-in-progress').length) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_raw_content_during_initial_render(self, mock_kumascript_get): """Raw content should be displayed during a document's initial deferred rendering""" @@ -3190,7 +3186,7 @@ def test_raw_content_during_initial_render(self, mock_kumascript_get): @attr('schedule_rendering') @mock.patch_object(Document, 'schedule_rendering') - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') def test_schedule_rendering(self, mock_kumascript_get, mock_document_schedule_rendering): mock_kumascript_get.return_value = (self.rendered_content, None) @@ -3220,7 +3216,7 @@ def test_schedule_rendering(self, mock_kumascript_get, eq_(302, response.status_code) ok_(mock_document_schedule_rendering.called) - @mock.patch('wiki.kumascript.get') + @mock.patch('kuma.wiki.kumascript.get') @mock.patch('requests.post') def test_alternate_bleach_whitelist(self, mock_requests_post, mock_kumascript_get): diff --git a/apps/wiki/urls.py b/kuma/wiki/urls.py similarity index 94% rename from apps/wiki/urls.py rename to kuma/wiki/urls.py index cbe8f931d91..b4770e8cd61 100644 --- a/apps/wiki/urls.py +++ b/kuma/wiki/urls.py @@ -1,13 +1,13 @@ from django.conf.urls import include, patterns, url from django.views.generic import TemplateView -from wiki.feeds import (DocumentsRecentFeed, DocumentsReviewFeed, RevisionsFeed, - AttachmentsFeed, - DocumentsUpdatedTranslationParentFeed,) +from .feeds import (DocumentsRecentFeed, DocumentsReviewFeed, RevisionsFeed, + AttachmentsFeed, + DocumentsUpdatedTranslationParentFeed,) # These patterns inherit (?P[^\$]+). -document_patterns = patterns('wiki.views', +document_patterns = patterns('kuma.wiki.views', url(r'^$', 'document', name='wiki.document'), url(r'^\$revision/(?P\d+)$', 'revision', name='wiki.revision'), @@ -48,7 +48,7 @@ url(r'^\$vote', 'helpful_vote', name="wiki.document_vote"), ) -urlpatterns = patterns('wiki.views', +urlpatterns = patterns('kuma.wiki.views', # Un/Subscribe to locale 'ready for review' notifications. url(r'^/ckeditor_config.js$', 'ckeditor_config', name='wiki.ckeditor_config'), diff --git a/apps/wiki/utils.py b/kuma/wiki/utils.py similarity index 100% rename from apps/wiki/utils.py rename to kuma/wiki/utils.py diff --git a/apps/wiki/views.py b/kuma/wiki/views.py similarity index 99% rename from apps/wiki/views.py rename to kuma/wiki/views.py index ac728fc8400..73c88efff09 100644 --- a/apps/wiki/views.py +++ b/kuma/wiki/views.py @@ -3,15 +3,19 @@ import json import hashlib import logging +import mime_types import re from urllib import urlencode -import mime_types try: from cStringIO import cStringIO as StringIO except: from StringIO import StringIO +import newrelic.agent +from pyquery import PyQuery as pq +from tower import ugettext_lazy as _lazy, ugettext as _ + from django.conf import settings from django.contrib import messages from django.core.exceptions import PermissionDenied @@ -32,25 +36,21 @@ xframe_options_sameorigin) from django.views.decorators.csrf import csrf_exempt -from authkeys.decorators import accepts_auth_key import constance.config import jinja2 -import newrelic.agent -from pyquery import PyQuery as pq from smuggler.utils import superuser_required from smuggler.forms import ImportFileForm from teamwork.shortcuts import get_object_or_404_or_403 -from tower import ugettext_lazy as _lazy, ugettext as _ from access.decorators import permission_required, login_required +from authkeys.decorators import accepts_auth_key from contentflagging.models import ContentFlag, FLAG_NOTIFICATIONS +import kuma.wiki.content +from kuma.users.models import UserProfile from search.store import referrer_url from sumo.helpers import urlparams from sumo.urlresolvers import reverse from sumo.utils import paginate, smart_int -from kuma.users.models import UserProfile - -import wiki.content from . import kumascript from .constants import (DOCUMENTS_PER_PAGE, TEMPLATE_TITLE_PREFIX, SLUG_CLEANSING_REGEX, REVIEW_FLAG_TAGS_DEFAULT, @@ -352,7 +352,7 @@ def _filter_doc_html(request, doc, doc_html, rendering_params): return doc_html # TODO: One more view-time content parsing instance to refactor - tool = wiki.content.parse(doc_html) + tool = kuma.wiki.content.parse(doc_html) # ?raw view is often used for editors - apply safety filtering. # TODO: Should this stuff happen in render() itself? @@ -380,7 +380,7 @@ def _filter_doc_html(request, doc, doc_html, rendering_params): # because this is often paired with ?section - so we'd need to store every # section twice for with & without include sections if rendering_params['include']: - doc_html = wiki.content.filter_out_noinclude(doc_html) + doc_html = kuma.wiki.content.filter_out_noinclude(doc_html) return doc_html @@ -1240,17 +1240,17 @@ def _edit_document_collision(request, orig_rev, curr_rev, is_iframe_target, # Process the content as if it were about to be saved, so that the # html_diff is close as possible. - content = (wiki.content - .parse(request.POST['content']) - .injectSectionIDs() - .serialize()) + content = (kuma.wiki.content + .parse(request.POST['content']) + .injectSectionIDs() + .serialize()) # Process the original content for a diff, extracting a section if we're # editing one. if (doc.is_template): curr_content = curr_rev.content else: - tool = wiki.content.parse(curr_rev.content) + tool = kuma.wiki.content.parse(curr_rev.content) tool.injectSectionIDs() if section_id: tool.extractSection(section_id) @@ -1669,9 +1669,9 @@ def translate(request, document_slug, document_locale, revision_id=None): elif not doc: content = based_on_rev.content if content: - initial.update(content=wiki.content.parse(content) - .filterEditorSafety() - .serialize()) + initial.update(content=kuma.wiki.content.parse(content) + .filterEditorSafety() + .serialize()) instance = doc and doc.current_or_latest_revision() rev_form = RevisionForm(instance=instance, initial=initial) @@ -1826,9 +1826,9 @@ def json_view(request, document_slug=None, document_locale=None): return HttpResponseBadRequest() document = get_object_or_404(Document, **kwargs) - (wiki.content.parse(document.html) - .injectSectionIDs() - .serialize()) + (kuma.wiki.content.parse(document.html) + .injectSectionIDs() + .serialize()) stale = True if request.user.is_authenticated(): diff --git a/media/js/wiki-edit.js b/media/js/wiki-edit.js index 41095314f38..155f3afaf2a 100644 --- a/media/js/wiki-edit.js +++ b/media/js/wiki-edit.js @@ -711,10 +711,6 @@ $clone.insertBefore($attachmentsNewTableActions); $clone.addClass('dynamic-row'); - // Show the cell actions now! - $attachmentsNewTable.find('.page-attachment-actions-cell').removeClass('hidden'); - $clone.find('.delete-attachment').removeClass('hidden'); - return $clone; } clone().find('input[type="text"]')[0].focus(); diff --git a/media/redesign/js/home.js b/media/redesign/js/home.js deleted file mode 100644 index 24ab760ecec..00000000000 --- a/media/redesign/js/home.js +++ /dev/null @@ -1,13 +0,0 @@ -(function($) { - 'use strict'; - - // Create the demos slider - var $list = $('.home-demos-list'); - if ($list.length) { - $list.owlCarousel({ - lazyLoad: true - }); - $list.css('height', 'auto'); - } - -})(jQuery); diff --git a/media/redesign/js/wiki.js b/media/redesign/js/wiki.js index 2206ae5bee7..458aad639ce 100644 --- a/media/redesign/js/wiki.js +++ b/media/redesign/js/wiki.js @@ -264,7 +264,7 @@ }, 10); // Set it forth! - if($toc.length || $pageButtons.attr('data-sticky') == "true"){ + if($toc.length || $pageButtons.attr('data-sticky') == 'true'){ scrollFn(); $(win).on('scroll resize', scrollFn); } @@ -528,8 +528,8 @@ // If the page does not have any YouTube videos if(!$youtubeIframes.length) return; - var origin = window.location.protocol + "//" + window.location.hostname + - (window.location.port ? ':' + window.location.port: ''); + var origin = win.location.protocol + '//' + win.location.hostname + + (win.location.port ? ':' + win.location.port: ''); //Enable JS API on all YouTube iframes, might cause flicker! $youtubeIframes.each(function() { @@ -541,12 +541,12 @@ // Load YouTube Iframe API var youtubeScript = doc.createElement('script'); youtubeScript.async = 'true'; - youtubeScript.src = "//www.youtube.com/iframe_api"; + youtubeScript.src = '//www.youtube.com/iframe_api'; doc.body.appendChild(youtubeScript); // Method executed by YouTube API, needs to be global - window.onYouTubeIframeAPIReady = function(event) { + win.onYouTubeIframeAPIReady = function(event) { $youtubeIframes.each(function(i){ players[i] = new YT.Player($(this).get(0)); @@ -617,7 +617,7 @@ }); }); players[i].addEventListener('onError', function(event) { - mdn.trackError('YouTube Error: ' + event.data + 'on ' + window.location.href); + mdn.trackError('YouTube Error: ' + event.data + 'on ' + win.location.href); }); }); }; diff --git a/media/redesign/stylus/badges.styl b/media/redesign/stylus/badges.styl index 83b9d23d0d1..d5bf78f8ad0 100644 --- a/media/redesign/stylus/badges.styl +++ b/media/redesign/stylus/badges.styl @@ -188,7 +188,7 @@ dl.award dd.awarded_to img.avatar { display: none; } -input[type="submit"].delete-badge { +input[type='submit'].delete-badge { margin: 0 auto; display: inherit; } diff --git a/media/redesign/stylus/diff.styl b/media/redesign/stylus/diff.styl index 0bd2eb1a64e..ce45017847c 100644 --- a/media/redesign/stylus/diff.styl +++ b/media/redesign/stylus/diff.styl @@ -64,6 +64,10 @@ td.diff_header { margin: 4px 0; clear: both; + span { + white-space: nowrap; + } + a { color: #444; } diff --git a/media/redesign/stylus/home.styl b/media/redesign/stylus/home.styl index 8d0422260f0..a4e8cedd555 100644 --- a/media/redesign/stylus/home.styl +++ b/media/redesign/stylus/home.styl @@ -75,7 +75,7 @@ $blue-background-text-color = #fff; } &[class^='icon-']:before { - margin: 16px 0 0 0; + margin: 18px 0 0 0; display: block; text-align: center; } @@ -95,7 +95,7 @@ $blue-background-text-color = #fff; float: left; &:before { - margin: 9px 0 0 0; + margin: 11px 0 0 0; display: block; text-align: center; } @@ -356,7 +356,7 @@ $blue-background-text-color = #fff; /* In right-to-left languages, show some carousel items in reverse order and hide the pager. This is not a permanent solution, https://bugzilla.mozilla.org/show_bug.cgi?id=992745 */ - html[dir="rtl"] & { + html[dir='rtl'] & { .owl-item { float: right; } @@ -516,7 +516,7 @@ $blue-background-text-color = #fff; } /* right to left */ -html[dir="rtl"] #home { +html[dir='rtl'] #home { h2 { > $selector-icon:before { diff --git a/media/redesign/stylus/includes/grid.styl b/media/redesign/stylus/includes/grid.styl index 2f1bda4a580..166d7dca7a1 100644 --- a/media/redesign/stylus/includes/grid.styl +++ b/media/redesign/stylus/includes/grid.styl @@ -91,7 +91,7 @@ draw-grid() { } /* adjustments to reverse the column containers in RTL */ - html[dir="rtl"] .column-container { + html[dir='rtl'] .column-container { {$grid-column-selector} { &:first-child { margin-right: 0; diff --git a/media/redesign/stylus/includes/mixins.styl b/media/redesign/stylus/includes/mixins.styl index 9d514ced272..5f3c552a430 100644 --- a/media/redesign/stylus/includes/mixins.styl +++ b/media/redesign/stylus/includes/mixins.styl @@ -227,7 +227,7 @@ bidi-style(ltr-prop, value, inverse-prop, inverse-value, make-important = false) {ltr-prop}: value make-important; - html[dir="rtl"] & { + html[dir='rtl'] & { if (ltr-prop != inverse-prop) { {inverse-prop}: value make-important; } diff --git a/media/redesign/stylus/learn.styl b/media/redesign/stylus/learn.styl index 811f56b8278..df69efdd5e1 100644 --- a/media/redesign/stylus/learn.styl +++ b/media/redesign/stylus/learn.styl @@ -13,7 +13,7 @@ text-align: left; a:before { - content: "\00AB\00A0"; + content: '\00AB\00A0'; } } @@ -44,14 +44,14 @@ } #blackboard { - background: #242424 url("../img/boardframe-top.jpg") center top no-repeat; + background: #242424 url('../img/boardframe-top.jpg') center top no-repeat; box-shadow: 0 2px 3px rgba(0,0,0,.25); margin: $grid-spacing auto; padding: 60px 0 0; width: 940px; ul { - background: url("../img/boardframe-btm.png") center bottom no-repeat; + background: url('../img/boardframe-btm.png') center bottom no-repeat; overflow: auto; padding: 0 60px 50px 0; @@ -100,15 +100,15 @@ h2 { #sub-html & { - background-image: url("../img/chalk-html.png"); + background-image: url('../img/chalk-html.png'); } #sub-css & { - background-image: url("../img/chalk-css.png"); + background-image: url('../img/chalk-css.png'); } #sub-js & { - background-image: url("../img/chalk-js.png"); + background-image: url('../img/chalk-js.png'); } } @@ -142,8 +142,8 @@ h2 { position: absolute; top: $grid-spacing; left: $grid-spacing; - background: url("../img/p2pu-webcraft.png") no-repeat 0 0; - content: ""; + background: url('../img/p2pu-webcraft.png') no-repeat 0 0; + content: ''; height: 80px; width: 101px; } @@ -156,7 +156,7 @@ h2 { } .learn-module h2 { - background: url("../img/icons-learnlevels.png") no-repeat; + background: url('../img/icons-learnlevels.png') no-repeat; color: #a36100; min-height: 56px; padding: 12px 18px 0 68px; @@ -195,7 +195,7 @@ h2 { position: absolute; top: -1px; left: 0; - background: url("../img/icons-tags.png") 0 0 no-repeat; + background: url('../img/icons-tags.png') 0 0 no-repeat; content: ''; height: 17px; width: 14px; @@ -242,7 +242,7 @@ h2 { visibility: hidden; width: 340px; vendorize(transition, bottom .4s ease-out); - vendorize(transition-property, unquote("bottom, opacity, visibility")); + vendorize(transition-property, unquote('bottom, opacity, visibility')); } &.visible .bubble { diff --git a/media/redesign/stylus/main/content.styl b/media/redesign/stylus/main/content.styl index 25946d06e2a..260473fa307 100644 --- a/media/redesign/stylus/main/content.styl +++ b/media/redesign/stylus/main/content.styl @@ -3,7 +3,7 @@ We cannot put these styles in the tags.styl file because they don't apply to the entire layout */ -table-blue = #d4dde4; +$table-blue = #d4dde4; .text-content { @@ -32,15 +32,15 @@ table-blue = #d4dde4; border: 2px solid #fff; td { - background-color: rgba(table-blue, 0.15); + background-color: rgba($table-blue, 0.15); border: @border; - box-shadow: inset 0 -1px 0 0 rgba(table-blue, 0.5); + box-shadow: inset 0 -1px 0 0 rgba($table-blue, 0.5); } td.header, th { border: @border; - border-bottom: 2px solid rgba(table-blue, 1); - background: rgba(table-blue, 0.5); + border-bottom: 2px solid rgba($table-blue, 1); + background: rgba($table-blue, 0.5); font-family: 'Open Sans Light', sans-serif; font-size: 14px; padding: 2px 8px 4px; @@ -50,7 +50,7 @@ table-blue = #d4dde4; &.fullwidth-table { background: #fff; - border: 1px solid rgba(table-blue, 0.5); + border: 1px solid rgba($table-blue, 0.5); margin-bottom: $grid-spacing; width: 100%; @@ -62,8 +62,8 @@ table-blue = #d4dde4; } td.header, th { - background: rgba(table-blue, 0.5); - border: 1px solid rgba(table-blue, 1); + background: rgba($table-blue, 0.5); + border: 1px solid rgba($table-blue, 1); font-weight: bold; padding: 0 5px; } @@ -78,7 +78,7 @@ table-blue = #d4dde4; } thead th { - background: rgba(table-blue, 0.5); + background: rgba($table-blue, 0.5); } /* lists and definitions */ @@ -241,7 +241,7 @@ ul.tagit { } .ui-icon-close { - background: url("../img/icn-delete.png") center -96px no-repeat; + background: url('../img/icn-delete.png') center -96px no-repeat; cursor: pointer; display: inline-block; height: 15px; @@ -333,7 +333,7 @@ div.tip { /* Classes created by the WYSIWYG */ .twocolumns { - vendorize(column-count, 2) + vendorize(column-count, 2); } .threecolumns { vendorize(column-count, 3); diff --git a/media/redesign/stylus/main/structure.styl b/media/redesign/stylus/main/structure.styl index 6030a25ae34..35ea48fbe65 100644 --- a/media/redesign/stylus/main/structure.styl +++ b/media/redesign/stylus/main/structure.styl @@ -312,15 +312,15 @@ a.github-button { .oauth-login-container { /* same as user-state, copying down as user-state will go */ bidi-style(right, 200px, left, auto); + set-font-size($small-bump-font-size); position: absolute; top: 12px; - set-font-size($small-bump-font-size); - z-index: 3; cursor: pointer; border-radius: 8px; border: 1px solid transparent; display: inline-block; + overflow: hidden; &.active { border-color: rgba(255, 255, 255, 0.3); @@ -377,18 +377,10 @@ a.github-button { &:hover, &:active, &:focus { background: rgba($link-color, 0.1); } - - &:after { - position: absolute; - top: 6px; - bidi-style(right, 10px, left, auto); - font-family: FontAwesome; - bidi-value(content, "\f0da", "\f0d9"); - opacity: 0.5; - } } {$selector-icon} { + background: none; bidi-style(margin-right, $icon-margin, margin-left, 0); } } @@ -608,13 +600,14 @@ footer { } } -/* for mobile, move the search box under the nav */ + @media $media-query-mobile { .center { add-center-spacing(15px); } + /* move the search box under the nav */ #main-header { .main-nav-search { display: block; @@ -638,6 +631,11 @@ footer { } } } + + /* add bottom spacing to the footer */ + footer { + padding-bottom: $grid-spacing; + } } diff --git a/media/redesign/stylus/main/tags.styl b/media/redesign/stylus/main/tags.styl index 2bb5e5daf79..97314e8b6c3 100644 --- a/media/redesign/stylus/main/tags.styl +++ b/media/redesign/stylus/main/tags.styl @@ -32,13 +32,13 @@ blockquote { &:before { top: 0; left: 10px; - content: "\201C"; + content: '\201C'; } &:after { bottom: 0; right: 10px; - content: "\201D"; + content: '\201D'; } } @@ -257,7 +257,7 @@ a.button:hover, a.button:focus, a.button:active { @media print { /* Not a pretty selector but needed to keep Prism in check */ - pre, pre[class*="language-"], code { + pre, pre[class*='language-'], code { white-space: pre-wrap; &, & span { diff --git a/media/redesign/stylus/profile.styl b/media/redesign/stylus/profile.styl index e676ecf538f..d16d930425b 100644 --- a/media/redesign/stylus/profile.styl +++ b/media/redesign/stylus/profile.styl @@ -76,12 +76,12 @@ &:before { color: #a19f93; - content: "/"; + content: '/'; margin-right: @margin-right; } &:first-child:before { - content: ""; + content: ''; margin: 0; } } @@ -198,7 +198,7 @@ table.activity { .profile-edit { /* Set forms to full width so that they resize with the column. */ - .section li > input[type="text"], select, textarea, #tagit-interests, #tags-expertise, legend { + .section li > input[type='text'], select, textarea, #tagit-interests, #tags-expertise, legend { width: 100%; vendorize(box-sizing, border-box); } diff --git a/media/redesign/stylus/search.styl b/media/redesign/stylus/search.styl index d01f03f8e59..273beee8b1f 100644 --- a/media/redesign/stylus/search.styl +++ b/media/redesign/stylus/search.styl @@ -146,7 +146,7 @@ h3 {$selector-icon}, fieldset {$selector-icon} { margin-right: 7px; } &:hover .filter-name, - input[type="checkbox"]:focus+ .filter-name{ + input[type='checkbox']:focus+ .filter-name{ color: $link-color; } diff --git a/media/redesign/stylus/submission.styl b/media/redesign/stylus/submission.styl index 02c34e938d2..7774ffd961d 100644 --- a/media/redesign/stylus/submission.styl +++ b/media/redesign/stylus/submission.styl @@ -81,7 +81,7 @@ } } - input[type="url"], input[type="email"], input[type="text"] { + input[type='url'], input[type='email'], input[type='text'] { width: 450px; } diff --git a/media/redesign/stylus/wiki.styl b/media/redesign/stylus/wiki.styl index 44e311c58dd..2f57c8c0105 100644 --- a/media/redesign/stylus/wiki.styl +++ b/media/redesign/stylus/wiki.styl @@ -196,7 +196,7 @@ article { .external-icon:not([href^='https://mdn.mozillademos.org']) { white-space: pre-line; - html[dir="ltr"] &:before, html[dir="rtl"] &:after { + html[dir='ltr'] &:before, html[dir='rtl'] &:after { content: '\f08e'; font-family: FontAwesome; set-font-size(9px); @@ -205,7 +205,7 @@ article { margin-right: 3px; } - html[dir="rtl"] &:after { + html[dir='rtl'] &:after { transform: rotateY(180deg); } @@ -1153,7 +1153,7 @@ div.note { } #page-attachments-new-table { - input[type="text"] { + input[type='text'] { width: 90%; .attachment-required { @@ -1202,13 +1202,13 @@ details { summary:before { set-font-size(1.25em); bidi-value(float, left, right); - content: "+"; + content: '+'; margin-top: -.15em; bidi-style(margin-left, -15px, margin-right, 0); } &.open summary:before { - content: "–"; + content: '–'; margin-top: -.2em; bidi-style(margin-left, -13px, margin-right, 0); } diff --git a/puppet/files/etc/motd b/puppet/files/etc/motd index 893f21bff01..a359cd7ee5f 100644 --- a/puppet/files/etc/motd +++ b/puppet/files/etc/motd @@ -7,7 +7,7 @@ To run developer-local.allizom.org, run: (Consult ~/src/Procfile to see what services are managed by Foreman.) To run Kuma tests: - ~/src/manage.py test actioncounters contentflagging kuma.demos devmo landing kuma.users search wiki kuma.events + ~/src/manage.py test actioncounters contentflagging kuma.demos devmo landing kuma.users search kuma.wiki kuma.events To run KumaScript tests: cd ~/src/kumascript && ./node_modules/.bin/nodeunit tests diff --git a/settings.py b/settings.py index 64d7042b145..303107509a6 100644 --- a/settings.py +++ b/settings.py @@ -406,8 +406,8 @@ def lazy_language_deki_map(): # LocaleURLMiddleware must be before any middleware that uses # sumo.urlresolvers.reverse() to add locale prefixes to URLs: 'sumo.middleware.LocaleURLMiddleware', - 'wiki.middleware.DocumentZoneMiddleware', - 'wiki.middleware.ReadOnlyMiddleware', + 'kuma.wiki.middleware.DocumentZoneMiddleware', + 'kuma.wiki.middleware.ReadOnlyMiddleware', 'sumo.middleware.Forbidden403Middleware', 'django.middleware.common.CommonMiddleware', 'sumo.middleware.RemoveSlashMiddleware', @@ -422,12 +422,11 @@ def lazy_language_deki_map(): 'kuma.users.middleware.BanMiddleware', 'badger.middleware.RecentBadgeAwardsMiddleware', - 'wiki.badges.BadgeAwardingMiddleware', + 'kuma.wiki.badges.BadgeAwardingMiddleware', ) # Auth AUTHENTICATION_BACKENDS = ( - 'django.contrib.auth.backends.ModelBackend', 'allauth.account.auth_backends.AuthenticationBackend', 'teamwork.backends.TeamworkBackend', ) @@ -484,12 +483,12 @@ def lazy_language_deki_map(): 'landing', 'search', 'kuma.users', + 'kuma.wiki', 'allauth', 'allauth.account', 'allauth.socialaccount', 'allauth.socialaccount.providers.persona', 'kuma.users.providers.github', - 'wiki', 'kuma.events', # DEMOS @@ -826,7 +825,7 @@ def JINJA_CONFIG(): CELERY_IMPORTS = ( 'devmo.tasks', - 'wiki.tasks', + 'kuma.wiki.tasks', 'search.tasks', 'tidings.events', 'elasticutils.contrib.django.tasks', @@ -1096,7 +1095,7 @@ def JINJA_CONFIG(): ), WELCOME_EMAIL_FROM = ( - "Janet Swisher, MDN Community Manager ", + "Janet Swisher ", 'Email address from which welcome emails will be sent', ), diff --git a/urls.py b/urls.py index 4d164f1ba44..4884a1015a1 100644 --- a/urls.py +++ b/urls.py @@ -31,14 +31,14 @@ def _error_page(request, status): # Django admin: (r'^grappelli/', include('grappelli.urls')), url(r'^admin/wiki/document/purge/', - 'wiki.admin.purge_view', + 'kuma.wiki.admin.purge_view', name='wiki.admin_bulk_purge'), (r'^admin/', include('smuggler.urls')), (r'^admin/', include(admin.site.urls)), (r'^search', include('search.urls')), - (r'^docs', include('wiki.urls')), + (r'^docs', include('kuma.wiki.urls')), # Javascript translations. url(r'^jsi18n/.*$', cache_page(60 * 60 * 24 * 365)(javascript_catalog), @@ -49,19 +49,19 @@ def _error_page(request, status): # Files. url(r'^files/new/$', - 'wiki.views.new_attachment', + 'kuma.wiki.views.new_attachment', name='wiki.new_attachment'), url(r'^files/(?P\d+)/$', - 'wiki.views.attachment_detail', + 'kuma.wiki.views.attachment_detail', name='wiki.attachment_detail'), url(r'^files/(?P\d+)/edit/$', - 'wiki.views.edit_attachment', + 'kuma.wiki.views.edit_attachment', name='wiki.edit_attachment'), url(r'^files/(?P\d+)/history/$', - 'wiki.views.attachment_history', + 'kuma.wiki.views.attachment_history', name='wiki.attachment_history'), url(r'^files/(?P\d+)/(?P.+)$', - 'wiki.views.raw_file', + 'kuma.wiki.views.raw_file', name='wiki.raw_file'), # Flagged content. @@ -72,9 +72,6 @@ def _error_page(request, status): # Users ('', include('kuma.users.urls')), - # Auth keys - (r'^keys/', include('authkeys.urls')), - # Badges (r'^badges/', include('badger.urls_simple')), @@ -100,7 +97,7 @@ def _error_page(request, status): # with local instances' ability to serve media. urlpatterns += patterns('', url(r'^@api/deki/files/(?P\d+)/=(?P.+)$', - 'wiki.views.mindtouch_file_redirect', + 'kuma.wiki.views.mindtouch_file_redirect', name='wiki.mindtouch_file_redirect'), - (r'^(?P.*)$', 'wiki.views.mindtouch_to_kuma_redirect'), + (r'^(?P.*)$', 'kuma.wiki.views.mindtouch_to_kuma_redirect'), )