From d5f2e4a1507ddba8c326c1bf0b4f3a2d8e26b187 Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Tue, 20 Jul 2010 20:19:38 -0600 Subject: [PATCH] Rebased intranet project onto basic project --- .../apps/profiles/__init__.py | 0 .../intranet_project/apps/profiles/admin.py | 6 +++ .../intranet_project/apps/profiles/models.py | 11 +++++ pinax/projects/intranet_project/media/README | 13 +++++ .../intranet_project/requirements/base.txt | 29 +++++------ pinax/projects/intranet_project/settings.py | 48 +++++++++---------- .../{openid_login.html => _openid_login.html} | 0 ...erpass_login.html => _userpass_login.html} | 0 .../templates/account/base.html | 26 ---------- .../templates/account/login.html | 4 +- .../intranet_project/templates/homepage.html | 5 +- .../intranet_project/templates/site_base.html | 23 ++++----- pinax/projects/intranet_project/urls.py | 33 ++++++------- 13 files changed, 97 insertions(+), 101 deletions(-) create mode 100644 pinax/projects/intranet_project/apps/profiles/__init__.py create mode 100644 pinax/projects/intranet_project/apps/profiles/admin.py create mode 100644 pinax/projects/intranet_project/apps/profiles/models.py create mode 100644 pinax/projects/intranet_project/media/README rename pinax/projects/intranet_project/templates/account/{openid_login.html => _openid_login.html} (100%) rename pinax/projects/intranet_project/templates/account/{userpass_login.html => _userpass_login.html} (100%) delete mode 100644 pinax/projects/intranet_project/templates/account/base.html diff --git a/pinax/projects/intranet_project/apps/profiles/__init__.py b/pinax/projects/intranet_project/apps/profiles/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pinax/projects/intranet_project/apps/profiles/admin.py b/pinax/projects/intranet_project/apps/profiles/admin.py new file mode 100644 index 000000000..c07f3c09a --- /dev/null +++ b/pinax/projects/intranet_project/apps/profiles/admin.py @@ -0,0 +1,6 @@ +from django.contrib import admin + +from profiles.models import Profile + + +admin.site.register(Profile) \ No newline at end of file diff --git a/pinax/projects/intranet_project/apps/profiles/models.py b/pinax/projects/intranet_project/apps/profiles/models.py new file mode 100644 index 000000000..66ba3b034 --- /dev/null +++ b/pinax/projects/intranet_project/apps/profiles/models.py @@ -0,0 +1,11 @@ +from django.db import models +from django.utils.translation import ugettext_lazy as _ + +from idios.models import ProfileBase + + +class Profile(ProfileBase): + name = models.CharField(_("name"), max_length=50, null=True, blank=True) + about = models.TextField(_("about"), null=True, blank=True) + location = models.CharField(_("location"), max_length=40, null=True, blank=True) + website = models.URLField(_("website"), null=True, blank=True, verify_exists=False) diff --git a/pinax/projects/intranet_project/media/README b/pinax/projects/intranet_project/media/README new file mode 100644 index 000000000..cd444f3c0 --- /dev/null +++ b/pinax/projects/intranet_project/media/README @@ -0,0 +1,13 @@ +This directory is used to store static assets for your project. User media files +(FileFields/ImageFields) are not stored here. + +The convention for this directory is: + + * css/ — stores CSS files + * js/ — stores Javascript files + * img/ — stores image files + +This directory is accessed at /site_media/static/ in runserver when SERVE_MEDIA +is True. It is built with build_static for production environments. + +See http://pinaxproject.com/docs/dev/media.html for more information. \ No newline at end of file diff --git a/pinax/projects/intranet_project/requirements/base.txt b/pinax/projects/intranet_project/requirements/base.txt index 5385b8257..ccbc32580 100644 --- a/pinax/projects/intranet_project/requirements/base.txt +++ b/pinax/projects/intranet_project/requirements/base.txt @@ -8,9 +8,22 @@ Django==1.2.1 Pinax -python-dateutil==1.4.1 -python-openid==2.2.5 +django-debug-toolbar==0.8.3 +django-staticfiles==0.2.0 + +django-mailer==0.1.0 +django-email-confirmation==0.2.dev2 +django-timezones==0.2.dev1 +django-ajax-validation==0.1.3 pytz==2010h +django-openid==0.2.3.dev1 +django-uni-form==0.7.0 + +django-announcements==0.1.2 +django-pagination==1.0.7 +django-notification==0.1.4 +idios==0.1.dev6 + docutils==0.6 smartypants==1.6.0.3 Markdown==2.0.3 @@ -18,26 +31,14 @@ textile==2.1.4 diff-match-patch==20090804 django-atomformat==0.1.1.dev1 creole==1.1 - -django-notification==0.1.4 -django-openid==0.2.3.dev1 -django-email-confirmation==0.1.4 -django-mailer==0.1.0 -django-announcements==0.1.2 -django-pagination==1.0.7 -django-timezones==0.2.dev1 django-tagging==0.3.1 django-threadedcomments==0.5.2 -django-ajax-validation==0.1.3 django-avatar==1.0.4 -django-uni-form==0.7.0 django-wikiapp==0.2.0 django-attachments==0.3.1 django-markup==0.3 django-bookmarks==0.1.0 django-filter==0.5.3 -django-staticfiles==0.2.0 django-groups==0.1.dev10 django-tagging-ext==0.2.0 -django-debug-toolbar==0.8.3 django-voting==0.1 \ No newline at end of file diff --git a/pinax/projects/intranet_project/settings.py b/pinax/projects/intranet_project/settings.py index 088f107bc..85f3f4a86 100644 --- a/pinax/projects/intranet_project/settings.py +++ b/pinax/projects/intranet_project/settings.py @@ -39,16 +39,15 @@ } # Local time zone for this installation. Choices can be found here: -# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE -# although not all variations may be possible on all operating systems. +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = "US/Eastern" # Language code for this installation. All choices can be found here: -# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes -# http://blogs.law.harvard.edu/tech/stories/storyReader$15 -LANGUAGE_CODE = "en" +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = "en-us" SITE_ID = 1 @@ -60,8 +59,9 @@ # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = os.path.join(PROJECT_ROOT, "site_media", "media") -# URL that handles the media served from MEDIA_ROOT. -# Example: "http://media.lawrence.com" +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = "/site_media/media/" # Absolute path to the directory that holds static files like app media. @@ -102,7 +102,6 @@ "groups.middleware.GroupAwareMiddleware", "pinax.apps.account.middleware.LocaleMiddleware", "pinax.apps.account.middleware.AuthenticatedMiddleware", - "django.middleware.doc.XViewMiddleware", "pagination.middleware.PaginationMiddleware", "pinax.middleware.security.HideSensistiveFieldsMiddleware", "debug_toolbar.middleware.DebugToolbarMiddleware", @@ -127,9 +126,10 @@ "pinax.core.context_processors.pinax_settings", + "pinax.apps.account.context_processors.account", + "notification.context_processors.notification", "announcements.context_processors.site_wide_announcements", - "pinax.apps.account.context_processors.account", ] INSTALLED_APPS = [ @@ -147,30 +147,30 @@ # external "notification", # must be first + "staticfiles", + "debug_toolbar", + "mailer", + "uni_form", "django_openid", + "ajax_validation", + "timezones", "emailconfirmation", - "mailer", "announcements", "pagination", + "idios", "groups", - "timezones", - "ajax_validation", "bookmarks", "avatar", "tagging", "threadedcomments", "wiki", - "uni_form", "django_markup", "attachments", "django_filters", - "staticfiles", - "debug_toolbar", "tagging_ext", "voting", # Pinax - "pinax.apps.basic_profiles", "pinax.apps.account", "pinax.apps.signup_codes", "pinax.apps.topics", @@ -179,6 +179,7 @@ "pinax.apps.tasks", # project + "profiles", ] FIXTURE_DIRS = [ @@ -200,16 +201,9 @@ ] WIKI_MARKUP_CHOICES = MARKUP_CHOICES -AUTH_PROFILE_MODULE = "basic_profiles.Profile" +AUTH_PROFILE_MODULE = "profiles.Profile" NOTIFICATION_LANGUAGE_MODULE = "account.Account" -EMAIL_CONFIRMATION_DAYS = 2 -EMAIL_DEBUG = DEBUG -CONTACT_EMAIL = "feedback@example.com" -SITE_NAME = "Pinax" -LOGIN_URL = "/account/login/" -LOGIN_REDIRECT_URLNAME = "home" - ACCOUNT_OPEN_SIGNUP = False ACCOUNT_REQUIRED_EMAIL = False ACCOUNT_EMAIL_VERIFICATION = False @@ -225,6 +219,12 @@ "django.contrib.auth.backends.ModelBackend", ] +LOGIN_URL = "/account/login/" # @@@ any way this can be a url name? +LOGIN_REDIRECT_URLNAME = "home" + +EMAIL_CONFIRMATION_DAYS = 2 +EMAIL_DEBUG = DEBUG + AUTHENTICATED_EXEMPT_URLS = [ r"^/account/signup/$", r"^/account/password_reset", diff --git a/pinax/projects/intranet_project/templates/account/openid_login.html b/pinax/projects/intranet_project/templates/account/_openid_login.html similarity index 100% rename from pinax/projects/intranet_project/templates/account/openid_login.html rename to pinax/projects/intranet_project/templates/account/_openid_login.html diff --git a/pinax/projects/intranet_project/templates/account/userpass_login.html b/pinax/projects/intranet_project/templates/account/_userpass_login.html similarity index 100% rename from pinax/projects/intranet_project/templates/account/userpass_login.html rename to pinax/projects/intranet_project/templates/account/_userpass_login.html diff --git a/pinax/projects/intranet_project/templates/account/base.html b/pinax/projects/intranet_project/templates/account/base.html deleted file mode 100644 index bf2454bde..000000000 --- a/pinax/projects/intranet_project/templates/account/base.html +++ /dev/null @@ -1,26 +0,0 @@ -{% extends "site_base.html" %} - -{% load i18n %} - -{% block rtab_id %}id="account_tab"{% endblock %} - -{% block subnav %} - {% if user.is_authenticated %} - - {% else %} -   {# need this to give subnav some height when empty #} - {% endif %} -{% endblock %} diff --git a/pinax/projects/intranet_project/templates/account/login.html b/pinax/projects/intranet_project/templates/account/login.html index d11aa03eb..7d9c0a3a7 100644 --- a/pinax/projects/intranet_project/templates/account/login.html +++ b/pinax/projects/intranet_project/templates/account/login.html @@ -94,9 +94,9 @@ - {% include "account/userpass_login.html" %} + {% include "account/_userpass_login.html" %} - {% include "account/openid_login.html" %} + {% include "account/_openid_login.html" %} diff --git a/pinax/projects/intranet_project/templates/homepage.html b/pinax/projects/intranet_project/templates/homepage.html index 2f849dbe3..0b346304c 100644 --- a/pinax/projects/intranet_project/templates/homepage.html +++ b/pinax/projects/intranet_project/templates/homepage.html @@ -2,9 +2,12 @@ {% load i18n %} -{% block head_title %}Homepage{% endblock %} +{% block head_title %}{% trans "Welcome" %}{% endblock %} + +{% block body_class %}home{% endblock %} {% block body %} +

{% trans "Welcome to Pinax" %}

diff --git a/pinax/projects/intranet_project/templates/site_base.html b/pinax/projects/intranet_project/templates/site_base.html index 6594d2c3c..28cd3128f 100644 --- a/pinax/projects/intranet_project/templates/site_base.html +++ b/pinax/projects/intranet_project/templates/site_base.html @@ -1,8 +1,6 @@ {% extends "base.html" %} {% load i18n %} -{% load account_tags %} -{% load openid_tags %} {% block extra_head_base %} @@ -15,16 +13,12 @@ {% block extra_head %}{% endblock %} {% endblock %} +{% block logo_link_image %}Pinax{% endblock %} + {% block login %} - {% if user.is_authenticated %} - {% ifopenid %}Logged in with OpenID{% endifopenid %}{% user_display user %} | {% trans "Account" %} | {% if user.is_staff %}{% trans "Admin" %} | {% endif %}{% trans "Logout" %} - {% else %} - {% trans "Login" %} - {% endif %} + {% include "_account_bar.html" %} {% endblock %} -{% block logo_link_image %}Pinax{% endblock %} - {% block right_tabs %} {% if user.is_authenticated %}