class ConseDashboard(Dashboard): # append an app list module for "Country_prefix" self.children.append( modules.AppList( _('Dashboard Stats Settings'), models=('admin_tools_stats.*', ), )) # Copy following code into your custom dashboard # append following code after recent actions module or # a link list module for "quick links" graph_list = get_active_graph() for i in graph_list: kwargs = {} #kwargs['chart_size'] = "260x100" # uncomment this option to fix your graph size kwargs['graph_key'] = i.graph_key if request.POST.get('select_box_' + i.graph_key): kwargs['select_box_' + i.graph_key] = request.POST['select_box_' + i.graph_key] self.children.append(DashboardCharts(**kwargs))
def init_with_context(self, context): request = context['request'] # we want a 3 columns layout self.columns = 3 self.children.append( modules.Group(title=_("General"), display="tabs", children=[ modules.AppList( title=_('User'), models=( 'django.contrib.*', 'user_profile.*', 'agent.*', ), ), modules.AppList( _('Task Manager'), models=('djcelery.*', ), ), modules.AppList( _('Dashboard stats'), models=('admin_tools_stats.*', ), ), modules.RecentActions(_('Recent Actions'), 5), ])) self.children.append( modules.AppList( _('Callcenter'), models=('callcenter.*', ), )) self.children.append( modules.AppList( _('Settings'), models=('dialer_settings.*', ), )) # append an app list module for "Dialer" self.children.append( modules.AppList( _('VoIP dialer'), models=( 'dialer_cdr.*', 'dialer_gateway.*', 'dialer_contact.*', 'dialer_campaign.*', ), )) # append an app list module for "Dialer" self.children.append( modules.AppList( _('Surveys'), models=('survey.*', ), )) self.children.append( modules.AppList( _('SMS Gateway'), models=('sms.*', ), )) # append an app list module for "SMS" self.children.append( modules.AppList( _('SMS module'), models=('mod_sms.*', ), )) # append an app list module for "Dialer" self.children.append( modules.AppList( _('Audio Files'), models=('audiofield.*', ), )) self.children.append( modules.AppList( _('Do Not Call'), models=('dnc.*', ), )) self.children.append( modules.AppList( _('Appointment'), models=('appointment.*', ), )) self.children.append( modules.AppList( _('Mod Mailer'), models=('mod_mailer.*', ), )) self.children.append( modules.AppList( _('Calendar Settings'), models=('calendar_settings.*', ), )) self.children.append( modules.LinkList( _('Reporting'), draggable=True, deletable=True, collapsible=True, children=[ [ _('Call Daily Report'), reverse('admin:dialer_cdr_voipcall_changelist') + 'voip_daily_report/' ], ], )) # append a link list module for "quick links" # site_name = get_admin_site_name(context) # Quick link seems to broke the admin design if too many element self.children.append( modules.LinkList( _('Quick links'), layout='inline', draggable=True, deletable=True, collapsible=True, children=[ [ _('Newfies-Dialer Website'), 'http://www.newfies-dialer.org/' ], [ _('Support'), 'http://www.newfies-dialer.org/about-us/contact/' ], [_('Add-ons'), 'http://www.newfies-dialer.org/add-ons/'], # [_('Change password'), reverse('%s:password_change' % site_name)], # [_('Log out'), reverse('%s:logout' % site_name)], ], )) if not settings.DEBUG: # append a feed module self.children.append( modules.Feed( _('Latest Newfies-Dialer News'), feed_url= 'http://www.newfies-dialer.org/category/blog/feed/', limit=5)) # append an app list module for "Country_prefix" self.children.append( modules.AppList( _('Dashboard Stats Settings'), models=('admin_dashboard_stats.*', ), )) # Copy following code into your custom dashboard graph_list = get_active_graph() for i in graph_list: kwargs = {} kwargs['require_chart_jscss'] = False kwargs['graph_key'] = i.graph_key if request.POST.get('select_box_' + i.graph_key): kwargs['select_box_' + i.graph_key] = request.POST['select_box_' + i.graph_key] self.children.append(DashboardCharts(**kwargs))
def init_with_context(self, context): site_name = get_admin_site_name(context) # append a link list module for "quick links" self.children.append( modules.LinkList( _('Quick links'), layout='inline', draggable=False, deletable=False, collapsible=False, children=[ [_('Return to site'), '/'], [ _('Change password'), reverse('%s:password_change' % site_name) ], [_('Log out'), reverse('%s:logout' % site_name)], ])) # append an app list module for "Applications" self.children.append( modules.AppList( _('Applications'), exclude=('django.contrib.*', ), )) # append an app list module for "Administration" self.children.append( modules.AppList( _('Administration'), models=('django.contrib.*', ), )) # append a recent actions module self.children.append(modules.RecentActions(_('Recent Actions'), 5)) graph_list = get_active_graph() for i in graph_list: kwargs = {} kwargs['graph_key'] = i.graph_key kwargs['require_chart_jscss'] = False if context['request'].POST.get('select_box_' + i.graph_key): kwargs['select_box_' + i.graph_key] = context['request'].POST['select_box_' + i.graph_key] self.children.append(DashboardCharts(**kwargs)) # append a feed module self.children.append( modules.Feed(_('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( _('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): request = context['request'] # we want a 3 columns layout self.columns = 3 site_name = get_admin_site_name(context) #self.children.append( # HistoryDashboardModule() #) self.children.append( modules.Group(title="General", display="tabs", children=[ modules.AppList( title='User', models=( 'django.contrib.*', 'user_profile.*', ), ), modules.AppList( _('Task Manager'), models=('djcelery.*', ), ), modules.AppList( _('Dashboard Stats'), models=('admin_tools_stats.*', ), ), modules.RecentActions(_('Recent Actions'), 5), ])) self.children.append( modules.AppList( _('Settings'), models=('dialer_settings.*', ), )) # append an app list module for "Dialer" self.children.append( modules.AppList( _('Voip Dialer'), models=( 'dialer_cdr.*', 'dialer_gateway.*', 'dialer_campaign.*', ), )) # append an app list module for "Dialer" self.children.append( modules.AppList( _('Voip Server'), models=('voice_app.*', ), )) # append an app list module for "Dialer" self.children.append( modules.AppList( _('Audio Files'), models=('audiofield.*', ), )) # append an app list module for "Country_prefix" self.children.append( modules.AppList( _('Survey'), models=('survey.*', ), )) # append a link list module for "quick links" """ #Quick link seems to broke the admin design if too many element self.children.append(modules.LinkList( _('Quick links'), layout='inline', draggable=True, deletable=True, collapsible=True, children=[ [_('Go to Newfies-Dialer'), 'http://www.newfies-dialer.org/'], [_('Change password'), reverse('%s:password_change' % site_name)], [_('Log out'), reverse('%s:logout' % site_name)], ], )) """ if not settings.DEBUG: # append a feed module self.children.append( modules.Feed( _('Latest Newfies-Dialer News'), feed_url= 'http://www.newfies-dialer.org/category/blog/feed/', limit=5)) # append an app list module for "Country_prefix" self.children.append( modules.AppList( _('Dashboard Stats Settings'), models=('admin_dashboard_stats.*', ), )) # Copy following code into your custom dashboard graph_list = get_active_graph() for i in graph_list: kwargs = {} kwargs['chart_size'] = "360x100" kwargs['graph_key'] = i.graph_key if request.POST.get('select_box_' + i.graph_key): kwargs['select_box_' + i.graph_key] = request.POST['select_box_' + i.graph_key] self.children.append(DashboardCharts(**kwargs))
from admin_tools_stats.modules import DashboardCharts, get_active_graph # append an app list module for "Country_prefix" self.children.append( modules.AppList( _('Dashboard Stats Settings'), models=('admin_tools_stats.*', ), )) # Copy following code into your custom dashboard # append following code after recent actions module or # a link list module for "quick links" graph_list = get_active_graph() for i in graph_list: kwargs = {} kwargs['graph_key'] = i.graph_key kwargs['require_chart_jscss'] = False if context['request'].POST.get('select_box_' + i.graph_key): kwargs['select_box_' + i.graph_key] = context['request'].POST['select_box_' + i.graph_key] self.children.append(DashboardCharts(**kwargs))
def init_with_context(self, context): request = context['request'] # we want a 3 columns layout self.columns = 3 site_name = get_admin_site_name(context) #self.children.append( # HistoryDashboardModule() #) self.children.append(modules.Group( title="General", display="tabs", children=[ modules.AppList( title='User', models=('django.contrib.*', 'user_profile.*', ), ), modules.AppList( _('Task Manager'), models=('djcelery.*', ), ), modules.AppList( _('Dashboard Stats'), models=('admin_tools_stats.*', ), ), modules.RecentActions(_('Recent Actions'), 5), ] )) self.children.append(modules.AppList( _('Settings'), models=('dialer_settings.*', ), )) # append an app list module for "Dialer" self.children.append(modules.AppList( _('Voip Dialer'), models=('dialer_cdr.*', 'dialer_gateway.*', 'dialer_campaign.*', ), )) # append an app list module for "Dialer" self.children.append(modules.AppList( _('Voip Server'), models=('voice_app.*', ), )) # append an app list module for "Dialer" self.children.append(modules.AppList( _('Audio Files'), models=('audiofield.*', ), )) # append an app list module for "Country_prefix" self.children.append(modules.AppList( _('Survey'), models=('survey.*', ), )) # append a link list module for "quick links" """ #Quick link seems to broke the admin design if too many element self.children.append(modules.LinkList( _('Quick links'), layout='inline', draggable=True, deletable=True, collapsible=True, children=[ [_('Go to Newfies-Dialer'), 'http://www.newfies-dialer.org/'], [_('Change password'), reverse('%s:password_change' % site_name)], [_('Log out'), reverse('%s:logout' % site_name)], ], )) """ # append a feed module self.children.append(modules.Feed( _('Latest Newfies-Dialer News'), feed_url='http://www.newfies-dialer.org/category/blog/feed/', limit=5 )) # append an app list module for "Country_prefix" self.children.append(modules.AppList( _('Dashboard Stats Settings'), models=('admin_dashboard_stats.*', ), )) # Copy following code into your custom dashboard graph_list = get_active_graph() for i in graph_list: kwargs = {} kwargs['chart_size'] = "360x100" kwargs['graph_key'] = i.graph_key if request.POST.get('select_box_'+i.graph_key): kwargs['select_box_'+i.graph_key] = request.POST['select_box_'+i.graph_key] self.children.append(DashboardCharts(**kwargs))
def init_with_context(self, context): request = context['request'] # we want a 3 columns layout self.columns = 3 self.children.append(modules.Group( title=_("General"), display="tabs", children=[ modules.AppList( title=_('User'), models=('django.contrib.*', 'user_profile.*', 'agent.*', ), ), modules.AppList( _('Task Manager'), models=('djcelery.*', ), ), modules.AppList( _('Dashboard stats'), models=('admin_tools_stats.*', ), ), modules.RecentActions(_('Recent Actions'), 5), ] )) self.children.append(modules.AppList( _('Callcenter'), models=('callcenter.*', ), )) self.children.append(modules.AppList( _('Settings'), models=('dialer_settings.*', ), )) # append an app list module for "Dialer" self.children.append(modules.AppList( _('VoIP dialer'), models=('dialer_cdr.*', 'dialer_gateway.*', 'dialer_contact.*', 'dialer_campaign.*', ), )) # append an app list module for "Dialer" self.children.append(modules.AppList( _('Surveys'), models=('survey.*', ), )) self.children.append(modules.AppList( _('SMS Gateway'), models=('sms.*', ), )) # append an app list module for "SMS" self.children.append(modules.AppList( _('SMS module'), models=('mod_sms.*', ), )) # append an app list module for "Dialer" self.children.append(modules.AppList( _('Audio Files'), models=('audiofield.*', ), )) self.children.append(modules.AppList( _('Do Not Call'), models=('dnc.*', ), )) self.children.append(modules.AppList( _('Appointment'), models=('appointment.*', ), )) self.children.append(modules.AppList( _('Mod Mailer'), models=('mod_mailer.*', ), )) self.children.append(modules.AppList( _('Calendar Settings'), models=('calendar_settings.*', ), )) self.children.append(modules.LinkList( _('Reporting'), draggable=True, deletable=True, collapsible=True, children=[ [_('Call Daily Report'), reverse('admin:dialer_cdr_voipcall_changelist') + 'voip_daily_report/'], ], )) # append a link list module for "quick links" #""" # site_name = get_admin_site_name(context) # Quick link seems to broke the admin design if too many element self.children.append(modules.LinkList( _('Quick links'), layout='inline', draggable=True, deletable=True, collapsible=True, children=[ [_('Newfies-Dialer Website'), 'http://www.newfies-dialer.org/'], [_('Support'), 'http://www.newfies-dialer.org/about-us/contact/'], [_('Add-ons'), 'http://www.newfies-dialer.org/add-ons/'], # [_('Change password'), reverse('%s:password_change' % site_name)], # [_('Log out'), reverse('%s:logout' % site_name)], ], )) # """ if not settings.DEBUG: # append a feed module self.children.append(modules.Feed( _('Latest Newfies-Dialer News'), feed_url='http://www.newfies-dialer.org/category/blog/feed/', limit=5 )) # append an app list module for "Country_prefix" self.children.append(modules.AppList( _('Dashboard Stats Settings'), models=('admin_dashboard_stats.*', ), )) # Copy following code into your custom dashboard graph_list = get_active_graph() for i in graph_list: kwargs = {} kwargs['require_chart_jscss'] = False kwargs['graph_key'] = i.graph_key if request.POST.get('select_box_' + i.graph_key): kwargs['select_box_' + i.graph_key] = request.POST['select_box_' + i.graph_key] self.children.append(DashboardCharts(**kwargs))
def init_with_context(self, context): site_name = get_admin_site_name(context) # append a link list module for "quick links" self.children.append( modules.LinkList( _('Quick links'), layout='inline', draggable=False, deletable=False, collapsible=False, children=[ [_('Return to site'), '/'], [ _('Change password'), reverse('%s:password_change' % site_name), ], [_('Log out'), reverse('%s:logout' % site_name)], [_('Helpdesk'), reverse('helpdesk:dashboard')], ], ), ) # append an app list module for "Applications" self.children.append( modules.AppList( _('Applications'), exclude=('django.contrib.*', ), ), ) # append an app list module for "Administration" self.children.append( modules.AppList( _('Administration'), models=('django.contrib.*', ), ), ) # append a recent actions module self.children.append(modules.RecentActions(_('Recent Actions'), 5)) self.children.append( modules.LinkList( _('Statistics'), children=[ { 'title': _('Members'), 'url': '/admin/aklub/stat-members', 'external': False, }, { 'title': _('Payments'), 'url': '/admin/aklub/stat-payments', 'external': False, }, ], ), ) # Modules for conditions: children = [] if AccountStatements.objects.exists(): children.append({ 'title': _(u"Days from last bill upload: %(days)s days") % { "days": (timezone.now() - AccountStatements.objects.first().import_date).days, }, 'url': "aklub/accountstatements/", 'external': False, }) if MassCommunication.objects.exists(): children.append({ 'title': _(u"Days from last mass communication: %(days)s days") % { "days": (datetime.date.today() - MassCommunication.objects.order_by("-date").first().date ).days }, 'url': "aklub/masscommunication/", 'external': False, }) for cond in Condition.objects.filter(on_dashboard=True): children.append({ 'title': _(u"%(name)s: %(items)s items") % { "name": str(cond.name), "items": get_users_by_condition_cached(cond).count(), }, 'url': "aklub/user/?user_condition=%i" % cond.id, 'external': False, }) self.children.append( modules.LinkList( _('Conditions'), children=children, ), ) for cond in Condition.objects.filter(on_dashboard=True): children = [] members = get_users_by_condition_cached(cond) for member in members[:10]: children.append({ 'title': member.person_name(), 'url': reverse('admin:aklub_userincampaign_change', args=[member.id]), 'external': False, }) self.children.append( modules.LinkList( title=cond.name, title_url="aklub/user/?user_condition=%i" % cond.id, children=children, pre_content=_(u"Total number of items: %i") % members.count(), ), ) # append an app list module self.children.append( modules.AppList( _('Dashboard Stats Settings'), models=('admin_tools_stats.*', ), ), ) # Copy following code into your custom dashboard # append following code after recent actions module or # a link list module for "quick links" graph_list = get_active_graph() for i in graph_list: kwargs = {} kwargs['require_chart_jscss'] = True kwargs['graph_key'] = i.graph_key for key in context['request'].POST: if key.startswith('select_box_'): kwargs[key] = context['request'].POST[key] self.children.append(YearDashboardCharts(**kwargs))
def init_with_context(self, context): # noqa site_name = get_admin_site_name(context) # append a link list module for "quick links" self.children.append( modules.LinkList( _("Quick links"), layout="inline", draggable=False, deletable=False, collapsible=False, children=[ [_("Return to site"), "/"], [ _("Change password"), reverse("%s:password_change" % site_name), ], [_("Log out"), reverse("%s:logout" % site_name)], [_("Helpdesk"), reverse("helpdesk:dashboard")], ], ), ) # append an app list module for "Applications" self.children.append( modules.AppList( _("Applications"), exclude=("django.contrib.*", ), ), ) # append an app list module for "Administration" self.children.append( modules.AppList( _("Administration"), models=("django.contrib.*", ), ), ) # append a recent actions module self.children.append(modules.RecentActions(_("Recent Actions"), 5)) self.children.append( modules.LinkList( _("Statistics"), children=[ { "title": _("Members"), "url": "/admin/aklub/stat-members", "external": False, }, { "title": _("Payments"), "url": "/admin/aklub/stat-payments", "external": False, }, ], ), ) # Modules for conditions: children = [] if AccountStatements.objects.exists(): children.append({ "title": _(u"Days from last bill upload: %(days)s days") % { "days": (timezone.now() - AccountStatements.objects.first().import_date).days, }, "url": "aklub/accountstatements/", "external": False, }) if MassCommunication.objects.exists(): children.append({ "title": _(u"Days from last mass communication: %(days)s days") % { "days": (datetime.date.today() - MassCommunication.objects.order_by("-date").first().date ).days }, "url": "aklub/masscommunication/", "external": False, }) for cond in NamedCondition.objects.filter(on_dashboard=True): children.append({ "title": _(u"%(name)s: %(items)s items") % { "name": str(cond.name), "items": get_users_by_condition_cached(cond).count(), }, "url": reverse("admin:aklub_userprofile_changelist") + "?user_condition=%i" % cond.id, "external": False, }) self.children.append( modules.LinkList( _("Conditions"), children=children, ), ) for cond in NamedCondition.objects.filter(on_dashboard=True): children = [] members = get_users_by_condition_cached(cond) for member in members[:10]: children.append({ "title": member.person_name(), "url": reverse("admin:aklub_donorpaymentchannel_change", args=[member.id]), "external": False, }) self.children.append( modules.LinkList( title=cond.name, title_url=reverse("admin:aklub_userprofile_changelist") + "/?user_condition=%i" % cond.id, children=children, pre_content=_(u"Total number of items: %i") % members.count(), ), ) # append an app list module self.children.append( modules.AppList( _("Dashboard Stats Settings"), models=("admin_tools_stats.*", ), ), ) # Copy following code into your custom dashboard # append following code after recent actions module or # a link list module for "quick links" if context["request"].user.has_perm( "admin_tools_stats.view_dashboardstats"): graph_list = get_active_graph() else: graph_list = [] for i in graph_list: kwargs = {} kwargs["require_chart_jscss"] = True kwargs["graph_key"] = i.graph_key for key in context["request"].POST: if key.startswith("select_box_"): kwargs[key] = context["request"].POST[key] self.children.append(DashboardChart(**kwargs))
def init_with_context(self, context): site_name = get_admin_site_name(context) # append a link list module for "quick links" self.children.append(modules.LinkList( _('Quick links'), layout='inline', draggable=False, deletable=False, collapsible=False, children=[ [_('Return to site'), '/'], [_('Change password'), reverse('%s:password_change' % site_name)], [_('Log out'), reverse('%s:logout' % site_name)], ] )) # append an app list module for "Applications" self.children.append(modules.AppList( _('Applications'), exclude=('django.contrib.*',), )) # append an app list module for "Administration" self.children.append(modules.AppList( _('Administration'), models=('django.contrib.*',), )) # append a recent actions module self.children.append(modules.RecentActions(_('Recent Actions'), 5)) # append a feed module self.children.append(modules.Feed( _('Latest Django News'), feed_url='http://www.djangoproject.com/rss/weblog/', limit=5 )) # append an app list module self.children.append(modules.AppList( _('Dashboard Stats Settings'), models=('admin_tools_stats.*', ), )) # Copy following code into your custom dashboard # append following code after recent actions module or # a link list module for "quick links" graph_list = get_active_graph() for i in graph_list: kwargs = {} kwargs['require_chart_jscss'] = True kwargs['graph_key'] = i.graph_key if context['request'].POST.get('select_box_' + i.graph_key): kwargs['select_box_' + i.graph_key] = context['request'].POST['select_box_' + i.graph_key] self.children.append(DashboardCharts(**kwargs)) # append another link list module for "support". self.children.append(modules.LinkList( _('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, }, ] ))