commit
bc5c7a383b
|
@ -106,7 +106,7 @@ $j(document).ready(function() {
|
|||
loader: '<img src="/static/images/loading.gif" alt="loading..." />',
|
||||
callback: function(p) {
|
||||
page += 1;
|
||||
var url = "?q={{ q }}&gbo={{ gbo }}&page=" + page;
|
||||
var url = "?q={{ q }}&gbo={{ gbo }}&ty={{ ty }}&page=" + page;
|
||||
$j.get(url, function(html) {
|
||||
var view = $j(".listview").length > 0 ? "list" : "panel";
|
||||
var results = $j(html).find(".book");
|
||||
|
|
|
@ -96,9 +96,9 @@
|
|||
<div>
|
||||
<div class="pubinfo">
|
||||
<h3 class="book-author">
|
||||
<span itemprop="author">{{ work.relators.0.name }}</span>{% ifequal work.authors.count 2 %}
|
||||
and <span itemprop="author">{{ work.relators.1.name }}</span>
|
||||
{% endifequal %}{% if work.relators.count > 2 %}{% for author in work.relators %}{% if not forloop.first %}, <span itemprop="author">{{ author.name }}</span>{% endif %}{% endfor %}
|
||||
<span itemprop="author"><a href="{% url 'search' %}?q={{ work.relators.0.author.name|urlencode }}&ty=au" />{{ work.relators.0.name }}</a></span>{% ifequal work.authors.count 2 %}
|
||||
and <span itemprop="author"><a href="{% url 'search' %}?q={{ work.relators.1.author.name|urlencode }}&ty=au" />{{ work.relators.1.name }}</a></span>
|
||||
{% endifequal %}{% if work.relators.count > 2 %}{% for author in work.relators %}{% if not forloop.first %}, <span itemprop="author"><a href="{% url 'search' %}?q={{ author.author.name|urlencode }}&ty=au" />{{ author.name }}</a></span>{% endif %}{% endfor %}
|
||||
{% endif %}
|
||||
</h3>
|
||||
<h3 class="book-year">
|
||||
|
|
|
@ -2218,6 +2218,7 @@ class ManageAccount(FormView):
|
|||
|
||||
def search(request):
|
||||
q = request.GET.get('q', '')
|
||||
ty = request.GET.get('q', 'g') # ge= 'general, au= 'author'
|
||||
request.session['q']=q
|
||||
page = int(request.GET.get('page', 1))
|
||||
gbo = request.GET.get('gbo', 'n') # gbo is flag for google books only
|
||||
|
@ -2226,6 +2227,8 @@ def search(request):
|
|||
isbnq = ISBN(q)
|
||||
if isbnq.valid:
|
||||
work_query = Q(identifiers__value=str(isbnq), identifiers__type="isbn")
|
||||
elif ty=='au':
|
||||
work_query = Q(editions__authors__name=q)
|
||||
else:
|
||||
work_query = Q(title__icontains=q) | Q(editions__authors__name__icontains=q) | Q(subjects__name__iexact=q)
|
||||
campaign_works = models.Work.objects.filter(our_stuff).filter(work_query).distinct()
|
||||
|
@ -2252,6 +2255,7 @@ def search(request):
|
|||
context = {
|
||||
"q": q,
|
||||
"gbo": gbo,
|
||||
"ty": ty,
|
||||
"results": works,
|
||||
"campaign_works": campaign_works
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -41,6 +41,12 @@
|
|||
font-weight:normal;
|
||||
color:@text-blue;
|
||||
}
|
||||
|
||||
h3.book-author span a, h3.book-year span a{
|
||||
font-size: @font-size-default;
|
||||
font-weight:normal;
|
||||
color:@link-color;
|
||||
}
|
||||
|
||||
> div {
|
||||
width:100%;
|
||||
|
|
Loading…
Reference in New Issue