Skip to content

Commit

Permalink
Merge pull request #1334 from jdlrobson/1329
Browse files Browse the repository at this point in the history
Fix add-cover and manage-covers
  • Loading branch information
mekarpeles committed Oct 12, 2018
2 parents 7c84439 + 9be3e32 commit c0abbf0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 29 deletions.
6 changes: 2 additions & 4 deletions openlibrary/templates/covers/add.html
Expand Up @@ -10,7 +10,7 @@
$ intro = _("There are two ways to get a cover image on Open Library")
$ action = doc.url('/add-cover')
$elif doc.get_edition_covers:
$ intro = _("There are three ways to get a cover image on Open Library")
$ intro = _("There are two ways to get a cover image on Open Library")
$ action = doc.url('/add-cover')
$else:
$ intro = _("There are two ways to get a cover image on Open Library")
Expand All @@ -26,9 +26,7 @@

<script type="text/javascript">
<!--
\$().ready(carousels);
\$().ready(function(){\$('#popcovers').jcarousel();});
\$(function() {
window.q.push(function(){
parent.closeThrobber();
\$("#form.addcover-form").submit(function(event) {

Expand Down
6 changes: 1 addition & 5 deletions openlibrary/templates/covers/manage.html
Expand Up @@ -4,7 +4,7 @@
$putctx('robots', 'noindex,nofollow')

<script type="text/javascript">
\$(function() {
window.q.push(function () {
\$(".column").sortable({
connectWith: '.trash'
});
Expand All @@ -13,10 +13,6 @@
});
\$(".column").disableSelection();
\$(".trash").disableSelection();
});
</script>
<script type="text/javascript">
\$().ready(function(){
\$("#topNotice").hide();
});
</script>
Expand Down
12 changes: 0 additions & 12 deletions openlibrary/templates/lib/covers.html
Expand Up @@ -30,18 +30,6 @@
updateBookAvailability('#coversCarousel li ');
});
}

\$().ready(function() {
page.renderCovers = render_page;
page.displayCovers(0);
});

\$().ready(carousels);
\$().ready(function() {
carouselSetup(loadCoverCarousels);
\$('.jcarousel-next').attr('title','View the next editions').append('<h4 class="shift"><a href="#" onclick="return false;">View the next editions</a></h4>');
\$('.jcarousel-prev').attr('title','View the previous editions').append('<h4 class="shift"><a href="#" onclick="return false;">View the previous editions</a></h4>');
});
//-->
</script>

Expand Down
16 changes: 10 additions & 6 deletions openlibrary/templates/site/body.html
Expand Up @@ -3,20 +3,24 @@
$ announcement = '<strong>New Feature:</strong> You can now embed Open Library books on your website! &nbsp; <a href="https://blog.openlibrary.org/2018/05/06/turn-your-website-into-a-library/" data-ol-link-track="AnnouncementsBar|BlogWidget" class="btn primary">Learn More</a>'

$ bodyid = ctx.get('bodyid', 'user')

$ show_banners = bodyid != 'form'
$if 'v2' in page:
<body id="$bodyid">
<script>
// Provide a signal that JS will load
document.body.className += ' client-js';
</script>
<span id="top"></span>
$:render_template("site/alert")
$:render_template("lib/nav_head", None)
$# on form pages e.g. manage-covers, add-cover we do not display the header
$# this is consistent with version 1.
$if show_banners:
$:render_template("site/alert")
$:render_template("lib/nav_head", None)
<div id="test-body-mobile">
<div class="page-banner page-banner-body">
$:announcement
</div>
$if show_banners:
<div class="page-banner page-banner-body">
$:announcement
</div>
$:page
</div>

Expand Down
1 change: 0 additions & 1 deletion static/css/page-form.less
Expand Up @@ -37,7 +37,6 @@ body#form {
}
.column {
min-height: 90px;
float: left;
margin: 10px;
background-image: url(/images/back_sortable.png);
background-repeat: no-repeat;
Expand Down
7 changes: 6 additions & 1 deletion static/css/v2.less
Expand Up @@ -4,8 +4,13 @@
max-width: 960px;
width: 100%;
margin: 0 auto;
margin-top: 20px;
background-color: @white;
border-radius: 5px;
border: 1px solid @dark-beige;
}
// For pages without a header we don't want a margin.
// This might be better placed in the header component in future
// but is kept here for backwards compatibility with v1 pages
header + #test-body-mobile {
margin-top: 20px;
}

0 comments on commit c0abbf0

Please sign in to comment.