-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Also adds static files via `django.contrib.staticfiles` (preferred) or serving static media via `django.views.static.serve`. Test Plan: Visual. Reviewers: jeff, dcramer Reviewed By: jeff CC: vincelane Differential Revision: http://phabricator.local.disqus.net/D4329
- Loading branch information
Showing
19 changed files
with
202 additions
and
50 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
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
.tox/ | ||
dist/ | ||
docs/_build/ | ||
node_modules/ |
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,3 @@ | ||
[submodule "vendor/bootstrap"] | ||
path = vendor/bootstrap | ||
url = git://github.com/twitter/bootstrap.git |
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 @@ | ||
recursive-include mailviews/static * | ||
recursive-include mailviews/templates * |
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
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 @@ | ||
__version__ = (0, 3, 2) | ||
__version__ = (0, 3, 3) |
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,5 @@ | ||
from django.conf import settings | ||
|
||
|
||
def should_use_staticfiles(): | ||
return 'django.contrib.staticfiles' in settings.INSTALLED_APPS |
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,3 @@ | ||
* | ||
!.gitignore | ||
!mailviews.css |
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,26 @@ | ||
body { | ||
padding-top: 60px; | ||
} | ||
|
||
#html iframe, | ||
#html textarea { | ||
border: 0; | ||
height: 700px; | ||
width: 100%; | ||
} | ||
|
||
#html textarea { | ||
font-family: monospace; | ||
padding: 0; | ||
} | ||
|
||
section { | ||
border-bottom: 1px solid #ddd; | ||
padding-bottom: 20px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
section.last { | ||
border-bottom: 0; | ||
padding-bottom: 0; | ||
} |
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,2 @@ | ||
* | ||
!.gitignore |
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
Empty file.
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,22 @@ | ||
from __future__ import absolute_import | ||
|
||
from django import template | ||
|
||
from mailviews.helpers import should_use_staticfiles | ||
|
||
|
||
register = template.Library() | ||
|
||
|
||
def mailviews_static(path): | ||
if should_use_staticfiles(): | ||
from django.contrib.staticfiles.templatetags import staticfiles | ||
return staticfiles.static(path) | ||
else: | ||
from django.core.urlresolvers import reverse | ||
return reverse('mailviews-static', kwargs={ | ||
'path': path, | ||
}) | ||
|
||
|
||
register.simple_tag(mailviews_static) |
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
}, | ||
}, | ||
ROOT_URLCONF='mailviews.tests.urls', | ||
STATIC_URL='/static/', | ||
) | ||
|
||
|
||
|
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,8 +1,9 @@ | ||
from django.conf.urls.defaults import patterns, url | ||
from django.conf.urls.defaults import include, patterns, url | ||
|
||
from mailviews.tests.views import preview | ||
|
||
|
||
urlpatterns = patterns('', | ||
url(regex=r'^$', view=preview), | ||
url(regex=r'^mailviews/', view=include('mailviews.urls')), | ||
) |
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
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,19 @@ | ||
import os | ||
|
||
from django.conf.urls.defaults import patterns, url | ||
|
||
from mailviews.helpers import should_use_staticfiles | ||
|
||
|
||
urlpatterns = patterns('') | ||
|
||
|
||
if not should_use_staticfiles(): | ||
urlpatterns += patterns('', | ||
url(regex=r'^static/(?P<path>.*)$', | ||
view='django.views.static.serve', | ||
kwargs={ | ||
'document_root': os.path.join(os.path.dirname(__file__), 'static'), | ||
}, | ||
name='mailviews-static'), | ||
) |
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,16 @@ | ||
{ | ||
"name": "django-mailviews", | ||
"version": "0.0.0", | ||
"description": "", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/disqus/django-mailviews.git" | ||
}, | ||
"author": "disqus", | ||
"license": "apache license 2.0", | ||
"readmeFilename": "README.rst", | ||
"dependencies": { | ||
"less": "1.3.1", | ||
"jshint": "0.8.0" | ||
} | ||
} |
Submodule bootstrap
added at
3b3dd3