merge from trunk

This commit is contained in:
Charles Haley 2010-10-14 21:38:49 +01:00
commit 264c7948b2
5 changed files with 32 additions and 22 deletions

View File

@ -190,6 +190,10 @@ h2.library_name {
padding: 0.75em;
text-align: center;
cursor: pointer;
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
}
.toplevel li:hover {
@ -206,30 +210,38 @@ h2.library_name {
/* }}} */
/* Category {{{ */
.category ul {
list-style-type: none;
margin: 0;
padding: 0;
.category > div.category-container {
width: 100%;
margin-top: 1ex;
margin-bottom: 1ex;
display: table;
}
.category li.category-item {
margin: 0.75em;
.category div.category-item {
display: table-row;
}
.category div.category-item > div {
padding: 0.75em;
text-align: center;
cursor: pointer;
display: table-cell;
}
.category li.category-item:hover {
.category div.category-name { font-weight: bold }
.category div.category-item:hover > div {
background-color: #d6d3c9;
font-weight: bold;
-moz-box-shadow: 5px 5px 5px #ccc;
-webkit-box-shadow: 5px 5px 5px #ccc;
box-shadow: 5px 5px 5px #ccc;
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
}
.category li.category-item h4 { display: inline }
.category li.category-item span.href { display: none }
.category div.category-item span.href { display: none }
#groups span.load_href { display: none }

View File

@ -77,8 +77,6 @@ function init() {
function toplevel() {
$(".sort_select").hide();
$(".toplevel li").corner("15px");
$(".toplevel li").click(function() {
var href = $(this).children("span").html();
window.location = href;
@ -92,10 +90,8 @@ function render_error(msg) {
// Category feed {{{
function category() {
$(".category li").corner("15px");
$(".category li").click(function() {
var href = $(this).children("span.href").html();
$(".category .category-item").click(function() {
var href = $(this).find("span.href").html();
window.location = href;
});

View File

@ -84,6 +84,7 @@ class TagsView(QTreeView): # {{{
self.setAcceptDrops(True)
self.setDragDropMode(self.DropOnly)
self.setDropIndicatorShown(True)
self.setAutoExpandDelay(500)
def set_database(self, db, tag_match, sort_by):
self.hidden_categories = config['tag_browser_hidden_categories']

View File

@ -106,9 +106,10 @@ def render_rating(rating, container='span'): # {{{
def get_category_items(category, items, db, datatype): # {{{
def item(i):
templ = (u'<li title="{4}" class="category-item">'
'<h4>{0}&nbsp;&nbsp;{1}</h4>&nbsp;&nbsp;{2}'
'<span class="href">{3}</span></li>')
templ = (u'<div title="{4}" class="category-item">'
'<div class="category-name">{0}</div><div>{1}</div>'
'<div>{2}'
'<span class="href">{3}</span></div></div>')
rating, rstring = render_rating(i.avg_rating)
name = xml(i.name)
if datatype == 'rating':
@ -125,7 +126,7 @@ def get_category_items(category, items, db, datatype): # {{{
xml(desc), xml(quote(href)), rstring)
items = list(map(item, items))
return '\n'.join(['<ul>'] + items + ['</ul>'])
return '\n'.join(['<div class="category-container">'] + items + ['</div>'])
# }}}