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:
parent
c1bd19041a
commit
e3e6a6e475
4
web/static/js/jquery-1.9.0.min.js
vendored
4
web/static/js/jquery-1.9.0.min.js
vendored
File diff suppressed because one or more lines are too long
6
web/static/js/jquery-ui-1.10.0.custom.min.js
vendored
6
web/static/js/jquery-ui-1.10.0.custom.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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>
|
||||||
|
@ -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'),
|
||||||
)
|
)
|
||||||
|
21
web/views.py
21
web/views.py
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user