Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jean Michel Rouly
bookshare
Commits
2f156ffa
Commit
2f156ffa
authored
Jan 24, 2015
by
Daniel W Bond
Browse files
revamped homepage
parent
7aa4cfb7
Changes
3
Hide whitespace changes
Inline
Side-by-side
bookshare/core/templates/homepage-profile.html
0 → 100644
View file @
2f156ffa
{% extends 'layouts/base.html' %}
{% block title %}
GMU Bookshare
•
Homepage
{% endblock %}
{% block content %}
<div
class=
"page-header"
id=
"banner"
>
<div
class=
"row"
>
<div
class=
"col-lg-12 text-center"
>
<h1><strong>
GMU
</strong>
​
BOOKSHARE
</h1>
<p
class=
"lead"
>
A place for GMU students to buy and sell textbooks.
</p>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<a
href=
"{% url 'create_listing' %}"
class=
"btn btn-primary btn-lg btn-block"
>
I have a book
</a>
</div>
<div
class=
"col-sm-6"
>
<a
href=
"{% url 'haystack_search' %}"
class=
"btn btn-primary btn-lg btn-block"
>
I need a book
</a>
</div>
</div>
<hr/>
{% if listings %}
<div
class=
"row"
>
{% comment %}
Essentially the logic here is to create 3 columns where
there are n rows in each.
The first conditional will add an initial column tag if the loop is
beginning a new column. The second conditional adds a closing column
tag when the loop ends a column.
{% endcomment %}
{% for listing in listings %}
{% if forloop.counter|add:-1|divisibleby:rows %}
<div
class=
"col-md-4"
>
{% endif %}
{% include 'listing_preview_panel.html' %}
{% if forloop.counter|add:rows|divisibleby:rows %}
</div>
{% endif %}
{% endfor %}
</div>
<div
class=
"row"
>
<div
class=
"col-lg-4 col-lg-offset-4"
>
<ul
class=
"pager"
>
{% if listings.has_previous %}
<li
class=
"previous"
>
<a
href=
"?page={{ listings.previous_page_number }}"
>
←
Newer
</a>
</li>
{% else %}
<li
class=
"previous disabled"
>
<a>
←
Newer
</a>
</li>
{% endif %}
{% if listings.has_next %}
<li
class=
"next"
>
<a
href=
"?page={{ listings.next_page_number }}"
>
Older
→
</a>
</li>
{% else %}
<li
class=
"next disabled"
>
<a>
Older
→
</a>
</li>
{% endif %}
</ul>
</div>
</div>
{% else %}
<div
class=
"row"
>
<div
class=
"col-lg-12 text-center"
>
<div
class=
"panel panel-warning"
>
<div
class=
"panel-body"
>
<h3>
No lookout results found.
</h3>
<p>
Lookouts are books you have an eye out for. You can
<a
data-toggle=
"modal"
data-target=
"#CreateLookout"
href=
"#"
>
set some
</a>
, and we'll automatically show them here when a
selling goes up.
</p>
</div>
</div>
</div>
</div>
{% endif %}
{% include 'create_lookout_modal.html' %}
{% endblock %}
bookshare/settings/urls.py
View file @
2f156ffa
...
...
@@ -3,7 +3,8 @@ from django.views.generic import TemplateView
from
django.contrib
import
admin
from
website.forms
import
StyledSearchForm
# FIX SEARCH #
from
trades.forms
import
StyledSearchForm
from
haystack.views
import
SearchView
# Uncomment the next two lines to enable the admin:
...
...
@@ -15,7 +16,7 @@ handle500 = TemplateView.as_view(template_name="500.html")
urlpatterns
=
patterns
(
''
,
#### USER PAGES ####
# home page
url
(
r
'^$'
,
'website.views.index'
,
name
=
'homepage'
),
url
(
r
'^$'
,
TemplateView
.
as_view
(
template_name
=
'index.html'
)
,
name
=
'homepage'
),
# user profile page
url
(
r
'^u/(?P<username>\w+)/?$'
,
'website.views.profile'
,
name
=
'profile'
),
# create lookout
...
...
bookshare/templates/index.html
View file @
2f156ffa
...
...
@@ -15,111 +15,25 @@ GMU Bookshare • Homepage
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<a
href=
"{% url 'create_listing' %}"
class=
"btn btn-primary btn-lg btn-block"
>
I have a book
</a>
</div>
<legend></legend>
<div
class=
"
col-sm-6
"
>
<
a
href=
"{% url 'haystack_search' %}"
class=
"btn btn-primary btn-lg btn-block
"
>
I need a book
<
/a
>
<div
class=
"
row
"
>
<
div
class=
"col-md-3 text-center
"
>
<h4><i
class=
"fa fa-key fa-lg"
></i></h4>
<
h4>
Log in with your Mason credentials
</h4
>
</div>
</div>
<hr/>
{% if listings %}
<div
class=
"row"
>
{% comment %}
Essentially the logic here is to create 3 columns where
there are n rows in each.
The first conditional will add an initial column tag if the loop is
beginning a new column. The second conditional adds a closing column
tag when the loop ends a column.
{% endcomment %}
{% for listing in listings %}
{% if forloop.counter|add:-1|divisibleby:rows %}
<div
class=
"col-md-4"
>
{% endif %}
{% include 'listing_preview_panel.html' %}
{% if forloop.counter|add:rows|divisibleby:rows %}
</div>
{% endif %}
{% endfor %}
<div
class=
"col-md-3 text-center"
>
<h4><i
class=
"fa fa-money fa-lg"
></i></h4>
<h4>
Sell used textbooks to Mason students
</h4>
</div>
<div
class=
"row"
>
<div
class=
"col-lg-4 col-lg-offset-4"
>
<ul
class=
"pager"
>
{% if listings.has_previous %}
<li
class=
"previous"
>
<a
href=
"?page={{ listings.previous_page_number }}"
>
←
Newer
</a>
</li>
{% else %}
<li
class=
"previous disabled"
>
<a>
←
Newer
</a>
</li>
{% endif %}
{% if listings.has_next %}
<li
class=
"next"
>
<a
href=
"?page={{ listings.next_page_number }}"
>
Older
→
</a>
</li>
{% else %}
<li
class=
"next disabled"
>
<a>
Older
→
</a>
</li>
{% endif %}
</ul>
</div>
<div
class=
"col-md-3 text-center"
>
<h4><i
class=
"fa fa-book fa-lg"
></i></h4>
<h4>
Search for textbooks by course, price, and more
</h4>
</div>
{% else %}
<div
class=
"row"
>
<div
class=
"col-lg-12 text-center"
>
<div
class=
"panel panel-warning"
>
<div
class=
"panel-body"
>
<h3>
No lookout results found.
</h3>
<p>
Lookouts are books you have an eye out for. You can
<a
data-toggle=
"modal"
data-target=
"#CreateLookout"
href=
"#"
>
set some
</a>
, and we'll automatically show them here when a
selling goes up.
</p>
</div>
</div>
</div>
<div
class=
"col-md-3 text-center"
>
<h4><i
class=
"fa exclamation-circle fa-lg"
></i></h4>
<h4>
Get updates when textbooks you want are posted
</h4>
</div>
{% endif %}
{% include 'create_lookout_modal.html' %}
</div>
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment