YUI editor for flatpages inside admin interface

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{% extends "admin/change_form.html" %}

{% block extrastyle %}
<link rel="stylesheet" type="text/css"
href="http://yui.yahooapis.com/2.5.1/build/assets/skins/sam/skin.css">
{% endblock %}

{% block extrahead %}
{{ block.super }}
<script type="text/javascript"
src="http://yui.yahooapis.com/2.5.1/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript"
src="http://yui.yahooapis.com/2.5.1/build/element/element-beta.js"></script>
<script type="text/javascript"
src="http://yui.yahooapis.com/2.5.1/build/container/container_core.js"></script>
<script type="text/javascript"
src="http://yui.yahooapis.com/2.5.1/build/menu/menu.js"></script>
<script type="text/javascript"
src="http://yui.yahooapis.com/2.5.1/build/button/button.js"></script>
<script type="text/javascript"
src="http://yui.yahooapis.com/2.5.1/build/editor/editor-beta.js"></script>
{% endblock %}

{% block bodyclass %}{{ block.super }} change-form yui-skin-sam{% endblock %}

{% block after_field_sets %}
<script type="text/javascript">
    var editor = new YAHOO.widget.Editor('id_content', { handleSubmit: true});
    editor.render();
</script>
{% endblock %}

More like this

  1. WTForm (What The Form) by chrj 6 years ago
  2. Overriding Third-party Admin by mattdw 4 years, 8 months ago
  3. S3 static media uploader by phlex 4 years, 5 months ago
  4. YUI Loader as Django middleware by akaihola 5 years ago
  5. YUI Autocomplete by pigletto 5 years, 8 months ago

Comments

Winand (on February 26, 2013):

extrastyle also needs {{block.super}} (otherwise the whole page is broken), though i just moved styles to extrahead. Also "change-form" body class duplicates definition in parent.

#

(Forgotten your password?)