forked from 0x2620/pandora
merging changes
This commit is contained in:
commit
277a0991b0
2 changed files with 7 additions and 24 deletions
|
@ -73,9 +73,13 @@ def update_static():
|
||||||
pandora_json = os.path.join(settings.STATIC_ROOT, 'json/pandora.json')
|
pandora_json = os.path.join(settings.STATIC_ROOT, 'json/pandora.json')
|
||||||
for root, folders, files in os.walk(os.path.join(settings.STATIC_ROOT, 'js/pandora')):
|
for root, folders, files in os.walk(os.path.join(settings.STATIC_ROOT, 'js/pandora')):
|
||||||
for f in files:
|
for f in files:
|
||||||
if f.endswith('.js'):
|
if f.endswith('.js') and len(f.split('.')) == 2:
|
||||||
js.append(os.path.join(root, f)[len(settings.STATIC_ROOT)+1:])
|
f = os.path.join(root, f)
|
||||||
with open(os.path.join(root, f)) as j:
|
fsite = f.replace('.js', '.%s.js' % settings.SITENAME)
|
||||||
|
if os.path.exists(fsite):
|
||||||
|
f = fsite
|
||||||
|
js.append(f[len(settings.STATIC_ROOT)+1:])
|
||||||
|
with open(f) as j:
|
||||||
data += j.read() + '\n'
|
data += j.read() + '\n'
|
||||||
|
|
||||||
print 'write', pandora_js
|
print 'write', pandora_js
|
||||||
|
|
|
@ -405,27 +405,6 @@ def get(request):
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
actions.register(get)
|
actions.register(get)
|
||||||
|
|
||||||
def getItem(request):
|
|
||||||
'''
|
|
||||||
param data
|
|
||||||
string id
|
|
||||||
|
|
||||||
return item array
|
|
||||||
'''
|
|
||||||
response = json_response({})
|
|
||||||
itemId = json.loads(request.POST['data'])
|
|
||||||
item = get_object_or_404_json(models.Item, itemId=itemId)
|
|
||||||
if item.access(request.user):
|
|
||||||
info = item.get_json()
|
|
||||||
info['stream'] = item.get_stream()
|
|
||||||
info['layers'] = item.get_layers(request.user)
|
|
||||||
response['data'] = info
|
|
||||||
else:
|
|
||||||
response = json_response(status=403, text='permission denied')
|
|
||||||
return render_to_json_response(response)
|
|
||||||
actions.register(getItem)
|
|
||||||
|
|
||||||
|
|
||||||
@login_required_json
|
@login_required_json
|
||||||
def edit(request):
|
def edit(request):
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Reference in a new issue