commit
a2ead35bf8
|
@ -36,6 +36,10 @@ def create_app(test_config=None):
|
|||
def about():
|
||||
return render_template('about.html')
|
||||
|
||||
@app.route('/help')
|
||||
def help():
|
||||
return render_template('help.html')
|
||||
|
||||
@app.route('/results')
|
||||
def results():
|
||||
return render_template('results.html')
|
||||
|
|
|
@ -31,6 +31,7 @@ def index():
|
|||
|
||||
if not arguments:
|
||||
print("NO ARGUMENTS GIVEN. PLEASE GIVE ARGUMENTS")
|
||||
return render_template('search/index.html', results=results, term=title, paging=paging, search_type=search_type)
|
||||
else:
|
||||
if request.args.get("renewal"):
|
||||
results = ren_search(request.args['renewal'], request.args.get('page'),
|
||||
|
@ -97,52 +98,60 @@ def index():
|
|||
# paging = tempPaging
|
||||
# tempArgs = request.args['publisher']
|
||||
|
||||
# #Modifed Search Functionality
|
||||
# for i in range(max_page):
|
||||
# pageResults = proc_results(search(tempArgs, i, 10))
|
||||
# for obj in pageResults:
|
||||
# match_author = False
|
||||
# match_title = False
|
||||
# match_publisher = False
|
||||
# if(title!=None):
|
||||
# if(re.search(title, obj['title'], re.IGNORECASE)):
|
||||
# match_title = True
|
||||
# else:
|
||||
# match_title = True
|
||||
|
||||
# if("type" in obj):
|
||||
# if(author!=None):
|
||||
# if(re.search(author, obj['author'], re.IGNORECASE)):
|
||||
# match_author = True
|
||||
# else:
|
||||
# match_author = True
|
||||
|
||||
# else:
|
||||
# if(author!=None):
|
||||
# for a in obj['authors']:
|
||||
# if(re.search(author, a, re.IGNORECASE)):
|
||||
# match_author = True
|
||||
# break
|
||||
# else:
|
||||
# match_author = True
|
||||
|
||||
# if(publisher!=None):
|
||||
# for p in obj['publishers']:
|
||||
# if(re.search(publisher, p, re.IGNORECASE)):
|
||||
# match_publisher = True
|
||||
# break
|
||||
# else:
|
||||
# match_publisher = True
|
||||
|
||||
# if(match_author and match_title and match_publisher):
|
||||
# matched_results.append(obj)
|
||||
#Modifed Search Functionality
|
||||
|
||||
# print(json.dumps(matched_results))
|
||||
# print(len(matched_results))
|
||||
# if max_page != 0:
|
||||
# print("----------------------------------------------------------")
|
||||
# procResults = proc_results(search(tempArgs, 0, results['data']['total']))
|
||||
# print(procResults)
|
||||
for i in range(max_page):
|
||||
pageResults = proc_results(search(tempArgs, i, 10))
|
||||
for obj in pageResults:
|
||||
match_author = False
|
||||
match_title = False
|
||||
match_publisher = False
|
||||
if(title!=None):
|
||||
if(re.search(title, obj['title'], re.IGNORECASE)):
|
||||
match_title = True
|
||||
else:
|
||||
match_title = True
|
||||
|
||||
if("type" in obj):
|
||||
if(author!=None):
|
||||
if(re.search(author, obj['author'], re.IGNORECASE)):
|
||||
match_author = True
|
||||
else:
|
||||
match_author = True
|
||||
|
||||
else:
|
||||
if(author!=None):
|
||||
for a in obj['authors']:
|
||||
if(re.search(author, a, re.IGNORECASE)):
|
||||
match_author = True
|
||||
break
|
||||
else:
|
||||
match_author = True
|
||||
|
||||
if(publisher!=None):
|
||||
for p in obj['publishers']:
|
||||
if(re.search(publisher, p, re.IGNORECASE)):
|
||||
match_publisher = True
|
||||
break
|
||||
else:
|
||||
match_publisher = True
|
||||
|
||||
if(match_author and match_title and match_publisher):
|
||||
matched_results.append(obj)
|
||||
print(results)
|
||||
print("__________________________________________________________")
|
||||
print(json.dumps(matched_results))
|
||||
print(type(matched_results))
|
||||
print(len(matched_results))
|
||||
|
||||
#tempPaging = new_pagination(matched_results['data']['paging'], request.args.get('page'))
|
||||
#print(tempPaging)
|
||||
|
||||
if max_page != 0:
|
||||
print("----------------------------------------------------------")
|
||||
#newResults = proc_results(matched_results)
|
||||
procResults = proc_results(search(tempArgs, 0, results['data']['total']))
|
||||
print(type(procResults))
|
||||
|
||||
|
||||
print("PRINTING PAGING HERE")
|
||||
|
@ -158,8 +167,22 @@ def index():
|
|||
noresults = 1
|
||||
return render_template('search/index.html', noresults=noresults)
|
||||
|
||||
return render_template('search/index.html', results=results, term=title,
|
||||
paging=paging, search_type=search_type)
|
||||
if unique == 1:
|
||||
return render_template('search/index.html', results=results, term=title,paging=paging, search_type=search_type)
|
||||
|
||||
return render_template('results.html', results=matched_results)
|
||||
|
||||
|
||||
def new_pagination(pg, current):
|
||||
if not pg['next'] and not pg['previous']:
|
||||
return {**pg, **{'has_pages': False}}
|
||||
|
||||
per_page = extract_per_page(pg)
|
||||
|
||||
if current is None:
|
||||
current = 1
|
||||
else:
|
||||
current = int(current) + 1
|
||||
|
||||
|
||||
def proc_results(r):
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
<li class="nav-item active">
|
||||
<a class="nav-link" href="https://www.nypl.org/">NYPL <span class="sr-only"></span></a>
|
||||
</li>
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="/help">Help <span class="sr-only"></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="py-5 text-center">
|
||||
<div class="content">
|
||||
<h1>Need Help? (IN PROGRESS)</h1>
|
||||
<p>Enter in the Title, Author, Publisher, Registration Number, Renewal Number or any combination of the previous options into your search.</p>
|
||||
<p>Your search results should yield the registration(s) from your search parameters. Including it’s description, publishers and renewal history.</p>
|
||||
<p>If this work has been found to be out of copyright, then it is able to be distributed freely online.</p>
|
||||
<br>
|
||||
<h3>How to determine if a book is in the public domain:</h3>
|
||||
<li>Published before 1923: automatically in public domain.</li>
|
||||
<li>Published from 1923-1963: In public domain if copyright hasn’t been renewed.</li>
|
||||
<li>Published from 1964-1977: public domain after 28 years with additional 67 year automatic extension.</li>
|
||||
<li>Published from 1978-present: in public domain for life of author plus additional 70 years.</li>
|
||||
<li>Special circumstances: Created pre 1978 but not published: in public domain for life of author plus additional 70 years OR until 2003, whichever is greater.</li>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -5,6 +5,8 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="py-5 text-center">
|
||||
<div class="content">
|
||||
<p>The letters at the beginning of a registration number like “A1234”, or "BB4567" are the registration “class.” These classes mainly have to do with type or material of the work: “A” for books, “D” for dramas, “F” for maps, and so on. They may also indicate some other aspect of the work such as “DP” for a <em>published</em> drama or “DU” for an <em>unpublished</em> one.</p> Most of the entries in this dataset so far are “A” (books), and some sub-classes of class “A” are important to understand for determining copyright.</p>
|
||||
|
||||
<h3 id="foreign">Foreign Publications (AF, AFO)</h3>
|
||||
|
@ -22,5 +24,5 @@
|
|||
<p>“AI” and “AIO” are used English-language works published outside the United States. Unlike non-English works, these were subject to the “Manufacturing Clause” which required them to printed in the United States in order to gain US copyright protection. The interim registration secured temporary protection until an American edition could be printed. Like class AF, copyright was restored to most of these works after URAA<p>
|
||||
|
||||
<p>When an AI registration is followed by an American edition, the American edition receives an A-class registration. Therefore in determining the copyright if any book, it is important to determine whether there is a previous AI (or possibly AF) registration that would indicate restored rights.</p>
|
||||
|
||||
</div></div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,53 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
{% extends 'base.html' %}
|
||||
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
|
||||
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
|
||||
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
|
||||
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
|
||||
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="/static/styles.css">
|
||||
{% block content %}
|
||||
|
||||
<head>
|
||||
<title>Copyright Renewals</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<a class="navbar-brand">Copyright Renewals</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="/">Search <span class="sr-only"></span></a>
|
||||
</li>
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="about">About Us <span class="sr-only"></span></a>
|
||||
</li>
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Copyrights <span class="sr-only"></span></a>
|
||||
</li>
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">NYPL <span class="sr-only"></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
{% if results %}
|
||||
{% for result in results %}
|
||||
<div class="results">
|
||||
{% if result['type'] %}
|
||||
{% include "search/new_renewal.html" %}
|
||||
{% else %}
|
||||
{% include "search/new_registration.html" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</nav>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<div class="bg">
|
||||
<div class="results">
|
||||
<h1>Static Results page</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
{% endblock %}
|
|
@ -37,7 +37,7 @@
|
|||
<br>
|
||||
{% else %}
|
||||
{% if results %}
|
||||
<div class="nav justify-content-end">Page 1 of 1</div>
|
||||
<div class="nav float-right badge badge-primary">Page 1 of 1</div>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue