diff --git a/frontend/templates/work.html b/frontend/templates/work.html index 0647decb..0f3f8d97 100644 --- a/frontend/templates/work.html +++ b/frontend/templates/work.html @@ -5,7 +5,7 @@ {% load purchased %} {% load lib_acqs %} {% load sass_tags %} -{% block title %}— +{% block title %}— {% if work.is_free %} {{ work.title }} is a Free eBook. {% for fmt in work.formats %}[{{ fmt }}]{% endfor %} {% else %} @@ -22,503 +22,100 @@ {% endblock %} -{% block extra_js %} - - - - - - -{% if user.is_staff or user in work.last_campaign.managers.all %} - {{ kwform.media.js }} -{% endif %} - - - - -{% endblock %} - -{% block topsection %} -{% if work.last_campaign.status == 'ACTIVE' %} - {% if request.user in work.last_campaign.managers.all %} -
Hi, {{ request.user.username }}. Since you're a manager for this campaign, you can edit this campaign.
- {% endif %} -{% elif not work.user_with_rights %} - {% if request.user.rights_holder.all %} -
Hi, {{ request.user.username }}. Since you're an authorized Unglue.it rights holder, if you own the worldwide electronic rights to this work, you may claim it through the More... tab. Need help? Check out the rights holder tools page.
- {% endif %} -{% elif request.user == work.user_with_rights %} - {% if work.last_campaign.status != 'SUCCESSFUL' %} -
Hi, {{ request.user.username }}. Since you're a rights holder for this work, you can launch a campaign.
- {% endif %} -{% endif %} -{% endblock %} - -{% block content %} -{% purchased %} -{% lib_acqs %} -{% with work.last_campaign_status as status %} +{% block content %} {% with work.id as work_id %} -
-
-
- {% include "explore.html" %} -
-
-
-
-
- {% if work.uses_google_cover %} -
- - Find {{ work.title }} at Google Books -
- {% else %} -
- {{ work.title }} -
- {% endif %} -
-
-

{{ work.title }}

-
-
-

- {% if work.authors.count == 2 %} - and - {% endif %}{% if work.relators.count > 2 %}{% for author in work.relators %}{% if not forloop.first %}, {% endif %}{% endfor %} - {% endif %} -

-

- {% if work.last_campaign.publisher %} - {{ work.last_campaign.publisher }} - {% endif %} - - - -

-
-
-
- {% if status == 'ACTIVE' %} - {% if work.last_campaign.type != 3 %} -
-
-
- {{ work.percent_of_goal }}% of goal -
- {% endif %} -
-
- {% if work.last_campaign.type == 1 %} - ${{ work.last_campaign.current_total|floatformat:0|intcomma }} pledged - {% endif %} - {% if work.last_campaign.type == 2 %} - current ungluing date: - {% endif %} - {% if work.last_campaign.type == 3 %} - ${{ work.last_campaign.current_total|floatformat:0|intcomma }} of thanks from - {% endif %} -
-
- {% if work.last_campaign.type == 1 %} - ${{ work.last_campaign.target|floatformat:0|intcomma }} goal - {% endif %} - {% if work.last_campaign.type == 2 %} - {{ work.last_campaign.cc_date|date:"M j, Y" }} - After {{ work.last_campaign.cc_date|date:"M j, Y" }} this book will be available for free to anyone, anywhere. Every purchase before then brings that date closer. - {% endif %} - {% if work.last_campaign.type != 3 %} -
-
- {% endif %} - {% if work.last_campaign.supporters_count == 1 %} - 1 ungluer - {% else %} - {{ work.last_campaign.supporters_count }} ungluers - {% endif %} - {% if work.last_campaign.type == 3 %} -
- {% if work.last_campaign.anon_count == 1 %} - 1 other - {% else %} - {{ work.last_campaign.anon_count }} others - {% endif %} - {% endif %} -
- {% if work.last_campaign.type == 2 %} -
- {% if work.lib_acqs.count == 1 %} - 1 copy in a library - {% else %} - {{ work.lib_acqs.count }} in libraries - {% endif %} -
- {% endif %} - {% if work.last_campaign.type != 3 %} -
- {% if work.last_campaign.type == 1 %} - {{ work.last_campaign.countdown }} to go - {% else %} - ${{ work.last_campaign.left|floatformat:0|intcomma }} to go - ${{ work.last_campaign.left|floatformat:0|intcomma }} is the amount it would take to make this ebook free to the world tomorrow. - {% endif %} -
- {% endif %} -
- {% else %} - {% if status == 'SUCCESSFUL' %} -
- This campaign succeeded on {{ work.last_campaign.success_date|date:"M j, Y" }}. -
-
-
- {% if work.last_campaign.supporters_count == 1 %} - 1 ungluer - {% else %} - {{ work.last_campaign.supporters_count }} ungluers - {% endif %} -
-
- ${{ work.last_campaign.current_total|floatformat:0|intcomma }} raised -
-
- ${{ work.last_campaign.target|floatformat:0|intcomma }} goal -
-
- Unglued! -
-
- {% endif %} - -
- {% if wishers == 1 %} - 1 Ungluer has - {% else %} - {{ wishers }} Ungluers have - {% endif %} Faved this Work -
- {% endif %} -
- - -
-
- {% if request.user.is_anonymous %} - - {% elif request.user.id in work.last_campaign.supporters %} -
- Faved! -
- {% elif work in request.user.wishlist.works.all %} -
- Remove from My Faves -
- {% else %} -
- Add to My Faves -
- {% endif %} -
-
-
- {% get_comment_count for work as comment_count %} - {% if action == 'editions' %} - - {% else %} - +
+
+ {% if work.uses_google_cover %} + + Find {{ work.title }} at Google Books + + {% else %} + {{ work.title }} + {% endif %} +
+
+
+

{{ work.title }}

+
+
+

+ {% if work.authors.count == 2 %} + and + {% endif %}{% if work.relators.count > 2 %}{% for author in work.relators %}{% if not forloop.first %}, {% endif %}{% endfor %} {% endif %} -
-
-
-
- {% if status == 'ACTIVE' %} - {% if work.last_campaign.type != 3 %} - {{ work.last_campaign.description|safe }} - {% else %} - {{ work.description|safe }} - {% endif %} - {% elif work.description %} - {{ work.description|safe }} - {% else %} - {{ work.last_campaign.description|safe }} - {% endif %} -
-
- {% for work_rel in work.works_related_to.all %} - {% if work_rel.from_work.language != 'xx' and work.language != 'xx' %} -

- This work is a {{ work_rel.relation }} of {{ work_rel.from_work }}. -

- {% endif %} - {% endfor %} - {% for work_rel in work.works_related_from.all %} - {% if work.language != 'xx' and work_rel.to_work.language != 'xx' %} -

- {{ work_rel.to_work }} is a {{ work_rel.relation }} of this work. -

- {% endif %} - {% endfor %} - {% if work.doab %} -

- This book is included in DOAB. -

- {% endif %} - {% if work.gtbg %} -

- This book is included in Project Gutenberg. -

- {% endif %} -
-
-
-
-

Why {% if work.ebooks.all %}read{% else %}unglue{% endif %} this book? Have your say.

-
- {% render_comment_list for work %} - {% if user.is_authenticated %} - {% render_comment_form for work %} - {% else %} -

You must be logged in to comment.

- {% endif %} -
-
-
-
- {% if request.user.is_staff or request.user in work.last_campaign.managers.all %} -
- {% csrf_token %} - - {% for wish in work.wishes.all reversed %} - {% with wish.wishlist.user as supporter %} -
- - - Avatar for {{ supporter }} - - -
- -
-
- {{ supporter }}
- Wished: {{ wish.created }}
- {% if supporter.id in work.last_campaign.supporters %}Pledged!
{% endif %} - {% if supporter in work.last_campaign.ungluers.all %}Supported!
{% endif %} -
-
-
- - {% endwith %} - {% endfor %} -
- {% else %} - {% for wish in work.wishes.all reversed %} - {% with wish.wishlist.user as supporter %} - - {% endwith %} - {% endfor %} - {% endif %} -
-
-
-
- {% if action == 'display' %} - {% if status == 'ACTIVE' %} - {% if work.last_campaign.type == 1 %} -

A campaign is running to unglue {{work.title}}!

-

The rights holder, {% for claim in work.claim.all %} - {% if claim.status == 'active' %} - {{ claim.rights_holder.rights_holder_name }} - {% endif %} - {% endfor %} - , has agreed to release {{work.title}} to the world as a Creative Commons licensed ebook ({{ work.last_campaign.license }}) if ungluers can join together to raise ${{ work.last_campaign.target|floatformat:0|intcomma }} by {{ work.last_campaign.deadline }}. - You can help!

- {% endif %} - {% if work.last_campaign.type == 2 %} -

A Buy-to-Unglue Campaign is running to unglue {{work.title}}!

-

The rights holder, {% for claim in work.claim.all %} - {% if claim.status == 'active' %} - {{ claim.rights_holder.rights_holder_name }} - {% endif %} - {% endfor %} - , has agreed to release {{work.title}} to the world as a Creative Commons licensed ebook ({{ work.last_campaign.license }}) on {{ work.last_campaign.cc_date }}. For every copy that ungluers purchase, that date gets sooner. ${{ work.last_campaign.left|floatformat:0|intcomma }} of sales will unglue the book TODAY. - You can help!

- {% endif %} - {% if work.last_campaign.type == 3 %} -

A Thanks-for-Ungluing Campaign is running to reward the creators of {{work.title}}!

-

The rights holder, {% for claim in work.claim.all %} - {% if claim.status == 'active' %} - {{ claim.rights_holder.rights_holder_name }} - {% endif %} - {% endfor %} - , has released {{work.title}} to the world as a Creative Commons licensed ebook ({{ work.last_campaign.license }}) . - You can help us say "Thank You!" so that other creators will do the same.

- {% endif %} -

Campaign details: the fine print

- {{ work.last_campaign.details|safe }} - {% endif %} - - {% if status == 'SUCCESSFUL' %} -

A campaign has succeeded to unglue {{work.title}}!

-

The rights holder, {% for claim in work.claim.all %} - {% if claim.status == 'active' %} - {{ claim.rights_holder.rights_holder_name }} - {% endif %} - {% endfor %} - , has agreed to release {{work.title}} to the world as a Creative Commons licensed ebook ({{ work.last_campaign.license }}) thanks to the efforts of ungluers like you.

-

Campaign details: the fine print

- {{ work.last_campaign.details|safe }} - {% endif %} - {% if status != 'ACTIVE' and status != 'SUCCESSFUL' %} -

Rights Information

- {% if claimstatus == 'one_active' %} -

This work has been claimed by {{ rights_holder_name }}.

- {% else %} - {% if claimstatus == 'disputed' %} -

Rights claims are pending.

- {% else %} - {% if claimstatus == 'one_pending' %} -

A claim for this work by {{ rights_holder_name }} is pending.

- {% else %} - {% if request.user.rights_holder.all.count %} - Is this work yours? Claim it:

- -
- {% csrf_token %} - {{ claimform.user }} - {{ claimform.work }} - {{ claimform.rights_holder }} - -

- {% else %} - Are you the author or publisher of this work? If so, you can claim it as yours by registering as an Unglue.it rights holder. - {% endif %} - {% endif %} - {% endif %} - {% endif %} - {% endif %} - {% if work.is_free %} -

Downloads

-
- This work has been downloaded {{ work.download_count }} times via unglue.it ebook links. -
    - {% for ebook in work.ebooks.all %} -
  1. {{ ebook.download_count }} - {{ ebook.format }} {% if ebook.version_label %} ({{ ebook.version_label }}) {% endif %}({{ ebook.rights }}) at {{ ebook.provider }}.
  2. - {% endfor %} -
-
- {% if user.is_staff %} -

- Feature this work today. -

- {% endif %} - {% endif %} - {% if user.is_staff %} -

Related Works

- - - {% endif %} -

Keywords

