master
Nick Sergeant 2012-03-05 13:05:53 -05:00
parent fbd99b9c18
commit b9327e02ca
5 changed files with 35 additions and 36 deletions

12
fabfile.py vendored
View File

@ -7,8 +7,8 @@ def staticfiles():
# CSS # CSS
local('sass %s/media/css/style.scss %s/media/css/style.css' % (BASE_PATH, BASE_PATH)) local('sass %s/media/css/style.scss %s/media/css/style.css' % (BASE_PATH, BASE_PATH))
local('sed -i -e \'s/\/media\//https:\/\/snipt.s3.amazonaws.com\//g\' %s/media/css/style.css' % BASE_PATH) #local('sed -i -e \'s/\/media\//https:\/\/snipt.s3.amazonaws.com\//g\' %s/media/css/style.css' % BASE_PATH)
local('rm %s/media/css/style.css-e' % BASE_PATH) #local('rm %s/media/css/style.css-e' % BASE_PATH)
css = [ css = [
'%s/media/css/bootstrap.css' % BASE_PATH, '%s/media/css/bootstrap.css' % BASE_PATH,
'%s/media/css/style.css' % BASE_PATH, '%s/media/css/style.css' % BASE_PATH,
@ -46,8 +46,8 @@ def deployapp(m):
except: except:
pass pass
local('hg push') local('hg push')
local('git push -f heroku') #local('git push -f heroku')
local('heroku restart') #local('heroku restart')
def deploy(m): def deploy(m):
staticfiles() staticfiles()
@ -55,5 +55,5 @@ def deploy(m):
def deployall(m): def deployall(m):
deploy(m) deploy(m)
local('heroku run bin/python snipt/manage.py syncdb') #local('heroku run bin/python snipt/manage.py syncdb')
local('heroku run bin/python snipt/manage.py migrate') #local('heroku run bin/python snipt/manage.py migrate')

View File

@ -55,7 +55,7 @@ $Consolas: Consolas, Menlo, "Courier New", monospace;
// Page // Page
html, body { html, body {
background: #F5F2F3 url('/media/images/bg.gif') top left repeat; background: #F5F2F3 url('/static/images/bg.gif') top left repeat;
} }
body { body {
color: #666; color: #666;
@ -81,7 +81,7 @@ body {
// Global // Global
header.main { header.main {
background: #12343D url('/media/images/header-bg.gif') top left repeat-x; background: #12343D url('/static/images/header-bg.gif') top left repeat-x;
border-bottom: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD;
height: 66px; height: 66px;
position: relative; position: relative;
@ -95,7 +95,7 @@ header.main {
width: 939px; width: 939px;
div.shadey { div.shadey {
background: transparent url('/media/images/header-inner-bg.png') top left no-repeat; background: transparent url('/static/images/header-inner-bg.png') top left no-repeat;
height: 65px; height: 65px;
left: -157px; left: -157px;
position: absolute; position: absolute;
@ -109,7 +109,7 @@ header.main {
z-index: 50; z-index: 50;
a { a {
background: transparent url('/media/images/logo.png') top left no-repeat; background: transparent url('/static/images/logo.png') top left no-repeat;
display: block; display: block;
float: left; float: left;
height: 35px; height: 35px;
@ -142,8 +142,8 @@ header.main {
width: auto; width: auto;
} }
input { input {
background: #17484F url('/media/images/search-icon.png') top left no-repeat; background: #17484F url('/static/images/search-icon.png') top left no-repeat;
background: rgba(43, 82, 93, .5) url('/media/images/search-icon.png') 8px center no-repeat; background: rgba(43, 82, 93, .5) url('/static/images/search-icon.png') 8px center no-repeat;
border: 1px solid #3A5E67; border: 1px solid #3A5E67;
color: #FFF; color: #FFF;
font: normal 12px $Helvetica; font: normal 12px $Helvetica;
@ -357,7 +357,7 @@ section.main {
margin: 0 15px 45px 15px; margin: 0 15px 45px 15px;
h1 { h1 {
background: transparent url('/media/images/tags-icon.png') 0 0 no-repeat; background: transparent url('/static/images/tags-icon.png') 0 0 no-repeat;
color: #3BAAF3; color: #3BAAF3;
font: bold 12px $Helvetica; font: bold 12px $Helvetica;
padding-bottom: 5px; padding-bottom: 5px;
@ -398,7 +398,7 @@ section.main {
margin: 0; margin: 0;
li { li {
background: transparent url('/media/images/api-icon.png') center left no-repeat; background: transparent url('/static/images/api-icon.png') center left no-repeat;
list-style-type: none; list-style-type: none;
margin: 6px 0 6px 0; margin: 6px 0 6px 0;
padding-left: 22px; padding-left: 22px;
@ -415,13 +415,13 @@ section.main {
} }
} }
&.twitter { &.twitter {
background: transparent url('/media/images/twitter-icon.png') 4px center no-repeat; background: transparent url('/static/images/twitter-icon.png') 4px center no-repeat;
} }
&.pro { &.pro {
background: transparent url('/media/images/upgrade-icon.png') 2px center no-repeat; background: transparent url('/static/images/upgrade-icon.png') 2px center no-repeat;
} }
&.groups { &.groups {
background: transparent url('/media/images/groups-icon.png') 2px center no-repeat; background: transparent url('/static/images/groups-icon.png') 2px center no-repeat;
} }
} }
} }
@ -529,7 +529,7 @@ article.snipt {
} }
} }
a.expand { a.expand {
background: #FFF url('/media/images/expand.png') 15px 18px no-repeat; background: #FFF url('/static/images/expand.png') 15px 18px no-repeat;
border-top: 1px solid #F1F1EE; border-top: 1px solid #F1F1EE;
bottom: 0; bottom: 0;
color: #999999; color: #999999;
@ -630,7 +630,7 @@ article.snipt {
margin: 2px 0; margin: 2px 0;
a { a {
background: rgba(128, 128, 128, .15) url('/media/images/edit-icon.png') 14px center no-repeat; background: rgba(128, 128, 128, .15) url('/static/images/edit-icon.png') 14px center no-repeat;
color: #000; color: #000;
display: block; display: block;
font: bold 12px $Helvetica; font: bold 12px $Helvetica;
@ -646,7 +646,7 @@ article.snipt {
} }
&.edit { &.edit {
&:after { &:after {
background: #F5F2F3 url('/media/images/bg.gif') top left repeat; background: #F5F2F3 url('/static/images/bg.gif') top left repeat;
content: ""; content: "";
height: 20px; height: 20px;
position: absolute; position: absolute;
@ -658,10 +658,10 @@ article.snipt {
} }
} }
&.embed { &.embed {
background-image: url('/media/images/embed-icon.png'); background-image: url('/static/images/embed-icon.png');
} }
&.copy { &.copy {
background-image: url('/media/images/copy-icon.png'); background-image: url('/static/images/copy-icon.png');
span.done { span.done {
display: none; display: none;
@ -674,7 +674,7 @@ article.snipt {
padding-top: 15px; padding-top: 15px;
h2 { h2 {
background: transparent url('/media/images/snipt-tags-icon.png') 15px center no-repeat; background: transparent url('/static/images/snipt-tags-icon.png') 15px center no-repeat;
color: #999999; color: #999999;
font: bold 12px $Helvetica; font: bold 12px $Helvetica;
padding: 7px 0 7px 35px; padding: 7px 0 7px 35px;
@ -719,7 +719,7 @@ article.snipt {
margin: 15px 0 0 15px; margin: 15px 0 0 15px;
li { li {
background: transparent url('/media/images/calendar-icon.png') top left no-repeat; background: transparent url('/static/images/calendar-icon.png') top left no-repeat;
color: #999; color: #999;
display: inline; display: inline;
font: normal 12px $Helvetica; font: normal 12px $Helvetica;
@ -736,10 +736,10 @@ article.snipt {
} }
} }
&.author { &.author {
background: transparent url('/media/images/author-icon.png') 0 1px no-repeat; background: transparent url('/static/images/author-icon.png') 0 1px no-repeat;
} }
&.comments { &.comments {
background: transparent url('/media/images/comments-icon.png') 0 2px no-repeat; background: transparent url('/static/images/comments-icon.png') 0 2px no-repeat;
} }
} }
} }
@ -754,7 +754,7 @@ article.snipt {
} }
} }
a.expand { a.expand {
background-image: url('/media/images/collapse.png'); background-image: url('/static/images/collapse.png');
-webkit-box-shadow: none; -webkit-box-shadow: none;
-moz-box-shadow: none; -moz-box-shadow: none;
box-shadow: none; box-shadow: none;
@ -794,7 +794,7 @@ article.snipt {
article.private-snipt { article.private-snipt {
div.container { div.container {
header { header {
@include vertical-gradient-with-image(url('/media/images/private-icon.png') top right no-repeat, #FFF, #FFFAF2); @include vertical-gradient-with-image(url('/static/images/private-icon.png') top right no-repeat, #FFF, #FFFAF2);
h1 { h1 {
a { a {

View File

@ -64,7 +64,10 @@ MEDIA_URL = '/media/uploads/'
# in apps' "static/" subdirectories and in STATICFILES_DIRS. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/" # Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(BASE_PATH, 'static') STATIC_ROOT = os.path.join(BASE_PATH, 'static')
STATIC_URL = '/static/' if DEBUG:
STATIC_URL = '/media/'
else:
STATIC_URL = '/static/'
# URL prefix for admin static files -- CSS, JavaScript and images. # URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash. # Make sure to use a trailing slash.

View File

@ -31,9 +31,9 @@
<link rel="stylesheet" href="{{ STATIC_URL }}cache/snipt.css" /> <link rel="stylesheet" href="{{ STATIC_URL }}cache/snipt.css" />
<script type="text/javascript" src="{{ STATIC_URL }}cache/snipt.js"></script> <script type="text/javascript" src="{{ STATIC_URL }}cache/snipt.js"></script>
{% endif %}<script type="text/javascript" src="/media/js/libs/ace/ace.js"></script> {% endif %}<script type="text/javascript" src="/static/js/libs/ace/ace.js"></script>
<script type="text/javascript" src="/media/js/libs/ace/theme-tomorrow.js"></script> <script type="text/javascript" src="/static/js/libs/ace/theme-tomorrow.js"></script>
<script type="text/javascript" src="/media/js/libs/ace/mode-javascript.js"></script> <script type="text/javascript" src="/static/js/libs/ace/mode-javascript.js"></script>
<script type="text/javascript">{% block js %}window.user = '{{ request.user.username }}'; <script type="text/javascript">{% block js %}window.user = '{{ request.user.username }}';
window.pub = {{ public|lower }};{% endblock %} </script> window.pub = {{ public|lower }};{% endblock %} </script>

View File

@ -23,10 +23,6 @@ private_api.register(PrivateUserResource())
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.HEROKU_STATIC_URL,
}),
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
url(r'^grappelli/', include('grappelli.urls')), url(r'^grappelli/', include('grappelli.urls')),