├── AsyncioAgg ├── __init__.py ├── urls.py ├── wsgi.py └── settings.py ├── static ├── media │ └── .gitkeep └── content_submit │ ├── img │ ├── .gitkeep │ └── opensource.png │ ├── robots.txt │ ├── humans.txt │ ├── js │ ├── foundation │ │ ├── foundation.alert.js │ │ ├── foundation.accordion.js │ │ ├── foundation.equalizer.js │ │ ├── foundation.offcanvas.js │ │ ├── foundation.tab.js │ │ ├── foundation.slider.js │ │ ├── foundation.magellan.js │ │ ├── foundation.interchange.js │ │ ├── foundation.tooltip.js │ │ ├── foundation.dropdown.js │ │ ├── foundation.abide.js │ │ ├── foundation.reveal.js │ │ ├── foundation.topbar.js │ │ ├── foundation.clearing.js │ │ ├── foundation.orbit.js │ │ └── foundation.js │ └── vendor │ │ ├── jquery.cookie.js │ │ ├── placeholder.js │ │ ├── fastclick.js │ │ └── modernizr.js │ └── css │ ├── style.css │ └── normalize.css ├── content_submit ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0002_auto__add_field_resource_publish_date.py │ ├── 0003_auto__add_field_resource_author.py │ ├── 0004_auto__add_field_resource_active.py │ ├── 0005_auto__chg_field_resource_publish_date.py │ ├── 0001_initial.py │ └── 0006_auto__add_submission__chg_field_resource_title__chg_field_resource_lin.py ├── tests.py ├── urls.py ├── templates │ └── content_submit │ │ ├── submission_page.html │ │ ├── _resource.html │ │ ├── home_page.html │ │ └── base.html ├── admin.py ├── models.py └── views.py ├── .gitignore ├── README.md ├── requirements.txt └── manage.py /AsyncioAgg/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/media/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /content_submit/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /content_submit/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/content_submit/img/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /content_submit/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | local_settings.py 2 | *.sqlite3 3 | *.db 4 | staticfiles/ 5 | *.log 6 | *.pot 7 | *.pyc 8 | env 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | asyncio-aggregator 2 | ================== 3 | 4 | Content Aggregation site for python's asyncio 5 | -------------------------------------------------------------------------------- /static/content_submit/img/opensource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4grim/asyncio-aggregator/HEAD/static/content_submit/img/opensource.png -------------------------------------------------------------------------------- /static/content_submit/robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 3 | 4 | User-agent: * 5 | -------------------------------------------------------------------------------- /content_submit/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | from content_submit import views 3 | 4 | urlpatterns = patterns('', 5 | url(r'^$', views.home_page, name='home_page'), 6 | ) -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.6.2 2 | Pillow==2.3.1 3 | South==0.8.4 4 | boto==2.27.0 5 | django-storages==1.1.8 6 | wsgiref==0.1.2 7 | psycopg2==2.5.2 8 | gunicorn==18.0 9 | django-markdown-deux==1.0.4 -------------------------------------------------------------------------------- /static/content_submit/humans.txt: -------------------------------------------------------------------------------- 1 | /* Foundation was made by ZURB, an interaction design and design strategy firm in Campbell, CA */ 2 | /* zurb.com */ 3 | /* humanstxt.org */ 4 | 5 | /* SITE */ 6 | Standards: HTML5, CSS3 7 | Components: jQuery, Orbit, Reveal 8 | Software: Sublime, Git, Sass 9 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AsyncioAgg.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /content_submit/templates/content_submit/submission_page.html: -------------------------------------------------------------------------------- 1 | 2 |
9 | -------------------------------------------------------------------------------- /AsyncioAgg/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, include, url 2 | 3 | from django.contrib import admin 4 | 5 | 6 | admin.autodiscover() 7 | 8 | urlpatterns = patterns('', 9 | # Examples: 10 | # url(r'^$', 'AsyncioAgg.views.home', name='home'), 11 | # url(r'^blog/', include('blog.urls')), 12 | 13 | url(r'^', include('content_submit.urls')), 14 | url(r'^admin/', include(admin.site.urls)), 15 | ) 16 | -------------------------------------------------------------------------------- /AsyncioAgg/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for AsyncioAgg project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AsyncioAgg.settings") 12 | 13 | from django.core.wsgi import get_wsgi_application 14 | application = get_wsgi_application() 15 | -------------------------------------------------------------------------------- /content_submit/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from content_submit.models import Resource, Submission 4 | 5 | # Register your models here. 6 | 7 | class ResourceAdmin(admin.ModelAdmin): 8 | date_hierarchy = 'publish_date' 9 | 10 | list_display = ('title', 'author', 'category', 'publish_date', 'active') 11 | 12 | list_filter = ('category',) 13 | 14 | search_fields = ('title', 'author', ) 15 | 16 | class SubmissionAdmin(admin.ModelAdmin): 17 | list_display = ('name', 'email', 'link' ) 18 | 19 | 20 | admin.site.register(Resource, ResourceAdmin) 21 | admin.site.register(Submission, SubmissionAdmin) -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.alert.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.alert = { 5 | name : 'alert', 6 | 7 | version : '5.2.1', 8 | 9 | settings : { 10 | animation: 'fadeOut', 11 | speed: 300, // fade out speed 12 | callback: function (){} 13 | }, 14 | 15 | init : function (scope, method, options) { 16 | this.bindings(method, options); 17 | }, 18 | 19 | events : function () { 20 | var self = this, 21 | S = this.S; 22 | 23 | $(this.scope).off('.alert').on('click.fndtn.alert', '[' + this.attr_name() + '] a.close', function (e) { 24 | var alertBox = S(this).closest('[' + self.attr_name() + ']'), 25 | settings = alertBox.data(self.attr_name(true) + '-init') || self.settings; 26 | 27 | e.preventDefault(); 28 | alertBox[settings.animation](settings.speed, function () { 29 | S(this).trigger('close').remove(); 30 | settings.callback(); 31 | }); 32 | }); 33 | }, 34 | 35 | reflow : function () {} 36 | }; 37 | }(jQuery, this, this.document)); 38 | -------------------------------------------------------------------------------- /content_submit/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | class Resource(models.Model): 4 | LIBRARY = 'Library' 5 | DOCUMENTATION = 'Documentation' 6 | TALK = 'Talk' 7 | TUTORIAL = 'Tutorial' 8 | BLOG = 'Blog' 9 | CATEGORY_CHOICES = ( 10 | (LIBRARY, 'Library'), 11 | (DOCUMENTATION, 'Documentation'), 12 | (TALK, 'Talk'), 13 | (TUTORIAL, 'Tutorial'), 14 | (BLOG, 'Blog'), 15 | ) 16 | title = models.CharField(max_length=254) 17 | link = models.URLField(max_length=254) 18 | author = models.CharField(blank=True, max_length=200) 19 | description = models.TextField() 20 | image = models.ImageField(upload_to='content_submit', blank=True) 21 | category = models.CharField(max_length=220, choices=CATEGORY_CHOICES, default=None) 22 | publish_date = models.DateField(blank=True, null=True) 23 | active = models.BooleanField(default=False) 24 | 25 | def __unicode__(self): 26 | return self.title 27 | 28 | 29 | class Submission(models.Model): 30 | link = models.URLField(max_length=254) 31 | description = models.TextField() 32 | name = models.CharField(max_length=200) 33 | email = models.EmailField(max_length=254) 34 | 35 | def __unicode__(self): 36 | return self.name 37 | 38 | -------------------------------------------------------------------------------- /content_submit/templates/content_submit/_resource.html: -------------------------------------------------------------------------------- 1 | {% load markdown_deux_tags %} 2 | 3 | {% if resource.image %} 4 | 5 |{{ resource.author }} - {{ resource.publish_date|date:"M j, Y" }}
9 | {% elif resource.author %} 10 |{{ resource.author }}
11 | {% elif resource.publish_date %} 12 |{{ resource.publish_date }}
13 | {% else %} 14 | {% endif %} 15 |{{ resource.link|truncatechars:35 }}
16 |{{ resource.description|markdown }}
17 | 18 | {% else %} 19 | 20 |{{ resource.author }} - {{ resource.publish_date|date:"M j, Y" }}
23 | {% elif resource.author %} 24 |{{ resource.author }}
25 | {% elif resource.publish_date %} 26 |{{ resource.publish_date }}
27 | {% else %} 28 | {% endif %} 29 |{{ resource.link|truncatechars:35 }}
30 |{{ resource.description|markdown }}
31 | 32 | {% endif %} -------------------------------------------------------------------------------- /static/content_submit/js/vendor/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.0 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{a=decodeURIComponent(a.replace(g," "))}catch(b){return}try{return h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setDate(k.getDate()+j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0!==a.cookie(b)?(a.cookie(b,"",a.extend({},c,{expires:-1})),!0):!1}}); 9 | -------------------------------------------------------------------------------- /content_submit/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.core.mail import send_mail 3 | from content_submit.models import Resource, Submission 4 | 5 | # Create your views here. 6 | def home_page(request): 7 | 8 | library_resources = Resource.objects.filter(category='Library') 9 | doc_resources = Resource.objects.filter(category='Documentation') 10 | talk_resources = Resource.objects.filter(category='Talk') 11 | tutorial_resources = Resource.objects.filter(category='Tutorial') 12 | blog_resources = Resource.objects.filter(category='Blog') 13 | 14 | form = request.POST 15 | link = form.get('link', default=None) 16 | name = form.get('name', default=None) 17 | email = form.get('email', default=None) 18 | description = form.get('description', default=None) 19 | 20 | if request.POST: 21 | form = request.POST 22 | 23 | #save submission to DB 24 | new_resource = Submission(link=link, name=name, description=description, email=email) 25 | new_resource.save() 26 | 27 | #send submission to email 28 | send_mail( 29 | 'Asyncio Submission', 30 | '%s %s %s %s' % (name, email, link, description), 31 | 'amber.grimaldi@gmail.com', 32 | ['amber.grimaldi@gmail.com'] 33 | ) 34 | if request.is_ajax(): 35 | print "the message should be sent" 36 | 37 | context = { 38 | 'library_resources': library_resources, 39 | 'doc_resources': doc_resources, 40 | 'talk_resources': talk_resources, 41 | 'tutorial_resources': tutorial_resources, 42 | 'blog_resources': blog_resources, 43 | } 44 | 45 | return render(request, 'content_submit/home_page.html', context) 46 | -------------------------------------------------------------------------------- /content_submit/migrations/0002_auto__add_field_resource_publish_date.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from south.utils import datetime_utils as datetime 3 | from south.db import db 4 | from south.v2 import SchemaMigration 5 | from django.db import models 6 | 7 | 8 | class Migration(SchemaMigration): 9 | 10 | def forwards(self, orm): 11 | # Adding field 'Resource.publish_date' 12 | db.add_column(u'content_submit_resource', 'publish_date', 13 | self.gf('django.db.models.fields.DateField')(default=datetime.datetime(2014, 5, 2, 0, 0)), 14 | keep_default=False) 15 | 16 | 17 | def backwards(self, orm): 18 | # Deleting field 'Resource.publish_date' 19 | db.delete_column(u'content_submit_resource', 'publish_date') 20 | 21 | 22 | models = { 23 | u'content_submit.resource': { 24 | 'Meta': {'object_name': 'Resource'}, 25 | 'category': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '220'}), 26 | 'description': ('django.db.models.fields.TextField', [], {}), 27 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 28 | 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}), 29 | 'link': ('django.db.models.fields.URLField', [], {'max_length': '200'}), 30 | 'publish_date': ('django.db.models.fields.DateField', [], {}), 31 | 'title': ('django.db.models.fields.CharField', [], {'max_length': '220'}) 32 | } 33 | } 34 | 35 | complete_apps = ['content_submit'] -------------------------------------------------------------------------------- /content_submit/migrations/0003_auto__add_field_resource_author.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from south.utils import datetime_utils as datetime 3 | from south.db import db 4 | from south.v2 import SchemaMigration 5 | from django.db import models 6 | 7 | 8 | class Migration(SchemaMigration): 9 | 10 | def forwards(self, orm): 11 | # Adding field 'Resource.author' 12 | db.add_column(u'content_submit_resource', 'author', 13 | self.gf('django.db.models.fields.CharField')(default='', max_length=200, blank=True), 14 | keep_default=False) 15 | 16 | 17 | def backwards(self, orm): 18 | # Deleting field 'Resource.author' 19 | db.delete_column(u'content_submit_resource', 'author') 20 | 21 | 22 | models = { 23 | u'content_submit.resource': { 24 | 'Meta': {'object_name': 'Resource'}, 25 | 'author': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}), 26 | 'category': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '220'}), 27 | 'description': ('django.db.models.fields.TextField', [], {}), 28 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 29 | 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}), 30 | 'link': ('django.db.models.fields.URLField', [], {'max_length': '200'}), 31 | 'publish_date': ('django.db.models.fields.DateField', [], {}), 32 | 'title': ('django.db.models.fields.CharField', [], {'max_length': '220'}) 33 | } 34 | } 35 | 36 | complete_apps = ['content_submit'] -------------------------------------------------------------------------------- /content_submit/migrations/0004_auto__add_field_resource_active.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from south.utils import datetime_utils as datetime 3 | from south.db import db 4 | from south.v2 import SchemaMigration 5 | from django.db import models 6 | 7 | 8 | class Migration(SchemaMigration): 9 | 10 | def forwards(self, orm): 11 | # Adding field 'Resource.active' 12 | db.add_column(u'content_submit_resource', 'active', 13 | self.gf('django.db.models.fields.BooleanField')(default=False), 14 | keep_default=False) 15 | 16 | 17 | def backwards(self, orm): 18 | # Deleting field 'Resource.active' 19 | db.delete_column(u'content_submit_resource', 'active') 20 | 21 | 22 | models = { 23 | u'content_submit.resource': { 24 | 'Meta': {'object_name': 'Resource'}, 25 | 'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 26 | 'author': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}), 27 | 'category': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '220'}), 28 | 'description': ('django.db.models.fields.TextField', [], {}), 29 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 30 | 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}), 31 | 'link': ('django.db.models.fields.URLField', [], {'max_length': '200'}), 32 | 'publish_date': ('django.db.models.fields.DateField', [], {'blank': 'True'}), 33 | 'title': ('django.db.models.fields.CharField', [], {'max_length': '220'}) 34 | } 35 | } 36 | 37 | complete_apps = ['content_submit'] -------------------------------------------------------------------------------- /content_submit/templates/content_submit/home_page.html: -------------------------------------------------------------------------------- 1 | {% extends 'content_submit/base.html' %} 2 | 3 | {% load staticfiles %} 4 | 5 | {% block body_block %} 6 |