make pandora.json dynamic
This commit is contained in:
parent
24434a73ed
commit
7a01749b66
7 changed files with 22 additions and 5 deletions
6
README
6
README
|
@ -33,3 +33,9 @@ Development:
|
||||||
|
|
||||||
Apache setup:
|
Apache setup:
|
||||||
sudo apt-get install libapache2-mod-wsgi libapache2-mod-xsendfile
|
sudo apt-get install libapache2-mod-wsgi libapache2-mod-xsendfile
|
||||||
|
|
||||||
|
add pandora repository:
|
||||||
|
sudo apt-get install python-software-properties
|
||||||
|
sudo add-apt-repository ppa:j/pandora
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install oxtools mkvtoolnix
|
||||||
|
|
|
@ -32,3 +32,11 @@ def site_js(request):
|
||||||
siteSettings[s.key] = s.value
|
siteSettings[s.key] = s.value
|
||||||
context = RequestContext(request, {'settings':settings, 'pages': pages, 'siteSettings': siteSettings})
|
context = RequestContext(request, {'settings':settings, 'pages': pages, 'siteSettings': siteSettings})
|
||||||
return render_to_response('site.js', context, mimetype="application/javascript")
|
return render_to_response('site.js', context, mimetype="application/javascript")
|
||||||
|
|
||||||
|
def pandora_json(request):
|
||||||
|
siteSettings = {}
|
||||||
|
for s in models.SiteSettings.objects.all():
|
||||||
|
siteSettings[s.key] = s.value
|
||||||
|
context = RequestContext(request, {'settings':settings, 'siteSettings': siteSettings})
|
||||||
|
return render_to_response('pandora.json', context, mimetype="application/javascript")
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import os
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
SITENAME = 'Pandora'
|
SITENAME = 'Pandora'
|
||||||
|
SITEID = 'pandora'
|
||||||
URL = 'pan.do/ra'
|
URL = 'pan.do/ra'
|
||||||
|
|
||||||
PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__))
|
PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__))
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
***/
|
***/
|
||||||
|
|
||||||
var app = new Ox.App({
|
var app = new Ox.App({
|
||||||
config: '/static/json/pandora.json',
|
config: '/pandora.json',
|
||||||
init: 'hello',
|
init: 'hello',
|
||||||
id: 'oxdb',
|
id: site.id,
|
||||||
name: 'OxDB',
|
name: site.name,
|
||||||
requestURL: '/api/'
|
requestURL: '/api/'
|
||||||
}).launch(function(data) {
|
}).launch(function(data) {
|
||||||
Ox.print('data', data)
|
Ox.print('data', data)
|
||||||
|
@ -521,7 +521,7 @@ app.constructList = function(view) {
|
||||||
id: data['id'],
|
id: data['id'],
|
||||||
info: data[info],
|
info: data[info],
|
||||||
title: data.title + (data.director ? ' (' + data.director + ')' : ''),
|
title: data.title + (data.director ? ' (' + data.director + ')' : ''),
|
||||||
url: 'http://0xdb.org/' + data.id + '/poster.' + size + '.' + 'jpg',
|
url: 'http://0xdb.org/' + data.id + '/poster.' + size + '.' + 'jpg', //url: data.poster.url.replace(/.jpg/, size + '.jpg'),
|
||||||
width: data.poster.width || 80 // fixme: remove later
|
width: data.poster.width || 80 // fixme: remove later
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
var site = {};
|
var site = {};
|
||||||
site.url = "{{settings.URL}}";
|
site.url = "{{settings.URL}}";
|
||||||
site.name = "{{settings.SITENAME}}";
|
site.name = "{{settings.SITENAME}}";
|
||||||
|
site.id = "{{settings.SITEID}}";
|
||||||
|
|
||||||
site.pages = {};
|
site.pages = {};
|
||||||
{% for page in pages %}
|
{% for page in pages %}
|
||||||
|
|
|
@ -13,6 +13,7 @@ urlpatterns = patterns('',
|
||||||
(r'^api/', include('backend.urls')),
|
(r'^api/', include('backend.urls')),
|
||||||
(r'^api/upload/$', 'archive.views.firefogg_upload'),
|
(r'^api/upload/$', 'archive.views.firefogg_upload'),
|
||||||
(r'^site.js$', 'app.views.site_js'),
|
(r'^site.js$', 'app.views.site_js'),
|
||||||
|
(r'^pandora.json$', 'app.views.pandora_json'),
|
||||||
(r'^$', 'app.views.intro'),
|
(r'^$', 'app.views.intro'),
|
||||||
(r'^ra$', 'app.views.index'),
|
(r'^ra$', 'app.views.index'),
|
||||||
(r'^r/(?P<key>.*)$', 'oxuser.views.recover'),
|
(r'^r/(?P<key>.*)$', 'oxuser.views.recover'),
|
||||||
|
|
Loading…
Reference in a new issue