From 94cc95cdfa92ca66dbc1133167df42a4d419ed89 Mon Sep 17 00:00:00 2001 From: Harris Lapiroff Date: Mon, 13 Jun 2011 14:40:06 -0400 Subject: [PATCH] Made the embed widget automatically generate URLs based on the ADMIN_URL global, which is provided by Grappelli. Unfortunately, this introduces a dependency on Grappelli. I'll return to this branch at a later date when my thinking is clearer. --- philo/static/philo/js/EmbedWidget.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/philo/static/philo/js/EmbedWidget.js b/philo/static/philo/js/EmbedWidget.js index 0f972e4..bcb9f5f 100644 --- a/philo/static/philo/js/EmbedWidget.js +++ b/philo/static/philo/js/EmbedWidget.js @@ -94,8 +94,8 @@ object_name = val.split('.')[1]; // generate the url - // TODO: abstract this so it can calculate the admin url dynamically - href=["/admin", app_label, object_name, '?pop=1'].join('/'); + // TODO: Find a better way to get ADMIN_URL. Currently this only works with grappelli, which provides the javascript global ADMIN_URL + href=[ADMIN_URL, app_label, '/', object_name, '/?pop=1'].join(''); // this is a bit hackish. let's walk through it. // TODO: best to write our own template for this in the future -- 2.20.1