Permalink
Browse files

Initial code dump

  • Loading branch information...
0 parents commit 8c55abc45d47de02c97818be377044ff362adb4f Will Kahn-Greene committed Mar 4, 2012
Showing with 10,403 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +5 −0 AUTHORS
  3. +41 −0 COPYING
  4. +49 −0 README.rst
  5. +17 −0 apps/pages/__init__.py
  6. +24 −0 apps/pages/urls.py
  7. +20 −0 apps/pages/views.py
  8. +17 −0 apps/sitenews/__init__.py
  9. +25 −0 apps/sitenews/admin.py
  10. +51 −0 apps/sitenews/models.py
  11. +27 −0 apps/sitenews/templates/sitenews/macros.html
  12. +44 −0 apps/sitenews/templates/sitenews/news.html
  13. +43 −0 apps/sitenews/templates/sitenews/news_list.html
  14. +29 −0 apps/sitenews/tests/__init__.py
  15. +34 −0 apps/sitenews/urls.py
  16. +59 −0 apps/sitenews/views.py
  17. +17 −0 apps/videos/__init__.py
  18. +39 −0 apps/videos/admin.py
  19. +165 −0 apps/videos/models.py
  20. +42 −0 apps/videos/search_indexes.py
  21. +3 −0 apps/videos/templates/search/indexes/videos/video_rendered.txt
  22. +19 −0 apps/videos/templates/search/indexes/videos/video_text.txt
  23. +39 −0 apps/videos/templates/videos/category.html
  24. +34 −0 apps/videos/templates/videos/category_list.html
  25. +47 −0 apps/videos/templates/videos/macros.html
  26. +61 −0 apps/videos/templates/videos/search.html
  27. +37 −0 apps/videos/templates/videos/speaker.html
  28. +38 −0 apps/videos/templates/videos/speaker_list.html
  29. +136 −0 apps/videos/templates/videos/video.html
  30. +17 −0 apps/videos/tests/__init__.py
  31. +50 −0 apps/videos/urls.py
  32. +78 −0 apps/videos/views.py
  33. +153 −0 docs/Makefile
  34. +48 −0 docs/administration.rst
  35. +248 −0 docs/conf.py
  36. +52 −0 docs/deploy.rst
  37. +8 −0 docs/dev_contribute.rst
  38. +90 −0 docs/dev_conventions.rst
  39. +139 −0 docs/dev_hacking.rst
  40. +51 −0 docs/dev_layout.rst
  41. +150 −0 docs/dev_resources.rst
  42. +14 −0 docs/dev_testing.rst
  43. +48 −0 docs/index.rst
  44. +167 −0 docs/install.rst
  45. +661 −0 licenses/AGPLv3.txt
  46. +202 −0 licenses/APLv2.txt
  47. +26 −0 manage.py
  48. +6 −0 requirements/base.txt
  49. +5 −0 requirements/development.txt
  50. +17 −0 richard/__init__.py
  51. +24 −0 richard/context_processors.py
  52. +223 −0 richard/settings.py
  53. +1 −0 richard/settings_test.py
  54. +581 −0 richard/static/bootstrap/css/bootstrap-responsive.css
  55. +4 −0 richard/static/bootstrap/css/bootstrap-responsive.min.css
  56. +3,496 −0 richard/static/bootstrap/css/bootstrap.css
  57. +632 −0 richard/static/bootstrap/css/bootstrap.min.css
  58. BIN richard/static/bootstrap/img/glyphicons-halflings-white.png
  59. BIN richard/static/bootstrap/img/glyphicons-halflings.png
  60. +1,720 −0 richard/static/bootstrap/js/bootstrap.js
  61. +1 −0 richard/static/bootstrap/js/bootstrap.min.js
  62. 0 richard/static/css/README
  63. +14 −0 richard/static/css/richard.css
  64. 0 richard/static/img/README
  65. 0 richard/static/js/README
  66. +58 −0 richard/templates/base.html
  67. +84 −0 richard/templates/home.html
  68. +29 −0 richard/templates/pages/about.html
  69. +28 −0 richard/templates/pages/contact.html
  70. +33 −0 richard/urls.py
  71. +34 −0 richard/views.py
  72. +44 −0 richard/wsgi.py
@@ -0,0 +1,5 @@
+*.pyc
+*~
+richard/settings_local.py
+
+docs/_build/
@@ -0,0 +1,5 @@
+=========
+ AUTHORS
+=========
+
+* Will Kahn-Greene
@@ -0,0 +1,41 @@
+=========
+ COPYING
+=========
+
+richard
+=======
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public
+License along with this program, in the file ``licenses/AGPLv3.txt``.
+If not, see <http://www.gnu.org/licenses/>.
+
+
+bootstrap
+=========
+
+Located in: ``richard/static/bootstrap/``
+
+Copyright 2012 Twitter, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
@@ -0,0 +1,49 @@
+========
+ README
+========
+
+Richard is a Django project (not a Django app) for video index sites.
+
+It currently has no features. If you're looking at this or using it at this
+stage, then you're either a friend of mine or you're intrigued by the
+future possibilities.
+
+My priorities:
+
+1. Maximize ease of finding the video you're looking for.
+2. Minimize site upkeep and maintenance---it's an index and it should pretty
+ much run itself.
+3. Minimize work for adding video.
+
+Things I'd like to implement at some point in the future:
+
+* search: terms search for quickly finding things
+* navigation: from a given video, easily navigate to related videos on a
+ variety of axes like speaker, conference, keywords, ...
+* feeds: every listing should have a feed view of it
+* Universal Subtitles
+* Popcorn.js
+* democratizing video metadata upkeep: this is foo-foo speak for making it
+ easy for anyone to help maintain the metadata and make it better
+
+
+Code
+====
+
+Code is not currently available.
+
+
+Documentation
+=============
+
+Documentation is in the ``docs/`` directory.
+
+Installation and upgrade documentation is in ``docs/install.rst``.
+
+
+Tests
+=====
+
+Run::
+
+ ./manage.py test
@@ -0,0 +1,17 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
@@ -0,0 +1,24 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.conf.urls.defaults import patterns, url
+
+
+urlpatterns = patterns(
+ 'pages.views',
+
+ url(r'(?P<page>[\w-]+)/?$', 'pages_view', name='pages_view'),
+ )
@@ -0,0 +1,20 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import jingo
+
+def pages_view(request, page):
+ return jingo.render( request, 'pages/%s.html' % page, {})
@@ -0,0 +1,17 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
@@ -0,0 +1,25 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.contrib import admin
+from sitenews.models import SiteNews
+
+
+class SiteNewsAdmin(admin.ModelAdmin):
+ pass
+
+
+admin.site.register(SiteNews, SiteNewsAdmin)
@@ -0,0 +1,51 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.db import models
+from django.template.defaultfilters import slugify
+
+
+class SiteNews(models.Model):
+ """
+ This is a really basic site news model. It's not designed to be
+ WordPress. It is designed so it's easy to do site news on the site
+ in the same style.
+ """
+ title = models.CharField(max_length=50)
+ summary = models.TextField(help_text='Two sentences. Use HTML.')
+ content = models.TextField(help_text='Use HTML.')
+ # TODO: make this a django user instead?
+ author = models.CharField(max_length=50)
+
+ updated = models.DateTimeField(auto_now=True)
+ created = models.DateTimeField(auto_now_add=True)
+
+ slug = models.SlugField(unique=True)
+
+ class Meta(object):
+ get_latest_by = "updated"
+ ordering = ["-updated"]
+
+ @models.permalink
+ def get_absolute_url(self):
+ return ('news', (self.pk, self.slug))
+
+ def __unicode__(self):
+ return '<SiteNews: %s>' % self.title
+
+ def save(self):
+ self.slug = slugify(self.title)
+ super(SiteNews, self).save()
@@ -0,0 +1,27 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% macro archivebar(archives, activeyear=None) %}
+<div class="well">
+ <ul class="nav nav-list">
+ <li class="nav-header">Archives</li>
+ {% for year in archives %}
+ <li class="{{ 'active' if year == activeyear }}"><a href="{{ url('news_archive_year', year=year) }}">{{ year }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
+{% endmacro %}
@@ -0,0 +1,44 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% extends "base.html" %}
+{% import "sitenews/macros.html" as macros %}
+{% block content %}
+<div class="row-fluid">
+ <div class="span2">
+ {{ macros.archivebar(archives) }}
+ </div>
+
+ <div class="span10">
+ <div class="section">
+ <h1>{{ item.title }}</h1>
+ <div class="summary">
+ {{ item.summary|safe }}
+ </div>
+ <div class="content">
+ {{ item.content|safe }}
+ </div>
+ <div class="meta">
+ Author: {{ item.author }} |
+ Created: {{ item.created|datetime }} |
+ Updated: {{ item.updated|datetime }} |
+ <a href="{{ item.get_absolute_url() }}">Permalink</a>
+ </div>
+ </div>
+ </div>
+</div>
+{% endblock %}
@@ -0,0 +1,43 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% extends "base.html" %}
+{% import "sitenews/macros.html" as macros %}
+{% block content %}
+<div class="row-fluid">
+ <div class="span2">
+ {{ macros.archivebar(archives, activeyear) }}
+ </div>
+
+ <div class="span10">
+ {% for item in items %}
+ <div class="news-item">
+ <h1><a href="{{ item.get_absolute_url() }}">{{ item.title }}</a></h1>
+ <div class="summary">
+ {{ item.summary|safe }}
+ </div>
+ <div class="meta">
+ Author: {{ item.author }}
+ Created: {{ item.created }}
+ Updated: {{ item.updated }}
+ <a href="{{ item.get_absolute_url() }}">Permalink</a>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+</div>
+{% endblock %}
Oops, something went wrong.

0 comments on commit 8c55abc

Please sign in to comment.