Commit 4356da19 authored by Samuel GAIST's avatar Samuel GAIST Committed by Flavio TARSETTI
Browse files

[team][templatetags] Pre-commit cleanup

parent 13ed9575
...@@ -26,19 +26,18 @@ ...@@ -26,19 +26,18 @@
############################################################################### ###############################################################################
from django import template from django import template
from django.conf import settings from django.conf import settings
register = template.Library() 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): 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. This panel primarily exists for user's team list page.
...@@ -50,22 +49,22 @@ def team_table(context, objects, owner, id): ...@@ -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 id: The HTML id to set on the generated table. This is handy for the
filter functionality normally available on list pages. filter functionality normally available on list pages.
''' """
return { return {
'request': context['request'], "request": context["request"],
'objects': objects, "objects": objects,
'owner': owner, "owner": owner,
'panel_id': id, "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): 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 This panel primarily exists for showing action buttons for a given
team taking into consideration it is being displayed for a given user. team taking into consideration it is being displayed for a given user.
...@@ -78,29 +77,30 @@ def team_actions(context, obj, display_count): ...@@ -78,29 +77,30 @@ def team_actions(context, obj, display_count):
display_count (bool): If true, displays the number of elements in the display_count (bool): If true, displays the number of elements in the
team in a button team in a button
''' """
return { return {
'request': context['request'], "request": context["request"],
'display_count': display_count, "display_count": display_count,
'object': obj, "object": obj,
} }
#-------------------------------------------------- # --------------------------------------------------
@register.inclusion_tag('ui/contribution_list.html') @register.inclusion_tag("ui/contribution_list.html")
def user_list(id): def user_list(id):
return { 'panel_id': id, return {
'URL_PREFIX': settings.URL_PREFIX, "panel_id": id,
'finder_placeholder': 'Find an User...', "URL_PREFIX": settings.URL_PREFIX,
'owner': False, "finder_placeholder": "Find an User...",
} "owner": False,
}
#-------------------------------------------------- # --------------------------------------------------
@register.simple_tag(takes_context=True) @register.simple_tag(takes_context=True)
def total_shares_for_user(context, team): def total_shares_for_user(context, team):
return team.total_shares(context['request'].user) return team.total_shares(context["request"].user)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment