regluit/frontend/templates/supporter.html

413 lines
23 KiB
HTML
Raw Normal View History

2015-04-28 03:24:02 +00:00
{% extends 'base.html' %}
2016-05-11 14:41:50 +00:00
2018-04-20 01:25:12 +00:00
{% load el_pagination_tags %}
{% load truncatechars %}
2018-01-30 17:47:51 +00:00
{% load sass_tags %}
2016-05-11 14:41:50 +00:00
{% block title %} — {{ supporter.username }}{% endblock %}
{% block extra_css %}
2018-01-30 20:31:20 +00:00
<link type="text/css" rel="stylesheet" href="{% sass_src 'scss/supporter_layout.scss' %}" />
2018-01-30 17:47:51 +00:00
<link type="text/css" rel="stylesheet" href="{% sass_src 'scss/searchandbrowse2.scss' %}" />
2018-01-30 20:31:20 +00:00
<link type="text/css" rel="stylesheet" href="{% sass_src 'scss/book_list.scss' %}" />
2018-01-30 17:47:51 +00:00
<link type="text/css" rel="stylesheet" href="{% sass_src 'scss/book_panel2.scss' %}" />
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="/static/js/wishlist.js"></script>
2012-03-08 02:47:40 +00:00
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
<script type="text/javascript" src="/static/js/greenpanel.js"></script>
<script type="text/javascript" src="/static/js/import_books.js"></script>
<script type="text/javascript" src="/static/js/counter.js"></script>
{% ifequal supporter request.user %}
<!-- we only need to be able to toggle the profile edit area in this case -->
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function(){
if(window.location.hash!="#edit") {
$j('#user-block-hide').hide();
} else {
$j('#user-block-hide').css({"background": "#8dc63f"}).animate(
{backgroundColor: "white"}, 1500
);
}
$j('#edit_profile').click(function() {
2012-10-19 16:31:23 +00:00
$j("#user-block-hide").slideToggle(300);
});
$j('#profile_edit').click(function() {
$j("#user-block-hide").slideToggle(300);
});
});
</script>
{% endifequal %}
2013-12-14 18:24:29 +00:00
{% if slidelist %}
<!-- when the user's wishlist is empty, views.py gives us works for a slideshow -->
<script src="/static/js/slides.min.jquery.js"></script>
<script src="/static/js/slideshow.js"></script>
<!-- toggle to panelview instead of listview default so slideshow will look right -->
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function($) {
$('.listview').addClass("panelview").removeClass("listview");
});
</script>
{% else %}
<!-- we only need these when there's stuff on the user's wishlist -->
<script type="text/javascript" src="/static/js/toggle.js"></script>
<script type="text/javascript" src="/static/js/tabs.js"></script>
{% endif %}
<!-- highlight LT/GR add functions when people click on import divs -->
<script type="text/javascript">
var $j = jQuery.noConflict();
function highlightTarget(targetdiv) {
var target = $j(targetdiv);
target.css({"background": "#8dc63f"}).animate(
{backgroundColor: "white"}, 1500
);
};
</script>
{% endblock %}
{% block extra_head %}
<link rel="alternate" type="application/atom+xml" title="feed for books from {{ supporter }}'s ungluing list" href="feed" />
{% endblock %}
{% block topsection %}
<div id="locationhash">{{ activetab }}</div>
2013-10-17 16:44:47 +00:00
{% if supporter.library %}
2015-04-08 02:55:30 +00:00
<div class="launch_top pale">{{ supporter.library }} is a Library participating in Unglue.it. <a href="{% url 'join_library' supporter.library.id %}">Click here</a> to use {{ supporter.library }}'s books.
</div>
{% endif %}
<div id="js-topsection">
2011-10-14 05:29:23 +00:00
<div class="js-main">
<div class="js-topnews">
<div class="js-topnews1">
<div class="js-topnews2">
<div class="js-topnews3">
2013-03-10 01:25:47 +00:00
<div class="user-block" itemscope itemtype="http://schema.org/Person">
<div id="user-block1">
<div class="block-inner">
<img class="user-avatar" src="{{ supporter.profile.avatar_url }}" height="50" width="50" alt="Avatar for {{ supporter }}" title="Avatar" />
<span class="user-name">
2013-03-10 01:25:47 +00:00
<a href="#"><span itemprop="name">{{ supporter.username }}</span></a>
</span>
</div>
<span class="user-badges">
{% if supporter.profile.badges.all %}
{% for badge in supporter.profile.badges.all %}
2013-01-04 18:34:50 +00:00
<img src="{{ badge.path }}" alt="{{ badge.description }}" title="{{ badge.description }}" width="26" height="26" class="{{ badge.name }}" />
{% endfor %}
{% endif %}
</span>
</div>
<div class="user-block2">
<span class="user-short-info">
{% with supporter.profile.tagline as tagline %}{% if tagline %}{{ tagline }}{% else %}&nbsp;{% endif %}{% endwith %}
</span>
</div>
2011-12-15 15:28:23 +00:00
<div class="user-block3">
<div class="badges">
{% ifequal request.user supporter %}
<span class="rounded"><span class="blue tabs1" title="I've unglued {{ backed }} {% if backed == 1 %}book{% else %}books{% endif %}."><span class="hovertext">I've unglued&nbsp;</span>{{ backed }}</span></span>
<span class="rounded"><span class="orange tabs2" title="I'm supporting {{ backing }} {% if backing == 1 %}book{% else %}books{% endif %}."><span class="hovertext">I'm ungluing&nbsp;</span>{{ backing }}</span></span>
<span class="rounded"><span class="grey tabs3" title="I'm wishing for {{ wished }} {% if wished == 1 %}book{% else %}books{% endif %}."><span class="hovertext">I'm wishing for&nbsp;</span>{{ wished }}</span></span>
{% else %}
2012-10-01 13:47:32 +00:00
<span class="rounded"><span class="blue tabs1" title="{{ supporter }} has unglued {{ backed }} {% if backed == 1 %}book{% else %}books{% endif %}."><span class="hovertext">has unglued&nbsp;</span>{{ backed }}</span></span>
<span class="rounded"><span class="orange tabs2" title="{{ supporter }} is supporting {{ backing }} {% if backing == 1 %}book{% else %}books{% endif %}."><span class="hovertext">is ungluing&nbsp;</span>{{ backing }}</span></span>
<span class="rounded"><span class="grey tabs3" title="{{ supporter }} is wishing for {{ wished }} {% if wished == 1 %}book{% else %}books{% endif %}."><span class="hovertext">is wishing for&nbsp;</span>{{ wished }}</span></span>
{% endifequal %}
2011-12-15 15:28:23 +00:00
</div>
</div>
<div class="user-block4">
2017-03-05 04:00:19 +00:00
{% if request.user.is_authenticated %}
{% ifequal request.user supporter %}
<div id="edit_profile">
<img src="/static/images/header/icon-edit.png" alt="Edit Your Profile" title="Edit Your Profile" />
</div>
{% endifequal %}
<div class="social">
{% if supporter.profile.home_url %}
<a href="{{ supporter.profile.home_url }}" class="nounderline">
<img src="/static/images/supporter_icons/home_square.png" alt="{{ supporter }}'s homepage" title="{{ supporter }}'s Homepage" />
</a>
{% endif %}
{% if supporter.profile.facebook_id %}
<a href="https://www.facebook.com/{{supporter.profile.facebook_id}}" class="nounderline">
<img src="/static/images/supporter_icons/facebook_square.png" alt="{{ supporter }}'s Facebook" title="{{ supporter }}'s Facebook" />
</a>
{% endif %}
{% if supporter.profile.twitter_id %}
<a href="https://twitter.com/#!/{{ supporter.profile.twitter_id }}" class="nounderline">
<img src="/static/images/supporter_icons/twitter_square.png" alt="{{ supporter }}'s Twitter" title="{{ supporter }}'s Twitter" />
</a>
{% endif %}
{% if supporter.profile.goodreads_user_link %}
<a href="{{supporter.profile.goodreads_user_link}}" class="nounderline">
<img src="/static/images/supporter_icons/goodreads_square.png" alt="{{ supporter }}'s profile on GoodReads" title="{{ supporter }}'s page on GoodReads" />
</a>
{% endif %}
{% if supporter.profile.librarything_id %}
2017-07-27 14:33:13 +00:00
<a href="https://www.librarything.com/profile/{{ supporter.profile.librarything_id }}" class="nounderline">
2017-03-05 04:00:19 +00:00
<img src="/static/images/supporter_icons/librarything_square.png" alt="{{ supporter }}'s profile on LibraryThing" title="{{ supporter }}'s page on LibraryThing" />
</a>
{% endif %}
{% endif %}
</div>
</div>
</div>
{% ifequal supporter request.user %}
<div id="user-block-hide" class="user-block-hide">
2012-03-09 18:15:30 +00:00
<form method="POST" action="#">
{% csrf_token %}
2011-10-14 05:29:23 +00:00
<div class="block block1">
2013-03-15 01:42:00 +00:00
<div class="block-inner">
{{ profile_form.avatar_source.errors }}
2013-03-28 01:46:52 +00:00
Your profile pic: {{ profile_form.avatar_source }} {% ifequal supporter.profile.avatar_source 1 %} <br /><a href="http://en.gravatar.com/">Set your Gravatar</a><br /><br />{% endifequal %}
2013-03-15 01:42:00 +00:00
</div>
<div class="block-inner">
2013-03-18 18:56:27 +00:00
<p>Your Tagline</p>
{{ profile_form.tagline.errors }}
{{ profile_form.tagline }}<br />
<span id="count_display">140</span> characters remaining<br /><br />
</div>
<input class="profile-save" type="submit" name="submit" value="Update" id="submit">
</div>
<div class="block block2">
2013-03-18 18:56:27 +00:00
<h3 class="title">Your Links</h3>
2011-10-14 05:29:23 +00:00
<div class="check-list">
<label> {% if supporter.profile.home_url %}Change{% else %}Add{% endif %} your homepage URL:</label>
{{ profile_form.home_url }}{{ profile_form.home_url.errors }}
</div>
<div class="check-list">
{% if supporter.profile.twitter_id %}
2015-04-09 15:44:48 +00:00
<a href="{% url 'social:begin' backend='twitter' %}?next=/">Update your Twitter connection</a> <br /> or disconnect Twitter: {{ profile_form.clear_twitter }}
{% else %}
2015-04-09 15:44:48 +00:00
<a href="{% url 'social:begin' backend='twitter' %}?next=/">Connect your Twitter account</a> to Unglue.it
{% endif %}
</div>
2011-11-12 18:58:31 +00:00
<div class="check-list">
{% if supporter.profile.facebook_id %}
2015-04-09 15:44:48 +00:00
<a href="{% url 'social:begin' backend='facebook' %}?next=/">Update your Facebook connection</a> <br /> or disconnect Facebook: {{ profile_form.clear_facebook }}
{% else %}
2015-04-09 15:44:48 +00:00
<a href="{% url 'social:begin' backend='facebook' %}?next=/">Connect your Facebook account</a> to Unglue.it
{% endif %}
</div>
<div class="check-list" id="connectgr">
{% if user.profile.goodreads_user_id %}
2015-04-08 02:55:30 +00:00
<a href="{% url 'goodreads_auth' %}">Update your GoodReads connection</a> <br /> or disconnect GoodReads: {{ profile_form.clear_goodreads }}
2011-11-12 18:58:31 +00:00
{% else %}
2015-04-08 02:55:30 +00:00
<a href="{% url 'goodreads_auth' %}">Connect your GoodReads account</a> to Unglue.it
2011-11-12 18:58:31 +00:00
{% endif %}
</div>
<div class="check-list" id="connectlt">
<label>{% if supporter.profile.librarything_id %}Change{% else %}Add{% endif %} your LibraryThing User ID:</label>
{{ profile_form.librarything_id }}{{ profile_form.librarything_id.errors }}
</div>
</div>
</form>
<div class="block block3">
<h3 class="title">Import your books</h3>
2013-10-17 16:44:47 +00:00
{% if request.user.profile.goodreads_user_id %}
<form id="load_shelf_form" method="post" action="#">
{% csrf_token %}
<div class="fieldWrapper">
<div id="loadgr"><span><span id="goodreads_shelves"></span><input id="goodreads_input" type="submit" value="Select your GoodReads shelves" /></span>
</div>
</div>
</form>
{% else %}
<div id="loadgr" onclick="highlightTarget('#connectgr'); return false;"><div>Connect your GoodReads account to import from GoodReads.</div></div>
{% endif %}
2013-10-17 16:44:47 +00:00
{% if request.user.profile.librarything_id %}
<form id="librarything_load" method="post" action="#">
{% csrf_token %}
<div id="loadlt"><input type="submit" id="librarything_input" value="Add your LibraryThing library" /></div>
</form>
{% else %}
<div id="loadlt" onclick="highlightTarget('#connectlt'); return false;"><div>Add your LibraryThing ID to import from LibraryThing.</div></div>
{% endif %}
<h3 class="title">More</h3>
2015-04-08 02:55:30 +00:00
<a href="{% url 'marc_config' %}">Librarian Settings</a>
</div>
</div>
{% endifequal %}
</div>
</div>
</div>
</div>
</div>
</div>
2011-09-29 11:44:03 +00:00
{% endblock %}
{% block content %}
<div id="main-container">
<div class="js-main">
<div id="js-leftcol">
{% include "explore.html" %}
</div>
<div id="js-maincol-fr">
<div class="js-maincol-inner">
<div id="content-block">
2012-05-01 13:56:19 +00:00
{% if not works %}
{% comment %}
if we're in empty-wishlist, slideshow mode, suppress tab area
{% endcomment %}
2011-12-14 21:49:36 +00:00
<div class="content-block-heading wantto" id="tabs">
2011-10-14 05:29:23 +00:00
<ul class="tabs">
<li class="tabs1"><a href="#">Unglued</a></li>
<li class="tabs2"><a href="#">Active</a></li>
<li class="tabs3"><a href="#">Not Yet</a></li>
</ul>
2012-05-01 13:56:19 +00:00
2011-09-29 02:02:33 +00:00
<ul class="book-list-view">
<li>View As:</li>
<li class="view-list">
<a href="#" id="toggle-list">
<img src="/static/images/booklist/view-list.png" alt="view list" title="view list" />
2011-09-29 02:02:33 +00:00
</a>
</li>
<li class="view-list">
<a href="#" id="toggle-panel">
<img src="/static/images/booklist/view-icon.png" alt="view icon" title="view icon" />
2011-09-29 02:02:33 +00:00
</a>
</li>
</ul>
</div>
2012-05-01 13:56:19 +00:00
{% endif %}
<div id="content-block-content">
{% ifequal wishlist.works.all.count 0 %}
2012-02-29 17:13:29 +00:00
{% ifequal request.user supporter %}
<div class="empty-wishlist">
<div><h2 style="padding-left:35px;">Add a book to your list to get started.</h2><br /><br /></div>
<div id="js-slide">
<div class="js-main">
<div class="jsmodule">
{% include "slideshow.html" %}
</div>
</div>
</div>
<div id="js-maincontainer-bot-block">
<div id="js-search">
2015-05-06 20:14:13 +00:00
<label>Search and add free-licenced books! </label>
2015-04-08 02:55:30 +00:00
<form action="{% url 'search' %}" method="get">
2015-05-06 20:14:13 +00:00
<input type="text" onfocus="imgfocus()" onblur="imgblur(0)" size="25" class="inputbox" name="q" value="{{ q }}">
<input type="submit" class="greenbutton" value="Search">
</form>
</div>
</div>
2015-08-18 15:03:49 +00:00
<br /><br /><hr />We'd also love to hear your <a href="{% url 'feedback' %}?page={{request.build_absolute_uri|urlencode:""}}">feedback</a>.
2012-02-29 17:13:29 +00:00
</div>
{% else %}
<div class="empty-wishlist">
It looks like {{ supporter.username }} is just getting started, and hasn't added books just yet.<br /><br />
{% endifequal %}
{% else %}
{% if request.user.is_anonymous %}
<div class="tabs-1 anon_about">
{% if works_unglued %}
2013-08-20 16:41:39 +00:00
{{ supporter }} wants you to know about these free books. <a href="/about/unglued/" class="hijax">Find out why.</a>
{% else %}
2013-08-20 16:41:39 +00:00
{{ supporter }} isn't promoting any free books yet. <a href="/about/unglued_empty/" class="hijax">Find out how you can.</a>
{% endif %}
</div>
<div class="tabs-2 anon_about">
{% if works_active %}
2013-08-20 16:41:39 +00:00
{{ supporter }} is helping to make these books free. <a href="/about/active/" class="hijax">Find out how.</a>
{% else %}
2013-08-20 16:41:39 +00:00
{{ supporter }} isn't ungluing books at the moment. <a href="/about/active_empty" class="hijax">Find out how you can.</a>
{% endif %}
</div>
<div class="tabs-3 anon_about">
{% if works_wished %}
{{ supporter }} wants these books to be free. <a href="/about/wishlist/" class="hijax">Find out how to help.</a>
{% else %}
{{ supporter }} hasn't decided which books to give the world yet. <a href="/about/wishlist_empty/" class="hijax">Learn more.</a>
{% endif %}
</div>
{% endif %}
{% lazy_paginate 20 works_unglued using "works_unglued" %}
{% for work in works_unglued %}
<div class="{% cycle 'row1' 'row2' %}">
{% with work.googlebooks_id as googlebooks_id %}
{% include "book_panel.html" %}
2013-03-11 20:23:52 +00:00
{% endwith %}
</div>
{% endfor %}
<div class="pagination content-block-heading tabs-1">
{% get_pages %}
{% for page in pages %}
<a href="{{ page.path }}#1" class="endless_page_link">{{ page.number }}</a>
{% endfor %}
</div>
{% lazy_paginate 20 works_active using "works_active" %}
{% for work in works_active %}
<div class="{% cycle 'row1' 'row2' %}">
{% with work.googlebooks_id as googlebooks_id %}{% with 'tabs-2' as tab_override %}
{% include "book_panel.html" %}
{% endwith %}{% endwith %}
</div>
2011-09-29 02:02:33 +00:00
{% endfor %}
<div class="pagination content-block-heading tabs-2">
{% get_pages %}
{% for page in pages %}
<a href="{{ page.path }}#2" class="endless_page_link">{{ page.number }}</a>
{% endfor %}
</div>
{% lazy_paginate 20 works_wished using "works_wished" %}
{% for work in works_wished %}
<div class="{% cycle 'row1' 'row2' %}">
{% with work.googlebooks_id as googlebooks_id %}
{% include "book_panel.html" %}
2013-03-11 20:23:52 +00:00
{% endwith %}
</div>
{% endfor %}
<div class="pagination content-block-heading tabs-3">
{% get_pages %}
{% for page in pages %}
<a href="{{ page.path }}#3" class="endless_page_link">{{ page.number }}</a>
{% endfor %}
</div>
{% endifequal %}
</div>
2011-09-29 02:02:33 +00:00
</div>
2014-10-27 15:55:46 +00:00
{% if request.user.libpref %}
<div id="libtools">
<p>for libraries...</p>
{% block marcform %}
2015-04-08 02:55:30 +00:00
<form method="GET" action="{% url 'user_marc' supporter.username %}">
2014-10-27 15:55:46 +00:00
{% include 'marc_form.html' %}
<input type="submit" name="submit" value="download MARC for {{supporter.username}} " id="submit">
</form>
{% endblock %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}