Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit b7061cb52815095c14c78ba630bc82c1f2b83e3d 1 parent b8964fb
@palewire palewire authored
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. 0  {media → templates/static}/img/both.png
  11. 0  {media → templates/static}/img/bubble_legend.png
  12. 0  {media → templates/static}/img/bubble_no.png
  13. 0  {media → templates/static}/img/bubble_yes.png
  14. 0  {media → templates/static}/img/checkbox_no.png
  15. 0  {media → templates/static}/img/checkbox_yes.png
  16. 0  {media → templates/static}/img/down.png
  17. 0  {media → templates/static}/img/first.png
  18. 0  {media → templates/static}/img/last.png
  19. 0  {media → templates/static}/img/next.png
  20. 0  {media → templates/static}/img/prev.png
  21. 0  {media → templates/static}/img/rss/feed-icon-12x12.png
  22. 0  {media → templates/static}/img/rss/rss_notext.gif
  23. 0  {media → templates/static}/img/thumb_down.png
  24. 0  {media → templates/static}/img/thumb_up.png
  25. 0  {media → templates/static}/img/tribubble_legend.png
  26. 0  {media → templates/static}/img/tribubble_no.png
  27. 0  {media → templates/static}/img/tribubble_partly.png
  28. 0  {media → templates/static}/img/tribubble_yes.png
  29. 0  {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  .gitignore
@@ -1,4 +1,5 @@
*.db
+static/*
build/*
settings_private.py
*.pyc
View
1  settings.py
@@ -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
View
9 table_stacker/management/commands/build.py
@@ -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 templates/base.html
@@ -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 %}
View
7 templates/similar_tables.html
@@ -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>
-
View
0  media/css/blueprint/print.css → templates/static/css/blueprint/print.css
File renamed without changes
View
0  media/css/blueprint/screen.css → templates/static/css/blueprint/screen.css
File renamed without changes
View
0  media/css/blueprint/typography.css → templates/static/css/blueprint/typography.css
File renamed without changes
View
0  media/css/style.css → templates/static/css/style.css
File renamed without changes
View
0  media/img/both.png → templates/static/img/both.png
File renamed without changes
View
0  media/img/bubble_legend.png → templates/static/img/bubble_legend.png
File renamed without changes
View
0  media/img/bubble_no.png → templates/static/img/bubble_no.png
File renamed without changes
View
0  media/img/bubble_yes.png → templates/static/img/bubble_yes.png
File renamed without changes
View
0  media/img/checkbox_no.png → templates/static/img/checkbox_no.png
File renamed without changes
View
0  media/img/checkbox_yes.png → templates/static/img/checkbox_yes.png
File renamed without changes
View
0  media/img/down.png → templates/static/img/down.png
File renamed without changes
View
0  media/img/first.png → templates/static/img/first.png
File renamed without changes
View
0  media/img/last.png → templates/static/img/last.png
File renamed without changes
View
0  media/img/next.png → templates/static/img/next.png
File renamed without changes
View
0  media/img/prev.png → templates/static/img/prev.png
File renamed without changes
View
0  media/img/rss/feed-icon-12x12.png → templates/static/img/rss/feed-icon-12x12.png
File renamed without changes
View
0  media/img/rss/rss_notext.gif → templates/static/img/rss/rss_notext.gif
File renamed without changes
View
0  media/img/thumb_down.png → templates/static/img/thumb_down.png
File renamed without changes
View
0  media/img/thumb_up.png → templates/static/img/thumb_up.png
File renamed without changes
View
0  media/img/tribubble_legend.png → templates/static/img/tribubble_legend.png
File renamed without changes
View
0  media/img/tribubble_no.png → templates/static/img/tribubble_no.png
File renamed without changes
View
0  media/img/tribubble_partly.png → templates/static/img/tribubble_partly.png
File renamed without changes
View
0  media/img/tribubble_yes.png → templates/static/img/tribubble_yes.png
File renamed without changes
View
0  media/img/up.png → templates/static/img/up.png
File renamed without changes
View
0  media/js/jquery.tablesorter.js → templates/static/js/jquery.tablesorter.js
File renamed without changes
View
0  media/js/jquery.tablesorter.multipagefilter.js → ...s/static/js/jquery.tablesorter.multipagefilter.js
File renamed without changes
View
0  media/js/jquery.tablesorter.pager.js → templates/static/js/jquery.tablesorter.pager.js
File renamed without changes
View
20 templates/table_detail.html
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.