Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
0ce39357
Commit
0ce39357
authored
Oct 13, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rst renderer for credits
Issue #798 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
c2603381
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
weblate/trans/tests/test_reports.py
weblate/trans/tests/test_reports.py
+11
-0
weblate/trans/views/reports.py
weblate/trans/views/reports.py
+16
-0
No files found.
weblate/trans/tests/test_reports.py
View file @
0ce39357
...
...
@@ -73,3 +73,14 @@ class ReportsTest(ViewTestCase):
credits
,
[{
'Czech'
:
[[
'noreply@weblate.org'
,
'Weblate Test'
]]}]
)
def
test_credits_view_rst
(
self
):
self
.
add_change
()
response
=
self
.
client
.
post
(
reverse
(
'credits'
,
kwargs
=
self
.
kw_subproject
),
{
'style'
:
'rst'
,
'start_date'
:
'2000-01-01'
},
)
self
.
assertEqual
(
response
.
content
,
'* Czech
\
n
\
n
* Weblate Test <noreply@weblate.org>
\
n
'
)
weblate/trans/views/reports.py
View file @
0ce39357
...
...
@@ -61,3 +61,19 @@ def get_credits(request, project, subproject):
json
.
dumps
(
credits
),
content_type
=
'application/json'
)
result
=
[]
for
language
in
credits
:
name
,
translators
=
language
.
items
()[
0
]
result
.
append
(
u'* {0}
\
n
'
.
format
(
name
))
result
.
append
(
'
\
n
'
.
join
(
[
' * {1} <{0}>'
.
format
(
*
t
)
for
t
in
translators
]
))
result
.
append
(
''
)
return
HttpResponse
(
'
\
n
'
.
join
(
result
),
content_type
=
'text/plain'
,
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment