mirror of
https://github.com/bodyrep/bodyrep-sandpit.git
synced 2026-02-07 04:31:40 +00:00
Django import
Django import
This commit is contained in:
5
django/.gitignore
vendored
Normal file
5
django/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
*.pyc
|
||||
*.pyo
|
||||
utils
|
||||
img
|
||||
media
|
||||
0
django/__init__.py
Normal file
0
django/__init__.py
Normal file
0
django/app/__init__.py
Normal file
0
django/app/__init__.py
Normal file
91
django/app/forms.py
Normal file
91
django/app/forms.py
Normal file
@@ -0,0 +1,91 @@
|
||||
import datetime
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth import authenticate
|
||||
from django.db.models import Q
|
||||
from app.models import Members
|
||||
|
||||
class LoginForm(forms.Form):
|
||||
username = forms.CharField(label=_("Username"), max_length=30,
|
||||
widget=forms.TextInput(attrs={'tabindex': 1, 'class': 'NB-input'}),
|
||||
error_messages={'required': 'Please enter a username.'})
|
||||
password = forms.CharField(label=_("Password"),
|
||||
widget=forms.PasswordInput(attrs={'tabindex': 2, 'class': 'NB-input'}),
|
||||
required=False)
|
||||
# error_messages={'required': 'Please enter a password.'})
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.user_cache = None
|
||||
super(LoginForm, self).__init__(*args, **kwargs)
|
||||
|
||||
def clean(self):
|
||||
username = self.cleaned_data.get('username', '').lower()
|
||||
password = self.cleaned_data.get('password', '')
|
||||
|
||||
user = User.objects.filter(Q(username__iexact=username) | Q(email=username))
|
||||
if username and user:
|
||||
self.user_cache = authenticate(username=user[0].username, password=password)
|
||||
if self.user_cache is None:
|
||||
self.user_cache = authenticate(username=user[0].username, password="")
|
||||
if self.user_cache is None:
|
||||
email_username = User.objects.filter(email=username)
|
||||
if email_username:
|
||||
self.user_cache = authenticate(username=email_username[0].username, password=password)
|
||||
if self.user_cache is None:
|
||||
self.user_cache = authenticate(username=email_username[0].username, password="")
|
||||
if self.user_cache is None:
|
||||
# logging.info(" ***> [%s] Bad Login: TRYING JK-LESS PASSWORD" % username)
|
||||
jkless_password = password.replace('j', '').replace('k', '')
|
||||
self.user_cache = authenticate(username=username, password=jkless_password)
|
||||
if self.user_cache is None:
|
||||
#logging.info(" ***> [%s] Bad Login" % username)
|
||||
raise forms.ValidationError(_("Whoopsy-daisy. Try again."))
|
||||
else:
|
||||
# Supreme fuck-up. Accidentally removed the letters J and K from
|
||||
# all user passwords. Re-save with correct password.
|
||||
#logging.info(" ***> [%s] FIXING JK-LESS PASSWORD" % username)
|
||||
self.user_cache.set_password(password)
|
||||
self.user_cache.save()
|
||||
if not self.user_cache.is_active:
|
||||
raise forms.ValidationError(_("This account is inactive."))
|
||||
elif username and not user:
|
||||
raise forms.ValidationError(_("That username is not registered. Create an account with it instead."))
|
||||
|
||||
return self.cleaned_data
|
||||
|
||||
def get_user_id(self):
|
||||
if self.user_cache:
|
||||
return self.user_cache.id
|
||||
return None
|
||||
|
||||
def get_user(self):
|
||||
return self.user_cache
|
||||
|
||||
class EditProfileForm(forms.Form):
|
||||
firstname = forms.CharField(label=_("First Name"), max_length=30,
|
||||
widget=forms.TextInput(attrs={'tabindex': 1, 'class': 'NB-input'}),
|
||||
error_messages={'required': 'Please enter a first name'})
|
||||
lastname = forms.CharField(label=_("LastName"),
|
||||
widget=forms.TextInput(attrs={'tabindex': 2, 'class': 'NB-input'}),
|
||||
error_messages={'required': 'Please enter a last name.'})
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(EditProfileForm, self).__init__(*args, **kwargs)
|
||||
|
||||
def clean(self):
|
||||
firstname = self.cleaned_data.get('firstname', '')
|
||||
lastname = self.cleaned_data.get('lastname', '')
|
||||
|
||||
return self.cleaned_data
|
||||
|
||||
def save(self, username):
|
||||
firstname = self.cleaned_data['firstname']
|
||||
lastname = self.cleaned_data['lastname']
|
||||
|
||||
member = Members.objects.get(username=username)
|
||||
member.firstname = firstname
|
||||
member.lastname = lastname
|
||||
member.save()
|
||||
|
||||
return member
|
||||
8
django/app/models.py
Normal file
8
django/app/models.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.models import User, UserManager
|
||||
|
||||
class Members(models.Model):
|
||||
username = models.CharField(max_length = 30)
|
||||
firstname = models.CharField(max_length=30)
|
||||
lastname = models.CharField(max_length=30)
|
||||
113
django/app/views.py
Normal file
113
django/app/views.py
Normal file
@@ -0,0 +1,113 @@
|
||||
import datetime
|
||||
import time
|
||||
import sys
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.shortcuts import render, render_to_response
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.template.loader import render_to_string
|
||||
from django.db import IntegrityError
|
||||
from django.views.decorators.cache import never_cache
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.contrib.auth import login as login_user
|
||||
from django.contrib.auth import logout as logout_user
|
||||
from django.contrib.auth.models import User
|
||||
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, Http404
|
||||
from django.conf import settings
|
||||
from django.core.mail import mail_admins
|
||||
from django.core.validators import email_re
|
||||
from django.core.mail import EmailMultiAlternatives
|
||||
from django.contrib.sites.models import Site
|
||||
from neh.app.forms import LoginForm, EditProfileForm
|
||||
from django.core.context_processors import csrf
|
||||
from django.template import RequestContext
|
||||
from annoying.decorators import render_to, ajax_request
|
||||
|
||||
from app.models import Members
|
||||
|
||||
from utils.user_functions import get_user, ajax_login_required
|
||||
from utils.view_functions import get_argument_or_404, render_to, is_true
|
||||
#from utils.ratelimit import ratelimit
|
||||
|
||||
@render_to('app/landing.html')
|
||||
def index(request):
|
||||
return {}
|
||||
|
||||
@render_to('app/member.html')
|
||||
def mprofile(request):
|
||||
if request.user.is_anonymous():
|
||||
return login(request)
|
||||
else:
|
||||
member = Members.objects.get(username=request.user.username)
|
||||
return {'member': member}
|
||||
|
||||
@render_to('app/profile.html')
|
||||
def vprofile(request, username):
|
||||
member = Members.objects.get(username=username)
|
||||
|
||||
if request.user.is_anonymous():
|
||||
return login(request)
|
||||
else:
|
||||
return { 'user': request.user, 'member': member }
|
||||
|
||||
@never_cache
|
||||
@render_to('auth/login.html')
|
||||
def login(request):
|
||||
if not request.user.is_anonymous():
|
||||
return HttpResponseRedirect(reverse('mprofile'))
|
||||
|
||||
if request.method == "POST":
|
||||
if request.POST.get('submit', '').startswith('log'):
|
||||
login_form = LoginForm(request.POST, prefix='login')
|
||||
else:
|
||||
login_form = LoginForm(prefix='login')
|
||||
else:
|
||||
login_form = LoginForm(prefix='login')
|
||||
|
||||
|
||||
return {'login_form':login_form}
|
||||
|
||||
|
||||
@never_cache
|
||||
def dologin(request):
|
||||
code = -1
|
||||
message = ""
|
||||
if request.method == "POST":
|
||||
form = LoginForm(request.POST, prefix='login')
|
||||
if form.is_valid():
|
||||
login_user(request, form.get_user())
|
||||
return HttpResponseRedirect(reverse('mprofile'))
|
||||
else:
|
||||
message = form.errors.items()[0][1][0]
|
||||
|
||||
@never_cache
|
||||
def logout(request):
|
||||
logout_user(request)
|
||||
|
||||
if request.GET.get('api'):
|
||||
return HttpResponse(json.encode(dict(code=1)), mimetype='application/json')
|
||||
else:
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
|
||||
@ajax_request
|
||||
@render_to('app/editProfile.html')
|
||||
def edit(request):
|
||||
if request.user.is_anonymous():
|
||||
return login(request)
|
||||
else:
|
||||
|
||||
member = Members.objects.get(username=request.user.username)
|
||||
|
||||
mdata = {'firstname': member.firstname, 'lastname': member.lastname }
|
||||
|
||||
edit_form = EditProfileForm(initial=mdata, prefix='edit')
|
||||
return { 'edit_form': edit_form }
|
||||
|
||||
@ajax_request
|
||||
def save(request):
|
||||
edit_form = EditProfileForm(data=request.POST,prefix = 'edit')
|
||||
if edit_form.is_valid():
|
||||
edit_form.save(request.user.username)
|
||||
return { 'result': 1 }
|
||||
else:
|
||||
return { 'result': 0 }
|
||||
14
django/manage.py
Normal file
14
django/manage.py
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python
|
||||
from django.core.management import execute_manager
|
||||
import imp
|
||||
try:
|
||||
imp.find_module('settings') # Assumed to be in the same directory.
|
||||
except ImportError:
|
||||
import sys
|
||||
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
|
||||
sys.exit(1)
|
||||
|
||||
import settings
|
||||
|
||||
if __name__ == "__main__":
|
||||
execute_manager(settings)
|
||||
153
django/settings.py
Normal file
153
django/settings.py
Normal file
@@ -0,0 +1,153 @@
|
||||
import os
|
||||
import logging
|
||||
|
||||
DEBUG = True
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
DIRNAME = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
ADMINS = (
|
||||
# ('Your Name', 'your_email@example.com'),
|
||||
)
|
||||
|
||||
MANAGERS = ADMINS
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
|
||||
'NAME': 'test', # Or path to database file if using sqlite3.
|
||||
'USER': 'site', # Not used with sqlite3.
|
||||
'PASSWORD': 'suppity', # Not used with sqlite3.
|
||||
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
|
||||
'PORT': '', # Set to empty string for default. Not used with sqlite3.
|
||||
}
|
||||
}
|
||||
|
||||
# Local time zone for this installation. Choices can be found here:
|
||||
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
||||
# although not all choices may be available on all operating systems.
|
||||
# On Unix systems, a value of None will cause Django to use the same
|
||||
# timezone as the operating system.
|
||||
# If running in a Windows environment this must be set to the same as your
|
||||
# system time zone.
|
||||
TIME_ZONE = 'UTC'
|
||||
|
||||
# Language code for this installation. All choices can be found here:
|
||||
# http://www.i18nguy.com/unicode/language-identifiers.html
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
|
||||
SITE_ID = 1
|
||||
|
||||
# If you set this to False, Django will make some optimizations so as not
|
||||
# to load the internationalization machinery.
|
||||
USE_I18N = True
|
||||
|
||||
# If you set this to False, Django will not format dates, numbers and
|
||||
# calendars according to the current locale
|
||||
USE_L10N = True
|
||||
|
||||
# Absolute filesystem path to the directory that will hold user-uploaded files.
|
||||
# Example: "/home/media/media.lawrence.com/media/"
|
||||
MEDIA_ROOT = ''
|
||||
|
||||
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
||||
# trailing slash.
|
||||
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
|
||||
MEDIA_URL = ''
|
||||
|
||||
# Absolute path to the directory static files should be collected to.
|
||||
# Don't put anything in this directory yourself; store your static files
|
||||
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
|
||||
# Example: "/home/media/media.lawrence.com/static/"
|
||||
STATIC_ROOT = DIRNAME
|
||||
|
||||
# URL prefix for static files.
|
||||
# Example: "http://media.lawrence.com/static/"
|
||||
STATIC_URL = '/static/'
|
||||
PASSWORD_HASHERS = (
|
||||
'django.contrib.auth.hashers.BCryptPasswordHasher',
|
||||
)
|
||||
# URL prefix for admin static files -- CSS, JavaScript and images.
|
||||
# Make sure to use a trailing slash.
|
||||
# Examples: "http://foo.com/static/admin/", "/static/admin/".
|
||||
ADMIN_MEDIA_PREFIX = '/static/admin/'
|
||||
|
||||
# Additional locations of static files
|
||||
STATICFILES_DIRS = (
|
||||
# Put strings here, like "/home/html/static" or "C:/www/django/static".
|
||||
# Always use forward slashes, even on Windows.
|
||||
# Don't forget to use absolute paths, not relative paths.
|
||||
)
|
||||
|
||||
# List of finder classes that know how to find static files in
|
||||
# various locations.
|
||||
STATICFILES_FINDERS = (
|
||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
||||
)
|
||||
|
||||
# Make this unique, and don't share it with anybody.
|
||||
SECRET_KEY = '!@)1ngg_(jtlt!7yj4jkxtg@pf^1=w1!9qz*g$1!o-%(^gdv!u'
|
||||
|
||||
# List of callables that know how to import templates from various sources.
|
||||
TEMPLATE_LOADERS = (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
# 'django.template.loaders.eggs.Loader',
|
||||
)
|
||||
|
||||
#TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
# 'django.core.context_processors.auth',
|
||||
#)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
)
|
||||
|
||||
ROOT_URLCONF = 'neh.urls'
|
||||
|
||||
TEMPLATE_DIRS = (
|
||||
DIRNAME + '/templates'
|
||||
)
|
||||
|
||||
INSTALLED_APPS = (
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.sites',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django_extensions',
|
||||
'annoying',
|
||||
'utils',
|
||||
'app',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.admindocs',
|
||||
)
|
||||
|
||||
# A sample logging configuration. The only tangible logging
|
||||
# performed by this configuration is to send an email to
|
||||
# the site admins on every HTTP 500 error.
|
||||
# See http://docs.djangoproject.com/en/dev/topics/logging for
|
||||
# more details on how to customize your logging configuration.
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'handlers': {
|
||||
'mail_admins': {
|
||||
'level': 'ERROR',
|
||||
'class': 'django.utils.log.AdminEmailHandler'
|
||||
}
|
||||
},
|
||||
'loggers': {
|
||||
'django.request': {
|
||||
'handlers': ['mail_admins'],
|
||||
'level': 'ERROR',
|
||||
'propagate': True,
|
||||
},
|
||||
}
|
||||
}
|
||||
35
django/templates/app/editProfile.html
Normal file
35
django/templates/app/editProfile.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% block content %}
|
||||
|
||||
<h1>Update Profile</h1>
|
||||
|
||||
|
||||
<form action="{% url msave %}" method="post" id="profile">
|
||||
<div>
|
||||
{% if edit_form.errors %}
|
||||
{% for field, error in edit_form.errors.items %}
|
||||
{{ error|safe }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
{{ edit_form.firstname.label_tag }}
|
||||
{{ edit_form.firstname }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ edit_form.lastname.label_tag }}
|
||||
{{ edit_form.lastname }}
|
||||
</div>
|
||||
<div> </div>
|
||||
<div>
|
||||
<label for="newpass1">New Password:</label><br />
|
||||
<input type="password" id="newpass1" name="_newpass1" /> <br />
|
||||
<input type="password" id="newpass2" name="_newpass2" />
|
||||
</div>
|
||||
<div> </div>
|
||||
|
||||
<input type="submit" class="btn btn-primary btn-small" value="Save" />
|
||||
{% csrf_token %}
|
||||
|
||||
</form>
|
||||
{% endblock %}
|
||||
8
django/templates/app/landing.html
Normal file
8
django/templates/app/landing.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}BodyRep - Welcome{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include "navbar.html" %}
|
||||
Landing Page
|
||||
{% endblock %}
|
||||
312
django/templates/app/member.html
Normal file
312
django/templates/app/member.html
Normal file
@@ -0,0 +1,312 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}BodyRep{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'navbar.html' %}
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span2">
|
||||
<div class="well sidebar-nav">
|
||||
<ul class="nav nav-list">
|
||||
<li class="nav-header">Profile</li>
|
||||
<li class="active"><a href="#">Body Stats</a></li>
|
||||
<li><a href="#">Body Reputation</a></li>
|
||||
<li><a href="#">Challenges</a></li>
|
||||
<li class="nav-header">Workouts</li>
|
||||
<li class="nav-header">Meals</li>
|
||||
<li class="nav-header">Community</li>
|
||||
<li class="nav-header">Learning</li>
|
||||
<li class="nav-header">Apps</li>
|
||||
<li class="nav-header">Shopping</li>
|
||||
</ul>
|
||||
</div><!--/.well -->
|
||||
</div><!--/span-->
|
||||
<div class="span6" id='mcnt'>
|
||||
<div class="row-fluid">
|
||||
<h2 class="pull-left">{{ member.firstname }} {{ member.lastname }}</h2>
|
||||
<a class="pull-right btn btn-primary btn-mini" id='edprf' href="#"><i class="icon-cog icon-white"></i> Edit Profile</a>
|
||||
|
||||
</div>
|
||||
<div class="row-fluid" style='font-size : 12px;'>
|
||||
<i class="icon-signal"></i><span> Weight: 100kg ( <div class='arrowup'></div> 0)</span>
|
||||
<span>Bodyfat: 20% ( <div class='arrowup'></div> 2)</span>
|
||||
<span>Measurements: 400cm ( <div class='arrowup'></div> 15)</span>
|
||||
</div>
|
||||
<div class="row-fluid" style='font-size : 12px;'>
|
||||
<i class="icon-home"></i><span> Lives in </span><a>Calgary, Alberta</a>
|
||||
<i class="icon-signal"></i><span> Trains at </span><a>Talisman Center,Fitness First</a>
|
||||
<i class="icon-signal"></i><span> Hobbies: </span><a>Skiing,</a><span> and </span><a>(5) other</a><span> ...</span>
|
||||
<i class="icon-signal"></i><span> Professionals: </span><a>Heath Spence</a><span>,</span><a>Steve Baudo</a><a> see more...</a>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row-fluid">
|
||||
<h5 class="pull-left">Filters:</h5>
|
||||
<div class="pull-left">
|
||||
<div class="block_type_small redbg redbd pull-left">
|
||||
<i class="icon-user icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small bluebg bluebd pull-left">
|
||||
<i class="icon-wrench icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small orangebg orangebd pull-left">
|
||||
<i class="icon-magnet icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small tealbg tealbd pull-left">
|
||||
<i class="icon-heart icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small purplebg purplebd pull-left">
|
||||
<i class="icon-th icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small greenbg greenbd pull-left">
|
||||
<i class="icon-book icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small graybg graybd pull-left">
|
||||
<i class="icon-file icon-white"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type redbd">
|
||||
<i class="gicon-magnet"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
<i class="icon-signal"></i>
|
||||
565
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
<b>Breakfast:</b><span> 30g Oats, 1x Banana, 5x Egg Whites</span>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>14 minutes ago</span>
|
||||
</div>
|
||||
<div class="user-sub-comment">
|
||||
<div class='sub-avatar user1'></div>
|
||||
<a>Brian Goff</a>
|
||||
<p>Good to see you're keeping up the good work mate. Keep us posted ;)</p>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 3 at 2:05pm</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-sub-comment">
|
||||
<div class='sub-avatar user2'></div>
|
||||
<a>Alex Zborowski</a>
|
||||
<p>Well it's not easy but you do your best every day and you judge every action.</p>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 3 at 2:05pm</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type greenbd">
|
||||
<i class="gicon-search"></i>
|
||||
</div>
|
||||
<div class="block_type orangebd">
|
||||
<i class="gicon-screen"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
<i class="icon-time"></i>
|
||||
45
|
||||
<i class="icon-signal"></i>
|
||||
900
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
Workout at <a>Talisman Center</a> with <a>Brian Goff</a>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>37 minutes ago</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type greenbd">
|
||||
<i class="gicon-search"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
<i class="icon-time"></i>
|
||||
90
|
||||
<i class="icon-signal"></i>
|
||||
720
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
Workout at <a>Talisman Center</a>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 4 at 7:00pm</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type bluebd">
|
||||
<i class="gicon-profile"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
You commented on <a>Brian Goff's workout</a>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 4 at 6:30pm</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type purplebd">
|
||||
<i class="gicon-profile"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
Your read <a>"Fatigue Recovery & Supercompensation Theory"</a>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 2 at 8:00am</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type greenbd">
|
||||
<i class="gicon-search"></i>
|
||||
</div>
|
||||
<div class="block_type orangebd">
|
||||
<i class="gicon-screen"></i>
|
||||
</div>
|
||||
<div class="block_type tealbd">
|
||||
<i class="gicon-line"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
<i class="icon-time"></i>
|
||||
30
|
||||
<i class="icon-signal"></i>
|
||||
450
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
<a>Workout</a> using <a>Runtracker</a> with <a>Brian Goff</a>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 2 at 6:00am</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type orangebd">
|
||||
<i class="gicon-screen"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user-comment">
|
||||
<div class='avatar user1'></div>
|
||||
<a>Brian Goff</a>
|
||||
<p>Hey "mate"! Want to train at the <a>Talisman</a> again tonight?</p>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 3 at 2:00pm</span>
|
||||
</div>
|
||||
|
||||
<div class="user-sub-comment">
|
||||
<div class='sub-avatar user2'></div>
|
||||
<a>Alex Zborowski</a>
|
||||
<p>Sorry Brian, working on the BodyREP pitch tonight.</p>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 3 at 2:05pm</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-sub-comment">
|
||||
<div class='sub-avatar user1'></div>
|
||||
<a>Brian Goff</a>
|
||||
<p>No worries "mate", maybe next time.</p>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 3 at 2:07pm</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="span4">
|
||||
<div class="hero-unit">
|
||||
<h1>Hello, world!</h1>
|
||||
<p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
|
||||
<p><a class="btn btn-primary btn-large">Learn more »</a></p>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
<div class="row-fluid">
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
{% endblock %}
|
||||
311
django/templates/app/profile.html
Normal file
311
django/templates/app/profile.html
Normal file
@@ -0,0 +1,311 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}BodyRep{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'navbar.html' %}
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span2">
|
||||
<div class="well sidebar-nav">
|
||||
<ul class="nav nav-list">
|
||||
<li class="nav-header">Profile</li>
|
||||
<li class="active"><a href="#">Body Stats</a></li>
|
||||
<li><a href="#">Body Reputation</a></li>
|
||||
<li><a href="#">Challenges</a></li>
|
||||
<li class="nav-header">Workouts</li>
|
||||
<li class="nav-header">Meals</li>
|
||||
<li class="nav-header">Community</li>
|
||||
<li class="nav-header">Learning</li>
|
||||
<li class="nav-header">Apps</li>
|
||||
<li class="nav-header">Shopping</li>
|
||||
</ul>
|
||||
</div><!--/.well -->
|
||||
</div><!--/span-->
|
||||
<div class="span6" id='mcnt'>
|
||||
<div class="row-fluid">
|
||||
<h2 class="pull-left">{{ member.firstname }} {{ member.lastname }}</h2>
|
||||
<a class="pull-right btn btn-primary btn-mini" id='edprf' href="#"><i class="icon-cog icon-white"></i> Edit Profile</a>
|
||||
</div>
|
||||
<div class="row-fluid" style='font-size : 12px;'>
|
||||
<i class="icon-signal"></i><span> Weight: 100kg ( <div class='arrowup'></div> 0)</span>
|
||||
<span>Bodyfat: 20% ( <div class='arrowup'></div> 2)</span>
|
||||
<span>Measurements: 400cm ( <div class='arrowup'></div> 15)</span>
|
||||
</div>
|
||||
<div class="row-fluid" style='font-size : 12px;'>
|
||||
<i class="icon-home"></i><span> Lives in </span><a>Calgary, Alberta</a>
|
||||
<i class="icon-signal"></i><span> Trains at </span><a>Talisman Center,Fitness First</a>
|
||||
<i class="icon-signal"></i><span> Hobbies: </span><a>Skiing,</a><span> and </span><a>(5) other</a><span> ...</span>
|
||||
<i class="icon-signal"></i><span> Professionals: </span><a>Heath Spence</a><span>,</span><a>Steve Baudo</a><a> see more...</a>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row-fluid">
|
||||
<h5 class="pull-left">Filters:</h5>
|
||||
<div class="pull-left">
|
||||
<div class="block_type_small redbg redbd pull-left">
|
||||
<i class="icon-user icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small bluebg bluebd pull-left">
|
||||
<i class="icon-wrench icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small orangebg orangebd pull-left">
|
||||
<i class="icon-magnet icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small tealbg tealbd pull-left">
|
||||
<i class="icon-heart icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small purplebg purplebd pull-left">
|
||||
<i class="icon-th icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small greenbg greenbd pull-left">
|
||||
<i class="icon-book icon-white"></i>
|
||||
</div>
|
||||
<div class="block_type_small graybg graybd pull-left">
|
||||
<i class="icon-file icon-white"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type redbd">
|
||||
<i class="gicon-magnet"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
<i class="icon-signal"></i>
|
||||
565
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
<b>Breakfast:</b><span> 30g Oats, 1x Banana, 5x Egg Whites</span>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>14 minutes ago</span>
|
||||
</div>
|
||||
<div class="user-sub-comment">
|
||||
<div class='sub-avatar user1'></div>
|
||||
<a>Brian Goff</a>
|
||||
<p>Good to see you're keeping up the good work mate. Keep us posted ;)</p>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 3 at 2:05pm</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-sub-comment">
|
||||
<div class='sub-avatar user2'></div>
|
||||
<a>Alex Zborowski</a>
|
||||
<p>Well it's not easy but you do your best every day and you judge every action.</p>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 3 at 2:05pm</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type greenbd">
|
||||
<i class="gicon-search"></i>
|
||||
</div>
|
||||
<div class="block_type orangebd">
|
||||
<i class="gicon-screen"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
<i class="icon-time"></i>
|
||||
45
|
||||
<i class="icon-signal"></i>
|
||||
900
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
Workout at <a>Talisman Center</a> with <a>Brian Goff</a>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>37 minutes ago</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type greenbd">
|
||||
<i class="gicon-search"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
<i class="icon-time"></i>
|
||||
90
|
||||
<i class="icon-signal"></i>
|
||||
720
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
Workout at <a>Talisman Center</a>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 4 at 7:00pm</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type bluebd">
|
||||
<i class="gicon-profile"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
You commented on <a>Brian Goff's workout</a>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 4 at 6:30pm</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type purplebd">
|
||||
<i class="gicon-profile"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
Your read <a>"Fatigue Recovery & Supercompensation Theory"</a>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 2 at 8:00am</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type greenbd">
|
||||
<i class="gicon-search"></i>
|
||||
</div>
|
||||
<div class="block_type orangebd">
|
||||
<i class="gicon-screen"></i>
|
||||
</div>
|
||||
<div class="block_type tealbd">
|
||||
<i class="gicon-line"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tnc-blurb">
|
||||
<i class="icon-time"></i>
|
||||
30
|
||||
<i class="icon-signal"></i>
|
||||
450
|
||||
</div>
|
||||
<div class="basic-comment">
|
||||
<a>Workout</a> using <a>Runtracker</a> with <a>Brian Goff</a>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 2 at 6:00am</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="stats">
|
||||
<div class="comment_block">
|
||||
<div class="block_types">
|
||||
<div class="block_type orangebd">
|
||||
<i class="gicon-screen"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user-comment">
|
||||
<div class='avatar user1'></div>
|
||||
<a>Brian Goff</a>
|
||||
<p>Hey "mate"! Want to train at the <a>Talisman</a> again tonight?</p>
|
||||
</div>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 3 at 2:00pm</span>
|
||||
</div>
|
||||
|
||||
<div class="user-sub-comment">
|
||||
<div class='sub-avatar user2'></div>
|
||||
<a>Alex Zborowski</a>
|
||||
<p>Sorry Brian, working on the BodyREP pitch tonight.</p>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 3 at 2:05pm</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-sub-comment">
|
||||
<div class='sub-avatar user1'></div>
|
||||
<a>Brian Goff</a>
|
||||
<p>No worries "mate", maybe next time.</p>
|
||||
<div class="like-comment-time">
|
||||
<i class="icon-thumbs-up"></i>
|
||||
<i class="icon-comment"></i>
|
||||
<span>April 3 at 2:07pm</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="span4">
|
||||
<div class="hero-unit">
|
||||
<h1>Hello, world!</h1>
|
||||
<p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
|
||||
<p><a class="btn btn-primary btn-large">Learn more »</a></p>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
<div class="row-fluid">
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
{% endblock %}
|
||||
30
django/templates/auth/login.html
Normal file
30
django/templates/auth/login.html
Normal file
@@ -0,0 +1,30 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'navbar.html' %}
|
||||
|
||||
<h1>Login</h1>
|
||||
|
||||
{% if login_form.errors %}
|
||||
{% for field, error in login_form.errors.items %}
|
||||
{{ error|safe }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<form name='login' action="{% url dologin %}" method="post" id="login">
|
||||
|
||||
<div>
|
||||
{{ login_form.username.label_tag }}
|
||||
{{ login_form.username }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ login_form.password.label_tag }}
|
||||
{{ login_form.password }}
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary btn-mini" id='loginbtn' value="LOGIN" />
|
||||
<input type="hidden" name="next" value="/m/profile" />
|
||||
{% csrf_token %}
|
||||
|
||||
</form>
|
||||
{% endblock %}
|
||||
60
django/templates/base.html
Normal file
60
django/templates/base.html
Normal file
@@ -0,0 +1,60 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>test</title>
|
||||
<link rel="stylesheet" href="https://br.netbit.com.au/css/bootstrap.css" media="all" />
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-top: 60px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
.sidebar-nav {
|
||||
padding: 9px 0;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="https://br.netbit.com.au/css/bootstrap-responsive.css" />
|
||||
<link rel="stylesheet" href="https://br.netbit.com.au/css/site.css" />
|
||||
<link rel="stylesheet" href="https://br.netbit.com.au/css/chosen.css" />
|
||||
<script type="text/javascript" src="https://br.netbit.com.au/js/LAB.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var loadb;
|
||||
$LAB.script('https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js')
|
||||
.script('//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js')
|
||||
.script("https://br.netbit.com.au/js/application.js")
|
||||
.script("https://br.netbit.com.au/js/jquery.chosen.min.js")
|
||||
.script("https://br.netbit.com.au/js/bootstrap.js").wait(function() {
|
||||
|
||||
|
||||
clearTimeout(loadb);
|
||||
$('#loadmast').hide();
|
||||
$('#mast').removeClass('hidden');
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id='mast' class='hidden'>
|
||||
<div class="container-fluid symfony-content">
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
<hr>
|
||||
|
||||
<footer>
|
||||
<p>© BodyRep 2012</p>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id='loadmast'><img align="absmiddle" style="margin-left: 10px; margin-bottom: 3px;" src="https://br.netbit.com.au/img/progress.gif"> Loading</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
44
django/templates/navbar.html
Normal file
44
django/templates/navbar.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container-fluid">
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<img src="https://br.netbit.com.au/img/logo-nav.png" class='pull-left' style='padding-right : 5px; margin-top : 10px;' />
|
||||
<a class="brand" href="#">BODY<b>REP</b></a>
|
||||
{% if not user.is_authenticated %}
|
||||
<div class="btn-group pull-right">
|
||||
<a class="btn " href="{% url login %}" style="background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
|
||||
<i class="icon-user icon-white"></i> Login
|
||||
</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="btn-group pull-right">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#" style="background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
|
||||
<i class="icon-user icon-white"></i> {{ user.first_name }} {{ user.last_name }}
|
||||
<span class="caret" style='border-top-color : white; border-bottom-color : white;'></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{% url mprofile %}">Profile</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="{% url logout %}">Sign Out</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='offset2'>
|
||||
<form class="navbar-search pull-left" id='topsearch' action="">
|
||||
<input type="text" class="search-query span4" id="topsearch" style='height : 28px;' placeholder="Search"><span id='msg_topsearch'></span>
|
||||
</form>
|
||||
</div>
|
||||
<a class="btn dropdown-toggle pull-right" data-toggle="dropdown" href="#" style="margin : 0; background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
|
||||
<i class='licon-calendar licon-white'></i>
|
||||
</a>
|
||||
<a class="btn dropdown-toggle pull-right" data-toggle="dropdown" href="#" style="margin : 0; background : transparent; color : white; text-shadow : none; border : none; box-shadow : 0 0 0 #fff;">
|
||||
<i class='licon-mail-new licon-white'></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
20
django/urls.py
Normal file
20
django/urls.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.conf.urls.defaults import patterns, include, url
|
||||
from app import views
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
|
||||
admin.autodiscover()
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^$', views.index, name='index'),
|
||||
url(r'^m/profile/?$', views.mprofile, name='mprofile'),
|
||||
url(r'^m/profile/save/?$', views.save, name='msave'),
|
||||
url(r'^m/profile/edit/?$', views.edit, name='medit'),
|
||||
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
||||
url(r'^mgmt/', include(admin.site.urls)),
|
||||
url(r'^logout$', views.logout, name='logout'),
|
||||
url(r'^login$', views.login, name='login'),
|
||||
url(r'^dologin$', views.dologin, name='dologin'),
|
||||
url(r'^([a-zA-Z0-9]+)', views.vprofile),
|
||||
|
||||
)
|
||||
Reference in New Issue
Block a user