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
c0444a89
Commit
c0444a89
authored
May 14, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show words count when listing dictionary
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
8b81cfa4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
weblate/html/project.html
weblate/html/project.html
+3
-3
weblate/trans/views/basic.py
weblate/trans/views/basic.py
+14
-2
No files found.
weblate/html/project.html
View file @
c0444a89
...
@@ -79,11 +79,11 @@
...
@@ -79,11 +79,11 @@
<div
class=
"panel-heading"
><h4
class=
"panel-title"
>
{% trans "Glossaries" %}
</h4></div>
<div
class=
"panel-heading"
><h4
class=
"panel-title"
>
{% trans "Glossaries" %}
</h4></div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
{% if dicts %}
{% if dicts %}
<
ul
>
<
div
class=
"list-group"
>
{% for dict in dicts %}
{% for dict in dicts %}
<
li><a
href=
"{% url 'show_dictionary' project=object.slug lang=dict.code %}"
>
{{ dict }}
</a></li
>
<
a
class=
"list-group-item"
href=
"{% url 'show_dictionary' project=object.slug lang=dict.language.code %}"
><span
class=
"badge"
>
{{ dict.count }}
</span>
{{ dict.language }}
</a
>
{% endfor %}
{% endfor %}
</
ul
>
</
div
>
{% else %}
{% else %}
<p>
{% trans "There are currently no glossaries defined for this project." %}
</p>
<p>
{% trans "There are currently no glossaries defined for this project." %}
</p>
{% endif %}
{% endif %}
...
...
weblate/trans/views/basic.py
View file @
c0444a89
...
@@ -207,12 +207,24 @@ def show_engage(request, project, lang=None):
...
@@ -207,12 +207,24 @@ def show_engage(request, project, lang=None):
def
show_project
(
request
,
project
):
def
show_project
(
request
,
project
):
obj
=
get_project
(
request
,
project
)
obj
=
get_project
(
request
,
project
)
dicts
=
Dictionary
.
objects
.
filter
(
dict
_lang
s
=
Dictionary
.
objects
.
filter
(
project
=
obj
project
=
obj
).
values_list
(
).
values_list
(
'language'
,
flat
=
True
'language'
,
flat
=
True
).
distinct
()
).
distinct
()
dicts
=
[]
for
language
in
Language
.
objects
.
filter
(
id__in
=
dict_langs
):
dicts
.
append
(
{
'language'
:
language
,
'count'
:
Dictionary
.
objects
.
filter
(
language
=
language
,
project
=
obj
).
count
(),
}
)
last_changes
=
Change
.
objects
.
prefetch
().
filter
(
last_changes
=
Change
.
objects
.
prefetch
().
filter
(
Q
(
translation__subproject__project
=
obj
)
|
Q
(
translation__subproject__project
=
obj
)
|
Q
(
dictionary__project
=
obj
)
Q
(
dictionary__project
=
obj
)
...
@@ -223,7 +235,7 @@ def show_project(request, project):
...
@@ -223,7 +235,7 @@ def show_project(request, project):
'project.html'
,
'project.html'
,
{
{
'object'
:
obj
,
'object'
:
obj
,
'dicts'
:
Language
.
objects
.
filter
(
id__in
=
dicts
)
,
'dicts'
:
dicts
,
'last_changes'
:
last_changes
,
'last_changes'
:
last_changes
,
'last_changes_rss'
:
reverse
(
'last_changes_rss'
:
reverse
(
'rss-project'
,
'rss-project'
,
...
...
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