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
36407b10
Commit
36407b10
authored
Apr 15, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not list repositories multiple time in status
Fixes #670 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
dcdb7109
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
8 deletions
+31
-8
weblate/html/js/git-status.html
weblate/html/js/git-status.html
+5
-7
weblate/trans/models/subproject.py
weblate/trans/models/subproject.py
+4
-1
weblate/trans/views/js.py
weblate/trans/views/js.py
+22
-0
No files found.
weblate/html/js/git-status.html
View file @
36407b10
...
...
@@ -52,14 +52,12 @@
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
><h4
class=
"panel-title"
>
{% trans "Repository details" %}
</h4></div>
<div
class=
"panel-body"
>
{% if object.subproject_set %}
{% for sp in object.subproject_set.all %}
<h4>
{{ sp }}
</h3>
<pre>
{{ sp.repository.status }}
</pre>
{% endfor %}
{% else %}
<pre>
{{ object.repository.status }}
</pre>
{% for status in statuses %}
{% if status.0 %}
<h4>
{{ status.0 }}
</h4>
{% endif %}
<pre>
{{ status.1 }}
</pre>
{% endfor %}
</div>
</div>
...
...
weblate/trans/models/subproject.py
View file @
36407b10
...
...
@@ -767,12 +767,15 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
return
True
def
get_repo_link_url
(
self
):
return
'weblate://%s/%s'
%
(
self
.
project
.
slug
,
self
.
slug
)
def
get_linked_childs
(
self
):
'''
Returns list of subprojects which link repository to us.
'''
return
SubProject
.
objects
.
filter
(
repo
=
'weblate://%s/%s'
%
(
self
.
project
.
slug
,
self
.
slug
)
repo
=
self
.
get_repo_link_url
(
)
)
def
commit_pending
(
self
,
request
,
from_link
=
False
,
skip_push
=
False
):
...
...
weblate/trans/views/js.py
View file @
36407b10
...
...
@@ -132,6 +132,25 @@ def ignore_check(request, check_id):
def
git_status_project
(
request
,
project
):
obj
=
get_project
(
request
,
project
)
statuses
=
[]
included
=
set
()
not_linked
=
obj
.
subproject_set
.
exclude
(
repo__startswith
=
'weblate://'
)
linked
=
obj
.
subproject_set
.
filter
(
repo__startswith
=
'weblate://'
)
for
subproject
in
not_linked
:
statuses
.
append
((
subproject
.
__unicode__
(),
subproject
.
repository
.
status
,
))
included
.
add
(
subproject
.
get_repo_link_url
())
for
subproject
in
linked
.
exclude
(
repo__in
=
included
):
statuses
.
append
((
subproject
.
__unicode__
(),
subproject
.
repository
.
status
,
))
return
render
(
request
,
'js/git-status.html'
,
...
...
@@ -141,6 +160,7 @@ def git_status_project(request, project):
subproject__project
=
obj
,
action__in
=
Change
.
ACTIONS_REPOSITORY
,
)[:
10
],
'statuses'
:
statuses
,
}
)
...
...
@@ -161,6 +181,7 @@ def git_status_subproject(request, project, subproject):
action__in
=
Change
.
ACTIONS_REPOSITORY
,
subproject
=
obj
,
)[:
10
],
'statuses'
:
[(
None
,
obj
.
repository
.
status
)],
}
)
...
...
@@ -181,6 +202,7 @@ def git_status_translation(request, project, subproject, lang):
action__in
=
Change
.
ACTIONS_REPOSITORY
,
subproject
=
obj
.
subproject
,
)[:
10
],
'statuses'
:
[(
None
,
obj
.
subproject
.
repository
.
status
)],
}
)
...
...
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