ppetrid / yawd-admin

An administration website for Django
Other
138 stars 32 forks source link

Javascript in master is not working #13

Closed volksman closed 11 years ago

volksman commented 11 years ago

It appears something broke the JS in the master branch with Django 1.5. None of the admin js is working. All the js files are being served.

Uncaught ReferenceError: yawdadmin is not defined select2.min.js:488 Uncaught ReferenceError: yawdadmin is not defined localhost:26 Uncaught ReferenceError: yawdadmin is not defined localhost:33 Uncaught ReferenceError: yawdadmin is not defined actions.js:139

ghost commented 11 years ago

please try to refetch the master, this problem came up while updating to the latest bootstrap but I believe it should be ok by now

volksman commented 11 years ago

No change. Pulled, ran collectstatic, restarted service for good measure.

volksman commented 11 years ago

Correction, some of the JS is busted. I can't get popup calendar, auto mass select (checkboxes), help text popovers etc...

ghost commented 11 years ago

weird, I'll have to check this with a fresh project. Is the js error still the same (the "yawdadmin" namespace is unavailable)?

volksman commented 11 years ago

Yes. I'll hopefully have a chance later today to dig deeper as well.

On 13-03-13 12:47 PM, yawd wrote:

weird, I'll have to check this with a fresh project. Is the js error still the same (the "yawdadmin" namespace is unavailable)?

— Reply to this email directly or view it on GitHub https://github.com/yawd/yawd-admin/issues/13#issuecomment-14853271.

volksman commented 11 years ago

Just tried it on a fresh project and same results. Some of the JS is not functional.

ghost commented 11 years ago

I'm afraid i can't reproduce this, even on a fresh virtualenv with a new git clone using the example project. I also made sure the browser does not use cashed versions of js files and it seems ok.

Just a thought: Are you using any template overrides? If yes, note that bootstrap.min.js must always be at the top of the page (right below jquery), since that is where the yawdadmin namespace is defined. If the popovers are not working for you, please check bootstrap.min.js and verify that the following is at the top of the file:

var yawdadmin = {}; yawdadmin.jQuery = jQuery.noConflict(true);

Especially popovers should work because the namespace is defined in the same file! For the other problems, as I said, ensure all js comes after the inclusion of jquery and bootstrap.min.js. Look forward to hearing more on this, or some info on how to reproduce the problem.

volksman commented 11 years ago

I apologize. I must have hit the wrong browser when I tested as my virgin project is working now. So I dug deeper on my other project and it turns out I had already copied bootstrap css and js to my static folder for my app. That explains that.

ghost commented 11 years ago

no problem, glad it's working after all!

Nabu-thinker-ru commented 11 years ago

volksman, I met this problem too. I solved it by moving all yawd's static files into admin folder. Now i have /static/admin/css/bootstrap.css instead /static/css/bootstrap.css and i can use other bootstrap on my site. Maybe it would be useful to apply this changes to the distrib?

ghost commented 11 years ago

hello! We have already moved the yawd-admin static files (bootstrap etc) in a separate directory. Please see this issue https://github.com/yawd/yawd-admin/issues/16. Just make sure you use the latest version from master branch and please do report back if something is still wrong!

Nabu-thinker-ru commented 11 years ago

oh. sorry, i'm used mater version from pip install. 10x