dashboard.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. from jet.dashboard import modules
  2. from jet.dashboard.dashboard import Dashboard
  3. class TestIndexDashboard(Dashboard):
  4. columns = 3
  5. init_with_context_called = False
  6. class Media:
  7. js = ('file.js', 'file2.js')
  8. css = ('file.css', 'file2.css')
  9. def init_with_context(self, context):
  10. self.init_with_context_called = True
  11. self.available_children.append(modules.LinkList)
  12. self.available_children.append(modules.Feed)
  13. # append a recent actions module
  14. self.children.append(modules.RecentActions(
  15. 'Recent Actions',
  16. 10,
  17. column=0,
  18. order=1
  19. ))
  20. # append a feed module
  21. self.children.append(modules.Feed(
  22. 'Latest Django News',
  23. feed_url='http://www.djangoproject.com/rss/weblog/',
  24. limit=5,
  25. column=1,
  26. order=1
  27. ))
  28. class TestAppIndexDashboard(Dashboard):
  29. columns = 3
  30. init_with_context_called = False
  31. class Media:
  32. js = ('file.js', 'file2.js')
  33. css = ('file.css', 'file2.css')
  34. def init_with_context(self, context):
  35. self.init_with_context_called = True
  36. self.available_children.append(modules.LinkList)
  37. self.available_children.append(modules.Feed)
  38. # append a recent actions module
  39. self.children.append(modules.RecentActions(
  40. 'Recent Actions',
  41. 10,
  42. column=0,
  43. order=1
  44. ))
  45. # append a feed module
  46. self.children.append(modules.Feed(
  47. 'Latest Django News',
  48. feed_url='http://www.djangoproject.com/rss/weblog/',
  49. limit=5,
  50. column=1,
  51. order=1
  52. ))