forked from pydanny/django-social-bookmarking
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add news templatetags: show_bookmarks_related based on content_type. Add BookmarkRelated model to share an url from a django model.
- Loading branch information
Showing
18 changed files
with
304 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Daniel Greenfeld <[email protected]> | ||
Daniel Greenfeld <[email protected]> | ||
Florent Messa <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
from django.contrib import admin | ||
from social_bookmarking.models import Bookmark | ||
from social_bookmarking.models import Bookmark, BookmarkRelated | ||
|
||
class BookmarkAdmin(admin.ModelAdmin): | ||
list_display = ('title', 'status') | ||
list_filter = ('title', 'status') | ||
search_fields = ('title', 'status') | ||
list_editable = ('status',) | ||
|
||
class BookmarkRelatedAdmin(admin.ModelAdmin): | ||
list_display = ('content_type', 'object_id', 'visits', 'bookmark') | ||
list_filter = ('content_type', ) | ||
|
||
admin.site.register(Bookmark, BookmarkAdmin) | ||
admin.site.register(BookmarkRelated, BookmarkRelatedAdmin) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
[{ | ||
"pk": 1, | ||
"model": "social_bookmarking.bookmark", | ||
"fields": { | ||
"status": 2, | ||
"description": "", | ||
"title": "del.icio.us", | ||
"url": "http://del.icio.us/post?url=%(url)s&title=%(title)s", | ||
"image": "delicious.png", | ||
"slug": "delicious", | ||
"js": "" | ||
} | ||
}, | ||
{ | ||
"pk": 2, | ||
"model": "social_bookmarking.bookmark", | ||
"fields": { | ||
"status": 2, | ||
"description": "", | ||
"title": "Diigo", | ||
"url": "https://secure.diigo.com/sign-in?referInfo=%(url)s&title=%(title)s", | ||
"image": "diigo.png", | ||
"slug": "diigo", | ||
"js": "" | ||
} | ||
}, | ||
{ | ||
"pk": 3, | ||
"model": "social_bookmarking.bookmark", | ||
"fields": { | ||
"status": 2, | ||
"description": "", | ||
"title": "Digg", | ||
"url": "http://digg.com/submit?phase=2&url=%(url)s&title=%(title)s", | ||
"image": "digg.png", | ||
"slug": "digg", | ||
"js": "" | ||
} | ||
}, | ||
{ | ||
"pk": 4, | ||
"model": "social_bookmarking.bookmark", | ||
"fields": { | ||
"status": 2, | ||
"description": "", | ||
"title": "Facebook", | ||
"url": "http://www.facebook.com/share.php?u=%(url)s&t=%(title)s", | ||
"image": "facebook.png", | ||
"slug": "facebook", | ||
"js": "" | ||
} | ||
}, | ||
{ | ||
"pk": 5, | ||
"model": "social_bookmarking.bookmark", | ||
"fields": { | ||
"status": 2, | ||
"description": "", | ||
"title": "Technorati", | ||
"url": "http://technorati.com/faves?add=%(url)s", | ||
"image": "technorati.png", | ||
"slug": "technorati", | ||
"js": "" | ||
} | ||
}, | ||
{ | ||
"pk": 6, | ||
"model": "social_bookmarking.bookmark", | ||
"fields": { | ||
"status": 2, | ||
"description": "", | ||
"title": "Twitter", | ||
"url": "http://twitter.com/home?status=%(title)s %(url)s", | ||
"image": "twitter.png", | ||
"slug": "twitter", | ||
"js": "" | ||
} | ||
}, | ||
{ | ||
"pk": 7, | ||
"model": "social_bookmarking.bookmark", | ||
"fields": { | ||
"status": 2, | ||
"description": "", | ||
"title": "Friendfeed", | ||
"url": "http://friendfeed.com/?url=%(url)s&title=%(title)s", | ||
"image": "friendfeed.png", | ||
"slug": "friendfeed", | ||
"js": "" | ||
} | ||
}, | ||
{ | ||
"pk": 8, | ||
"model": "social_bookmarking.bookmark", | ||
"fields": { | ||
"status": 2, | ||
"description": "", | ||
"title": "Wikio", | ||
"url": "http://www.wikio.fr/sharethis?url=%(url)s&title=%(title)s", | ||
"image": "wikio.png", | ||
"slug": "wikio", | ||
"js": "" | ||
} | ||
}] |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 19 additions & 15 deletions
34
social_bookmarking/templates/social_bookmarking/links.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
<div class="social-bookmarking"> | ||
Share: | ||
|
||
{% for bookmark in bookmarks %} | ||
<span class="bookmark" id="{{ bookmark.title|slugify }}"> | ||
{% if book.js %} | ||
<script type="javascript"> | ||
{{ bookmark.js|safe }} | ||
</script> | ||
{% endif %} | ||
<a href="{{ bookmark.link }}" title="{{ bookmark.title }}" rel="nofollow"> | ||
<img src="{{ MEDIA_URL }}social_bookmarking/img/{{ bookmark.image }}" width="16" height="16" alt="{{ bookmark.title }}" border="0" /> | ||
</a> | ||
</span> | ||
{% endfor %} | ||
|
||
{% if bookmarks %} | ||
<h2>Share</h2> | ||
<ul> | ||
{% for bookmark in bookmarks %} | ||
<li> | ||
<span class="bookmark {{ bookmark.slug }}"> | ||
{% if book.js %} | ||
<script type="javascript"> | ||
{{ bookmark.js|safe }} | ||
</script> | ||
{% endif %} | ||
<a href="{{ bookmark.link }}" title="{{ bookmark.title }}" rel="nofollow"> | ||
<img src="{{ MEDIA_URL }}social_bookmarking/img/{{ bookmark.image }}" width="16" height="16" alt="{{ bookmark.title }}" /> | ||
</a> | ||
</span> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
</div> |
Oops, something went wrong.