Author: gregoryjnewman
Date: Sat Sep 27 15:25:21 2008
New Revision: 964
Modified:
trunk/pinax/templates/base.html
trunk/pinax/templates/tags/index.html
Log:
adding bookmarks to tags page
Modified: trunk/pinax/templates/base.html
==============================================================================
--- trunk/pinax/templates/base.html (original)
+++ trunk/pinax/templates/base.html Sat Sep 27 15:25:21 2008
@@ -1,4 +1,6 @@
-{% load i18n %}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+{% load i18n %}
+{% load tag_helper %}
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{% if
LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}" xml:lang="{{ LANGUAGE_CODE }}"
lang="{{ LANGUAGE_CODE }}">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8"/>
@@ -8,7 +10,7 @@
zoom: 1; /* trigger hasLayout */
}
</style><![endif]-->
- <link rel="stylesheet" href="/site_media/base.css?743" />
+ {% css_tag "base" %}
{% if LANGUAGE_BIDI %}
<style type="text/css" media="screen">
div.right_panel {
@@ -58,7 +60,7 @@
<div id="footer">{% block footer %}{% endblock %}</div>
- <script src="/site_media/jquery.js"
type="text/javascript"></script>
+ {% js_tag "jquery.js" %}
<script src="/site_media/base.js" type="text/javascript"></script>
{% load analytics %}
{% urchin %}
Modified: trunk/pinax/templates/tags/index.html
==============================================================================
--- trunk/pinax/templates/tags/index.html (original)
+++ trunk/pinax/templates/tags/index.html Sat Sep 27 15:25:21 2008
@@ -4,9 +4,16 @@
{% load threadedcommentstags %}
{% load tribe_tags %}
+{% load gravatar %}
{% load project_tags %}
{% load blog_tags %}
{% load wiki %}
+{% load voting_tags %}
+{% load extra_voting_tags %}
+
+{% load in_filter %}
+{% load extra_tagging_tags %}
+
{% block head_title %}{% blocktrans %}Tags{% endblocktrans %}{% endblock %}
@@ -31,6 +38,34 @@
No photos matching tag.
{% endif %}
+ {% if bookmarktags %}
+ {% scores_for_objects bookmarktags as score_dict %}
+
+ <h1>All Bookmarks Matching <i>{{ tag }}</i></h1>
+ <table class="bookmarks" width="100%">
+ {% for bookmark in bookmarktags %}
+ <tr class="{% cycle odd,even %}">
+ <td class="meta">
+ <div class="avatar">{% gravatar
bookmark.bookmark.adder 40 %}</div>
+ <div class="details"><a href="{% url
profiles.views.profile bookmark.bookmark.adder.username %}">{{
bookmark.bookmark.adder }}</a></div>
+ {{ bookmark.bookmark.added|date }}
+ </td>
+
+ <td>
+ <h2><a href="{{ bookmark.bookmark.url }}">{{
bookmark.bookmark.description }}</a></h2>
+ <div class="url">{% if
bookmark.bookmark.get_favicon_url %}<img src="{{
bookmark.bookmark.get_favicon_url }}" width="16" height="16" /> {%
endif %}{{ bookmark.bookmark.url }}</div>
+ <div class="body">{{ bookmark.bookmark.note|
linebreaks }}</div>
+ <div class="tags">{% show_tag_counts
bookmark.bookmark.all_tags_with_counts %}</div>
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+
+ {% else %}
+ No bookmarks matching tag.
+ {% endif %}
+
+
<h1>{% trans "All Blog Posts Matching " %}<i>"{{ tag }}"</i></h1>
{% if alltags %}
@@ -85,4 +120,29 @@
</table>
+{% endblock %}
+
+
+{% block extra_body %}
+ <script>
+ function vote(bookmark_id, direction) {
+ $.post(bookmark_id + '/' + direction + 'vote/', function(data)
{
+ var jsonResult = eval('(' + data + ')');
+ var new_score = jsonResult.score.score;
+ $('#bookmark_' + bookmark_id + '_score').text(new_score
+ ' point' + (new_score == 1 ? '': 's'));
+ });
+ if (direction == 'up') {
+ $('#up_' + bookmark_id).replaceWith('<a id="up_' +
bookmark_id + '" href="#" onclick="return false;"><img
src="/site_media/up_mod.png"/>');
+ $('#down_' + bookmark_id).replaceWith('<a id="down_' +
bookmark_id + '" href="#" onclick="vote(' + bookmark_id + ', \'clear\');
return false;"><img src="/site_media/down_grey.png"/>');
+ }
+ else if (direction == 'down') {
+ $('#up_' + bookmark_id).replaceWith('<a id="up_' +
bookmark_id + '" href="#" onclick="vote(' + bookmark_id + ', \'clear\');
return false;"><img src="/site_media/up_grey.png"/>');
+ $('#down_' + bookmark_id).replaceWith('<a id="down_' +
bookmark_id + '" href="#" onclick="return false;"><img
src="/site_media/down_mod.png"/>');
+ }
+ else { // clear
+ $('#up_' + bookmark_id).replaceWith('<a id="up_' +
bookmark_id + '" href="#" onclick="vote(' + bookmark_id + ', \'up\');
return false;"><img src="/site_media/up_grey.png"/>');
+ $('#down_' + bookmark_id).replaceWith('<a id="down_' +
bookmark_id + '" href="#" onclick="vote(' + bookmark_id + ', \'down\');
return false;"><img src="/site_media/down_grey.png"/>');
+ }
+ }
+ </script>
{% endblock %}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---