Custom Query (1173 matches)
Results (268 - 270 of 1173)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #955 | fixed | Creative Common 4.0 licenses | ||
| Description |
Upgrade to Creative Commons 4.0 license? |
|||
| #605 | invalid | Cross-instance collections/galleries (think Flickr pool) | ||
| Description |
source : http://mediagoblin.org/news/fsws-2012-wrap-up.html |
|||
| #625 | wontfix | Custom CSS/JS list in the ini | ||
| Description |
I needed a simple way to add and order JS and CSS, so instead of having them hard coded in "base.html" I made a list in the ini that is "foreached" in the template above. Here's how this work : in mediagoblin.ini, I've added three sections (css_files, js_header_files, js_footer_files (and allow me to stress the importance of footer js)) : It look like this : [js_header_files] files = """ /js/extlib/jquery.js /js/header_dropdown.js """ the """/""" allow multiple lines statements cause I want to be able to move lines up and down easily. "file_1="/"file_N=" is error prone and comma lists are unreadable. In tools/templates.py I treat the data and send them as templates' context : context['js_header_files'] = mg_globals.global_config.get('js_header_files', {})['files'].split()
And finally in "template/base.html", I display the data : {% for js_header_file in js_header_files %}
{% set js_header_file = request.staticdirect(js_header_file) %}
<script src="{{js_header_file}}"></script>
{% endfor %}
Smooth and easy. |
|||
