diff --git a/colab/api/resources.py b/colab/api/resources.py deleted file mode 100644 index 38baa71..0000000 --- a/colab/api/resources.py +++ /dev/null @@ -1,120 +0,0 @@ -# -*- coding: utf-8 -*- - -from django.contrib.auth import get_user_model - -from tastypie import fields -from tastypie.constants import ALL_WITH_RELATIONS, ALL -from tastypie.resources import ModelResource - -from colab.super_archives.models import Message, EmailAddress -# from proxy.trac.models import Revision, Ticket, Wiki - -User = get_user_model() - - -class UserResource(ModelResource): - class Meta: - queryset = User.objects.filter(is_active=True) - resource_name = 'user' - fields = ['username', 'institution', 'role', 'bio', 'first_name', - 'last_name', 'email'] - allowed_methods = ['get', ] - filtering = { - 'email': ('exact', ), - 'username': ALL, - 'institution': ALL, - 'role': ALL, - 'bio': ALL, - } - - def dehydrate_email(self, bundle): - return '' - - -class EmailAddressResource(ModelResource): - user = fields.ForeignKey(UserResource, 'user', full=False, null=True) - - class Meta: - queryset = EmailAddress.objects.all() - resource_name = 'emailaddress' - excludes = ['md5', ] - allowed_methods = ['get', ] - filtering = { - 'address': ('exact', ), - 'user': ALL_WITH_RELATIONS, - 'real_name': ALL, - } - - def dehydrate_address(self, bundle): - return '' - - -class MessageResource(ModelResource): - from_address = fields.ForeignKey(EmailAddressResource, 'from_address', - full=False) - - class Meta: - queryset = Message.objects.all() - resource_name = 'message' - excludes = ['spam', 'subject_clean', 'message_id'] - filtering = { - 'from_address': ALL_WITH_RELATIONS, - 'subject': ALL, - 'body': ALL, - 'received_time': ALL, - } - - -# class RevisionResource(ModelResource): -# class Meta: -# queryset = Revision.objects.all() -# resource_name = 'revision' -# excludes = ['collaborators', ] -# filtering = { -# 'key': ALL, -# 'rev': ALL, -# 'author': ALL, -# 'message': ALL, -# 'repository_name': ALL, -# 'created': ALL, -# } -# -# -# class TicketResource(ModelResource): -# class Meta: -# queryset = Ticket.objects.all() -# resource_name = 'ticket' -# excludes = ['collaborators', ] -# filtering = { -# 'id': ALL, -# 'summary': ALL, -# 'description': ALL, -# 'milestone': ALL, -# 'priority': ALL, -# 'component': ALL, -# 'version': ALL, -# 'severity': ALL, -# 'reporter': ALL, -# 'author': ALL, -# 'status': ALL, -# 'keywords': ALL, -# 'created': ALL, -# 'modified': ALL, -# 'modified_by': ALL, -# } -# -# -# class WikiResource(ModelResource): -# class Meta: -# queryset = Wiki.objects.all() -# resource_name = 'wiki' -# excludes = ['collaborators', ] -# filtering = { -# 'name': ALL, -# 'wiki_text': ALL, -# 'author': ALL, -# 'name': ALL, -# 'created': ALL, -# 'modified': ALL, -# 'modified_by': ALL, -# } diff --git a/colab/api/urls.py b/colab/api/urls.py index 4e0b29c..9f198f4 100644 --- a/colab/api/urls.py +++ b/colab/api/urls.py @@ -2,21 +2,9 @@ from django.conf.urls import patterns, include, url -from tastypie.api import Api - -from .resources import (UserResource, EmailAddressResource, MessageResource) from .views import VoteView -api = Api(api_name='v1') -api.register(UserResource()) -api.register(EmailAddressResource()) -api.register(MessageResource()) - - urlpatterns = patterns('', url(r'message/(?P\d+)/vote$', VoteView.as_view()), - - # tastypie urls - url(r'', include(api.urls)), ) diff --git a/colab/static/img/changeset.png b/colab/static/img/changeset.png deleted file mode 100644 index 80e3ee1..0000000 Binary files a/colab/static/img/changeset.png and /dev/null differ diff --git a/colab/static/img/opendata3.png b/colab/static/img/opendata3.png deleted file mode 100644 index dc12759..0000000 Binary files a/colab/static/img/opendata3.png and /dev/null differ diff --git a/colab/static/img/thread.png b/colab/static/img/thread.png deleted file mode 100644 index c429cbe..0000000 Binary files a/colab/static/img/thread.png and /dev/null differ diff --git a/colab/static/img/ticket.png b/colab/static/img/ticket.png deleted file mode 100644 index 09fcc0c..0000000 Binary files a/colab/static/img/ticket.png and /dev/null differ diff --git a/colab/static/img/wiki.png b/colab/static/img/wiki.png deleted file mode 100644 index c267a33..0000000 Binary files a/colab/static/img/wiki.png and /dev/null differ diff --git a/colab/templates/footer.html b/colab/templates/footer.html index 197c296..c961974 100644 --- a/colab/templates/footer.html +++ b/colab/templates/footer.html @@ -6,7 +6,6 @@