- {% if work.subjects.all.count > 0 %} -
    - {% for subject in work.subjects.all %} -
  • {{ subject.name }} - {% if user.is_staff or user in work.last_campaign.managers.all %} - x - {% endif %} -
  • - {% endfor %} -
- {% else %} - No keywords yet. -
    - - {% endif %} - {% if user_can_edit_work %} -
    {% csrf_token %} - {{ kwform.add_kw }} -
    - {% endif %} - {% endif %} -

    Editions

    - {% if alert %} -

    {{ alert }}
    - {% endif %} - {% if user_can_edit_work %} - - {% endif %} - - {% if action == 'editions' %} - {% include 'split.html' %} - {% else %} - {% with work.preferred_edition as edition %} - {% include 'edition_display.html' %} - {% endwith %} - {% if not campaign %} - {% for edition in editions %} - {% if edition != work.preferred_edition %} - {% include 'edition_display.html' %} - {% endif %} - {% endfor %} - {% endif %} - - {% endif %} - -
    -
    -
    -

    + +

    + {% if work.last_campaign.publisher %} + {{ work.last_campaign.publisher }} + {% endif %} + + + +

    +
    -
    - {% include 'work_action.html' %} +
    + {% if status == 'ACTIVE' %} + {% if work.last_campaign.type != 3 %} + {{ work.last_campaign.description|safe }} + {% else %} + {{ work.description|safe }} + {% endif %} + {% elif work.description %} + {{ work.description|safe }} + {% else %} + {{ work.last_campaign.description|safe }} + {% endif %}
    +
    +
    +
    + {% if request.user.is_anonymous %} + + {% elif request.user.id in work.last_campaign.supporters %} +
    + Faved! +
    + {% elif work in request.user.wishlist.works.all %} +
    + Remove from My Faves +
    + {% else %} +
    + Add to My Faves +
    + {% endif %} +
    +
    +
    + Find on GoodReads + GoodReads +
    +
    + Find on LibraryThing + LibraryThing +
    +
    + +
    +
    + +
    +
    +
    +

    Comments

    + {% render_comment_list for work %} + {% if user.is_authenticated %} + {% render_comment_form for work %} + {% else %} +

    You must be logged in to comment.

    + {% endif %} +
    {% endwith %} -{% endwith %} {% endblock %} diff --git a/static/less/book_detail.less b/static/less/book_detail.less index e28f9d12..e94eb4d4 100644 --- a/static/less/book_detail.less +++ b/static/less/book_detail.less @@ -13,7 +13,7 @@ float: left; margin-right:10px; width:151px; - + img { .mediaborder; } @@ -47,7 +47,7 @@ font-weight:normal; color:@link-color; } - + > div { width:100%; clear:both; @@ -56,50 +56,46 @@ border-top:1px solid @pale-blue; padding:10px 0; } - + > div.layout { border: none; padding: 0; - + div.pubinfo { float: left; width: auto; padding-bottom: 7px; - } + } } - - .btn_wishlist span { - text-align: right; - } - + .find-book label { float:left; line-height:31px; } - + .find-link { float:right; - + img { padding: 2px; .one-border-radius(5px); } } - + .pledged-info { padding:10px 0; position: relative; - + &.noborder { border-top: none; padding-top: 0; } - + .campaign-status-info { float: left; width: 50%; margin-top: @font-size-default; - + span { font-size: @font-size-larger; color: @medium-blue; @@ -107,7 +103,7 @@ } } } - + .thermometer { .one-border-radius(10px); border: solid 2px @blue-grey; @@ -118,22 +114,22 @@ /* looks better if we start the gradient a little closer to the success color */ @greener-than-alert: #CF6944; - + background: -webkit-gradient(linear, left top, right top, from(@call-to-action), to(@greener-than-alert)); background: -webkit-linear-gradient(left, @greener-than-alert, @call-to-action); background: -moz-linear-gradient(left, @greener-than-alert, @call-to-action); background: -ms-linear-gradient(left, @greener-than-alert, @call-to-action); background: -o-linear-gradient(left, @greener-than-alert, @call-to-action); background: linear-gradient(left, @greener-than-alert, @call-to-action); - - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@alert', endColorstr='@call-to-action'); /* IE6 & IE7 */ - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='@alert', endColorstr='@call-to-action')"; /* IE8+ */ - + + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@alert', endColorstr='@call-to-action'); /* IE6 & IE7 */ + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='@alert', endColorstr='@call-to-action')"; /* IE8+ */ + &.successful { border-color: @bright-blue; background: @pale-blue; } - + .cover { position: absolute; right: 0; @@ -143,11 +139,11 @@ margin-top: -7px; background: lighten(@blue-grey, 10%); } - + span { display: none; } - + &:hover span { display: block; position: absolute; @@ -166,7 +162,7 @@ span.explanation{ display: none; } - + &:hover span.explanation { display: block; position: absolute; @@ -181,7 +177,7 @@ .one-border-radius(10px); padding: 5px; } - + } .status { position: absolute; @@ -190,5 +186,5 @@ height: 25px; margin-top: -12px; } - -} \ No newline at end of file + +} diff --git a/static/less/campaign2.less b/static/less/campaign2.less index b8639525..4c70be0d 100644 --- a/static/less/campaign2.less +++ b/static/less/campaign2.less @@ -24,7 +24,7 @@ border:none; margin:0; line-height: 16px; - + /* Bubble in upper left looks different depending on campaign status */ &.ACTIVE { background: @green; @@ -33,7 +33,7 @@ font-weight: normal; line-height: 20px; } - + &.No.campaign.yet { background: @orange; color: white; @@ -42,15 +42,15 @@ span { display: inline-block; vertical-align: middle; - + &.spacer { visibility: none; - } - + } + &.findtheungluers { cursor: pointer; } - } + } } } @@ -60,7 +60,7 @@ } #js-slide .jsmodule { - width: 660px !important; + width: 660px !important; } #js-search { @@ -74,14 +74,14 @@ text-align: left; font-weight: normal; font-size: @font-size-default; - + > li { margin-bottom: 14px; } .errorlist { - margin-top: 7px; - + margin-top: 7px; + li { width: auto; height: auto; @@ -98,7 +98,7 @@ width:470px; margin:0 10px; - div#content-block { + div#content-block { background: none; padding:0; } @@ -113,13 +113,13 @@ .add-wishlist, .add-wishlist-workpage, &.remove-wishlist-workpage, .remove-wishlist, &.on-wishlist, &.create-account { float: right; cursor: pointer; - + span { font-weight:normal; color:@text-blue; text-transform: none; padding-left:20px; - + &.on-wishlist { background:url("@{image-base}checkmark_small.png") left center no-repeat; cursor: default; @@ -138,15 +138,15 @@ /* Center - tabs and content below them */ div#content-block-content { padding-left: 5px; - + a { color: @medium-blue; } - + #tabs-1 img { .mediaborder; } - + #tabs-3 { margin-left: -5px; } @@ -154,15 +154,15 @@ div#content-block-content { .tabs-content { padding-right: 5px; - + iframe { .mediaborder; } - + form { margin-left: -5px; } - + .clearfix { margin-bottom: 10px; border-bottom: 2px solid @blue-grey; @@ -179,12 +179,12 @@ div#content-block-content { .work_supporter_avatar { float: left; margin-right: 5px; - + img { .one-border-radius(5px); } } - + .work_supporter_name { .height(50px); float: left; @@ -197,13 +197,13 @@ div#content-block-content { min-width: 235px; float: left; } -.show_supporter_contact_form +.show_supporter_contact_form { display:block; margin-left: 5px; float: right; } -.supporter_contact_form +.supporter_contact_form { display:none; margin-left: 5px; @@ -243,24 +243,24 @@ div#content-block-content { margin-left: -5px; } -.editions { +.editions { div { float:left; padding-bottom: 5px; margin-bottom: 5px; } - + .image { width: 60px; overflow: hidden; } - - .metadata { + + .metadata { display:block; overflow: hidden; margin-left: 5px; } - + a:hover { text-decoration: underline; } @@ -273,7 +273,7 @@ div#content-block-content { .show_more_edition { text-align: right; - + &:hover { text-decoration: underline; } @@ -283,7 +283,7 @@ div#content-block-content { display:none; clear: both; padding-bottom: 10px; - padding-left: 60px; + padding-left: 60px; } .more_ebooks { @@ -300,7 +300,7 @@ div#content-block-content { .add-wishlist, .on-wishlist, .create-account { float: none; } - + .on-wishlist { margin-left: 20px; } @@ -310,7 +310,7 @@ div#content-block-content { float:right; width:235px; margin-bottom: 20px; - + h3.jsmod-title { background:@medium-blue-grey; .one-border-radius(10px); @@ -320,7 +320,7 @@ div#content-block-content { font-size: @font-size-larger; margin:0 0 10px 0; color: white; - + span { padding:0; color:#fff; @@ -331,11 +331,11 @@ div#content-block-content { .jsmodule { margin-bottom:10px; - + a:hover { text-decoration: none; } - } + } } #pledge-rightcol { @@ -346,7 +346,7 @@ div#content-block-content { border:1px solid @blue-grey; .one-border-radius(10px); padding:10px; -} +} #widgetcode { display: none; @@ -366,18 +366,18 @@ ul.support li { &.last { border-bottom: none; } - + span { display:block; padding-right:10px; - &.menu-item-price { + &.menu-item-price { font-size: @font-size-header; float: left; display: inline; margin-bottom: 3px; } - + &.menu-item-desc { float: none; clear: both; @@ -386,7 +386,7 @@ ul.support li { line-height: @font-size-larger*1.3; } } - + &:hover { color: #fff; background:@call-to-action url("@{image-base}icons/pledgearrow-hover.png") 98% center no-repeat; @@ -417,7 +417,7 @@ ul.support li { margin: 20px auto; } -div#libtools { +div#libtools { border:1px solid @blue-grey; .one-border-radius(10px); padding:10px; @@ -436,4 +436,4 @@ div#libtools { input[type="submit"]{ margin-left: 4em; } -} \ No newline at end of file +} diff --git a/static/scss/bookview.scss b/static/scss/bookview.scss index a5116734..ff979b3c 100644 --- a/static/scss/bookview.scss +++ b/static/scss/bookview.scss @@ -1,3 +1,91 @@ * { - color: pink !important; -} \ No newline at end of file + // color: red !important; +} + +@media screen and (max-width: 480px) { + .wrapper { + display: grid; + grid-template-columns: fit-content 1fr 20%; + grid-template-rows: auto auto; + grid-template-areas: "bookImage bookImage bookImage" + "bookSidebar bookSidebar bookSidebar" + "bookDescription bookDescription bookDescription" + "bookComments bookComments bookComments"; + } + + .bookImage { + display: flex; + justify-content: center; + } + + .bookSidebar { + flex-direction: row; + } + + .book-sidebar-item { + flex: auto; + } + + .book-sidebar-item span { + display: none; + } + + .bookDownload { + flex: 100%; + } + + .bookDonate { + flex: 100%; + } +} + +@media screen and (min-width: 480px) { + .wrapper { + display: grid; + grid-template-columns: fit-content 1fr 20%; + grid-template-rows: auto auto; + grid-template-areas: "bookImage bookDescription bookSidebar" + "bookComments bookComments bookComments"; + margin-left: auto; + margin-right: auto; + max-width: 1000px; + } + + .bookDescription { + padding-right: 15px; + } + + .bookSidebar { + flex-direction: column; + } +} + +.bookImage { + grid-area: bookImage; +} + +.bookImage div { + float:right; +} + +.bookDescription { + grid-area: bookDescription; +} + +.bookSidebar { + display: flex; + grid-area: bookSidebar; +} + +.bookComments { + grid-area: bookComments; +} + +.btn_wishlist span{ + text-align: right; +} + +//TODO remove me +.btn_wishlist div{ + float: none; +} diff --git a/static/scss/global.scss b/static/scss/global.scss index c6b75c82..a60f6c5c 100644 --- a/static/scss/global.scss +++ b/static/scss/global.scss @@ -1,3 +1,3 @@ @import 'settings/settings'; @import 'foundation'; -@include foundation-everything; \ No newline at end of file +@include foundation-everything;