10000 Updated Trac to 1.4 (no CSS) · stroebjo/code.djangoproject.com@9deade1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9deade1

Browse files
apollo13felixxm
authored andcommitted
Updated Trac to 1.4 (no CSS)
This commit is enough to get the site up and running but doesn't contain any CSS fixes.
1 parent 43d9616 commit 9deade1

File tree

9 files changed

+284
-232
lines changed

9 files changed

+284
-232
lines changed

DjangoPlugin/tracdjangoplugin/__init__.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
from tracext.github import GitHubBrowser
88

99

10+
class CustomTheme(Component):
11+
implements(IRequestFilter)
12+
13+
def pre_process_request(self, req, handler):
14+
return handler
15+
16+
def post_process_request(self, req, template, data, metadata):
17+
req.chrome["theme"] = "django_theme.html"
18+
return template, data, metadata
19+
20+
1021
class CustomWikiModule(WikiModule):
1122
"""Works in combination with the CustomNavigationBar and replaces
1223
the default wiki module. Has a different logic for active item
@@ -37,7 +48,7 @@ def process_request(self, req):
3748
def pre_process_request(self, req, handler):
3849
return handler
3950

40-
def post_process_request(self, req, template, data, content_type):
51+
def post_process_request(self, req, template, data, metadata):
4152
if data is None:
4253
data = {}
4354
if req.path_info == "/newticket" and not data.get("preview_mode", False):
@@ -48,7 +59,7 @@ def post_process_request(self, req, template, data, content_type):
4859
]
4960
data["simple_interface"] = simple_interface
5061
template = "custom_ticket.html"
51-
return template, data, content_type
62+
return template, data, metadata
5263

5364

5465
class CustomNavigationBar(Component):

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ that can help:
1111
the database creation).
1212
* Use ``trac-admin ./trac-env/ permission add anonymous TRAC_ADMIN``
1313
to give all permissions to the anonymous user.
14-
* Use the command ``tracd --port 9000 -s trac-env`` to serve Trac locally.
14+
* Use the command ``DJANGO_SETTINGS_MODULE=tracdjangoplugin.settings TRAC_ENV=`pwd`/trac-env gunicorn tracdjangoplugin.wsgi:application --bind 0.0.0.0:9000 --workers=1 --reload`` to serve Trac locally.
1515
* If you've modified the ``trackhack.scss`` file, use
1616
``sassc scss/trachacks.scss trac-env/htdocs/css/trachacks.css -s compressed``
1717
to compile it to CSS.

requirements.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
Trac==1.2.6
1+
Trac==1.4.4
22
Pygments==2.5.2
33
dnspython==1.15
44
spambayes == 1.1b1
55
psycopg2==2.7.6.1 --no-binary=psycopg2
66
docutils==0.14
77
Django==1.11.29
88
libsass==0.17.0
9+
Genshi==0.7.7 # still required by some plugins
910

1011
# Trac plugins
1112
TracSpamFilter==1.2.7
12-
TracXMLRPC==1.1.9
13+
# TracXMLRPC from PyPI does not (yet) have a 1.2.0 release (compatible with Trac 1.4)
14+
https://trac-hacks.org/browser/xmlrpcplugin/trunk?rev=18591&format=zip
1315

1416
oauthlib==2.1.0
1517
requests==2.20.1
@@ -19,4 +21,4 @@ trac-github==2.3
1921 F438
gunicorn==19.10.0
2022
sentry-sdk==1.11.0
2123

22-
-e ./DjangoPlugin
24+
-e ./DjangoPlugin

trac-env/templates/custom_ticket.html

Lines changed: 43 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,43 @@
1-
<html xmlns="http://www.w3.org/1999/xhtml"
2-
xmlns:py="http://genshi.edgewall.org/"
3-
xmlns:xi="http://www.w3.org/2001/XInclude"
4-
py:strip="">
5-
<head py:match="head" py:attrs="select('@*')">
6-
${select('*|comment()|text()')}
7-
</head>
8-
<body py:match="body" py:attrs="select('@*')">
9-
<div class="ticket-readme">
10-
<h2>Please read this first:</h2>
11-
<ul>
12-
<li>
13-
<strong><a href="https://docs.djangoproject.com/en/dev/internals/contributing/bugs-and-features/#reporting-security-issues">Please don't report security issues here!</a>
14-
Contact <a href="mailto:security@djangoproject.com">security@djangoproject.com</a> instead.</strong>
15-
</li>
16-
<li>
17-
Report bugs and suggest features in Django itself (or its
18-
documentation) using this ticket tracker.
19-
</li>
20-
<li>
21-
Don't use the ticket system for
22-
<a href="https://docs.djangoproject.com/en/dev/faq/help/">help with
23-
support questions</a>. <a href="https://docs.djangoproject.com/en/dev/faq/">
24-
check the FAQ</a> for common issues.
25-
</li>
26-
<li>
27-
Use <a href="https://www.transifex.com/projects/p/django/">Transifex</a> for
28-
<a href="https://docs.djangoproject.com/en/dev/internals/contributing/localizing/#translations">bug reports on translations</a>.
29-
</li>
30-
<li>
31-
Report issues with our web site (www.djangoproject.com) in <a href="https://github.com/django/djangoproject.com/issues">its GitHub issue tracker</a>.
32-
</li>
33-
<li>
34-
Report issues with our bug tracker (code.djangoproject.com) in <a href="https://github.com/django/code.djangoproject.com/issues">its GitHub issue tracker</a>.
35-
</li>
36-
<li>
37-
Follow our
38-
<a href="https://docs.djangoproject.com/en/dev/internals/contributing/bugs-and-features/#reporting-bugs">bug reporting guidelines</a>
39-
and our <a href="https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#patch-style">patch submission guidelines</a> and
40-
<a href="https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#patch-review-checklist">checklist</a> for the best response.
41-
</li>
42-
<li>
43-
Use the "Preview" button to check your <a href="https://code.djangoproject.com/wiki/WikiFormatting">formatting</a>.
44-
</li>
45-
</ul>
46-
</div>
47-
${select('*|text()')}
48-
</body>
49-
<xi:include href="ticket.html" />
50-
</html>
1+
# extends 'ticket.html'
2+
3+
# block content
4+
<div class="ticket-readme">
5+
<h2>Please read this first:</h2>
6+
<ul>
7+
<li>
8+
<strong><a href="https://docs.djangoproject.com/en/dev/internals/contributing/bugs-and-features/#reporting-security-issues">Please don't report security issues here!</a>
9+
Contact <a href="mailto:security@djangoproject.com">security@djangoproject.com</a> instead.</strong>
10+
</li>
11+
<li>
12+
Report bugs and suggest features in Django itself (or its
13+
documentation) using this ticket tracker.
14+
</li>
15+
<li>
16+
Don't use the ticket system for
17+
<a href="https://docs.djangoproject.com/en/dev/faq/help/">help with
18+
support questions</a>. <a href="https://docs.djangoproject.com/en/dev/faq/">
19+
check the FAQ</a> for common issues.
20+
</li>
21+
<li>
22+
Use <a href="https://www.transifex.com/projects/p/django/">Transifex</a> for
23+
<a href="https://docs.djangoproject.com/en/dev/internals/contributing/localizing/#translations">bug reports on translations</a>.
24+
</li>
25+
<li>
26+
Report issues with our web site (www.djangoproject.com) in <a href="https://github.com/django/djangoproject.com/issues">its GitHub issue tracker</a>.
27+
</li>
28+
<li>
29+
Report issues with our bug tracker (code.djangoproject.com) in <a href="https://github.com/django/code.djangoproject.com/issues">its GitHub issue tracker</a>.
30+
</li>
31+
<li>
32+
Follow our
33+
<a href="https://docs.djangoproject.com/en/dev/internals/contributing/bugs-and-features/#reporting-bugs">bug reporting guidelines</a>
34+
and our <a href="https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#patch-style">patch submission guidelines</a> and
35+
<a href="https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#patch-review-checklist">checklist</a> for the best response.
36+
</li>
37+
<li>
38+
Use the "Preview" button to check your <a href="https://code.djangoproject.com/wiki/WikiFormatting">formatting</a>.
39+
</li>
40+
</ul>
41+
</div>
42+
${ super() }
43+
# endblock content

trac-env/templates/django_theme.html

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<!DOCTYPE html>
2+
<html lang="${trac_lang}"> {# jinjacheck: "attribute lang" OK #}
3+
4+
# macro navigation(category)
5+
<div id="${category}" class="nav">
6+
# if chrome.nav[category]:
7+
<ul>{%
8+
for item in chrome.nav[category]
9+
%}<li ${{'class': {
10+
'first': loop.first, 'last': loop.last, 'active': item.active
11+
}}|htmlattr}>${item.label}</li>{%
12+
endfor
13+
%}</ul>
14+
# endif
15+
</div>
16+
# endmacro
17+
18+
# macro main()
19+
<div role="main">
20+
${navigation('metanav')}
21+
${navigation('mainnav')}
22+
<div id="main" ${{'class': {
23+
'uisymbols': req.session.get('ui.use_symbols'),
24+
'uinohelp': req.session.get('ui.hide_help'),
25+
}}|htmlattr}>
26+
27+
# if req.authname != 'anonymous' and not req.session.email:
28+
<div class="system-message" id="warning">
29+
Add an email address on the <a href="${req.href.prefs()}">Preferences</a>
30+
page to receive updates on tickets you own, have created, or been CCed on.
31+
</div>
32+
# endif
33+
34+
# if resourcepath_template:
35+
# include resourcepath_template ignore missing
36+
# endif
37+
<div id="ctxtnav" class="nav">
38+
<h2>${_("Context Navigation")}</h2>
39+
# if chrome.ctxtnav:
40+
<ul>
41+
# for elm in chrome.ctxtnav:
42+
<li ${{'class': {'first': loop.first, 'last': loop.last}}|htmlattr}>${
43+
elm}</li>
44+
# endfor
45+
</ul>
46+
# endif
47+
<hr />
48+
</div>
49+
50+
${jmacros.warnings(chrome.warnings)}
51+
52+
${jmacros.notices(chrome.notices)}
53+
54+
# block content
55+
# endblock content
56+
</div>
57+
<a href="#top" class="backtotop"><i class="icon icon-chevron-up"></i> Back to Top</a>
58+
</div>
59+
# endmacro
60+
61+
<head>
62+
# block head
63+
# endblock head
64+
</head>
65+
66+
{# we don't use the modernizer js lib anymore, but the css still uses some classes from it #}
67+
<body class="mdzr-boxshadow">
68+
# block body
69+
70+
# include 'site_header.html' ignore missing
71+
72+
<div id="banner">
73+
<div class="copy-banner">
74+
<div class="container">
75+
<h1>Issues</h1>
76+
</div>
77+
</div>
78+
79+
# if req.path_info == '/':
80+
<div class="container sidebar-right">
81+
${main()}
82+
<div role="complementary">
83+
<form action="/search/" id="sidebar_search" class="search form-input" role="search">
84+
<label class="visuallyhidden" for="q">Search:</label>
85+
<input id="id_sidebar_search_q" name="q" placeholder="Search Trac" type="search" />
86+
87+
<button type="submit">
88+
<i class="icon icon-search"></i>
89+
<span class="visuallyhidden">Search</span>
90+
</button>
91+
</form>
92+
<h3>Useful links</h3>
93+
<dl>
94+
<dt><a href="https://docs.djangoproject.com/en/dev/internals/contributing/">Contribution Guide</a></dt>
95+
<dd>You'd like to contribute to Django but don't know how? This document will explain our process and how to get involved.</dd>
96+
97+
<dt><a href="/query?status=!closed&amp;easy=1">"Easy Pickings"</a></dt>
98+
<dd>First time contributor and you're looking for something manageable? The "easy pickings" list is a good start.</dd>
99+
100+
<dt><a href="https://docs.djangoproject.com/en/dev/internals/security/">Security Policy</a></dt>
101+
<dd>You found a security issue in Django? You'd like to know more about our security policy? It's all in there.</dd>
102+
103+
<dt><a href="https://github.com/django/django">GitHub</a></dt>
104+
<dd>Want to peek under the hood and see Django's source code, file or help review a pull request? It's all on GitHub.</dd>
105+
106+
<dt><a href="https://dashboard.djangoproject.com/">Django Dashboard</a></dt>
107+
<dd>Confused about Trac's filtering system? This dashboard shows easy-to-read metrics and has links to pre-set filters to get you started.</dd>
108+
109+
<dt><a href="irc://irc.freenode.net/django-dev">#django-dev IRC channel</a></dt>
110+
<dd>Questions about a ticket? Stuck on how to write a unit test for your pull request? Come chat with us!</dd>
111+
</dl>
112+
</div>
113+
</div>
114+
</div>
115+
# else
116+
<div class="container full-width">
117+
${main()}
118+
</div>
119+
# endif
120+
121+
# include 'site_footer.html' ignore missing
122+
123+
# endblock body
124+
</body>
125+
126+
</html>

0 commit comments

Comments
 (0)
0