Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cosinnus-poll
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
global
Code
cosinnus-poll
Commits
85bfc3a8
Commit
85bfc3a8
authored
5 years ago
by
sascha
Browse files
Options
Downloads
Patches
Plain Diff
Dashboard Timeline Item and Comment Context Menus
parent
36c756ad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cosinnus_poll/models.py
+14
-0
14 additions, 0 deletions
cosinnus_poll/models.py
with
14 additions
and
0 deletions
cosinnus_poll/models.py
+
14
−
0
View file @
85bfc3a8
...
...
@@ -132,6 +132,14 @@ class Poll(LikeableObjectMixin, BaseTaggableObjectModel):
kwargs
=
{
'
group
'
:
self
.
group
,
'
slug
'
:
self
.
slug
}
return
group_aware_reverse
(
'
cosinnus:poll:detail
'
,
kwargs
=
kwargs
)
def
get_edit_url
(
self
):
kwargs
=
{
'
group
'
:
self
.
group
,
'
slug
'
:
self
.
slug
}
return
group_aware_reverse
(
'
cosinnus:poll:edit
'
,
kwargs
=
kwargs
)
def
get_delete_url
(
self
):
kwargs
=
{
'
group
'
:
self
.
group
,
'
slug
'
:
self
.
slug
}
return
group_aware_reverse
(
'
cosinnus:poll:delete
'
,
kwargs
=
kwargs
)
def
get_options_hash
(
self
):
"""
Returns a hashable string containing all suggestions with their time.
Useful to compare equality of suggestions for two doodles.
"""
...
...
@@ -281,6 +289,12 @@ class Comment(models.Model):
if
self
.
pk
:
return
'
%s#comment-%d
'
%
(
self
.
poll
.
get_absolute_url
(),
self
.
pk
)
return
self
.
poll
.
get_absolute_url
()
def
get_edit_url
(
self
):
return
group_aware_reverse
(
'
cosinnus:poll:comment-update
'
,
kwargs
=
{
'
group
'
:
self
.
poll
.
group
,
'
pk
'
:
self
.
pk
})
def
get_delete_url
(
self
):
return
group_aware_reverse
(
'
cosinnus:poll:comment-delete
'
,
kwargs
=
{
'
group
'
:
self
.
poll
.
group
,
'
pk
'
:
self
.
pk
})
def
is_user_following
(
self
,
user
):
"""
Delegates to parent object
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment