Ë
    ”2Úi¾  ã                   ó†   — d Z ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ  G d„ dej                  ¬	«      Z G d
„ de«      Zy)z7
Module where grappelli dashboard classes are defined.
é    )Úforms)Úreverse)Úgettext_lazy)Úmodules)Úget_admin_site_namec                   ó>   — e Zd ZdZ ed «      ZdZdZdZd„ Z	d„ Z
d„ Zy)Ú	Dashboardaï  
    Base class for dashboards.
    The Dashboard class is a simple python list that has three additional
    properties:

    ``title``
        The dashboard title, by default, it is displayed above the dashboard
        in a ``h2`` tag. Default value: 'Dashboard'.

    ``template``
        The template to use to render the dashboard.
        Default value: 'admin_tools/dashboard/dashboard.html'

    ``columns``
        An integer that represents the number of columns for the dashboard.
        Default value: 2.

    If you want to customize the look of your dashboard and it's modules, you
    can declare css stylesheets and/or javascript files to include when
    rendering the dashboard (these files should be placed in your
    media path), for example::

        from admin_tools.dashboard import Dashboard

        class MyDashboard(Dashboard):
            class Media:
                css = {
                    'all': (
                        'css/mydashboard.css',
                        'css/mystyles.css',
                    ),
                }
                js = (
                    'js/mydashboard.js',
                    'js/myscript.js',
                )

    Here's an example of a custom dashboard::

        from django.urls import reverse
        from django.utils.translation import gettext_lazy as _
        from admin_tools.dashboard import modules, Dashboard

        class MyDashboard(Dashboard):

            # we want a 3 columns layout
            columns = 3

            def __init__(self, **kwargs):
                super(MyDashboard, self).__init__(**kwargs)

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

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

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

    z"grappelli/dashboard/dashboard.htmlé   Nc                 óŠ   — |D ])  }t        | j                  |«      sŒt        | |||   «       Œ+ | j                  xs g | _        y )N)ÚhasattrÚ	__class__ÚsetattrÚchildren)ÚselfÚkwargsÚkeys      úU/var/www/html/acx/venv/lib/python3.12/site-packages/grappelli/dashboard/dashboards.pyÚ__init__zDashboard.__init__\   sA   € Øò 	0ˆCÜ�t—~‘~ sÕ+Ü˜˜c 6¨#¡;Õ/ð	0ð Ÿ™Ò+¨ˆ�ó    c                  ó   — y)a  
        Sometimes you may need to access context or request variables to build
        your dashboard, this is what the ``init_with_context()`` method is for.
        This method is called just before the display with a
        ``django.template.RequestContext`` as unique argument, so you can
        access to all context variables and to the ``django.http.HttpRequest``.
        N© )r   Úcontexts     r   Úinit_with_contextzDashboard.init_with_contextb   s   € ð 	r   c                  ó   — y)zV
        Internal method used to distinguish different dashboards in js code.
        zgrp-dashboardr   )r   s    r   Úget_idzDashboard.get_idl   s   € ð r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_ÚtitleÚtemplateÚcolumnsr   r   r   r   r   r   r   r	   r	      s2   „ ñEñN ˆk‹N€EØ3€HØ€GØ€Hò,òór   r	   )Ú	metaclassc                   ó   — e Zd ZdZd„ Zy)ÚDefaultIndexDashboardad  
    The default dashboard displayed on the admin index page.
    To change the default dashboard you'll have to type the following from the
    commandline in your project root directory::

        python manage.py customdashboard

    And then set the `GRAPPELLI_INDEX_DASHBOARD`` settings variable to
    point to your custom index dashboard class.
    c                 ó˜  — t        |«      }| j                  j                  t        j                  t        d«      dt        d«      dgt        d«      t        d|z  «      gt        d«      t        d|z  «      gg¬	«      «       | j                  j                  t        j                  t        d
«      d¬«      «       | j                  j                  t        j                  t        d«      d¬«      «       | j                  j                  t        j                  t        d«      d«      «       | j                  j                  t        j                  t        d«      dd¬«      «       | j                  j                  t        j                  t        d«      t        d«      ddddœt        d«      ddddœt        d«      dddœg¬«      «       y ) NzQuick linksFzReturn to siteú/zChange passwordz%s:password_changezLog outz	%s:logout)Úcollapsibler   ÚApplications)zdjango.contrib.*)ÚexcludeÚAdministration)ÚmodelszRecent actionsé   zLatest Django Newsz(http://www.djangoproject.com/rss/weblog/)Úfeed_urlÚlimitÚSupportzDjango documentationzhttp://docs.djangoproject.com/TÚ_blank)r!   ÚurlÚexternalÚtargetz"Django "django-users" mailing listz+http://groups.google.com/group/django-userszDjango irc channelzirc://irc.freenode.net/django)r!   r3   r4   )r   )
r   r   Úappendr   ÚLinkListr    r   ÚAppListÚRecentActionsÚFeed)r   r   Ú	site_names      r   r   z'DefaultIndexDashboard.init_with_context   sš  € Ü'¨Ó0ˆ	à�‰×ÑœW×-Ñ-ÜˆmÓØäÐ#Ó$ cÐ*ÜÐ$Ó%ÜÐ-°	Ñ9Ó:ð<ä�9“œw {°YÑ'>Ó?Ð@ð	ô	
ô 		ð 	�‰×ÑœWŸ_™_ÜˆnÓØ)ô
ô 	ð 	�‰×ÑœWŸ_™_ÜÐÓØ(ô
ô 	ð 	�‰×ÑœW×2Ñ2´1Ð5EÓ3FÈÓJÔKð 	�‰×ÑœWŸ\™\ÜÐ"Ó#Ø?Øô
ô 	ð 	�‰×ÑœW×-Ñ-Üˆi‹Lô Ð5Ó6Ø;Ø $Ø&ñ	ô ÐCÓDØHØ $Ø"ñ	ô Ð3Ó4Ø:Ø $ñðô
õ 	r   N)r   r   r   r   r   r   r   r   r&   r&   s   s   „ ñ	ó:r   r&   N)r   Údjangor   Údjango.urlsr   Údjango.utils.translationr   r    Úgrappelli.dashboardr   Úgrappelli.dashboard.utilsr   ÚMediaDefiningClassr	   r&   r   r   r   ú<module>rB      s>   ðñõ Ý Ý 6å 'Ý 9ôa˜%×2Ñ2õ aôHF˜Iõ Fr   