Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bookshare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SRCT
bookshare
Commits
6172c9c6
Commit
6172c9c6
authored
May 05, 2015
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search page login protected; listing charts not
parent
a5917739
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
4 deletions
+18
-4
bookshare/settings/urls.py
bookshare/settings/urls.py
+5
-2
bookshare/settings/views.py
bookshare/settings/views.py
+1
-1
bookshare/templates/charts.html
bookshare/templates/charts.html
+6
-0
bookshare/templates/layouts/navbar.html
bookshare/templates/layouts/navbar.html
+1
-1
bookshare/trades/forms.py
bookshare/trades/forms.py
+5
-0
No files found.
bookshare/settings/urls.py
View file @
6172c9c6
...
...
@@ -5,6 +5,9 @@ from django.conf.urls.static import static
from
django.conf
import
settings
from
django.contrib
import
admin
from
django.views.decorators.cache
import
cache_page
from
django.contrib.auth.decorators
import
login_required
# third party imports
from
haystack.views
import
SearchView
# imports from your apps
from
.views
import
HomepageView
,
ChartsView
...
...
@@ -23,13 +26,13 @@ urlpatterns = patterns('',
url
(
r'^mod/'
,
include
(
'mod.urls'
)),
# search
url
(
r'^search/'
,
include
(
'haystack.urls
'
),
name
=
'search'
),
url
(
r'^search/'
,
login_required
(
SearchView
(),
login_url
=
'login
'
),
name
=
'search'
),
# site-wide pages
# homepage is weird for cacheing... no special url, but different content
# for each user
url
(
r'^$'
,
HomepageView
.
as_view
(),
name
=
'homepage'
),
url
(
r'^charts/?$'
,
cache_page
(
60
*
10
)(
ChartsView
.
as_view
()
),
name
=
'charts'
),
url
(
r'^charts/?$'
,
ChartsView
.
as_view
(
),
name
=
'charts'
),
# static pages
url
(
r'^about/?$'
,
...
...
bookshare/settings/views.py
View file @
6172c9c6
...
...
@@ -21,7 +21,7 @@ class HomepageView(TemplateView):
return
context
class
ChartsView
(
LoginRequiredMixin
,
TemplateView
):
class
ChartsView
(
TemplateView
):
template_name
=
'charts.html'
login_url
=
'login'
...
...
bookshare/templates/charts.html
View file @
6172c9c6
...
...
@@ -10,6 +10,10 @@ SRCT Bookshare • Charts
{% load trades_extras %}
{% load cache %}
{% cache 600 ChartsNotToolbar %}
<div
class=
"page-header"
id=
"banner"
>
<div
class=
"row"
>
<div
class=
"col-lg-12 text-center"
>
...
...
@@ -82,4 +86,6 @@ SRCT Bookshare • Charts
</div>
</div>
{% endcache %}
{% endblock content %}
bookshare/templates/layouts/navbar.html
View file @
6172c9c6
...
...
@@ -15,10 +15,10 @@
{% if user.is_authenticated %}
<li><a
href=
"{% url 'create_listing' %}"
>
Create Listing
</a></li>
<li><a
href=
"{% url 'list_listings' %}"
>
Latest Listings
</a></li>
<li><a
href=
"{% url 'charts' %}"
>
Listing Charts
</a></li>
{% else %}
<li><a
href=
"{% url 'about' %}"
>
About
</a></li>
{% endif %}
<li><a
href=
"{% url 'charts' %}"
>
Listing Charts
</a></li>
</ul>
<ul
class=
"nav navbar-nav navbar-right"
>
{% if user.is_authenticated %}
...
...
bookshare/trades/forms.py
View file @
6172c9c6
...
...
@@ -52,6 +52,11 @@ class ListingForm(forms.ModelForm):
self
.
fields
[
'description'
].
label
=
"Other Notes"
self
.
fields
[
'photo'
].
required
=
False
def
clean
(
self
):
cleaned_data
=
super
(
ListingForm
,
self
).
clean
()
print
cleaned_data
return
super
(
ListingForm
,
self
).
clean
()
class
Meta
:
model
=
Listing
...
...
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