<commit_before>from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from admin_tools.dashboard import modules, Dashboard, AppIndexDashboard

# to activate your index dashboard add the following to your settings.py:
#
# ADMIN_TOOLS_INDEX_DASHBOARD = 'teerace.dashboard.CustomIndexDashboard'

class CustomIndexDashboard(Dashboard):
	"""
	Custom index dashboard for teerace.
	"""
	def __init__(self, **kwargs):
		Dashboard.__init__(self, **kwargs)

		# append a link list module for "quick links"
		self.children.append(modules.LinkList(
			title=_('Quick links'),
			layout='inline',
			draggable=False,
			deletable=False,
			collapsible=False,
			children=[
				{
					'title': _('Return to site'),
					'url': '/',
				},
				{
					'title': _('Change password'),
					'url': reverse('admin:password_change'),
				},
				{
					'title': _('Log out'),
					'url': reverse('admin:logout')
				},
			]
		))

		# append an app list module for "Applications"
		self.children.append(modules.AppList(
			title=_('Applications'),
			exclude_list=('django.contrib','piston'),
		))

		# append an app list module for "Administration"
		self.children.append(modules.AppList(
			title=_('Administration'),
			include_list=('django.contrib',),
		))

		# append a recent actions module
		self.children.append(modules.RecentActions(
			title=_('Recent Actions'),
			limit=5
		))

		# append a feed module
		self.children.append(modules.Feed(
			title=_('Latest Django News'),
			feed_url='http://www.djangoproject.com/rss/weblog/',
			limit=5
		))

		# append another link list module for "support".
		self.children.append(modules.LinkList(
			title=_('Support'),
			children=[
				{
					'title': _('Django documentation'),
					'url': 'http://docs.djangoproject.com/',
					'external': True,
				},
				{
					'title': _('Django "django-users" mailing list'),
					'url': 'http://groups.google.com/group/django-users',
					'external': True,
				},
				{
					'title': _('Django irc channel'),
					'url': 'irc://irc.freenode.net/django',
					'external': True,
				},
			]
		))

	def init_with_context(self, context):
		"""
		Use this method if you need to access the request context.
		"""
		pass


# to activate your app index dashboard add the following to your settings.py:
#
# ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'teerace.dashboard.CustomAppIndexDashboard'

class CustomAppIndexDashboard(AppIndexDashboard):
	"""
	Custom app index dashboard for teerace.
	"""
	def __init__(self, *args, **kwargs):
		AppIndexDashboard.__init__(self, *args, **kwargs)

		# we disable title because its redundant with the model list module
		self.title = ''

		# append a model list module
		self.children.append(modules.ModelList(
			title=self.app_title,
			include_list=self.models,
		))

		# append a recent actions module
		self.children.append(modules.RecentActions(
			title=_('Recent Actions'),
			include_list=self.get_app_content_types(),
		))

	def init_with_context(self, context):
		"""
		Use this method if you need to access the request context.
		"""
		pass<commit_msg>removed i18n from dashboard<commit_after>from django.core.urlresolvers import reverse
from admin_tools.dashboard import modules, Dashboard, AppIndexDashboard

# to activate your index dashboard add the following to your settings.py:
#
# ADMIN_TOOLS_INDEX_DASHBOARD = 'teerace.dashboard.CustomIndexDashboard'

class CustomIndexDashboard(Dashboard):
	"""
	Custom index dashboard for teerace.
	"""
	def __init__(self, **kwargs):
		Dashboard.__init__(self, **kwargs)

		# append a link list module for "quick links"
		self.children.append(modules.LinkList(
			title="Quick links",
			layout='inline',
			draggable=False,
			deletable=False,
			collapsible=False,
			children=[
				{
					'title': "Return to site",
					'url': '/',
				},
				{
					'title': "Change password",
					'url': reverse('admin:password_change'),
				},
				{
					'title': "Log out",
					'url': reverse('admin:logout')
				},
			]
		))

		# append an app list module for "Applications"
		self.children.append(modules.AppList(
			title="Applications",
			exclude_list=('django.contrib', 'piston'),
		))

		# append an app list module for "Administration"
		self.children.append(modules.AppList(
			title="Administration",
			include_list=('django.contrib',),
		))

		# append a recent actions module
		self.children.append(modules.RecentActions(
			title="Recent Actions",
			limit=5
		))

		# append a feed module
		self.children.append(modules.Feed(
			title="Latest Django News",
			feed_url='http://www.djangoproject.com/rss/weblog/',
			limit=5
		))

		# append another link list module for "support".
		self.children.append(modules.LinkList(
			title="Support",
			children=[
				{
					'title': "Django documentation",
					'url': 'http://docs.djangoproject.com/',
					'external': True,
				},
				{
					'title': "Django \"django-users\" mailing list",
					'url': 'http://groups.google.com/group/django-users',
					'external': True,
				},
				{
					'title': "Django irc channel",
					'url': 'irc://irc.freenode.net/django',
					'external': True,
				},
			]
		))

	def init_with_context(self, context):
		"""
		Use this method if you need to access the request context.
		"""
		pass


# to activate your app index dashboard add the following to your settings.py:
#
# ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'teerace.dashboard.CustomAppIndexDashboard'

class CustomAppIndexDashboard(AppIndexDashboard):
	"""
	Custom app index dashboard for teerace.
	"""
	def __init__(self, *args, **kwargs):
		AppIndexDashboard.__init__(self, *args, **kwargs)

		# we disable title because its redundant with the model list module
		self.title = ''

		# append a model list module
		self.children.append(modules.ModelList(
			title=self.app_title,
			include_list=self.models,
		))

		# append a recent actions module
		self.children.append(modules.RecentActions(
			title="Recent Actions",
			include_list=self.get_app_content_types(),
		))

	def init_with_context(self, context):
		"""
		Use this method if you need to access the request context.
		"""
		pass
{'fraction_non_alphanumeric': 0.1333985649054142, 'fraction_numerical': 0.0009784735812133072, 'mean_word_length': 3.750580945003873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1418062', 'n_tokens_mistral': 2366, 'n_tokens_neox': 1955, 'n_words': 462}