Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.web
Commits
4356da19
Commit
4356da19
authored
Sep 11, 2020
by
Samuel GAIST
Committed by
Flavio TARSETTI
Sep 11, 2020
Browse files
[team][templatetags] Pre-commit cleanup
parent
13ed9575
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/web/team/templatetags/team_tags.py
View file @
4356da19
...
...
@@ -26,19 +26,18 @@
###############################################################################
from
django
import
template
from
django.conf
import
settings
register
=
template
.
Library
()
#--------------------------------------------------
#
--------------------------------------------------
@
register
.
inclusion_tag
(
'
team/panels/table.html
'
,
takes_context
=
True
)
@
register
.
inclusion_tag
(
"
team/panels/table.html
"
,
takes_context
=
True
)
def
team_table
(
context
,
objects
,
owner
,
id
):
'''
Composes a team list table
"""
Composes a team list table
This panel primarily exists for user's team list page.
...
...
@@ -50,22 +49,22 @@ def team_table(context, objects, owner, id):
id: The HTML id to set on the generated table. This is handy for the
filter functionality normally available on list pages.
'''
"""
return
{
'
request
'
:
context
[
'
request
'
],
'
objects
'
:
objects
,
'
owner
'
:
owner
,
'
panel_id
'
:
id
,
"
request
"
:
context
[
"
request
"
],
"
objects
"
:
objects
,
"
owner
"
:
owner
,
"
panel_id
"
:
id
,
}
#--------------------------------------------------
#
--------------------------------------------------
@
register
.
inclusion_tag
(
'
team/panels/actions.html
'
,
takes_context
=
True
)
@
register
.
inclusion_tag
(
"
team/panels/actions.html
"
,
takes_context
=
True
)
def
team_actions
(
context
,
obj
,
display_count
):
'''
Composes the action buttons for a particular team
"""
Composes the action buttons for a particular team
This panel primarily exists for showing action buttons for a given
team taking into consideration it is being displayed for a given user.
...
...
@@ -78,29 +77,30 @@ def team_actions(context, obj, display_count):
display_count (bool): If true, displays the number of elements in the
team in a button
'''
"""
return
{
'
request
'
:
context
[
'
request
'
],
'
display_count
'
:
display_count
,
'
object
'
:
obj
,
"
request
"
:
context
[
"
request
"
],
"
display_count
"
:
display_count
,
"
object
"
:
obj
,
}
#--------------------------------------------------
#
--------------------------------------------------
@
register
.
inclusion_tag
(
'
ui/contribution_list.html
'
)
@
register
.
inclusion_tag
(
"
ui/contribution_list.html
"
)
def
user_list
(
id
):
return
{
'panel_id'
:
id
,
'URL_PREFIX'
:
settings
.
URL_PREFIX
,
'finder_placeholder'
:
'Find an User...'
,
'owner'
:
False
,
}
return
{
"panel_id"
:
id
,
"URL_PREFIX"
:
settings
.
URL_PREFIX
,
"finder_placeholder"
:
"Find an User..."
,
"owner"
:
False
,
}
#--------------------------------------------------
#
--------------------------------------------------
@
register
.
simple_tag
(
takes_context
=
True
)
def
total_shares_for_user
(
context
,
team
):
return
team
.
total_shares
(
context
[
'
request
'
].
user
)
return
team
.
total_shares
(
context
[
"
request
"
].
user
)
Write
Preview
Supports
Markdown
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