Commits

hardwood  committed 501dd9d

Fixes for live site

  • Participants
  • Parent commits 84f12f6

Comments (0)

Files changed (4)

File templates/scidash/base.html

 	  		</div>
 	  	  	<div class="row"> <!-- Footer -->	
 	  	  		<br>	 
-			  	<div class='span2 offset4'>
+			  	<div class='span12' style='text-align:center'>
 			  	  {% 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='span2 offset1'>
+			  	<!--<div class='span2 offset1'>
 			  		<a class='btn btn-primary btn-large' href="/scidash/contact">
 						Contact
 					</a>
-				</div>
+				</div>-->
 				<!--<div class='span2 offset1'>
 					<a class='btn btn-primary btn-large' href="/scidash/bugs">
 						Report a bug

File templates/scidash/community.html

 	  {% for fork in forks %}
 		<tr>
 			<td>
-				<a href='/scidash/repo/{{fork.id}}'>{{ fork.name }}</a>
+				<a href='{% url 'scidash.views.repo_summary' fork.id %}'>{{ fork.name }}</a>
 			</td>
 			<td>
 				<a href='{{ fork.owner.html_url}}'>{{ fork.owner.login }}</a>
 	  {% include "scidash/twitter.html" %}
 	</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'^tests/create/$', 'test_create'),
     url(r'^models/add/$', 'model_add'),
     url(r'^repo/(?P<github_id>\d+)/$', 'repo_summary'),
+    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 index(request):
     return render_it(request,TEMPLATE_DIR+'/index.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']