Commit 51765a9b authored by Jean Michel Rouly's avatar Jean Michel Rouly
Browse files

Merge branch 'master' of git.gmu.edu:srct/bookshare

Merging branch master.
parents ddd005e5 6eabb0e6
......@@ -33,5 +33,7 @@ To-do
* Set up Haystack with ElasticSearch
* Save searches, and display saved search results on user's home page
* Set up Bidding and Commenting systems
* Display comments on user's listings, or the comments on listings for which the user has bid.
* Make links more prevalent on the site.
* Seller's rating
......@@ -19,14 +19,16 @@ urlpatterns = patterns('website.views',
# url(r'^bookshare/', include('bookshare.foo.urls')),
#### USER PAGES ####
# home page
url(r'^$', 'index', name = 'homepage'),
# user profile page
url(r'^u/(?P<username>\w+)/?$', 'profile', name = 'profile'),
# book listing page
url(r'^u/(?P<username>\w+)/listings/(?P<book_id>\w+)$', 'listing', name = 'listing'),
# manage books you're looking for
url(r'^u/(?P<username>\w+)/lookout/$', 'lookout', name = 'lookout'),
#### STATIC PAGES ####
# home page
url(r'^$', 'index', name = 'homepage'),
# about page
url(r'^about/?$', 'about', name = 'about'),
# contact staff
......
......@@ -14,7 +14,7 @@ GMU Bookshare &bull; Homepage
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-6">
<a href="{% url 'create_listing' %}" class="btn btn-primary btn-lg btn-block">I have a book</a>
</div>
......@@ -23,4 +23,22 @@ GMU Bookshare &bull; Homepage
</div>
</div>
<!-- if the user is not signed in, or doesn't have anything on the lookout for
then it just shows the most recent new postings -->
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
You haven't picked anything you're looking for! <a href="{% url 'lookout' %}">Manage those textbooks here.</a>
</div>
{% if listings %}
<div class="row">
{% for listing in listings %}
<div class="col-lg-6">
</div>
{% endfor %}
</div>
{% endif %}
{% endblock %}
{% extends 'layouts/base.html' %}
{% block title %}
GMU Bookshare &bull; Lookouts
{% endblock %}
{% block content %}
{% endblock %}
......@@ -74,32 +74,25 @@ def error_500(request):
# home page
# Maybe don't login_require this, and allow anonymous users to browse a
# list of currently potsed books? idk.
# list of currently posted books? idk.
@login_required
def index(request):
# # front page of the site shows the 12 most recent listings
# products = Book.objects.all().order_by("-uploaded")
# paginator = Paginator(products, 12)
#
# # can we get a first page please?
# try:
# page = int(request.GET.get("page", '1'))
# except ValueError: page = 1
#
# # how many pages do we have?
# try:
# products = paginator.page(page)
# except (InvalidPage, EmptyPage):
# blogs = paginator.page(paginator.num_pages)
# need to figure out what needs to be displayed/accessed
# ability to create and display saved searches
# pull all comments from listings user has posted on and their listings
# make pagination work
# NEED TO HAVE THE SEARCH WORK--- YAY HAYSTACK
listings = []
return render(request, 'index.html', {
'listings' : listing,
},
)
def lookout(request, username):
return render(request, 'lookout.html', {
},
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment