Permalink
Browse files

Moved files from media to static, where they ought to be. Fixes #84

  • Loading branch information...
palewire committed Jan 12, 2012
1 parent b8964fb commit b7061cb52815095c14c78ba630bc82c1f2b83e3d
Showing with 19 additions and 25 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 settings.py
  3. +6 −3 table_stacker/management/commands/build.py
  4. +3 −3 templates/base.html
  5. +0 −7 templates/similar_tables.html
  6. 0 {media → templates/static}/css/blueprint/print.css
  7. 0 {media → templates/static}/css/blueprint/screen.css
  8. 0 {media → templates/static}/css/blueprint/typography.css
  9. 0 {media → templates/static}/css/style.css
  10. BIN {media → templates/static}/img/both.png
  11. BIN {media → templates/static}/img/bubble_legend.png
  12. BIN {media → templates/static}/img/bubble_no.png
  13. BIN {media → templates/static}/img/bubble_yes.png
  14. BIN {media → templates/static}/img/checkbox_no.png
  15. BIN {media → templates/static}/img/checkbox_yes.png
  16. BIN {media → templates/static}/img/down.png
  17. BIN {media → templates/static}/img/first.png
  18. BIN {media → templates/static}/img/last.png
  19. BIN {media → templates/static}/img/next.png
  20. BIN {media → templates/static}/img/prev.png
  21. BIN {media → templates/static}/img/rss/feed-icon-12x12.png
  22. BIN {media → templates/static}/img/rss/rss_notext.gif
  23. BIN {media → templates/static}/img/thumb_down.png
  24. BIN {media → templates/static}/img/thumb_up.png
  25. BIN {media → templates/static}/img/tribubble_legend.png
  26. BIN {media → templates/static}/img/tribubble_no.png
  27. BIN {media → templates/static}/img/tribubble_partly.png
  28. BIN {media → templates/static}/img/tribubble_yes.png
  29. BIN {media → templates/static}/img/up.png
  30. 0 {media → templates/static}/js/jquery.tablesorter.js
  31. 0 {media → templates/static}/js/jquery.tablesorter.multipagefilter.js
  32. 0 {media → templates/static}/js/jquery.tablesorter.pager.js
  33. +8 −12 templates/table_detail.html
View
@@ -1,4 +1,5 @@
*.db
+static/*
build/*
settings_private.py
*.pyc
View
@@ -84,6 +84,7 @@
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
+ os.path.join(ROOT_PATH, 'templates', 'static'),
)
# List of finder classes that know how to find static files in
@@ -5,6 +5,7 @@
from table_stacker import views
from django.http import Http404
from django.conf import settings
+from django.core import management
from django.shortcuts import render
from table_stacker.models import Table, Tag
from table_stacker.feeds import LatestTables
@@ -81,9 +82,11 @@ def handle(self, *args, **options):
# Then recreate it from scratch
os.makedirs(settings.BUILD_DIR)
- # Copy the media directory
- self.stdout.write("Building media directory\n")
- shutil.copytree(settings.MEDIA_ROOT, os.path.join( settings.BUILD_DIR, 'media'))
+ # Copy the static files
+ self.stdout.write("Building static files\n")
+ management.call_command("collectstatic", interactive=False, verbosity=0)
+ shutil.copytree(settings.STATIC_ROOT, os.path.join(settings.BUILD_DIR, 'static'))
+ shutil.copytree(settings.MEDIA_ROOT, os.path.join(settings.BUILD_DIR, 'media'))
# Load all YAML files into the local database
self.stdout.write("Building database\n")
View
@@ -6,9 +6,9 @@
<meta name="keywords" content="{% block keywords %}tablstacker{% endblock %}" >
<meta name="description" content="{% block description %}{% endblock %}" >
- <link href='{{ MEDIA_URL }}css/blueprint/screen.css' rel='stylesheet' type='text/css' media='all' />
- <link href='{{ MEDIA_URL }}css/blueprint/typography.css' rel='stylesheet' type='text/css' media='all' />
- <link href='{{ MEDIA_URL }}css/style.css' rel='stylesheet' type='text/css' media='all' />
+ <link href='{{ STATIC_URL }}css/blueprint/screen.css' rel='stylesheet' type='text/css' media='all' />
+ <link href='{{ STATIC_URL }}css/blueprint/typography.css' rel='stylesheet' type='text/css' media='all' />
+ <link href='{{ STATIC_URL }}css/style.css' rel='stylesheet' type='text/css' media='all' />
{% block extra-css %}
{% endblock %}
@@ -1,7 +0,0 @@
-<h5>Similar data</h5>
-<ul>
-{% for table in object.get_similar_tables_list|slice:"3" %}
- <li><a target="_blank" href="{{ table.get_absolute_url }}">&raquo; {{ table.title }}</a></li>
-{% endfor %}
-</ul>
-
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -21,9 +21,9 @@
{% endif %}
{% block extra-js %}
- <script src='{{ MEDIA_URL }}js/jquery.tablesorter.js' type='text/javascript'></script>
- <script src='{{ MEDIA_URL }}js/jquery.tablesorter.pager.js' type='text/javascript'></script>
- <script src='{{ MEDIA_URL }}js/jquery.tablesorter.multipagefilter.js' type='text/javascript'></script>
+ <script src='{{ STATIC_URL }}js/jquery.tablesorter.js' type='text/javascript'></script>
+ <script src='{{ STATIC_URL }}js/jquery.tablesorter.pager.js' type='text/javascript'></script>
+ <script src='{{ STATIC_URL }}js/jquery.tablesorter.multipagefilter.js' type='text/javascript'></script>
<script type="text/javascript">
/* For picking out bits from the query string */
var getParameterByName = function(name) {
@@ -64,12 +64,8 @@ <h1 id="title">{{ object.title|safe }}</h1>
<div id="table_fu">
<div class="clear"></div>
- {% if object.similar_tables %}
- <div id="similar">{% include "similar_tables.html" %}</div>
- {% endif %}
-
{% if object.description %}
- <div id="description" {% if object.similar_tables %}style="width:660px;"{% endif %}>{{ object.description|safe }}</div>
+ <div id="description">{{ object.description|safe }}</div>
{% endif %}
<div class="clear"></div>
@@ -94,11 +90,11 @@ <h1 id="title">{{ object.title|safe }}</h1>
<div id="filter">Search: <input type="text"></div>
<div id="pager" class="pager">
<form {% ifequal table.total_pages 1 %}style="display:none !important;"{% endifequal %}>
- <img src="{{ MEDIA_URL }}img/first.png" class="first">
- <img src="{{ MEDIA_URL }}img/prev.png" class="prev">
+ <img src="{{ STATIC_URL }}img/first.png" class="first">
+ <img src="{{ STATIC_URL }}img/prev.png" class="prev">
<span class="pagedisplay"/>1/{{ table.total_pages }}</span>
- <img src="{{ MEDIA_URL }}img/next.png" class="next">
- <img src="{{ MEDIA_URL }}img/last.png" class="last">
+ <img src="{{ STATIC_URL }}img/next.png" class="next">
+ <img src="{{ STATIC_URL }}img/last.png" class="last">
<select class="pagesize">
{% for page_size in table.page_size_list %}
<option {% if forloop.first %}selected="selected"{% endif %} value="{{ page_size }}">{{ page_size }}</option>

0 comments on commit b7061cb

Please sign in to comment.