Skip to content

Commit

Permalink
Issue mozilla#108: Initial skeleton of local teams sub-app
Browse files Browse the repository at this point in the history
  • Loading branch information
lmorchard committed Feb 27, 2015
1 parent eefdcc0 commit 22c8bc2
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 4 deletions.
5 changes: 1 addition & 4 deletions badgus/base/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@
<ul class="nav">
<li><a href="{{ url('badger.views.badges_list') }}">{{ _('Badges') }}</a></li>
<li><a href="{{ url('badger.views.awards_list') }}">{{ _('Awards') }}</a></li>
{% set allow_staff = (user.is_staff or user.is_superuser) %}
{% if allow_staff %}
<li><a href="{{ url('badger.views.staff_tools') }}">{{ _('Staff Tools') }}</a></li>
{% endif %}
<li><a href="{{ url('badgus.teams.views.home') }}">{{ _('Teams') }}</a></li>
</ul>
<form class="navbar-search pull-left search_badges" method="GET"
action="{{ url('badger.views.badges_list') }}">
Expand Down
1 change: 1 addition & 0 deletions badgus/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ def get_middleware(exclude=(), append=(),
'valet_keys',

'badgus.profiles',
'badgus.teams',

'badger',

Expand Down
Empty file added badgus/teams/__init__.py
Empty file.
Empty file added badgus/teams/models.py
Empty file.
9 changes: 9 additions & 0 deletions badgus/teams/templates/teams/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% extends "base.html" %}

{% block pageid %}teams_home{% endblock %}

{% block content %}

<p>Hi.</p>

{% endblock %}
7 changes: 7 additions & 0 deletions badgus/teams/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.conf.urls import *

from django.conf import settings

urlpatterns = patterns('badgus.teams.views',
url(r'^$', 'home', name='teams.home'),
)
24 changes: 24 additions & 0 deletions badgus/teams/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from django.conf import settings
from django.db import models

from django.contrib.auth.models import User, AnonymousUser
from django.contrib.auth.forms import UserChangeForm

from django.http import (HttpResponseRedirect, HttpResponse,
HttpResponseForbidden, HttpResponseNotFound)
from django.views.decorators.http import (require_GET, require_POST,
require_http_methods)
from django.contrib.auth import REDIRECT_FIELD_NAME, login as auth_login, logout as auth_logout
from django.contrib.auth.decorators import login_required

from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext

from django.core.urlresolvers import reverse
from tower import ugettext_lazy as _


def home(request):
"""Profile home page"""
return render_to_response('teams/index.html', dict(
), context_instance=RequestContext(request))
2 changes: 2 additions & 0 deletions badgus/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.conf.urls import *

from .profiles import urls as profiles_urls
from .teams import urls as teams_urls

from .base import monkeypatches
monkeypatches.patch()
Expand All @@ -25,6 +26,7 @@
(r'^badges/', include('badgus.badger_api.urls')),
(r'^badges/', include('badger.urls')),
(r'^profiles/', include(profiles_urls)),
(r'^teams/', include(teams_urls)),
(r'^accounts/', include('django.contrib.auth.urls')),
(r'^keys/', include('valet_keys.urls')),
(r'^admin/', include(admin.site.urls)),
Expand Down

0 comments on commit 22c8bc2

Please sign in to comment.