{% trans "Last email imported at" %} {{ last_imported_message.received_time|date:'DATETIME_FORMAT' }}

{% endif %}

-

diff --git a/colab/templates/open-data.html b/colab/templates/open-data.html deleted file mode 100644 index 17d5d74..0000000 --- a/colab/templates/open-data.html +++ /dev/null @@ -1,144 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block main-content %} -

-

{% trans "OpenData - Communities" %}

-

{% trans "If you are interested in any other data that is not provided by this API, please contact us via the ticketing system (you must be registered in order to create a ticket)." %}

- -

{% trans "Retrieving data via API" %}

-

{% trans "Colab API works through HTTP/REST, always returning JSON objects." %}

-

- {% trans "The base API URL is" %}: - {% url 'api_v1_top_level' api_name='v1' as BASE_API_URL %} - {{ BASE_API_URL }} -

- - - -
-{% endblock %} diff --git a/colab/urls.py b/colab/urls.py index 888607e..ae2e4f8 100644 --- a/colab/urls.py +++ b/colab/urls.py @@ -8,31 +8,20 @@ from django.views.generic import RedirectView admin.autodiscover() urlpatterns = patterns('', + url(r'^$', RedirectView.as_view(url=settings.COLAB_HOME_URL), name='home'), url(r'^robots.txt$', 'colab.home.views.robots', name='robots'), url(r'^dashboard$', 'colab.home.views.dashboard', name='dashboard'), - url(r'^$', RedirectView.as_view(url=settings.COLAB_HOME_URL), name='home'), - - url(r'^open-data/$', TemplateView.as_view(template_name='open-data.html'), - name='opendata'), - url(r'^search/', include('colab.search.urls')), - url(r'^archives/', include('colab.super_archives.urls')), url(r'^api/', include('colab.api.urls')), url(r'^rss/', include('colab.rss.urls')), - # Kept for backwards compatibility - url(r'^user/', include('colab.accounts.urls')), - # Kept for backwards compatibility - url(r'^user/', include('colab.accounts.urls')), - # (same here) TODO: move to nginx - url(r'^signup/', include('colab.accounts.urls')), url(r'^account/', include('colab.accounts.urls')), url(r'^myaccount/(?P.*)$', 'colab.accounts.views.myaccount_redirect', name='myaccount'), - # Uncomment the next line to enable the admin: url(r'^colab/admin/', include(admin.site.urls)), + url(r'^archives/', include('colab.super_archives.urls')), url(r'^gitlab/', include('colab.plugins.gitlab.urls')), url(r'^mezuro/', include('colab.plugins.mezuro.urls')), url(r'^social/', include('colab.plugins.noosfero.urls')), -- libgit2 0.21.2