tools: Create /devtools page for useful dev URLs.

Fixes #5179.
This commit is contained in:
Cory Lynch
2017-06-13 20:01:01 -04:00
committed by Tim Abbott
parent 3e10bdf0e8
commit cb4dadfdcd
5 changed files with 66 additions and 0 deletions

View File

@@ -1624,3 +1624,12 @@ input.new-organization-button {
font-size: .85rem; font-size: .85rem;
color: #AAA; color: #AAA;
} }
#devtools-wrapper {
text-align: right;
}
#devtools-page {
max-width: 800px;
margin: 0 auto;
}

View File

@@ -36,6 +36,9 @@
</div> </div>
</div> </div>
</form> </form>
<div id="devtools-wrapper">
<a id="devtools-link" href="/devtools">Zulip developer tools</a>
</div>
</div> </div>
</div> </div>

View File

@@ -0,0 +1,49 @@
{% extends "zerver/portico.html" %}
{# Login page. #}
{% block portico_content %}
<div id="devtools-page">
<h2>Useful development URLs</h2>
<p>
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!
</p>
<table class="table table-striped table-rounded table-bordered">
<thead>
<tr>
<th>URL</th>
<th>Command</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/coverage/index.html">/coverage/index.html</a></td>
<td><code>./tools/test-backend --coverage</code></td>
<td>View backend coverage report</td>
</tr>
<tr>
<td><a href="/node-coverage/index.html">/node-coverage/index.html</a></td>
<td><code>./tools/test-js-with-node --coverage</code></td>
<td>View node coverage report</td>
</tr>
<tr>
<td><a href="/docs/index.html">/docs/index.html</a></td>
<td><code>./tools/build-docs</code></td>
<td>View Zulip documentation</td>
</tr>
<tr>
<td><a href="/emails">/emails</a></td>
<td>None needed</td>
<td>Preview all email templates</td>
</tr>
</tbody>
</table>
</div>
{% endblock %}

View File

@@ -46,6 +46,7 @@ class DocPageTest(ZulipTestCase):
"https://my.pingdom.com/reports/integration/settings", "https://my.pingdom.com/reports/integration/settings",
]) ])
self._test('/devlogin/', 'Normal users') self._test('/devlogin/', 'Normal users')
self._test('/devtools/', 'Useful development URLs')
self._test('/emails/', 'Road Runner invited you to join Zulip') self._test('/emails/', 'Road Runner invited you to join Zulip')
self._test('/register/', 'Sign up for Zulip') self._test('/register/', 'Sign up for Zulip')

View File

@@ -1,5 +1,6 @@
from django.conf.urls import url from django.conf.urls import url
from django.conf import settings from django.conf import settings
from django.views.generic import TemplateView
import os.path import os.path
from django.views.static import serve from django.views.static import serve
import zerver.views.registration import zerver.views.registration
@@ -34,6 +35,9 @@ urls = [
# Page for testing email templates # Page for testing email templates
url(r'^emails/$', zerver.views.test_emails.email_page), 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 = [ i18n_urls = [