Index: /lang/python/every_resources/trunk/everes_theme_default/templates/static/styles/basic.css
===================================================================
--- /lang/python/every_resources/trunk/everes_theme_default/templates/static/styles/basic.css (revision 30091)
+++ /lang/python/every_resources/trunk/everes_theme_default/templates/static/styles/basic.css (revision 31795)
@@ -279,4 +279,5 @@
 
 div.bookmark h2.cms_title:before { content: '[Bookmark]'; color: #AAAAFF; margin-left: 1em;}
+div.diigobookmark h2.cms_title:before { content: '[Bookmark]'; color: #AAAAFF; margin-left: 1em;}
 div.event h2.cms_title:before { content: '[Event]'; color: #AAFFFF; margin-left: 1em;}
 div.release h2.cms_title:before { content: '[Release]'; color: #FFFFAA; margin-left: 1em;}
Index: /lang/python/every_resources/trunk/settings.py
===================================================================
--- /lang/python/every_resources/trunk/settings.py (revision 30091)
+++ /lang/python/every_resources/trunk/settings.py (revision 31795)
@@ -90,4 +90,5 @@
     'django.contrib.markup',
     'django.contrib.flatpages',
+    'django.contrib.admindocs',
     'everes_core',
     'everes_functional_workflow',
@@ -95,4 +96,5 @@
     'everes_blog',
     'everes_event',
+    'everes_diigo',
     'everes_magnolia',
     'everes_photo',
Index: /lang/python/every_resources/trunk/everes_core/admin.py
===================================================================
--- /lang/python/every_resources/trunk/everes_core/admin.py (revision 27555)
+++ /lang/python/every_resources/trunk/everes_core/admin.py (revision 31795)
@@ -212,4 +212,7 @@
 
 class EveresAdmin(RowLevelAdmin):
+    list_display = ('title', 'published_from','author',)
+    list_filter = ('published', 'author',)
+    date_hierarchy = 'published_from'
     form = LocationForm
     search_fields = ('title', 'summary',)
Index: /lang/python/every_resources/trunk/everes_diigo/admin.py
===================================================================
--- /lang/python/every_resources/trunk/everes_diigo/admin.py (revision 31795)
+++ /lang/python/every_resources/trunk/everes_diigo/admin.py (revision 31795)
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2008 Makoto Tsuyuki All rights reserved
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#
+#  2. Redistributions in binary form must reproduce the above
+#     copyright notice, this list of conditions and the following
+#     disclaimer in the documentation and/or other materials provided
+#     with the distribution.
+#
+#  3. Neither the name of the authors nor the names of its contributors
+#     may be used to endorse or promote products derived from this
+#     software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+from django.contrib import admin
+from everes_core.admin import EveresAdmin
+
+from everes_core.admin import EveresAdmin, LocationForm, RowLevelAdmin
+from models import DiigoBookmark, DiigoUser
+
+class DiigoBookmarkLocationForm(LocationForm):
+    class Meta:
+        model = DiigoBookmark
+
+class DiigoBookmarkAdmin(EveresAdmin):
+    form = DiigoBookmarkLocationForm
+    filter_horizontal = ('tags', 'related_item')
+    fieldsets = EveresAdmin.fieldsets[::] + (
+        ('Basic Meta Info', {
+            'fields': ('url', )
+        }),
+    )
+
+class DiigoUserAdmin(RowLevelAdmin):
+    def get_user_field_name(self):
+        return 'user'
+
+admin.site.register(DiigoBookmark, DiigoBookmarkAdmin)
+admin.site.register(DiigoUser, DiigoUserAdmin)
Index: /lang/python/every_resources/trunk/everes_diigo/views.py
===================================================================
--- /lang/python/every_resources/trunk/everes_diigo/views.py (revision 31795)
+++ /lang/python/every_resources/trunk/everes_diigo/views.py (revision 31795)
@@ -0,0 +1,1 @@
+# Create your views here.
Index: /lang/python/every_resources/trunk/everes_diigo/__init__.py
===================================================================
--- /lang/python/every_resources/trunk/everes_diigo/__init__.py (revision 31795)
+++ /lang/python/every_resources/trunk/everes_diigo/__init__.py (revision 31795)
@@ -0,0 +1,7 @@
+#from everes_core import INFO_DICT
+from models import DiigoBookmark
+
+INFO_DICT = dict(date_field='published_from', month_format='%m')
+APP_DICT = INFO_DICT.copy()
+APP_DICT.update(queryset=DiigoBookmark.public_objects.all())
+USE_SLUG = False
Index: /lang/python/every_resources/trunk/everes_diigo/utils.py
===================================================================
--- /lang/python/every_resources/trunk/everes_diigo/utils.py (revision 31795)
+++ /lang/python/every_resources/trunk/everes_diigo/utils.py (revision 31795)
@@ -0,0 +1,90 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2008 Makoto Tsuyuki All rights reserved
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#
+#  2. Redistributions in binary form must reproduce the above
+#     copyright notice, this list of conditions and the following
+#     disclaimer in the documentation and/or other materials provided
+#     with the distribution.
+#
+#  3. Neither the name of the authors nor the names of its contributors
+#     may be used to endorse or promote products derived from this
+#     software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+import pydiigo
+from django.conf import settings
+from datetime import datetime, timedelta
+import time
+import string
+
+from everes_core.models import Tag
+from models import DiigoUser, DiigoBookmark
+
+_YMDHIS_LENGTH = 19
+
+def _get_time_from_diigo_datetime(str):
+    """
+    >>> test_str = '2009/03/04 02:57:09 +0000'
+    >>> result_date = _get_time_from_diigo_datetime(test_str)
+    >>> assert result_date.year == 2009
+    >>> assert result_date.month == 3
+    >>> assert result_date.day == 4
+    >>> assert result_date.hour == 2
+    >>> assert result_date.minute == 57
+    >>> assert result_date.second == 9
+    """
+    if len(str) < _YMDHIS_LENGTH:
+        return None
+    d = datetime(*(time.strptime(str[:_YMDHIS_LENGTH], '%Y/%m/%d %H:%M:%S')[:6]))
+    if len(str) == _YMDHIS_LENGTH + 6:
+        h_dlt = timedelta(hours=int(str[-6] + str[-5:-3]))
+        m_dlt = timedelta(minutes=int(str[-6] + str[-2:]))
+        d = d - h_dlt - m_dlt
+    return d
+        
+
+def update_feeds():
+    n = datetime.now()
+    delta = timedelta(1)
+    date_from = n - delta
+    
+    for du in DiigoUser.objects.all():
+        api = pydiigo.DiigoApi(user=du.username, password=du.password)
+        
+        bms = api.bookmarks_find(users=du.username)
+        exist_tags = {}
+        for bm in bms:
+            create_datetime = _get_time_from_diigo_datetime(bm.created_at)
+            update_datetime = _get_time_from_diigo_datetime(bm.updated_at)
+            db_bm, created = DiigoBookmark.objects.get_or_create(url=bm.url,
+                              defaults={'title': bm.title,
+                                        'summary': bm.desc,
+                                        'create_date': create_datetime,
+                                        'update_date': update_datetime,
+                                        'published_from': create_datetime,
+                                        'author': du.user})
+            db_bm.tags.all().delete()
+            for tag in bm.tags.split(','):
+                if len(tag.strip()) > 0:
+                    t, created = Tag.objects.get_or_create(name__iexact=tag.strip(), defaults={'name': tag.strip(),'author': du.user, 'view_at_front': False})
+                    db_bm.tags.add(t)
+            db_bm.save()
Index: /lang/python/every_resources/trunk/everes_diigo/models.py
===================================================================
--- /lang/python/every_resources/trunk/everes_diigo/models.py (revision 31795)
+++ /lang/python/every_resources/trunk/everes_diigo/models.py (revision 31795)
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2008 Makoto Tsuyuki All rights reserved
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#
+#  2. Redistributions in binary form must reproduce the above
+#     copyright notice, this list of conditions and the following
+#     disclaimer in the documentation and/or other materials provided
+#     with the distribution.
+#
+#  3. Neither the name of the authors nor the names of its contributors
+#     may be used to endorse or promote products derived from this
+#     software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+from django.db import models
+from django.contrib.auth.models import User
+from django.utils.translation import ugettext_lazy as _
+
+from everes_core import models as cms_models
+
+MAGNOLIA_RANK = ((0,0),(1,1),(2,2),(3,3),(4,4),(5,5),)
+
+class DiigoUser(models.Model):
+    user = models.ForeignKey(User, unique=True)
+    username = models.CharField(max_length=20)
+    password = models.CharField(max_length=100)
+
+class DiigoBookmark(cms_models.ContentsMeta):
+    url   = models.URLField(blank=True, verify_exists=False)
+
+    objects = models.Manager()
+    public_objects = cms_models.PublicManager()
Index: /lang/python/every_resources/trunk/everes_diigo/management/commands/syncdiigo.py
===================================================================
--- /lang/python/every_resources/trunk/everes_diigo/management/commands/syncdiigo.py (revision 31795)
+++ /lang/python/every_resources/trunk/everes_diigo/management/commands/syncdiigo.py (revision 31795)
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2008 Makoto Tsuyuki All rights reserved
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#
+#  2. Redistributions in binary form must reproduce the above
+#     copyright notice, this list of conditions and the following
+#     disclaimer in the documentation and/or other materials provided
+#     with the distribution.
+#
+#  3. Neither the name of the authors nor the names of its contributors
+#     may be used to endorse or promote products derived from this
+#     software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+from django.core.management.base import NoArgsCommand, CommandError
+
+class Command(NoArgsCommand):
+    help = 'getting user bookmark from diigo.com'
+    
+    def handle_noargs(self, **options):
+        from everes_diigo.utils import update_feeds
+        update_feeds()
Index: /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/diigobookmark_list.html
===================================================================
--- /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/diigobookmark_list.html (revision 31795)
+++ /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/diigobookmark_list.html (revision 31795)
@@ -0,0 +1,3 @@
+{% extends 'everes_core/contentsmeta_list.html' %}
+
+{% block title %}Bookmark - {{ current_site.name }}{% endblock %}
Index: /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/diigobookmark_as_list.html
===================================================================
--- /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/diigobookmark_as_list.html (revision 31795)
+++ /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/diigobookmark_as_list.html (revision 31795)
@@ -0,0 +1,3 @@
+{% extends 'everes_core/contentsmeta_as_list.html' %}
+
+{% block after_summary %}<p>Visit SITE: <a href="{{ obj.url }}" rel="nofollow">{{ obj.url }}</a></p>{% endblock %}
Index: /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/diigobookmark_detail.html
===================================================================
--- /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/diigobookmark_detail.html (revision 31795)
+++ /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/diigobookmark_detail.html (revision 31795)
@@ -0,0 +1,34 @@
+{% extends 'everes_core/contentsmeta_detail.html' %}
+
+{% load markup %}
+
+{% block custom_css %}
+{{ block.super }}
+
+p#before_summary {
+    padding-top: 1em;
+    font-size: medium;
+}
+p#before_summary ul li {
+    float: right;
+}
+p#before_summary:after {
+    content: ".";  
+    display: block;  
+    visibility: hidden;  
+    height: 0.1px;  
+    font-size: 0.1em;  
+    line-height: 0;  
+    clear: both;
+}
+{% endblock %}
+
+{% block summary %}
+{{ object.summary|linebreaksbr|safe }}
+{% endblock %}
+
+{% block before_summary %}
+<p id="before_summary"><img src="http://img.simpleapi.net/small/{{ object.url }}" class="photo" /><br />
+    About : <a href="{{ object.url }}" rel="nofollow">{{ object.url }}</a><br />
+</p>
+{% endblock %}
Index: /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/base.html
===================================================================
--- /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/base.html (revision 31795)
+++ /lang/python/every_resources/trunk/everes_diigo/templates/everes_diigo/base.html (revision 31795)
@@ -0,0 +1,2 @@
+{% extends 'index.html' %}
+
Index: /lang/python/every_resources/trunk/urls.py
===================================================================
--- /lang/python/every_resources/trunk/urls.py (revision 27497)
+++ /lang/python/every_resources/trunk/urls.py (revision 31795)
@@ -48,7 +48,7 @@
     # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
     # to INSTALLED_APPS to enable admin documentation:
-    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
 
     # Uncomment the next line to enable the admin:
+    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
     (r'^admin/(.*)', admin.site.root),
     (r'^api/feed/', include('everes_functional_feed.urls')),
