From cb4dadfdcd39a2fcbac8ce321c6ceeb406849866 Mon Sep 17 00:00:00 2001 From: Cory Lynch Date: Tue, 13 Jun 2017 20:01:01 -0400 Subject: [PATCH] tools: Create /devtools page for useful dev URLs. Fixes #5179. --- static/styles/portico.css | 9 ++++++ templates/zerver/dev_login.html | 3 ++ templates/zerver/dev_tools.html | 49 +++++++++++++++++++++++++++++++++ zerver/tests/test_docs.py | 1 + zproject/dev_urls.py | 4 +++ 5 files changed, 66 insertions(+) create mode 100644 templates/zerver/dev_tools.html diff --git a/static/styles/portico.css b/static/styles/portico.css index f4f5334aca..e5feec765f 100644 --- a/static/styles/portico.css +++ b/static/styles/portico.css @@ -1624,3 +1624,12 @@ input.new-organization-button { font-size: .85rem; color: #AAA; } + +#devtools-wrapper { + text-align: right; +} + +#devtools-page { + max-width: 800px; + margin: 0 auto; +} diff --git a/templates/zerver/dev_login.html b/templates/zerver/dev_login.html index 75b0d2ea80..516d5b3238 100644 --- a/templates/zerver/dev_login.html +++ b/templates/zerver/dev_login.html @@ -36,6 +36,9 @@ +
+ Zulip developer tools +
diff --git a/templates/zerver/dev_tools.html b/templates/zerver/dev_tools.html new file mode 100644 index 0000000000..cd246a1b6f --- /dev/null +++ b/templates/zerver/dev_tools.html @@ -0,0 +1,49 @@ +{% extends "zerver/portico.html" %} + +{# Login page. #} +{% block portico_content %} +
+

Useful development URLs

+

+ Below is a list of useful tools and data sets available only in the Zulip + development environment that are often useful when contributing to Zulip. + Most of these require you to run a command to build/generate the relevant + content. This table specifies which command to use to update the data served + by each page (since several of these, like test coverage, require a special + command to be run to generate the data). Make sure your development server is still running + when you visit these! +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
URLCommandDescription
/coverage/index.html./tools/test-backend --coverageView backend coverage report
/node-coverage/index.html./tools/test-js-with-node --coverageView node coverage report
/docs/index.html./tools/build-docsView Zulip documentation
/emailsNone neededPreview all email templates
+
+ +{% endblock %} diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py index 3cdc47543f..b02c539819 100644 --- a/zerver/tests/test_docs.py +++ b/zerver/tests/test_docs.py @@ -46,6 +46,7 @@ class DocPageTest(ZulipTestCase): "https://my.pingdom.com/reports/integration/settings", ]) self._test('/devlogin/', 'Normal users') + self._test('/devtools/', 'Useful development URLs') self._test('/emails/', 'Road Runner invited you to join Zulip') self._test('/register/', 'Sign up for Zulip') diff --git a/zproject/dev_urls.py b/zproject/dev_urls.py index 66e6ffe984..3948fd8b09 100644 --- a/zproject/dev_urls.py +++ b/zproject/dev_urls.py @@ -1,5 +1,6 @@ from django.conf.urls import url from django.conf import settings +from django.views.generic import TemplateView import os.path from django.views.static import serve import zerver.views.registration @@ -34,6 +35,9 @@ urls = [ # Page for testing email templates url(r'^emails/$', zerver.views.test_emails.email_page), + + # Listing of useful URLs and various tools for development + url(r'^devtools/$', TemplateView.as_view(template_name='zerver/dev_tools.html')), ] i18n_urls = [