Revamped results UI

pull/4/head
Rachel Kim 2020-03-04 01:37:23 -05:00
parent d0ebf8a273
commit 64bb8e084d
9 changed files with 201 additions and 53 deletions

View File

@ -12,13 +12,13 @@ body, html {
text-align: center;
width: 60%;
padding: 20px 30px;
text-align: center;
}
.content p {
line-height: 1.5em;
margin-left:auto;
margin-right:auto;
/* width: 75%; */
}
#cprr {
@ -26,16 +26,14 @@ body, html {
}
input {
width: 75%;
width: 85%;
height:30px;
padding-left: 5px;
margin-bottom:10px;
}
button{
width: 10%;
border-radius: 5px;
margin-top:10px;
.btn{
margin-top: 0.75em
}
.header {
@ -48,36 +46,15 @@ button{
top: 0;
}
.totheleft{
float:left;
color:white;
font-size:40px;
text-align:center;
padding: 10px 10px;
text-decoration: none;
}
.totheright {
float:right;
color:white;
font-size:20px;
text-align:center;
padding: 20px 20px;
text-decoration: none;
}
.totheright a {
color:white;
text-decoration:none;
padding-right: 15px
}
/* FOR THE RESULTS PAGE */
.results {
/* position:relative; */
width: 80%;
width: 70%;
margin-left:auto;
margin-right:auto;
margin-top: 1em;
margin-bottom: 1em;
padding: 30px 20px;
/* padding-top:10%; */
background-color:#E4E6E9;
@ -85,6 +62,27 @@ button{
border-radius: 46px;
}
h3 {
margin-bottom: 1rem;
}
ul {
margin-bottom: 0;
}
.results p {
margin: 0;
}
th {
width: 20%;
}
.table-bordered td, .table-bordered th {
border: 2px solid black;
background-color: white;
}
.title {
width: fit-content;
margin-left:auto;

View File

@ -33,7 +33,7 @@
<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>
<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="https://github.com/NYPL/catalog_of_copyright_entries_project">Copyrights Catalog <span class="sr-only"></span></a>
@ -44,9 +44,7 @@
</ul>
</div>
</nav>
<div class="background">
{% block content %}{% endblock %}
</div>
</body>
</html>

View File

@ -6,9 +6,11 @@
{% block content %}
{% if result["type"] %}
{% include "search/render_renewal.html" %}
{% include "search/new_renewal.html" %}
{% else %}
{% include "search/render_registration.html" %}
<div class="results">
{% include "search/new_registration.html" %}
</div>
{% endif %}
{% endblock %}

View File

@ -9,14 +9,15 @@
{% for result in results %}
<div class = "results">
{% include "search/render_registration.html" %}
<!-- {% include "search/render_registration.html" %} -->
{% include "search/new_registration.html" %}
</div>
{% endfor %}
{% else %}
<div class="py-5 text-center">
<div class= "content">
<div class = "content">
<h1>Copyright Search</h1>
<p id="cprr">Search for copyright registrations and renewals on books from the Catalog of Copyright Entries.</p>
<p>Find a book:</p>
@ -26,7 +27,7 @@
<input type="text" name="publisher" placeholder="Publisher" autocomplete="off"><br>
<input type="text" name="registration" placeholder="Registration Number" autocomplete="off"><br>
<input type="text" name="renewal" placeholder="Renewal Number" autocomplete="off"><br>
<input type="submit" value="Search" class="btn">
<button type="submit" class="btn btn-secondary">Search</button>
</form>
</div>
</div>

View File

@ -0,0 +1,103 @@
<h3>Registration {{ result['registrations'][0]['number'] }}</h3>
<table class="table table-bordered">
<tbody>
<tr>
<th scope="row">Title</th>
<td>{{ result['title'] }}</td>
</tr>
<tr>
<th scope="row">Authors</th>
<td>
{% for a in result['authors'] %}
<p>{{ a }}</p>
{% endfor %}
</td>
</tr>
<tr>
<th scope="row">Registrations</th>
<td>
{% for r in result['registrations'] %}
<p>{{ r['number'] }} {{ r['date'] }}</p>
{% endfor %}
</td>
</tr>
{% if result['copies'] %}
<tr>
<th scope="row">Copies</th>
<td>{{ result['copies'] }}</td>
</tr>
{% endif %}
{% if result['copy_date'] %}
<tr>
<th scope="row">Copy Date</th>
<td>{{ result['copy_date'] }}</td>
</tr>
{% endif %}
{% if result['description'] %}
<tr>
<th scope="row">Description</th>
<td>{{ result['description'] }}</td>
</tr>
{% endif %}
{% if result['pub_date'] %}
<tr>
<th scope="row">Publication Date</th>
<td>{{ result['pub_date'] }}</td>
</tr>
{% endif %}
{% if result['publishers'] %}
<tr>
<th scope="row">Publishers</th>
<td>
{% for p in result['publishers'] %}
<p>{{p}}</p>
{% endfor %}
</td>
</tr>
{% endif %}
<tr>
<th scope="row">Renewals</th>
<td>
{% if result['is_post_1963'] %}
<em>Works published after 1963 do not require renewal and are in copyright</em>
{% else %}
{% if result['renewals'] %}
{% for renewal in result['renewals'] %}
{% include "search/render_child_renewal.html" %}
{% endfor %}
{% else %}
<em>No renewals found</em>
{% endif %}
{% endif %}
{% if result['is_foreign'] %}
<br>See note on <a href="/registration-classes#foreign">Foreign publications</a>
{% endif %}
{% if result['is_interim'] %}
<br>See note on <a href="/registration-classes#interim">Interim registrations</a>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Source</th>
<td>
<a href="{{ result['source_url'] }}">
{{ result['source']['year'] }} p. {{ result['source']['page'] }}
</a>
</td>
</tr>
<tr>
<th scope="row">Original</th>
<td>{{ result['original'] }}</td>
</tr>
<tr>
<th scope="row">CCEID</th>
<td><a href="/cceid/{{ result['uuid'] }}">{{ result['uuid'] }}</a></td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,51 @@
<h3>Renewal {{ result['renewal_num'] }}</h3>
<table class="table table-bordered">
<tbody>
<tr>
<th scope="row">Title</th>
<td>{{ result['title'] }}</td>
</tr>
<tr>
<th scope="row">Authors</th>
<td>{{ result['author'] }}</td>
</tr>
<tr>
<th scope="row">Renewal</th>
<td>{{ result['renewal_num'] }} {{ result['renewal_date'] }}</td>
</tr>
<tr>
<th scope="row">Claimants</th>
<td>
{% for c in result['claimants'] %}
<p>{{ c['name'] }} ({{ c['type'] }})</p>
{% endfor %}
</td>
</tr>
{% if result['new_matter'] %}
<tr>
<th scope="row">New Matter</th>
<td>{{ result['new_matter'] }}</td>
</tr>
{% endif %}
{% if result['notes'] %}
<tr>
<th scope="row">Notes</th>
<td>{{ result['notes'] }}</td>
</tr>
{% endif %}
{% if result['source'] %}
<tr>
<th scope="row">Original</th>
<td>{{ result['source'] }}</td>
</tr>
{% endif %}
<tr>
<th scope="row">CCEID</th>
<td><a href="/cceid/{{ result['uuid'] }}">{{ result['uuid'] }}</a></dd>
</tr>
</tbody>
</table>

View File

@ -29,10 +29,10 @@
<a href="{{ paging['pages']['last'] }}">Last</a>
</span>
{% endif %}
</nav>
<div class="float-right badge badge-light">
<a href="/">Back To Search</a>
<a href="/">Back To Search</a>
</div>
<br>
{% else %}

View File

@ -1,17 +1,13 @@
<div class="grid-col-4">
<a href="/cceid/{{ renewal['uuid'] }}">
<p><a href="/cceid/{{ renewal['uuid'] }}">
{{ renewal['renewal_num'] }} {{ renewal['renewal_date'] }}
</a>
</div>
</a></p>
<div class="grid-col-6">
<div>
<p>
{{ renewal['author'] }} {{ renewal['title'] }}
</div>
</p>
<ul class="usa-list usa-list--unstyled">
{% for cl in renewal['claimants'] %}
<li>{{ cl['name'] }} ({{ cl['type'] }})</li>
{% endfor %}
</ul>
</div>

View File

@ -1,16 +1,15 @@
<div class = "d-flex"><h3>Registration {{ result['registrations'][0]['number'] }}</h3></div>
<dl>
<div class="row">
<div class="col-sm-6"><b>Title</b></div>
<div class="col-sm-6">{{ result['title'] }}</div>
<div class="col col-sm-6"><b>Title</b></div>
<div class="col col-sm-6">{{ result['title'] }}</div>
</div>
<div class = "row">
<div class="col-sm-6"><b>Authors</b></div>
<div class="col col-sm-6"><b>Authors</b></div>
{% for a in result['authors'] %}
<div class="col-sm-6">-{{ a }}</div>
<div class="col col-sm-6">-{{ a }}</div>
<div class="col-sm-6"> </div>
{% endfor %}
</div>