From 69192cb169b1e277b4907f3709cb1cb48c0962f6 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 3 Jul 2011 06:19:54 +0530 Subject: [PATCH] show all results by default on archive page; order categories by name; add upload link; make account link work; --- edgware/files/models.py | 1 + edgware/static/js/files/browse.js | 2 ++ edgware/templates/main_base.html | 3 +++ edgware/templates/registration/login.html | 4 ++++ edgware/urls.py | 2 ++ 5 files changed, 12 insertions(+) diff --git a/edgware/files/models.py b/edgware/files/models.py index de7e98d..790b296 100755 --- a/edgware/files/models.py +++ b/edgware/files/models.py @@ -221,6 +221,7 @@ class Category(models.Model): return self.name class Meta: + ordering = ['name'] verbose_name = 'Study' verbose_name_plural = 'Studies' diff --git a/edgware/static/js/files/browse.js b/edgware/static/js/files/browse.js index 3219cd3..fea239a 100644 --- a/edgware/static/js/files/browse.js +++ b/edgware/static/js/files/browse.js @@ -27,6 +27,8 @@ $(function() { }, "json"); }); + $('#filterForm').submit(); + $('#prevBtn').click(function() { var $page_no = $('#page_no'); var currPage = parseInt($page_no.val()); diff --git a/edgware/templates/main_base.html b/edgware/templates/main_base.html index 2fa9427..3384f68 100644 --- a/edgware/templates/main_base.html +++ b/edgware/templates/main_base.html @@ -38,6 +38,9 @@
  • Archive
  • +
  • + Upload +
  • Publish
  • diff --git a/edgware/templates/registration/login.html b/edgware/templates/registration/login.html index bee0232..120c2f5 100644 --- a/edgware/templates/registration/login.html +++ b/edgware/templates/registration/login.html @@ -1,4 +1,8 @@ +{% extends 'main_base.html' %} + +{% block content %}
    {{ form.as_ul }}
    +{% endblock %} diff --git a/edgware/urls.py b/edgware/urls.py index 97188c5..3de3756 100644 --- a/edgware/urls.py +++ b/edgware/urls.py @@ -2,6 +2,7 @@ from django.conf.urls.defaults import * import settings +from django.contrib.auth.views import login # uncomment the next two lines to enable the admin: from django.contrib import admin @@ -21,6 +22,7 @@ urlpatterns = patterns('', (r'^sandbox/upload$', 'files.views.upload_files'), (r'^sandbox/faq$', 'main.views.faq'), (r'^sandbox/help$', 'main.views.help'), + (r'^sandbox/account$', login), (r'^$', 'django.views.generic.simple.redirect_to', {'url': '/slider/'}), (r'^robots.txt(?P)$', 'django.views.static.serve', { 'document_root' : "/home/itf/soc/edgware/static/txt/robots.txt" } ), # Uncomment the admin/doc line below and add 'django.contrib.admindocs'