list of unlguit libraries at libraryauth/list/

pull/1/head
eric 2013-10-12 22:39:47 -04:00
parent 13b4a028f1
commit b1d8b2338a
5 changed files with 150 additions and 2 deletions

View File

@ -0,0 +1,72 @@
{% extends "base.html" %}
{% block title %} Comments {% endblock %}
{% block extra_css %}
<link type="text/css" rel="stylesheet" href="/static/css/supporter_layout.css" />
<link type="text/css" rel="stylesheet" href="/static/css/liblist.css" />
{% endblock %}
{% block extra_head %}
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
{% endblock %}
{% block topsection %}
<div id="js-topsection">
<div class="js-main">
<div class="js-topnews">
<div class="js-topnews1">
<div class="js-topnews2">
<div class="js-topnews3">
<div class="user-block">
<div id="user-block1">
<div id="block-intro-text"><span class="special-user-name">Unglue.it Libraries</span></div>
</div>
<div class="user-block24"><span class="user-short-info">These libraries are participating in Unglue.it. If one of these is your library, you should be able to join, borrow and donate books. If your library is not on this list, contact your librarian and have them check out our <a href="{% url libraries %}">libraries FAQ</a>.</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% 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">
<div id="content-block-content">
<div style="height:46px;"></div>
{% for library in libraries %}
<div class="items {% cycle 'row1' 'row2' %}{% if library.group in request.user.groups.all %} joined{% endif %}">
<div class="avatar">
<a href="{% url library library %}">
<img class="user-avatar" src="{{ library.user.profile.avatar_url }}" height="50" width="50" alt="Avatar for {{ library }}" title="{{ library }}" />
</a>
</div>
<div class="nonavatar">
<div class="libname"><a href="{% url library library %}">{{ library }}</a> {{ library.user.tagline }}</div>
<div class="libstat">{% if library.group in request.user.groups.all %}<em>joined</em>{% else %}&nbsp;{% endif %}</div>
<div class="libstat">{{ library.library_users.count }} Unglue.it users</div>
<div class="libstat">{{ library.user.acqs.count }} Unglue.it holdings</div>
<div class="libstat">{{ library.user.wishlist.works.count }} books on list</div>
</div>
</div>
{% empty %}
No libraries yet.
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -644,7 +644,7 @@
<span class="menu-item-desc">{{ work.last_campaign.library_offer.get_license_display }}</span>
</a>
{% else %}
<a href="something"><span class="menu-item-desc">
<a href="{% url library_list %}"><span class="menu-item-desc">
Join a Library to share and borrow unglue.it ebooks
</span></a>
{% endif %}

View File

@ -1,11 +1,15 @@
from django.conf.urls.defaults import *
from django.core.urlresolvers import reverse
from django.views.generic.simple import direct_to_template
from . import views
from . import views, models
urlpatterns = patterns(
"",
url(r"^libraryauth/(?P<library>[^/]+)/join/$", views.join_library, name="join_library"),
url(r"^libraryauth/(?P<library>[^/]+)/deny/$", direct_to_template, {'template':'libraryauth/denied.html'}, name="bad_library"),
url(r"^libraryauth/list/$", direct_to_template, {
'template':'libraryauth/list.html',
'extra_context':{'libraries':models.Library.objects.order_by('user__username')}
}, name="library_list"),
url(r'^accounts/superlogin/$', views.superlogin, name='superlogin'),
)

1
static/css/liblist.css Normal file
View File

@ -0,0 +1 @@
.header-text{height:36px;line-height:36px;display:block;text-decoration:none;font-weight:bold;letter-spacing:-0.05em}.panelborders{border-width:1px 0;border-style:solid none;border-color:#fff}.roundedspan{border:1px solid #d4d4d4;-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px;padding:1px;color:#fff;margin:0 8px 0 0;display:inline-block}.roundedspan>span{padding:7px 7px;min-width:15px;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;text-align:center;display:inline-block}.roundedspan>span .hovertext{display:none}.roundedspan>span:hover .hovertext{display:inline}.mediaborder{padding:5px;border:solid 5px #edf3f4}.actionbuttons{width:auto;height:36px;line-height:36px;background:#8dc63f;-moz-border-radius:32px;-webkit-border-radius:32px;border-radius:32px;color:white;cursor:pointer;font-size:13px;font-weight:bold;padding:0 15px;border:0;margin:5px 0}.errors{-moz-border-radius:16px;-webkit-border-radius:16px;border-radius:16px;border:solid #e35351 3px;clear:both;width:90%;height:auto;line-height:16px;padding:7px 0;font-weight:bold;font-size:13px;text-align:center}.errors li{list-style:none;border:0}.items{clear:both;padding:5px;margin:0 5px 8px 0;width:95%}.items.row1{background:#f6f9f9}.items.row2{background:#fff}.items div{float:left}.items div img{margin:0 5px}.items .image img{height:100px}.items:after{content:".";display:block;height:0;clear:both;visibility:hidden}.items .nonavatar{width:620px;padding-top:5px}.items .nonavatar span{padding-right:5px}.items .nonavatar div.libname{width:100%}.items .nonavatar div.libname a{font-size:15px}.items .nonavatar div.libstat{width:25%;display:block}.items .avatar{float:left;margin:0 auto;padding-top:5px}.joined{border:3px #b8dde0 solid;margin-top:3px;margin-bottom:5px;padding-left:2px}.joined em{font-color:#b8dde0;font-style:italic}

71
static/less/liblist.less Normal file
View File

@ -0,0 +1,71 @@
@import "variables.less";
.items {
clear: both;
padding: 5px;
margin: 0 5px 8px 0;
//min-height: 105px;
width: 95%;
&.row1 {
background: #f6f9f9;
}
&.row2 {
background: #fff;
}
div {
float: left;
img {
margin: 0 5px;
}
}
.image img {
height: 100px;
}
// so div will stretch to height of content
&:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.nonavatar {
width: 620px;
padding-top: 5px;
span {
padding-right: 5px;
}
div.libname{
width: 100%;
a{
font-size: @font-size-larger;
}
}
div.libstat {
width:25%;
display: block;
}
}
.avatar {
float: left;
margin: 0 auto;
padding-top: 5px;
}
}
.joined {
border: 3px #B8DDE0 solid;
margin-top: 3px;
margin-bottom: 5px;
padding-left: 2px;
em {
font-color:#B8DDE0;
font-style:italic;
}
}