1
0
mirror of https://github.com/bspeice/Melodia synced 2024-12-26 00:28:13 -05:00

Fix web asset loading

Now using jquery 1.8.1, jquery-ui 1.9.2
This commit is contained in:
Bradlee Speice 2013-01-24 14:11:11 -05:00
parent c1bd19041a
commit e3e6a6e475
5 changed files with 23 additions and 15 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -63,8 +63,8 @@ List of block elements in this page:
{# General scripts #} {# General scripts #}
{% block scripts %} {% block scripts %}
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery-ui.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap.min.js"></script> <script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery-1.9.0.min.js"></script>
<!--<script type="text/javascript" src="{{ STATIC_URL }}js/jquery-ui-1.10.0.custom.min.js"></script>-->
{% endblock %} {% endblock %}
</html> </html>

View File

@ -6,5 +6,6 @@ web_urls = patterns('web.views',
# url(r'^Melodia/', include('Melodia.foo.urls')), # url(r'^Melodia/', include('Melodia.foo.urls')),
url(r'^$|main/', 'main'), url(r'^$|main/', 'main'),
url(r'^login/', 'login'), url(r'^login/', 'login_page'),
url(r'^authenticate/', 'authenticate'),
) )

View File

@ -1,11 +1,28 @@
from django.http import HttpResponse from django.http import HttpResponse
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login
from django.template import RequestContext from django.template import RequestContext
from django.shortcuts import render_to_response from django.shortcuts import render_to_response, redirect
@login_required @login_required
def main(request): def main(request):
return render_to_response("main", context_instance = RequestContext(request)) return render_to_response("main", context_instance = RequestContext(request))
def login(request): def login_page(request):
return render_to_response("login", context_instance = RequestContext(request)) return render_to_response("login", context_instance = RequestContext(request))
def authenticate(request):
username = request.POST["username"]
password = request.POST["password"]
user = authenticate(username, password)
if user is not None:
if user.isactive:
login(request, user)
redirect("/")
else:
#User is inactive
pass
else:
#Authentication failed
pass