Move static media to static/ and start compiling it.

Review Request #4654 — Created Sept. 27, 2013 and submitted

Information

Djblets
master

Reviewers

Move static media to static/ and start compiling it.

Until now, static media has lived in djblets/media, which didn't match all of
our other codebases. I've moved all the files to djblets/static and set things
up to compile together our various javascript and CSS files.

  • Ran build-media.py and verified that everything got compiled correctly.
  • Used this from Review Board and tested that the dashboard and extensions
    pages still worked and looked correct.
Description From Last Updated

Missing the ".min"

chipx86chipx86

Missing the ".min"

chipx86chipx86

Blank line isn't needed.

chipx86chipx86

admin.css is used for more than extensions. Perhaps this should just be djblets-admin.

chipx86chipx86

I'm not sure this change should be here. A project referencing djblets as a static path would still have the …

chipx86chipx86
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    djblets/settings.py
    Ignored Files:
    djblets/util/templates/js/jquery.html
    djblets/extensions/templates/extensions/extension_list.html
    djblets/siteconfig/templates/siteconfig/settings.html
    djblets/util/templates/js/jquery-ui.html

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    djblets/settings.py
    Ignored Files:
    djblets/util/templates/js/jquery.html
    djblets/extensions/templates/extensions/extension_list.html
    djblets/siteconfig/templates/siteconfig/settings.html
    djblets/util/templates/js/jquery-ui.html

  2. 
      
chipx86
  1. Giving it more thought, I don't think we want to have a single JS and a single CSS deliverable. There's not a lot of overlap in what pages things are on, so we end up just serving more content that the browser has to download and then deal with.

    It's very unlikely that extensions and datagrid will be on the same page, for instance. Given that Djblets is a collection of independent utilities, we should treat the media deliverables the same way, much like we already have. I think the power of having this setup for less/uglifyjs for this is more useful in allowing us to split up some existing files (like jquery.gravy).

    Also, a lot of the files we have today are not meant to play nicely outside of the pages they're already in. extension.js, for instance, assumes certain page elements, and the css files are not very well namespaced.

    So, I'd propose we keep every independent deliverable we have today as an independent deliverable in this new setup. The one exception I'm fine with is merging extensions.css and admin.css.

  2. djblets/settings.py (Diff revision 1)
     
     
    Show all issues

    Missing the ".min"

  3. djblets/settings.py (Diff revision 1)
     
     
    Show all issues

    Missing the ".min"

  4. djblets/settings.py (Diff revision 1)
     
     
     
     
    Show all issues

    Blank line isn't needed.

  5. 
      
david
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    djblets/settings.py
    Ignored Files:
    djblets/util/templates/js/jquery.html
    djblets/extensions/templates/extensions/extension_list.html
    djblets/siteconfig/templates/siteconfig/settings.html
    djblets/util/templates/js/jquery-ui.html

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    djblets/settings.py
    Ignored Files:
    djblets/util/templates/js/jquery.html
    djblets/extensions/templates/extensions/extension_list.html
    djblets/siteconfig/templates/siteconfig/settings.html
    djblets/util/templates/js/jquery-ui.html

  2. 
      
chipx86
  1. 
      
  2. djblets/settings.py (Diff revision 2)
     
     
     
     
     
     
    Show all issues

    admin.css is used for more than extensions. Perhaps this should just be djblets-admin.

  3. djblets/util/templates/js/jquery.html (Diff revision 2)
     
     
    Show all issues

    I'm not sure this change should be here. A project referencing djblets as a static path would still have the "djblets/" prefix, I believe, not "lib/".

    Perhaps this change should be made in RB instead?

    Or maybe it's just time to change these files to point to the Google CDN for jquery.

    1. One thing that isn't clear from the uploaded diff is that I moved jquery and jquery-ui into djblets/static/lib/

    2. Ahh, okay.

      Does Django do the right thing then when looking for {% static "lib/...." %}? How does it know which lib to check?

    3. I guess it depends a lot on how people have configured their static dirs in their settings. Djblets doesn't really prescribe a specific layout, and afaik reviewboard is the only consumer of this. That said, the CDN route is sounding better and better.

  4. 
      
david
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    djblets/settings.py
    Ignored Files:
    djblets/util/templates/js/jquery.html
    djblets/extensions/templates/extensions/extension_list.html
    djblets/siteconfig/templates/siteconfig/settings.html
    djblets/util/templates/js/jquery-ui.html

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    djblets/settings.py
    Ignored Files:
    djblets/util/templates/js/jquery.html
    djblets/extensions/templates/extensions/extension_list.html
    djblets/siteconfig/templates/siteconfig/settings.html
    djblets/util/templates/js/jquery-ui.html

  2. 
      
david
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    djblets/settings.py
    Ignored Files:
    djblets/siteconfig/templates/siteconfig/settings.html
    djblets/media/js/jquery-1.8.2.min.js
    .gitignore
    djblets/media/js/jquery-ui-1.8.24.custom.min.js
    djblets/extensions/templates/extensions/extension_list.html
    djblets/util/templates/js/jquery-ui.html
    djblets/util/templates/js/jquery.html

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    djblets/settings.py
    Ignored Files:
    djblets/siteconfig/templates/siteconfig/settings.html
    djblets/media/js/jquery-1.8.2.min.js
    .gitignore
    djblets/media/js/jquery-ui-1.8.24.custom.min.js
    djblets/extensions/templates/extensions/extension_list.html
    djblets/util/templates/js/jquery-ui.html
    djblets/util/templates/js/jquery.html

  2. 
      
chipx86
  1. Ship It!

  2. 
      
david
Review request changed
Status:
Completed
Change Summary:

Pushed to master (1ccdd82).