Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.web
Commits
4356da19
Commit
4356da19
authored
4 years ago
by
Samuel GAIST
Committed by
Flavio TARSETTI
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[team][templatetags] Pre-commit cleanup
parent
13ed9575
No related branches found
No related tags found
2 merge requests
!364
Cleanup team
,
!342
Django 3 migration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/web/team/templatetags/team_tags.py
+25
-25
25 additions, 25 deletions
beat/web/team/templatetags/team_tags.py
with
25 additions
and
25 deletions
beat/web/team/templatetags/team_tags.py
+
25
−
25
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
)
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