From 7b67c56ced3d009d7309ea19cea1df793881f160 Mon Sep 17 00:00:00 2001 From: Javyer DerDerian Date: Mon, 15 Dec 2014 13:51:42 -0500 Subject: [PATCH 1/1] Updated stats module --- README | 1 + forum_modules/{updates => stats}/__init__.py | 0 forum_modules/{updates => stats}/base.py | 0 forum_modules/{updates => stats}/settings.py | 6 +++--- forum_modules/{updates => stats}/startup.py | 0 forum_modules/{updates => stats}/templates/index.html | 2 +- forum_modules/stats/urls.py | 8 ++++++++ forum_modules/{updates => stats}/views.py | 8 ++++---- forum_modules/updates/urls.py | 8 -------- settings_local.py.dist | 2 +- 10 files changed, 18 insertions(+), 17 deletions(-) rename forum_modules/{updates => stats}/__init__.py (100%) rename forum_modules/{updates => stats}/base.py (100%) rename forum_modules/{updates => stats}/settings.py (67%) rename forum_modules/{updates => stats}/startup.py (100%) rename forum_modules/{updates => stats}/templates/index.html (90%) create mode 100644 forum_modules/stats/urls.py rename forum_modules/{updates => stats}/views.py (69%) delete mode 100644 forum_modules/updates/urls.py diff --git a/README b/README index 554535d..fabc08a 100644 --- a/README +++ b/README @@ -5,3 +5,4 @@ Homepage - http://www.osqa.net Bug tracking - http://jira.osqa.net Wiki - http://wiki.osqa.net +* The ‘stats’ module sends install info to our OSQA directory, including number of users, number of questions, and the email addresses of the super users. These email addresses are not sold to any third party. \ No newline at end of file diff --git a/forum_modules/updates/__init__.py b/forum_modules/stats/__init__.py similarity index 100% rename from forum_modules/updates/__init__.py rename to forum_modules/stats/__init__.py diff --git a/forum_modules/updates/base.py b/forum_modules/stats/base.py similarity index 100% rename from forum_modules/updates/base.py rename to forum_modules/stats/base.py diff --git a/forum_modules/updates/settings.py b/forum_modules/stats/settings.py similarity index 67% rename from forum_modules/updates/settings.py rename to forum_modules/stats/settings.py index 6f68310..e4ff401 100644 --- a/forum_modules/updates/settings.py +++ b/forum_modules/stats/settings.py @@ -5,12 +5,12 @@ from django.utils.translation import ugettext_lazy as _ from base import generate_installation_key -UPDATER_SET = SettingSet('updater', _('Updater Settings'), _("OSQA Update Checker Settings."), 100) +STATS_SET = SettingSet('stats', _('Stats Settings'), _("OSQA Stats Settings."), 100) -CHECK_FOR_UPDATES = Setting('CHECK_FOR_UPDATES', True, UPDATER_SET, dict( +CHECK_FOR_UPDATES = Setting('CHECK_FOR_UPDATES', True, STATS_SET, dict( label = "Check for updates", help_text = _(""" -Use the OSQA update server recieve notifications about the latest updates. +Use the OSQA stats server recieve notifications about the latest updates. """), required=False)) diff --git a/forum_modules/updates/startup.py b/forum_modules/stats/startup.py similarity index 100% rename from forum_modules/updates/startup.py rename to forum_modules/stats/startup.py diff --git a/forum_modules/updates/templates/index.html b/forum_modules/stats/templates/index.html similarity index 90% rename from forum_modules/updates/templates/index.html rename to forum_modules/stats/templates/index.html index d07d9e3..04c2f67 100644 --- a/forum_modules/updates/templates/index.html +++ b/forum_modules/stats/templates/index.html @@ -43,7 +43,7 @@ $(function() { {% block admincontent %} -{% trans "Check for Updates" %} +{% trans "Check for Updates" %}
{% endblock %} diff --git a/forum_modules/stats/urls.py b/forum_modules/stats/urls.py new file mode 100644 index 0000000..f4669a8 --- /dev/null +++ b/forum_modules/stats/urls.py @@ -0,0 +1,8 @@ +from django.conf.urls import patterns, url, include +from django.utils.translation import ugettext as _ + +from views import stats_index, stats_check + +urlpatterns = patterns('', + url(r'^%s%s%s$' % (_('admin/'), _('stats/'), _('check/')), stats_check, name='stats_check'), +) diff --git a/forum_modules/updates/views.py b/forum_modules/stats/views.py similarity index 69% rename from forum_modules/updates/views.py rename to forum_modules/stats/views.py index 27008f2..12a58ab 100644 --- a/forum_modules/updates/views.py +++ b/forum_modules/stats/views.py @@ -5,16 +5,16 @@ from base import check_for_updates from forum.views.admin import admin_tools_page, admin_page -@admin_tools_page(_('updater'), _('Update Checker')) -def updater_index(request): +@admin_tools_page(_('stats'), _('Stats Module')) +def stats_index(request): return ( - 'modules/updates/index.html', + 'modules/stats/index.html', { }, ) -def updater_check(request): +def stats_check(request): update_status = check_for_updates() return HttpResponse(update_status, mimetype='text/html') diff --git a/forum_modules/updates/urls.py b/forum_modules/updates/urls.py deleted file mode 100644 index 58ad7ac..0000000 --- a/forum_modules/updates/urls.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.conf.urls import patterns, url, include -from django.utils.translation import ugettext as _ - -from views import updater_index, updater_check - -urlpatterns = patterns('', - url(r'^%s%s%s$' % (_('admin/'), _('updater/'), _('check/')), updater_check, name='updater_check'), -) diff --git a/settings_local.py.dist b/settings_local.py.dist index e687228..b85d89b 100644 --- a/settings_local.py.dist +++ b/settings_local.py.dist @@ -79,4 +79,4 @@ LANGUAGE_CODE = 'en' OSQA_DEFAULT_SKIN = 'default' -DISABLED_MODULES = ['books', 'recaptcha', 'project_badges'] +DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'stats'] -- 2.39.5