Commits

Richard Gerkin  committed 3e21587 Merge

Merged

  • Participants
  • Parent commits b5bfab2, 501dd9d

Comments (0)

Files changed (4)

File templates/scidash/base.html

 			  	<div class='span3 offset3'>
 			  	  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 			  	  {% if not request.user.is_anonymous %}
-					<a class='btn btn-primary btn-large' href="{% url 'fantasci.views.logout' %}?next={{ request.path }}">Logout</a>
+					<a class='btn btn-primary btn-large' href="{% url 'scidash.views.logout' %}?next={{ request.path }}">Logout</a>
 			  	  {% else %}
-					<a class='btn btn-large btn-primary' href="{% url 'fantasci.views.login' %}?next={{ request.path }}">Login</a>
+					<a class='btn btn-large btn-primary' href="{% url 'scidash.views.login' %}?next={{ request.path }}">Login</a>
 				  {% endif %}	  
 				</div>	
 			  	<div class='span3 offset1'>

File templates/scidash/community.html

 	  <br><br>
 	</span>
 </div>
-{% endblock %}
+{% endblock %}
 
 urlpatterns = patterns('www.scidash.views',
     url(r'^$', 'index'),
+    url(r'^login$', 'login'),
+    url(r'^logout$', 'logout'),
     url(r'^my/$', 'my'),
     url(r'^profile/(?P<user_id>\d+)$', 'profile'),
     url(r'^community/$', 'community'),
     url(r'^repo/(?P<github_id>\d+)/follow/$', 'repo_follow'),
     url(r'^repo/(?P<github_id>\d+)/unfollow/$', 'repo_unfollow'),
     url(r'^contact/$', 'contact'),
+    url(r'^accounts/', include('social_auth.urls')),
+    #url(r'^scidash/', include('scidash.urls')),
 )
 
 urlpatterns += patterns('django.views.generic.simple',
-    url(r'^twitter.html$',TemplateView.as_view(template_name='sciunit/twitter.html')),#,name='twitter-feed')),
+    url(r'^twitter.html$',TemplateView.as_view(template_name='scidash/twitter.html')),#,name='twitter-feed')),
 )
 
-urlpatterns += patterns('django.contrib.auth.views',
-	(r'^login/$', 'login', {'template_name': 'scidash/login.html',}),
-	(r'^logout/$', 'logout_then_login', {'login_url':'login',}),
-)
+#urlpatterns += patterns('django.contrib.auth.views',
+#	(r'^login/$', 'login', {'template_name': 'scidash/login.html',}),
+#	(r'^logout/$', 'logout_then_login', {'login_url':'login',}),
+#)
 
 # For when there is no sciunit prefix in the url.  
 #urlpatterns += patterns('',
 from django.shortcuts import render_to_response
 from django.contrib.auth.forms import UserCreationForm
 from django.contrib import auth
+from django.contrib.auth.views import logout as django_logout
 
 TEMPLATE_DIR = 'scidash'
 
 def contact(request):
     return render_it(request,TEMPLATE_DIR+'/contact.html',locals())
 
+def login(request):
+    next = request.GET['next'] if 'next' in request.GET.keys() else None
+    return render_it(request,TEMPLATE_DIR+'/login.html', locals())
+
+def logout(request):
+    django_logout(request)
+    return HttpResponseRedirect('/scidash/')
+
 def docs(request):
     try:
         search = request.GET['search']