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
74f9b584
Commit
74f9b584
authored
Jan 12, 2015
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
96c0426e
04facbe4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
1 deletion
+45
-1
docs/admin/auth.rst
docs/admin/auth.rst
+2
-0
docs/changes.rst
docs/changes.rst
+1
-0
weblate/accounts/models.py
weblate/accounts/models.py
+1
-0
weblate/html/js/detail.html
weblate/html/js/detail.html
+2
-0
weblate/html/list-comments.html
weblate/html/list-comments.html
+8
-0
weblate/html/translate.html
weblate/html/translate.html
+2
-0
weblate/trans/views/edit.py
weblate/trans/views/edit.py
+24
-1
weblate/urls.py
weblate/urls.py
+5
-0
No files found.
docs/admin/auth.rst
View file @
74f9b584
...
...
@@ -167,6 +167,8 @@ Can accept suggestion [Users, Managers]
Can accept suggestion (might be disabled with :ref:`voting`).
Can delete suggestion [Users, Managers]
Can delete suggestion (might be disabled with :ref:`voting`).
Can delete comment [Managers]
Can delete comment.
Can vote for suggestion [Users, Managers]
Can vote for suggestion (see :ref:`voting`).
Can override suggestion state [Managers]
...
...
docs/changes.rst
View file @
74f9b584
...
...
@@ -10,6 +10,7 @@ Released on ? 2015.
* Fulltext search on location and comments fields.
* New SVG/javascript based activity charts.
* Support for Django 1.8.
* Support for deleting comments.
weblate 2.1
-----------
...
...
weblate/accounts/models.py
View file @
74f9b584
...
...
@@ -661,6 +661,7 @@ def create_groups(update):
Permission
.
objects
.
get
(
codename
=
'accept_suggestion'
),
Permission
.
objects
.
get
(
codename
=
'vote_suggestion'
),
Permission
.
objects
.
get
(
codename
=
'override_suggestion'
),
Permission
.
objects
.
get
(
codename
=
'delete_comment'
),
Permission
.
objects
.
get
(
codename
=
'delete_suggestion'
),
Permission
.
objects
.
get
(
codename
=
'ignore_check'
),
Permission
.
objects
.
get
(
codename
=
'upload_dictionary'
),
...
...
weblate/html/js/detail.html
View file @
74f9b584
...
...
@@ -76,7 +76,9 @@
</tr>
<tr>
<td>
{% with next as next_url %}
{% include "list-comments.html" %}
{% endwith %}
</td>
</tr>
{% endif %}
...
...
weblate/html/list-comments.html
View file @
74f9b584
...
...
@@ -13,6 +13,14 @@
{% endif %}
</span>
</div>
{% if perms.trans.delete_comment %}
<form
method=
"POST"
action=
"{% url 'delete-comment' pk=comment.pk %}"
>
{% csrf_token %}
<input
type=
"hidden"
name=
"next"
value=
"{{ next_url }}"
/>
<button
class=
"btn btn-danger btn-xs pull-right flip"
><i
class=
"fa fa-trash"
></i>
{% trans "Delete" %}
</button>
</form>
<div
class=
"clearfix"
></div>
{% endif %}
<div
class=
"list-group"
>
<div
class=
"list-group-item"
dir=
"auto"
>
{{ comment.comment }}
</div>
</div>
...
...
weblate/html/translate.html
View file @
74f9b584
...
...
@@ -281,7 +281,9 @@
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
><h4
class=
"panel-title"
>
{% trans "Comments" %}
</h4></div>
<div
class=
"panel-body"
>
{% with this_unit_url as next_url %}
{% include "list-comments.html" %}
{% endwith %}
</div>
</div>
{% endif %}
...
...
weblate/trans/views/edit.py
View file @
74f9b584
...
...
@@ -19,6 +19,7 @@
#
from
django.shortcuts
import
render
,
get_object_or_404
,
redirect
from
django.views.decorators.http
import
require_POST
from
django.utils.translation
import
ugettext
as
_
from
django.http
import
HttpResponseRedirect
,
HttpResponse
from
django.contrib
import
messages
...
...
@@ -28,7 +29,8 @@ import uuid
import
time
from
weblate.trans.models
import
(
SubProject
,
Unit
,
Change
,
Comment
,
Suggestion
,
Dictionary
SubProject
,
Unit
,
Change
,
Comment
,
Suggestion
,
Dictionary
,
get_related_units
,
)
from
weblate.trans.autofixes
import
fix_target
from
weblate.trans.forms
import
(
...
...
@@ -678,6 +680,27 @@ def comment(request, pk):
return
redirect
(
request
.
POST
.
get
(
'next'
,
translation
))
@
login_required
@
require_POST
def
delete_comment
(
request
,
pk
):
"""
Deletes comment.
"""
comment
=
get_object_or_404
(
Comment
,
pk
=
pk
)
comment
.
project
.
check_acl
(
request
)
units
=
get_related_units
(
comment
)
if
units
.
exists
():
fallback_url
=
units
[
0
].
get_absolute_url
()
else
:
fallback_url
=
comment
.
project
.
get_absolute_url
()
comment
.
delete
()
messages
.
info
(
request
,
_
(
'Translation comment has been deleted.'
))
return
redirect
(
request
.
POST
.
get
(
'next'
,
fallback_url
))
def
get_zen_unitdata
(
translation
,
request
):
'''
Loads unit data for zen mode.
...
...
weblate/urls.py
View file @
74f9b584
...
...
@@ -272,6 +272,11 @@ urlpatterns = patterns(
'weblate.trans.views.edit.comment'
,
name
=
'comment'
,
),
url
(
r'^comment/(?P<pk>[0-9]+)/delete/$'
,
'weblate.trans.views.edit.delete_comment'
,
name
=
'delete-comment'
,
),
# VCS manipulation - commit
url
(
...
...
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