Staticfiles #782

Closed
wants to merge 11 commits into
from

Projects

None yet

2 participants

@AdrianRibao
Contributor

I've changed how the static files are served. Now it's using the default django.contrib.staticfiles app ( http://docs.djangoproject.com/en/dev/howto/static-files/ )

I've been testing it in a personal project and everything seems ok, but I'm using just a reduced set of plugins, and I wasn't able to run the tests on my machine.

Feel free to post all the issues you may find.

Regards,

Adrian

AdrianRibao added some commits Apr 18, 2011
@AdrianRibao AdrianRibao Changing the way static files are served. Now is using django v1.3
staticfiles.
e20e81e
@AdrianRibao AdrianRibao Manage CSRF tokens in ajax views 1fa74b4
@AdrianRibao AdrianRibao WYMEditor widget fix 5e0dab8
@AdrianRibao AdrianRibao Corrected Spanish traslation 3fb0d12
@AdrianRibao AdrianRibao Manage CSRF tokens in the toolbar 862f409
@AdrianRibao AdrianRibao Changed settings to run tests 2b0f3e6
@AdrianRibao AdrianRibao Merge remote-tracking branch 'upstream/develop' into staticfiles
Conflicts:
	cms/conf/global_settings.py
	cms/forms/widgets.py
	cms/middleware/toolbar.py
	cms/plugins/flash/templates/cms/plugins/flash.html
	cms/plugins/twitter/cms_plugins.py
	cms/plugins/video/templates/cms/plugins/video.html
	cms/static/cms/js/toolbar.js
	cms/static/cms/plugins/twitter/js/jquery.tweet.js
	cms/templates/admin/cms/page/change_list.html
	cms/templates/admin/cms/page/plugin_forms_ok.html
	cms/templates/cms/toolbar/toolbar.html
ad8b831
@ojii ojii commented on the diff May 2, 2011
cms/conf/global_settings.py
CMS_MEDIA_PATH = 'cms/'
-CMS_MEDIA_ROOT = os.path.join(settings.MEDIA_ROOT, CMS_MEDIA_PATH)
-CMS_MEDIA_URL = os.path.join(settings.MEDIA_URL, CMS_MEDIA_PATH)
@ojii
ojii May 2, 2011 Collaborator

why not turn this into CMS_STATIC_URL etc?

@AdrianRibao
AdrianRibao May 2, 2011 Contributor

Because django 1.3 provides a "standard" way for namig the static content. I think is much more clear the follow the Django path.

CMS_MEDIA_PATH = 'cms/'
-CMS_MEDIA_ROOT = os.path.join(settings.MEDIA_ROOT, CMS_MEDIA_PATH)
-CMS_MEDIA_URL = os.path.join(settings.MEDIA_URL, CMS_MEDIA_PATH)

why not turn this into CMS_STATIC_URL etc?

@ojii
ojii May 2, 2011 Collaborator

fair enough

@ojii ojii commented on the diff May 2, 2011
cms/locale/es/LC_MESSAGES/django.po
@@ -1635,7 +1635,7 @@ msgstr "Mover a %(name)s"
#: templates/cms/toolbar/toolbar.html:34
msgid "Are you sure you want to delete this plugin?"
-msgstr "¿Seguro que desea eliminar este \"plugin\"?"
+msgstr "¿Seguro que desea eliminar este plugin?"
@ojii
ojii May 2, 2011 Collaborator

maybe use single quotes instead of double quotes? Also why is this mixed into the 'static-file' pull request?

@AdrianRibao
AdrianRibao May 2, 2011 Contributor

I'm spanish, I don't know why plugin is surrended in double quotes, Is more correct like this.

I'm sorry for adding this change into this pull-request, I just wanted the pull request to work, If it's not ok you can dismiss it.

@@ -1635,7 +1635,7 @@ msgstr "Mover a %(name)s"

#: templates/cms/toolbar/toolbar.html:34
msgid "Are you sure you want to delete this plugin?"
-msgstr "¿Seguro que desea eliminar este "plugin"?"
+msgstr "¿Seguro que desea eliminar este plugin?"

maybe use single quotes instead of double quotes? Also why is this mixed into the 'static-file' pull request?

@ojii
ojii May 2, 2011 Collaborator

I don't know spanish so if you say it makes sense without quotes, that's fine with me. It would be nicer to have this in another pull request, but leave it if it's too much work.

@ojii ojii commented on the diff May 2, 2011
cms/static/cms/js/plugin_editor.js
@@ -1,5 +1,28 @@
(function($) {
$(document).ready(function() {
+ // Manage Ajax CSRF connectios
+ $('html').ajaxSend(function(event, xhr, settings) {
@ojii
ojii May 2, 2011 Collaborator

what does this do and why doesn't $.fn.cmsPatchCSRF() do this already?

@AdrianRibao
AdrianRibao May 2, 2011 Contributor

I don't know why $.fn.cmsPatchCSRF() is not working. My mistake, I didn't see that function.

@@ -1,5 +1,28 @@
(function($) {
$(document).ready(function() {

  •    // Manage Ajax CSRF connectios
    
  •    $('html').ajaxSend(function(event, xhr, settings) {
    

what does this do and why doesn't $.fn.cmsPatchCSRF() do this already?

@ojii
ojii May 2, 2011 Collaborator

yea but the proper way would be to fix cmsPatchCSRF ;-)

@ojii
Collaborator
ojii commented May 2, 2011

are you sure about the removal of all those js files?

@AdrianRibao
Contributor

There are many issues since the merge with develop, I thought it was working but I made a mistake in the repo. I'm trying to fix everything now.

I hope I have everything fixed soon.

I'm sorry about that.

@ojii
Collaborator
ojii commented May 2, 2011

don't get me wrong, if you delete unused js files that's great, just want to make sure they're not used

@AdrianRibao
Contributor

I'm gonna close this pull request and I'll send you another one when everything is fixed. ok?

@AdrianRibao AdrianRibao closed this May 2, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment