Commit e7c32b54 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

visual cleanup and consistency (issue #39) forgot the 'a'

parent e465aed1
......@@ -46,24 +46,24 @@ SRCT Bookshare • {{ student.user.first_name }} {{ student.user.last_name }}
<div class="row">
<div class="col-md-12">
{% if student.user == request.user %}
<legend><h3>Listings <small>(<a href="{% url 'create_listing' %}">Create</a>)</small></h3></legend>
<legend><h3><i class="fa fa-book"></i> Listings <small>(<a href="{% url 'create_listing' %}">Create</a>)</small></h3></legend>
{% else %}
<h3>Listings</h3>
{% endif %}
{% if listings %}
<div class="table-responsive">
<table class="table table-bordered table-hover">
<table class="table table-bordered table-hover text-center">
<thead>
<th class="col-md-2 text-center"><h4>ISBN</h4></th>
<th class="col-md-8 text-center"><h4>Title</h4></th>
<th class="col-md-1 text-center"><h4>Price</h4></th>
<th class="col-md-1 text-center"><h4>
<td class="col-md-2"><h4><strong>ISBN</strong></h4></td>
<td class="col-md-8"><h4><strong>Title</strong></h4></td>
<td class="col-md-1"><h4><strong>Price</strong></h4></td>
<td class="col-md-1"><h4><strong>
{% if student.user == request.user %}
Action
{% else %}
Status
{% endif %}</h4></th>
{% endif %}</strong></h4></td>
</thead>
{% for listing in listings %}
<tbody>
......@@ -124,7 +124,7 @@ SRCT Bookshare &bull; {{ student.user.first_name }} {{ student.user.last_name }}
{% if student.user == request.user %}
<div class="row">
<div class="col-md-12">
<legend><h3>Lookouts <small>(<a href="{% url 'create_lookout' %}">Create</a>)</small></h3></legend>
<legend><h3><i class="fa fa-eye"></i> Lookouts <small>(<a href="{% url 'create_lookout' %}">Create</a>)</small></h3></legend>
</div>
</div>
{% endif %}
......@@ -133,11 +133,11 @@ SRCT Bookshare &bull; {{ student.user.first_name }} {{ student.user.last_name }}
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-bordered table-hover">
<table class="table table-bordered table-hover text-center">
<thead>
<th class="col-md-2 text-center"><h4>ISBN</h4></th>
<th class="col-md-8 text-center"><h4>Title</h4></th>
<th class="col-md-2 text-center"><h4>Action</h4></th>
<td class="col-md-2"><h4><strong>ISBN</strong></h4></td>
<td class="col-md-8"><h4><strong>Title</strong></h4></td>
<td class="col-md-2"><h4><strong>Action</strong></h4></td>
</thead>
<tbody>
{% for lookout in lookouts %}
......
......@@ -8,20 +8,25 @@ from lookouts.models import Lookout
class LookoutForm( forms.ModelForm ):
helper = FormHelper()
helper.form_method = 'POST'
helper.form_class = 'form-horizontal'
helper.label_class='col-sm-2'
helper.field_class='col-sm-6'
def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.form_method = 'POST'
self.helper.form_class = 'form-horizontal'
self.helper.label_class='col-sm-2'
self.helper.field_class='col-sm-6'
helper.layout = Layout(
Fieldset("Your Lookout",
'owner',
Field('isbn', title="ISBN"),
HTML("""<hr/ >"""),
FormActions(Submit('submit', 'Submit', css_class='btn-primary'))
),
)
self.helper.layout = Layout(
Fieldset("",
'owner',
'isbn',
HTML("""<hr/ >"""),
FormActions(Submit('submit', 'Submit', css_class='btn-primary'))
),
)
super(LookoutForm, self).__init__(*args, **kwargs)
self.fields['isbn'].label = "ISBN"
class Meta:
model = Lookout
......@@ -12,13 +12,12 @@ SRCT Bookshare &bull; Creare Lookout
<div class="row">
<div class="col-lg-12 text-center">
<h1><strong>SRCT</strong>&#8203;BOOKSHARE</h1>
<p class="lead"><strong>Create Lookout</strong></p>
<p class="lead text-center"><strong>Create Lookout</strong></p>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<span class="help-block">
<strong>Lookouts</strong> help you find the textbooks you
......@@ -26,13 +25,15 @@ SRCT Bookshare &bull; Creare Lookout
for, and any new listings with that ISBN will show up on
your homepage, automatically!
</span>
<div class="well">
<div class="row">
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title text-center"><strong><i class="fa fa-plus-circle"></i> Add Your Lookout</strong></h1>
</div>
<div class="panel-body">
{% crispy my_form %}
</div>
</div>
</div>
</div>
{% endblock %}
......@@ -50,3 +50,7 @@ text-align: center;
bottom: 8px;
right: 15px;
}
.navbar-brand img {
margin-top: -5px;
}
......@@ -21,33 +21,18 @@ SRCT Bookshare &bull; Homepage
{% load trades_extras %}
<legend class="text-center"><strong>Lookouts</strong></legend>
<legend class="text-center"><i class="fa fa-eye"></i> <strong>Your Lookouts</strong> <small>(<a href="{% url 'create_lookout' %}">Create</a>)</small></legend>
{% if lookouts %}
<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 lookout in lookouts %}
<legend><a href="{{ lookout.get_absolute_url }}">{{ lookout.isbn|isbn_name }}</a></legend>
{% for listing in lookout.get_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 %}
<legend><i class="fa fa-book"></i> <a href="{{ lookout.get_absolute_url }}">{{ lookout.isbn|isbn_name }}</a></legend>
<div class="row">
{% for listing in lookout.get_listings %}
<div class="col-md-6">
{% include 'listing_preview_panel.html' %}
</div>
{% endfor %}
</div>
{% endfor %}
</div>
......
......@@ -7,7 +7,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% url 'homepage' %}"><strong>SRCT</strong>BOOKSHARE</a>
<a class="navbar-brand" href="{% url 'homepage' %}"><img src="/static/img/SRCT_square.svg" height="24" width="24" alt="SRCT"> BOOKSHARE</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
......
......@@ -8,52 +8,41 @@ from trades.models import Listing, Bid
class ListingForm( forms.ModelForm ):
helper = FormHelper()
helper.form_method = 'POST'
helper.form_class='form-horizontal'
helper.label_class='col-sm-2'
helper.field_class='col-sm-6'
helper.layout = Layout(
Fieldset("Your Textbook",
'seller',
Field('isbn', title="ISBN"),
HTML("""<hr/ >"""),
Field('title'),
'author',
'edition',
'year',
HTML("""<hr/ >"""),
#'course',
'condition',
AppendedPrependedText('price','$', '.00', placeholder="whole numbers"),
'photo',
Field('description', placeholder='I would be willing to exchange this textbook for one that I need next semester'),
HTML("""<hr/ >"""),
FormActions(Submit('submit', 'Submit', css_class='btn-primary'))
),
)
def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.form_method = 'POST'
self.helper.form_class='form-horizontal'
self.helper.label_class='col-sm-2'
self.helper.field_class='col-sm-6'
self.helper.layout = Layout(
Fieldset("",
'seller',
'isbn',
HTML("""<hr/ >"""),
Field('title'),
'author',
'edition',
'year',
HTML("""<hr/ >"""),
#'course',
'condition',
AppendedPrependedText('price','$', '.00', placeholder="whole numbers"),
'photo',
Field('description', placeholder='I would be willing to exchange this textbook for one that I need next semester'),
HTML("""<hr/ >"""),
FormActions(Submit('submit', 'Submit', css_class='btn-primary'))
),
)
super(ListingForm, self).__init__(*args, **kwargs)
self.fields['isbn'].label = "ISBN"
class Meta:
model = Listing
exclude = ('data_sold', 'sold', 'active', 'finalPrice')
# def clean(self):
# error_message = "You've already posted a listing with this ISBN. Close that listing first."
# cleaned_data = super(ListingForm, self).clean()
# cleaned_isbn = cleaned_data.get('isbn')
# cleaned_seller = self.request.user.seller
# existing_listings = Listing.objects.filter(isbn=cleaned_isbn,
# seller=cleaned_seller,
# active=True)
# if len( existing_listings ) > 0:
# raise ValidationError(error_message)
# return cleaned_data
class BidForm( forms.ModelForm ):
def clean(self):
......
......@@ -29,6 +29,5 @@ SRCT Bookshare &bull; Create Listing
</div>
</div>
</div>
</div>
{% endblock %}
......@@ -67,9 +67,9 @@ SRCT Bookshare &bull; {{ listing.title }}
${{ listing.price }}
{% endif %}
</h1>
<h4><small>Listed</small> {{ listing.created|date:"M d y P" }}</h4>
Sold by<a href="{% url 'profile' listing.seller.user.username %}"> {{ listing.seller.user.username }}</a> |
<span class="label label-danger"><strong><a href="#"><i class="fa fa-flag"></i> Report</a></strong></span>
<h4><small>Listed</small> {{ listing.created|date:"M d, 'y P" }}</h4>
<h4><small>Sold by</small><a href="{% url 'profile' listing.seller.user.username %}"> {{ listing.seller.user.username }}</a> |
<span class="label label-danger"><strong><a href="#"><i class="fa fa-flag"></i> Report</a></strong></span></h4>
</div>
</div>
</div>
......@@ -97,7 +97,7 @@ SRCT Bookshare &bull; {{ listing.title }}
{% endif %}
</div>
<div class="col-md-1 col-sm-12 col-xs-12">
<h4><strong>ENGH 302</strong></h4>
{% comment %}<h4><strong>ENGH 302</strong></h4> {% endcomment %}
</div>
</div>
......
......@@ -19,52 +19,34 @@ SRCT Bookshare &bull; Latest Listings
<div class="row">
<div class="col-md-10 col-md-offset-1 text-center">
<p>Want to <strong><a href="/search">search</a></strong> for something specific?</p>
<h4><p><em>Want to <strong><a href="/search">search</a></strong> for something specific?</em></p></h4>
</div>
</div>
<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 %}
<legend></legend>
<div class="row">
{% for listing in listings %}
{% if forloop.counter|add:-1|divisibleby:rows %}
<div class="col-md-4">
{% endif %}
<div class="col-md-6">
{% 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 }}">
&larr; Newer
<h4>&larr; Newer</h4>
</a>
</li>
{% else %}
<li class="previous disabled">
<a>
&larr; Newer
<h4>&larr; Newer</h4>
</a>
</li>
{% endif %}
......@@ -72,13 +54,13 @@ SRCT Bookshare &bull; Latest Listings
{% if listings.has_next %}
<li class="next">
<a href="?page={{ listings.next_page_number }}">
Older &rarr;
<h4>Older &rarr;</h4>
</a>
</li>
{% else %}
<li class="next disabled">
<a>
Older &rarr;
<h4>Older &rarr;</h4>
</a>
</li>
{% endif %}
......@@ -96,7 +78,7 @@ SRCT Bookshare &bull; Latest Listings
<div class="panel-body">
<h3>There aren't any books in the database!</h3>
<p>
Looks like you'll be the first to <a href="#">create one</a>!
Looks like you'll be the first to <a href="{% url 'create_listing' %}">create one</a>!
</p>
</div>
</div>
......
......@@ -15,53 +15,48 @@ SRCT Bookshare &bull; Search Listings
</div>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<form class="form-horizontal" role="form" method="get">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon">
<i class="fa fa-search fa-lg"></i>
</span>
{{ form.q }}
</div>
</div>
</form>
<form class="form-horizontal" method="get" action=".">
<div class="form-group">
<label for "id_q" class="col-md-1 col-md-offset-4 control-label"><strong>Search</strong></label>
<div class="col-md-2">
{{ form.q }}
</div>
<button type="submut" class="btn btn-default"><i class="fa fa-search fa-fw fa-lg"></i></button>
</div>
</div>
</form>
{% if query %}
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="col-md-10 col-md-offset-1">
{% if page.object_list %}
<table class="table table-hover">
<table class="table table-hover text-center">
<thead>
<th class="col-md-1 text-center"><h3><small>ISBN</small></h3></th>
<th class="col-md-7 text-center"><h3><small>Title</small></h3></th>
<th class="col-md-3 text-center"><h3><small>Author</small></h3></th>
<th class="col-md-1 text-center"><h3><small>Price</small></h3></th>
<td class="col-md-1"><h4><strong>ISBN</strong></h4></td>
<td class="col-md-7"><h4><strong>Title</strong></h4></td>
<td class="col-md-3"><h4><strong>Author</strong></h4></td>
<td class="col-md-1"><h4><strong>Price</strong></h4></td>
</thead>
{% endif %}
{% for result in page.object_list %}
<tr>
<td class="text-center">
<h4>{{ result.object.isbn }}</h4>
<h5>{{ result.object.isbn }}</h5>
</td>
<td class="text-center">
<a href="{{ result.object.get_absolute_url }}"><h4><strong>{{ result.object.title }}</strong></h4></a>
<a href="{{ result.object.get_absolute_url }}"><h5><strong>{{ result.object.title }}</strong></h5></a>
</td>
<td class="text-center">
<h4>{{ result.object.author }}</h4>
<h5>{{ result.object.author }}</h5>
</td>
<td class="text-center">
<h4>${{ result.object.price }}</h4>
<h5>${{ result.object.price }}</h5>
</td>
</tr>
{% empty %}
<h3 class="text-center">No results found.</h3>
<h4 class="text-center">No results found.</h4>
{% endfor %}
{% if page.object_list %}
......@@ -79,13 +74,13 @@ SRCT Bookshare &bull; Search Listings
{% if page.has_previous %}
<li class="previous">
<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">
&larr; Previous
<h4>&larr; Previous</h4>
</a>
</li>
{% else %}
<li class="previous disabled">
<a>
&larr; Previous
<h4>&larr; Previous</h4>
</a>
</li>
{% endif %}
......@@ -93,13 +88,13 @@ SRCT Bookshare &bull; Search Listings
{% if page.has_next %}
<li class="next">
<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">
Next &rarr;
<h4>Next &rarr;</h4>
</a>
</li>
{% else %}
<li class="next disabled">
<a>
Next &rarr;
<h4>Next &rarr;</h4>
</a>
</li>
{% endif %}
......
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