diff --git a/bookshare/mod/__init__.py b/bookshare/mod/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/bookshare/mod/admin.py b/bookshare/mod/admin.py
new file mode 100644
index 0000000000000000000000000000000000000000..8c38f3f3dad51e4585f3984282c2a4bec5349c1e
--- /dev/null
+++ b/bookshare/mod/admin.py
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/bookshare/mod/models.py b/bookshare/mod/models.py
new file mode 100644
index 0000000000000000000000000000000000000000..71a836239075aa6e6e4ecb700e9c42c95c022d91
--- /dev/null
+++ b/bookshare/mod/models.py
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
diff --git a/bookshare/templates/mod.html b/bookshare/mod/templates/email_ratio_mod.html
similarity index 100%
rename from bookshare/templates/mod.html
rename to bookshare/mod/templates/email_ratio_mod.html
diff --git a/bookshare/mod/templates/flag_mod.html b/bookshare/mod/templates/flag_mod.html
new file mode 100644
index 0000000000000000000000000000000000000000..91bb701a355b46d2f8bda7e1bb455fbc774a263a
--- /dev/null
+++ b/bookshare/mod/templates/flag_mod.html
@@ -0,0 +1,46 @@
+{% extends 'layouts/base.html' %}
+
+{% block title %}
+SRCT Bookshare • Mod
+{% endblock title %}
+
+{% block content %}
+
+
+
+
Listings by number of Flags
+
+
+
+
+
+{% endblock content %}
diff --git a/bookshare/mod/templates/listing_num_mod.html b/bookshare/mod/templates/listing_num_mod.html
new file mode 100644
index 0000000000000000000000000000000000000000..91bb701a355b46d2f8bda7e1bb455fbc774a263a
--- /dev/null
+++ b/bookshare/mod/templates/listing_num_mod.html
@@ -0,0 +1,46 @@
+{% extends 'layouts/base.html' %}
+
+{% block title %}
+SRCT Bookshare • Mod
+{% endblock title %}
+
+{% block content %}
+
+
+
+
Listings by number of Flags
+
+
+
+
+
+{% endblock content %}
diff --git a/bookshare/mod/templates/mod.html b/bookshare/mod/templates/mod.html
new file mode 100644
index 0000000000000000000000000000000000000000..91bb701a355b46d2f8bda7e1bb455fbc774a263a
--- /dev/null
+++ b/bookshare/mod/templates/mod.html
@@ -0,0 +1,46 @@
+{% extends 'layouts/base.html' %}
+
+{% block title %}
+SRCT Bookshare • Mod
+{% endblock title %}
+
+{% block content %}
+
+
+
+
Listings by number of Flags
+
+
+
+
+
+{% endblock content %}
diff --git a/bookshare/mod/tests.py b/bookshare/mod/tests.py
new file mode 100644
index 0000000000000000000000000000000000000000..7ce503c2dd97ba78597f6ff6e4393132753573f6
--- /dev/null
+++ b/bookshare/mod/tests.py
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/bookshare/mod/urls.py b/bookshare/mod/urls.py
new file mode 100644
index 0000000000000000000000000000000000000000..d2b2055e8f6ff81a529d6d05f9ea19d09d1c71b3
--- /dev/null
+++ b/bookshare/mod/urls.py
@@ -0,0 +1,17 @@
+# core django imports
+from django.conf.urls import patterns, url
+from django.views.decorators.cache import cache_page
+# imports from your apps
+from .views import ModLandingView, FlagModView, ListingNumModView,\
+ UserEmailRatioModView
+
+urlpatterns = patterns('',
+ url(r'^$', cache_page(60 * 15)(ModLandingView.as_view()), name='mod_page'),
+
+ url(r'^flags/$', FlagModView.as_view(), name='flag_mod'),
+
+ url(r'^listing-nums/$', ListingNumModView.as_view(), name='listing_nums'),
+
+ url(r'^email-ratio/$', UserEmailRatioModView.as_view(), name='email_ratio'),
+
+)
diff --git a/bookshare/mod/views.py b/bookshare/mod/views.py
new file mode 100644
index 0000000000000000000000000000000000000000..08be8e691728c5a81319bc1cbfaafc58acfb6143
--- /dev/null
+++ b/bookshare/mod/views.py
@@ -0,0 +1,30 @@
+# core django imports
+from django.views.generic import TemplateView, ListView
+from django.db.models import Sum
+# third party imports
+from braces.views import LoginRequiredMixin, SuperuserRequiredMixin
+# imports from your apps
+from trades.models import Listing
+
+
+class ModLandingView(LoginRequiredMixin, SuperuserRequiredMixin, TemplateView):
+ template_name = 'mod.html'
+
+class FlagModView(LoginRequiredMixin, SuperuserRequiredMixin, ListView):
+ queryset = Listing.objects.annotate(num_flags=Count('flag')).order_by('-num_flags')[:20]
+ context_object_name = 'listings'
+ template_name = 'flag_mod.html'
+ login_url = 'login'
+
+class ListingNumModView(LoginRequiredMixin, SuperuserRequiredMixin, ListView):
+ queryset = Listing.objects.all()[:20]
+ context_object_name = 'users'
+ template_name = 'listing_num_mod.html'
+ login_url = 'login'
+
+class UserEmailRatioModView(LoginRequiredMixin, SuperuserRequiredMixin, TemplateView):
+ template_name = 'email_ratio_mod.html'
+
+ def get_context_data(self, **kwargs):
+ context = super(UserEmailRatioView, self).get_context_data(**kwargs)
+ return context
diff --git a/bookshare/settings/settings.py b/bookshare/settings/settings.py
index 0f0fe3013544160dbebbdb1741f8b7dcda6c30fc..d58c87f60cf868be1d078c32de3b582060f1d4f9 100644
--- a/bookshare/settings/settings.py
+++ b/bookshare/settings/settings.py
@@ -37,6 +37,7 @@ INSTALLED_APPS = (
'trades',
'core',
'lookouts',
+ 'mod',
# packages
'randomslugfield',
'django_gravatar',
diff --git a/bookshare/settings/urls.py b/bookshare/settings/urls.py
index f6ed2e4264043665226a5ee2901620eba56488a0..1e03030adc16b2fd113d140535d2d8f43e2813f6 100644
--- a/bookshare/settings/urls.py
+++ b/bookshare/settings/urls.py
@@ -6,7 +6,7 @@ from django.conf import settings
from django.contrib import admin
from django.views.decorators.cache import cache_page
# imports from your apps
-from .views import HomepageView, ChartsView, ModView
+from .views import HomepageView, ChartsView
admin.autodiscover()
@@ -20,6 +20,7 @@ urlpatterns = patterns('',
url(r'^share/', include('trades.urls')),
url(r'^student/', include('core.urls')),
url(r'^lookouts/', include('lookouts.urls')),
+ url(r'^mod/', include('mod.urls')),
# search
url(r'^search/', include('haystack.urls'), name='search'),
@@ -30,8 +31,6 @@ urlpatterns = patterns('',
url(r'^$', HomepageView.as_view(), name='homepage'),
url(r'^charts/?$', cache_page(60 * 10)(ChartsView.as_view()), name='charts'),
- url(r'^mod/?$', ModView.as_view(), name='mod'),
-
# static pages
url(r'^about/?$',
cache_page(60 * 15)(TemplateView.as_view(template_name='about.html')),
diff --git a/bookshare/settings/views.py b/bookshare/settings/views.py
index ea996f93de0360fb615e0897ea06769da08af331..1c2a41a860a413af16203d4b98a856a507120aeb 100644
--- a/bookshare/settings/views.py
+++ b/bookshare/settings/views.py
@@ -1,10 +1,10 @@
# standard library imports
from collections import Counter
# core django imports
-from django.views.generic import TemplateView, ListView
+from django.views.generic import TemplateView
from django.db.models import Sum, Count
# third party imports
-from braces.views import LoginRequiredMixin, SuperuserRequiredMixin
+from braces.views import LoginRequiredMixin
# imports from your apps
from lookouts.models import Lookout
from trades.models import Listing, Bid
@@ -55,9 +55,3 @@ class ChartsView(LoginRequiredMixin, TemplateView):
context['total_students'] = Student.objects.count()
context['total_proceeds'] = total_proceeds
return context
-
-class ModView(LoginRequiredMixin, SuperuserRequiredMixin, ListView):
- queryset = Listing.objects.annotate(num_flags=Count('flag')).order_by('-num_flags')[:20]
- context_object_name = 'listings'
- template_name = 'mod.html'
- login_url = 'login'