Browse files

Fixing URLs and other small things

  • Loading branch information...
1 parent 54c1ee4 commit bcf378c7e3a08eb8f99adbf7db70d9604cfdebed Buzzi committed Nov 13, 2011
Showing with 23 additions and 40 deletions.
  1. +4 −27 app/templates/comment.html
  2. +3 −3 app/templates/home.html
  3. +4 −4 app/templates/js_templates.html
  4. +2 −1 app/urls.py
  5. +6 −1 public/javascripts/app/routes/app.js
  6. +4 −4 urls.py
View
31 app/templates/comment.html
@@ -18,31 +18,22 @@
<script src="{{ STATIC_URL }}javascripts/lib/utils.js"></script>
<link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}stylesheets/screen.css">
- <link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}javascripts/lib/facebox/facebox.css">
-
- <script type="text/javascript" charset="utf-8">
- $.facebox.settings.closeImage = "{{ STATIC_URL }}javascripts/lib/facebox/closelabel.png";
- $.facebox.settings.loadingImage = "{{ STATIC_URL }}javascripts/lib/facebox/loading.gif";
-
- $(document).ready(function($) {
- $('a[rel*=facebox]').facebox();
- });
- </script>
</head>
+ <body>
<div id="wrapper">
<div id="nav_top">
<div id="nav_top_center">
<div id="logo">
- <a href="{% url home %}">
+ <a href="{% url app:home %}">
<img src="{{ STATIC_URL }}images/logo.png">
</a>
</div>
<div id="slogan">
your foul mouth at work |
{% if user.is_authenticated %}
- <a href="{% url logout %}">logout</a>
+ <a href="{% url app:logout %}">logout</a>
{% else %}
- <a href="#login" rel="facebox">login</a>
+ <a href="{% url app:login %}" rel="facebox">login</a>
{% endif %}
</div>
</div>
@@ -61,19 +52,5 @@
</div>
</div>
- <div id="register" style="display: none;">
- </div>
-
- <div id="login" style="display: none;">
- <form action="{% url home %}" method="post" accept-charset="utf-8">
- <table border="0">
- {{ login_form.as_table }}
- </table>
- <p><input type="submit" value="Login" /></p>
- </form>
- </div>
-
- <div id="register" style="display: none;">
- </div>
</body>
</html>
View
6 app/templates/home.html
@@ -40,16 +40,16 @@
<div id="nav_top">
<div id="nav_top_center">
<div id="logo">
- <a href="javascript: Application.navigate('', true);">
+ <a href="{% url app:home %}">
<img src="{{ STATIC_URL }}images/logo.png">
</a>
</div>
<div id="slogan">
your foul mouth at work |
{% if user.is_authenticated %}
- <a href="{% url logout %}">logout</a>
+ <a href="{% url app:logout %}">logout</a>
{% else %}
- <a href="#login"class="login">login</a>
+ <a href="{% url app:login %}"class="login">login</a>
{% endif %}
</div>
</div>
View
8 app/templates/js_templates.html
@@ -1,7 +1,7 @@
<script type="text/template" id="comment">
<div class="thumbs_bar">
- <a href="{% url comment-builder %}/<%= id %>/" class="thumbup">&nbsp;</a>
- <a href="{% url comment-builder %}/<%= id %>/" class="thumbdown">&nbsp;</a>
+ <a href="{% url app:comment-builder %}/<%= id %>/" class="thumbup">&nbsp;</a>
+ <a href="{% url app:comment-builder %}/<%= id %>/" class="thumbdown">&nbsp;</a>
</div>
<div class="comment_right">
@@ -19,7 +19,7 @@
</div>
<div class="comment_meta">
- <a href="{% url comment-builder %}/<%= id %>/" class="comment-link">by <span class="dark"><%= user_name %></span> <%= timeAgo %></a>
+ <a href="{% url app:comment-builder %}/<%= id %>/" class="comment-link">by <span class="dark"><%= user_name %></span> <%= timeAgo %></a>
</div>
</div>
</script>
@@ -42,5 +42,5 @@
<script type="text/template" id="login">
<label>Username <input type="text" name="username"></label>
<label>Password <input type="password" name="password"></label>
- <a href="{% url login %}" class="login">Login</a><a href="{% url home %}" class="cancel">Cancel</a>
+ <a href="{% url app:login %}" class="login">Login</a><a href="{% url app:home %}" class="cancel">Cancel</a>
</script>
View
3 app/urls.py
@@ -7,5 +7,6 @@
urlpatterns += patterns('',
url(r'^comments/?$', 'django.views.generic.simple.redirect_to', {'url': '/'}, name="comment-builder"),
- url(r'^logout/?$', 'django.contrib.auth.views.logout', { 'next_page': '/' }, name='logout'),
+ url(r'^login/?$', 'django.views.generic.simple.redirect_to', {'url': '/'}, name='login'),
+ url(r'^logout/?$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),
)
View
7 public/javascripts/app/routes/app.js
@@ -40,7 +40,12 @@ $(function() {
$(document).ready(function(){
$("a.login").click(function(){
$("#overlay").append((new LoginView()).render().el)
-
+
+ return false;
+ });
+ $("#logo > a").click(function(){
+ Application.navigate('', true);
+
return false;
});
});
View
8 urls.py
@@ -3,9 +3,9 @@
from app import models
-admin.site.register(models.Comment)
-admin.site.register(models.Rating)
-admin.site.register(models.Organization)
+# admin.site.register(models.Comment)
+# admin.site.register(models.Rating)
+# admin.site.register(models.Organization)
admin.autodiscover()
@@ -17,5 +17,5 @@
url(r'^admin/?', include(admin.site.urls)),
# App stuff.
- url(r'', include('app.urls')),
+ url(r'', include('app.urls', namespace='app', app_name='app')),
)

0 comments on commit bcf378c

Please sign in to comment.